- add new permissions:
template.opd_print, template.pathology_print, template.diagnosis_print,
template.document_print, template.ipd_document
- Template controller now accepts new permission keys (with backward-compatible fallbacks)
- IPD Document Master now has independent permission key (template.ipd_document)
- Template index tile visibility updated to use new granular keys
- OPD print template builder now honors template.opd_print permission
- preserve existing behavior via legacy permission fallbacks to avoid role breakage
- add formatAiReportHtml() in opd_prescription_basic to render labeled sections
- auto-format loaded patient scan history reports after AJAX load
- format updated report immediately after Run AI response
- keep raw report text for Use Report action while presenting readable UI blocks
- style history report container as light card for clearer visual structure
- new rx_group_delete(int rxId) method in Opd_prescription controller
- deletes linked medicines first (opd_prescrption_prescribed_template), then group row
- POST route: Opd_prescription/rx_group_delete/(:num)
- Delete button (red) added to each row in Rx-Group list table
- confirm dialog before delete (shows group name)
- reloads list after delete; clears form if deleted group was loaded
- cache session medicine rows in currentSessionMedicineRows on every renderMedicine() call
- when Create Rx-Group modal opens, show all current consult medicines as checkboxes
- all medicines pre-checked by default so they are included in the new Rx-Group
- uncheck any medicine to exclude it from the Rx-Group
- crgcMedicineList built from checked rows; manually added medicines preserved
- medicines listed as chips: Type Name (Dose When Freq) for quick readability
- expanded rxGroupCreateModal to modal-xl with two-column layout
- left column: group info (name, complaints, diagnosis, investigation, finding)
- right column: medicine form (name autocomplete, type, dose/when/freq/where, days/qty/remark)
- medicine name search uses medicine_search endpoint with datalist
- type auto-fills on datalist selection (same Chrome input-event fix as main form)
- dose/when/freq/where selects populated from medicineDoseMasterCache (already loaded)
- + Add Medicine adds to local crgcMedicineList array with live table display
- Remove button (x) on each row in the pending medicine table
- Save Rx-Group: creates group then batch-saves all medicines sequentially
- Save & Apply: same as above then applies group to current session
- added '+ Rx-Group' button beside Rx Group selector in medicine panel
- added rxGroupCreateModal with Name/Complaints/Diagnosis/Investigation/Finding fields
- pre-fills Complaints and Diagnosis from current consult textarea values
- Save: creates group and refreshes catalog (group appears in selector)
- Save & Apply: creates group and immediately applies it to current session
- error shown inline in modal, catalog reloads after successful create
- remove use_count/(0) decoration from datalist option value
- option value is now plain med_name, no star or count suffix
- extract applyMedicineSelection() helper to avoid code duplication
- detect datalist selection inside input callback (Chrome fires input not change)
- type, med-id, favorite button all fill immediately when exact name match found
- change handler simplified: matches against medicineSuggestRows array directly