Reference·HL7 v2·OBX
HL7 v2 Reference

How to Test HL7 v2 OBX: A Field-by-Field Breakdown

Jul 27, 2026 · 6 min read

OBX is the segment that carries the actual result — a lab value, a vital sign, a coded finding — and it repeats as many times as a message has observations, sometimes dozens per ORU. Get OBX-2 wrong and every OBX-5 value that follows it gets parsed against the wrong data type, which corrupts results without throwing a single error.

Quick answer

OBX (Observation/Result) is the HL7 v2 segment that carries a single observation result — its identifier, type, value, units, and reference range — and typically repeats multiple times within an ORU or ORU-style message, one OBX per result.

The fields that actually matter in practice

OBX-1 →
Set ID — numbers each repeating OBX within the message, starting at 1
OBX-2 →
Value Type — declares how OBX-5 must be parsed — NM, ST, CE, TX, and more
OBX-3 →
Observation Identifier — the coded test name — usually a LOINC code plus text
OBX-5 →
Observation Value — the actual result — its format depends entirely on OBX-2
OBX-6 →
Units — the unit of measure for numeric results, often UCUM-coded
OBX-7 →
Reference Range — the normal range used to flag a result as abnormal
OBX-8 →
Abnormal Flags — L/H/LL/HH/N — the coded flag most result-review screens key off of
OBX-11 →
Observation Result Status — P/F/C/etc. — distinguishes preliminary results from final ones

Example

Synthetic example Generated by Synthibase
OBX|1|NM|2823-3^Potassium^LN||4.2|mmol/L|3.5-5.1|N|||F|||202607261430

A synthetic potassium lab result — normal value, normal flag, finalized status. Synthetic result — not a real patient.

Where this trips people up

Teams frequently build and test their OBX parser against numeric (NM) results only, since labs are the most common source of test messages. Then a coded observation (CE) or free-text narrative (TX) result arrives — say, a pathology impression or a microbiology susceptibility panel — and the parser tries to run numeric comparisons against a string, either crashing or silently coercing the value into something meaningless. OBX-2 has to be checked before OBX-5 is ever touched, every single time.

Healthcare API Testing Guide: FHIR and X12
How to Write EDI Test Cases That Actually Catch Go-Live Failures
Generate synthetic OBX segments in seconds
Synthibase generates realistic HL7 v2 result messages with fully populated OBX segments — every value type, every abnormal flag, zero PHI.
Start free trial →
This page is written independently by Synthibase for testing and informational purposes. It is not an official publication of HL7 International or X12/Washington Publishing Company, and is not a substitute for reviewing the official standard or your trading partner's companion guide. See our Terms of Service for full legal terms.