Filter by chapter
HL7 v2 segments
A segment is one line of an HL7 message. It starts with a three-letter code saying what the line is about, and everything after that is fields separated by pipes.
What a segment is
Here is a short admission message. Four lines, four segments, and the code at the start of each one tells you what you are looking at.
MSH|^~\&|EPIC|STJOSEPH|LABSYS|STJOSEPH|20240314093015||ADT^A01|MSG00017|P|2.5.1 EVN|A01|20240314093000 PID|1||1000345678^^^STJOSEPH^MR||CARTWRIGHT^ELEANOR^MAY^^^^L||19510822|F PV1|1|I|3W^312^A^STJOSEPHMSH is the header, which every message begins with.EVN says what happened and when.PID says who the patient is.PV1 says where they are being admitted.
Read in order, those four lines say one thing. St Joseph admitted Eleanor Cartwright on 14 March 2024 and put her in bed A of room 312 on ward 3 West.
Required and optional
A message type states which segments it expects and whether each one has to be there. An R segment must be present, an O segment is optional, and a C segment is required only when some stated condition holds. The same marks appear against every field inside a segment.
For an admission, that leaves four segments you cannot omit, which is the message above. The ADT page shows the full structure and what each of the optional ones would add.
The seven to learn first
The standard defines 151 segments. Almost all ordinary traffic is these 7. Each page has a worked example, notes on the fields that cause trouble, and a FHIR mapping.
MSHMessage headerMSH is the first line of every HL7 v2 message. It sets the delimiters the rest of the message uses. It also names the sender, the receiver, the time and the kind of message.
PIDPatient identificationPID carries the identity of one patient: who they are, what identifiers the sending system knows them by, and the demographics that travel with those identifiers.
PV1Patient visitPV1 describes one visit. It says where the patient is, what kind of stay it is, who is responsible for them and what the visit is called.
OBRObservation requestOBR carries one request for an observation: what was ordered, who ordered it, when the specimen was taken, and in a result message, the report that answered it.
OBXObservation resultOBX carries exactly one observation: what was measured, what the answer was, what units it is in, and how confident the sender is that the answer is final.
ORCCommon orderORC carries the parts of an order that stay the same whatever is being ordered. Its most important field is the order control code, which says whether the order is being placed, cancelled, held or reported on.
IN1InsuranceIN1 carries one insurance policy for the patient. It names the payer, the plan, the person who holds the policy and how that person relates to the patient.
HL7 segments list
144 more, running from allergies to waveform data. Their pages carry the field table as published.
Show the other 144 segments
| Segment | Name | Fields | Chapter |
|---|---|---|---|
| ABS | Abstract Segment | 14 | 06 |
| ACC | Accident Segment | 11 | 06 |
| ADD | addendum segment | 1 | 02 |
| AFF | Professional Affiliation Segment | 5 | 15 |
| AIG | Appointment Information - General Resource Segment | 14 | 10 |
| AIL | Appointment Information - Location Resource Segment | 12 | 10 |
| AIP | Appointment Information - Personnel Resource Segment | 12 | 10 |
| AIS | Appointment Information - Service Segment | 12 | 10 |
| AL1 | Patient Allergy Information Segment | 6 | 03 |
| APR | Appointment Preferences Segment | 5 | 10 |
| ARQ | Appointment Request Segment | 25 | 10 |
| AUT | Authorization Information Segment | 10 | 11 |
| BHS | batch header segment | 12 | 02 |
| BLC | Blood Code Segment | 2 | 06 |
| BLG | Billing Segment | 4 | 04 |
| BPO | Blood Product Order Segment | 14 | 04 |
| BPX | Blood Product Dispense Status Segment | 21 | 04 |
| BTS | batch trailer segment | 3 | 02 |
| BTX | Blood Product Transfusion/Disposition Segment | 19 | 04 |
| CDM | Charge Description Master Segment | 13 | 08 |
| CER | Certificate Detail Segment | 31 | 15 |
| CM0 | Clinical Study Master Segment | 11 | 08 |
| CM1 | Clinical Study Phase Master Segment | 3 | 08 |
| CM2 | Clinical Study Schedule Master Segment | 4 | 08 |
| CNS | Clear Notification Segment | 6 | 13 |
| CON | Consent Segment | 25 | 09 |
| CSP | Clinical Study Phase Segment | 4 | 07 |
| CSR | Clinical Study Registration Segment | 16 | 07 |
| CSS | Clinical Study Data Schedule Segment | 3 | 07 |
| CTD | Contact Data Segment | 7 | 11 |
| CTI | Clinical Trial Identification Segment | 3 | 07 |
| DB1 | Disability Segment | 8 | 03 |
| DG1 | Diagnosis Segment | 21 | 06 |
| DRG | Diagnosis Related Group Segment | 11 | 06 |
| DSC | continuation pointer segment | 2 | 02 |
| DSP | display data segment | 5 | 05 |
| ECD | Equipment Command Segment | 5 | 13 |
| ECR | Equipment Command Response Segment | 3 | 13 |
| EDU | Educational Detail Segment | 9 | 15 |
| EQL | Embedded Query Language | 4 | 05 |
| EQP | Equipment Log/Service Segment | 5 | 13 |
| EQU | Equipment Detail Segment | 5 | 13 |
| ERQ | Event replay query | 3 | 05 |
| ERR | error segment | 12 | 02 |
| EVN | Event Type Segment | 7 | 03 |
| FAC | Facility | 12 | 07 |
| FHS | file header segment | 12 | 02 |
| FT1 | Financial Transaction Segment | 31 | 06 |
| FTS | file trailer segment | 2 | 02 |
| GOL | Goal Detail Segment | 21 | 12 |
| GP1 | Grouping/Reimbursement - Visit | 5 | 06 |
| GP2 | Grouping/Reimbursement - Procedure Line Item | 14 | 06 |
| GT1 | Guarantor Segment | 57 | 06 |
| IAM | Patient Adverse Reaction Information Segment - Unique Identifier | 20 | 03 |
| IIM | Inventory Item Master Segment | 15 | 08 |
| IN2 | Insurance Additional Information Segment | 72 | 06 |
| IN3 | Insurance Additional Information, Certification Segment | 25 | 06 |
| INV | Inventory Detail Segment | 20 | 13 |
| IPC | Imaging Procedure Control Segment | 9 | 04 |
| ISD | Interaction Status Detail Segment | 3 | 13 |
| LAN | Language Detail Segment | 4 | 15 |
| LCC | Location Charge Code Segment | 4 | 08 |
| LCH | Location Characteristic Segment | 5 | 08 |
| LDP | Location Department Segment | 12 | 08 |
| LOC | Location Identification Segment | 9 | 08 |
| LRL | Location Relationship Segment | 6 | 08 |
| MFA | Master File Acknowledgment Segment | 6 | 08 |
| MFE | Master File Entry Segment | 5 | 08 |
| MFI | Master File Identification Segment | 6 | 08 |
| MRG | Merge Patient Information Segment | 7 | 03 |
| MSA | message acknowledgment segment | 6 | 02 |
| NCK | System Clock Segment | 1 | 14 |
| NDS | Notification Detail Segment | 4 | 13 |
| NK1 | Next of Kin / Associated Parties Segment | 39 | 03 |
| NPU | Bed Status Update Segment | 2 | 03 |
| NSC | Application Status Change Segment | 9 | 14 |
| NST | Application Control-Level Statistics Segment | 15 | 14 |
| NTE | notes and comments segment | 4 | 02 |
| ODS | dietary orders, supplements, and preferences segment | 4 | 04 |
| ODT | diet tray instructions segment | 3 | 04 |
| OM1 | General Segment (Fields That Apply to Most Observations) | 47 | 08 |
| OM2 | Numeric Observation Segment | 10 | 08 |
| OM3 | Categorical Service/Test/Observation Segment | 7 | 08 |
| OM4 | Observations That Require Specimens Segment | 14 | 08 |
| OM5 | Observation Batteries (Sets) Segment | 3 | 08 |
| OM6 | Observations that are Calculated from Other Observations | 2 | 08 |
| OM7 | Additional Basic Attributes (Fields That Apply to Most Observations/Services) | 24 | 08 |
| ORG | Practitioner Organization Unit Segment | 12 | 15 |
| OVR | override segment | 5 | 02 |
| PCR | Possible Causal Relationship Segment | 23 | 07 |
| PD1 | Patient Additional Demographic Segment | 21 | 03 |
| PDA | Patient Death and Autopsy Segment | 9 | 03 |
| PDC | Product Detail Country Segment | 15 | 07 |
| PEO | Product Experience Observation Segment | 25 | 07 |
| PES | Product Experience Sender | 13 | 07 |
| PR1 | Procedures Segment | 20 | 06 |
| PRA | Practitioner Detail Segment | 12 | 15 |
| PRB | Problem Detail Segment PRB | 25 | 12 |
| PRC | Pricing Segment | 18 | 08 |
| PRD | provider data segment | 9 | 11 |
| PSH | Product Summary Header Segment | 14 | 07 |
| PTH | Pathway Segment | 6 | 12 |
| PV2 | Patient Visit - Additional Information Segment | 49 | 03 |
| QAK | query acknowledgment segment | 6 | 05 |
| QID | query identification segment | 2 | 05 |
| QPD | query parameter definition | 3 | 05 |
| QRD | Original-Style Query Definition | 12 | 05 |
| QRF | Original style query filter | 10 | 05 |
| QRI | query response instance segment | 3 | 05 |
| RCP | response control parameter segment | 7 | 05 |
| RDF | table row definition segment | 2 | 05 |
| RDT | table row data segment | 1 | 05 |
| RF1 | Referral Information Segment | 11 | 11 |
| RGS | Resource Group Segment | 3 | 10 |
| RMI | Risk Management Incident Segment | 3 | 06 |
| ROL | Role Segment | 12 | 12 |
| RQ1 | Requisition Detail-1 Segment | 7 | 04 |
| RQD | Requisition Detail Segment | 10 | 04 |
| RXA | segment usage in vaccine messages | 26 | 04 |
| RXC | Pharmacy/Treatment Component Order Segment | 9 | 04 |
| RXD | Pharmacy/Treatment Dispense | 33 | 04 |
| RXE | Pharmacy/Treatment Encoded Order Segment | 44 | 04 |
| RXG | Pharmacy/Treatment Give Segment | 26 | 04 |
| RXO | Pharmacy/Treatment Order Segment | 28 | 04 |
| RXR | Pharmacy/Treatment Route Segment | 6 | 04 |
| SAC | Specimen Container Detail Segment | 44 | 13 |
| SCH | Schedule Activity Information Segment | 27 | 10 |
| SFT | software segment | 6 | 02 |
| SID | Substance Identifier Segment | 4 | 13 |
| SPM | Specimen Segment | 29 | 07 |
| SPR | Stored Procedure Request Definition | 4 | 05 |
| STF | Staff Identification Segment | 38 | 15 |
| TCC | Test Code Configuration Segment | 14 | 13 |
| TCD | Test Code Detail Segment | 8 | 13 |
| TQ1 | Timing/Quantity Segment | 14 | 04 |
| TQ2 | Timing/Quantity Relationship | 10 | 04 |
| TXA | Transcription Document Header Segment | 23 | 09 |
| UB1 | UB82 Data Segment | 23 | 06 |
| UB2 | UB92 Data Segment | 17 | 06 |
| URD | Results/update Definition | 7 | 05 |
| URS | Unsolicited Selection | 9 | 05 |
| VAR | Variance Segment | 6 | 12 |
| VTQ | Virtual Table Query Request | 5 | 05 |
| ZL7 | (proposed example only) | 2 | 08 |