devsofttech_hms_ci4/app/Views/billing
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
..
charges refactor: set number input step to 1 across views 2026-04-10 21:16:25 +05:30
ipd Fix discharge medicine save, add CKEditor, and Review After quick select 2026-06-06 20:53:05 +05:30
opd_templates feat: OPD speech-to-text mic, medicine label enhancements & template search 2026-03-30 18:46:33 +05:30
main.php Implement OPD template builder, doctor template selection, and OPD print integration fixes 2026-02-27 19:44:36 +05:30
opd_advice_workspace.php feat: migrate OPD template flow to DB and apply related updates 2026-03-20 18:11:17 +05:30
opd_app_insurance_V.php Add OPD appointment time capture and storage with date+time display 2026-04-28 07:59:47 +05:30
opd_appointment_dashboard.php Enhance OPD and patient workflows with live updates and UX improvements 2026-04-07 03:27:39 +05:30
opd_appointment_list_table.php Move ABDM sandbox to task board and improve OPD queue handling 2026-04-06 13:55:19 +05:30
opd_appointment_list.php feat: commit all pending page and ABDM gateway updates 2026-05-26 06:04:34 +05:30
opd_appointment_V.php Add OPD appointment time capture and storage with date+time display 2026-04-28 07:59:47 +05:30
opd_clinical_master_workspace.php feat: Clinical Master — inline table style with expand-in-place SNOMED assignment 2026-05-20 01:49:00 +05:30
opd_invest_master_workspace.php feat: SNOMED background coding pipeline + ABDM Coding Panel 2026-05-19 20:40:27 +05:30
opd_invest_profile_master_workspace.php Investigation Profile Master: CRUD and consult integration 2026-04-01 18:44:52 +05:30
opd_invest_shortcuts_manager.php Add investigation shortcuts manager panel 2026-04-14 21:51:49 +05:30
opd_invoice_pdf_v.php Implement OPD template builder, doctor template selection, and OPD print integration fixes 2026-02-27 19:44:36 +05:30
opd_invoice_print_v.php Implement OPD template builder, doctor template selection, and OPD print integration fixes 2026-02-27 19:44:36 +05:30
opd_invoice_V.php feat: ABDM OPD Queue + ABHA Register flow + patient ABHA search fix 2026-05-16 04:21:31 +05:30
opd_letter_head_pdf.php OPD consult: add women history fields, persist in history, update print sections 2026-05-12 12:52:13 +05:30
opd_letter_head.php OPD consult: add women history fields, persist in history, update print sections 2026-05-12 12:52:13 +05:30
opd_medicince_workspace.php feat(abdm): proper FHIR bundles for lab reports and IPD discharge 2026-05-23 04:41:59 +05:30
opd_paper_print_settings.php feat: migrate OPD template flow to DB and apply related updates 2026-03-20 18:11:17 +05:30
opd_prescription_basic.php Make diagnosis column editable in OPD consult form 2026-06-06 02:57:54 +05:30
opd_rx_group_workspace.php feat: add Delete button to Rx-Group list 2026-03-31 04:28:18 +05:30
opd_scan_carousel_list.php Make OPD scan list delete self-contained AJAX with inline CSRF sync 2026-04-17 04:50:40 +05:30
opd_scan_history_panel.php feat: format AI scan report text in history cards 2026-03-31 05:18:33 +05:30
opd_scan_last_list.php fix: restrict scan delete to 24h or same date 2026-04-11 04:49:59 +05:30
opd_scan_modal_body.php feat: auto visit-done on scan save and add scan delete actions 2026-04-11 04:45:45 +05:30
opd_template_builder_list.php Refine OPD template builder UI and preview behavior 2026-06-05 03:34:08 +05:30
opd_template_builder.php Add {{Tadvise_test_list}} placeholder for investigation test names 2026-06-05 15:15:15 +05:30
opd_template_workspace.php Implement OPD template builder, doctor template selection, and OPD print integration fixes 2026-02-27 19:44:36 +05:30
Patient_Cards_V.php Implement OPD template builder, doctor template selection, and OPD print integration fixes 2026-02-27 19:44:36 +05:30
Patient_File_Upload_V.php Implement OPD template builder, doctor template selection, and OPD print integration fixes 2026-02-27 19:44:36 +05:30
Patient_Profile_Image_V.php billing: redesign ABHA wizard, enhance patient info panels and consult page photo/layout 2026-05-08 13:29:57 +05:30
Patient_Profile_Opd_V.php feat: ABDM OPD Queue + ABHA Register flow + patient ABHA search fix 2026-05-16 04:21:31 +05:30
Patient_Search_opd.php Implement OPD template builder, doctor template selection, and OPD print integration fixes 2026-02-27 19:44:36 +05:30
Patient_Search_V.php Convert patient search to DataTables with AJAX server-side processing 2026-06-06 14:52:10 +05:30
Patient_V.php feat: ABDM OPD Queue + ABHA Register flow + patient ABHA search fix 2026-05-16 04:21:31 +05:30
Person_Edit_V.php Add permission for Admin to edit patient name anytime 2026-06-05 17:33:31 +05:30
Person_profile_V.php feat: ABDM OPD Queue + ABHA Register flow + patient ABHA search fix 2026-05-16 04:21:31 +05:30
rx_group_medicine_workspace.php feat: ABDM OPD Queue + ABHA Register flow + patient ABHA search fix 2026-05-16 04:21:31 +05:30
search_adv_data.php Enhance OPD and patient workflows with live updates and UX improvements 2026-04-07 03:27:39 +05:30
snomed_dashboard.php feat: ABDM OPD Queue + ABHA Register flow + patient ABHA search fix 2026-05-16 04:21:31 +05:30