HL7 v2 Segment Reference
An HL7 segment is a single line within an HL7 v2 message, starting with a three-character identifier (MSH, PID, PV1, etc.) followed by pipe-delimited fields containing clinical, administrative, or financial data. Segments are the building blocks of every HL7 message.
Segment Structure
Section titled “Segment Structure”Every segment follows the same format:
SEG|Field1|Field2|Field3|...- Segment ID: Three uppercase letters (MSH, PID, OBX, etc.)
- Field separator: Pipe character
|between fields - Components: Caret
^separates components within a field - Repetitions: Tilde
~separates repeated values - Empty fields: Consecutive pipes
||indicate an empty field
See our Data Types reference for detailed component structure.
Message Header
Section titled “Message Header”Patient Segments
Section titled “Patient Segments”Segments that identify the patient and their associated parties.
Visit & Event Segments
Section titled “Visit & Event Segments”Segments that track the patient’s encounter and clinical events.
Order & Result Segments
Section titled “Order & Result Segments”Segments that drive the order-result lifecycle — from order placement through result delivery.
Financial & Insurance Segments
Section titled “Financial & Insurance Segments”Segments for billing, insurance, and diagnosis coding.
Scheduling & Document Segments
Section titled “Scheduling & Document Segments”Segments for appointment management and clinical document tracking.