[Solved] Prescription drop down No of Tablets left, expiry date in the stock Visible (code)

Where is the drop down code Need to add to show also no of tablets available in stock.
I have used the ndc to display price of single tablet. Similarly want to be able to see in the drop down list how many tabs are left in the stock,

1 Like

You would have to code that into your Prescription module, it does not display there natively.

  • HT

No Hutch, this drop down /drop up shown in the snapshot is inbuilt into the software.
if i can come to know where this file is can modify it.

Can any devs out there help with this?
Might want to move this post to the Dev category instead of this one…

  • HT

try templates/prescription/general_edit.html around L-176
You’d probably have to modify in the look up endpoint through controller.

1 Like

Thanks @sjpadgett , @htuck i did it. Looks great. Saves time.

edit controller/C_Prescription.class file

the code change, replace the below code like in the snapshot.

around line 61-74
select the code and add the below code

            $res = sqlStatement("SELECT d.name, d.ndc_number, d.form, d.size, " .
            "d.unit, d.route, d.substitute, t.drug_id, t.selector, t.dosage, " .
            "t.period, t.quantity, t.refills, d.drug_code, i.on_hand,i.expiration " .
            "FROM drug_templates AS t " .
            "JOIN drugs AS d ON d.drug_id = t.drug_id " .
            "JOIN drug_inventory AS i ON d.drug_id = i.drug_id " .
            "ORDER BY t.selector");

            while ($row = sqlFetchArray($res)) {
                $tmp_output = $row['selector'];
                if ($row['ndc_number']) {

                    $tmp_output .= ' - Price of One Tab: ' . $row['ndc_number'];
                    $tmp_output .= ' - No left in stock: ' . $row['on_hand'];
                    $tmp_output .= ' - Expiry Date: ' . $row['expiration'];

this will display on_hand ( no fo tabs left in stock) and expiry daye in the drop down along with ndc_number value.

This code can send a visual alert to the parmacist to order the drug on time, also alert about drugs about to expire…
Code can be incorporated into the upgrade also.

1 Like

That’s great and happy to hear. You know you can always contribute a PR while you are getting through your production effort.
I don’t think this issue would work in community version(but other Admin’s may like it) but perhaps you’ll come across one that will.

1 Like