Transport Specification: MLLP, Release 2

ANSI
ANSI/HL7 V3 TRMLLP, R2-2006 (R2011)
HL7 Version 3 Standard: Transport Specification - MLLP, Release 2 (a reaffirmation of ANSI/HL7 V3 TRMLLP, R2-2006)
11/1/2011
Responsible Group Work Group
HL7
Control Query Co-Chair Grahame Grieve
Kestral Computing
Control Query Co-Chair & Editor Anthony Julian
Mayo Clinic
Control Query Co-Chair Joann Larson
Kaiser Permanente
Control Query Co-Chair Douglas Pratt
Siemens
Control Query Co-Chair Rene Spronk
Ringholm


Table of Contents

Preface
    i Preface
Overview
    1.1 Introduction
    1.2 Protocol specification
        1.2.1 Content exchange model
        1.2.2 Block Format
            1.2.2.1 HL7 Content Block
            1.2.2.2 Commit Acknowledgement Block
        1.2.3 Limitations of MLLP
    1.3 Examples
        1.3.1 HL7 version 2 Example
        1.3.2 HL7 version 3 Example
        1.3.3 CDA Release 2 Example
        1.3.4 MLLP Commit Acknowledgement Example
        1.3.5 MLLP Negative Commit Acknowledgement Example
    1.4 References

In release 2 the MLLP Message Transport protocol has been extended by commit acknowledgements. This is done in order to create a reliable Message Transport protocol, a requirement for all Message Transport protocols used to transport HL7 Version 3 content. See the new Abstract Transport Specification document for this and other transport protocol requirements.

Changes include:

  • The addition of a definition of a commit acknowledgement and a negative commit acknowledgement at the MLLP transport layer.
  • The mandatory use by a destination system of commit acknowledgements. This to denote that the HL7 Content has been received and committed to safe storage.

This document specifies Release 2 of the Minimal Lower Layer Message Transport protocol (MLLP, a.k.a. MLP). Release 1 of the MLLP Message Transport protocol (a version without built-in Reliable delivery assurances) has a long history of use within the HL7 community.

Note on conformance (FAQ): only those applications that claim conformance to MLLP Release 2 (or applications that claim conformance to a future HL7 v3 Normative Edition which contains MLLP Release 2) have to support this specification. HL7 does not require applications which support a MLLP Release 1 conformant transport protocol to upgrade to MLLP Release 2. Upgrading is recommended, but not required.

mllp_layers.gifFigure 1 Abstraction Layers for message transmission

The figure above illustrates the traditional separation between the application layer, the MLLP messaging infrastructure layer, and the message transport layer. Messaging Adapters live inside the Application and provide the interface to the specific messaging stack being used. Messaging adapters are both aware of HL7 and the messaging stack being interfaced. Their role is to prepare the HL7 message for transmission by the messaging infrastructure. The Messaging Infrastructure consists of the runtime components that implement a particular messaging protocol. These components are generally off-the-shelf implementations that have no knowledge of the specific payload being transported. Message Transport: this layer represents the means by which the HL7 message is transported to the appropriate destination. Different protocols might use multiple transports, depending on the implementation, the degree of separation between the protocol and the transport and a number of other factors.

From the application's perspective, it's sending an HL7 message between Application 1 and Application 2. Note that "Application" includes store-and-forward intermediaries, such as Gateways. A Gateway is understood to be an HL7 application that implements delegating capabilities in a distributed healthcare environment. A Gateway performs business level functions in the name of other HL7 Applications.

The application doesn't need to know the details about what's happening in the underlying layers. While the application initiates sending a message, the underlying MLLP messaging takes care of the delivery. The application communicates with the MLLP Messaging Infrastructure through an adapter that deals with the specifics of MLLP and uses the APIs and/or the object model exposed by the MLLP Messaging Infrastructure. In this context, the MLLP Adapter is still part of the application. The MLLP Messaging Infrastructure then sends the message over the specified transport to the receiving application.

The goal of the MLLP Message Transport protocol is to provide an interface between HL7 Applications and the transport protocol that uses minimal overhead. MLLP is based on a minimalistic OSI-session layer framing protocol. It is assumed that MLLP will be used only in a network environment. Most of the details of error detection and correction are handled by the lower levels of any reasonable transport protocol (e.g. TCP/IP, SNA) and do not require any supplementation. The network protocol and the network behavior have to be agreed upon by the communicating parties prior to the exchange of data. MLLP Release 2 covers the absolute minimal requirements in order for it to be a reliable Message Transport protocol.

