Remove escape characters _____from message

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Remove escape characters _____from message

  • Creator
    Topic
  • #51831
    marcus robinson
    Participant

      I am working on a translate and have run into a couple problems with the message structure, specifically OBX-5.   I translated an ORU to an MDM, but when I look at OBX-5 I see the following characters:

      E, .br, T, P  and lines _______________

      I have a TCL that removes the E, but i need something that can remove all these characters from the message.  Has anyone seen this before?

      |________________________________________________________________________________________________________________________E.brE

      and

      E.brEHTP Notes

      regsub -all {\E\} $xlateOutVals “” xlateOutVals

      Thanks!

    Viewing 4 reply threads
    • Author
      Replies
      • #71897
        Jim Kosloskey
        Participant

          Marcus,

          I don’t know if you are aware of it but those escaped characters all mean something and probably should be escaped proeprly by the reeceiving system so the text does not lose meaning. For example the E should be converted to the escape character defined in MSH-2 (probably a single by observation) and the .br should be replaced by a new-line.

          You may have already considered that and the receving system does not have the ability to return the escaped characters to their original meaning and thus wants them removed.

          If so, you are on the correct track but probably need a more complex regsub argument set – you may also be able to use the string map to your satisfaction.

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

        • #71898
          Robert Gordon
          Participant

            Marcus;

            It looks like the vendor is using either html or rtf tags in an xml style, you can filter them out or find out if your receiving application can use them.  In the receving application needs only text results then filter then out, if your receiving application can receive formated text then convert the information.

            filter out

            regsub -all “\E\|\.br\…” $xlateOutVals “” xlateOutVals

            translate

            |________________________________________________________________________________________________________________________

            and                      Notes

          • #71899
            marcus robinson
            Participant

              Thanks guys.

              The receiving system does not convert the characters.  As a result they appear in the imported document.  So it looks like I need to work on a filter to remove them.

            • #71900
              Jim Kosloskey
              Participant

                Marcus,

                Actually it appears the sending vendor is actually following the HL/7 standard and the Receiving system is not. I don’t see any XML or HTML here at all.

                Ask the receiving system if they cannot follow the standard (it is just about the only part of the HL/7 v2 standard that is not up to individual interpretation) can they tolerate having the separator characters and line break in the message. If they can (it does not break their parser) then you can convert those to their separator characters (E is , T is & (typically), etc.) and the .br to new-line on the outbound TPS prior to delivery.

                For example:

                |________________________________________________________________________________________________________________________E\.br\E and E\.br\EHTP Notes

                after proper substition would be:

                |________________________________________________________________________________________________________________________

                and

                H&P Notes

                Where is the actual hex for new-line.

                You can see H&P Notes makes sense where HP Notes does not.

                If they cannot tolerate the separators you can agree on some substiitution that makes sense like substituting ‘ and ‘ for T so that HTP reads H and P.

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

              • #71901
                marcus robinson
                Participant

                  Thanks Jim.  What you say makes sense.  Unfortunately I am the receiving system so I know there isn’t anything  that I can do.

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