The Inbound HL7 V3 Collaboration, jcdHL7V3Inbound, contains Message Libraries 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). The Collaboration works with its own internal code and the properties configuration files.
Immediate mode contains only one type of Acknowledgement Message Library, MCCI_IN000004UV01.
The following topics describe the business logic defined in the jcdHL7V3Inbound Collaboration:
HL7 V3 Standard Inbound Message Mode Data Flow (For Immediate Mode of ACK Process) — Part 1
HL7 V3 Standard Inbound Message Mode Data Flow (For Immediate Mode of ACK Process) — Part 2
An HL7 V3 message triggers an inbound Collaboration received from an external system or an outbound HL7 V3 client. The Collaboration calls the HL7 V3 user Collaboration rule by executing receive().
The receive method is the entry point to the HL7 V3 User Collaboration, with the following signature:
public void receive(com.stc.connector.appconn.tcpip.hl7.HL7ServerApplication input, com.stc.connectors.jms.JMS otdJMS_DATA, xsd.hl7v3.PRPA_IN403001UV01.PRPA_IN403001UV01_ otd_PRPA_IN403001UV01_1 xsd.hl7v3.MCCI_IN000004UV01.MCCI_IN000004UV01_ otd_MCCI_IN000004UV01 otdHL7_ACK_1,com.stc.connectors.jms.JMS otdJMS_JOURNAL, com.stc.connectors.jms.JMS otdJMS_ERROR) throws Throwable. |
The above text has been wrapped to fit the page.
Once the message is received, the Collaboration determines whether the message needs to be validated. The 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 these fields do not match the configuration, a NAK is returned.
The Collaboration receives the HL7 V3 message from the external using receiveHL7Message(). 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, validateHL7Message() is called, which validates the message to determine whether to ACK or NAK the message. Other helper methods are also called to validate the HL7 V3 message.
If the HL7 V3 message does not pass validation, the Collaboration calls makeNak() and sendHL7Nak() to create and send the NAK to the external. The HL7 V3 message, with the NAK, is archived to the error queue. If the number of consecutive NAKs sent surpasses the maximum number of retries, the associated recourse action is taken.
If the HL7 V3 message passes validation, the Collaboration calls makeAck() and sendHL7Ack() to create and send the ACK to the external.
After the ACK is sent, the HL7 V3 message and the ACK are journaled to the JMS queue journal destination. If the message fails to journal the associated recourse action is taken.