
Project
R-Based Laboratory Turnaround Time Audit and Timestamp Data Quality Assessment for Accident and Emergency Samples at Kenyatta National Hospital
This project comprises a retrospective audit of laboratory sample turnaround times for Accident and Emergency department specimens at Kenyatta National Hospital for June 2025. The work was conducted using data exported from the REDCap electronic data capture system and fully processed in R and RStudio. The primary aims were to quantify stagewise and overall turnaround times where complete timestamps existed, to characterize the distribution of those times against conventional benchmarks, and to systematically document the extent and nature of missing or implausible timestamp data that limit reliable performance measurement. The analysis began with a cleaned dataset of 190 records. Key datetime fields were parsed robustly across multiple formats using the lubridate package, variable names were standardized to lowercase snake_case with janitor, and a set of interval variables was derived in minutes: request to sample collection, sample collection to laboratory registration, registration to result readiness, result readiness to dispatch, and the overall request to dispatch interval. Records lacking the necessary pair of timestamps for any given interval were excluded from that specific calculation, and extreme or negative values were flagged for quality review. Results revealed severe incompleteness of the source data. Only 11 of the 190 records possessed a complete set of timestamps permitting computation of overall request to dispatch turnaround time. Critical fields such as request time and sample obtained time were missing in more than 85 percent of records. Among the 11 complete cases the median overall turnaround time was 105.63 minutes, with a mean of 120.23 minutes and an interquartile range of 92.35 to 132.97 minutes. None of these records met a 60 minute threshold, 72.7 percent met a 120 minute threshold, and all met a 240 minute threshold. Stagewise medians where calculable were 29 minutes for sample to registration, approximately 44 minutes for registration to result, and 13 minutes for result to dispatch; however, these estimates rested on small numbers of observations and were accompanied by extreme outliers, including negative intervals and values exceeding 10 000 minutes, indicating clear data entry errors. Subgroup summaries by patient type and priority flag were produced but remained descriptive only, given the limited sample of complete records. The dominant finding of the audit was therefore not laboratory processing speed in isolation but the profound data quality barriers that prevent continuous, facility level monitoring of turnaround time. High rates of missingness, inconsistent recording practices, and implausible values undermine both the accuracy of calculated intervals and the ability to distinguish genuine operational delays from artifacts of incomplete capture. The project concludes with a set of prioritized, actionable recommendations: enforcement of mandatory timestamp fields at the point of data entry, real time validation rules to reject future dates, negative intervals and format inconsistencies, targeted cleaning of existing extreme values, staff training on consistent timestamp ownership, formal definition of institutional turnaround time targets, and the eventual development of an ongoing monitoring dashboard once data integrity improves. Limitations are explicitly acknowledged, principally the non representative nature of the complete case subset and the presence of residual entry errors requiring manual verification. Taken together, the work demonstrates rigorous application of data cleaning, interval calculation, descriptive statistical summarization, and quality assessment methods in a real world clinical laboratory setting. It supplies both a transparent baseline for the limited number of complete records and a clear roadmap for establishing a reliable, continuous turnaround time surveillance system within the Accident and Emergency laboratory workflow.
Resources