I am using openemr version 7.0.0 (2). When I “Save and Dispense” the drug. It shows the below error.
Warning : Undefined array key “sale_id” in C:\xampp\htdocs\OpenEMR\interface\drugs\dispense_drug.php on line 43
Internal error: the referenced encounter no longer exists. 1 0
I request please guide me why it is showing this error. It is also not getting less the drug inventory.
I think sale_id is generated as <mrn>.<encounter>. So looks like you are trying to sell drug/product to patient #1 for whom there has not been any encounter created.
Or may be a bug if you can replicate it in demo systems.
Thanks for your response.
Now I enable Debugging Options for “All”. Now it is not showing the error which I shared before.
But now it is showing error “Internal error: the referenced encounter no longer exists. 2 0”.
Anyone please suggest what could be the reason. It is also not getting less the inventory. Means not hitting the sale.
Internal error: the referenced encounter no longer exists. 1 0
1 is the PID, whereas 0 is the encounter which has been initialized to 0. However, there’s no encounter ID of 0 in the database. So what you need to do is to get the current encounter and dispense the drug accordingly.