Greg, what the background here is that our pathology system parses our results into OBX-5 with a character limit of a set value. Two EMR vendors we are sending results to have systems that have different values set for the characters in OBX-5. I was trying to pull the ~’s out and see if they can insert line breaks on their own. On a side note, take a look at this proc I pulled off Clovertech. I have not seen anyone use the CALL command with an @ variable, and was wondering if the syntax was correct
ITERATE: group Basis: 1(0).1(0).1 Variable: %g1
CALL: Source: @gIndex, 1(0).1(0).1(%g1).OBX.00573.[0] Destination: @gIndex
set i [lindex $xlateInVals 0]
set OBX5 [lindex $xlateInVals 1]
set addr {1(0).1(0).1(index).OBX.00573}
if {[string length $OBX5] > 68} {
set pos 0
while {$pos < [string length $OBX5]} {
regsub index $addr $i addr
xpmstore $xlateId $addr c [string range $OBX5 $pos [expr $pos + 67]]
regsub {(d+).OBX} $addr (index).OBX addr
incr pos 68
incr i
}
} elseif {[string length $OBX5] > 0} {
regsub index $addr $i addr
xpmstore $xlateId $addr c $OBX5
incr i
}
xpmstore $xlateId [lindex $xlateOutList 0] c $i