- This topic has 8 replies, 3 voices, and was last updated 15 years, 12 months ago by .
-
Topic
-
I have a fairly simple proc I wrote that extracts data from incoming ADT or ORM’s, creates a file name with a time stamp, and copies the data out to it. When I run it through the tester, route test, and tps with show by dest, it works fine. When I place it in the inbound thread, route messages, xlate prop., preproc or post proc, it creates the file, but it is 0 bytes, any ideas. Here is the proc proc insurance_sheet { args } {
set mode [keylget args MODE]
switch -exact — $mode {
start {
}
run {
set mh [keylget args MSGID]
set msg [msgget $mh]
set fldSep [string index $msg 3] ; # Normally |
set seg_list [split $msg r]
foreach seg $seg_list {
set name [lindex [lregexp $seg_list {^MSH}] 0]
set ID [lindex [split $name $fldSep] 6]
set patient [lindex [lregexp $seg_list {^PID}] 0]
#set ID [lindex [split $seg $fldSep] 5]
set obr [lindex [lregexp $seg_list {^OBR}] 0]
set doctor [lindex [split $obr $fldSep] 16]
set test [lindex [split $obr $fldSep] 4]
set time [clock format [clock seconds] -format “%Y%m%d%H%M%S”]
set insur [lindex [lregexp $seg_list {^IN1}] 0]
set gurant [lindex [lregexp $seg_list {^GT1}] 0]
set insur2 [lindex [lregexp $seg_list {^IN1}] 1]
set data “{$patient}rnnn{$doctor}rnnn{$test}rnnn{$insur}rnnn{$insur2}rnnn{$gurant}”
set file [open $time w]
puts $file $data
#exec lpr -S 192.168.160.26 -P HP LaserJet 4000 Series PCL on SKAGIT_PATHOLOG $file
#exec print $file
return “{CONTINUE $mh}”
}
}
}
}
time {
}
- The forum ‘Cloverleaf’ is closed to new topics and replies.