If Statement is not evaluating condition

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf If Statement is not evaluating condition

  • Creator
    Topic
  • #55825
    Rigo Vernon
    Participant

      I have a very simple if statement that evaluates a number in a variable.

      If @variable ge =10

          assign “NPI” to OBR-16.13

      Else

          assign “PROVID” to OBR-16.13

      The content of my variable is currently “5”, so it should drop to the else portion and assign “PROVID” to OBR-16.13, however this is not happening. when I run the xlate, OBR-16.13 has “NPI”. I have an echo statement in the code which confirms to me that the value in the variable is 5. If I change the value to 10 0r more, I still get NPI, which in this case I should be getting, but I know the if statement is not evaluating. I have tried deleting the code and typing it all over again, I have closed and opened the xlate, I have close the entire site,  I have shut down cloverleaf and re-open, and nothing! Can someone who is more knowledgeable than me help me by telling me why this is happening?

    Viewing 1 reply thread
    • Author
      Replies
      • #86628
        Jim Kosloskey
        Participant

          What release of Cloverleaf?

          Place echoes in each of the leg so you know which leg is actually executing.

          Make sure there are no Xlate Actions subsequent to this Action which may be resetting the OBR-16 field (including PATHCOPY Actions).

          I have been bit a few time by having subsequent code undo my change.

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

        • #86629
          Paul Bishop
          Participant

            I might not be thinking it through completely, but shouldn’t you use the numeric operator and not the string operator (>= vs ge)?  I did a quick test and that’s what made it work for me.  I’m running 6.1.1.

            Paul Bishop
            Carle Foundation Hospital
            Urbana, IL

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