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:
Biomedical Troubleshooting: Common HL7 Parsing Errors
If the receiving daemon does not strip 0x0B (VT) and 0x1C (FS) bytes, standard JSON parsers will fail with framing syntax errors.
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.