Commit Graph

259 Commits

Author SHA1 Message Date
ddec3cec69 Fix editable complaint fields - attach handlers after section reload
BUGFIX: Event handlers were only attached on initial page load

PROBLEM: After implementing editable complaint fields, the inputs
wouldn't become editable when adding new complaints via the Smart
Complaints Picker. The event handlers were only attached once on
page load, not after the section was dynamically reloaded.

ROOT CAUSE: When clicking Add or AI Draft buttons, the form submits
and the section-complaints area is reloaded from server. The new
complaint rows had the input fields but no event handlers attached.

SOLUTION:
1. Moved event handler attachment logic into initComplaintTools()
   function as new attachComplaintFieldHandlers() helper
2. This function is automatically called after section reload
3. Clone-and-replace pattern to prevent duplicate event handlers
4. Fixed table name: ipd_discharge_complaint (not ipd_discharge_comp)

FLOW:
- Add complaint → section reloads → initComplaintTools() runs →
  attachComplaintFieldHandlers() attaches blur/keydown handlers →
  editable fields work

Now clicking on complaint name/remark inputs works for both:
- Existing complaints (on page load)
- Newly added complaints (after section reload)
2026-06-06 05:18:35 +05:30
2e6bff35a0 Make IPD discharge complaint names and remarks editable like OPD form
FEATURE: Inline editing for discharge complaint table

PROBLEM: In IPD discharge form, complaint names and remarks were
read-only after adding. Unlike OPD consult form where you can edit
complaint names directly in the table.

SOLUTION:
1. VIEW Changes (discharge_create.php):
   - Changed complaint name and remark columns from static <td> to editable <input>
   - Added data attributes for complaint ID and original values
   - Added CSS classes: discharge-complaint-name-input, discharge-complaint-remark-input

2. JAVASCRIPT Changes:
   - Added saveComplaintField() function for AJAX updates
   - Event handlers on blur to save changes
   - Enter key support to blur and save
   - Visual feedback: green border on success, red on error
   - Auto-updates original value after successful save

3. CONTROLLER Changes (Ipd_discharge.php):
   - Added update_complaint_field() method for AJAX endpoint
   - Updates ipd_discharge_comp table (comp_report or comp_remark)
   - Returns JSON success/error response

BENEFITS:
- Same user experience as OPD consult form
- Edit complaints/remarks without page reload
- Immediate feedback on save success/failure
- Type correction and updates without removing and re-adding rows
2026-06-06 05:12:23 +05:30
5847f642d8 Make discharge preview top panel sticky and add action buttons
IMPROVEMENTS:
1. Sticky top panel - stays visible when scrolling
2. Action buttons moved to top panel for easy access
3. Compact layout with better button organization

CHANGES:
- Added .discharge-preview-sticky-header class with position: sticky
- Moved all action buttons to top panel:
  * Back to Edit button (with edit icon)
  * Print on Letter Head dropdown (PDF icon)
  * Print on Plain Paper dropdown (file icon)
- Added icons to buttons for better UX
- Made buttons smaller (btn-sm) to fit in top panel
- Reduced margins and padding for compact layout
- Removed duplicate buttons from bottom
- Top panel now includes: header, patient info, action buttons, template selector

BENEFITS:
- Buttons always visible even when scrolling long discharge summary
- No need to scroll up/down to access print functions
- Better workflow for reviewing and printing
2026-06-06 04:46:17 +05:30
3de14194a7 Add Preview button at top of IPD discharge form
IMPROVEMENT: Preview button now always visible at top of page

PROBLEM: Preview button was at bottom in sidebar, often hidden
and users had to scroll to find it.

SOLUTION:
- Added Preview button at top right after patient header
- Button labeled 'Preview Discharge Summary' with eye icon
- Original sidebar button still present for convenience
- Top button uses same onclick handler as sidebar button

