units/unit_conversions.json currently stores only multiplicative conversion factors (target = factor × source). This works for most analytes but cannot represent affine conversions of the form target = factor × source + offset.
Known cases that need affine conversions
- HbA1c:
IFCC [mmol/mol] = (NGSP [%] − 2.152) / 0.0915 (derived from the NGSP-IFCC master equation, see concept set 184).
- Temperature: Fahrenheit ↔ Celsius (
°F = 9/5 × °C + 32).
For HbA1c, the conversion is currently documented in the concept set description and must be applied manually in downstream code.
Proposed change
Add an optional offset field to each conversion entry. When absent or 0, the conversion remains purely multiplicative — so the 372 existing entries are unaffected.
{
"conceptId": 3004410,
"sourceUnitConceptId": 8554,
"sourceUnitCode": "%",
"conversionFactor": 10.929,
"offset": -23.52,
"targetUnitConceptId": 9579,
"targetUnitCode": "mmol/mol",
...
}
target = factor × source + offset
units/unit_conversions.jsoncurrently stores only multiplicative conversion factors (target = factor × source). This works for most analytes but cannot represent affine conversions of the formtarget = factor × source + offset.Known cases that need affine conversions
IFCC [mmol/mol] = (NGSP [%] − 2.152) / 0.0915(derived from the NGSP-IFCC master equation, see concept set 184).°F = 9/5 × °C + 32).For HbA1c, the conversion is currently documented in the concept set description and must be applied manually in downstream code.
Proposed change
Add an optional
offsetfield to each conversion entry. When absent or0, the conversion remains purely multiplicative — so the 372 existing entries are unaffected.{ "conceptId": 3004410, "sourceUnitConceptId": 8554, "sourceUnitCode": "%", "conversionFactor": 10.929, "offset": -23.52, "targetUnitConceptId": 9579, "targetUnitCode": "mmol/mol", ... }target = factor × source + offset