dhis3/go
craftclinical-safetyDHIS2

The Number That Moved

In the version 42.7 release of DHIS2, a small change landed in three program-rule functions that calculate child nutrition z-scores. The change is correct, is quiet, and affects nothing that is not already measured. This post is about what happens to the records calculated under the old functions, and who inside a ministry carries the knowledge that two different versions of the same number can exist for the same child.

What a z-score is for

A child's weight at any given moment is only interesting against the backdrop of what a healthy child of the same age and sex typically weighs. The World Health Organization's standard answer to that comparison is the z-score: how many standard deviations above or below the reference-population median this particular child's measurement sits. The WHO Child Growth Standards publish the reference curves (median and standard deviations by age, by sex) up to 60 months, and the WHO Growth Reference 2007 extends them for school-age children and adolescents.

In a tracker-based nutrition programme, the z-score is not a decoration. A child whose weight-for-age sits below minus two standard deviations is flagged as moderately underweight; below minus three, severely underweight. A programme will often attach an automatic intervention trigger to those thresholds: a referral, a supplementary feeding enrolment, a notification to the clinic supervisor. The z-score is the point at which a child's measurement crosses from a number into a decision.

The specific change

Three program-rule functions were updated: d2:zScoreWFA (weight-for-age), d2:zScoreHFA (height-for-age), and d2:zScoreWFH (weight-for-height). The pre-42.7 implementation produced z-scores that did not always match WHO Anthro (the WHO's own reference desktop application) past the second decimal place; occasionally the discrepancy was wider for extreme values beyond plus or minus three standard deviations. The new implementation uses the WHO LMS method with interpolation for any height, and the published release note states the output now matches WHO Anthro to two decimal places including those extreme values.

Height-for-age coverage was also extended. The pre-42.7 band ended at 60 months (five years); the new band runs from 0 to 228 months (0 to 19 years), using the WHO Growth Reference 2007 for the school-age extension. Nutrition programmes that work in school-age children and adolescents now have a reference-population denominator the function can compute against.

The fix is in DHIS2 core version 42.7. Patches for the 41.x and 43.x lines are described as "coming." The server-side change is also mirrored in the Capture Web App so that z-scores computed in the browser at data entry time use the same method the server will use.

What the fix does not do

The release note is explicit, in the way a careful engineering communication is explicit: prior results from these functions in earlier versions may not match WHO Anthro output. The fix is forward-only. A child measured in 2024 whose z-score was computed as minus one point nine seven does not get a new z-score; the record stands at minus one point nine seven. The identical measurement, run through 42.7, might come out at minus two point zero one. Minus one point nine seven does not trigger a moderately-underweight flag. Minus two point zero one does.

This is the whole post, really: a single child's record, calculated under the old functions, that would have been calculated differently if it had been entered three months later. The record is not wrong. It was calculated correctly, by the software of its time, under the specification of its time. It is simply calculated to a different method than the one that will be applied to the child's next visit.

The ministry's question

Nothing in the 42.7 release note tells a Ministry of Health what to do about its historical nutrition records. Nothing could. The policy answer belongs to each ministry and is a difficult one. The options span a spectrum. At one end, a ministry can leave the historical records alone on the explicit footing that the records represent a particular measurement interpreted through a particular method on a particular date, and that comparability across dates is already imperfect for reasons older than this z-score fix. At the other end, a ministry can run the fixed functions over the stored measurement values, store the recomputed z-scores alongside the old ones, and flag any records whose moderately- or severely-underweight classification changed under the new method. The policy choice has operational consequences: a child whose records are now flagged as moderately underweight, where they were not before, may need a clinical follow-up.

The point to attend to is that neither option is what the engineering fix accomplished. The fix corrected the function. The question of what to do with the records belongs to a different conversation and a different kind of expertise.

What this means for the port

The DHIS3/go port, at the time of writing, has not yet reached the program-rules engine. The engine is one of the surfaces the port will have to reimplement with special care. A z-score function implemented in the Go port is not a UX decision or a performance decision; it is a specification decision whose output a clinician will treat as medically meaningful. The parity harness that currently diffs the port against stock DHIS2 on metadata reads will, when it reaches the rules-engine surface, be checking that d2:zScoreWFA applied to the same inputs produces the same outputs to the same decimal places, under the same WHO reference curves, on the same age bands. Any divergence will be a safety issue, not a styling one.

The pattern this release surfaces (silent correction of a safety-critical calculation, with no automatic retroactive fix on historical records) will almost certainly recur in the port's rules-engine phase. The port's job will be to implement the correct method, and to make the specification of which method is correct, under which version, on which date explicit enough that the ministries using the port can audit their own records against it.

A z-score is a number only in the sense that a prescription is a number. What matters is the decision the number triggers, and the record of the decision made under the number that was computed at the time.