Announcement

Collapse

Mirth Connect 3.12.0 Released!

Mirth Connect 3.12.0 is now available as an appliance update and on our GitHub page. This release includes database performance improvements, improves visual HL7 representation, message pruning, keystore handling, PDF generation, community contributions, and fixes several security vulnerabilities. This release also contains many 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

x12Transaction internal representation issue

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

  • x12Transaction internal representation issue

    I am thinking the internal transformation of 270 to internal XML in the mirth may be an issue while translation. I feel you may have to change in order to affectively preserving the meaning of the loop. For example

    Please take a look into the HL loop of 270, in this example, NM1, REF,REF belong to this loop, now in translator, if we try to map

    msg['REF'][0]['REF.02']['REF.02.1'].toString()
    msg['REF'][1]['REF.02']['REF.02.1'].toString()
    msg['REF'][2]['REF.02']['REF.02.1'].toString()

    We are getting the values from the XML dom using index but REF is an optional segment and index changes based on the input, it mean if previous REF is missing the above indexes changes. Therefore the meaning of the document changes and in order to preserve that I think it may be better to change the internal representation. I am giving the before and proposed change of the document. Please let me know your thoughts.

    If you want I can modify the code and can submit the code to you.

    Thank you

    Ram





    Current Internal representation:

    <HL>
    <HL.01>
    <HL.01.1>3</HL.01.1>
    </HL.01>
    <HL.02>
    <HL.02.1>2</HL.02.1>
    </HL.02>
    <HL.03>
    <HL.03.1>22</HL.03.1>
    </HL.03>
    <HL.04>
    <HL.04.1>1</HL.04.1>
    </HL.04>
    </HL>
    <NM1>
    <NM1.01>
    <NM1.01.1>IL</NM1.01.1>
    </NM1.01>
    <NM1.02>
    <NM1.02.1>1</NM1.02.1>
    </NM1.02>
    <NM1.03>
    <NM1.03.1>FirstName</NM1.03.1>
    </NM1.03>
    <NM1.04>
    <NM1.04.1>LastName</NM1.04.1>
    </NM1.04>
    <NM1.05>
    <NM1.05.1>B</NM1.05.1>
    </NM1.05>
    <NM1.06/>
    <NM1.07/>
    <NM1.08>
    <NM1.08.1>MI</NM1.08.1>
    </NM1.08>
    <NM1.09>
    <NM1.09.1>XXXXXXXXDX</NM1.09.1>
    </NM1.09>
    </NM1>
    <REF>
    <REF.01>
    <REF.01.1>SY</REF.01.1>
    </REF.01>
    <REF.02>
    <REF.02.1>44444444444</REF.02.1>
    </REF.02>
    </REF>
    <REF>
    <REF.01>
    <REF.01.1>18</REF.01.1>
    </REF.01>
    <REF.02>
    <REF.02.1>4475</REF.02.1>
    </REF.02>
    </REF>

    Proposed Representation

    <HL>
    <HL.01>
    <HL.01.1>3</HL.01.1>
    </HL.01>
    <HL.02>
    <HL.02.1>2</HL.02.1>
    </HL.02>
    <HL.03>
    <HL.03.1>22</HL.03.1>
    </HL.03>
    <HL.04>
    <HL.04.1>1</HL.04.1>
    </HL.04>
    <NM1>
    <NM1.01>
    <NM1.01.1>IL</NM1.01.1>
    </NM1.01>
    <NM1.02>
    <NM1.02.1>1</NM1.02.1>
    </NM1.02>
    <NM1.03>
    <NM1.03.1>RAM</NM1.03.1>
    </NM1.03>
    <NM1.04>
    <NM1.04.1>PRATAPA</NM1.04.1>
    </NM1.04>
    <NM1.05>
    <NM1.05.1>B</NM1.05.1>
    </NM1.05>
    <NM1.06/>
    <NM1.07/>
    <NM1.08>
    <NM1.08.1>MI</NM1.08.1>
    </NM1.08>
    <NM1.09>
    <NM1.09.1>XXXXXXX</NM1.09.1>
    </NM1.09>
    </NM1>
    <REF>
    <REF.01>
    <REF.01.1>SY</REF.01.1>
    </REF.01>
    <REF.02>
    <REF.02.1>1234567899</REF.02.1>
    </REF.02>
    </REF>
    <REF>
    <REF.01>
    <REF.01.1>18</REF.01.1>
    </REF.01>
    <REF.02>
    <REF.02.1>4475</REF.02.1>
    </REF.02>
    </REF>
    </HL>


    Another way is
    <Loop1>
    <HL>
    <HL.01>
    <HL.01.1>3</HL.01.1>
    </HL.01>
    <HL.02>
    <HL.02.1>2</HL.02.1>
    </HL.02>
    <HL.03>
    <HL.03.1>22</HL.03.1>
    </HL.03>
    <HL.04>
    <HL.04.1>1</HL.04.1>
    </HL.04>
    </HL>
    <NM1>
    <NM1.01>
    <NM1.01.1>IL</NM1.01.1>
    </NM1.01>
    <NM1.02>
    <NM1.02.1>1</NM1.02.1>
    </NM1.02>
    <NM1.03>
    <NM1.03.1>RAM</NM1.03.1>
    </NM1.03>
    <NM1.04>
    <NM1.04.1>PRATAPA</NM1.04.1>
    </NM1.04>
    <NM1.05>
    <NM1.05.1>B</NM1.05.1>
    </NM1.05>
    <NM1.06/>
    <NM1.07/>
    <NM1.08>
    <NM1.08.1>MI</NM1.08.1>
    </NM1.08>
    <NM1.09>
    <NM1.09.1>XXXXXXX</NM1.09.1>
    </NM1.09>
    </NM1>
    <REF>
    <REF.01>
    <REF.01.1>SY</REF.01.1>
    </REF.01>
    <REF.02>
    <REF.02.1>1234567899</REF.02.1>
    </REF.02>
    </REF>
    <REF>
    <REF.01>
    <REF.01.1>18</REF.01.1>
    </REF.01>
    <REF.02>
    <REF.02.1>4475</REF.02.1>
    </REF.02>
    </REF>
    </Loop1>

  • #2
    Re:x12Transaction internal representation issue

    All of the EDI messages are messed up in regards to message structure. We've had to write a javascript processor that calls EDIREADER and converts the X12 to a proper message structure, then its usable within Mirth. If you would like a sample, let me know and I'll post it.

    Comment


    • #3
      Re:x12Transaction internal representation issue

      Thank you, I have written javascript using e4x and modified the struture in the Source transformer and it is working.

      Thank you for the help

      Thanks
      RAm

      Comment


      • #4
        Re:x12Transaction internal representation issue

        I'd be curious to see how you modified the structure with e4x, would you mind sharing your code?

        Comment


        • #5
          Re:x12Transaction internal representation issue

          I'd be curious to see how you modified the structure with e4x, would you mind sharing your code?

          Comment


          • #6
            Re:x12Transaction internal representation issue

            X12 example
            step 1 : tranlate message into mirth internal XML using the following way

            temp = SerializerFactory.getX12Serializer(true).toXML(pay loadReceived);
            default xml namespace = new Namespace('urn:mirthproject-org:x12:xml');
            logger.error(" Translated Message" + temp);
            msg = new XML(temp);


            step 2 define a new XML object

            var tmpMessage = new XML("<?xml version="1.0" encoding="UTF-8"?><X12Transaction xmlns="urn:mirthproject\-org:x12:xml"></X12Transaction>"

            step 3: get all children in orignal xml object

            var childNodes = msg.children();

            using the following loop you can get to each node.
            for each (child in childNodes)
            {
            // Here you have to write add the values and tags to your tmpMessage from the mirth internal object i.e child using child.name() or any other e3x methods

            }

            step 4 :
            replace the original msg with this temp so that you can use this in the detination

            msg= tmpMessage;

            Let me know if you need any help

            Thanks
            Ram

            Comment

            Working...
            X