setting a portion of ORU OBX.5 to a variable missing spaces

Homepage Clovertech Forums Read Only Archives Cloverleaf Cloverleaf setting a portion of ORU OBX.5 to a variable missing spaces

  • Creator
    Topic
  • #50850
    Gina Borden
    Participant

    I don’t claim to be a tcl programmer, but I am  trying to pull a certain phrase out of result and set it to a variable.  I have the following proc in my Pre tcl of a concat in my Xlate:

    set text [string toupper $xlateInVals]

    set index [string first “IMPRESSION:” $text]

    echo “indexIM =$index”

    if {$index > -1} {

       set text [string range $text $index [string length $text]]

    echo “textIM =$text”

       set xlateOutVals $text

    }

    if {$index == -1} {

        set OutVal “UNKNOWN”

    }

    When I run this through my tester the echo textIM shows:

    But when I set my variable in my outbound field, it comes out like
    Creator
    Topic
Viewing 2 reply threads
  • Author
    Replies
    • #67766
      Jim Kosloskey
      Participant

      Gina,

      A hint: all of the values you upvar for an XPLT type proc are LISTS and need to be treated as such.

      Also it appears this is a repeating field. If so, you may be able to simplify your Tcl work by Iterating through the repetitions of the field rather than trying to treat the entire set as one field.

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

    • #67767
      Robert Milfajt
      Participant

      Try using:

      Code:

      set xlateOutVals [list $text]

      Also it appers you are setting OutVals and not xlateOutVals in your second set statement.

      Robert Milfajt
      Northwestern Medicine
      Chicago, IL

    • #67768
      Gina Borden
      Participant

      Thanks!  That was it!  It always seems to be the little things. . .

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

Forum Statistics

Registered Users
5,126
Forums
28
Topics
9,296
Replies
34,439
Topic Tags
287
Empty Topic Tags
10