Installing Upgrading Designing Configuring Deploying Monitoring Administering Troubleshooting Reference JBI Components
Close Print View
Designing: Outbound HL7 V2 Collaboration Overview
 

Classic Java CAPS

Developing Java CAPS Projects

Using SOAP Message Handlers

Creating a Runtime Environment

Designing Business Processes in the Sun Business Process Manager

Working with TCP/IP HL7 Collaborations

TCP/IP HL7 Adapter Collaborations Overview

TCP/IP HL7 Adapter Task Overview

TCP/IP HL7 V2 Adapter Collaborations

Inbound HL7 V2 Collaboration Overview

Outbound HL7 V2 Collaboration Overview

Limitations of Version 2.x

Creating a Copy of an HL7 V2 Project

To Export a Project

Customizing Predefined Collaborations for HL7 V2

Creating Copies of an HL7 V2 Collaborations

To Create Copies of an HL7 V2 Collaborations

Adding HL7 V2 OTD to an Existing Collaboration

To Add HL7 V2 OTD to an Existing Collaboration

TCP/IP HL7 V3 Adapter Collaborations

Introducing the Methodology

What's New with HL7 V3

Artifact Identification System

HL7 V3 Message Development Process

Artifact Codes

Transmission Wrapper and Control Act Wrapper

Comparison between HL7 V2.x and HL7 V3

Benefits of V3 to HL7

Inbound HL7 V3 Collaboration

Inbound HL7 V3 Immediate Collaboration Overview

Inbound HL7 V3 Deferred Collaboration Overview

Outbound HL7 V3 Collaboration

Outbound HL7 V3 Collaboration Overview

Creating a Copy of an HL7 V3 Project

Customizing Predefined Collaborations for HL7 V3

Creating Copies of an HL7 V3 Collaborations

Adding HL7 V3 OTD to an Existing Collaboration

To Add HL7 V3 OTD to an Existing Collaboration

MLLP V2

MLLP V2 Content Exchange Model

Standard Inbound HL7 V2 Collaboration Overview over MLLPV2

Developing Sun Master Indexes (Repository)

Developing Sun Master Patient Indexes

Developing OTDs for Application Adapters

Developing OTDs for Communication Adapters

Developing OTDs for Database Adapters

Developing OTDs for Web Server Adapters

Designing with Application Adapters

Designing with Communication Adapters

Designing with Web Server Adapters

SWIFT Integration Projects

Java EE Based Components

Designing with Sun JCA Adapters

About the TCP/IP JCA Adapter

Defining Constants and Variables

Using Database Operations

Developing Sun Master Indexes

Using the JMS JCA Wizard

Using the JAXB Wizard and Code-Seeder Pallete

Outbound HL7 V2 Collaboration Overview

The Outbound HL7 V2 Collaboration, jcdHL7Outbound, contains OTDs for the HL7 Resource Adapter, JMS Data, HL7 ACK, JMS Journal, and JMS Error, as well as the Generic HL7 Event. The Collaboration works with its own internal code and the Properties Configuration files. The outbound Collaboration assumes that it is reading valid HL7 V2 messages, so the data flow that feeds this Collaboration must ensure this.

Outbound HL7 V2 Collaboration - Part 1

The Collaboration is triggered by a JMS HL7 V2 message. The Collaboration then calls the HL7 User Collaboration Rule by executing the receive method. Receive is the entry point to the HL7 User Collaboration, with the following signature,

receive (input, otdHL7eWay_1, otdJMS_JOURNAL, otdJMS_ERROR, otdHL7_ACK_1, otdHL7_GENERIC_EVT_1)

The incoming HL7 V2 message is then validated, making sure that the message structure is correct. Various fields of the message are also validated, such as Sending Facility, version ID, and MSH.

If the message does not pass validation, an error occurs and the associated recourse action is applied. If the HL7 V2 message passes validation, the message moves on to processInitialHandshake() to receive a sequence number (if sequences numbering is enabled). The Collaboration takes the sequence number from the Sequence Numbering file and determines the next number to use. This number is then inserted into the HL7 V2 message.

Next, the message moves on to processMessage(), which calls the helper method, sendAndReceive(). The sendAndReceive method sends the HL7 message, waits for an HL7 ACK message, and processes the ACK or NAK. The validation also checks the message structure to see if the message is unmarshaled. If a valid ACK is not received, it continues to send the HL7 V2 message up to the configured number of retries, at which time an error occurs and the associated recourse action is taken. If a valid ACK is received, the message moves on to insertSequenceNumber().

If sequence numbering is enabled, the insertSequenceNumber method inserts the sequence number and call sendHL7Message().

The sendHL7Message method sends the HL7 V2 message to the external using the HL7 adapter OTD.

Figure 4 Outbound HL7 V2 Collaboration - Part 1
Outbound Collaboration — Part 1
Outbound HL7 V2 Collaboration - Part 2

The Collaboration receives the HL7 ACK or NAK from the external using receiveHL7AckNak(). If an exception occurs due to incomplete data, and the adapter fails to read the data within the configured number of retries, the associated recourse action is taken. If the exception is due to no response, the associated recourse action is taken. If no exception occurs, the ACK or NAK message moves on to isAckMessage(), which validates the message to determine whether the message is an ACK or a NAK.

Next the validateAckNak method unmarshalls the message to the ACK OTD and does validation on the MSH/MSA data. In addition, it also calls other helper methods such as checkSendingReceivingApplication() and checkSendingReceivingFacility() to validate the ACK message.

If the message does not pass validation it is handled as a NAK, the associated recourse action is taken, and the message is archived in the Error Queue.

If the message is a NAK, the associated recourse action is taken, and the message is archived in the Error Queue, along with the NAK message, as a JMS property.

If the message is an ACK and passes validation, the message is sent on to the journalMessage method

Figure 5 Outbound HL7 V2 Collaboration - Part 2
Outbound Collaboration — Part 2
Outbound HL7 V2 Collaboration - Part 3

If the ACK message validates, the HL7 V2 message and ACK message are sent to the JMS Journal Destination. If the message fails to journal, the associated recourse action is taken.

If Sequence Numbering is enabled, the processAckNakSequenceNumbering method calculates the next sequence number and stores the number in the sequence number file, calling updateSequenceNumberFile to persist the next sequence number.

Figure 6 Outbound HL7 V2 Collaboration - Part 3
Outbound Collaboration — Part 3
HL7 V2 Outbound Test Collaboration

In addition to the Inbound and Outbound HL7 V2 Collaborations, an Outbound test Collaboration, jcdHL7OutboundTestDriver, is provided to test the HL7 V2 Outbound and HL7 V2 Outbound Delayed ACK samples.

The jcdHL7OutboundTestDriver Collaboration simply picks up HL7 V2 messages from the File eWay and sends the message to the JMS queue. This is used by the sample Projects to test the number of HL7 V2 messages processed per minute.