Skip to main content
v2026.11,858 entries · CC-BY 4.0
LAC HealthMedical & Research SuppliesReagents, PPE & instruments — chain-of-custody documented.Fast, traceable sourcing built for regulated research environments, from bench consumables to instrumentation.Shop lac.us CodeCASRAIlac.us

HL7 Messages: HL7 v2 Message Types (ADT, ORM, ORU, SIU, MDM, DFT, VXU), Segments (MSH, PID, PV1, OBR, OBX), and MLLP Framing

A technical reference to HL7 v2.x messages in hospital interface engines and clinical research data pipelines, detailing ER7 pipe-and-hat delimiter syntax, major message types (ADT, ORM, ORU, SIU, MDM, DFT, VXU, ACK), core segment definitions (MSH, PID, PV1, ORC, OBR, OBX), and MLLP socket framing.

Written and maintained by CASRAI Editorial Board

Last updated

HL7 messages are event-driven, structured text payloads defined by the Health Level Seven (HL7) Version 2.x standard (most commonly deployed in versions v2.3.1, v2.5.1, and v2.8.2) to exchange real-time clinical, administrative, laboratory, and billing events across hospital Electronic Health Records (EHRs), Laboratory Information Management Systems (LIMS), Picture Archiving and Communication Systems (PACS), and clinical trial registries. While RESTful HL7 FHIR R4 APIs govern modern web and mobile interoperability, HL7 v2 pipe-delimited messages remain the high-throughput backbone of intra-hospital EHR integration engines (such as Mirth Connect / NextGen Connect, Rhapsody, and Cloverleaf).

1. What Are HL7 Messages? ER7 Pipe-and-Hat Syntax and Encoding Characters

In the standard HL7 v2 ER7 (Encoding Rules 7) format, every message is a human-readable ASCII or UTF-8 string composed of one or more segments separated by the ASCII carriage return character (“, hex `0x0D`). Each segment begins with a mandatory 3-character uppercase identifier (such as `MSH`, `PID`, or `OBX`) followed by fields separated by five hierarchical delimiters declared in fields `MSH-1` and `MSH-2`:

Delimiter Symbol HL7 Name & MSH Position Structural Role in an HL7 v2 Message
| (Pipe) Field Separator (MSH-1) Separates sequential fields within a segment (e.g., PID|1||...).
^ (Caret / Hat) Component Separator (MSH-2[1]) Splits composite data types (such as XPN Extended Person Name or CE/CWE Coded Element) into components (e.g., LastName^FirstName^Middle or 8480-6^Systolic BP^LN).
~ (Tilde) Repetition Separator (MSH-2[2]) Separates multiple occurrences of a repeating field within the same segment (e.g., multiple patient identifiers in PID-3 or multiple phone numbers in PID-13).
(Backslash) Escape Character (MSH-2[3]) Escapes literal delimiter characters or formatting commands inside text fields (e.g., F for literal pipe, S for caret, .br for line break).
& (Ampersand) Subcomponent Separator (MSH-2[4]) Subdivides a component into subcomponents (e.g., assigning authority namespace and universal ID inside a composite identifier).

2. Types of HL7 Messages and Trigger Events (`MSH-9`)

Every HL7 v2 message is classified by field `MSH-9` (Message Type), formatted as MessageType^TriggerEvent^MessageStructure (for example, `ADT^A01^ADT_A01` or `ORU^R01^ORU_R01`). The trigger event indicates the real-world clinical or operational state transition that caused the sending system to emit the message:

