Announcement

Collapse
No announcement yet.

Responding with RSP_K11 instead of just an ACK

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Responding with RSP_K11 instead of just an ACK

    Hello All,

    I am trying to send a RSP_K11 response to a QBP_Q11 request. What I have done is: pass the parameters from the request/query to a webservice(soap sender) which returns the hl7 response as a string. I am having to do an xslt transform on the response from the webservice to extract the string message. (I remove the namespaces and change a 'return' element name to 'response' in the process).
    I have then put the string message(which is infact a complete hl7 RSP_K11 message) in a variable and passed it to the responseMap (responseMap.put("ReturnResponse", result)) so that I can send it back instead of an ACK.
    But I am getting the following error:
    ============================================
    ERROR (org.mule.impl.DefaultComponentExceptionStrategy:9 5): Caught exception in Exception Strategy for: MessageSink: java.lang.ClassCastException: org.mozilla.javascript.xmlimpl.XMLList
    java.lang.ClassCastException: org.mozilla.javascript.xmlimpl.XMLList
    at com.webreach.mirth.connectors.mllp.MllpMessageRece iver$TcpWorker.processHL7Data(MllpMessageReceiver. java:496)
    at com.webreach.mirth.connectors.mllp.MllpMessageRece iver$TcpWorker.processData(MllpMessageReceiver.jav a:436)
    at com.webreach.mirth.connectors.mllp.MllpMessageRece iver$TcpWorker.run(MllpMessageReceiver.java:353)
    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(Unknown Source)
    ==================================================
    Can anyone please suggest where I might be going wrong? I can post the channel is you need to have a look at the xslt transform. But am I wrong in my logic of getting the hl7 message from the webservice as a string and passing it on?
    Please help. I would greatly appreciate it. I have been working on it error for 48 hrs now!!!

    I also did observe that if I change responseMap.put("ReturnResponse", result) to a responseMap.put("ReturnResponse", result.toString()), it changes the exception to java.lang.ClassCastException: java.lang.String. So I figured, its something to do with what or how I put the value in the responseMap.
    I also tried putting responseMap.put("ReturnResponse", ResponseFactory.getSuccessResponse(result));....bu t this statements keeps calling the webservice again and again and I see about 300-400 msgs being sent to Mirth and processed like in an infinite loop. Please help me find a way out!!

    Thanks,
    Nicky
    Last edited by nickydavid; 11-18-2009, 02:12 PM.

  • #2
    Which version are you using ?

    Comment


    • #3
      Anyway, you HAVE TO use

      responseMap.put("ReturnResponse", ResponseFactory.getSuccessResponse(result));

      or

      responseMap.put("ReturnResponse", ResponseFactory.getFailureResponse(result));

      Or mirth will launch a "cannot be cast to com.webreach.mirth.model.Response" error

      Comment


      • #4
        Thanks for responding. I am using version 1.8.0.
        I did try with the responseMap.put("ReturnResponse", ResponseFactory.getSuccessResponse(result)); but when I do that, the channel goes into kind of an infinite loop. (I see about 200-300 messages even if I dont stop the webservice or the channel itself..its like its processing the same message again and again) When I checked the message browser, I saw this --
        MSH|^~\@|||||20091119102033.412-0800||ACK|7804|P|2.5
        MSA|AR|12345|No appropriate destination could be found to which this message could be routed.
        ERR|^^^[email protected] Internal [email protected]
        .All the 199 or something repeatitions are these ACK's after the initial single processing of the actual request.
        Would you know why its not able to find a destination? The app is still running and waiting for a response. I also increased the timeout for the app thinking it might have closed the connection...but that doesnt seem to be the case. Do I have to tap in the receiverSocket and manually send the response on the client outputstream? But that shouldnt be the case!!!
        Please help. And thanks again for responding.

        Thank you,
        Nicky

        Comment


        • #5
          This works in 1.8.2.4472

          channel > destinations > select a destination > edit transformer > create new step > change type to Javascript and write this

          responseMap.put("ReturnResponse", ResponseFactory.getSuccessResponse("my custom response"));
          return;

          Comment

          Working...
          X