Friday, September 30, 2022
Home Uncategorized Make Sense of HL7 v2 Messages Effortlessly Now

Make Sense of HL7 v2 Messages Effortlessly Now

Prerequisites

  • Beginner Knowledge of HL7

Introduction

If you’ve been in Healthcare Information Technology for any period of time, you have definitely heard of HL7 (Health Level 7). Health Level 7 is one of the leading standards organizations for Healthcare data and its exchange.

HL7 has given the industry the HL7v2, FHIR (Fast Healthcare Interoperability Resources), and CDA (Clinical Document Architecture) standards. However, this article will focus on how anyone can easily make sense of HL7v2, the most widespread of the HL7 standards.

Understanding the Syntax

HL7v2, like any other data standard, has a handful of building blocks that can be used repeatedly. These building blocks are:

  • Segments
  • Fields
  • Components
  • Sub-components

Consider the following HL7 message.

MSH|^~\&|||||20210731102064||ADT^A04|6045117205200356375|P|2.2|18
EVN|A04|20210731102064|||dtrn1
PID|||000133346|^^^^^123e4567-e89b-12d3-a456-426614174000&456e4567-e89b-12d3-a456-426614174000&^UUID|TEST^GUY^R||59444417|M|||
000 9th AVE^^LOSANGELES^CA^90043||(000)000-000|||M|AT|255574|000-00-000
PV1||O|OQA|3|20||890|||MED||||1|||890|O||||||||||||||||||||||||||20121025|0500
PV2|||PAIN|||||20121025
GT1|UPDATEDISCHNO1^OPTWO1^||||000 2ND AVE^^LOS ANGELES^CA^90043|(210)566-6641|||||S |545-87-9294|||||||
IN1|1|MO|||MEDICARE A B|MEDICARE A B|MUTUAL OF OMAHA^BOX 1602-MEDICARE DEPT^OMAHA^NEBRASKA^12667
|729765384|(704)9985989||||||||^^||MO||||||0.00|0||||101028|dtr|||||||1|1||""||""||||Y| 

For the purposes of this section, we will focus on the PID segment.

Segements

Think of an HL7 segment as a bucket that contains data of a specific category. For example, the PID segment is the bucket that contains all the patient data in a message. Below, you can see the entire PID segment from the original HL7 message.

PID|||000133346|^^^^^123e4567-e89b-12d3-a456-426614174000&456e4567-e89b-12d3-a456-426614174000&^UUID|TEST^GUY^R||59444417|M|||

Each segment is separated by a newline character in a message. If you look at the original message, you will see other segments like MSH, EVN, PV1, PV2, etc. Additionally, segments will always be alphanumerical abbreviations and appear on the left-hand side of a message.

Keep in mind that each segment is an abbreviation of the larger category. For example, the PV1 segment contains data around the patient’s visit to the facility.

Fields

A field is comprised of all data between two |’s (pipes). This is the delimiting character for a field in HL7. Consider the third field in the PID segment.

PID|||000133346|

The third field contains the patient identifier ‘000133346’. However, notice that the first two fields are blank. It’s perfectly acceptable for a field to be blank in HL7 if it’s not required according to the version of HL7 that you are using.

Lastly, keep in mind that fields can repeat. A ‘~’ is used to denote a repeating field. A repeating field can be used (when appropriate) in the following way.

|field1~field1_repeated|

Note: Both field1 and field1_repeated can have multiple components within the field itself.

Components

A component is comprised of all data between two ^’s (caret). You will see ^’s within a field (between two pipes). Consider the fifth field of the PID segment.

|TEST^GUY^R|

In this example, the last name, ‘TEST’, is in the first component of the field. The first name, ‘GUY’, is in the second component of the field, and the middle initial, ‘R’, is the third component of the field.

All three are part of the name of the patient but are placed in different components. Components are typically used for things of this nature.

Sub-components

Sub-components are rarer within HL7 messages; however, you will see them occasionally. A sub-component is comprised of all data between two &’s. As you might have guessed, &’s appear within a component. That is, between two ^’s.

Consider the fourth field of PID.

|^^^^^123e4567-e89b-12d3-a456-426614174000&456e4567-e89b-12d3-a456-426614174000&UUID|

