Mirth Connect 4.1.0 Released!

Mirth Connect 4.1.0 is now available as an appliance update and on our GitHub page. Mirth Connect 4.1.0 includes new features such as new event log messages, additional fields to the Welcome to Mirth Connect screen, new information included in alerts as well as many smaller changes, updates, and improvements. This release also contains several improvements to commercial extensions. See the release notes for the list of fixes and updates.

Download | See What's New | Upgrade Guide | Release Notes

For discussion on this release, see this thread.
See more
See less

Problem with HL7 ack

  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem with HL7 ack

    when i send a hl7 message, I need to have different ack response, from the same channel, depending on db-query result.
    To do this, I use a channel writer destination (with "none" value).
    This channel have a trasformer with this javascript:
    responseMap.put(connector, ResponseFactory.getSuccessResponse(ack_message));

    By this way I have only this result: channel send to my application a "SUCCES: Message routed successfully" but no hl7 message.
    How could I have only correct hl7-ack response?
    Thanks for help

  • #2
    Re:Problem with HL7 ack


    I had also the same problem what I wanted to sent a custom ACK back to the server. I finally figured it out (partly by your question).

    Maybe if I tell you how I did it, it will help you solve the problem.

    your transformer javascript on the destination (channel writer) is:
    responseMap.put(connector, ResponseFactory.getSuccessResponse(ack_message));

    where connector is a string with a name and ack_message is the complete HL7 ack message (including header etc) ? I hope this is how you did it.

    Then go back to the channel source and change the 'send ACK' to 'Response from' and select the connector from the list. Make sure to check it is still on "Response from" because I think there is a bug in 1.4.0 which resets the Send Ack to 'no' when you edit the channel.

    After I did this I got a complete ACK message back ...

    Hope this helps,
    kind regards,



    • #3
      Re:Problem with HL7 ack

      Yes. this is the right way to create a custom ACK (or a custom response)

      Instead of writing the full ACK into a string, you could use the templates (input/output) of the NoneWriter. If you do it, at the last Step of the NoneWriter, add the next JS step:

      responseMap.put(connector, ResponseFactory.getSuccessResponse(tmp.toXMLString ()));

      [RECEIVER]-------------->[DESTINATION 1]-------------->[DESTINATION 2]
      () (db Writer) (NoneWriter)
      ··>[Input Message)····(transform/do stuff)····[SUCESS]----(generate ACK)····+
      <·····(Response Message)<········································· ··········+

      And angelo, you're right again: there's a bug in LLP receiver for 1.4.0


      • #4
        Re:Problem with HL7 ack

        Thanks a lot.

        But if I use

        responseMap.put(connector, ResponseFactory.getSuccessResponse(tmp.toXMLString ()));

        I send and xml message.
        What is the function to send a HL7 message, because if I use:

        responseMap.put('custom_ack', SerializerFactory.getHL7Serializer(useStrictParser ).fromXML(tmp));

        I have an error about useStrictParser


        ack.xml (4610 bytes)


        • #5
          Re:Problem with HL7 ack

          SerializerFactory needs two arguments (is an error in the gui). Try:

          responseMap.put('custom_ack', SerializerFactory.getHL7Serializer(false, false).fromXML(tmp));


          • #6
            Re:Problem with HL7 ack

            Unfortunately I obtain this error:hmy:

            ERROR-300: Transformer error
            ERROR MESSAGE: Error evaluating transformer
            org.mozilla.javascript.EcmaError: TypeError: Cannot call method "replace" of null (ac0a7b0d-0b8e-4bbe-81a2-065d531ced45#4)
            at org.mozilla.javascript.ScriptRuntime.constructErro r(
            at org.mozilla.javascript.ScriptRuntime.constructErro r(
            at org.mozilla.javascript.ScriptRuntime.typeError(Scr
            at org.mozilla.javascript.ScriptRuntime.typeError2(Sc
            at org.mozilla.javascript.ScriptRuntime.undefCallErro r(
            at org.mozilla.javascript.ScriptRuntime.getPropFuncti onAndThis(
            at org.mozilla.javascript.gen.c40._c3(ac0a7b0d-0b8e-4bbe-81a2-065d531ced45:4)
            at org.mozilla.javascript.optimizer.OptRuntime.callNa me0(
            at org.mozilla.javascript.gen.c40._c0(ac0a7b0d-0b8e-4bbe-81a2-065d531ced45:10)
            at org.mozilla.javascript.ContextFactory.doTopCall(Co
            at org.mozilla.javascript.ScriptRuntime.doTopCall(Scr
            at org.mozilla.javascript.gen.c40.exec(ac0a7b0d-0b8e-4bbe-81a2-065d531ced45)
            at com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer.evaluateTransformerScript(JavaScri
            at com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer.transform(JavaScriptTransformer.ja va:229)
            at org.mule.transformers.AbstractEventAwareTransforme r.doTransform( 8)
            at org.mule.transformers.AbstractTransformer.transfor m(
            at org.mule.impl.MuleEvent.getTransformedMessage(Mule
            at com.webreach.mirth.server.controllers.MessageObjec tController.getMessageObjectFromEvent(MessageObjec
            at com.webreach.mirth.server.mule.providers.vm.VMMess ageDispatcher.doSend(
            at org.mule.providers.AbstractMessageDispatcher.send(
            at org.mule.impl.MuleSession.sendEvent(MuleSession.ja va:191)
            at org.mule.impl.MuleSession.sendEvent(MuleSession.ja va:130)
            at org.mule.routing.outbound.AbstractOutboundRouter.s end(
            at org.mule.routing.outbound.FilteringMulticastingRou ter.route(
            at org.mule.routing.outbound.OutboundMessageRouter$1. doInTransaction(
            at org.mule.transaction.TransactionTemplate.execute(T
            at ute(
            at org.mule.impl.model.DefaultMuleProxy.onCall(Defaul
            at org.mule.impl.model.seda.SedaComponent.doSend(Seda
            at org.mule.impl.model.AbstractComponent.sendEvent(Ab
            at org.mule.impl.MuleSession.sendEvent(MuleSession.ja va:201)
            at org.mule.routing.inbound.InboundMessageRouter.send (
            at org.mule.routing.inbound.InboundMessageRouter.rout e(
            at org.mule.providers.AbstractMessageReceiver$Default InternalMessageListener.onMessage(AbstractMessageR
            at org.mule.providers.AbstractMessageReceiver.routeMe ssage(
            at org.mule.providers.AbstractMessageReceiver.routeMe ssage(
            at com.webreach.mirth.server.mule.providers.mllp.Mllp MessageReceiver$TcpWorker.processData(MllpMessageR
            at com.webreach.mirth.server.mule.providers.mllp.Mllp MessageReceiver$ java:278)
            at .java:290)
            at eadPoolExecutor$Worker.runTask(ThreadPoolExecutor. java:650)
            at eadPoolExecutor$ :675)

            You find the channel export attached.

            Thanks, Claudio ack2.xml (4216 bytes)


            • #7
              Re:Problem with HL7 ack

              I restar mirth and everythinks works.



              • #8
                Re:Problem with HL7 ack

                Can you add that bug to the JIRA, thanks!
                Chris Lang


                • #9
                  Re:Problem with HL7 ack



                  • #10
                    Re:Problem with HL7 ack

                    Strange situation :blink:

                    If I use this transformer:

                    var ack_message2 = SerializerFactory.getHL7Serializer(false, false).fromXML(tmp);
                    responseMap.put('custom_ack', ResponseFactory.getSuccessResponse(ack_message2));

                    if I receive this message:
                    MSH|^~\\&|SSI|SI|RAYNUX|IST. RAD. 1|200511250415||ORM^O01|SI050000000109329500|P|2.3 .1
                    PID||260148220^^^116|95485053^^^L^ASSIPCA||XXXXXX^ ANNAMARIA^^^^^L||19510124|F|||VIA DELLE CAVE,174^^PADOVA^PD^35100^^L^028060||8685492|||||1 200576056|260148220||||CERIGNOLA|||ITALIA
                    PV1|1|I|013301^52||||57^AMADORI^GIUSEPPE^^^^^^^^^^ ^^050901|57^AMADORI^GIUSEPPE^^^^^^^^^^^^050901|||| |||||||200576056^^^^RIC_AO|SSN|||||||||||||||||||| ||||20051125041500||||||2909510|V
                    ORC|NW|2909510-1^AOPD^013301^L||2909510^AOPD^013301^L|CM||1^once^ ^20051125041500^^R||200511250415|M60614|57^AMADORI ^GIUSEPPE^^^^^^^^^^^^050901|57^AMADORI^GIUSEPPE^^^ ^^^^^^^^^050901||2266|||013301
                    OBR|1|2909510-1^AOPD^013301^L||50^RX TORACE^L|||200511250415|||||N|paziente con leucemia acuta con sospetta localizzazione midollo allungato|||57^AMADORI^GIUSEPPE^^^^^^^^^^^^050901| ||||||||||1^once^^^^R|||PORT|||||||||||U

                    mirth respond with a strange ack (look at the attachment)

                    ack.png (28861 bytes)


                    • #11
                      Re:Problem with HL7 ack

                      Hi boys,
                      could you send me pls channels export?!
                      Thx a lot.


                      • #12
                        Re:Problem with HL7 ack

                        i need this kinds of mirth channels.. can you export it to me?!
                        Thx for yor help.