Field guides for the segments you meet most on hospital interfaces. Original notes checked against HL7 v2.5.1, not a copy of the standard.
MSHEVNPIDPV1NK1AL1DG1IN1MRGORCOBROBXMSAERR
The envelope on every v2 message: who sent it, who should get it, what kind it is, and its unique control ID. Chapter 2 (Control) HL7 v2.5.1
| Field | Name / type | In plain words |
|---|---|---|
| MSH-1 | Field Separator ST | The character that separates fields. Almost always |. |
| MSH-2 | Encoding Characters ST | Four characters: component, repetition, escape, subcomponent. Usual value: ^~\&. |
| MSH-3 | Sending Application HD | Software that built the message (Penford example: PENEHR). |
| MSH-4 | Sending Facility HD | Site or organization that sent it (PMC). |
| MSH-5 | Receiving Application HD | Intended receiving application. |
| MSH-6 | Receiving Facility HD | Intended receiving facility. |
| MSH-7 | Date/Time of Message TS | When the message was created (YYYYMMDDHHMMSS±ZZZZ). |
| MSH-8 | Security ST | Optional security field; rarely used on hospital ADT feeds. |
| MSH-9 | Message Type MSG | Message code ^ trigger ^ structure, e.g. ADT^A04^ADT_A01. |
| MSH-10 | Message Control ID ST | Unique id for this instance; the ACK echoes it. |
| MSH-11 | Processing ID PT | P (production), T (training), or D (debugging) — Table 0103. |
| MSH-12 | Version ID VID | v2 version claimed by the sender, e.g. 2.5.1. |
| MSH-15 | Accept Acknowledgment Type ID | Enhanced-mode accept ACK expectation (AL/NE/ER/SU) — Table 0155. |
| MSH-16 | Application Acknowledgment Type ID | Enhanced-mode application ACK expectation — Table 0155. |
| MSH-18 | Character Set ID | Character set(s), e.g. ASCII, UNICODE UTF-8 — Table 0211. |
When the real-world event happened, and who recorded it — separate from MSH-7 (when the message was built). Chapter 3 (Patient Administration) HL7 v2.5.1
| Field | Name / type | In plain words |
|---|---|---|
| EVN-1 | Event Type Code ID | Optional echo of the trigger (A04…). Often empty when MSH-9 already carries it. |
| EVN-2 | Recorded Date/Time TS | When the event was recorded in the system. |
| EVN-3 | Date/Time Planned Event TS | For planned events. |
| EVN-4 | Event Reason Code IS | Why the event occurred — Table 0062 / user-defined. |
| EVN-5 | Operator ID XCN | Who entered the event. |
| EVN-6 | Event Occurred TS | When the event actually happened (may differ from recorded time). |
| EVN-7 | Event Facility HD | Facility where the event occurred. |
Who the patient is: identifiers, name, DOB, sex, address, phone, account. Chapter 3 HL7 v2.5.1
| Field | Name / type | In plain words |
|---|---|---|
| PID-1 | Set ID – PID SI | Sequence when multiple PID segments appear (usually 1). |
| PID-2 | Patient ID CX | Deprecated/withdrawn path; prefer PID-3. |
| PID-3 | Patient Identifier List CX | MRN, account, etc. with assigning authority and type (MR, AN…). |
| PID-4 | Alternate Patient ID CX | Deprecated; prefer PID-3 repetitions. |
| PID-5 | Patient Name XPN | family^given^middle^… |
| PID-6 | Mother's Maiden Name XPN | Sometimes used for matching newborns. |
| PID-7 | Date/Time of Birth TS | YYYYMMDD (optionally with time). |
| PID-8 | Administrative Sex IS | Table 0001: M, F, O, U, A, N… |
| PID-10 | Race CE | Coded race; privacy-sensitive. |
| PID-11 | Patient Address XAD | Street, city, state, ZIP… |
| PID-13 | Phone Number – Home XTN | Prefer XTN components over a free-text blob. |
| PID-14 | Phone Number – Business XTN | Work phone. |
| PID-16 | Marital Status CE | Table 0002. |
| PID-18 | Patient Account Number CX | Visit/account id many ancillaries require. |
| PID-19 | SSN Number – Patient ST | Backward-compatible in 2.5.1; prefer PID-3 type SS. PHI. |
| PID-22 | Ethnic Group CE | Coded ethnicity; privacy-sensitive. |
| PID-29 | Patient Death Date and Time TS | Populated on discharge/death events. |
| PID-30 | Patient Death Indicator ID | Y/N style death indicator — Table 0136. |
How the patient is here now: class, location, attending, admit time. Chapter 3 HL7 v2.5.1
| Field | Name / type | In plain words |
|---|---|---|
| PV1-1 | Set ID – PV1 SI | Usually 1. |
| PV1-2 | Patient Class IS | Table 0004: E, I, O, P, R… |
| PV1-3 | Assigned Patient Location PL | Point of care / room / bed / facility. |
| PV1-4 | Admission Type IS | Table 0007. |
| PV1-7 | Attending Doctor XCN | Current attending. |
| PV1-8 | Referring Doctor XCN | Referring provider. |
| PV1-10 | Hospital Service IS | Service code (MED, SUR…). |
| PV1-14 | Admit Source IS | Table 0023. |
| PV1-17 | Admitting Doctor XCN | Who admitted the patient. |
| PV1-18 | Patient Type IS | User-defined patient type. |
| PV1-19 | Visit Number CX | Visit identifier. |
| PV1-36 | Discharge Disposition IS | Table 0112. |
| PV1-44 | Admit Date/Time TS | When the visit started. |
| PV1-45 | Discharge Date/Time TS | When the visit ended. |
Emergency contact or related person. Chapter 3 HL7 v2.5.1
| Field | Name / type | In plain words |
|---|---|---|
| NK1-1 | Set ID – NK1 SI | Sequence number. |
| NK1-2 | Name XPN | Contact name. |
| NK1-3 | Relationship CE | Table 0063 (SPO, ENC…). |
| NK1-4 | Address XAD | Contact address. |
| NK1-5 | Phone Number XTN | Contact phone. |
| NK1-7 | Contact Role CE | Table 0131. |
Allergy or adverse reaction on the patient record. Chapter 3 HL7 v2.5.1
| Field | Name / type | In plain words |
|---|---|---|
| AL1-1 | Set ID – AL1 SI | Sequence. |
| AL1-2 | Allergen Type Code CE | Table 0127 (DA drug, FA food…). |
| AL1-3 | Allergen Code/Mnemonic/Description CE | What they are allergic to. |
| AL1-4 | Allergy Severity Code CE | Table 0128. |
| AL1-5 | Allergy Reaction Code ST | Reaction description. |
| AL1-6 | Identification Date DT | When the allergy was identified. |
A diagnosis code tied to the visit or account. Chapter 6 (Financial) / used widely HL7 v2.5.1
| Field | Name / type | In plain words |
|---|---|---|
| DG1-1 | Set ID – DG1 SI | Sequence. |
| DG1-2 | Diagnosis Coding Method ID | Deprecated in later versions; often empty in 2.5.1 feeds. |
| DG1-3 | Diagnosis Code – DG1 CE | ICD code ^ text ^ coding system. |
| DG1-4 | Diagnosis Description ST | Free-text description when not fully coded. |
| DG1-5 | Diagnosis Date/Time TS | When diagnosed. |
| DG1-6 | Diagnosis Type IS | Table 0052 (A admitting, W working, F final…). |
Coverage information for billing interfaces. Chapter 6 HL7 v2.5.1
| Field | Name / type | In plain words |
|---|---|---|
| IN1-1 | Set ID – IN1 SI | Sequence (primary = 1). |
| IN1-2 | Insurance Plan ID CE | Plan identifier. |
| IN1-3 | Insurance Company ID CX | Payer id. |
| IN1-4 | Insurance Company Name XON | Payer name. |
| IN1-16 | Name Of Insured XPN | Subscriber name. |
| IN1-17 | Insured's Relationship To Patient CE | Table 0063. |
| IN1-36 | Policy Number ST | Member/policy number. |
On merge events (A18/A34/A40…): which prior identifiers are being retired. Chapter 3 HL7 v2.5.1
| Field | Name / type | In plain words |
|---|---|---|
| MRG-1 | Prior Patient Identifier List CX | Old MRN(s) being merged away. |
| MRG-2 | Prior Alternate Patient ID CX | Deprecated alternate id. |
| MRG-3 | Prior Patient Account Number CX | Old account if merging accounts. |
| MRG-5 | Prior Visit Number CX | Old visit number. |
| MRG-7 | Prior Patient Name XPN | Name on the prior record. |
Order control and status that apply across the order — pairs with OBR on ORM/ORU. Chapter 4 (Order Entry) HL7 v2.5.1
| Field | Name / type | In plain words |
|---|---|---|
| ORC-1 | Order Control ID | Table 0119: NW new, CA cancel, SC status change… |
| ORC-2 | Placer Order Number EI | Order id from the placer (EHR). |
| ORC-3 | Filler Order Number EI | Order id from the filler (lab/RIS). |
| ORC-5 | Order Status ID | Table 0038. |
| ORC-9 | Date/Time of Transaction TS | When this ORC was produced. |
| ORC-12 | Ordering Provider XCN | Who ordered. |
| ORC-17 | Entering Organization CE | Organization that entered the order. |
What was ordered or reported: service id, times, specimen, result status. Chapters 4 & 7 HL7 v2.5.1
| Field | Name / type | In plain words |
|---|---|---|
| OBR-1 | Set ID – OBR SI | Sequence under the order. |
| OBR-2 | Placer Order Number EI | Placer id (may mirror ORC-2). |
| OBR-3 | Filler Order Number EI | Filler id. |
| OBR-4 | Universal Service Identifier CE | Test/procedure code ^ text ^ system. |
| OBR-7 | Observation Date/Time TS | Clinically relevant observation time. |
| OBR-14 | Specimen Received Date/Time TS | When specimen arrived. |
| OBR-16 | Ordering Provider XCN | Ordering clinician. |
| OBR-22 | Results Rpt/Status Chng – Date/Time TS | When results were reported/changed. |
| OBR-24 | Diagnostic Serv Sect ID ID | Table 0074: LAB, RAD… |
| OBR-25 | Result Status ID | Table 0123: F final, P preliminary… |
One result row: what was measured, the value, units, flags, status. Chapter 7 (Observation Reporting) HL7 v2.5.1
| Field | Name / type | In plain words |
|---|---|---|
| OBX-1 | Set ID – OBX SI | Sequence under the OBR. |
| OBX-2 | Value Type ID | Table 0125: NM, ST, TX, CWE, SN… |
| OBX-3 | Observation Identifier CE | Code ^ text ^ coding system (often LOINC / LN). |
| OBX-4 | Observation Sub-ID ST | Distinguishes repeats of the same OBX-3. |
| OBX-5 | Observation Value varies | The result; shape must match OBX-2. |
| OBX-6 | Units CE | Units for numeric results. |
| OBX-7 | References Range ST | Normal range text. |
| OBX-8 | Abnormal Flags IS | Table 0078: H, L, N, AA… |
| OBX-11 | Observation Result Status ID | Table 0085: F, P, C, X… |
| OBX-14 | Date/Time of the Observation TS | Observation time for this row. |
How the receiver answered, plus the echoed control ID. Chapter 2 HL7 v2.5.1
| Field | Name / type | In plain words |
|---|---|---|
| MSA-1 | Acknowledgment Code ID | Table 0008: AA, AE, AR, CA, CE, CR. |
| MSA-2 | Message Control ID ST | Echo of the original MSH-10. |
| MSA-3 | Text Message ST | Optional human-readable note. |
| MSA-4 | Expected Sequence Number NM | For sequence-number protocol. |
| MSA-6 | Error Condition CE | Older error coding; prefer ERR segment in 2.5+. |
Structured error detail for AE/AR (and enhanced-mode CE/CR) responses. Chapter 2 HL7 v2.5.1
| Field | Name / type | In plain words |
|---|---|---|
| ERR-1 | Error Code and Location ELD | Deprecated location form; still seen on older feeds. |
| ERR-2 | Error Location ERL | Segment/field/component location of the problem. |
| ERR-3 | HL7 Error Code CWE | Table 0357 message error condition. |
| ERR-4 | Severity ID | Table 0516: I/W/E/F… |
| ERR-5 | Application Error Code CWE | App-specific code (detail for 207). |
| ERR-6 | Application Error Parameter ST | Parameters for the app error. |
| ERR-7 | Diagnostic Information TX | Technical diagnostics. |
| ERR-8 | User Message TX | Message safe to show an analyst. |
Official definitions: HL7 v2.5.1. Related: ACK & error codes · Glossary · HL7 viewer