Forum Replies Created
-
AuthorReplies
-
Charlie Bursell wrote:
Oxygen.
whichever process writes to file knows the file name. That process can rename the file as soon the date changes. There are many ways of doing this. You have to choose the best method that suits your needs. I do not know how you are writing to file.
If you give more details, I may be able to help you.
Thank you.
Dinakar
Try the following in your script. tcl>set a “LawsonJE.txt”
LawsonJE.txt
tcl>set b [file rootname $a]
LawsonJE
tcl>set c “$b.[clock format [clock seconds] -format “%Y%m%d”]”
LawsonJE.20081016
tcl>
Let me know, if you need more information.
Dinakar
Try following: You need to escape ^ character. set a “ORU^O01”
ORU^O01
tcl>regsub — {^} $a {_} b
1
tcl>echo $b
ORU_O01
October 10, 2008 at 5:45 pm in reply to: Get the filename on IBDir Parse and pass to OB filename #65656You can set the file name in USERDATA (meta data) or DRIVERCTRL in the inbound thread (one that picks up the file) and let the sending (outbound) thread get the filename from USERDATA/DRIVERCTRL and set as file name in ftp. I have many threads that ftp this way. I do not use Cloverleaf FTP, I have written a proc for this using ftp package.
make use of that foreach loop over segment with switch. Dinakar
Your code had few problems. I have fixed them. Please try it with following code. 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]
set data “”
set time [clock format [clock seconds] -format “%Y%m%d%H%M%S”]
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 insur [lindex [lregexp $seg_list {^IN1}] 0]
set gurant [lindex [lregexp $seg_list {^GT1}] 0]
set insur2 [lindex [lregexp $seg_list {^IN1}] 1]
append data “{$patient}rnnn{$doctor}rnnn{$test}rnnn{$insur}rnnn{$insur2}rnnn{$gurant}”
#exec lpr -S 192.168.160.26 -P HP LaserJet 4000 Series PCL on SKAGIT_PATHOLOG $file
#exec print $file
}
set file [open $time w]
puts $file $data
close $file
return “{CONTINUE $mh}”
}
time {
}
-
AuthorReplies