Iteration Query

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Iteration Query

  • Creator
    Topic
  • #48339
    Ray Mullen
    Participant

      Hi I posted this query in the wrong forum, so here it is again thanks.

      Hi this is probably quite simple but im not too sure how to go about it. I am trying to map HL7 Phone values to a proprietry system. (FRL). For Example I am mapping Home Phone number and Mobile Phone number to 2 seperate fields in A FRL.

      On the hl7 side the fields required come in as follows:

      PID_13_1(1): phone number

      PID_13_1(2): PH

      PID_13_2(1): mobile_phone

      PID_13_2(2): CP

      I have set up an iterate in the Xlate as follows:

      Type: Field

      Basis: 0(0).pid.00116

      Variable: %f1

      On the copy Option for the telephone e.t.c I have setup the following:

      Source : 0(0).pid.00116(%f1)

      Destination: Telephone Number

      And the tcl in the translate goes as follows:

      set data [lindex $xlateInVals 1]

      if {[cequal $data “PH”]} {

      set c_phone [lindex $xlateInVals 0]

      set xlateOutVals

        }

        I keep getting the last value in the repeating field , am i going about this the correct way or is there a much easier way. I need to fall out of the iteration when i receive the telecomunication use code i need e.t.c.

        Thanks in advance for your help

        Ray

    Viewing 1 reply thread
    • Author
      Replies
      • #58349
        Charlie Bursell
        Participant

          The primary difference between a COPY and a CALL statement in Xlate is that a COPY *ALWAYS* copies something to the output.  If nothing is specified, the input value is copied.  To do it the way you have coded you need to use a CALL statement and use xpmstore in the if.

          OR, you could use an Xlate IF inside your iterate like:

                              IF 0(0)PID.#13(%f1).[0] eq ==PH

                              COPY 0(0)PID.#13(%f1).[1] -> Telephone Number

          Charlie

        • #58350
          Ray Mullen
          Participant

            Great Thanks for your help Charlie , Much appreciated.

            Ray

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