Convert HL7 to text

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Convert HL7 to text

  • Creator
    Topic
  • #52812
    Gena Gill
    Participant

      I need to get a document out of our transcription system in a flat .txt format.  The documents come out as MDM message types with the full text of the document itself in OBX 5.

      I’d like to take that OBX 5 field and convert it to a readable text document that I can then upload into a system that does not accept HL7 transactions, but I really don’t know where to start.

      Does anyone have any suggestions?

    Viewing 3 reply threads
    • Author
      Replies
      • #75548
        Daniel Lee
        Participant

          You could write a tcl proc that takes whatever is in the OBX-5 and writes it to a flat file using the patient account number and the document number as the file name.

          If you want someone else to upload these documents then I’d write them to a file share instead of on your interface engine server.

        • #75549
          Jim Kosloskey
          Participant

            Gina,

            Perhaps the outbound can be described as a VRL or HRL.

            In that case simply Xlate from HL/7 to the VRL or HRL and make your outbound thread Fileset protocol.

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

          • #75550
            Josh Deere
            Participant

              Here’s some pseudo-code to do what you’re looking for:

              # assuming ‘mrn’ = patient id and ‘duid’ = document id

              set fn “/path/to/file/${mrn}_${duid}.txt”
              set fp [open $fn w]

              # assuming ‘segs’ is a list containing all segments from msg

              foreach _seg $segs {
              [code]# assuming ‘mrn’ = patient id and ‘duid’ = document id

              set fn “/path/to/file/${mrn}_${duid}.txt”
              set fp [open $fn w]

              # assuming ‘segs’ is a list containing all segments from msg

              foreach _seg $segs {

            • #75551
              Gena Gill
              Participant

                The documents are plain text.

                Based on a couple of conversations with Jim, I’ve been using FRL and then the HRL to account for the repeating subfield, and then rounded it all out with a translation and have made some progress.  

                So far, I’ve been able to get the document into 1 of 2 states:

                1)  the entire report on one line — this happens when I don’t use a line feed in the FRL

                2)  one line per page, so a 50 line report is 50 pages long — this happens when I do use a line feed in the FRL

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