Message Type Code Full Name Common Trigger Events Primary Clinical & Research Workflow
ADT Admission, Discharge, Transfer A01 (Admit Inpatient), A02 (Transfer), A03 (Discharge), A04 (Register Outpatient), A08 (Update Demographics), A40 (Merge Patient ID) Synchronizes master patient index (EMPI) demographics, bed census, and encounter status across hospital ancillaries and clinical trial screening engines (see HL7 ADT messages).
ORM / OML / OMG Order Entry Messages (General, Lab, Imaging) ORM^O01 (General Order), OML^O21 (Laboratory Order), OMG^O19 (Clinical/Radiology Order) Transmits new, modified (`XO`), or canceled (`CA`) orders from EHR Computerized Provider Order Entry (CPOE) to laboratory LIMS or radiology RIS/PACS.
ORU Observation Result (Unsolicited) ORU^R01 (Unsolicited Transmission of Observation) Delivers discrete LOINC-coded lab results, microbiology sensitivities, vital signs from bedside monitors, and diagnostic cardiology/radiology findings back to the EHR and EDC eSource pipelines.
SIU Scheduling Information Unsolicited S12 (New Appointment), S13 (Reschedule), S14 (Modify), S15 (Cancel), S26 (No-Show) Coordinates clinic calendars, infusion chairs, imaging modalities, and digital patient intake / telehealth platforms.
MDM Medical Document Management T01 (Original Document Notification), T02 (Notification and Content), T08 (Edit Document) Transfers dictated clinical notes, operative reports, discharge summaries, and Base64-encoded PDFs into the EHR chart.
DFT Detailed Financial Transaction DFT^P03 (Post Detail Financial Transaction) Sends billable procedure charges, supply item usage, and CPT/HCPCS codes from clinical ancillaries to the billing and revenue cycle system.
VXU Unsolicited Vaccination Record Update VXU^V04 (Vaccination Record Update) Reports administered CVX/MVX-coded immunizations to state and CDC Immunization Information Systems (IIS).
RDE / RAS Pharmacy/Treatment Encoded Order & Administration RDE^O11 (Pharmacy Order), RAS^O17 (Medication Administration) Drives inpatient automated dispensing cabinets (Pyxis/Omnicell) and Barcode Medication Administration (BCMA) charting.
ACK General Acknowledgment Returned in response to any message; carries MSA-1 status (AA Accept, AE Error, AR Reject) Confirms message receipt and schema validity over synchronous MLLP connections before the sender dequeues the message.

3. Core HL7 Segments Explained (`MSH`, `PID`, `PV1`, `ORC`, `OBR`, `OBX`)

While HL7 v2 defines more than 150 segments, six foundational segments appear across the vast majority of clinical interfaces, supplemented by custom institution-specific Z-segments (such as `ZPD` or `ZRX` for local extensions):

  • `MSH` (Message Header): Mandatory first segment of every message. Contains the delimiters (`MSH-1`, `MSH-2`), Sending Application/Facility (`MSH-3`, `MSH-4`), Receiving Application/Facility (`MSH-5`, `MSH-6`), Message Date/Time (`MSH-7`), Message Type (`MSH-9`), unique Message Control ID (`MSH-10`, echoed back in `MSA-2` of the `ACK`), Processing ID (`MSH-11`: `P` for Production, `T` for Training/Test, `D` for Debugging), and HL7 Version ID (`MSH-12`, e.g., `2.5.1`).
  • `PID` (Patient Identification): Carries patient demographics, including Patient Identifier List (`PID-3`, holding the Medical Record Number [MRN], enterprise EMPI ID, and Assigning Authority), Patient Name (`PID-5`), Date/Time of Birth (`PID-7`, `YYYYMMDD`), Administrative Sex (`PID-8`), Patient Address (`PID-11`), and Phone Numbers (`PID-13`).
  • `PV1` (Patient Visit): Captures encounter context, including Patient Class (`PV1-2`: `I` Inpatient, `O` Outpatient, `E` Emergency), Assigned Patient Location (`PV1-3`: PointOfCare^Room^Bed^Facility), Attending Doctor (`PV1-7` with NPI), Visit Number (`PV1-19`), and Admit/Discharge Date/Time (`PV1-44`, `PV1-45`).
  • `ORC` (Common Order) & `OBR` (Observation Request): Paired in `ORM` and `ORU` messages. `ORC` holds the Order Control code (`ORC-1`: `NW` New Order, `RE` Observations to Follow), Placer Order Number (`ORC-2`), and Filler Order Number (`ORC-3`). `OBR` serves as the header for a diagnostic panel, specifying the Universal Service Identifier (`OBR-4`, e.g., `24323-8^Comprehensive Metabolic Panel^LN`), Specimen Collection Date/Time (`OBR-7`), and Result Status (`OBR-25`: `F` Final, `P` Preliminary, `C` Corrected).
  • `OBX` (Observation/Result): Repeats beneath each `OBR` to report individual measured values. Key fields include Value Type (`OBX-2`: `NM` Numeric, `ST` String, `CE`/`CWE` Coded Element, `TX` Text, `ED` Encapsulated Data), Observation Identifier (`OBX-3`, LOINC code), Observation Value (`OBX-5`), Units (`OBX-6`, UCUM), Reference Range (`OBX-7`), Abnormal Flags (`OBX-8`: `H` High, `L` Low, `HH` Critical High, `N` Normal), and Observation Result Status (`OBX-11`).
