HL7 FAQ: Messages, Segments & Integration
Short, practical answers to the questions that come up most often when working with HL7 v2 — what the standard is, how messages are structured, the common message types, how HL7 moves across the network, and how to debug interfaces. Each answer links to the deeper reference.
HL7 basics
Section titled “HL7 basics”What is HL7?
HL7 (Health Level Seven) is both a healthcare standards organization and the family of standards it publishes for exchanging clinical and administrative data between systems. The most widely deployed is HL7 v2, a pipe-delimited messaging standard, alongside the newer FHIR API standard.
What does the "Level Seven" in HL7 mean?
The "Level Seven" in HL7 refers to the seventh layer of the OSI networking model — the application layer. The name signals that HL7 standardizes the application-level content and meaning of healthcare data, not the lower-level network transport.
Is HL7 v2 still used today?
Yes. HL7 v2 remains the dominant interoperability standard inside hospitals — most clinical interface traffic between EHRs, laboratories, radiology, and ancillary systems is HL7 v2. FHIR is growing for APIs and patient-facing apps, but it has not replaced v2 for internal messaging.
What is the difference between HL7 v2, HL7 v3, and FHIR?
HL7 v2 is the pipe-delimited messaging standard in near-universal hospital use. HL7 v3 was an XML, model-driven redesign that saw limited adoption. FHIR is the modern standard — a RESTful API with JSON or XML resources. See HL7 vs FHIR for a full comparison.
Who uses HL7?
Hospitals, reference laboratories, imaging centers, EHR and ancillary-system vendors, health information exchanges, and public-health agencies — any organization where separate clinical systems must share patient, order, result, or scheduling data.
Message structure
Section titled “Message structure”What are segments, fields, and components in an HL7 message?
An HL7 v2 message is a stack of segments — lines such as MSH or PID. Each segment splits into fields, fields split into components, and components into subcomponents. It is a four-level hierarchy defined entirely by delimiter characters.
What delimiters does HL7 v2 use?
HL7 v2 uses five delimiters: the pipe separates fields, the caret separates components, the tilde separates repetitions, the backslash is the escape character, and the ampersand separates subcomponents. Every message declares them in MSH-1 and MSH-2.
What is an HL7 trigger event?
A trigger event is the real-world occurrence that causes a message to be sent — a patient admission, a finalized lab result, a new order. HL7 encodes it in MSH-9; in ADT^A01, A01 is the trigger event "admit."
What is MSH-9 and the HL7 message-type format?
MSH-9, the Message Type field, carries up to three components: message code, trigger event, and message structure — for example ORU^R01^ORU_R01. The receiver reads MSH-9 to route and parse the message. See the MSH segment reference.
Does an HL7 message end each line with CR or CRLF?
HL7 v2 segments are terminated by a single carriage return (CR, hex 0x0D) — not a line feed, and not a CRLF pair. Many tools tolerate CRLF, but strict interface engines expect a bare CR. See the encoding reference.
Message types
Section titled “Message types”What HL7 v2 message types are there?
Common HL7 v2 message types include ADT (admit, discharge, transfer), ORM (orders), ORU (observation results), SIU (scheduling), MDM (medical documents), DFT (financial transactions), and ACK (acknowledgments). Each defines its own set of trigger events.
What is the difference between ADT A01, A04, and A08?
A01 is an inpatient admission, A04 is an outpatient or emergency registration, and A08 is an update to existing patient information. All three are ADT trigger events; A08 is the most common in routine demographic-synchronization interfaces.
What is an HL7 ACK message?
An ACK (acknowledgment) is the response a receiver returns to confirm an HL7 message. Its MSA segment carries an acknowledgment code — AA, AE, or AR — and echoes the original message control ID so the sender can correlate the response.
What is the difference between ORM and ORU messages?
An ORM message places and manages orders — a provider ordering a lab test or imaging study. An ORU message returns the results. Together they form the bidirectional order-and-result loop between a CPOE system and an ancillary system.
What is an HL7 SIU scheduling message?
SIU (Scheduling Information Unsolicited) messages communicate appointment activity — new bookings, reschedules, modifications, and cancellations — between a scheduling system and downstream EHR or resource-management systems. See the SIU reference.
Transport and integration
Section titled “Transport and integration”What is MLLP?
MLLP (Minimum Lower Layer Protocol) is the standard TCP transport for HL7 v2. It frames each message with a start block (0x0B) and an end-block sequence (0x1C 0x0D) so a receiver knows where one message ends and the next begins on a persistent connection. See the MLLP reference.
What port does HL7 use?
HL7 v2 over MLLP has no officially assigned port. IANA registers port 2575 for HL7, but it is rarely used in practice — interfaces typically run on ports in the 5000–6999 range, often one port per channel. Always confirm the configured port with the receiving system.
Is HL7 encrypted, and how do you secure it?
Plain MLLP transmits HL7 in cleartext. To meet HIPAA requirements for protected health information in transit, run MLLP over TLS (version 1.2 or higher), or confine the traffic to a dedicated, otherwise-secured network. Mutual TLS is recommended for cross-organization interfaces.
What is an HL7 interface engine?
An interface engine (also called an integration engine) — such as Mirth Connect, Rhapsody, or Cloverleaf — receives, transforms, routes, and monitors HL7 messages between systems. It is the central hub of most hospital integration architectures and the usual endpoint of an MLLP connection.
What do the HL7 acknowledgment codes AA, AE, and AR mean?
They are the values of MSA-1 in an ACK message. AA (Application Accept) means the message processed successfully. AE (Application Error) means it was understood but could not be processed — fix and resend. AR (Application Reject) means a structural or protocol problem — resolve the cause before resending.
Troubleshooting
Section titled “Troubleshooting”Why is my HL7 interface not receiving messages?
Common causes: the listener is not bound to the expected port, a firewall is blocking the TCP connection, the sender is pointed at the wrong host or port, or the two ends disagree on MLLP framing. Test the raw TCP path first, then confirm the port and MLLP settings on both sides.
Why am I getting duplicate HL7 messages?
Duplicates usually come from retransmission after a missed or slow acknowledgment — the sender resends a message it never got an ACK for. Receivers should deduplicate on MSH-10, the message control ID: process the first instance and return AA for repeats.
Why does an HL7 message fail patient matching?
Patient-matching failures usually trace to PID-3 — a missing or wrong identifier, a missing assigning authority, or an identifier-type mismatch between systems. Confirm both sides agree on which identifier and assigning authority are authoritative.
How do I debug an HL7 message that failed to process?
Start with the ACK: the MSA-3 text and the ERR segment name the problem, often down to the exact field. Then parse the raw message — the HL7 Workbench highlights segments and looks up fields — and compare it against the structure the receiver expects.