Skip to main content
TECHNICAL COMPARISON & REFERENCE

HL7 v2.x Segment Reference Guide for Clinical Interfacing

Complete technical reference guide for HL7 MSH, PID, PV1, ORC, OBR, OBX, and MSA segments used in laboratory instrument interfacing.

HL7 v2.x Segment Reference Guide for Laboratory Engineers

Health Level Seven (HL7) Version 2.x is the foundational messaging standard for healthcare interoperability. Below is the complete segment specification used by clinical analyzer interfaces and hospital information systems (HIS).

Segment Segment Name Key Fields & Structure Usage
MSH Message Header MSH-3 (Sending App), MSH-7 (Timestamp), MSH-9 (Message Type) Mandatory First Segment
PID Patient Identification PID-3 (Patient ID), PID-5 (Name), PID-7 (DOB), PID-8 (Gender) Patient Demographics
PV1 Patient Visit PV1-2 (Patient Class: I/O/E), PV1-3 (Assigned Location), PV1-7 (Attending Doctor) Encounter Data
ORC Common Order ORC-1 (Order Control: NW/OK/RE), ORC-2 (Placer Order #), ORC-3 (Filler Order #) Order Status Management
OBR Observation Request OBR-4 (Universal Service ID), OBR-7 (Observation Date/Time), OBR-16 (Ordering Provider) Test Battery Header
OBX Observation / Result OBX-3 (Observation Identifier), OBX-5 (Value), OBX-6 (Units), OBX-8 (Abnormal Flag: H/L/N) Test Parameter Result
NTE Notes and Comments NTE-3 (Comment Text) Pathologist Clinical Notes

Real-World HL7 v2.5 Message Wire Frames

Below is a standard ORU^R01 (Observation Result Unsolicited) message stream emitted by automated clinical chemistry and hematology analyzers over MLLP TCP sockets:

MSH|^~&|MINDRAY_BC5380|CENTRAL_LAB|AILS_LIMS|HOSPITAL|20260816103000||ORU^R01|MSG000102|P|2.5
PID|1||PAT994820||DOE^JOHN||19850412|M
PV1|1|O|CLINIC_ROOM_3||||DR_SMITH
ORC|RE|ORD-20260816-01|FIL-88392||IP||||20260816102500
OBR|1|ORD-20260816-01|FIL-88392|CBC^Complete Blood Count^LOINC|||20260816102800|||||||||||||||||F
OBX|1|NM|6690-2^WBC^LN||7.8|10*3/uL|4.0-11.0|N|||F|||20260816102900
OBX|2|NM|789-8^RBC^LN||4.92|10*6/uL|4.30-5.90|N|||F|||20260816102900
OBX|3|NM|718-7^Hemoglobin^LN||15.1|g/dL|13.5-17.5|N|||F|||20260816102900
OBX|4|NM|777-3^Platelets^LN||245|10*3/uL|150-450|N|||F|||20260816102900
NTE|1|L|Specimen non-hemolyzed. Normal morphological profile.

Biomedical Troubleshooting: Common HL7 Parsing Errors

Missing MLLP Wrapper (0x0B / 0x1C)

If the receiving daemon does not strip 0x0B (VT) and 0x1C (FS) bytes, standard JSON parsers will fail with framing syntax errors.

Field Separator Escape Clashes

Ensure text comments in NTE-3 escape pipe characters (|) as F to avoid truncating following fields.

Need Help Interfacing Your Laboratory Instruments?

Our biomedical engineering team can assist with HL7 message parsing, MLLP framing, and TCP socket configuration.