Print prescriptions directly

gutiersa wrote on Monday, April 14, 2008:

I would like to send scripts (from the charges screen, after adding a prescription) directly to the printer without opening a pdf file. is this possible?? How??

cfapress wrote on Thursday, April 17, 2008:

Currently this is not possible with OpenEMR. The PDF file is generated and then you use the File->Print facility in your PDF viewer, such as Adobe Acrobat Reader.

Jason

markleeds wrote on Friday, April 18, 2008:

You can print from any screen using your browser (ctrl-p).  The results may not be what you are looking for. 

To print something that is not displayed on your screen and without your browser, it would have to be printed from your server, just like paper claims with freeb.  I am not saying that there is code that does this yet, but I don’t see any other way to do it with a web based program.

If you are trying to avoid PDFs because they take so long to load on slower machines, it would be possible to generate a prescription very quickly with html and css formatting.  I don’t believe that this exists in the main program, but the camos form does have this capability.  If you are interested in programming this capability elsewhere, you might look at the code for /openemr/interface/forms/CAMOS/rx_print.php, first uploaded 1/16/08 and last updated 2/22/08.  Also look at rx.css.  I have been using this since January with great results.

It should be possible to alter this code to query data from the prescription table that you use and place a link wherever it is convenient.

markleeds wrote on Tuesday, April 22, 2008:

Dr. G:

I made the changes described in my post above to make my prescription generator available to users of the built in prescription feature included with OpenEMR.  I posted a message about it on the Developers Forum, but I will paste the instructions here for you:

I updated my prescription generator in CAMOS to also work with the Prescriptions table. To make it accessible, I added a link which can be found by clicking ‘list prescriptions’. The link is just below the ‘Print Multiple’ link and is called ‘Print Four Panel’. To try it out, you have to update the following files:

/openemr/templates/prescription/general_list.html
/openemr/library/classes/Controller.class.php
/openemr/interface/forms/CAMOS/report.php
/openemr/interface/forms/CAMOS/rx_print.php

Also, to print properly, go into your Firefox page setup and set all margins to zero and change to landscape.

gutiersa wrote on Wednesday, April 23, 2008:

thanks so much for your reply.

> "If you are trying to avoid PDFs because they take so long to load…"

I am not exactly trying to avoid PDFs, the problem is that NJ has standard prescriptions that we must use, they are 4x5.5 inches, and our printer loses its configuration after closing the printer driver in some of the computer terminals. It is time consuming to have to change settings every time. It is specially difficult for the other doctor in my practice who is very fast. He just goes back to hand writing his scripts. This means they must be scanned, because they will not be entered into openemr.
I think pdfs print very nicely, I just don’t know how to keep the printer driver from losing its configuration. Furthermore, if we want to print something else, such as patient instructions, we have to keep changing printers, since our script printer is dedicated and only has the little prescription blanks (that is since the default printer from the exam rooms is the dedicated prescription printer).

I will definitely try your recommendations. Thanks

markleeds wrote on Wednesday, April 23, 2008:

Are you actually printing to a 4x5.5 sheet of paper?

I print to an 8.5x11 sheet which is divided into up to four prescriptions.  That would make each one 4.25x5.5 inches.  I use special paper with a blue background which is “copy proof”.  I also use a dedicated printer and computer so I don’t have to change the paper or page setup.

It is probably a good idea to have a dedicated computer/printer or computer/scanner setup for different tasks.

If I was using the built in prescription module in OpenEMR, I would go back to hand written prescriptions also.  It seems too clumsy to me.  It requires entering the same information over and over if you prescribe the same drug to different patients.

I use CAMOS for all prescriptions which allows me to enter info for a particular drug only once.  It also has other features to make prescribing very fast and easy once you get used to it.

Part of the advantage of using a computer is that the machine should do the repetitive work for you, freeing up your time for more useful activities, like spending more time with patients and less time with paper and pen.

gutiersa wrote on Wednesday, April 23, 2008:

Yes actually I am printing to a 4x5.5 piece of paper. Our scripts must be preprinted with our practice info and each doctor’s numbers, they are also in a blue background. I was hoping to just continue to use our supplier.

How do you handle your scripts, if you only print one, do you tear it out and throw out the rest of the page?? Do you feed it back to your printer?? We do have a dedicated script printer, but not computer. We send the scripts from the laptop/computer in the exam rooms. The printer is in the front office, where patients do not have access to the blank scripts. If I put a dedicated prescription printer in each exam room I would have to lock up the paper tray.

thanks

markleeds wrote on Thursday, April 24, 2008:

I give the whole 8.5x11 page to the patient.  Each page can have from one to four prescriptions on it.  if there are quadrants of the page that are unused, the program prints a large ‘X’ through them.  It also prints a dotted line vertically and horizontally to divide the four sections.  You can try it out for yourself if you like.  It seems like most patients leave with 2-3 prescriptions and less often either 1 or 4.  I rarely waste the whole page or have to go to a second page.

