Use ITERATE to loop through the each address repetition

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Use ITERATE to loop through the each address repetition

  • Creator
    Topic
  • #54988
    Reena Gadhia
    Participant

      Hi,

      I need help in writing an ITERATE fuction to loop through PID;11 field until it finds HOME  and when i find a match, I can copy the address fields from source to the destination.

      E.g.

      London^^^””^””^””^TEMPORARY^^””~Flat 6 Rowan Court^112A Coombe Lane^London^””^SW20 0BA^GBR^HOME^Raynes Park^””

    Viewing 3 reply threads
    • Author
      Replies
      • #83696
        Robert Kersemakers
        Participant

          Hi Reena,

          You can do this through tcl or in Xlate. I prefer Xlate, where it will look something like this:

          Quote:


          ITERATE Type: field; Basis: 1(0).0(0).PID(0).00114; Variable: %f1

           IF 1(0).0(0).PID(0).00114(%f1).[6] eq =HOME

             COPY 1(0).0(0).PID(0).00114(%f1).[0] -> @destination

             etc…

          It could be that the path for your PID-field differs though, depending on the HL7 variant/event.

          Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands

        • #83697
          Reena Gadhia
          Participant

            Hi Robert,

            Thank you for your quick response on this.

            How can I add to the xlate below that if the home address is blank, add the temporary address to the destination?

          • #83698
            Jim Kosloskey
            Participant

              In HL/7 a component should never be blank it will be null like thiis ^^. I am assuming it is null.

              You can add an ELSE to the existing IF or add a new IF both would check the desired component to the temp variable @null which is provided with Xlate.

              If it is actually blank – first try to get the source system to fix that. If the cannot fix it then some Tcl will be necesary to check the component for all spaces.

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

            • #83699
              Reena Gadhia
              Participant

                Thanks Jim.

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