Uploading files

markleeds wrote on Sunday, April 10, 2005:

I looked at the form that allows uploading of images.  I tried to upload a document and was told that it must be a .jpg etc…

I was thinking that uploading of .pdf files would allow for the scanning of multipage documents with uploading of a single file.  I was told that there are high speed scanners that come with the software to automatically scan to pdf.  This may be a good way for an office to quickly go completely paperless.

Also, what about uploading audio files to a patient’s encounter?  Like .wav and .mp3.  Now you can integrate dictations into an encounter.

Maybe people are already doing this or maybe not, but if not, it seems it would be just a matter of a new upload form.

Mark

andres_paglayan wrote on Sunday, April 10, 2005:

there is a little check within the file that handles the upload,
if you email me a zip of the form folder I’ll bee happy to fix it for you,

drbowen wrote on Sunday, April 10, 2005:

I have been working on some code that will allow any datatype to be uploaded into the database.

Metsdata and binary information are stored separately.  The metadata table stores the data type jpeg, png, tiff, mp3, pdf etc.

We have it working but are still refining the download function so that it can handle larger files such high resolution x-rays stored usually as jpegs.  The download function notifies the browser which data type is coming.

Images are stored as BLOBs in the MySQL database in 100Kbyte stripes and the download function streams them back to the requesting browser in 100 Kbyte chunks.

This eases the demand on the server and is more extensible.  We haven’t tried it with pdf but theorectically this shouldn’t be a problem.

We will likely need to add some desicional code to bring up different types of viewers for such thinhs as mpeg and pdf.

tekknogenius wrote on Monday, April 11, 2005:

The browser should be able to handle the different types of files (mime types) with plugins, shouldn’t it?

markleeds wrote on Monday, April 11, 2005:

I did it.  I just made a few minor changes to ‘save.php’ in interface/forms/documents.  Here’s a diff:

30,35c30
< // we check for a valid type of file.
< if (($HTTP_POST_FILES[‘document_image’][‘type’] == ‘image/gif’) ||
<       ($HTTP_POST_FILES[‘document_image’][‘type’] == ‘image/jpg’) ||
<       ($HTTP_POST_FILES[‘document_image’][‘type’] == ‘image/pjpeg’) ||
<       ($HTTP_POST_FILES[‘document_image’][‘type’] == ‘image/jpeg’) ||
<       ($HTTP_POST_FILES[‘document_image’][‘type’] == ‘image/bmp’)){

> //removed check for type
37d31
< }
85c79
<       document_image=’$file_new_name’ ,

>       document_image=’<a href=file://$document_path/$file_new_name>$file_new_name</a>’ ,

(sorry if the above paste does not render properly)

I basically took out the checking for appropriate extensions and then made one of the database fields an HTML link to the file.  When you click on the link, your browser will handle the rest (as Tekkno Genius stated above).

This is just a quick and dirty way to show that it can be done easily.  It needs to be cleaned up.

Just think, 5-10 minutes more work on this one and you can have integrated dictations and scanned pdf documents and a true paperless office.

This is the big sticking point when trying to get doctors interested in EMR’s (now called EHR’s).

Mark

wpennington wrote on Monday, April 11, 2005:

We have been able to upload .tiff, .jpg, .png and .pdf files as an OpenEMR document and been able to view all of them.  You will need the appropriate extension handling in your browser, and fortunately most browsers automatically handle these extensions.  You should be able to view documents of any type (.doc, .sxw, etc.), as long as your browser has a plugin and document handling for that type of document. 

Our experience is that most documents attached to medical records are either scanned or received as a fax.  Those two types typically arrive as a .tiff or .jpeg.  I realize that some clinics may have different needs for handling a variety of documents, and OpenEMR should currently handle all of the document types. 

