Prescription problems

rayaz wrote on Saturday, April 02, 2011:

Hi,

In Prescriptions pane, “Check all”,  selects all saved medications even those that are inactive. This is not the correct expected behavior.

Any thoughts?

Regards
Rayaz

rayaz wrote on Wednesday, April 20, 2011:

Hi,

Anyone please, it really is important for me. Some of my patients have multiple prescriptions that are inactive and prescribing just a few new ones results in having to deselect or select by hand.

Regards

yehster wrote on Thursday, April 21, 2011:

I have implemented a fix. it is available here.

https://github.com/yehster/openemr/commit/e7218a3aef7e84b7939d268e83af9690022825b0

-            chk[pr].checked=true;
-            changeLinkHref_All('multiprint',true,chk[pr].value);
-            changeLinkHref_All('multiprintcss',true, chk[pr].value);
-            changeLinkHref_All('multiprintToFax',true, chk[pr].value);
+            if($(chk[pr]).parents("tr.inactive").length==0)

yehster wrote on Thursday, April 21, 2011:

This fix makes it so that clicking check all only selects the active medications.

Since the purpose of this screen is to print prescriptions, it doesn’t make sense that you would want to print an inactive prescription.  (If you wanted to do that, you should edit the script and make it active again.)

Therefore, I think that it is appropriate to call the previous behavior a bug, and not provide the means to “check all” including the inactive meds. 

This is a very small code change. It uses jQuery to determine if an element is inactive and skips any inactive checkboxes. This fix has been tested and is ready for code review for inclusion in the main branch at this point if the new behavior is considered appropriate.

jcahn2 wrote on Thursday, April 21, 2011:

Clinically, it makes good sense.
Jack

mukoya wrote on Thursday, April 21, 2011:

Hope brady will include this fix in next 4.0 patch as well.

Thanks yehster.

bradymiller wrote on Saturday, April 23, 2011:

Yehster,
Thanks for the contribution. I just committed this to sourceforge (it will also be in the next 4.0 patch).
-brady

rayaz wrote on Thursday, April 28, 2011:

Indeed, Thanks Yehster.  You’ve finally made my day!

Best Regards
Rayaz