- This topic has 2 replies, 2 voices, and was last updated 17 years, 4 months ago by .
-
Topic
-
I have a TCL proc that I want to kill ADT messages if the patient type in the PV1 segement is not equal to a certain parameter. I past procs, I would count the fields until I reached the desired field and check the value. This does not work when the ADT has multiple NK1 segments. I’m trying to locate the PV1 segement and then move to the position that I want to check. The only problem that I seem to be having is in my if condition when check the field for “PV1”. Below is my code. set field_sep [csubstr $msg 3 1] ;# HL7 field
set sub_sep [csubstr $msg 4 1] ;# HL7 subfield
set fieldList [split $msg $field_sep]
#find pv1 segment
set x 0
set pos 0
while {$x < 1} { set xfield [lindex $fieldList $pos] set xfieldList [split $xfield $sub_sep] set xtype [lindex $xfieldList 0] if {$xtype == “PV1”} incr x } else { incr pos } } set pos [expr {$pos + 17}] set pv1_17 [lindex $fieldList $pos] set subfieldList [split $pv1_17 $sub_sep] set pttype [lindex $subfieldList 0] if {$pttype == $type} { lappend dispList “CONTINUE $msgId” } else { lappend dispList “KILL $msgId” } }
- The forum ‘Cloverleaf’ is closed to new topics and replies.