We’re facing an unprecedented (at least for us) requirement w.r.t. the way prescriptions are printed. As far as we’ve seen until now, OpenEMR allows for up to three or four medications (depending on the size of the provider’s logo) to be put on the same page of a prescription’s printout. If more medications are prescribed, then the remaining medications are placed on a new page, which includes (of course) the provider’s logo and data. That way, it looks as if it’s two separate prescriptions.
Now, as the entire project is coming to an end, our client has turned and said that this is undesirable. They want the prescription’s printout to include more medications (five, six, maybe more), because they view this as wasteful (in paper) and confusing (as it makes the patient think they were given two separate prescriptions). These are exactly the words of our client’s representative. I have to point out that the paper size used is A4.
Has anyone else faced such an issue? If yes, what changes did you make to the controllers/C_Prescription.class.php file in order to fit more medications on the same prescription page?
For more information, here’s what we’ve encountered.
In line 451 of the controllers/C_Prescription.class.php file, there’s a function named get_prescription_body_text.
Now, although we’ve experimented with deleting a number of line breaks, this didn’t allow us to fit more than three medications on one prescription page (even after replacing the provider’s logo with an extremely small - 32 pixels high - version of it, or even omitting it entirely); the fourth, fifth and sixth medications were still put on a second page. The seventh, eighth, and ninth medications were put on the third page. And so on. Also, these experimentations simply led us to get more blank space on the bottom of the page.
So, this is what we’ve seen with the way prescriptions are printed. Any ideas on how to fit more (let’s say up to 10) medications on one prescription page and make better use of the available space on an A4 sheet (and satisfy the client’s new demand)?
If this explanation will do the job, you are ok. If not, you might ask Epdsky for help.
A great job done helping me out for small A6 prescriptions for the same provider name with clients getting prescriptions from different providers and printjob on pdf output.
Thank you. We’ll try it out first thing in the morning. Right now we’re already way past our working hours. If we run into problems, I’ll let you know, but I hope everything will work out well. Thanks again.
While experimenting with the solution proposed, we also found the following solution, which is the one we adopted in the end. I’m posting it here, in case anyone finds it useful. First of all, the part of the file that needed tweaking was the HTML. We adjusted all the margines, paddings and sizes accordingly. The “\n” bits suggested by Pieter were, of course, replaced.
Then, we went to line 581, where one can find the pagination functions. It was:
if (++$on_this_page > 3 || $p->provider->id != $this->providerid) {
This basically tells OpenEMR to allow up to 3 medications to be listed in one prescription page.
We changed it to
if (++$on_this_page > 7 || $p->provider->id != $this->providerid) {
That way, it now fits 7 medications on one printed page. To be honest, I think it’d be highly unlikely for anyone to prescribe more than 7 medications in one go. We also tried with higher values (8 and up), but the end results didn’t look good.
So, thanks again for the help, and here are our own findings and solutions as well.
I have one computer and two different printers. One printer for A4 paper and another printer with A6 paper.
Anybody with an idea to make software-matic a choice between printers for the A4 or A6 paper size printer. Just not to make the choice during printer after the PDF screen is shown, but automatic sofware-wise.