Tool to format HL7 to NL (newline) specification for Cloverleaf?

Clovertech Forums Cloverleaf Tool to format HL7 to NL (newline) specification for Cloverleaf?

  • Creator
    Topic
  • #119495
    Jason
    Participant

      Hi all,

      I’m trying to setup some sort of automated process that will replay certain failed HL7 messages in Cloverleaf. In Cloverleaf, we already have setup a ‘replay’ inbound file-based thread that will look in a folder and replay any properly formatted text/dat file.

      My issue is that, currently, the raw HL7 we’re getting out of SQL queries are not formatted properly, ASCII (0x0A & 0x0B all over the place) is off.. so Cloverleaf doesn’t read it properly as NL file type.

      Does anyone know of an HL7 tool or something that will do this in a more streamlined way? So I can just input the raw HL7 and it will come out formatted properly?

      Thanks!

    Viewing 2 reply threads
    • Author
      Replies
      • #119496
        Jason
        Participant

          Or would it be better/easier to output the SQL HL7 to XML and use that in the Cloverleaf input?

        • #119497
          Charlie Bursell
          Participant

            I understand the 0x0A in your data as that is a linefeed character.  I do not understand the 0x0B.  That is a vertical tab only used in MLLP encoding.  Are you sure it is not 0x0D which is the carriage return character?

            In any case, if you have a file you can use a simple command line perl script to change them.  For example:  (Assuming not many different hex characters)

            perl -pi.bak -e “s/0x0A/\n/g” <file name>

            The .bak will create a file with original contents in case you want to go back.  The g means global and will replace all.  If on Unix use the single quote instead of double.

            You could do this for each of the hex characters.  If worried use a different bak to enable recovery.  For example:

            perl -pi.bak1 -e “s/0x0D/\r/g” tst

            These command could be placed in a shell or batch script.

            I hope I did not mis-understand the problem here

          • #119500
            Jason
            Participant

              Charlie,

              yes, you were right, it was a 0x0D, my bad.

              Thank you for that. So what I did was basically what you’re suggesting but in C# instead of Perl.

              Appreciate you taking the time reply.

              Cheers!

          Viewing 2 reply threads
          • You must be logged in to reply to this topic.