Modification of prescription

banaitv wrote on Friday, March 13, 2015:

I have modified get prescription body text to remove and get results as below

  1. Tab xyz sign 30 tablet once a day remark

  2. Tab abc …
    It works well except the first line get blotched up. Kindly help. Here is the modified code

    function get_prescription_body_text($p) {
    $body = ‘’ . xl(‘Rx’) . ‘: ’ . $p->get_drug() . ’ ’ . $p->get_size() . ’ ’ . $p->get_unit_display();
    if ($p->get_form()) $body .= ’ [’ . $p->form_array[$p->get_form()] . “]”;
    $body .= "
    " . ‘’ . xl(‘Disp #’) . ': ’ . $p->get_quantity() . “” .
    ’ . xl(‘Sig’) . ': ’ . $p->get_dosage() . ’ ’ . $p->form_array[$p->get_form()] . ’ ’ .
    $p->route_array[$p->get_route()] . ’ ’ . $p->interval_array[$p->get_interval()] . “\n”;

     $note = $p->get_note();
     if ($note != '') {
     	$body .= "\n$note\n";
     }
     return $body;
    

    }

epsdky wrote on Sunday, March 15, 2015:

Hello,

function get_prescription_body_text($p) {
    $body = '<b>' . xl('Rx') . ': ' . $p->get_drug() . ' ' . $p->get_size() . ' ' . $p->get_unit_display();
    if ($p->get_form()) $body .= ' [' . $p->form_array[$p->get_form()] . "]";
    $body .= ' - ' . xl('Disp #') . ':</b> <u>' . $p->get_quantity() . "</u>" .
        '<b> - ' . xl('Sig') . ':</b> ' . $p->get_dosage() . ' ' . $p->form_array[$p->get_form()] . ' ' .
        $p->route_array[$p->get_route()] . ' ' . $p->interval_array[$p->get_interval()] . "\n";

    $note = $p->get_note();
    if ($note != '') {
        $body .= '<b>' . xl('Note') . ': </b>' . $note . "\n";
    }
    return $body;
}

Regards,

epsdky.

arnabnaha wrote on Sunday, March 15, 2015:

which file is this?

epsdky wrote on Sunday, March 15, 2015:

Hello,

controllers/C_Prescription.class.php

arnabnaha wrote on Sunday, March 15, 2015:

and modification line number? or where to add this code?

epsdky wrote on Sunday, March 15, 2015:

In 4.2.0, replace lines 477 - 500

arnabnaha wrote on Sunday, March 15, 2015:

Thanks epsdky…

arnabnaha wrote on Sunday, March 15, 2015:

works great…but i can see only 3 drugs on one pgae…can it be increased to 5 of 6?

epsdky wrote on Sunday, March 15, 2015:

Pleased I could help.

Change “3” to the number of Rx groups that you want in line 607…

if (++$on_this_page > 3 || $p->provider->id != $this->providerid) {

arnabnaha wrote on Sunday, March 15, 2015:

this line as you have stated is present on line no. 563 and also on 596…which one to change?

epsdky wrote on Sunday, March 15, 2015:

The version I am referring to is 4.2.0 (GitHub). The line to change for HTML output is 607 (multiprintcss_action). I Should have mentioned that PDF output is changed with line 574 (multiprint_action).

blankev wrote on Sunday, March 15, 2015:

It gives 4 Rx line on first page. Only one Rx on second and third pages.

arnabnaha wrote on Monday, March 16, 2015:

The edit…worked…I have a patient with 9 medications…changed the code as per epsdky and displayed 6 medications on one page and rest 3 on the other…Thanks epsdky…this was long needed

arnabnaha wrote on Monday, March 16, 2015:

Hi…epsdky

Can we change one more thing?

If a prescription continues to 2nd page, can we switch off the printing of the headers like Rx, Clinic name, Patient details, medical record number, date of birth etc…

this should be off only on the subsequent pages and should remain on 1sta page only in cases of multiple page prescription.

blankev wrote on Monday, March 16, 2015:

Hello Arnab,

if printing more than 3 recipe lines on the second page of prescriptions, do you get these all on the next page. In my Local version of OpenEMR I get 4 Rx lines on the first page (Changes > 3 into > 4), but it is followed with only one line per page on the 2nd, 3rd and 4th pages.

If epdky could make all these new options for prescriptions into something like toggle in Globals, it would be even better for the community.

Great improvements happened. When I started with prescriptions it was only possible to make 4 prescriptions of one(?) line on a A4/Letter sheet.

Please advise for my seemingly flow/bug in prescriptions. (Not tried yet in Demo versions)

blankev wrote on Monday, March 16, 2015:

Hello epdsky,

in GITHUB, what part do I have to copy to get my 4 prescriptions in shape again? I must have made changes in the past and now my second and third page do not give correct results. I want to copy paste a whole section (as many folders as needed for prescriptions) to get things working again as should.

Please advise.

epsdky wrote on Tuesday, March 17, 2015:

Hello Arnab,

I see I have overlooked the line number displacement that results after first edit…my mistake.

epsdky wrote on Tuesday, March 17, 2015:

(Pieter and Arnab, I have sent a message)

arnabnaha wrote on Tuesday, March 17, 2015:

epsdky…

I have replied to the message you have sent…kindly check it out

blankev wrote on Tuesday, March 17, 2015:

Using you e-mail to have private conversation I got this response:

This is an automatically generated Delivery Status Notification.

Delivery to the following recipients failed.

   exxxxx at users dot sf dot net </i>

This was my answer:

Hello e.,

It is still on the wish list.

YES (but I found some short cuts and clicks that took away the urgency)

I searched the Internet to find solutions to have the software decide where to print an A6 and where an A4 page. It is possible, but as a non-programmer beyond my comprehension to implement.

Has been a long time since!

Tnx for remembering, Pimm Blankevoort