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:
- The transport wrapper
- The control act (or trigger event)
- 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="126.96.36.1996188.8.131.52.1.1.1"/> ... <queryByParameter> <queryId extension="eventId" root="184.108.40.206.101.1.8"/> <parameterList> <clientIDBus> <value extension="123" root="220.127.116.11.18.104.22.168.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 “22.214.171.124.126.96.36.199.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:
- Which system sent the message
- Which system the message is being sent to
- Information about how to handle the messages (synchronously, asynchronously, etc.)
- Information about whether or not a response is expected
- A flag about whether or not this is a production message or not.
- 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.