MSH|^~&|LAB_LIMS|GENERAL_HOSP|EPIC_EHR|GENERAL_HOSP|20261015093012||ORU^R01^ORU_R01|MSG202610150091|P|2.5.1
PID|1||90041285^^^GENERAL_HOSP^MR||DOE^JANE^M||19720418|F|||100 MAIN ST^^BOSTON^MA^02115
PV1|1|I|ICU^402^A^GENERAL_HOSP||||1234567890^SMITH^ROBERT^A^^^MD^^^^^^^^^^^^NPI
ORC|RE|ORD88410^EPIC|LAB99201^LIMS
OBR|1|ORD88410^EPIC|LAB99201^LIMS|24323-8^Comprehensive Metabolic Panel^LN|||20261015084500||||||||||||||||||F
OBX|1|NM|2345-7^Glucose [Mass/volume] in Serum or Plasma^LN||142|mg/dL|70-99|H|||F
OBX|2|NM|2160-0^Creatinine [Mass/volume] in Serum or Plasma^LN||1.1|mg/dL|0.6-1.2|N|||F

4. Transport Framing: Minimal Lower Layer Protocol (MLLP)

Because raw TCP/IP sockets deliver a continuous byte stream without native message boundaries, HL7 v2 interfaces wrap each ER7 message in the Minimal Lower Layer Protocol (MLLP) envelope:

  • Start Block Byte: Vertical Tab (“, ASCII `11` / hex `0x0B`) precedes the `MSH` segment.
  • Segment Terminator: Each segment ends with a Carriage Return (“, ASCII `13` / hex `0x0D`).
  • End Block Bytes: File Separator followed by Carriage Return (“, ASCII `28` + `13` / hex `0x1C 0x0D`) marks the end of the message, signaling the receiving interface engine to parse the payload and return an MLLP-framed `ACK` message.

5. Frequently Asked Questions

What are HL7 messages?

HL7 messages are standardized, event-driven text messages defined by the Health Level Seven Version 2 (HL7 v2) specification to exchange patient demographics, hospital admissions, clinical orders, laboratory results, appointment schedules, and billing charges between healthcare software systems. Each message consists of pipe-delimited (`|`) 3-letter segments (such as `MSH`, `PID`, `PV1`, `OBR`, and `OBX`) transmitted over TCP/IP using the Minimal Lower Layer Protocol (MLLP).

Follow CASRAI

Research-administration guidance, standards updates and independent tool reviews.

Ask CASRAI · free to try

Ask about HL7 Messages: HL7 v2 Message Types (ADT, ORM, ORU, SIU, MDM, DFT, VXU), Segments (MSH, PID, PV1, OBR, OBX), and MLLP Framing

Ask your first 2 questions free below. Subscribers get 150 a day for $29 a month.

An AI assistant specialized in research administration. It cites the sources behind every answer, labels web answers and says when it can't answer.

Answers draw on CASRAI's guides and dictionary plus the federal and funder documents we index: Federal Register, Grants.gov, Regulations.gov and UKRI.

Works on this site and inside Claude, Cursor and the AI tools you already use.

Everything CASRAI publishes — this page, the dictionary, the guides and the news — stays free to read, with no account and no card.

Referenced across the research world

University of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoUniversity of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logo
  • University of Cambridge logo
  • Columbia University logo
  • Crossref logo
  • University of Edinburgh logo
  • Harvard University logo
  • University of Oxford logo
  • Princeton University logo
  • Stanford School of Medicine logo
  • University College London logo
  • ORCID logo

View CASRAI adoption →