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