Using the HL7 Binding Component

About the HL7 Binding Component

The HL7 Binding Component enables GlassFish ESB to establish and maintain connection with HL7 messaging systems, manage message enveloping and routing, perform message validations, and implement optional HL7 protocol sequence numbering. The following topics provide overview information for the HL7 messaging standard and the HL7 BC:

The Health Level 7 Messaging Standard

The HL7 Messaging Standard has been around for over 20 years, providing administrative, financial, and clinical messaging standards for the health care industry. This sharing of electronic health care information using the HL7 protocol allows hospitals to streamline all areas of patient care, communicating this information between numerous computer systems and applications from different departments and agencies. The problem is that these various systems and applications are not designed to communicate with each other. The HL7 Binding Component provides a solution by configuring and connecting the HL7 servers and clients within a JBI environment.

The HL7 Binding Component

The HL7 Binding Component supports HL7 Version 2 Messaging Standard (2.1, 2.2, 2.3, 2.3.1, 2.4, 2.5, 2.5.1, and 2.6). HL7 Version 3 can be implemented using other JBI components, such as the HTTP Binding Component using the SOAP protocol.

The HL7 Binding Component enables communication between HL7 servers and clients within a JBI environment. The binding component converts HL7 messages to XML messages within the JBI environment, and converts them back to HL7 messages. It provides both design-time and runtime functionality. The design-time portion uses a set of well-defined WSDL extensibility elements to configure HL7 service endpoints and message mapping. The runtime portion provides connectivity between the JBI framework and external HL7 clients and servers.

Image shows a diagram illustrating the HL7 Binding
Component Architecture.

HL7 Binding Component as a Consumer

    Inbound, in the role of consumer, the HL7 Binding Component (BC) acts as follows:

  1. The HL7 BC receives the HL7 message from an external HL7 system.

  2. The HL7 BC parses the received message. If parsing fails, the HL7 BC sends a NAK to the external HL7 sender.

  3. If validate MSH is enabled, the HL7 BC validates the MSH segment fields for message acceptance. If validation fails, the HL7 BC sends a NAK to the external HL7 sender.

  4. If sequence number is enabled, the HL7 BC validates the MSH-13–Sequence Number field in the received message against the persisted sequence in the database for the inbound endpoint. If the sequence number does not match, the HL7 BC sends a NAK to the external HL7 message sender.

  5. If the HL7 message proves acceptable, the HL7 BC sends the normalized message to the BPEL Service Engine. An ACK or NAK is sent to the external HL7 message sender, based on the message exchange status received from the Normalized Message Router, as follows:

    • An ACK is sent when the message exchange status is Done.

    • A NAK is sent when the message exchange status is Error.

Image illustrates the HL7 Binding Component in
the Consumer role as described in context

HL7 Binding Component as a Provider

    Outbound, in the role of provider, the HL7 Binding Component acts as follows:

  1. The HL7 BC receives the HL7 message from the BPEL Service Engine.

  2. If validate MSH is enabled, the HL7 BC validates the MSH segment fields, MSH-11–Processing ID and MSH-12–Version ID, against the configured Processing ID and Version ID. If validation fails, the HL7 BC sets the message exchange status to Error and sends the message back to the Normalized Message Router.

  3. If sequence number is enabled, the HL7 BC inserts the sequence number in the message.

  4. The HL7 BC converts the normalized message to the HL7 encoded form and sends it to the external HL7 system.

  5. The HL7 BC receives the acknowledgement from the HL7 external system, and determines whether the acknowledgement is an ACK or NAK, and responds as follows:

    • An ACK is sent when the message exchange status is Done.

    • A NAK is sent when the message exchange status is Error.

  6. If the HL7 message proves acceptable, the HL7 BC sends the normalized message to the BPEL Service Engine. An ACK or NAK is sent to the external HL7 message sender, based on the message exchange status received from the Normalized Message Router, as follows:

    • For an ACK, the HL7 BC sets the message exchange status to Done and sends it to the BPEL Service Engine. The ACK is also stored in a database.

    • For a NAK, the HL7 BC sets the message exchange status to Error and sends it to the BPEL Service Engine. The NAK is also stored in a database.

Image illustrates the HL7 Binding Component in
the Provider role as described in context

HL7 Acknowledgements

The HL7 protocol specifies that the system that receives an HL7 message will acknowledge the message by sending an acknowledgement to the message sender. HL7 protocol supports two types of message acknowledgement, Original Mode and Enhanced Mode.

Valid Acknowledgment condition values for MSH-15 and MSH-16 files in an HL7 messages are:

Sequence Numbering

The HL7 protocol uses the sequence number protocol to avoid duplication of messages between sending and receiving systems. The HL7 Binding Component can either play the role of the service consumer (that is, the inbound service endpoint) or the service provider (that is, the outbound service endpoint). In both roles, it supports the sequence numbering protocol for HL7 message transactions.

The negotiation and incrementation of the sequence number is automatically performed by the binding component. The HL7 Binding Component receives the message with the sequence number from the external system, validates the message based on the excepted sequence number stored in the database, and sends a positive or negative acknowledgment with the expected sequence number back to the external system. Sequence numbering is enabled or disabled as an attribute of the HL7 protocolproperties WSDL element.