Need to replace the | (pipe) in OBX.5 with F

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Need to replace the | (pipe) in OBX.5 with F

  • Creator
    Topic
  • #54975
    Frank Urbanija
    Participant

      Within the OBX segment in the result area (OBX.5) if there is a | within the text the remote system believe this is a field delimeter so it messes up the text result.  I need to replace the | with F.

    Viewing 5 reply threads
    • Author
      Replies
      • #83644
        aaron kaufman-moore
        Participant

          I’d use a regsub in a pre-proc command would be:

          regsub -all {|} $ {\F\}

        • #83645
          Jim Kosloskey
          Participant

            I would thiink this would need to be done at the field level. Doing it unilaterally at the message level would probably result in an unusable HL/7 message don’t you think?

            Like MSHF&^~Fib systemFib appF instead of

            MSH|&^~|ib system|ib app|

            Now how you are going to recognize the specific field when a field separator is imbedded is a good question.

            Personally I feel the resolution belongs with the source system before the message is sent.

            email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

          • #83646
            Frank Urbanija
            Participant

              Need to do this just for OBX.5  The regsub

            • #83647
              Frank Urbanija
              Participant

                Doing following in testing but also replacing the field seperators – | pipe after OBX.5. with F and I just want OBX.5 to be changed if | appears within OBX.5

                set sep [csubstr $msg 3 1] ;# HL7 field separator    

                   set sub [csubstr $msg 4 1] ;# HL7 subfield separator    

                   set segments [split $msg r] ;# Get segments

                   set outbuf “” ;# Holds outbound message

                foreach seg $segments {

                if [cequal $seg “”] { continue } ;# Just in case

                set segtype [csubstr $seg 0 3] ;# segment type

                echo >>>>>> SEGTYPE $segtype

                if [cequal $segtype OBX ] { ;# OBX?

                set fields [split $seg $sep] ;# Fields

                   echo >>>>>>>>>>> $fields $seg $sep

                      set sep “|”

                set obx5 [string trimright [join [lrange $fields 5 end] $sep] $sep]

                          # regsub -all “|” $obx5 “\F\” obx5

                regsub -all  — {(|)} $obx5 {\F\} obx5

                set obx [join [lreplace $fields 5 end $obx5] $sep]

              • #83648
                Charlie Bursell
                Participant

                  Jim is right.  This should be resolved at the source

                  If you know the extra pipe is always there it would not be hard.  But what if it is not?  You must have some of a priori knowledge of the structure

                  For example, if you do not need any data after field five you could split on the field separator and then join list elements 5 and 6 with the F  before putting the segment back together.

                  It is really a pain that should resolved by the source that is sending an illegal HL7 message

                • #83649
                  Rehman Masood
                  Participant

                    Epic does this on their outbound documentation interface. I solved this by setting up Epic to send the RTF in OBX-5 as base64 encoded (there is a PV that allows this) and then on my way switching it back to RTF, I replaced | as F and so forth. Jim/Charlie, are you right. If the source system can’t send it then see if they can send the data as base64 encoded where it might become a little bit easier for u to handle this.

                Viewing 5 reply threads
                • The forum ‘Cloverleaf’ is closed to new topics and replies.