Hylafax

sunsetsystems wrote on Wednesday, September 13, 2006:

Is anyone doing anything interesting with Hylafax?  I’m planning to build a basic fax client into OpenEMR, including support for moving faxes into patient documents.  If I’m about to re-invent any wheels, please let me know!

Rod
www.sunsetsystems.com

andres_paglayan wrote on Wednesday, September 13, 2006:

nothing at all,

drbowen wrote on Wednesday, September 13, 2006:

Sounds cool, Rod.

I have a question.  Is it necessary for the Hylafax server process to run on the OpenEMR primary server or can this function be separated out onto a dedicated Hylafax server?

Sam Bowen, MD

sunsetsystems wrote on Wednesday, September 13, 2006:

I expect it can be a separate server.  However the queued fax image files (e.g. in /var/spool/hylafax/recvq/) will need to be available to the OpenEMR server, so something like an NFS mount will be required.

Rod
www.sunsetsystems.com

blurngr wrote on Sunday, September 17, 2006:

Sam - It can be a different server.  Hylafax has a lot of different clients (Windows / Linux / Mac / etc…) that can connect to a server process, wherever the server process is.

Rod - What are you doing (or planning on doing) with Hylafax?  I don’t have any requirements yet for fax integration, but have done it quite a bit with other projects – including routing of faxes, both incoming and outgoing.  Curious what / how you are looking to do it.

drbowen wrote on Sunday, September 17, 2006:

I haven’t been able to work out the command line string necessary to communicate with a separate server.  There doesn’t appear to be any documentation on the Hylafax site.

To me, for security purposes, I like the idea of operating a separate fax server.  This way I do not have to expose the main OpenEMR server to any outside connection.

To do so the OpenEMR server will need to send faxes to the remote server.  Currently, the OpenEMR server assumes that the Hylafax server will be on localhost.

I am trying to figure how to modify the config.php to include the command necessary to communicate (ie connect and send an outgoing fax) with a Hylafax server on a separte host machine.

In fact this should be part of the setup.php script to allow IT admins to specify the Hylafax server for both incoming and outgoing faxes.

Sam Bowen, MD

blurngr wrote on Sunday, September 17, 2006:

Sam –

Try here:
http://www.hylafax.org/content/Handbook:Server_Operation:Sending_Faxes

You actually have about five-hundred configuration possibilities.  If you want to send faxes from one linux box (say, your OpenEMR server) to another (say, your HylaFax server), you can [most easily] install hylafax on both.  The hylafax server would actually be responsible for monitoring / sending on modems.  The hylafax on your OpenEMR server would just be used as a client to send from.

Specifically, the command would be something like:

sendfax -f "myname@mydomain.com" -R -r “faxsubject” -c “coverpage comments” -x “Recipient’s company” -d “Recipient@1234567” tofax.ps -h HYLAFAXHOST

Would send a fax the document tofax.ps from myname@mydomain.com with a subject of "faxsubject", including the "coverpage comments" on your coverpage, to the "recipients company", to the "recipient" at fax number "1234567" … and it would be sent to the server HYLAFAXHOST to be faxed.

Of course, there are some access-control settings you’ll want to configure inside of Hylafax itself to ensure that your OpenEMR server has the right permissions.


Anthony
Resolution Software / Resolution Systems

sunsetsystems wrote on Sunday, September 17, 2006:

Anthony, my plan is to:

(1) Provide an OpenEMR-specific web interface for incoming faxes: listing, viewing, looking up a patient and inserting it into their document tree, creating related patient notes, forwarding and deleting.

(2) Create a simple web interface for sending faxes, including the ability to upload multiple files to be sent.  I’m not really happy about having to do this part, but existing solutions do not seem to be acceptable.  It would basically just be a front-end to sendfax.

Any comments appreciated.

Rod
www.sunsetsystems.com

blurngr wrote on Monday, September 18, 2006:

Rod – Your plan is understandable.  I assume then, that there would be some sort of incoming "queue" / folder view that a user of OpenEMR should be able to select the fax, and then a patient, and link the two, along with some notes.

My guestimate would be that this would be best accomplished using a fax2email gateway, rather than worrying about NFS file mounts.  Either approach would work … I suppose.  But I think the email interface would be a bit cleaner.

Basically, outgoing faxes could be done either as a front-end to sendmail, or it could use the native PHP mail (err, PHP had a native mail sending capability), and documents to be faxed would simply be attached as attachments.  Hylafax will then convert them to faxes, and fax them.  The Hylafax server could exist on any server … that the user has access to (the same box, or any box).

Coming back in, the faxrcvd script would need to modified (slightly) to convert the incoming fax to PDF [trivial] from TIFF, and then attach it.  Where-ever the mail goes to, it would then sit there.

All of that is Hylafax native capabilities.  I’d think that you would need to write an interface that can read the mail queue – the actual messages would be of little consequence.  You just need the attachments.

