devsofttech_hms_ci4/app/Views/billing
DevSoftTech Server ea07063675 Fix: Prevent duplicate medicine saves on 'Save Discharge Advice' button
ISSUE: Medicines were being saved twice - once via Add button AJAX, and again when clicking 'Save Discharge Advice' button.

ROOT CAUSE:
1. Legacy code in save_main handler (lines 5489-5538) read 'discharge_medicine_json' POST field
2. JavaScript serializeDischargeMedicineTable() collected all medicine table rows into JSON
3. On form submit (Save Discharge Advice), JSON was sent and controller re-inserted all medicines
4. Result: duplicate entries in ipd_discharge_prescrption_prescribed table

SOLUTION:
- DISABLED controller code that processes discharge_medicine_json in save_main handler
- DISABLED JavaScript call to serializeDischargeMedicineTable() on form submit
- Medicines now saved ONLY via Add button AJAX (action='add_drug')
- Save Discharge Advice button now only saves dietary advice, instructions, review after, etc.

TESTING:
1. Add medicines via Add button (saves immediately)
2. Click Save Discharge Advice (does NOT save medicines again)
3. No duplicate entries in database
2026-06-07 09:03:12 +05:30
..
charges refactor: set number input step to 1 across views 2026-04-10 21:16:25 +05:30
ipd Fix: Prevent duplicate medicine saves on 'Save Discharge Advice' button 2026-06-07 09:03:12 +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