I can see how frustrating your problem is with the printers.  I was having problems with my network printer/scanner being unpredictably blocked by my laptop’s firewall.  I finally solved it by giving that scanner a dedicated computer.  Now I can use the scanner’s button to start scans and it is much simpler.

I don’t have computers in the exam rooms anymore.  I feel like it is a distraction.  I review the computer chart before I walk in the room and go back to it if I need to.  I do sometimes carry in a dummy paper chart to take notes.  We give the illusion of being low-tech until the patient gets their fancy prescription.

gutiersa wrote on Saturday, April 26, 2008:

Mark:
I followed your instructions above, but now when I try to view the prescriptions list, I get the following message:

Fatal error: Call to undefined function html_header_show() in /usr/local/www/data/openemr/interface/main/calendar/modules/PostCalendar/pntemplates/compiled/%%-10^%%-1066570898^general_list.html.php on line 7

How can I fix this? I would like to use CAMOS to print scripts

thanks, Sandra

gutiersa wrote on Sunday, April 27, 2008:

Mike:

I’m also getting this message when I click on Print four panel in the prescription list

gutiersa wrote on Sunday, April 27, 2008:

Sorry, here is the message:

Not Found

The requested URL /interface/forms/CAMOS/rx_print.php was not found on this server.

I have tried several things without success, including putting in the full path to the file, but no luck!

markleeds wrote on Monday, April 28, 2008:

Regarding the html_header_show() function call, this was added by someone else.  It appears that if you update the file:

/openemr/library/translation.inc.php

you will get this new function, which has nothing to do with the functioning of the CAMOS form.  It just prints an html header.  Whoever added it to the code of plugin forms should have made it optional for backwards compatibility.

Regarding the missing rx_print.php file:

If you do not have this in your CAMOS directory, the form is out of date on your system by at least about 4-5 months.  You should download all of the files under the CAMOS directory in the cvs repository and put them into your existing directory, overwriting existing files and adding the new ones.  One way you could also do this, is if you download the whole openemr module from cvs as directed on this site, you can delete your existing CAMOS directory and copy over the one from your new openemr download.  This way, you will have all of the newest openemr files in case you need others.

gutiersa wrote on Monday, April 28, 2008:

I did download the rx_print.php file. It is in the CAMOS directory. I even tried to change paths in all the places that call it (absolute path).

I will try replace the whole directory though. thanks

another thing. I don’t think I have the drug table.

thanks

markleeds wrote on Monday, April 28, 2008:

Did you update this?

/openemr/library/classes/Controller.class.php

Regarding CAMOS, it is probably good just to replace the whole directory.

gutiersa wrote on Monday, April 28, 2008:

Yes I had already updated /openemr/library/classes/Controller.class.php

I updated translation.inc.php and now I can’t get into openemr. I get this error message:

Warning: Unexpected character in input: ‘’ (ASCII=92) state=1 in /usr/local/www/data/openemr/library/translation.inc.php on line 2

Parse error: syntax error, unexpected T_STRING in /usr/local/www/data/openemr/library/translation.inc.php on line 2

I do not know how to download from cvs. I can only do one file at a time.

gutiersa wrote on Monday, April 28, 2008:

OK, I downloaded from cvs (my connection kept getting refused before)

I replaced the whole CAMOS directory, and using the old translations.inc.php, I am still getting the message:

Not Found

The requested URL /interface/forms/CAMOS/rx_print.php was not found on this server.

this are also from cvs:

/openemr/templates/prescription/general_list.html 
/openemr/library/classes/Controller.class.php 

gutiersa wrote on Monday, April 28, 2008:

OK, I got it to work by making the following changes to:
/usr/local/www/data/openemr/interface/main/calendar/modules/PostCalendar/pntemplates/compiled/%%-10^%%-1066570898^general_list.html.php

commented out the following line:
/* echo $GLOBALS[‘webroot’]; <?php echo ‘?>’; ?>*/

changed this line:
        <a id="four_panel_rx" target="_new" href="/interface/forms/CAMOS/rx_print.php?sigline=plain" onclick="top.restoreSession()">Print Four Panel</a>

to look like this: (inserted /openemr before /interface…)
        <a id="four_panel_rx" target="_new" href="/openemr/interface/forms/CAMOS/rx_print.php?sigline=plain" onclick="top.restoreSession()">Print Four Panel</a>

the mysql error message above was because I had not chosen an active encounter.

My CAMOS form seems to be working but for the html_header_show() problem above (I had to remove it from where ever it was found). Any ideas on how I can fix the translation.inc.php file?

gutiersa wrote on Monday, April 28, 2008:

Actually never mind, the initial translation.inc.php file from cvs was corrupted for some reason. I downloaded the whole openemr from cvs and replaced the CAMOS directory and the translation.inc.php file and now it works.

markleeds wrote on Tuesday, April 29, 2008:

Let me know what you think.