Friday, February 22, 2008

Fax Router


OK, so here was the problem...SWI Diagnostics is a mobile company, a small and limited staff mobile company at that. As a result, we rely heavily on technology to help us keep our heads above water. Our work flow for final reports simply wasn't working. The studies themselves were transmited securely enough through a VPN tunnel using a DICOM compliant PACS system, but the technologist's worksheet had to be faxed to the reading physician separately. The radiologist would dictate the study and send the dictation file to the transcriptionist, who would then send the final back to the radiologist for his digital signature. Only then would the final report be sent back to us, at which time we would route it via fax back to the originating physician. It was a nightmare, especially when you're on the road doing studies, as far away from the fax machine as you can get. I needed to be able to route incoming faxes to an email account as a PDF attachment, and there are plenty of Internet fax services out there that will do that for you for a price. eFax is around sixteen bucks a month plus something like seventy cents a sheet. With any volume that solution would quickly add up to more than we were willing to spend. The Fax Services Manager available in Microsoft Server 2003 and SBS will also route faxes via SMTP gateways, but that also seemed like a bit of an extreme since I was running XP pro on every machine in my network. Mixed clients don't work well for Microsoft. So, whats the answer here? Write our own fax router of course. Which is exactly what I set out to do over the weekend. The windows fax console embedded in XP SP2 seemed to send and receive faxes just fine, and it placed the converted tiff file in a directory of my choosing with just a few out of the box configurations. My solution was to develop a windows service using visual studio that would essentially invoke a filesystemwatcher component on the incoming fax directory that I set up during the fax console initial configuration. Whenever a new file arrived in the folder, I would capture the file name and pass it as a parameter to a simple smtp function I wrote to route the file as an email attachment to any address I specified. I used the System.Net.Mail namespace to accomplish this. Also, I used the GMail smtp server since I don't run the mail protocol on my machines. It works great. Our techs are now able to receive faxed orders on their mobile devices, regardless of where they are. I am working on a module to evaluate the fax header information in order to develop routing rules so that I can use the application to automatically send a carbon copy fax to the referring physician as soon as we receive the incoming fax of the final report. This is a huge step forward for our operation, and I'd be happy to post the source code for anyone who might be interested in the router. It is fully configurable and uses a modest xml file to store its connection parameters.

No comments: