donald faivre

Forum Replies Created

Viewing 2 replies – 1 through 2 (of 2 total)
  • Author
    Replies
  • in reply to: Convert segments sent #86177
    donald faivre
    Participant

      I appreciate you looking at this with me Jerry.

      Tried the new code it replaced everything with OBX.

      in reply to: Convert segments sent #86175
      donald faivre
      Participant

        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”

      Viewing 2 replies – 1 through 2 (of 2 total)