Search code examples
hl7mirth

Mirth Changing Default ACK Field Value


I am using Mirth with a LLP listener receiving HL7v2 message.

The customer expects an ACK message from us and so we checked the "Send ACK" radio button. The only problem is that in the default ACK it puts MIRTH in the MSH-3.1 field. I need to change this to another value to say where it came from.

Is this possible?


Solution

  • Mirth has a feature for customizing acks. I don't think it's documented, but their support staff directed us to it.

    In the postprocessor:

    var ackString = ""; //build a javascript string for your custom ack
    var ackResponse = ResponseFactory.getSuccessReponse (ackString);
    responseMap.put("Custom ACK", ackResponse);
    

    Mirth parses the postprocessor code, and discovers the reponseMap code. On the source tab, you can now select "Respond from" and "Custom ACK" will appear as an option there.

    The full code for building my custom acks is about 20 lines.