contact us

HL7 Messages Examples – Complete Guide 2024

Get the inside scoop on the latest healthcare trends and receive sneak peeks at new updates, exclusive content, and helpful tips.

Contact Us

    Posted in HL7

    Last Updated | June 14, 2024

    HL7 Messages Examples

    Data is sent between disparate networks via HL7 messages. A collection of segments organized in a predetermined order make up an HL7 message. Thus, we opted for the topic for our article today where you get to explore everything you need to know about HL7 messages examples.

    Exploring further the world of HL7 messages, we’ll dig deeper about the specific HL7 message structure and HL7 message format used to exchange healthcare data. HL7 messages, whether HL7 ADT (Admit, Discharge, Transfer) messages or other types, follow a defined format built upon segments. These HL7 segments, like building blocks, contain specific data points using standardized codes. The HL7 message format ensures clear communication regardless of the HL7 encoding characters or HL7 file format used.

    By understanding these components, we can decipher the intricate language of HL7 messages (ADT and others) and unlock the power of data exchange across healthcare networks.

    What are HL7 Messages Examples?

    HL7 messages examples are used whenever healthcare data needs to be transferred between disparate systems or different healthcare providers. So basically, an HL 7 message is a hierarchical structure called connected to a trigger event. These messages are sent in response to trigger events associated with patients, such as when a patient is being admitted into a clinic or when they are being discharged. Each HL7 message comprises of various segments in a specific sequence and take some practice to decipher.

    Doctor with smart device

    A collection of one or more messages is used to send information while using the standard HL7 data format. One record or piece of health-related information is transmitted in each message.

    What is Hl7 Message Structure?

    Each HL7 message consists of one or more segments, which make up different lines of text. Every HL7 message contains the HL7 message types, which specifies the message’s intended use. A carriage return character (\r)) separates each segment from the next. Each segment further contains fields, which are separated by the pipe ‘|’ character. Each field may contain further sub-fields, each of which are separated by the ‘^’ character. The sorts of data that can be found in a field used in an HL7 message structure are specified by HL7 data types. A string, text, timestamp, address, or coded element are some examples.

    Doctor with Smart Device

    Each HL7 message includes a message type, dictated by a three character code, which indicates why the message is being sent and which triggers an event. The MSH-9 field of the message contains both the message type as well as the trigger event.  For instance, in an HL7 message such as ADT-A01, the field ADT is the HL7 message type, and A01 is the trigger event. This type of message reads as “patient admit” message.

    What does ADT in HL7 stand for?

    Notifications of admission, discharge, and transfer (ADT) are frequently cited as a crucial component of enhancing patient care coordination through health information exchange. Or you can say that as it contains information for numerous trigger events such as patient admissions, registrations, cancellations, updates, discharges, patient data mergers, etc., ADT message types are one of the most popular and high-volume ADT messages HL7 types.

    Doctor with smart device

    When a patient is admitted to a hospital, transferred to another location, or released from the hospital, ADT HL7 messages are delivered. Then HL7 ADT notifications are issued to keep doctors and care management teams informed about a patient’s condition, facilitating follow-up and enhancing provider communication while assisting patients with multiple or chronic diseases.

    ADT HL7 message also assists in identifying people who use the healthcare system frequently or intensively. This enables healthcare professionals to direct those patients toward clinical and non-clinical therapies, lowering overutilization by averting unnecessary trips to the ER and readmissions to the hospital.

    In addition to carrying patient personal data for HL7 communications, HL7 ADT message types also provide vital information concerning trigger events (such as patient admit, discharge, transfer, registration, etc.).

    What is the Most Commonly Used HL7 Message Type List?

    Some of the many HL7 messaging types are listed below;

    ACK – General acknowledgement
    ADT – Admit, Discharge, Transfer
    BAR – Add/change billing account
    DFT – Detailed financial transaction
    MDM – Medical document management
    MFN – Master files notification
    ORM – Order (Pharmacy/treatment)
    ORU – Observation result (unsolicited)
    QRY – Query, original mode
    RAS – Pharmacy/treatment administration
    RDE – Pharmacy/treatment encoded order
    RGV – Pharmacy/treatment give.
    SIU – Scheduling information unsolicited

    Streamlining healthcare communication

    How to Read HL7 Messages and HL7 Files?

    Here is what a typical HL7 message looks like:









    Before you attempt to read this complicated HL7 message, you should understand its various components. Each HL7 message contains various segments, fields, components, and subcomponents. Every line in a message is called a segment and contains information of a specific type. Each segment has a three-character label, such as ‘MSH’, ‘PV1’, ‘NK1’ or ‘PID’, and a hierarchy of fields and sub-fields grouping related data. Various fields within each segment are separated by the ‘|’ character. If a segment or field is being repeated, it is indicated by the presence of the ‘~’ character. Within each field, components are separated by the ‘^’ character, while sub-components are separated by the ‘&’ character.

    HL7 Messages and HL7 Files

    Now that you can sort out each part of the message, it is time to decipher each segment separately.  Remember that each segment of the message contains one specific category of information, which is evident from the three character code. In our example message, we see four different HL7 segments. The MSH segments holds information about the sender and receiver of the message, as well as the time stamp. Since the MSH segment contains information about the message itself, each HL7 message has MSH as the first segment, and EVN (event type) as the second segment. The PID segment incorporates patient demographics, such as name, medical ID, location, and such. The Next of Kin (NK1) segment delineates information about the patient’s next of kin, while the PV1 segment includes every piece of data related to patient’s hospital stay, such as the doctor and assigned room. “0x0D” marks the end of each segment.

    Now, let’s dig deeper within each segment. Each segment consists of several fields, separated by ‘|’. Each field can be a primitive data type or contain more fields (sub-fields), denoted by the character ‘^’. Sub-fields may further contain sub-sub-fields, which are separated by the ‘&’ character.

    Remember that segments are either mandatory or optional. For instance, the MSH segment and the PID (Patient identification) segment are necessary to understand messages such as ADT^A04 (Register Patient). Some segments, such as those containing patient allergen information, are optional since patients may or may not have allergies.

    HL7 Integration Services

    How Many Types of HL7 Messages Are There?

    There are many types of HL7 messages, each with its own unique purpose and message contents. Each message format in HL7 has a specific code of three characters and each serves to trigger an event. While there are numerous messaging formats in HL7, the most common include ACK (General Acknowledgment), ADT: Admission, Discharge, and Transfer, which carry patient demographic information, and ORM: Pharmacy/Treatment Order Message which carries information about an order. The ORU message type: Observation message type transmits observations and results, such as clinical lab results and imaging reports, from the producing system. SIU: Schedule Information message type is used to create, modify, and delete patient appointments and has 14 different trigger events.

    Similarly, the RDE: Pharmacy/treatment Encoded Order Message is used by clinics to send orders to the pharmacies. Other important messaging types in HL7 include BAR – Add/change billing account, QRY – Query, original mode, MFN – Master files notification, and DFT – Detailed financial transaction.

    3 Interesting Facts About HL7

    3 Interesting Facts About HL7

    With the digital wave the healthcare is continuously undergoing change and with HL7 implemented more the usage of different types of HL7 messages.

    Standardized Healthcare Lingo

    HL7 messages work as a common language for healthcare data, ensuring consistent communication between disparate systems. Imagine an HL7 ADT (Admit, Discharge, Transfer) message in HL7 format. This message, containing specific HL7 segments, would transmit patient information using standardized codes, regardless of the HL7 file format or encoding characters used. This consistency helps prevent misunderstandings when exchanging HL7 messages (ADT or other message types) and improves patient care.

    Seven Layers of Structure

    HL7 isn’t a single standard, but a suite of standards organized into seven distinct layers. Each layer tackles a specific aspect of data exchange, like how HL7 messages are formatted (including segments) or how security is handled in an HL7 file. This layered approach allows for a lot of flexibility and customization, regardless of the specific HL7 message structure or HL7 file format used.

    Global Reach, Local Impact

    HL7 format is an international standard used in many countries around the world. But it’s also designed to be adaptable to specific regional needs. So, while the core principles of HL7 encoding characters and HL7 ADT message types remain the same, there might be variations in how HL7 is implemented in different healthcare systems, affecting how HL7 ADT messages structure or other HL7 message types are constructed.

    How Are Hl7 Messages Transmitted?

    HL7 messages are generally transmitted using the TCP/IP protocol over a local network, such as within an hospital. TCP/IP data is sent as a stream of bytes, which means that numerous message may be sent as a continuous stream. But this creates a confusion, since we would need to define a starting and ending point for each HL7 message. This is where you can use Minimal Lower-Layer Protocol to add a header and footer to each message to know where it begins and ends. These headers and footers are not actually shown in the transmitted message.

    HL7 message transmission needs an adequately designed protocol in the hospital. For this reason, a well-designed UX design healthcare will help ensure proper protocol implementation, hence proper HL7 message transmission. Also, you can depend on Folio3’s integration service for a good UX design.

    Folio3 hl7 integration solutions work accurately alongside some of the most challenging healthcare apps.

    What is Hl7 V3?

    The Health Level 7 Version 3 is quite different from version 2, since it supports the exchange of clinical information and electronic documents in the XML syntax. The V3 specification was released to eliminate variances and improve interoperability between all users of the standard. Another difference is that v3 includes both messages and documents, which are also called clinical document architecture.

    What does ORM stand for in hl7?

    The HL7 ORM (Order Entry Message) is a general order message that is used to transmit information about a patient-specific order against a trigger event, such as a new order placement, a cancellation of an existing order, updates to an order, discontinuation, etc. While most HL7 messages have several types, the ORM message only has one; ORM^001. Each ORM message consists of several segments and groups of repeating and non-repeating segments, such as the MSH, PID (in case of a new order), a notes and comments segment (NTE2), observation (OBX),  information about Patient visit (PV1 and PV2), diagnosis (DG1), insurance details, Clinical trial information (CTI) and billing details (BLG).

    An order’s details are transmitted via the ORM HL7 messages (HL7 ORM-O01 message), which serves as a generic order message. The ORM-O01 message is the sole type of ORM messages in HL7. Changes to an order, such as additions, cancellations, information modifications, discontinuation, etc., are trigger events for the O01 – ORM HL7 message. One of the most often used message kinds in the HL7 message formats is ORM messages.

    A “request for service” that is sent across apps, or maybe even within a single application, is what is known as an order (an application can send orders to itself). Each segment and collection of segments that make up an ORM message may be necessary, optional, repeated, or any combination of these in the HL7 messages format.

    How Can You Tell If A Message Is An Hl7 V2?

    A typical HL7 V2 message has a 3 character string identifier, such as ACK (Acknowledgement), ADT (Send Demographic Update), or RSP (Return Immunization History). The trigger of a V2 message is a real-life event that necessitated communication, such as patient admission into a clinical facility. Unlike flat file structures, version 2 messages can be expanded or shortened to carry only the necessary data. For instance, some segments and fields are optional or repeat. If no information is available for a patient’s next of kin (NK1), this segment can be removed, or if there are multiple Next of Kin, each would have a separate NK1 repeat segment. Each V2 message is composed of several segments, each with its own identifier and a separate line. Each segment is composed of composites, which carry the data. Each field within a segment is separated by the ‘|’ character. Each sub-composite within a field is separated by a ‘^’ character. Repeating fields are preceded by the ‘~’ character.

    This is how a simple V2 ACK message looks like!

    MSA|AA|9B38584D|Everything was okay dokay!|

    Here, the MSH segment contains information about the message itself, such as the time stamp, and the sender and the receiver of the message. MSH-10 field contains the message ID. When a message is acknowledged, this field of the acknowledgment message contains the same identifier as the message that it is acknowledging. The second segment, MSA, denotes the status of the message, here the status is AA, which translates to Positive acknowledgment. The id of the original message is returned in the MSA.

    What is ADT in Healthcare?

    Admission, discharge, transfer (ADT) notifications are most commonly used to exchange the patient status within a healthcare facility.  ADT messages are used to synchronize patient demographic, such as contact information, address, medical Record number, insurance, next of kin, and visit information, such as length of stay and attending physician, across numerous healthcare systems. Initiated by the EMR or a registration application, ADT messages also include reasons for admission or discharge. ADT messages are highly important in value-based care since they contain a repository of valuable information that can affect point-of-care decisions.

    How To Read Hl7 File?

    You need a software such as Health Level 7 to open and read an HL7 file. Without proper software, Windows won’t be open to open this type of file and you will receive an error. If you cannot open your HL7 file correctly, click on “Open with” and choose the pertinent application.

    Can You Define HL7 DFT?

    The DFT message defines a financial transaction that is utilized for patient accounting and communicated to a billing system. This message is delivered between the DSS/Order Filler and the Charge Processor and may contain information such as ancillary costs or patient deposits. The DSS/Order Filler would then check to see if the process was finished.

    The following are examples of DFT-P03 message triggers:

    • Ordered a procedure
    • Scheduled procedure
    • Performed the procedure
    • Future will establish Report incidents to get paid professionally

    FAQs – HL7 Messages Examples

    What is MSH HL7?

    The MSH segment contains important information about the message itself, such as intent, source, destination, as well as some specifics of the syntax of a message. MSH segment includes both the message type and trigger event.

    What is an A08 HL7 message?

    ADT-A08 (update patient information) messages are used to notify the receiving systems of a change in the address or a name of a patient.

    What is an A04 HL7 message?

    ADT-A04 message relates to “register a patient” event. This notification is sent to notify that a patient has arrived or checked in as a one-time, or recurring outpatient, and hasn’t yet been assigned a bed. This message is sent for both emergency room patients and outpatients. For instance, HL7 A04 could be used to signify the start of a trip to the emergency room (also known as casualty, etc.). The term “outpatient registrations” or “emergency admissions” may be used in some systems to describe these occurrences. The visit start date and hour is specified in PV1-44 – Admit Date/Time.

    What are the different ways to integrate Cerner with HL7?

    • Direct integration: This involves connecting Cerner directly to the HL7 server. This is the most secure method of integration, but it can be complex and expensive to set up.
    • Web services: This involves using web services to exchange data between Cerner and the HL7 server. This is a more scalable and cost-effective method of integration than direct integration, but it is not as secure.
    • File-based integration: This involves exchanging data between Cerner and the HL7 server in files. This is the simplest and least expensive method of integration, but it is not as secure as the other methods.

    For details about the solutions, click the link Cerner HL7 integration solutions to explore.

    Are there any specific HL7 messaging standards or versions used in Allscripts EHR integration?

    Allscripts EHR integration supports HL7 v2.x messaging standards, which are widely used for interoperability in healthcare. However, it is important to note that Allscripts may have specific implementation guidelines or customizations based on their product versions, so it’s advisable to consult Allscripts documentation or support for specific details related to their integration capabilities.

    What is an HL7 segment?

    Think of HL7 segments as logical grouping of data field. Each HL7 message consists of several segments, each characterized by a unique 3-character code identifier. Each segment of the message contains one specific category of information, such as patient visit data or insurance data. There are about 120 segment codes available for HL7, including MSH, PID, NK1, and PV1.

    Is HL7 a programming language?

    Yes, HL7 is an actively used programming language which denotes a set international standards for transfer, integration, sharing and retrieval of clinical and administrative data between the medical applications of various healthcare providers. Folio3 Medical app development solutions helps develop application that parse and decode HL7 messages.

    What is sample structure of HL7 message?

    In its most basic form, each HL7 message consists of segments, fields, components and sub-components. Components and subcomponents further contain the data within data fields.

    What are the various types of HL7 ADT messages?

    There are 51 types of ADT message, but a few common ADT messages include:

    • ADT-A01 – patient admit.
    • ADT-A02 – patient transfer.
    • ADT-A03 – patient discharge.
    • ADT-A04 – patient registration.
    • ADT-A05 – patient pre-admission.
    • ADT-A08 – patient information update.
    • ADT-A11 – cancel patient admit.
    • ADT-A12 – cancel patient transfer.

    What types of data can be exchanged using HL7 messaging in healthcare integration?

    HL7 messaging supports the exchange of various types of healthcare data in healthcare integration, including:

    • Patient demographics: Name, age, gender, address, contact information, etc.
    • Clinical observations: Vital signs, laboratory results, imaging reports, medication administration records, etc.
    • Orders and referrals: Diagnostic orders, medication orders, appointment requests, referrals to specialists, etc.
    • Administrative information: Admission/discharge/transfer (ADT) data, insurance details, billing codes, etc.

    What is Z segment in HL7?

    A Z-segment is a message segment that contains clinical or patient data but isn’t actually part of the HL7 standard. The option to add z segments is what makes HL7 such a flexible standard. All Z segments start with “Z”.

    What is an hl7 ORM message?

    In HL7, the ORM is a general order message that is used to transmit information about an order. The ORM message has only one type; ORM-O01 message.

    What does OBX mean in hl7?

    The OBX segment is used to transmit key clinical observation/results back to the requesting system, to another physician system, or or to an archival medical record system.

    What hl7 message has medicines listed?

    The HL7 RDE message is often used to place orders to medication dispensing systems and may contain a full list of the medication a patient has been prescribed with.

    How to convert hl7 message into XML?

    The easiest way to convert raw HL7 messages to XML is to use a HL7 to XML Transformer.

    What is PV1 in hL7?

    The patient visit segment (PV1) contains basic inpatient or outpatient encounter information. This type of message is most commonly used by Registration/Patient Administration applications to communicate information on an account or visit-specific basis.

    Is HL7 a type of file?

    An HL7 file format definition – The majority of HL7 format files come from Health Level 7 by Health Level Seven. In the healthcare industry, computerized medical and administrative information is exchanged, retrieved, and integrated using the HL7 data interchange format.

    What is the field for compendium in hl7?

    The Laboratory Test Compendium Framework within HL7 delineates the laboratory order codes for systems that support the electronic laboratory ordering functionality. Folio3’s team of HL7 integration experts offer exceptional Folio3 EHR/EMR integration services to help organizations gain seamless HL7 integration solutions.

    What is an HL7 message?

    ‘What are HL7 messages?’ is a very common question among the lay people. To simply put, it is a hierarchical structure called an HL7 message is connected to a trigger event. An “incident in the real world of health care” that necessitates the transfer of data between systems” is what the HL7 standard refers to as a trigger event.

    What types of data are covered by HL7 encoding requirements for State Health Departments?

    HL7 encoding requirements for State Health Departments typically cover a broad range of health-related data, including:

    • Patient demographics and identifiers
    • Laboratory results
    • Vital signs and observations
    • Immunization records
    • Reportable diseases and conditions
    • Syndromic surveillance data
    • Public health reporting information

    Why is HL7 messaging important in medical device integration?

    HL7 messaging plays a crucial role in medical device integration as it provides a standardized way for medical devices to communicate with healthcare systems. By using HL7 messages, medical devices can transmit data in a format that is easily understood and interpreted by receiving systems, facilitating the integration of device data into electronic health records and other clinical applications.

    Is DFT is a HL7 message format?

    Financial data is transmitted using the HL7 Detailed Financial Transaction (DFT) protocol between different systems as well as to a billing system for patient accounting and claims creation. This includes details on patient billing and accounts receivable, as well as billing accounts, charges, payments, adjustments, and insurance.

    Looking for Healthcare Integration Solutions?

    The Department System Scheduler (DSS)/Order Filler (i.e., the service provider) and the Charge Processor are the parties involved in a typical HL7 DFT message transmission (ie. Insurer or payee). The Charge Processor obtains the necessary patient demographics and account information for patient registration when the DSS/Order Filler confirms that the patient has received the requested service.

    About the Author

    Noc Folio3