devsofttech_hms_ci4/app/Views/billing
DevSoftTech Server fd70cc46cf Change medicine save to auto-save on Add button click (AJAX)
Medicine Save Behavior Change:
- Previously: Medicines added to table locally, saved on 'Save Discharge Advice' click
- Now: AJAX auto-save immediately when '+ADD / Update' button is clicked
- Matches OPD Consult Form workflow (instant save on add)

Implementation:
- Modified btn_discharge_med_add click handler to make AJAX POST
- POST parameters: action='add_drug', ajax_mode='json', new_drug_name, new_drug_type,
  new_drug_dose, new_drug_when, new_drug_freq, new_drug_day, new_drug_qty, new_drug_remark
- Controller add_drug action already existed - now returns JSON when ajax_mode='json'
- On success: adds row to table, clears form, shows 'Medicine saved successfully'
- On failure: shows error message from server
- CSRF token updated after each AJAX call

Remove Button Behavior:
- Remove button now shows confirmation dialog
- Warns user: 'This will only remove from current view. Reload to see saved medicines.'
- Note: Remove action is NOT yet AJAX - full page reload shows actual DB state
- Future enhancement: make Remove button also AJAX (action='remove_drug')

Technical Notes:
- Kept discharge_medicine_json serialization as backup (unused now, but harmless)
- Medicine data: med_id=0 marks client-added medicines
- Success check: data.update === 1
- Error handling: network timeout 30s, shows xhr.status on fail
- Form fields cleared after successful save
- Focus returns to medicine name field for next entry

User Benefits:
- Instant feedback - no need to scroll down and click 'Save Discharge Advice'
- Medicines immediately persisted to database
- Can add multiple medicines in quick succession
- Consistent with OPD prescription workflow
- Reduced risk of data loss (saves immediately vs. waiting for form submit)
2026-06-06 21:00:30 +05:30
..
charges refactor: set number input step to 1 across views 2026-04-10 21:16:25 +05:30
ipd Change medicine save to auto-save on Add button click (AJAX) 2026-06-06 21:00:30 +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