Within this field, consider the sixth component.

123e4567-e89b-12d3-a456-426614174000&456e4567-e89b-12d3-a456-426614174000&UUID

Above, you will see three sub-components all separated by &. In this component, 123e4567-e89b-12d3-a456-426614174000 is the first sub-component, 456e4567-e89b-12d3-a456-426614174000 is the second sub-component, and UUID is the third sub-component.

Referencing Data and Counting Pipes

In the above sections, we walked through every type of data bucket in the PID segment. However, you will see data referenced in a specific way in the context of an HL7 message. You will often hear this called “counting pipes” because the referencing system starts with segments and fields.

Consider the fourth field of PID once again.

|^^^^^123e4567-e89b-12d3-a456-426614174000&456e4567-e89b-12d3-a456-426614174000&UUID|

Integration professionals would refer to this field as PID.4. Alternatively, you may also see some people use PID-4. The notation uses a ‘.’ or ‘-‘ between the segment and field number.

Now, say you want to reference the sixth component of this field.

123e4567-e89b-12d3-a456-426614174000&456e4567-e89b-12d3-a456-426614174000&UUID

In the same fashion, you would refer to the above using PID.4.6.

Next, say you want to grab 123e4567-e89b-12d3-a456-426614174000 out of PID.4.6. In this scenario, PID.4.6.1 would do the trick.

123e4567-e89b-12d3-a456-426614174000

Once again, remember that you may see some Integration professionals substitute ‘-‘ for ‘.’ when referencing HL7 data.

Notable Segments

So far, we have just honed in on the PID segment in order to understand the structure of an HL7 message. However, there actually is a vast number of HL7 segments available in the standard. Despite this, some segments show up a lot more than others. In this section, we highlight segments that you will see more frequently when working with HL7.

MSH

MSH is the message header segment. This segment defines the source, destination, version, and information regarding the syntax of a message amongst other pieces of header data.

PID

PID is the patient identifier segment. This segment contains data like patient name, address, gender, patient identifier, social security number, etc.

PV1

PV1 is the primary patient visit segment. This segment is mainly used by registration systems to send and obtain data surrounding a patient’s appointment, encounter, case, visit, etc.

OBX

OBX is the observation segment. This segment’s scope is quite broad as it can contain lab data, vitals readings, and the results of various medical evaluations.

Clinical Data Reference

At some point, you will need a clinical data reference in order to determine what data is found in certain segments and fields. There are many resources out there that describe in detail every part of a particular segment or field.

Click here to go to Caristix.com, an easy reference tool for your clinical HL7 needs.

RELATED ARTICLES

Mirth Connect Extensions: What You Need to Know

Prerequisistes Basic Knowledge of Mirth Connect Overview Users can navigate to Mirth Connect's Extensions screen by selecting Extensions on the left-hand side. You should now see the following...

Take a Tour of System Settings in Mirth Connect Now

Prerequisites Basic Knowledge of Mirth Connect Introduction Mirth Connect has a multitude of system settings that are available for configuration. In larger companies, there will often be...

Why You Must Master Mirth’s Message Template Tool Today

Prerequisuites Basic Knowledge of Mirth ConnectKnowledge of Programming in Mirth Connect Introduction When writing scripts in Mirth Connect, you have a message template tool that allows you...

Most Popular

Mirth Connect Extensions: What You Need to Know

Prerequisistes Basic Knowledge of Mirth Connect Overview Users can navigate to Mirth Connect's Extensions screen by selecting Extensions on the left-hand side. You should now see the following...

Take a Tour of System Settings in Mirth Connect Now

Prerequisites Basic Knowledge of Mirth Connect Introduction Mirth Connect has a multitude of system settings that are available for configuration. In larger companies, there will often be...

Why You Must Master Mirth’s Message Template Tool Today

Prerequisuites Basic Knowledge of Mirth ConnectKnowledge of Programming in Mirth Connect Introduction When writing scripts in Mirth Connect, you have a message template tool that allows you...

Make Sense of HL7 v2 Messages Effortlessly Now

Prerequisites Beginner Knowledge of HL7 Introduction If you've been in Healthcare Information Technology for any period of time, you have definitely heard of HL7 (Health Level 7)....

Recent Comments