merging a PDF file into an HL7 messages generated from a VRL file

Clovertech Forums Cloverleaf merging a PDF file into an HL7 messages generated from a VRL file

Tagged: 

  • Creator
    Topic
  • #122527
    Ron Swain
    Participant

      I am wanting to embed a PDF file into the OBX segment of a message generated from a VRL file. The PDF filename will correspond to a field from the line in the flat file being converted to an HL7 message. We have done this via external shell scripts; but was hoping to move the functionality within the Cloverleaf engine.

    Viewing 4 reply threads
    • Author
      Replies
      • #122529
        Peter Heggie
        Participant

          Is the file on the Cloverleaf server? Then you can use TCL to open the file, read it into a variable (in binary) and then COPY the variable into the OBX.

          If you have to use FTP, then technically you could add the TCL FTP package into your environment but I’m not sure about the impact. especially if it encounters errors.

          Peter Heggie
          PeterHeggie@crouse.org

        • #122530
          Jim Kosloskey
          Participant

            Ron,

            I have a Tcl script that does what you want I think but at least a starting point. This proc though requires the file be accessible vioa the file system not FTP.

            If you would like that proc and its User Doc, email me.

            email: jim.kosloskey@jim-kosloskey.com 30+ years Cloverleaf, 61 years IT – old fart.

          • #122531
            Ron Swain
            Participant

              Thanks Jim.  I will let you know.. I appreciate it.

            • #122532
              David Barr
              Participant

                We do a lot of interfaces like this, but we use Windows file shares instead of FTP to access the PDFs, and we use TCL TPS procs to read the files into the message. We mount the Windows file shares to our Linux Cloverleaf server using CIFS mounts in fstab. Also, I’ve run into so many problems dealing with binary files in Cloverleaf, that I prefer to use a command like this to read in the pdf:

                set pdfData [exec base64 -w 0 < $filename]

                This puts the data in a variable in an Base64 ASCII encoded format that you can copy directly into a field in the message.

                You could probably do the same thing if you mounted the FTP server the files are on to your Linux Cloverleaf server using the FUSE filesystem type.

                 

              • #122533
                Jason Russell
                Participant

                  I agree that you should avoid dealing with binary PDFs. TCL does have a builtin protocol to do that vs running it via exec:

                  set pdf [<get PDF however>]

                  set b64 [binary encode base64 $pdf]

                  This is also a bit more portable between environments.

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