Clovertech
› Clovertech Forums › Read Only Archives › Cloverleaf › Cloverleaf › regsub
want to replace every occurrence of “S” in all of the obx segments with the character “;”
dont want to replace S when found in NTES…..other segments
regsub -all …?
THanks
Easy enough in Tcl, a bit harder in Xlate
assuming you have done the normal HL7 stuff
set map
foreach loc [lsearch -all -regexp $SEGMENTS {^OBX}] {
set obx [string map $map [lindex $SEGMENTS $loc]]
set SEGMENTS [lreplace $SEGMENTS $loc $loc $obx]
}
msgset $mh [join $SEGMENTS r]
return “{CONTINUE $mh}”
Thanks Charles!!
I was thinking youd be giving me one of those 1 line regsub extravaganzas..but this works !!!
Appreciate your Sunday time!