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…