Originally posted by Duy Nguyen
I have been running around in circles trying to pull the value of this field with my TCL code but whenever I run the testing tool and ECHO out the value of the field, it comes up empty or pulls up something else.
Would you guys see if I made a mistake somewhere because I've used similar code for other threads without any problems.
Here is my tcl proc:
proc labcorp_filter { args } {
keylget args MODE mode ;# Fetch mode
set dispList {} ;# Nothing to return
global HciConnName
switch -exact -- $mode {
start {
# Perform special init functions
# N.B.: there may or may not be a MSGID key in args
}
run {
# 'run' mode always has a MSGID; fetch and process it
keylget args MSGID mh
## pull field and component separators
set msg [msgget $mh]
set msg [split $msg r]
set msh [lindex $msg 0]
set fldsep [string index $msh 3]
set subfldsep [string index $msh 4]
echo The value of fldsep is ********** $fldsep
echo &&&&&&&&&&&&&&&&&&&
echo The value of subfldsep is ********** $subfldsep
## pull out ORC seg
set orc [lmatch -regexp $msg ^ORC]
echo TESTING ORC STUFF $orc
set orcFlds [split $orc $fldsep]
set orc13 [lindex $orcFlds 13]
echo The value of ENTIRE ORC 13 FIELD IS::::::: $orc13
set orc13 [lindex [split $orc13 $subfldsep] 0]
echo The value of ORC13 is>>>>>>>>>>>>> $orc13
## check value in the Labcorp_ALLOW table
set disp CONTINUE
set disp [hcitbllookup Labcorp_ALLOW $orc13]
if {![string length $disp]} {set disp KILL}
## if disp returned by the tables is KILL, then echo to log
if {[string equal $disp KILL]} {
set orc_msg ""
if {[info exists orc13]} {set orc_msg "- ORC.13 is $orc13"}
echo "WARNING- $HciConnName KILLING message"
}
lappend dispList "$disp $mh"
}
time {
# Timer-based processing
# N.B.: there may or may not be a MSGID key in args
}
shutdown {
# Doing some clean-up work
}
}
return $dispList
}
And here is some of my output from the testing tool:
he value of subfldsep is ********** R
TESTING ORC STUFF ORC|RE|201G5405110^LAB|201G5405110^LAB||||||200707230000|||C46028^SCHWIEBER^P^^^^^U
The value of ENTIRE ORC 13 FIELD IS:::::::
The value of ORC13 is>>>>>>>>>>>>>
WARNING- TEST KILLING message
The value of fldsep is ********** |
&&&&&&&&&&&&&&&&&&&
The value of subfldsep is ********** 1
TESTING ORC STUFF
The value of ENTIRE ORC 13 FIELD IS:::::::
The value of ORC13 is>>>>>>>>>>>>>
WARNING- TEST KILLING message
The value of fldsep is ********** |
&&&&&&&&&&&&&&&&&&&
The value of subfldsep is ********** 1
TESTING ORC STUFF
The value of ENTIRE ORC 13 FIELD IS:::::::
The value of ORC13 is>>>>>>>>>>>>>
WARNING- TEST KILLING message
The value of fldsep is ********** |
&&&&&&&&&&&&&&&&&&&
The value of subfldsep is ********** 1
TESTING ORC STUFF
The value of ENTIRE ORC 13 FIELD IS:::::::
The value of ORC13 is>>>>>>>>>>>>>
WARNING- TEST KILLING message
The value of fldsep is ********** |
&&&&&&&&&&&&&&&&&&&
The value of subfldsep is ********** 2
I am thinking the format from the vendor must be different than the other vendors I have been accustomed to....It does look quite similar though when opening up the files in the text editor.
Please advise. Thank you....