Skip to content

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.

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.

A LOINC code is a sentence, not a label. Six axes say what was measured, how, on what, and on what scale. Mapping a local test code means matching all of them, which is why two tests with the same name can need two different codes.

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.

CodeMeaning
718-7Hemoglobin [Mass/volume] in Blood
4548-4Hemoglobin A1c/Hemoglobin.total in Blood
6690-2Leukocytes [#/volume] in Blood by Automated count
2160-0Creatinine [Mass/volume] in Serum or Plasma
2951-2Sodium [Moles/volume] in Serum or Plasma
8867-4Heart rate
8480-6Systolic blood pressure
29463-7Body weight

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|||F
OBX|2|NM|6690-2^Leukocytes [#/volume] in Blood by Automated count^LN||7.2|10*3/uL|4.5-11.0|N|||F
OBX|3|NM|2160-0^Creatinine [Mass/volume] in Serum or Plasma^LN||0.9|mg/dL|0.60-1.30|N|||F

LN 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|||F

The 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.

These are not competitors; they answer different questions about the same result.

Code systemAnswersExample
LOINCWhat was measured?718-7 Hemoglobin in blood
SNOMED CTWhat was found?271737000 Anemia
UCUMIn what units?g/dL
CPT / HCPCSWhat gets billed?85018 Hemoglobin
ICD-10-CMWhat 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 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 (POSITIVE in a Qn code) will fail validation downstream and may be filed as a number of zero.
  • Dropping the coding system. 718-7 with no LN is 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 MCnc code can arrive in g/dL or g/L, and OBX-6 is what says which.