This error is from the default ack script in qvera. The error is on the following line:
ackMessage = qie.parseHL7String(response)
This line is trying to take the response recieved from the endpoint (socket or web service) and parse it as an HL7 message. The response received is an XML message which cannot be parsed as hl7.
Replace the default ack script with the one below.
if (response === null || response.length === 0) {
return false;
}
var isXML = true;
try {
response = qie.parseXMLString(response);
} catch (err) {
isXML = false;
}
var ackMessage;
if (isXML) {
ackMessage = qie.parseHL7String(response.getNode("//*[contains(text(), 'MSH|^~\\')]"));
} else {
ackMessage = qie.parseHL7String(response);
}
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');