Some .tiff document readers will only display a single page.  These readers will only display one page, even if you have multiple pages in a single .tiff document.  There are several multipage .tiff applications.  The multipage .tiff viewer that I recommend is Alternatiff (http://www.alternatiff.com/), if you are using a Windows desktop. 

Uploading Dictation to a Patient Encounter - You can add a Quicktime player to a speech dictation file, and record dictation directly to a file.  This would allow a remote or local transcriptionist to transcribe the file directly to the patient record.  You will need a method to flag the patient so the transcriptionist will know which patients have pending dictation that has not been transcribed. 

The quicktime player has not been added and is not a current feature. 

sankar1234 wrote on Saturday, April 23, 2005:

I enterered a dummy patient data with encounter, SOAP and vitals.   I wanted to attach a document.  When I clicked the document tab,  the screen showed nothing other than the tabs on top with patient name and adminstrator. 

I am sure I am not following some order to upload documents.   I appreciate the steps to upload the images.

Is the code written to upload directly into Database or a file is created and link is stored in the database ?

What if I want to store 2-3 images? Thank You

markleeds wrote on Saturday, April 23, 2005:

The current form for uploading images saves them to the folder that the form is in and inserts the link in the database.

I believe that the developers plan that in the future, uploaded files will go to the database.  This makes access control easier.

Mark

drbowen wrote on Sunday, April 24, 2005:

I have working code that uploads files to the database directly. If you would like I can forward these to you with instructions on how to install. Its pretty simple.

I am refining the code now to be able to load multiple pages at once and be able to view larger files.

The code already handles multiple file types.

tekknogenius wrote on Sunday, April 24, 2005:

We need to get this functionality into OpenEMR.

sankar1234 wrote on Sunday, April 24, 2005:

I was with the impression that we have this feature. But I tried all the forms and could see something like “upload file or browse or attach document” user interface option anywhere.  But it looks we don’t have this feature in OpenEMR.  I have written this feature for another web server application.  If someone wants, I will do it but refrain from duplicating the work.   So, if you have the code and it working,  please send it with instructions.  I greatly appreciate. 

That besides the point.  Some discussions are mentioning that we have this feature. But it’s not in the application.  It’s very confusing to me.

Someone clarify me, thanks.

drbowen wrote on Sunday, April 24, 2005:

The link to upload documents was in the forms section.  This seems to have been inadvertently removed, presumably when the "broken forms" were removed from the cvs tree.

My personal opinion is that it will be better to upload the images into the database directly.

I will forward you a "tarball" with what we have been using on our private OpenEMR version. I will upload this to the test server at:

http://www.openmedsoftware.org/openemr/

If the group likes the functionality we can commit it to the cvs tree.

sankar1234 wrote on Sunday, April 24, 2005:

My suggestion would be to show the progress bar while uploading.

Could you please upload ? I will test it out tonight or tomorrow.

sunsetsystems wrote on Sunday, April 24, 2005:

Hi Doc, can you be more specific about what was removed that broke uploading of documents?  I have not been having a problem with it, but if it’s broken we should probably put back whatever was taken out before applying your improvements.

Remember, we’re trying to stabilize things and then put out a release.

– Rod <rod at sunsetsystems dot com>

drbowen wrote on Monday, April 25, 2005:

I haven’t updated from CVS but the version I downloaded to my demo has 4 forms:

    Review of Systems Checks
    SOAP
    Speech Dictation
    Vitals

The earlier versions prior to the transfer to SourceForge had a “form” named “documents” that provides the current functionality to load an image onto the directory structure.  I don’t use this method so I didn’t miss it until pointed out by Sankar.

The new uploadprocess does not interfere in any way with the old "documents" function.  They both coexist quite peacefully.

Sam Bowen

sankar1234 wrote on Monday, April 25, 2005:

Are there any functional tests (QA) being performed before we release?  If yes,  where can I find the test list?  If none, we need to determine that and div up the work to volunteers so we don’t miss the functionality atleast.  This would make openEMR on par with commercial vendors.

tekknogenius wrote on Monday, April 25, 2005:

Uploading works for me. From the patient screen use the Documents link at the top of the page. Only problem is with multi-page tiff files. So for now I’m converting those to pdf since that works fine. I’m using a CVS version.