CALL function

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf CALL function

  • Creator
    Topic
  • #48844
    Mark Perschbacher
    Participant

      I am experimenting with ways to remove the ~’s from the OBX segment of an MDM message that I am xlating from an ORU.  The ~’s are the new line deliminters, so I am testing a proc by removing the *’s first.   I have this proc entered in the CALL function of the xlate, but it doesn’t seem to be working.  If I enter the same code directly into the COPY function, it works fine.   What part am I missing?

      proc tilde {} {

      upvar xlateId xlateId

      xlateInList                xlateInList

      xlateInTypes xlateInTypes

      xlateInVals xlateInVals

      xlateOutList xlateOutList

      xlateOutTypes xlateOutTypes

      xlateOutVals xlateOutVals

      set code [lindex $xlateInVals 0]

      regsub -all {*} $code { } code1

      set xlateOutVals

        #echo “proc run”

        }

        CALL   Options  TCL    tilde   Source1(0).1(0).1(0).OBX.00573

        Destination0(0).OBX(0).00573(0)

    Viewing 3 reply threads
    • Author
      Replies
      • #59875
        Greg Eriksen
        Participant

          Is ”

            ” just a typo in your posting, or do you have it that way in your actual proc code and maybe it should be “
            ” ?

        • #59876
          Mark Perschbacher
          Participant

            It was just a typo, and what I was missing was the xpmstore line.  It still will not work if I substitute the * for a ~, so I need to figure out how to work around the delimiter issue.

          • #59877
            Greg Eriksen
            Participant

              I may not understand your issue, but since the tilde is the repetition delimiter, could you just set up an Iterate to loop through all the “repetitions” of lines, and append them all into a temp field?  You could tack on whatever you want as a substitute for a line break indicator, if that’s what you’re trying to do.  And then do a copy of the temp field to your output.

            • #59878
              Mark Perschbacher
              Participant

                Greg, what the background here is that our pathology system parses our results into OBX-5 with a character limit of a set value.  Two EMR vendors we are sending results to have systems that have different values set for the characters in OBX-5.  I was trying to pull the ~’s out and see if they can insert line breaks on their own.  On a side note, take a look at this proc I pulled off Clovertech.  I have not seen anyone use the CALL command with an @ variable, and was wondering if the syntax was correct

                ITERATE: group Basis: 1(0).1(0).1 Variable: %g1

                CALL:   Source: @gIndex, 1(0).1(0).1(%g1).OBX.00573.[0]  Destination: @gIndex

                set i [lindex $xlateInVals 0]

                   set OBX5 [lindex $xlateInVals 1]

                   set addr {1(0).1(0).1(index).OBX.00573}

                   

                   if {[string length $OBX5] > 68} {

                       set pos 0

                       while {$pos < [string length $OBX5]} {            regsub index $addr $i addr            xpmstore $xlateId $addr c [string range $OBX5 $pos [expr $pos + 67]]            regsub {(d+).OBX} $addr (index).OBX addr            incr pos 68            incr i        }    } elseif {[string length $OBX5] > 0} {

                       regsub index $addr $i addr

                       xpmstore $xlateId $addr c $OBX5

                       incr i

                   }

                   xpmstore $xlateId [lindex $xlateOutList 0] c $i

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