Announcement

Collapse
No announcement yet.

Source Transformer

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

  • Source Transformer

    Hi
    I'm using Mirth Connect to save incoming HL7 messages to a database. When I receive a message what is the best way to transform it in the Source tab and make the segements available for inspection in the Destination tab.
    I have been using:
    channelMap.put('iMsg', msg);

    But I'm having trouble retrieving the values in the Destination tab. How do I put the incoming xml into the map and access the segments?

  • #2
    I do not understand what you are trying to do.

    Mirth is doing this automatically
    Code:
    <HL7Message>
        <MSH>
            <MSH.1>|</MSH.1>
            <MSH.2>^~\&amp;</MSH.2>
            <MSH.3>
                <MSH.3.1>ZIS</MSH.3.1>
            </MSH.3>
            <MSH.4>
                <MSH.4.1>ISALA</MSH.4.1>
            </MSH.4>
            <MSH.5>
                <MSH.5.1>ALL</MSH.5.1>
            </MSH.5>
            <MSH.6>
                <MSH.6.1>ALL</MSH.6.1>
    
    etc...
    see the transformed message. (messageObject.getTransformedData())
    Stefan

    Mirth Certified|Epic Bridges Certified|Cloverleaf Level 2 Certified

    Comment


    • #3
      Stefan's bang on. You can access them in the destination channel (or even in the source) using this format:

      Code:
      msg['OBX']['OBX.5.']['OBX.5.1'];
      
      //if its a string
      
      msg['OBX']['OBX.5.']['OBX.5.1'].toString();
      You can also paste a copy of your message in the message template and drag nodes into your code from the message tree tab.
      I can be reached through gmail and Google Talk using davidrothbauer at gmail dot com
      http://www.linkedin.com/pub/david-rothbauer/5/923/518
      codeismydrug.wordpress.com
      hl7coders.wordpress.com

      Test all my code suggestions prior to implementation

      Comment


      • #4
        Thanks for your help. I'm not being clear. I have an incoming result message. How do I make the values of the incoming message available for inspection? I use the template tree to get the proper segements, however if I use the msg object I just get the values from the template tree. I want to access the values in the incoming message. I know there is an easy way to map the incoming message to a channel variable in Source so that it is available to subsequent Destinations.

        Comment


        • #5
          Hi;

          My code will work in the destinations. You don't have to map it.
          But, if you want to map it anyway, just click the node in the source transformer and drag it to the upper middle pane.
          In the lower pane type a variable name and you're done.

          Oh wait...wait a minute....are you pasting your message example in the inbound or outbound template?

          If you put it in the outbound, you would access it using tmp instead of msg, but anything you don't explicitly manipulate will go across as you've pasted it in your outbound template.

          I hope that reads clearer than it looks.
          I can be reached through gmail and Google Talk using davidrothbauer at gmail dot com
          http://www.linkedin.com/pub/david-rothbauer/5/923/518
          codeismydrug.wordpress.com
          hl7coders.wordpress.com

          Test all my code suggestions prior to implementation

          Comment


          • #6
            Hi
            Thanks again for you help. I'm following your instructions. But when I access the segments I get the data from the template. I need to get the data from the incoming message.

            Comment

            Working...
            X