1.2k questions

1.4k answers

361 comments

339 users

Categories

Sidebar
0 votes
608 views
by brandon-w-8204 (34.1k points)
edited by brandon-w-8204

What does this mean and how do I fix it?

Full Error:

Wrapped com.qvera.qie.web.exception.MessageModelException: Unknown segment: '<?x' (<Unknown Source>#4)

1 Answer

0 votes

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');
by brandon-w-8204 (34.1k points)
...