Xmlformgen printing

biller2 wrote on Wednesday, May 14, 2014:

I am currently using openemr v1.2(5) Ubuntu 14.04 php 5.5.9 mysql 5.5.37 apache 2.4.7
The question I have is auto saving a form generated using xmlformgen. Its a long form and can take up to an hour for a clinician to fill out. I am trying to find a way to keep them from loosing their data if something goes wrong while they are filling out the form on-line.
Whoops I just realized I titled this incorrectly it should be xmlformgen auto-saving. I guess I was thinking of the other problem I have which is printing so I will include that here so the title will be somewhat correct =) The issue I am having with printing is when I pull up a form created by xmlformgengen from the “Encounter Summary” page and then choose “Edit” and then “Print”, at the bottom of the page. It prints but only two pages. The first page is pretty much blank except for the title at the top, the second page prints but cuts off the right side of the page and stops at the bottom of the second page. I have included an attachment as a picture is worth a thousand words =) Any help/guidance would be greatly appreciated, thanks in advance for your help John

fsgl wrote on Thursday, May 15, 2014:

Is there a Save button at the bottom of the form?

Are you able to print in HTML instead of PDF?

Printing Reports in PDF is a new feature in 4.1.2, but it has never worked properly.

biller2 wrote on Thursday, May 15, 2014:

fsgl, thanks for your assistance no there is not a “Save” button but there is a “Save Changes” button along with a “Don’t Save Changes” and the “Print” button. It appears that when I click “Save Changes” button it save the changes I make in the form to the database. When I click print it calls the print.php file and renders the form that will print, The print.php file is what xmlformgen creates along with all the other files. I don’t understand what you mean by printing in HTML. However the “Print” button works is how I am trying to print. It looks like it is HTML but not sure. It appears that when I click the print button it brings up a new page rendering the form and then prints only what is showing up on the screen not the whole frame. Attached is the bottom of the page so you can see the buttons I am talking about. Thanks again for your assistance. John

yehster wrote on Thursday, May 15, 2014:

I suspect what you are asking for is something akin to how gmail periodically “autosaves” drafts.

One implementation would be to add a timer event on the form in javascript which essentially processes a “save request” every 5 minutes or so, but doesn’t leave the screen like hitting the save button does.

fsgl wrote on Thursday, May 15, 2014:

Good that there is a Save button on the bottom and it’s working. The users can click “Save Changes” if the entry is not yet complete or you can customize as suggested by Kevin.

It sounds as if the form is being printed from the webpage (HTML) and not as a .pdf file. What happens when the form is selected from Reports, Encounters & Forms and the Generate Report button is clicked?

I don’t recognise the CDA form as one of the 89 Contributed Forms. Perhaps there has been a renaming. Is it a newly created form?

biller2 wrote on Friday, May 16, 2014:

Kevin, yes that is what I am looking for I found a script that is acts like its doing everything I want. The one caveat is it isn’t saving it to the data base. It appears to be using Ajax to perform the function. If you have some suggestion how to push those changes to the mysql database without a page refresh it would be greatly appreciated. Thanks for your help John

yehster wrote on Friday, May 16, 2014:

You can make an ajax call that does a POST of your current form that doesn’t refresh the page, and effectively does the same thing as the Save Changes button but without updating the form.

biller2 wrote on Friday, May 16, 2014:

fsgl thanks for your help with the printing issue, When I print from Reports, Encounters & Foms it prints all the data, however the data is just strung together and not formatted in a nice layout like the form. It is an intake form I created for a clinician using xmlformgen. My understanding is that xmlformgen creates all the files needed. One thing I did find out, I have a friend who has a Mac and he printed it using Safari and it worked fine, all five pages printed. When he tried it from Chrome or Firefox it printed goofy just like on my Ubuntu box. Any guidance foreword would be greatly appreciated Thanks JOhn

fsgl wrote on Friday, May 16, 2014:

O.K., we’re getting warmer.

Kevin or one of the developers will have to tell you where to look in and how to change the codes to modify the printing of the webpage from Reports and from the specific encounter as well.

In the interim, compare the printing part of the scripts of your form to a Contributed Form for any discrepancies. Provide screenshots of any suspicious script to aid the hunt.

I’m not much help when it comes to code modification.

You’re right; what you see is what you should get (print).

bradymiller wrote on Saturday, May 17, 2014:

Hi,

Some thoughts on notes.

I think what we need for forms is the following buttons:
Save
Save and close
Sign
Cancel

Save will save data and not leave form.
Save and close will save data and leave form.
Sign will save date, esign the note and leave form.
Cancel will leave form without saving.

For the Save and Save and close function, each save should create a separate entry in the database (ie. each revision is saved). This can be a real lifesaver (I remember clearly when my heart sank late at night in residency after my long consult note was completely deleted mistakenly by an attending; luckily that EMR saved each revision so the IT folks were able to resurrect it).

Note there is already a eSign feature in development version of OpenEMR which can be used for the Sign button. After a note is signed, then only able to add an addendum.

-brady
OpenEMR

blankev wrote on Saturday, May 17, 2014:

An automatic save every minute is even better. It is not unusual if the doctor has to rush and forget to hit the Save button. Save automatic (Y/N optional), than for a more definite concept, make the save definite after hitting the Save button. Save and Close could do all others not mentioned before? Like how to delete the finished concept or not.

bradymiller wrote on Tuesday, May 20, 2014:

Hi,

If revisions are being saved though, I would not want auto-save. For example, what if it auto-saves something I copy/pasted from somewhere that I do not want to be saved as a revision until I do some modifications; an example would be something that may be considered “poor form” by theoretical non-practitioners (for example, copy/pasting from another note with another patient name/data in it; then you’ve now potentially brought in patient records from another patient in a note revision). Most of us have learned the hard way to hit save frequently to avoid losing data. That being said, could always make auto-save an option.

At this point, for myself, an ideal note entry may be having:

  1. A form with just one large textbox
  2. The above buttons with a separate revision saved each time Save is hit.
  3. Leverages Rod’s template code to begin building templates to auto-populate the note in addition having clickable templates while working on the note

If others agreed, this is a potential project that a volunteer could work on(ie. I’d place it in the Active Projects page).

-brady
OpenEMR

biller2 wrote on Tuesday, May 20, 2014:

Thanks all for your help I was able to get the autosave working. Here is a link to the code that I found. I just inserted it into the forms that I wanted to have autosave. http://jsfiddle.net/MadLittleMods/NxQ4A/
I really like the idea of having multiple versions and can see where that would come in handy. I think at this point with my coding experience its over my head. John