Kill a Message in a IF Statement

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Kill a Message in a IF Statement

  • Creator
    Topic
  • #48367
    Galen Weinberg
    Participant

      Is there any way to kill a message if our IF statement in our translation is true or false, depending on what you are testing for. I’m trying to see if a PID 2 segment is there, then I want that message if not I want to kill it. I’m have trouble making this work, any suggestions.

    Viewing 1 reply thread
    • Author
      Replies
      • #58422
        Michael Lacriola
        Participant

          The answer is yes. Your options are a few if not many. “If” you are going to use a Xlate, place a “SUPPRESS” statement as the last line. Somewhere before that, use an “IF” statement to test a value in the PID not equal to @null (say PID.#1). If true, then place a “CONTINUE” statement within the “IF” as the last statement. The SUPPRESS will ensure that the outbound message structure does not get sent, while the CONTINUE statement will send the outbound structure onto the next TPS statk. It is important that the CONTINUE is the last statement within the IF and all other Xlate commands are before it.

          In a TPS, you will need to search the msgdta string for, let’s say PID|. If found then set your disposition to “CONTINUE”, else set it to “KILL.”

          Hope this gets you going in the right direction.

        • #58423
          Anonymous
          Participant

            Hope this code fragment helpful. In this messages is discarded if the PV1:18 contains the following: CN1

            foreach segment $segmentList {

                           if [cequal [crange $segment 0 2] PV1] {

                                   set fieldList [split $segment $field_sep]

                                   set pv1_18 [lindex $fieldList 18]

                           } else {

                           }

                       }

            # The following command is used to select specific patient types.

                           if {[regexp {CN1} $pv1_18]} {

                           lappend dispList “KILL $mh”

                           return $dispList

                       } else {

                           lappend dispList “CONTINUE $mh”

                           return $dispList

                      }

                      }

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