LOINC Codes: What They Are and How HL7 Uses Them
LOINC (Logical Observation Identifiers Names and Codes) is a universal code system for things that get observed and measured: lab tests, vital signs, imaging studies, survey instruments. It is maintained by the Regenstrief Institute and is free to use.
Its job is to let two systems agree on what a result is. A hospital calls a
test HGB, a reference lab calls it HB, an analyzer calls it HEMOGLOBIN-WB.
All three mean LOINC 718-7, and once they say so, the receiving system can
file the result without knowing any of their local vocabularies.
How to read a LOINC code
Section titled “How to read a LOINC code”A LOINC code looks arbitrary and is not. Every code is a point in a six-dimensional space, and the axes are what make two similar-sounding tests distinguishable.
The practical consequence is that “hemoglobin” is not a mapping. Hemoglobin in whole blood, hemoglobin A1c as a fraction of total hemoglobin, and hemoglobin measured in urine are three different codes, because they differ on Component, Property and System respectively.
| Code | Meaning |
|---|---|
718-7 | Hemoglobin [Mass/volume] in Blood |
4548-4 | Hemoglobin A1c/Hemoglobin.total in Blood |
6690-2 | Leukocytes [#/volume] in Blood by Automated count |
2160-0 | Creatinine [Mass/volume] in Serum or Plasma |
2951-2 | Sodium [Moles/volume] in Serum or Plasma |
8867-4 | Heart rate |
8480-6 | Systolic blood pressure |
29463-7 | Body weight |
Where LOINC appears in an HL7 message
Section titled “Where LOINC appears in an HL7 message”LOINC lives in OBX-3, the observation identifier, and identifies what the value in OBX-5 is a measurement of. The coded element carries the code, its display text and the coding system name:
OBX|1|NM|718-7^Hemoglobin [Mass/volume] in Blood^LN||13.8|g/dL|12.0-16.0|N|||FOBX|2|NM|6690-2^Leukocytes [#/volume] in Blood by Automated count^LN||7.2|10*3/uL|4.5-11.0|N|||FOBX|3|NM|2160-0^Creatinine [Mass/volume] in Serum or Plasma^LN||0.9|mg/dL|0.60-1.30|N|||FLN is the HL7 coding-system identifier for LOINC, and it is not optional: a
bare code with no system is ambiguous, because the same digits mean something
else in another code set.
Many production interfaces send both the local code and the LOINC code, using the alternate-identifier components of the coded element:
OBX|1|NM|HGB^HEMOGLOBIN^L^718-7^Hemoglobin [Mass/volume] in Blood^LN||13.8|g/dL|12.0-16.0|N|||FThe first triplet is the sender’s local code, the second is the LOINC equivalent. Receivers that understand LOINC use the second; receivers that were built against the sender’s vocabulary keep working off the first. The OBX segment reference covers the rest of the segment, and the HL7 data types reference covers the coded-element structure itself.
LOINC, SNOMED CT, and the rest
Section titled “LOINC, SNOMED CT, and the rest”These are not competitors; they answer different questions about the same result.
| Code system | Answers | Example |
|---|---|---|
| LOINC | What was measured? | 718-7 Hemoglobin in blood |
| SNOMED CT | What was found? | 271737000 Anemia |
| UCUM | In what units? | g/dL |
| CPT / HCPCS | What gets billed? | 85018 Hemoglobin |
| ICD-10-CM | What is the diagnosis? | D64.9 Anemia, unspecified |
A single lab result commonly carries three of these at once: LOINC in OBX-3, UCUM in OBX-6, and a SNOMED code in OBX-5 when the result is a finding rather than a number.
Mapping mistakes that break results
Section titled “Mapping mistakes that break results”- Mapping on the test name. Names are local and ambiguous. Map on the six axes, and treat a name match with a System mismatch as a non-match.
- Ignoring the Scale axis. A quantitative code with an ordinal result
(
POSITIVEin aQncode) will fail validation downstream and may be filed as a number of zero. - Dropping the coding system.
718-7with noLNis not a LOINC code as far as a strict receiver is concerned. - Mapping panels to members, or the reverse. A CBC panel has its own code
(
58410-2); the individual analytes have theirs. Sending the panel code on a member result collapses six results into one. - Assuming the units follow the code. LOINC fixes the Property, not the
unit. A
MCnccode can arrive ing/dLorg/L, and OBX-6 is what says which.
Related resources
Section titled “Related resources”- OBX segment reference, where LOINC codes are carried
- ORU message reference, the message that delivers results
- HL7 data types for the coded-element structure
- LIS and LIMS integration for compendium mapping at scale