devsofttech_hms_ci4/app/Views/billing/ipd
DevSoftTech Server e731ef61e9 Fix discharge medicine save, add CKEditor, and Review After quick select
Medicine Saving Fix (MAJOR):
- Add hidden field 'discharge_medicine_json' to capture medicine table data
- Add serializeDischargeMedicineTable() function to convert DOM table to JSON before form submit
- Hook serialization into form submit event (before syncEditorValues)
- Update controller to process discharge_medicine_json in save_main action
- Insert medicines into ipd_discharge_prescrption_prescribed or ipd_discharge_prescription_prescribed table
- Medicine data now persists on page reload

CKEditor Integration:
- Initialize CKEditor for 'instruction_other' (Other Advice) field
- Initialize CKEditor for 'instruction_remark' (Discharge Summary) field
- Add simplified toolbar: Bold, Italic, Underline, Lists, Undo/Redo
- Properly destroy existing instances before re-initialization
- Height: 120px for Other Advice, 150px for Discharge Summary

Review After Quick Select Buttons:
- Add getNextVisitOptions() method to Ipd_discharge controller (copied from Opd_prescription)
- Add resolveFirstField() helper method
- Pass next_visit_options array to view
- Render quick select buttons: '3 Days (09-06-2026)', '1 Week (13-06-2026)', etc.
- Add JavaScript handler: click button → populate #discharge_review_after input
- Change Review After field from col-md-4 to col-md-6 for better layout
- Add col-md-12 wrapper for button row with flex-wrap gap-2 layout

Technical Details:
- Medicine JSON structure: {med_type, med_name, dosage, dosage_when, dosage_freq, no_of_days, qty, remark}
- JSON processing includes column existence checks for flexibility
- Quick select buttons use data-value attribute for value insertion
- Falls back to hardcoded date options if opd_nextvisit table missing
- Medicine insert uses med_id=0 to mark client-added medicines

User Workflow:
1. Add medicines → shown in table (Type, Medicine, Dose labels, Duration formatted)
2. Click 'Save Discharge Advice' → medicines serialize to JSON → POST to controller
3. Controller parses JSON → inserts to database → medicines persist on reload
4. Other Advice/Discharge Summary now have rich text editing (bold, lists, etc.)
5. Review After: click '1 Week (13-06-2026)' button → auto-fills input
2026-06-06 20:53:05 +05:30
..
ayushman_claim_sheet.php Add Ayushman package import, billing claim sheet, and reporting dashboards 2026-03-26 15:42:40 +05:30
bill_print.php fix: correct IPD balance display when computed balance is zero 2026-04-10 21:07:01 +05:30
cash_balance_table.php Implement OPD template builder, doctor template selection, and OPD print integration fixes 2026-02-27 19:44:36 +05:30
cash_balance.php IPD cash balance: fix date range picker submission and parser 2026-04-03 14:13:05 +05:30
current_admission.php Implement OPD template builder, doctor template selection, and OPD print integration fixes 2026-02-27 19:44:36 +05:30
dashboard.php Implement OPD template builder, doctor template selection, and OPD print integration fixes 2026-02-27 19:44:36 +05:30
discharge_create.php Fix discharge medicine save, add CKEditor, and Review After quick select 2026-06-06 20:53:05 +05:30
discharge_preview.php Make discharge preview top panel sticky and add action buttons 2026-06-06 04:46:17 +05:30
discharge_print.php Add report panel updates and related billing/discharge enhancements 2026-03-10 02:43:35 +05:30
invoice_list.php Implement IPD admission/discharge editing, bill PDF modes, and invoice list view action 2026-03-21 15:47:18 +05:30
ipd_form_print.php Port CI3 vitals chart and treatment chart forms to CI4 IPD form print (form_no 6 and 7) 2026-04-09 04:26:09 +05:30
ipd_model_payment_box.php refactor: set number input step to 1 across views 2026-04-10 21:16:25 +05:30
ipd_panel_deduction_payment.php refactor: set number input step to 1 across views 2026-04-10 21:16:25 +05:30
ipd_panel_tpa_payment.php refactor: set number input step to 1 across views 2026-04-10 21:16:25 +05:30
ipd_payment_receipt_pdf.php IPD payment receipt: fix modal loader, add PDF print route, and bank mode details 2026-04-03 13:29:03 +05:30
ipd_payment_receipt_print.php IPD payment receipt: fix modal loader, add PDF print route, and bank mode details 2026-04-03 13:29:03 +05:30
legacy_registration.php Fix legacy billing prints and pathology template compatibility 2026-03-21 02:23:31 +05:30
nursing_chart_print.php Add nursing scan-to-structured workflow and discharge UI polish 2026-03-09 00:12:04 +05:30
panel_admission.php Implement IPD admission/discharge editing, bill PDF modes, and invoice list view action 2026-03-21 15:47:18 +05:30
panel_bed_assign.php Implement OPD template builder, doctor template selection, and OPD print integration fixes 2026-02-27 19:44:36 +05:30
panel_bill_details.php fix: correct IPD balance display when computed balance is zero 2026-04-10 21:07:01 +05:30
panel_diagnosis.php Add Ayushman package import, billing claim sheet, and reporting dashboards 2026-03-26 15:42:40 +05:30
panel_discharge.php refactor: set number input step to 1 across views 2026-04-10 21:16:25 +05:30
panel_documents.php Make IPD forms dynamic and stop stale OPD refresh polling 2026-04-08 11:41:33 +05:30
panel_ipd_charges.php feat(ipd-charges): group delete, sort order, Up/Down buttons, foldable billing panels 2026-04-18 06:56:38 +05:30
panel_medical_bills.php Implement OPD template builder, doctor template selection, and OPD print integration fixes 2026-02-27 19:44:36 +05:30
panel_package.php billing: add ABHA create/verify tab in patient billing view and update IPD panel package; add hospital logo image 2026-05-08 10:48:43 +05:30
panel_payments.php IPD payment receipt: fix modal loader, add PDF print route, and bank mode details 2026-04-03 13:29:03 +05:30
panel_placeholder.php Implement OPD template builder, doctor template selection, and OPD print integration fixes 2026-02-27 19:44:36 +05:30
panel.php Restore legacy HMS flows and add IPD document master templates 2026-03-24 04:24:19 +05:30