How to Test HL7 v2 OBX: A Field-by-Field Breakdown
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.
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
Example
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.