Sidebar

How do I process an HL7 ACK message that is embedded in an XML ACK on the destination node?

0 votes
645 views
asked Dec 12, 2013 by gary-t-8719 (14,860 points)
edited Dec 17, 2013 by gary-t-8719

1 Answer

0 votes

There are three things to keep in mind when processing an ACK message of any type (XML, HL7, CSV, et cetera).

1. QIE stores the ACK message in a variable named "response"

2. The ACK or value stored in the response variable is a string value.

3. After evaluating the response the ACK script should return a Boolean value (true or false, or a 1 or 0). If a non-boolean value is passed then it will always be evaluated as a successful response.

if (StringUtils.isBlank(response)) {
   return false;
}
 
response = qie.parseXMLString(response);
var ackMessage = qie.parseHL7String(response.getNode('//return'));
var msgId = message.getNode('MSH-10');
var ackId = ackMessage.getNode('MSA-2');
if ((msgId.equals('') && ackId.equals('')) || !msgId.equals(ackId)) {
   throw "Ack id (" + ackId + ") not equal to message id (" + msgId + "): '" + response + "'";
}
return ackMessage.getNode('MSA-1').endsWith('A');

 

 

See also How do ACK (Message Acknowledgment) scripts work in QIE

answered Nov 5, 2014 by gary-t-8719 (14,860 points)
...