Open-source WHO DQR-style data quality checks at scale: DHIS2 → data lake → PySpark (feedback welcome)

Hi everyone,

I’ve been building an open-source project that runs WHO Data Quality Review–style checks on DHIS2 aggregate data outside DHIS2, so they can run at scale on a schedule and feed other tools. I’d love feedback from this community.

How it works

  • Extracts data values and metadata through the Web API (dataValueSets, in dataset × district × month chunks, resumable)
  • Stores the raw responses in an S3-compatible data lake, then builds clean tables with PySpark (bronze → silver → gold)
  • Builds a reporting grid with one row per expected report (assigned, open facilities), so missing reports are counted rather than invisible
  • Runs 13 checks across the WHO DQR dimensions:
    • Completeness: never-reporting facilities; facilities below 80%
    • Outliers: ±3 SD from the facility’s own mean, plus a modified z-score (median/MAD) that isn’t fooled by the outliers it’s looking for
    • Internal consistency: negative Penta1→Penta3 and ANC1→ANC4 drop-out per facility-year; OPV1/Penta1 ratio vs national
    • Consistency over time: district totals vs the mean of previous years, compared on the same months
    • System checks: values identical to the same month 1–2 years earlier; repeated values; lastUpdated before created; data entered before the period ended; datasets assigned to non-facility org units; facilities without coordinates
  • Scores each facility and district from 0–100 per dimension, where each score is “100 × (1 − share of data affected)”, so it can be explained from counts

Running it on the play demo database (2.43)
Over ~1M values, 1,169 facilities, Jan 2023 – Sep 2026, the checks flag, for example:

  • Child Health completeness of 18% (assigned to 1,161 facilities, ~237 report)
  • 69–92% of facility values identical to the same month one or two years earlier
  • all received reports with entry dates before their period ended
  • the national org unit assigned to datasets alongside facilities

These are almost certainly artefacts of how the demo data is generated, not real-world findings, but they show the kinds of patterns the checks are built to catch. A guided notebook traces one facility from the raw API response to its score.

How it relates to the WHO Data Quality Tool: it doesn’t replace the app. It’s meant for running checks outside DHIS2, across many datasets, on a schedule, with results others can query.

Questions for the community

  1. Which checks do you rely on most in real implementations, and what’s missing here?
  2. Are the default thresholds (80% completeness, ±3 SD, ±33% over time, ±10% ratio) the ones you use in practice?
  3. Have you seen “copied from an earlier year” patterns in real data, and how do you handle them?
  4. Would anyone be interested in trying it against a non-demo instance? Everything is configured through environment variables.

Code, README and notebook: GitHub - Ghentlesteve/hmis-dq-platform: HMIS data quality & early-warning platform: DHIS2 → S3 data lake → PySpark → WHO DQR checks and scores · GitHub

Next up: forecasting with honest baselines, anomaly detection, and a map dashboard.

Personal project, built on the public demo server; not affiliated with or endorsed by any organisation.


2 Likes

We will try it out and give you feedback :slightly_smiling_face:

1 Like