MLLP has limited support for character encodings, see below for details. MLLP supports (amongst other message encodings and ITSs) the vertical bar and XML HL7 version 2 message encodings and the version 3 XML ITS. It may not be applicable to some HL7 version 3 ITSs. ITS's may require an inherent protocol stack that precludes their use of MLLP.

MLLP Release 2 is a reliable Message Transport protocol. It guarantees In Order delivery and At Least Once delivery of HL7 Content. HL7 Content is framed in a Block and sent to the Destination system. The Destination system acknowledges the receipt of the message by returning a Commit Acknowledgement message. The MLLP acknowledgement protocol is synchronous: the Source system shall not send new HL7 content until an acknowledgement for the previous HL7 Content has been received. Figure 2 Interaction Diagram

mllp3.gif

All HL7 Content (of any kind or type) is framed in a Block and sent to the Destination system. The Destination system acknowledges the receipt of the Block by returning a Commit Acknowledgement message. If the HL7 Content (a query in the example below) triggers the sending of HL7 Content (a Response) by the Destination system, then this HL7 Content is framed in a Block and sent. MLLP has no knowledge of the HL7 Content, nor does it base any part of its behaviour on HL7 Content.

The behavior of the Source is described by the pseudo-code shown below. The Source should empty its inbound buffer prior to sending a Block to ensure that a Commit Acknowledgement is related to the Block that was just sent, and not to a prior Block.

  1. "Send Block with HL7 Content, block and wait for Affirmative Commit Acknowledgement, Negative Commit Acknowledge, or a Timeout. "
  2. "In case of Affirmative Commit Acknowledgement (ACK), finished. "
  3. If case of Negative Commit Acknowledgement the subsequent step is subject to implementation decisions. The default behavior is
    1. If the preset number of retries has been reached, notify sender of delivery failure, with reason code.
    2. Otherwise go to step 1 to resend the block.
  4. In case of a Timeout the subsequent step is subject to implementation decisions. The default behavior is:
    1. If preset number of retries has been reached, or if a pre-specified time has elapsed, notify SENDER of delivery failure, with reason code.
    2. otherwise go to step 1 to resend the Block.

See the Abstract Transport Specification document for additional information on application faults raised by Message Adapters.

The behavior of the Destination is described by the pseudo-code shown below. The Destination should respond immediately with a Commit Acknowledgement upon receipt of a Block. The Destination should ensure that it sends Acknowledgements related to the last message received, and not to prior messages. It is recommended that the Destination empty its inbound buffer prior to the sending of an Acknowledgement.

  1. Receive and ignore any received bytes until the start of a Block is found.
  2. Continue to receive bytes until the end of a Block is found, or until a Timeout occurs.
  3. In case of a Timeout, ignore all bytes received thus far; go to step 1.
  4. Once an entire Block has been received, attempt to commit the HL7 Content to storage.
  5. In case the HL7 Content has been successfully committed to storage, send an Affirmative Commit Acknowledgement (ACK); go to step 1.
  6. In case the HL7 Content can't be committed to storage, send a Negative Commit Acknowledgement (NAK); go to step 1.

Timeouts have to be agreed upon by the communicating parties. It is recommended that the Source use a timeout of between 5 and 30 seconds before giving up on listening for a Commit Acknowledgement. It is recommended that the Destination use a timeout that is at least twice as high as the Source's timeout (e.g. 40 seconds or more) before flushing its inbound buffer.

HL7 content is enclosed by special characters to form a Block. The Block format is as follows: <SB>dddd<EB><CR>

  • <SB>: Start Block character (1 byte). ASCII <VT>, i.e., <0x0B>.
  • dddd: Data (variable number of bytes). This is the HL7 data content of the Block.
    The data can contain any single-byte values greater than 0x1F (see below for a discussion of issues related to character encodings) and the ASCII carriage return character, <CR>.
  • <EB>: End Block character (1 byte). ASCII <FS>, i.e., <0x1C>.
  • <CR>: Carriage Return (1 byte). ASCII <CR> character, i.e., <0x0D>.

In pseudo BNF-notation the HL7 Content Block Format is as follows:

HL7-Content-Block = SB, dddd, EB, CR.
     dddd = ( printableChar | CR )-sequence.
     printableChar = 0x20 | 0x21 | 0x22 | .. | 0xFF.
     SB = 0x0B.
     EB = 0x1C.
     CR = 0x0D.

