Announcement

Collapse
No announcement yet.

Problem with HL7 ack

Collapse
X
 
  • 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

    Hi,

    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,

    Angelo

    Comment


    • #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

      Comment


      • #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

        Bye,
        Claudio

        ack.xml (4610 bytes)

        Comment


        • #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));

          Comment


          • #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(ScriptRuntime.java:3226)
            at org.mozilla.javascript.ScriptRuntime.constructErro r(ScriptRuntime.java:3216)
            at org.mozilla.javascript.ScriptRuntime.typeError(Scr iptRuntime.java:3232)
            at org.mozilla.javascript.ScriptRuntime.typeError2(Sc riptRuntime.java:3251)
            at org.mozilla.javascript.ScriptRuntime.undefCallErro r(ScriptRuntime.java:3270)
            at org.mozilla.javascript.ScriptRuntime.getPropFuncti onAndThis(ScriptRuntime.java:1966)
            at org.mozilla.javascript.gen.c40._c3(ac0a7b0d-0b8e-4bbe-81a2-065d531ced45:4)
            at org.mozilla.javascript.gen.c40.call(ac0a7b0d-0b8e-4bbe-81a2-065d531ced45)
            at org.mozilla.javascript.optimizer.OptRuntime.callNa me0(OptRuntime.java:106)
            at org.mozilla.javascript.gen.c40._c0(ac0a7b0d-0b8e-4bbe-81a2-065d531ced45:10)
            at org.mozilla.javascript.gen.c40.call(ac0a7b0d-0b8e-4bbe-81a2-065d531ced45)
            at org.mozilla.javascript.ContextFactory.doTopCall(Co ntextFactory.java:337)
            at org.mozilla.javascript.ScriptRuntime.doTopCall(Scr iptRuntime.java:2755)
            at org.mozilla.javascript.gen.c40.call(ac0a7b0d-0b8e-4bbe-81a2-065d531ced45)
            at org.mozilla.javascript.gen.c40.exec(ac0a7b0d-0b8e-4bbe-81a2-065d531ced45)
            at com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer.evaluateTransformerScript(JavaScri ptTransformer.java:308)
            at com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer.transform(JavaScriptTransformer.ja va:229)
            at org.mule.transformers.AbstractEventAwareTransforme r.doTransform(AbstractEventAwareTransformer.java:4 8)
            at org.mule.transformers.AbstractTransformer.transfor m(AbstractTransformer.java:197)
            at org.mule.impl.MuleEvent.getTransformedMessage(Mule Event.java:251)
            at com.webreach.mirth.server.controllers.MessageObjec tController.getMessageObjectFromEvent(MessageObjec tController.java:276)
            at com.webreach.mirth.server.mule.providers.vm.VMMess ageDispatcher.doSend(VMMessageDispatcher.java:163)
            at org.mule.providers.AbstractMessageDispatcher.send( AbstractMessageDispatcher.java:166)
            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(AbstractOutboundRouter.java:85)
            at org.mule.routing.outbound.FilteringMulticastingRou ter.route(FilteringMulticastingRouter.java:89)
            at org.mule.routing.outbound.OutboundMessageRouter$1. doInTransaction(OutboundMessageRouter.java:78)
            at org.mule.transaction.TransactionTemplate.execute(T ransactionTemplate.java:48)
            at org.mule.routing.outbound.OutboundMessageRouter.ro ute(OutboundMessageRouter.java:82)
            at org.mule.impl.model.DefaultMuleProxy.onCall(Defaul tMuleProxy.java:247)
            at org.mule.impl.model.seda.SedaComponent.doSend(Seda Component.java:209)
            at org.mule.impl.model.AbstractComponent.sendEvent(Ab stractComponent.java:277)
            at org.mule.impl.MuleSession.sendEvent(MuleSession.ja va:201)
            at org.mule.routing.inbound.InboundMessageRouter.send (InboundMessageRouter.java:161)
            at org.mule.routing.inbound.InboundMessageRouter.rout e(InboundMessageRouter.java:128)
            at org.mule.providers.AbstractMessageReceiver$Default InternalMessageListener.onMessage(AbstractMessageR eceiver.java:492)
            at org.mule.providers.AbstractMessageReceiver.routeMe ssage(AbstractMessageReceiver.java:271)
            at org.mule.providers.AbstractMessageReceiver.routeMe ssage(AbstractMessageReceiver.java:243)
            at com.webreach.mirth.server.mule.providers.mllp.Mllp MessageReceiver$TcpWorker.processData(MllpMessageR eceiver.java:312)
            at com.webreach.mirth.server.mule.providers.mllp.Mllp MessageReceiver$TcpWorker.run(MllpMessageReceiver. java:278)
            at org.mule.impl.work.WorkerContext.run(WorkerContext .java:290)
            at edu.emory.mathcs.backport.java.util.concurrent.Thr eadPoolExecutor$Worker.runTask(ThreadPoolExecutor. java:650)
            at edu.emory.mathcs.backport.java.util.concurrent.Thr eadPoolExecutor$Worker.run(ThreadPoolExecutor.java :675)
            at java.lang.Thread.run(Thread.java:619)


            You find the channel export attached.

            Thanks, Claudio ack2.xml (4216 bytes)

            Comment


            • #7
              Re:Problem with HL7 ack

              I restar mirth and everythinks works.

              Thanks,
              Claudio

              Comment


              • #8
                Re:Problem with HL7 ack

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

                Comment


                • #9
                  Re:Problem with HL7 ack

                  MIRTH-361

                  Comment


                  • #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)

                    Bye,
                    Claudio
                    ack.png (28861 bytes)

                    Comment


                    • #11
                      Re:Problem with HL7 ack

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

                      Comment


                      • #12
                        Re:Problem with HL7 ack

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

                        Comment

                        Working...
                        X