Working with TCP/IP HL7 Collaborations

Outbound HL7 V3 Collaboration

The Outbound HL7 V3 Collaboration, jcdHL7V3Outbound, contains OTDs for the HL7 V3 Resource Adapter, JMS Data, JMS Journal, and JMS Error, as well as the HL7 V3 Patient Administration Domain Interaction Event (PRPA_IN403001UV01) and the corresponding HL7 V3 Acknowledgements. MCCI_IN000004UV01 for Immediate Mode and MCCI_IN000006UV01 for Deferred Mode. The Collaboration works with its own internal code and the Properties Configuration files. The outbound Collaboration assumes that it is reading valid HL7 V3 messages, so the data flow that feeds this Collaboration must ensure this.

Outbound HL7 V3 Collaboration Overview

The Outbound Collaboration is for both Immediate and Deferred Mode.

HL7 V3 Standard Outbound Message Mode Data Flow (For Immediate and Deferred Mode of ACK Process) — Part 1

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

receive (input, otdHL7eWay_1, otdJMS_JOURNAL, otdJMS_ERROR, otd_MCCI_IN000004UV01_1, otd_MCCI_IN000006UV01_1, otd_PRPA_IN403001UV01_1)

The incoming HL7 V3 message is then validated, making sure that the message structure is correct. Various fields in the Transmission Wrapper of the message are also validated, such as Version Code, Processing Code, Processing Mode Code, and Interaction ID.

If the message does not pass validation, an error occurs and the associated recourse action is applied. If the HL7 V3 message passes validation, the message moves on to processInitialHandshake() to receive a sequence number (if sequences numbering is enabled only for Deferred Mode). 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 V3 message.

Next, the message moves on to processMessage(), which calls the helper method, sendAndReceive(). The sendAndReceive method sends the HL7 V3 message, waits for an HL7 V3 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 V3 message up to the configured number of retries, at which time an error occurs and the associated recourse action is taken.

Figure 1–24 Immediate and Deferred Mode of ACK Process — Part 1

Immediate and Deferred Mode of ACK Process — Part
1

HL7 V3 Standard Outbound Message Mode Data Flow (For Immediate and Deferred Mode of ACK Process) — Part 2

In the processMessage(), the message moves on to insertSequenceNumber(). If sequence numbering is enabled and is in Deferred Mode, the insertSequenceNumber method inserts the sequence number and call sendHL7Message(). The sendHL7Message method sends the HL7 V3 message to the external using the HL7 V3 adapter OTD

The Collaboration receives the HL7 V3 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 in MCCI_IN000004UV01 Otd for Immediate Mode and MCCI_IN000006UV01 Otd for Deferred Mode.

Figure 1–25 Immediate and Deferred Mode of ACK Process — Part 2

Immediate and Deferred Mode of ACK Process — Part
2

HL7 V3 Standard Outbound Message Mode Data Flow (For Immediate and Deferred Mode of ACK Process) — Part 3

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.

If the ACK message validates, the HL7 V3 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 for Deferred Mode, 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 1–26 Immediate and Deferred Mode of ACK Process — Part 3

Immediate and Deferred Mode of ACK Process — Part
3

HL7 V3 Outbound Test Collaboration

For information, see HL7 V2 Outbound Test Collaboration.