proc read_rad_chrg_sharedrive { args } {
keylget args MODE mode ;# Fetch mode
set dispList {} ;# Nothing to return
global HciSiteDir
global env
set rootdir $env(HCIROOT)
set sitedir $env(HCISITEDIR)
set tclpath [file join $rootdir bin tcl]
set perlpath [file join $rootdir bin perl]
switch -exact — $mode {
start {
# Perform special init functions
# N.B.: there may or may not be a MSGID key in args
}
run {
}
time {
# Timer-based processing
# N.B.: there may or may not be a MSGID key in args
set dtback [clock scan “1 day ago”]
set dtb [clock format $dtback -format %Y%m%d]
set ts [clock format [clock seconds] -format %Y%m%d]
set fname MtSinaiDailyRADChargeFile$ts.txt
#set cpath $sitedir\exec\processes\rad_chrg\ftp_in
set cpath Z:\RADCharges
set newcpath $cpath\$fname
if {[file exists $newcpath]} {
set chrgfile [read_file $newcpath]
set newmsg [split $chrgfile rn]
foreach seg $newmsg {
set mh [msgcreate -recover]
msgset $mh $seg
lappend dispList “CONTINUE $mh”
#exec rm $fpath$seg $cpath$seg
}
#catch {file delete $newcpath}
} else {
echo “”
echo “*****************************************************************”
echo “***** EXITING UPOC read_rad_chrg_file NO CHARGE FILE PRESENT $cpath $newcpath *****”
echo “*****************************************************************”
echo “”
}
}
shutdown {
# Doing some clean-up work
}
}
return $dispList
}