Now, in another xlate, I need to read the file and retrieve a specific value.
The table consists of the Message ID from the MSH segment and a Medical Record Number.
I’m doing the read using a foreach loop. It is reading all of the records in the file, but I’m not able to select the one I need. Do I need to set it up as an array? I set up a counter that does increment as the foreach is executed. The $message_id is passed out of the Xlate
CL 6.0.2. AIX system.
[Just s snippet of the tcl code. All variables are defined.]
foreach line [ split $msg n ] {
echo “Data is: ” $msg
incr indx
echo “Counter is: ” $indx
set file_msg_id [ string range $msg 0 19 ]
set mrn_found_id [ string range $msg 21 27 ]
if { $file_msg_id == $message_id } {
set RESULTS $mrn_found_id
echo “Results to send back is:” $RESULTS
}
}