No announcement yet.

Rules for auto-generated HL7 ACKs?

  • Filter
  • Time
  • Show
Clear All
new posts

  • Rules for auto-generated HL7 ACKs?


    I've searched the forums and the wiki, and the net in general, but I haven't been able to find any information on how Mirth's response auto-generator determines what to put in MSA-1. Is there any documentation about this?

    I'm curious because I recently set an HL7 (from TCP Listener) channel to respond after the destinations were complete. I was surprised to learn that when a message is filtered by all destinations, the auto-generated ACK has an MSA-1 of "AR". Our sender resent the message and an endless loop was born.

    That isn't the behavior that I expect, so I would like to know more about how it works. I'm not looking for information on crafting a custom ACK right now. I want to determine if the built-in ACK meets our needs and avoid writing custom code, if possible.

    The particular server this happened on is running Mirth 3.6.1. Although, if this behavior varies among the Mirth 3.x versions, that would be great to know.



  • #2
    The first place to look for information like this is the user guide. It has the most through explanations of all of the options when configuring a channel.

    It's going to depend on which auto-gen option you have selected and if you've changed any of the values in the Response Generation section of the source inbound data type properties.

    You can click on each property to see a description, but it uses the following definitions. The defaults are what you would expect, but they can be changed.

    Successful Ack Code is when message has SENT/RECEIVED status
    Error Ack Code is when message has ERROR status
    Rejected Ack code is when message has FILTERED status

    The wording is a little misleading when selecting the the auto-gen option, because the ack will always be sent after the post-processor completes if the source queue is not turned on.

    If you generate before processing it should always return the Successful Ack Code if the message was successfully received.

    If you generate after source transformer it will base the response on the status of the source connector.

    If you generate on destinations complete, it will used the combined statuses of all destinations. Here's the section of source code where it determines which status to use.