Special Character in IF Condition

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Special Character in IF Condition

  • Creator
    Topic
  • #52932
    Gregg Price
    Participant

      I want an IF statement to test on a field with the special character *

      Example:

      *XR ABDOMEN  SUPINE

      The IF Condition of

      1(0).OBR(0).#4(0).[1] eq =*XR ABDOMEN  SUPINE

      generates the error

      [0:TEST] IF expression parse failed: Unrecognizable lexical token

      Error occurred at: ‘*XR ABDOMEN  SUPINE’

      [0:TEST] Unable to compile XLT ‘suburban_epic_orm_o01.xlt’.

      I’ve tried adding the in front of the *, but that didn’t work.

    Viewing 1 reply thread
    • Author
      Replies
      • #75982
        James Cobane
        Participant

          Gregg,

          Try copying the literal  to a temp variable, then use the temp variable in your IF statement; i.e.

          COPY =*XR ABDOMEN  SUPINE —> @mytemp

          IF 1(0).OBR(0).#4(0).[1] eq @mytemp

          Hope this helps.

          Jim Cobane

          Henry Ford Health

        • #75983
          Gregg Price
          Participant

            You were very close.  I didn’t need the in the copy command.

            COPY =*XR ABDOMEN  SUPINE —> @mytemp

            Copying the value to a variable and then testing the field against the variable did work.

            Thanks!

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