Originally posted by Gerri Jackson
please help!! I have a tcl that will take a string phone number and format correctly, it echos out correctly. when I take the output and put it to the frl, the phone number is not formatted at all, just a string. i have attached one of the many tcl i have written, and the ouput!! any suggestions would be appreciated, i am ready to pull my hair out!!!
tcl:"hsm_phone.tcl" 22 lines, 554 characters
proc hsm_phone {} {
upvar xlateInVals invals xlateOutVals outvals
#
# format telephone field ("1234567890" to "(123)456-7890")
#
echo ">>> emr_phone: <$invals>"
regsub -all -- "-" $invals "" numInval
set space " "
set tele1 [crange $numInval 0 2]
set tele2 [crange $numInval 3 5]
set tele3 [crange $numInval 6 9]
set xlateOutVals1 "($tele1)$space$tele2-$tele3"
# set xlateOutVals2 "$tele2-$tele3"
echo "xlateOutone <$xlateOutVals1>"
# echo "xlateOuttwo <$xlateOutVals2>"
output:
>>>formatted_date: <01/28/1963>
>>> emr_phone: <2123216546>
xlateOutone <(212) 321-6546>
>>> emr_phone: <2123216546>
xlateOutone <(212) 321-6546>
MESSAGE 1
last_name: >AIGTEST <
first_name: >TWO <
middle_name: > <
gender: >F<
birthdate: >01/28/1963<
ssn: >565-46-5465 <
EPN: >2506378 <
address: >230 West 245 Street <
address2: >305 <
city: >Bronx <
state: >NY<
zipcode: >10457 <
home_phone: >2123216546 <
business_phone: >(135)465-4651 <
mrn: >2506378 <
name_display: >AIGTEST, TWO