Sidebar

I am receiving the error "Uknown segment:<?x" in my log after setting up an HL7 web service.

0 votes
472 views
asked Jun 11, 2015 by brandon-w-8204 (33,270 points)
edited Jun 11, 2015 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');
answered Jun 11, 2015 by brandon-w-8204 (33,270 points)
...