From ee5b29f688fbebf006e4957eb7dd03a63a7ce76a Mon Sep 17 00:00:00 2001 From: DevSoftTech Server Date: Sat, 6 Jun 2026 20:10:52 +0530 Subject: [PATCH] Upgrade IPD Discharge Medicine form to OPD-style Rx prescription interface - Replace simple text inputs with advanced prescription form - Add medicine autocomplete with datalist suggestions - Add dropdown selects for Dose, When, Frequency, and Route from dose masters - Integrate with existing Opd_prescription/rx_group_dose_masters endpoint - Add medicine type auto-fill from medicine database - Add quick-fill buttons for common values (BF/AF/WF, OD/BD/TDS/HS, 3/5/7 Days) - Improve UI with two-column layout: medicine list table (left) + add form (right) - Add real-time medicine suggestions via rx_group_medicine_suggest endpoint - Support Remove All functionality - Dynamic table row add/remove with proper event binding - Better UX matching OPD Consult Form prescription interface --- app/Views/billing/ipd/discharge_create.php | 393 +++++++++++++++++---- 1 file changed, 330 insertions(+), 63 deletions(-) diff --git a/app/Views/billing/ipd/discharge_create.php b/app/Views/billing/ipd/discharge_create.php index f0d6fc1..1c98266 100644 --- a/app/Views/billing/ipd/discharge_create.php +++ b/app/Views/billing/ipd/discharge_create.php @@ -1223,78 +1223,144 @@ $allergyStatusNoKnown = in_array($allergyStatusNormalized, ['no known drug aller -
+
- + No Rx-Group selected
Select group and preview medicines before add.
- - - - - - - - - - - - - - - - - - - -
MedicineTypeDoseWhenFreqDaysQtyRemarkAction
No medicine added
- +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MedicineTypeDoseWhenFreqDaysQtyRemarkAction
No medicine added
+
+ +
-
-
-
-
-
-
-
-
-
-
-
-
-
+ +
+
+
Prescribed:
+
+ + -
- - - - - - - - - - -
+
+ + + +
- - - - - - - - - - - - - - -
+
+ + +
+ +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+ + +
+ +
+ + +
+ + +
+ + + +
+
+ + + + +
+
+ + + +
+ +
Ready.
+
+
+
+
@@ -3999,6 +4065,207 @@ $allergyStatusNoKnown = in_array($allergyStatusNormalized, ['no known drug aller } }); } + + // Load dose masters (Dose, When, Frequency, Route) + var doseMasterCache = { dose: [], when: [], freq: [], where: [] }; + + function renderSelectOptions($select, rows, placeholder) { + var html = '