SIMPLE NESTED OBR ITERATE

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf SIMPLE NESTED OBR ITERATE

  • Creator
    Topic
  • #52230
    Tom Parsons
    Participant

      Hi,

      Old CL user but new to ITERATE…

      I am attempting to perform very simple ITERATE nesting to just

      COPY hardcoded value- “LCMH” in each OBR segment.

      It works OK for 1st OBR but not for 2nd OBR.

      Thanks for any help !

      Tom

      ITERATE(1)=            group  basis=1  var=%g1

        ITERATE(2)=          group  basis=1(%g1).1  var=%g2

            COPY  source=   =LCMH    

                       dest=      1(%g1).1(%g2).0(0).OBR.00543.[0]

      MSH

      {

        [

        PID

        [{ NTE } ]

        [ PV1 ]

        ]

        {

         [ ORC ]

         OBR

         [{ NTE } ]

           {

           [ OBX ]

           [{ NTE } ]

           }

        }

      }

    Viewing 0 reply threads
    • Author
      Replies
      • #73511
        Jim Kosloskey
        Participant

          Tom,

          I think your basis is off.

          First question though is – will there be multiple patients? This does not afffect the change I am going to recommend but the first iteration is not necessary if each mesage will only have one Patient.

          Assuming that you want to continue as if there were multiple patients…

          Try setting your basis by using the inbound message tree.

          In your first ITERATE select the flag just above the PID segment (that is the group flag for the PID Group). If the ‘Copy to Basis’ button (looks like this {…}) below the inbound treee is no longer greyed out, you are at the right place and you should see a path below the buttons. If you click on the ‘Copy to Basis’ button your Basis field in the ITERATE should be populated. I am guessing it will look like this:

          1(0).1

          Now do the same thing with the OBR. Since it is a group the position to select in the inbound tree is the flag above the OBR segment (there could be two only one will activate the ‘Copy to Basis’ button.

          I am guessing this one will look like this:

          1(0).1(0).0

          and you should make it look like this in your basis field for the OBR ITERATE: 1(0).1(%g1).0

          In your COPY:

          1(0).1(%g1).0(%g2).OBR.00543.[0]

          If you know there will only be one Patient then you can just do the second ITERATE and modify the COPY accordingly.

          If you want to double check, here is something I do sometimes to check my sanity with Repeitions:

          Run the HL/7 tester for this variant against a message that has the repetitions you want with the detail level at something like 2 and look at the pathing. You will see the number change in the appropriate places for each repetition. Compare that pathing to where you have your basis.

          email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

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