HL7 (Health Level Seven) is a messaging standard for data transfer and consistency across disparate systems. HL7 plays a major role in healthcare interoperability and is used to define the format for the transmission of health-related information.
Health data sent using the HL7 standard is transmitted as a collection of one or more messages. Each message sends one record or item of health-related information. Some common examples of HL7 messages include patient records, laboratory records and billing information.
The following video describes the contents of an HL7 message and how a message is organized. After watching this video you will understand the following concepts:
- The components of an HL7 message;
- The delimiter characters that are used to separate these components;
- How to determine the HL7 message type;
- How HL7 message segments are organized.
Watch now: What are HL7 Message Components?
HL7 messages are in human-readable (ASCII) format, though they may require some effort to interpret. HL7 messages consists of 3 main components:
Let’s take a closer look at each HL7 message component.
An HL7 message consists of one or more segments, which contains one specific category of information, such as patient information or patient visit data.
A carriage return character (\r, which is 0D in hexadecimal) separates one segment from another. Each segment is displayed on a different line of text (as seen in the sample HL7 message below).
If you are interested in learning more about segments, we suggest reading the following article.
Further, segments consists of one or more composites, also known as fields. A pipe (|) character is used to separate one composite from another.
If a composite contains other composites, these sub-composites (or sub-fields) are normally separated by ^ characters.
Now that we understand HL7 message components, let’s explore a typical sample HL7 message, and describe segments and composites in more detail.
Sample HL7 message
PID||0493575^^^2^ID 1|454721||DOE^JOHN^^^^|DOE^JOHN^^^^|19480203|M||B|254 MYSTREET AVE^^MYTOWN^OH^44123^USA||(216)123-4567|||M|NON|400003403~1129086|
PV1||O|168 ~219~C~PMA^^^^^^^^^||||277^ALLEN MYLASTNAME^BONNIE^^^^|||||||||| ||2688684|||||||||||||||||||||||||199912271408||||||002376853
In this example, you will notice that we have 5 distinct segments separated by the carriage return character: MSH, PID, AVE, NK1 and PV1.
You will also notice that each segment contains a number of composites. For example, in the first line, the pipe character (|) separates the SMS and SMS ADT segments.
Finally, on the second line, the first name sub-field JOHN is separated from the last name DOE using the ^ character.
Determining the HL7 Message Type
To determine the message type of an HL7 message, examine its MSH segment. The message type is normally the ninth field of this segment. For example, consider this MSH segment, which you have seen before:
Here, the HL7 message type is ADT^A04, which is “Register a Patient”.
Looking for professional advice? Contact an HL7 integration specialist today.