repeating subfields

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf repeating subfields

  • Creator
    Topic
  • #50484
    Hongle Sun
    Participant

      Hello, I would like to move all inbound repeating subfield values in OBX5 to a outbound NTE 3..

      Here is my mapping in xlate file

      2(0).1(0).1(%f1).0(%g1).OBX(0).00573(0)  —- > 2(0).1(0).1(%f1).0(0).NTE(%g1).00098(0)

      for example in bound

      ..

      OBX|1|||A1~B2~C3

      ….

      OBX|4|ST|||DATA1~DATA2~DATA3

      with that xlate, my outbound NTE3 only have the first subfield value

      NTE|1||A1

      ..

      NTE|1||DATA1

      I know i need to do looping or repeating against those subfields but i dont know how..

      Can anyone help?

      Thanks

    Viewing 2 reply threads
    • Author
      Replies
      • #66278
        Gary Atkinson
        Participant

          Not sure if this will work but here goes…

          Iterate through the NTE segment with a counter.  Build each NTE based each OBX:5 field.  I believe it is just a matter of nesting the iterates and where you put your variable.

        • #66279
          Tom Rioux
          Participant

            Hongle,

            I’m assuming that you are already performing the iterate on the OBX segment because I see the %g1 iteration variable.  It appears that you have the iteration variables in the wrong place….simply guessing here since I don’t have your exact variant  or xlate to view.  

            I believe you would want an iterate inside of your OBX iterate.  Then you should have your %g1 variable for the iteration of the segments and the %f1 variable for the iteration of the subfields.  It should look similar to this:

            2(0).1(0).1(0).0(%g1).OBX(0).00573(%f1)  —- > 2(0).1(0).1(0).0(%g1).NTE(0).00098(%f1)

            Another thing to remember…check your HL7 variants to make sure the OBX.5 field and the NTE.3 field are set as repeating fields.  

            Hope this helps….

            Tom Rioux

          • #66280

            To get values from repeating subfields, you need to use the parens at the end like this: 2(0).1(0).1(0).0(0).OBX(0).00573(%f1). You can of course hard code the iteration of the repeating subfield like this 2(0).1(0).1(0).0(0).OBX(0).00573(0), 2(0).1(0).1(0).0(0).OBX(0).00573(1).

            A great way to see how this work is to run your message through the HL7 testing tool.

            -- Max Drown (Infor)

        Viewing 2 reply threads
        • The forum ‘Cloverleaf’ is closed to new topics and replies.