Anatomy of an HL7 Message

HL7 Messages that have been defined by Canada Health Infoway all tend to follow the same structure. Most messages contain the following three high-level parts:

  1. The transport wrapper
  2. The control act (or trigger event)
  3. The payload

By example, consider the HL7 message “Get Person Demographics Request”. It appears as follows:

<?xml version="1.0" encoding="UTF-8"?>
<PRPA_IN101101CA xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3"  ITSVersion="XML_1.0">

  ...

  <controlActEvent classCode="CACT" moodCode="EVN">
    <id extension="12345" root="2.16.124.113618.1.1.1.1.1.1"/>

    ...

    <queryByParameter>
      <queryId extension="eventId" root="2.16.124.9.101.1.8"/>
      <parameterList>
        <clientIDBus>
          <value extension="123" root="2.16.124.9.101.1.8.3.3" />
        </clientIDBus>
      </parameterList>
    </queryByParameter>
  </controlActEvent>
</PRPA_IN101101CA>

This request is issuing a query for information about a person whose internal id is 1234 (in the context defined by oid “2.16.124.9.101.1.8.3.3”).

In this case, the outermost part of the message includes the parts that start with the PRPA_IN101101CA element, and this part represents the transport wrapper. The transport wrapper tends to include information about:

  1. Which system sent the message
  2. Which system the message is being sent to
  3. Information about how to handle the messages (synchronously, asynchronously, etc.)
  4. Information about whether or not a response is expected
  5. A flag about whether or not this is a production message or not.
  6. A unique identifier of the message.

The element called (conveniently, in this case) the controlActEvent is the control act or trigger event. It tends to contain information about who authored the request and information that might be used for access control purposes.

The payload portion of the element starts with the section called parameterList. While there’s usually a very common format to the transport wrapper and a handful of variations on the control act, the payloads tend to be very specific to message being sent. In this case, we’re sending the id of a person that we want information about.

It's only fair to share...
Share on FacebookGoogle+Tweet about this on TwitterShare on LinkedIn

One thought on “Anatomy of an HL7 Message

  1. Pingback: You got Reflection in my Generics! You got Generics in my Reflection! | i-Proving –

Leave a Reply