NTE|1||Length of Study->30 Days||
NTE|2||Special instructions (if applicable):->Test eCardio order||
NTE|3||Service/Device Type->Mobile Cardiac Telemetry||
NTE|4||Serial Number->serial #||
Here is my logic I am trying to use.
if { ($segID == “NTE”) } {
set mct “Mobile Cardiac Telemetry”
set cem “Cardiac Event Monitor”
set MCT MCT
set CEM CEM
set fieldList [split $segment $fldSep]
set NTE3 [lindex $fieldList 3]
set NTE3ran [string range $NTE3 0 3]
echo “NTE3ran = $NTE3ran”
if {[cequal $NTE3ran “Leng”]} {
set nteCnt 1
set lenList [split $segment |]
set NTElen3 [lindex $lenList 3]
set nte31 [string range $NTElen3 16 end]
set obxSeg “OBX|$nteCnt|ST|12918^Deploy Duration (In Days)||$nte31”
incr nteCnt
lvarpop segList $count
set count [incr count -1]
}
if {[cequal $NTE3ran “Spec”]} {
lvarpop segList $count
set count [incr count -1]
}
if {[cequal $NTE3ran “Serv”]} {
set nte3 [lindex $fieldList 3]
echo “nte3 = $nte3”
set nte3serv [string range $nte3 20 end]
echo “nte3serv = $nte3serv”
if {[cequal $nte3serv “Mobile Cardiac Telemetry”]} {
set obxSeg2 “OBX|$nteCnt|ST|12916^Service/Device Type||$MCT”
incr nteCnt
lvarpop segList $count
set count [incr count -1]
}
}
# set obxSeg2 “OBX|$nteCnt|ST|12916^Service/Device Type||$CEM”
#echo “obxSeg2 = $obxSeg2”
# incr nteCnt
# lvarpop segList $count
# set count [incr count -1]
if {[cequal $NTE3ran “Seri”]} {
set seriList [split $segment |]
#echo “seriList = $seriList”
set NTEseri3 [lindex $seriList 3]
#echo “nteseri3 = $NTEseri3”
set nte3 [string range $NTEseri3 21 end]
#echo “nte3 = $nte3”
set obxSeg3 “OBX|$nteCnt|ST|12917^Hookup Location||Office”
incr nteCnt
set obxSeg4 “OBX|$nteCnt|ST|12919^Ssrial Number||$nte3”
set newNTESeg [concat $obxSegr$obxSeg2r$obxSeg3r$obxSeg4]
set segList [lreplace $segList $count $count $newNTESeg]
}
}