Announcement

Collapse
No announcement yet.

HL7--> SOAP--->HL7

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

  • HL7--> SOAP--->HL7

    I'm still strugling with the HL7 query model. When I have a HL7 client that wants to get an answer from Mirth I can
    set on the Source of channel 1, being a LLP listner, to send Response from destination 1.

    I can define destination 1 as a SOAP destination that will send back its answer to mirth.
    The SOAP reponse should then be tranformed to HL7 and send back to the source (LLP listner)

    I assume that the transformer on destination 1 is meant to build the SOAP envelope..( I do that to get a Patient ID in theSOAP request) and not to transform the SOAP-response to HL7.

    The result of the SOAP can only be sent to another channel in the destionation configuration (Send response to ..

    So how do I put this together to get a HL7 answer back to the listner.

    Somewhere I get a fealing that Mirth is not designed to do that.

    The way I configured it now the SOAP-response is send back to the HL7 listner without transformation. I cannot find a location to define the transformation for this last step.

    I also ttried to keep the LLP listner connection open, send the SOAP response to another channel, transform it to HL7 and send it back to a LLP sender listning to the same port as the orininal HL7 message was received. from. It would have suprised me if that had functioned. .

  • #2
    Re:HL7--> SOAP--->HL7

    What you'd like to do should be possible, however I do not completely understand the steps you took. Could you attach your channel export to the forum?

    Thanks!
    -Chris
    Chris Lang

    Comment


    • #3
      Re:HL7--> SOAP--->HL7

      I tried several things but this is the one that uses 1 channel and where on the source is defined that the response should come from destination 1. Destintation 1 will produce a SOAP-response. What I see is that this is sent "raw" to the HL7client. Somewhere I need to define a transformation.

      Post edited by: huubvandemortel, at: 04/24/2007 01:47

      Comment


      • #4
        Re:HL7--> SOAP--->HL7

        Can you repost that as an attachment? Thanks!
        Chris Lang

        Comment


        • #5
          Re:HL7--> SOAP--->HL7

          sorry,

          I tried the Outgoing message transformer on the source, but for some reason my HL7 message pasted to the OutGoing Data window is always a non valid HL7 message ???
          And I assume that the ougoing transformer of the source is the data that is passed to the destintaion.

          Dinet_HL7ADT.xml (102381 bytes)

          Post edited by: huubvandemortel, at: 04/24/2007 04:44

          Comment


          • #6
            Re:HL7--> SOAP--->HL7

            The basic Question is "Where to define a transformer on a SOAP-response, HTTP-Repsonse or LLP Sender-response" to transform it to HL7 and send it to the original source of the channel .

            Comment


            • #7
              Re:HL7--> SOAP--->HL7

              On any of your destinations, you can create a Javascript step - drag response from the reference list.

              Here you can give your response a key and a value. On your source tab, this response should then show up.
              Chris Lang

              Comment


              • #8
                Re:HL7--> SOAP--->HL7

                Thanks for your time at this hour Chris, I really appreciate this. But I find it hard to understand your last reply.
                Can you clarify where to put the Java Script. I have1 destintaion of type SOAP sender. I cannot find a response value on any reference list...

                (only Get response Variable Map ) I'm missing something.

                I'm studying this

                No,

                You will need a message builder.

                The steps are:

                1. Create a channel and set the type to XML
                2. In your SOURCE transformer, go to the incoming data tab. Paste a sample of the XML you are expected to receive.
                3. Go to the outgoing data tab, make sure the outgoing data type is set to HL7 v2
                4. Paste a sample HL7 formatted message in the outgoing data box (this is your template)
                5. Create a new step, change the type to Message Builder
                6. Expand the Tree on the outgoing tab that was formed from your HL7 template
                7. Drag the first segment you want to map to the first box in the message builder
                8. Switch to your Incoming Data tab
                9. In the tree that represents your XML, find the field that matches with the HL7 field and drag to the second box in the message builder
                10. Continue to do this for all the fields you wanted mapped.
                11. Make sure you edit your OUTGOING DATA hl7 message and remove any data you do not want in your final message
                12. Go to the destinations tab on the channel, on your destination go to "Edit Transformer"
                13. The incoming data type should be HL7v2
                14. Make sure the outgoing data type is HL7v2
                15. Make sure your destination is set to use ${message.encodedData} in whatever template field is available

                it's bedtime for you Chris..

                Post edited by: huubvandemortel, at: 04/25/2007 00:36

                Post edited by: huubvandemortel, at: 04/25/2007 00:36

                Comment


                • #9
                  Re:HL7--> SOAP--->HL7

                  Sorry I wasn't clear...

                  I checked out your channel and I now see what you are trying to do.

                  1. Create an additional destination
                  2. Set it to Channel Writer, set the channel to None (this creates a null destination, we just want to use the transformer)
                  3. Edit the transformer and add a Javascript step

                  Now you will want to get the response from the previous destination:
                  Code:
                  var responseVal = responseMap.get('Destination 1').getMessage();
                  Now you have the response from the SOAP sender in your responseVal variable. If you want to transform this to HL7, you can do it in the transformer...

                  You can convert the SOAP response to an XML object by doing:
                  Code:
                  msg = new XML(responseVal);
                  Now you can paste a sample HL7 in your outgoing data tab and create mappings with a message builder (between your msg var that contains the SOAP response and the HL7 template).

                  After you have created your mappings, we need to place the resulting HL7 into a response to send back to the LLP:

                  1. Convert your template to HL7:
                  Code:
                  var hl7 = SerializerFactory.getHL7Serializer(false, false).fromXML(tmp.toXMLString());
                  (the false,false is telling the converter to not use the strict parser and not use strict validation)

                  2. Create a response value:
                  Code:
                  responseMap.put('SOAP Response', ResponseFactory.getSuccessResponse(hl7));
                  (We are putting a new response in our response hashmap and setting the message to the HL7 we serialized above

                  Now you need to finally tell the LLP Listener what to respond with:

                  1. On the source tab, choose "Send ACK: Response From"
                  2. Drop down the response from box, you should see "SOAP Response"

                  Now if all goes well, your LLP sender will receive a message, send to the SOAP destination. The SOAP destination will invoke your SOAP server, get a Response, place that response in the response map. Your second destination will then be run, grab the response from the SOAP destination, convert to HL7 then create a new response to store the HL7. The LLP sender will reply back with the response from the second destination. (It will keep the connection open to respond, unless you choose "ACK on New Connection")

                  Whew, hope that helps!


                  (This process should be a bit easier in 1.4.2: http://www.mirthproject.org/communit...owse/MIRTH-342)

                  Post edited by: chrisl, at: 04/25/2007 00:46
                  Chris Lang

                  Comment


                  • #10
                    Re:HL7--> SOAP--->HL7

                    I have succeeded to get a response in HL7 back. I understand that destinations are not handled concurrently but 1 after another. The second destinations ignores its Incoming Data and fetches the SOAP response.

                    Do I understand it right that I have to transform the XML-message to HL7 entirely in javascript. I can change to HL7 outgoing message based on a template with fixed values but cannot succeed in getting parts of the XML-SOAP response. Logging it shows me the entire message but statements like

                    tmp['PID']['PID.5']['PID.5.1'] = msg['XMLDATA']['NewDataSet']['Table']['NAAM_MAN'];


                    do not work. Now I'm not an experienced Javascript writer so can someone give me a smaal hint on how to access certain parts of msg ? How do I parse the XML object ?

                    Do I need to remove namespace and other SOAP extra's ??

                    Post edited by: huubvandemortel, at: 04/25/2007 06:22

                    Post edited by: huubvandemortel, at: 04/25/2007 06:54

                    Comment


                    • #11
                      Re:HL7--> SOAP--->HL7

                      Yes, the namespace definition might be an issue - E4X can handle namespaces:

                      http://www.partlyhuman.com/blog/roge...our-namespaces

                      Check tips 3 and 4...E4X is pretty powerful and will let you do what you need with a bit of tweaking.

                      Also, try:

                      http://groups.google.com/group/mozil...15c028abdf381c
                      Chris Lang

                      Comment


                      • #12
                        Re:HL7--> SOAP--->HL7

                        I managed to make it work although it was more difficult than I had hoped for. Namespaces and CDATA tags made parsing the data difficult together with my Lack of knowledge about javascript and E4X.


                        Thanks Chris.

                        Next is trying a database connection :unsure:

                        Post edited by: huubvandemortel, at: 04/27/2007 06:32

                        Comment


                        • #13
                          Re:HL7--> SOAP--->HL7

                          Hi huubvandemortel!


                          I'm trying to do the same exact thing you posted here.

                          I hope you could post your final exported channel, please? I'm having some serious problems with XML parsing, so I'd like to have a look, if possible.


                          Thanx for your help, mate!

                          Comment


                          • #14
                            Re:HL7--> SOAP--->HL7

                            Sorry,

                            Was gone from Mirth for a while, if you are still interested ..

                            DinetH7ADT.xml (112480 bytes)

                            Comment


                            • #15
                              Re:HL7--> SOAP--->HL7

                              I have been working with a SOAP response for the better part of three days now. I can send to a SOAP listener, receive the reply on another channel, create an HL7 message from that channel's destination, and receive it on another system. What I'm having problems with is finding out how to break down the response from the WS and map the values to my HL7 message. I have arrays coming back in the SOAP response.

                              Does anyone have any experience doing this? I can attach the info if needed.

                              Thanks in advance!

                              Comment

                              Working...
                              X