echoing $code will probably show that the 0th element of your xlateInVals list is going to be everything to the left of the (first) ‘~’. The delmiiters will split your xlateInVals list and won’t actually show up in the xlateInVals list elements.
The only way I know to remove unwanted delimiters is in a tps proc, not an xlt proc.
If you know that you only have “~”s in the data at the front end of the copy you could do somthing like this inside the xlt proc. This fails if there are ^s or &s spiltting up the incoming list.
set outVal “”
foreach val $xlateInVals {
append outVal $val “~”
}
set outVal [ string trimright $outVal ~ ] ;# remove trailing s or ~s
set xlateOutVals [ list [string map “~ { }” $outVal ] ]
depending on what you are trying to do, a pre/post tps proc may be more straightforward – that’s where we invariably do this sort of scrubbing when the data isn’t quite HL7.
Ed, I went ahead and inserted it as an xlate CALL, and it worked. The only problem is since the ~’s are deliminters, when the xlate converts the proc output back to the outval, it still inserts the ~’s. I am thinking that running a similar proc on the thread after it is xlated might be the way to go. I am also testing another proc I pulled from Clovertech that truncates the OBX-5 if it is greater than 68 characters, but can’t get it to work. The proc runs fine, it just doesn’t truncate. Do you have time to take a look at it?
Author
Replies
Viewing 3 reply threads
The forum ‘Cloverleaf’ is closed to new topics and replies.