How do I send an error ack to the sender of a bad HL7?

0 votes
asked Oct 22, 2015 by oscar-p-6691 (550 points)
If I receive an invalid HL7 message it goes into my error queue.  Unfortunately some systems resend the message if they do not receive an ack.  I am dealing with a system right now where they just keep trying and will never error the message on their side but keep trying indefinately.  I would like to send an ack stating that something is wrong with the message.

For example, when I send HL7 to our PACS, if the accession belongs to another MRN due to a patient merge, our PACS sends an ack error stating that the MRN sent does not match what is in the database for that accession.  I am easily able to resolve the issue and resend the message correctly.  The message does not get stuck in a loop due to no ack and it does not leave us clueless why the message was rejected.

I'd like to do something similar when a message comes in with bad segments or something of that nature.  Is it possible that if the HL7 is invalid the ack script will still run?  I tried surrounding it with a try/catch but I was unsuccessful.

1 Answer

0 votes

QIE will send the error message it gets to the sender. Example "ERROR: error processing response script: com.qvera.qie.web.exception.MessageModelException: Expected first segment to be 'FHS', 'BHS' or 'MSH', but it was not.". This is not sent in a HL7 format and may or may not cause an error on the sender side. 

We have opened a Ehancement 1764 to add the ability to modify the response sent on a error. 


Create a text channel to receive the message that uses a mapping and destination to send the response.

Add a mapping that tries to parse the message as hl7 message in a try/catch. If errors then send a HL7 error response.

Set the destination to call the HL7 channel and return the response to the original sender.

answered Oct 22, 2015 by brandon-w-8204 (33,270 points)