tps_expr_filter

  • Creator
    Topic
  • #53844
    David Barr
    Participant

    This is a proc that filters messages based on a TCL expression that is passed as an argument. You can include HL7 field specifiers (like %PID.3%) or user metadata fields (like %u|VARNAME%).

    Example arguments:

    { EXPRESSION {! [regexp {^NC} %PID.18%] } }

     Kills a message if PID.18 starts with NC

    { EXPRESSION {%OBX(3.1=SmokingStatus).1% eq ” }}

     Kills a message if it contains an OBX with SmokingStatus in OBX.3.1

    { EXPRESSION {! [regexp {^EC} %u|DEPT%] } }

     Kills message if DEPT variable in user metadata starts with EC.

    The code was inspired by discussion in this thread.

Viewing 1 reply thread
  • Author
    Replies
    • #79159
      Amdy Diene
      Participant

      Dave, from where do you call this TCL proc?

    • #79160
      David Barr
      Participant

      You can call it from any context that want. All the script does is evaluate the expression and return a CONTINUE if it matches and a KILL if it doesn’t.

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

Forum Statistics

Registered Users
5,117
Forums
28
Topics
9,292
Replies
34,435
Topic Tags
286
Empty Topic Tags
10