IF multiple condition in TCL

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf IF multiple condition in TCL

  • Creator
    Topic
  • #53190
    Femina Jaffer
    Participant

      Hello,

      I am trying to do the most simplest thing and today I cannot get this code to work…  I am not getting the “OR” condition to work (||).

      proc PP_nte_rename { args } {

         keylget args MODE mode                      ;# Fetch mode

         set dispList {}                             ;# Nothing to return

         # ‘run’ mode always has a MSGID; fetch and process it

                    keylget args MSGID mh

         set msg [msgget $mh]

         set splitMsg [split $msg r]

         set ormCheck [lindex [split [lindex $splitMsg [lsearch $splitMsg “MSH|*”]] |] 8]

         set ormCheck [string range $ormCheck 0 2]

         set OBRsegID [lsearch -glob $splitMsg OBR|*]

         set OBRseg [lindex $splitMsg $OBRsegID]

         set OBRsplit [split $OBRseg |]

         set tstCd [lindex $OBRsplit 4]        

         set tstCd [string trimleft [lindex [split $tstCd ^] 0] 0]

                   array set note_labels {}

                   set segments {}

                   

       if {$tstCd ne “FCPNH” || $tstCd ne “DERMP”} {

                       lappend dispList “KILL $mh”

            } ; # close the main IF loop (before the foreach)

      } ; #close the main proc

      This message should CONTINUE as the test data has the right code “FCPNH”; however, it is killing this message.  Pls. advise.

      Femina

    Viewing 3 reply threads
    • Author
      Replies
      • #76866
        Jim Kosloskey
        Participant

          Femina,

          That should be an AND not an OR and then it should work.

          email: jim.kosloskey@jim-kosloskey.com 30+ years Cloverleaf, 60 years IT – old fart.

        • #76867
          Femina Jaffer
          Participant

            Oh gosh…that took care of that –don’t know how I missed that!!

            When I run this thru the testing tool as a “TPS” it works perfect no errors.  When I run this thru the testing tool and test as “ROUTE” — I get the following error:

            [xlt :xlat:ERR /0:  UNNAMED_TID:07/09/2012 16:06:49] [0.0.3] Xlate ‘FO_ORM_TA.xlt’ failed: Input validation errors: HL7 message does not begin with MSH segment.  

            What does this mean?  Please advise.

            Thanks,

            fj

          • #76868
            Jon Blanchard
            Participant

              If a proc has no reason to KILL the message, then it needs to CONTINUE the message prior to closing the main proc.  The CONTINUE may occur automatically in the test engine, but is required in regular use.  

              Just thought I would mention it, in case it wasn’t covered.

              Migration Consultant
              Coffee Regional Medical Center
              Eastern Time Zone

            • #76869
              Femina Jaffer
              Participant

                Thank you Jon and Josh for you replies…

                The problem has been resolved.  The first was due to the OR –changed that logic to AND as Jim pointed out.  The second issue had to do with another code in the routing.  

                Thanks again.

                Femina

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