Data Quality Assessment of HIV EHRs for Trustworthy AI (Zambia): analysis code
Joe Phiri, Aaron Zimba, Chiyaba Njovu, Andrew Kashoka, Innocent Chiboma, Mulenga Chiwele, Trevor Sinkala, Jacob Mutale, Mwansa Lumpa
Analysis code for the study "A Multi-Facility Data Quality Assessment of Electronic Health Records for Trustworthy AI in HIV Public Health in Zambia" (Discover Artificial Intelligence, under review). This deposit contains a Jupyter notebook (ML_AI_EHR.ipynb) and a helper module (dqa__additions.py) that implement an eight-dimension data quality assessment of Zambia's national SmartCare HIV electronic health record system, using an active machine-learning pipeline as a diagnostic instrument. The code reproduces every table and figure in the manuscript and supplementary materials, including the feature-importance, observed-versus-missing, and missingness-mechanism analyses (Supplementary Tables S9-S11). The assessment covers 246,053 patient registrations across six public health facilities in Lusaka, and evaluates three 12-month outcomes: recorded TB treatment, programme-recorded interruption in treatment, and recorded unsuppressed viral load, using a facility-level holdout design. The patient-level datasets are NOT included and are not publicly available. They contain sensitive health information governed by Ministry of Health, Zambia data-governance policies, and may be requested from the corresponding author with explicit Ministry of Health permission. The code is released so that any team holding equivalently structured SmartCare exports can reproduce the full assessment. See the README for input-data layout and run instructions.