UCUM units
One unambiguous code for every unit of measure — because mg/dL vs mmol/L confusion is a patient-safety issue, not a formatting nit.
In one line
UCUM (Unified Code for Units of Measure) defines machine-readable codes for units —
mg/dL, mmol/L, mm[Hg], kg/m2 — so software can validate, convert and compare
quantities instead of guessing from free text.
Why a unit needs a code at all
A number without a trustworthy unit is not data — it's a hazard. "Glucose 100" is reassuring in mg/dL and a medical emergency in mmol/L (≈ 1800 mg/dL). Humans disambiguate from context; software cannot, unless the unit is carried in a form it can parse. Free-text units ("mg per deciliter", "mg/dl", "MG/DL") defeat that. UCUM gives each unit exactly one canonical, machine-parseable code, so a value travels with an unambiguous meaning.
A grammar, not a list
The clever part: UCUM doesn't enumerate every unit, it defines a grammar that composes them from a small set of base units. That means even rare or compound units are expressible and still computable:
- Algebraic composition —
mg/dL,mL/min/{1.73_m2}(eGFR),ug/(kg.min)(infusion rate). - Prefixes —
k,m,u,nattach to base units (mmol= millimole). - Bracketed special units — non-metric or customary units wear square brackets:
mm[Hg](blood pressure),[iU](international unit),[degF]. - Annotations — descriptive, non-semantic text in braces:
{breaths}/min,{cells}/uL.
Because each code is parseable, a system can check that two units are commensurable (both pressures, both concentrations) and convert between them automatically.
Case sensitivity — the trap
UCUM is case-sensitive by design, and this catches people: mg is milligram but Mg is
megagram; m is metre but M is mega; s is second but S is siemens. Lowercasing or
upper-casing a unit string "to normalise it" silently corrupts the data. Carry UCUM codes
verbatim.
Where it shows up in digital health
- FHIR —
Observation.valueQuantity.code(andQuantityeverywhere) is bound to UCUM, with the unit's display inunitand the system fixed tohttp://unitsofmeasure.org. - LOINC — every LOINC term's example units are expressed in UCUM, so LOINC and UCUM are used together: LOINC names the test, UCUM names the unit of its result.
- Devices — IEEE 11073 MDC device units map to UCUM, so a connected monitor's readings arrive in a known unit.
- Cross-border exchange — any lab or registry sharing quantities across systems relies on UCUM to make conversion safe.
Common pitfalls
- Normalising case — the single most dangerous "cleanup"; never do it.
- Storing the display string as the code — "mg/dL" the label is for humans; the UCUM code is what software must key on.
- Dropping the unit on import — a value with no unit, or a defaulted unit, is worse than no value, because it looks usable.
- Confusing mass and molar — mg/dL ↔ mmol/L conversion needs the molar mass; UCUM enables the check but the clinical factor is yours to get right.
Key takeaways
- UCUM makes units computable: validate, convert, compare — not guess.
- It's a grammar, so any compound unit is expressible and still machine-readable.
- Case matters; carry codes verbatim.
- The cautionary tale: glucose in mg/dL read as mmol/L is an ~18-fold error. Units are clinical data — treat them with the same rigour as the value itself.
Check your recall
0 of 2 recalledActive recall beats re-reading — try to answer, then reveal.
Why does a measured value need a machine-readable unit code like UCUM?
Why is UCUM case-sensitive, and why does that matter clinically?
References
Related entries
SNOMED CT®, LOINC®, ICD and other terminologies are the property of their respective owners and are shown for education under their licences. Licences & attributions