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