HL7 Segment Reference
Field-level reference for every HL7 v2.x segment. Each entry includes data types, required/optional status, common values from real healthcare systems, and troubleshooting tips written from production experience.
Message Control
6Message Header
The MSH segment defines the intent, source, destination, and syntax rules of the message. Every HL7 v2.x message begins with MSH. It controls how the receiving system parses the rest of the message.
Message Acknowledgment
The MSA segment is returned by the receiving system to confirm receipt of a message. It carries the acknowledgment code and echoes back the original message control ID so the sender can match the ACK to the original message.
Error
The ERR segment provides detailed error information when a message fails processing. It is returned with NAK responses and contains structured error codes, severity levels, and diagnostic text to help identify root cause.
Event Type
The EVN segment provides additional event information for ADT and other trigger event messages. It records when the event was recorded versus when it actually occurred, and who initiated the event.
Query Definition
The QRD segment defines the parameters of a query request in the original-mode query framework. It specifies what data is being requested, from whom, and how results should be returned. This segment is deprecated in HL7 v2.5+ in favor of the newer query framework.
Query Filter
The QRF segment provides additional filtering criteria for queries defined by QRD. It allows specification of date ranges, user qualifiers, and other selection criteria for the query results. This segment is deprecated in HL7 v2.5+ along with QRD.
Patient Administration
7Patient Identification
The PID segment contains the primary patient identification information including name, date of birth, address, and medical record numbers. It is the cornerstone of patient identity in HL7 v2.x messages and appears in virtually every ADT, order, and result message.
Patient Additional Demographics
The PD1 segment carries supplemental patient demographic information that does not fit in the PID segment, including living situation, primary care provider, advance directives, and immunization registry status.
Patient Visit
The PV1 segment contains information specific to a patient's visit or encounter, including patient class, assigned location, attending provider, and admission and discharge details. It is the core encounter record in HL7 v2.x.
Patient Visit - Additional Information
The PV2 segment contains supplemental visit information not carried in PV1, including expected dates, visit descriptions, prior service dates, and special program codes. It provides additional context about the patient's visit that supports clinical and administrative workflows.
Next of Kin / Associated Parties
The NK1 segment contains information about the patient's next of kin and other associated parties such as emergency contacts, guarantors, and authorized representatives. Multiple NK1 segments can appear in a message for different associated parties.
Merge Patient Information
The MRG segment contains the prior identifiers for a patient before a merge or move operation. It is sent in ADT A34 through A40 messages to allow receiving systems to update their patient index when a merge or move occurs.
Allergy Information
The AL1 segment carries patient allergy information including allergen type, allergen identity, severity, and documented reactions. Multiple AL1 segments can be included in a message for patients with multiple allergies.
Order Management
2Common Order
The ORC segment is the common order segment that precedes all order detail segments (OBR, RXO, RXE, etc.). It carries the universal order control information including order identifiers, order status, ordering provider, and transaction timestamps.
Observation Request
The OBR segment defines what test, procedure, or study is being ordered or reported. It carries the universal service identifier, requesting provider, specimen details, and result status. OBR is the primary segment in lab, radiology, and diagnostic order and result messages.
Observation/Result
3Observation/Result
The OBX segment carries a single observation value or result. Multiple OBX segments appear in a message for multi-analyte test results. It supports a wide variety of value types from numeric lab values to coded findings to document references.
Notes and Comments
The NTE segment carries free-text notes and comments that annotate a parent segment. It can appear after MSH, PID, ORC, OBR, or OBX to provide additional context for that segment.
Transcription Document Header
The TXA segment provides header information for transcribed clinical documents such as discharge summaries, operative reports, and H&P notes. It identifies the document type, authorship, and status.
Financial
5Guarantor
The GT1 segment contains information about the guarantor — the person or organization financially responsible for the patient's account. It is used in billing and financial interfaces.
Insurance
The IN1 segment carries the primary insurance plan information for a patient encounter, including the insurance company, policy details, group information, and coverage dates. Multiple IN1 segments accommodate primary, secondary, and tertiary insurance.
Insurance Additional Information
The IN2 segment contains supplemental insurance information that does not fit in IN1, including military information, Medicaid details, and additional employment and subscriber data.
Diagnosis
The DG1 segment carries patient diagnosis information coded using ICD-9, ICD-10, or other diagnosis code systems. Multiple DG1 segments are used for patients with multiple diagnoses, including admitting, working, and final diagnoses.
Financial Transaction
The FT1 segment carries individual financial transaction detail for billing purposes, including procedure charges, quantities, and billing codes. Each billable service generates an FT1 segment.
Scheduling
5Scheduling Activity Information
The SCH segment carries scheduling activity information including appointment identifiers, reasons, timing, and status. It is the primary segment in SIU (Schedule Information Unsolicited) and SRM (Schedule Request Message) messages.
Appointment Information - Service
The AIS segment identifies a service that is required for an appointment, such as a clinical service, room type, or procedure. Multiple AIS segments can appear for appointments requiring multiple services.
Appointment Information - General Resource
The AIG segment identifies general resources required for an appointment, such as equipment, special rooms, or materials. It allows scheduling systems to reserve non-personnel, non-location resources.
Appointment Information - Location Resource
The AIL segment identifies location resources required for an appointment, such as exam rooms, operating rooms, or imaging suites. It allows scheduling systems to reserve specific physical locations.
Appointment Information - Personnel Resource
The AIP segment identifies personnel resources required for an appointment, such as physicians, nurses, or technicians. It enables scheduling systems to reserve specific people or roles for an appointment.
Pharmacy
3Pharmacy/Treatment Administration
The RXA segment records the details of a medication or treatment administration event. It documents what was given, how much, when, by whom, and what lot number was used. It appears in RAS messages for medication administration records.
Pharmacy/Treatment Encoded Order
The RXE segment contains the pharmacy-verified and encoded order details after pharmacist review. It carries the pharmacist's interpretation of the original order including specific drug, dose, and instructions.
Pharmacy/Treatment Order
The RXO segment carries the original pharmacy or treatment order as entered by the prescriber. It is the initial request before pharmacist review and encoding into RXE.
Other
4Diagnosis Related Group
The DRG segment contains the Diagnosis Related Group assignment for an inpatient stay, used for Medicare and managed care reimbursement. It carries the DRG code, severity information, and financial calculations.
Procedures
The PR1 segment carries information about clinical procedures performed on a patient, including the procedure code, performing provider, and timing. Multiple PR1 segments cover multiple procedures.
Role
The ROL segment identifies the specific role that a person or organization plays in a patient's care or in a specific event. It can follow PID, PV1, and other segments to attach provider role information.
Custom Z Segment
Z-segments (ZAA, ZBS, ZPD, ZPI, ZDT, etc.) are custom segments defined by individual healthcare organizations or vendors for information that does not fit into standard HL7 v2.x segments. Every Z-segment begins with the letter Z and is followed by two alphanumeric characters. Their structure and field definitions are entirely site-specific and not governed by the HL7 standard.
Parse HL7 messages instantly
Paste any HL7 message into our free viewer. Segment explorer, field decoder, and validation — all client-side, nothing uploaded.
Open HL7 Message Viewer →HL7 Integration Guide
Deep dive into HL7 v2.x interface design — channel configuration, segment mapping, acknowledgment modes, and Mirth Connect patterns.
Read the Guide →