MLLP protocol status information is enclosed by special characters to form a Block.
The Block format for Commit Acknowledgements is as follows: <SB><ACK><EB><CR> or <SB><NAK><EB><CR>

  • <SB>: Start Block character (1 byte). ASCII <VT>, i.e., <0x0B>.
    This should not be confused with the ASCII characters SOH or STX.
  • <ACK> or <NAK>: Either the acknowledgement character (1 byte, ASCII <ACK>, i.e., <0x06>) or the negative-acknowledgement character (1 byte, ASCII <NAK>, i.e., <0x15>).
  • <EB>: End Block character (1 byte). ASCII <FS>, i.e., <0x1C>.
  • <CR>: Carriage Return (1 byte). ASCII <CR> character, i.e., <0x0D>.

In pseudo BNF-notation the Commit Acknowledgement Block Format is as follows:

Commit-Acknowledgement-Block = SB, ( ACK | NAK ), EB, CR.
     SB = 0x0B.
     ACK = 0x06.
     NAK = 0x15.
     EB = 0x1C.
     CR = 0x0D.

Note that the receipt of unframed characters (e.g. characters between <EB><CR> of Block N and <SB> of Block N+1) should be ignored by the Destination system. This type of error shall not be reported using a MLLP Commit Acknowledgement.

The MLLP Block is framed by single-byte values. The characters transmitted within the MLLP Block have to be encoded in such a way that the HL7 Content does not conflict with the byte values used for framing. Some multi-byte character encodings (e.g. UTF-16, UTF-32) may result in byte values equal to the MLLP framing characters or byte values lower than 0x1F, resulting in errors. These character encodings are therefore not supported by MLLP.

Note on supported encodings (FAQ): MLLP supports all single-byte character encodings (e.g. iso-8859-x, cp1252) as well as UTF-8 and Shift_JIS. The byte values used by UTF-8 do not conflict with the byte values used for MLLP framing.

The sending and receiving systems will have to mutually agree upon the encoding used for a given connection. Most applications within a certain geographic/language area share the same character encoding. U.S./Canadian implementations of MLLP typically use the UTF-8 encoding; Western European (Germanic and Latin language areas) implementations typically use the ISO 8859-1 encoding.

This section contains a number of examples of MLLP-framed HL7 payloads, where <SB> <EB>, <CR>, <ACK> and <NAK> are used to denote the non-printable single-byte values 0x0B, 0x1C, 0x0D, 0x06 and 0x15. They are not to be interpreted as XML-tags.

<SB>
MSH|^~\&|ZIS|1^AHospital|||200405141144||ADT^A01|20041104082400|P|2.3|||
AL|NE|||8859/15|<CR>EVN|A01|20041104082400.0000+0100|20041104082400<CR>
PID||""|10||Vries^Danny^D.^^de||19951202|M|||Rembrandlaan^7^Leiden^^7301TH^""
^^P||""|""||""|||||||""|""<CR>PV1||I|3w^301^""^01|S|||100^van den Berg^^A.S.
^^""^dr|""||9||||H||||20041104082400.0000+0100<CR>
<EB><CR> 
<SB>
<?xml version="1.0" encoding="ISO-8859-15"?>
	<MFMT_IN10001NL xmlns="urn:hl7-org:v3" xmlns:voc="urn:hl7-org:v3/voc" 
	         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<id extension="10213" root="2.16.840.1.113883.2.4.99.1.700222.1"/>
	<creationTime value="20050216140000"/>
	<versionId>V3ED2005</versionId>
	<interactionId extension="MFMT_IN100010NL" root="2.16.840.1.113883"/>
	<processingCode code="P"/>
	. . .
	. . .
	</MFMT_IN10001NL>
<EB><CR>
<SB>				
<?xml version="1.0"?>
     <ClinicalDocument xmlns="urn:hl7-org:v3" xmlns:voc="urn:hl7-org:v3/voc" 
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xsi:schemaLocation="urn:hl7-org:v3 CDA.ReleaseTwo.Dec.2003.xsd">

	<id extension="c266" root="2.16.840.1.113883.3.933"/>
	<code code="11488-4" codeSystem="2.16.840.1.113883.6.1" 
               displayName="Consultation note"/>
	<title>Good Health Clinic Consultation Note</title>
	<effectiveTime value="20040407"/>
	<setId extension="BB35" root="2.16.840.1.113883.3.933"/>
	<versionNumber value="2"/>		
			. . .
			. . .
     </ClinicalDocument>
<EB><CR>
<SB><ACK><EB><CR>

The specification of MLLP Release 1 is based on the HL7 Implementation Guide for HL7 version 2.3.1, appendix C "Lower Layer Protocols", section C.4

Return to top of page