Getting file from share using filename in HL7 msg (OBX.5) ?

Clovertech Forums Read Only Archives Cloverleaf General Getting file from share using filename in HL7 msg (OBX.5) ?

  • Creator
    Topic
  • #52199
    Tom Patton
    Participant

      I need some help with some ideas on how to architect a thread that will get a filename and patient info from an HL7 ORU msg, then use the information in that msg to grab a PDF file from a share and create an ORU msg to forward to the EMR with the file and patient info found in the HL7 msg.

      I’ve created and sent PDF files in HL7 – so that isn’t a problem.

      But I’m banging my head trying to think of the best way to use the filename in the HL7 msg to filter a filename set (probably in an ftp protocol) to pickup the right file and send with the right patient info.

      I’m thinking of populating a file with the HL7 info to use as input in another thread, but it seems I could simply pass the info in memory instead.  

      How have you solved this one efficiently – any ideas??

      thanks,

    Viewing 3 reply threads
    • Author
      Replies
      • #73385
        Jim Kosloskey
        Participant

          Tom,

          Well, I see a  couple of options.

          Both will  require Tcl.

          The Tcl will have to do the actual open/read/close of the file (hopefully the PDF files will be ‘local’ to Cloverleaf).

          You can then deploy the Tcl either at one of the UPoCs prior to Xlate or within the Xlate itself.

          The essence of the Tcl will be the same in either case but it will either be a TPS or xltp type proc depending on where you want to deploy.

          I am not sure it is worthwhile to try and cause a Fileset/xxx protocol to get the PDF as a result of an HL/7 message that names the file and retain the other HL/7 segments/fields. Especially if trying to maintain a real time exchange.

          You do need to be careful to consider all of the ramifications of file access in flight. Not the least of which is what do you do when you cannot get to the file?

          If this does not need to be real time then there may be some other options.

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

        • #73386
          Tom Patton
          Participant

            Jim,

            You are right – the potential timing issues almost force this process into a more “batch-like” or decoupled process.

            So I’m thinking  one process might be to receive the HL7 RP msg via TCP/IP and store that patient info and filename in a file.

            The next process might pickup the patient-filename row from the file, match it to the PDF file and rename the PDF file (so it has the patient information from the HL7 msg in the filename e.g. MR, Last Name, DOB, DOS).

            Then the third process could pickup the filename and build an hl7 msg and send that msg.

            The 1st and 3rd processes would be Clover site threads.

            The 2nd would be a cron script and would also email “file not found” msgs to the user if the file is not there after 48 hours.

            As you can see by the timing of these post I’ve been walking around this for a couple weeks.

            This seems like the most rational approach, but I can’t help but think I’m missing something.

            This is for a CareFusion PDF where they refuse to place the pt last name in the filename – if they did, this would be done in 5 minutes…

          • #73387
            David Barr
            Participant

              Why don’t you use pdftotext ( http://www.foolabs.com/xpdf/ ) to get the patient name out of the PDF?

            • #73388
              David Barr
              Participant

                Another option is you have an inbound thread that receives the HL7 and sends it to an outbound thread that writes the message to a file.  Another inbound thread reads the message in from the file.  You can use a custom dir parse proc to make sure that the file modification time is a few minutes old if you want to give some extra time for the file to be written by your sending system.  In the inbound TPS proc of this thread, you can read the file path from the message, copy the patient identifiers into the message metadata, retrieve the PDF file (probably using TclCurl), and using msgset to replace the current message contents with the PDF file contents. Then you can route that message to an outbound FTP thread to deliver the PDF. You haven’t said how the patient identifiers get to the EMR. If it should be part of the filename, you can set the protocol metadata to have the correct filename.  If you need to send another HL7 message, you can construct that message in the SEND OK proc of your outbound FTP interface using the patient identifiers in the metadata.

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