HL7 OBX → FHIR Observation
The OBX (observation/result) segment becomes a FHIR R4 Observation. The tricky part is OBX-5: its FHIR value[x] type is chosen from the OBX-2 value type, and the reference range and abnormal flags have dedicated FHIR homes most converters drop.
An HL7 OBX segment maps to a FHIR Observation: OBX-3→code, OBX-5→value[x] (the type is driven by OBX-2 — NM→valueQuantity, ST/TX→valueString, CE/CWE→valueCodeableConcept, DT/TS→valueDateTime), OBX-6→units, OBX-7→referenceRange, OBX-8→interpretation, OBX-11→status.
Field-by-field
| HL7 field | FHIR path | Notes |
|---|---|---|
| OBX-2 | Observation.value[x] type | Value type: NM→valueQuantity, ST/TX/FT→valueString, CE/CWE→valueCodeableConcept, DT/TS→valueDateTime, SN→Quantity/Range/Ratio. |
| OBX-3 | Observation.code | The observation identifier (usually LOINC). Required 1..1. |
| OBX-5 | Observation.value[x] | The result value, in the type chosen by OBX-2. |
| OBX-6 | Observation.valueQuantity.unit | Units of measure for a numeric result. |
| OBX-7 | Observation.referenceRange | Normal range (e.g. 4.0-5.6, <120) → low / high SimpleQuantity + text. |
| OBX-8 | Observation.interpretation | Abnormal flags (H, L, HH, A…) → v3-ObservationInterpretation; unknown codes preserved verbatim. |
| OBX-11 | Observation.status | Result status: F→final, P→preliminary, C→corrected, X→cancelled. |
| OBX-14 | Observation.effectiveDateTime | Observation date/time (date-only kept when no timezone is given). |
| NTE (after OBX) | Observation.note | A trailing note segment annotates the Observation it follows. |
Live example
This is produced by the actual converter — paste your own message and it runs the same way, entirely in your browser.
MSH|^~\&|LAB|RIVERSIDE|ZK|MERIDIAN|20240101103000||ORU^R01|MSG1|P|2.5.1 PID|1||MRN123^^^HOSP^MR||DOE^JANE||19850312|F OBR|1||ORD9|24323-8^Comprehensive metabolic panel^LN OBX|1|NM|2345-7^Glucose^LN||105|mg/dL|70-99|H|||F NTE|1||Fasting specimen
{
"resourceType": "Observation",
"id": "observation-1",
"status": "final",
"category": [
{
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/observation-category",
"code": "laboratory",
"display": "Laboratory"
}
]
}
],
"code": {
"coding": [
{
"system": "http://loinc.org",
"code": "2345-7",
"display": "Glucose"
},
{
"system": "http://loinc.org",
"code": "2339-0",
"display": "Glucose"
}
],
"text": "Glucose"
},
"subject": {
"reference": "urn:uuid:00000000-0000-4000-8000-000000000001"
},
"valueQuantity": {
"value": 105,
"unit": "mg/dL",
"system": "http://unitsofmeasure.org",
"code": "mg/dL"
},
"interpretation": [
{
"coding": [
{
"code": "H",
"system": "http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation",
"display": "High"
}
],
"text": "High"
}
],
"referenceRange": [
{
"low": {
"value": 70,
"unit": "mg/dL",
"system": "http://unitsofmeasure.org",
"code": "mg/dL"
},
"high": {
"value": 99,
"unit": "mg/dL",
"system": "http://unitsofmeasure.org",
"code": "mg/dL"
},
"text": "70-99"
}
],
"note": [
{
"text": "Fasting specimen"
}
]
}Nothing needed review for this message
Every populated field above was mapped. When a field can’t be mapped, it appears here instead of being dropped — that’s the guarantee.
Related mappings
Zkeleton builds conversion and data infrastructure for healthcare. This converter is free, runs entirely in your browser, and never sends a message anywhere — we keep it open because clean data plumbing should be a commodity, not a toll.