If statement in translation

Homepage Clovertech Forums Read Only Archives Cloverleaf Cloverleaf If statement in translation

  • Creator
    Topic
  • #49639
    Joseph Paquette
    Participant

    I almost am embarrased to ask this question,  in a translation i am using an if statment.  If ~0(0).OBR.238.[4] eq =Stress test  i am getting a failure due to a multi word answer.  How to i search for “Stress test” in a translation if there is a space in the text??

Viewing 5 reply threads
  • Author
    Replies
    • #62824
      James Cobane
      Participant

      Joseph,

      This one has gotten me before as well.  To work around it, copy the literal ‘Stress test’ to a temp variable, and then use the temp variable in the IF statement:

      COPY =Stress test  –> @stresstest

      IF ~0(0).OBR.238.[4] eq @stresstest

      Hope this helps.

      Jim Cobane

      Henry Ford Health

    • #62825
      Joseph Paquette
      Participant

      Thanks,  worked perfectly.

      Joe

    • #62826
      Ruth Chong
      Participant

      Hi All experts out there….

      If i want to compare say IF @label  =a/treatment/findings

      how do i make the engine read the entire a/treatment/findings…it cannot process because of the /

      HELP!..thanks

    • #62827
      Tom Rioux
      Participant

      Ruth,

      The translator that is doing the IF won’t be able to recognize the “/” character because it has special meaning.   Here is what you can try:

      1.  In the copy statement where you are setting your @label variable, change your slashes to underscore via regsub or something.   You can use this:   regsub -all “/” $xlateInVals “_” xlateOutVals

      That should be all you need in the Tcl fragment.

      2. In the IF statment, simply change it to say:

        IF  @label eq =a_treatment_findings

      Then perform whatever you want to do underneath the IF

      I have tested this on my 5.2 Clovereleaf and it appears to be working just fine.  Let me know if you have any questions.

      Thanks…

      Tom Rioux

      Baylor Health Care Systems

    • #62828
      Robert Kersemakers
      Participant

      Another possible solution would be to put the condition into a variable:

      COPY =a/treatment/findings -> @condition

      IF @label eq @condition

      Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands

    • #62829
      Ruth Chong
      Participant

      Hi All Experts

      Thanks for the precious advice, I adopted using the temp variable instead.

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

Forum Statistics

Registered Users
5,115
Forums
28
Topics
9,290
Replies
34,422
Topic Tags
286
Empty Topic Tags
10