Now users can easily preview discharge summary without scrolling.
2026-06-06 04:42:00 +05:30
3e21ab57b0 Make diagnosis column editable in OPD consult form
- Convert diagnosis name from static text to editable input field
- Add event handlers for diagnosis name editing (input, blur, keydown)
- Users can now edit diagnosis text after adding it to the table
- Duration and Date remain editable as before
- Enter key moves focus from diagnosis to duration field
- Auto-sync with selectedDiagnosisItems and SNOMED JSON on edit
- Apply proper SNOMED styling (blue text) only when concept_id exists
2026-06-06 02:57:54 +05:30
09c3be0755 Fix jQuery CSS error in complaint name input
- Fix 'can't access property toUpperCase' error when rendering complaint table
- Apply SNOMED styling conditionally only when complaint has concept_id
- Use proper jQuery css() object notation instead of string
2026-06-06 02:54:00 +05:30
d156e26ac1 Make complaint column editable in OPD consult form
- Convert complaint name from static text to editable input field
- Add event handlers for complaint name editing (input, blur, keydown)
- Users can now edit complaint text after adding it to the table
- Frequency, Severity, Duration remain editable as before
- Enter key moves focus from complaint to frequency field
- Auto-sync with selectedComplaintItems and SNOMED JSON on edit
2026-06-06 02:50:44 +05:30
8ef46cddb1 Add permission for Admin to edit patient name anytime
- Add billing.patient.edit-name-anytime permission to AuthGroups
- Update patient edit time restriction from 12 hours to 24 hours
- Modify Person_Edit_V to check for edit-name-anytime permission
- Admin can now edit patient name field (input_name) even after 24-hour window
2026-06-05 17:33:31 +05:30
718e01156d Revert card/modal/container borders to original light colors
User feedback: Form controls with dark borders (#555) work fine, but
card/modal/container borders looked bad with dark colors.

Reverted to original light borders:
- Cards, card-header, card-footer: #ebeef4 (light gray)
- Modals: #ebeef4 (light gray)
- Dropdowns: #ebeef4 (light gray)
- Breadcrumb: #ebeef4 (light gray)
- List groups: #ebeef4 (light gray)
- Box/Panel components: #ebeef4 (light gray)
- Profile/User cards: #ebeef4 (light gray)
- Dashboard cards: #ebeef4 (light gray)
- Sidebar/Header: #ebeef4 (light gray)
- Tables: #ddd (moderate gray, slightly darker than cards)

KEPT dark borders (user says these work fine):
- Form controls (input, select, textarea): #555 (dark gray)
- Form control focus: #333 (very dark)
- Input groups: #555 (dark gray)
- Select2: #555 (dark gray)
- jQuery UI: #666 (dark gray)

Final result: Dark, highly visible borders only on interactive form
controls. Subtle, professional light borders on structural containers.
2026-06-05 16:20:21 +05:30
12610b4b8b Add dark border theme for better visibility on old LED screens
Created custom CSS file to enhance visibility on older displays:
- Darker border colors for all form controls (#555 instead of light grays)
- Enhanced contrast for inputs, selects, textareas
- Darker card borders (#999)
- Darker table and modal borders
- Better visibility for buttons, dropdowns, alerts
- Updated Select2, jQuery UI, and DataTables borders

Files changed:
- public/assets/css/custom-theme-dark-borders.css (NEW)
  * Comprehensive dark border overrides with !important flags
  * Covers all Bootstrap and custom components

- app/Views/welcome_message.php
  * Included custom-theme-dark-borders.css after main style.css

- app/Views/auth/login.php
  * Included custom-theme-dark-borders.css for login page

- app/Views/storestock/_niceadmin_theme.php
  * Updated inline CSS border colors from light to dark
  * Changed #ebeef4, #dfe3ea, #e9edf5 to #555, #666, #888, #999

Theme now provides better contrast for old LED monitors with darker,
more visible borders across all UI components.
2026-06-05 16:10:38 +05:30
6f6286f427 Add {{Tadvise_test_list}} placeholder for investigation test names
Created new OPD template placeholder to display investigation test names
as a formatted HTML list, separate from the textarea {{investigation}}.

Changes:
- app/Controllers/Opd.php:
  * Added $rxInvestigationTestList variable in buildLegacyDashboardTemplateVars()
  * Builds HTML <ul> list from rx_investigations test names
  * Added 'Tadvise_test_list' token to return array

- app/Views/billing/opd_template_builder.php:
  * Added 'Tadvise_test_list' to $opdConsultSet placeholder list
  * Now appears in "OPD Consult" group in template builder

Usage in OPD templates:
- {{investigation}} = comma-separated test names (for textarea)
- {{Tadvise_test_list}} = formatted HTML bullet list of test names (for print/display)

Example output:
<ul style="margin:3px 0 0 16px;padding:0;list-style-type:disc;">
  <li>CBC (Complete Blood Count)</li>
  <li>USG WHOLE ABDOMEN</li>
  <li>ECG (Electrocardiogram)</li>
</ul>
2026-06-05 15:15:15 +05:30
561adb9647 feat(discharge): add department and time placeholders 2026-06-05 11:05:00 +05:30
23fd1bf73f fix(discharge): render html fragments and reorder sections 2026-06-05 10:42:14 +05:30
0b05d7284c feat(discharge): support section placeholders 2026-06-05 10:24:31 +05:30
55e56176aa fix(discharge-ui): simplify preview and remove ABDM sandbox panel 2026-06-05 09:40:30 +05:30
c9c70a9ce5 fix(discharge): support borderless medication table in preview and PDF 2026-06-05 08:15:33 +05:30
3d8ebb1ed3 fix(discharge-preview): match table border CSS with PDF output 2026-06-05 08:08:30 +05:30
f341e8e76e fix(discharge-template): make delete endpoint reliable for URL and AJAX 2026-06-05 07:37:39 +05:30
a169ab174b fix(discharge): render header/footer hospital placeholders in PDF 2026-06-05 07:33:07 +05:30
fdb7c15f85 Fix discharge template page edit flow and AJAX save/delete 2026-06-05 07:12:58 +05:30
ecb55e7329 Add page settings and header footer support to discharge templates 2026-06-05 06:22:13 +05:30
226f956985 Add discharge preview and PDF quick-launch to template settings 2026-06-05 06:17:59 +05:30
a1ba8f0e6b Enhance OPD template placeholders and list rendering 2026-06-05 03:48:24 +05:30
b3e8a1a692 Refine OPD template builder UI and preview behavior 2026-06-05 03:34:08 +05:30
45c36e730c Fix diagnosis chip duplication in consult form 2026-06-04 14:22:34 +05:30
b575560a00 Fix complaint chip duplication in consult form 2026-06-04 14:09:24 +05:30
f079f32f58 Restore legacy pharmacy reports and fix net/payment totals 2026-06-01 10:53:27 +05:30
252f911fad Add pharmacy invoice permissions and discount print fixes 2026-06-01 10:13:40 +05:30
b12652d6e0 Align ABDM bridge workflow APIs and add report doctor mapping 2026-06-01 07:02:34 +05:30
0ebf8d2a8a ABDM: enforce PDF-backed report submit and improve gateway tracking 2026-05-31 04:17:39 +05:30
7253fa0cca Improve radiology template workflow and editor stability 2026-05-30 18:01:20 +05:30
78c23af7e5 Checkpoint: pathology panel modal workflow, gateway component search, and ABDM-style component/print editors 2026-05-30 06:32:30 +05:30
e449af8137 fix(pharmacy): make packing numeric in product form 2026-05-26 13:25:55 +05:30
298647b80b fix(pharmacy): finalize product page panel toggle and GST selector behavior 2026-05-26 13:07:46 +05:30
032ff4f1ab fix(ui): disable ajax cache for dynamic panel loads 2026-05-26 13:07:03 +05:30
89a4053ede fix(drug-master): keep search shell visible with nested sub panel 2026-05-26 06:20:56 +05:30
fc2ccc91c2 fix(drug-master): keep add edit flow in medical-main container 2026-05-26 06:15:14 +05:30
4ed366ccb2 feat: commit all pending page and ABDM gateway updates 2026-05-26 06:04:34 +05:30
c97db078a9 fix(product-edit): use short formulation master and manufacturer payload name 2026-05-26 06:02:26 +05:30
e5899e59ac Fix drug autocomplete to show medicine name over identifiers 2026-05-25 14:38:06 +05:30
e3290625cc Pharmacy autocomplete: Tab key selects highlighted medicine 2026-05-25 14:14:51 +05:30
2941fadcac Pharmacy product edit: suggestion keyboard nav + immediate parsed autofill 2026-05-25 14:12:33 +05:30
e221581578 Pharmacy product edit: smarter medicine autofill from ABDM label/detail 2026-05-25 14:07:11 +05:30
0558ac5a2e Pharmacy: add ABDM drug terminology autocomplete + canonical mapping 2026-05-25 13:57:56 +05:30
12cacc3a9c Pharmacy drug master: switch to AJAX DataTable search 2026-05-25 12:47:14 +05:30
e15d876a3f Fix ABDM OPD HMS patient profile link route to person_record 2026-05-25 12:14:23 +05:30
34ff92f685 fix(abdm-opd): open pdf print links directly instead of ajax modal load 2026-05-24 07:36:20 +05:30
fcc7ef50e6 fix(abdm-opd): make addopd/showfee workflow functional inside modal 2026-05-24 07:32:49 +05:30
d6c94a0972 feat(abdm-opd): open add OPD visit in modal iframe 2026-05-24 07:26:38 +05:30
8a5624264c feat(abdm-opd): open OPD registration inside modal iframe 2026-05-24 07:25:52 +05:30