Using "ct" in xlate to find * (asterix)

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Using "ct" in xlate to find * (asterix)

  • Creator
    Topic
  • #53000
    Tom Arrowsmith
    Participant

      In the Cloverleaf Engine we want to use the ct function (contains) in an IF statement. In this particular case, we want to see if the value contains an asterix ( * ) What is the syntax for this?

      We tried the following:

      1.     IF hl7 field ct *

      2.     IF hl7 field ct =*

      3.     IF hl7 field ct

    Viewing 2 reply threads
    • Author
      Replies
      • #76206
        Ian Morris
        Participant

          I haven’t had much luck comparing a string to a variable/field within an if statement.  In this situation I would set a variable like this:

          =* COPY @testvar

          Then I would compare @testvar to the value you want to use.

          Also, your example may work if you make your escape character like “” instead of “/”.  I think you are using it backwards.

          Tom Arrowsmith wrote:

          In the Cloverleaf Engine we want to use the ct function (contains) in an IF statement. In this particular case, we want to see if the value contains an asterix ( * ) What is the syntax for this?

          We tried the following:

          1.

        • #76207
          Jon Blanchard
          Participant

            <span style="color: Indigo]One option is to set a temp variable to the boolean result of a tcl snippet using the regexp statement, i.e.”>

            Code:

            COPY action:

            Inbound=

            tclproc=set xlateOutVals [list [regexp — {*} [lindex $xlateInVals 0] ] ]

            Outbound=


            The result of the regexp will be 0 or 1.

            Migration Consultant
            Coffee Regional Medical Center
            Eastern Time Zone

          • #76208
            Paul Von
            Participant

              I was having the same issue and someone suggested this to me and it worked great.

              1) Assign the asterisk

               a. Copy   =*   to   @asterisk

              2) Check if it is in the string

               a. 0(0).PID(0).#18(0) ct @asterisk

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