Tried a few things and it isn’t working not sure what I am missing.
run {
# ‘run’ mode always has a MSGID; fetch and process it
keylget args MSGID mh
set msg [msgget $mh]
set sep [csubstr $msg 3 1] ;# HL7 field separator
set segments [split $msg r]
foreach segment $segments {
# echo “Segment: $segment”
if [cequal [crange $segment 0 2] ^ZBH|] {
regsub -all ^ZBH| $segment ^OBX| segment
}
echo “Segment: $segment”
if [cequal [crange $segment 0 2] ^ZBX|] {
regsub -all ^ZBX| $segment ^OBX| segment
}
set msg [join $segments r]
}
msgset $mh $msg
lappend dispList “CONTINUE $mh”