I need to pad the MRN coming in on results messages from one system into our HIS. I currently have the following TCL code in the Xlate to pad PID-3.1 with zeroes until it reaches 9 digits long. I feel like this is not the most efficient way to do this but it is working for now. If anyone has a more efficient bit of code it would be appreciated.
set mrn [lindex $xlateInVals 0]
set mrnLength [string length $mrn]
while {$mrnLength < 9} {
set mrn 0$mrn
set mrnLength [string length $mrn]
}
set xlateOutVals $mrn