Seems simpler from a user POV to setup (they’d need to know the email address to send email to fax, and the mail server / username / password to retrieve faxes).

However, I’ve done the NFS route once or twice myself … you’ll have to write an interface to sendmail, and an interface to the filesystem [2 interfaces] – rather than a mail interface [1 interface].


Anthony

drbowen wrote on Monday, September 18, 2006:

Dear Anthony,

Don’t assume that NFS is available.  There are a lot of OpenEMR users who are running MS Windows.

Plus I don’t use the file system to store documents.  I upload my documents to the database as BLOBs.

My desire to use Hylafax also revolves around the fact that I have a number of Windows clients that I need outgoing faxing to Hylafax.

Our incoming recvq is on a samba share so that the queue is visible from both linux and Windows.

Sam Bowen

sunsetsystems wrote on Monday, September 18, 2006:

Anthony: Email-to-fax is a good idea.  You can tell I’m a newcomer to Hylafax.  :-)  Fax-to-email would be more work in this case, as I’d have to create, maintain and parse an intermediate fax repository on the OpenEMR server.  Easier to just use the one already on the Hylafax server.

Sam: I was referring to an NFS mount only at the OpenEMR server, not on the user PCs.  In any case if you already have the recvq shared out on Samba then the problem is solved.

Rod
www.sunsetsystems.com

andres_paglayan wrote on Monday, September 18, 2006:

for the windows clients, there’s a driver
it installls and works as printer,
you send to print
and it realy goes to the hylafax server,


you can use it against the same fax you are using for OpenEMR

blurngr wrote on Monday, September 18, 2006:

Sam – I wasn’t assuming NFS was available.  That entire post was for Rod :slight_smile: Sorry for the confusion.  However, the email may be a good idea for your situation as well.  It doesn’t require that anything except the Hylafax server be running on linux.  Everything else can be on Windows.

Sam – Um … BLOB’s, eh?  Do you mind if I ask what the rationale for BLOB’s is?  I ask – because the only reason I can think of to store your files inside of a db, ontop of a file system, rather than on the file system, is to make it easier to backup your data.  Just one backup command.  And, possibly, it’s slightly more secure (though, an encrypted filesystem would take care of that as well – and someone could just as easily walk off with your MySQL data files as they could with your fax PDF’s).

Sam – I’m very curious why (do any of the features of OpenEMR rely on it?) … because, with your files being stored as BLOB’s, I’d think you’d want to worry about two or three different types of corruption.  On the filesystem, you just need to worry about one (the filesystem getting corrupt).  On the BLOB’s, you add in the fact that your indexes could become corrupt (depending on MySQL’s architecture, that could destroy your data as well), as well as your table data becoming corrupt (rare, but it happens).  Just curious.

Sam – For outgoing faxing from Windows, I’d recommend using one of the Hylafax Windows clients (there’s about 4), or the email-to-fax gateway, or even, possibly, using a samba printer.  You can setup samba to dump to sendfax (locally on the samba server), and then sendfax can connect to any hylafax server it so cares to (locally, or anywhere else).

Rod – I’m not familiar enough w/ your architecture, so if what you’re saying is true … have fun!

Just my $0.02


Anthony

drbowen wrote on Tuesday, September 19, 2006:

“”“Sam – I’m very curious why”""

I know there is ongoing debate whether it is better to keep the images on the local file with just a pointer to the location versus keeping all the data in the database as BLOBs.

I have a setup of master - slave MySQL servers so that I get real time back using the built in MySQL replication.  I use this to backup data both in the office and offsite.

Hard backups are done less frequently, every 24 hours.

The local unix guys that are responsible for the local hospitals that handle much larger databases voted strongly in favor of keeing every thing in the database.  They have the same problem of real time data backup and remote backups are required.

As the data size gets larger and larger.  It gets to the point that the hard drives (and back up drives) just aren’t big enough anymore.

InnoDB has a nifty feature that allows the tables to span multiple drives.

Run out of space? just add another table space and or disk.

Andres and Rod beleive in storing the documents on the local hard drive.

Tekkno Genius and believe in keeping everything in the database.  I eat my own dog food as the saying goes.

Sam Bowen, MD

andres_paglayan wrote on Tuesday, September 19, 2006:

I’ll say,
for savy users and/or a place with enough tech support: use the database,
for simple setup and maintenance: use the file system

since most people will be in the second box, is still my preference,
but again, is opinionable,

sunsetsystems wrote on Saturday, September 23, 2006:

Just want to mention I’ve checked in my initial code for this.  You’ll want to see the new comments in interface/globals.php and INSTALL.

Rod
www.sunsetsystems.com

voipbound wrote on Friday, October 24, 2008:

Dr Bowen

Have you figure out how to connect the 2 servers, openemr and hylafax?