TCL script to copy Z segment field to end of AIS segment

Clovertech Forums Cloverleaf TCL script to copy Z segment field to end of AIS segment

  • Creator
    Topic
  • #117079
    Alison Benecchi
    Participant

      I’m having trouble with my tcl script.  I need to copy a custom Z segment field (Laterality/Body Part/Approach) to AIS.12.  The Z field is not always in the same place so I have to do a search and copy on the actual text).  What’s the best way to accomplish this?

      Here’s a snippet of my smat.

       

      ZBX|20|IS|Surg Priority^Surg Priority||Urgent||||||||Event Detail
      PID|1|9999999^^^XXXXXX|9999999^^^|||||||0|||||N
      PD1|||.^^0
      PV1|1|P|INT^^^FACILITY^^Nurse Unit(s)^FACILITY|||||||SUR||||||||PRO|||||||||||||||||||||FACILITY||PA
      RGS|1
      AIS|1||2567967417^Incision and Drainage|20200601170000|0|minutes|34|minutes||Future
      ZBX|24||Laterality/Body Part/Approach|Surgery|Left
      ZBX|25||Laterality/Body Part/Approach|Surgery|Hand
      ZBX|26||Additional Procedure Detail|Surgery|
      ZBX|27||Laterality/Body Part/Approach|Surgery|Right
      ZBX|5||Additional Procedure Detail|Surgery|INCISION AND DRAINAGE

    Viewing 3 reply threads
    • Author
      Replies
      • #117084
        Jim Kosloskey
        Participant

          Do you not want to use the Xlate?

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

        • #117095
          Charlie Bursell
          Participant

            Confusing!

            Do you want to copy the literal “Laterality/Body Part/Approach” or will there be other data.  In your example I see 3 ZBX segments that met that criteria.  Do you copy all to AIS.12?  You say not always in same place.  If its the data you want, how to id the field?

            Maybe a before and after example would be good.

          • #117096
            Ab Lugtenburg
            Participant

              Just use xlate and iterate on the zbx segement, with an by example if statement you can do a string compare and copy your data if needed

            • #117097
              Alison Benecchi
              Participant

                We do not use xlates so I was trying to get my script to work via TCL.

            Viewing 3 reply threads
            • You must be logged in to reply to this topic.