Commit Graph

114 Commits

Author SHA1 Message Date
9d568463f1 feat: completely remove HealthPlix integration, controllers, views, and database columns 2026-10-21 01:33:13 +05:30
a454bd178c fix(abdm): finalize and sync OPD consult and prescription FHIR bundles only on print 2026-10-19 18:53:58 +05:30
6c812236a8 feat(abdm): set autoLinkDelayMinutes to 1, regenerate FHIR bundle on print, map salt composition to reasonCode 2026-10-16 18:54:29 +05:30
a3c544a53c feat(user-management): enhance user management, permission handling, and charges invoice workflows
- Add UserProfileModel and migration for user profile data
- Enhance User Management views, controller, and doctor/nurse search integration
- Refactor handleAuthError to separate 401 session expiry from 403 access restriction
- Apply granular permission checks to sidebar navigation links
- Open Bed Status view for all authenticated users
- Support GET and POST on charges item routes and exempt billing charges from CSRF desync
2026-10-14 20:08:10 +05:30
18505968bd feat(abdm): add automatic invoice linking and syncOpenInvoices for OPD consultation fees and charge invoices 2026-10-08 12:46:12 +05:30
b3e7a2175f fix(abdm): make FHIR creation async local-only in web requests, auto-link every minute via cron, disable cooling delay 2026-10-08 12:30:47 +05:30
f367603962 fix(abdm): unify consult visit into single OPConsultRecord bundle and auto-sync on print 2026-10-06 16:40:30 +05:30
524a991098 fix(opd): preserve template settings and flow while compacting font sizes for large prescriptions 2026-09-27 13:40:35 +05:30
8850620931 fix(opd): accurately calculate top margin delta from template @page and fix named header/footer preservation 2026-09-27 11:50:27 +05:30
b75a43fc32 fix(opd): maintain letterhead top and left margins and content width ratios in Rx print pagination 2026-09-27 11:37:16 +05:30
0397071be4 fix(opd): reorder prescription directions to Frequency | Relation to Food | Dose | Duration | Remarks and add legacy data safeguards 2026-09-27 09:02:03 +05:30
3f1e89d4be Fix IPD patient admit search error, add admission type filters to IPD patient list, remove redundant sidebar links, and add OPD Day Care template support 2026-09-23 10:12:42 +05:30
2d68a19584 feat(hms): add Document Type selection dropdown to HMS Desktop Scan Upload Modal and save document_type with badges 2026-08-29 04:45:28 +05:30
7c04828e99 feat(ipd): align IPD Discharge prescribed medicine form design and autotext with OPD Consult 2026-08-27 04:33:10 +05:30
16f244f6be Add Refer By OPD template placeholder 2026-08-18 13:00:28 +05:30
51f5a87f92 Include old UHID in OPD template output
Append patient old_uhid to the OPD {{uhid_no}} placeholder only when a value exists.
2026-08-08 08:48:12 +05:30
3036b2189f Add failure-path diagnostics for OPD scan upload/list 2026-08-07 14:15:47 +05:30
a1a06c5dee Fix OPD scan list for live schema/path differences 2026-08-07 13:41:32 +05:30
acabc6abdd ABDM HIU callback hardening, OPD ABHA optional confirm, and AJAX memory cleanup 2026-07-10 00:09:35 +05:30
540de8c76e Enhance camera capture/edit permissions and fix OPD AdviceBlock rendering 2026-07-08 15:24:39 +05:30
f243aeeb04 Preserve OPD textarea newlines in print and refine IPD date filter layout 2026-07-06 18:49:10 +05:30
43f465e261 Fix OPD advice label and Hindi rendering in template output 2026-07-04 14:53:13 +05:30
fb460e02e8 Fix OPD AdviceBlock label rendering 2026-07-04 14:31:55 +05:30
c22c21d36c OPD template: keep {{investigation}} print order by sequence 2026-07-02 19:34:41 +05:30
6288c626fc mPDF: normalize numeric font-weights across template PDF renderers 2026-07-02 10:27:46 +05:30
1abf572a14 OPD letter: add HTML debug endpoint and placeholder style controls 2026-07-02 10:09:45 +05:30
e85bfd85e1 OPD template: split opd fee into amount and description placeholders 2026-07-02 09:40:25 +05:30
fe2fabc5b8 Make OPD placeholder headings consistently bold 2026-06-19 13:20:29 +05:30
b19d1d40c2 Fix OPD PDF overflow and compact consult placeholders 2026-06-19 13:12:34 +05:30
aa812354a6 Change mPDF default font from thin dejavusans to medium-weight freeserif for better Hindi/Devanagari rendering
- Updated all controllers: Opd, Diagnosis, Billing\Charges, Billing\Ipd, Storestock, AbdmGateway
- freeserif provides better Unicode coverage and more readable font weight
- Ipd_discharge and DoctorDocument already used good fonts (freeserif/freesans)
- Added comprehensive font configuration documentation
2026-06-06 11:19:35 +05:30
a76f0dd9e7 Make pain scale more compact for prescription layout
Reduced sizes:
- Table width: 100% to 60%
- Debug text: 10px to 8px
- Triangle: 18px to 12px
- Number boxes: 14px to 10px with 3px padding
- Border: 3px to 2px for selected
- Labels: uniform 7px font
- Reduced all margins and spacing

Still maintains clear B&W visibility with triangle, gray background, and bold border.
2026-06-06 04:21:56 +05:30
6259001aec Fix emoji rendering issue - use PDF-safe symbols instead
PROBLEM: Emojis don't render in PDF (showing as empty boxes)

SOLUTION:
- Use down-pointing triangle (▼) using HTML entity ▼
- This Unicode character renders properly in mPDF/PDF generators
- Darker gray background (#cccccc) for better B&W visibility
- Bold 3px border on selected box
- Larger font and padding for selected number

Visual indicators that work in B&W printing:
- Triangle (▼) above selected level
- Dark gray shading on selected box
- Bold border on selected box
- Bold text for selected label
2026-06-06 04:19:20 +05:30
a047955c7c Add emojis to pain scale for clear black & white printing
PROBLEM: Color coding not visible in black & white printers

SOLUTION:
- Added emoji indicators: 😊 😐 😣 😖 😭 for pain levels 0-4
- Changed colors to black/white/gray for B&W compatibility
- Emoji shows above selected pain level (larger size)
- Bold 3px border on selected box (visible in B&W)
- Light gray background on selected box

Now pain scale is clear even in monochrome printing!
2026-06-06 04:14:12 +05:30
cad5730182 Disable static PNG pain scale images, use dynamic HTML instead
PROBLEM: Static pains_scale_0-4.png files all look identical (just gradient)
so users can't tell which pain level is selected.

SOLUTION: Comment out PNG file checking code to force use of dynamic HTML
with arrow indicator, colored backgrounds, and bold borders.

Now {{painscale_img}} will show:
- Debug line: 'Pain Level: X - Label'
- Down arrow (▼) above selected level
- Colored background (green to red) on selected box
- Bold 3px border on selected box
- Different pain values will have visibly different displays
2026-06-06 04:07:16 +05:30
e0c44e79b1 Add debug info to pain scale image showing actual value
- Add 'Pain Level: X - Label' text above pain scale for debugging
- Helps identify if pain_value is being read correctly from database
- Fix comparison to use strict equality check for  ===
- User can now see which pain level is actually being rendered
2026-06-06 03:59:14 +05:30
a14011e11c Improve pain scale visual indicator for better clarity
- Change checkmark to down arrow (▼) for better visibility in PDFs
- Increase arrow size to 20px and make it bold
- Use white background for non-selected boxes for stronger contrast
- Add thick black border (3px) on selected level for emphasis
- Selected box shows colored background with white text
- Increase selected label text size and make it bold black
- Clear visual distinction between selected (value 2 vs 4) levels now
2026-06-06 03:54:51 +05:30
5e929c858e Fix H_logo placeholder not being replaced in OPD print
- Add fallback to 'logo.png' when H_logo is not set in database or constants
- Prevents {{H_logo}} placeholder from appearing as literal text in print/PDF
- Resolves 400 Bad Request error when browser tries to load unreplaced placeholder
- Ensures prescription templates always have a valid logo path
2026-06-06 03:43:31 +05:30
a5ccd71714 Enhance pain scale image with visual tick indicator
- Add checkmark (✓) above the selected pain intensity level
- Use color gradient from green (No Pain) to red (Worst) for better visual clarity
- Highlight selected level with colored background and white text
- Thicker border on selected level for better emphasis
- Bold label text for selected intensity
- Makes pain scale selection immediately visible in printed/PDF prescriptions
2026-06-06 03:11:25 +05:30
6314bafa29 Combine textarea notes and test list into single {{investigation}} placeholder
Modified {{investigation}} to show both:
1. Textarea content (advise_investigation_notes) if present
2. Comma-separated test list from opd_prescription_investigation table

Both sources combined with newline separator when both exist.
{{Tadvise_test_list}} still available separately for backward compatibility.

Example combined output:
USG WHOLE ABDOMEN
CECT ABDOMEN
PAC
COMPLETE CARDIAC CHECK UP
PAP SMEAR
CBC (Complete Blood Count), ECG (Electrocardiogram), HBA1C, HBSAG, HCV, HIV I & II (Elisa), Liver Function Test (LFT), PT/INR, Renal Function Test (RFT), Urine Routine & Microscopy, X-Ray Chest (PA View)
2026-06-05 16:04:01 +05:30
a1fbf50f3f Change {{Tadvise_test_list}} to comma-separated format (not bullet list)
Changed placeholder behavior to match user requirements:
- {{investigation}} = textarea content (advise_investigation_notes) only
- {{Tadvise_test_list}} = comma-separated test names from table

Removed HTML bullet list formatting. Now outputs plain comma-separated text.

Example output:
CBC (Complete Blood Count), ECG (Electrocardiogram), HBA1C, HBSAG, HCV,
HIV I & II (Elisa), Liver Function Test (LFT), PT/INR, Renal Function Test (RFT),
Urine Routine & Microscopy, X-Ray Chest (PA View)

Both placeholders are independent and can show content simultaneously.
2026-06-05 15:59:16 +05:30
0b865f41cd Add textarea fallback for {{Tadvise_test_list}} placeholder
When opd_prescription_investigation table is empty but investigation
textarea has content, parse textarea content (split by newlines) to
populate the test list.

This handles cases where tests are entered as free-text in the
"Advise Investigation" textarea instead of selecting from master list.

Parsing logic:
- Try rx_investigations table first
- If empty, split investigation textarea by newlines
- Filter out empty lines and 'null' values
- Build HTML bullet list from either source

Example textarea content:
USG WHOLE ABDOMEN
CECT ABDOMEN
PAC
COMPLETE CARDIAC CHECK UP
PAP SMEAR

Will render as:
• USG WHOLE ABDOMEN
• CECT ABDOMEN
• PAC
• COMPLETE CARDIAC CHECK UP
• PAP SMEAR
2026-06-05 15:55:34 +05:30
1ca2dbce4c Add error handling and debug mode for OPD PDF rendering
Added try-catch around mPDF WriteHTML to catch rendering errors.
Changed debug_html mode to output as text/html for better preview.
Logs mPDF errors and returns user-friendly error message.

This will help diagnose blank page issues with {{Tadvise_test_list}} placeholder.
2026-06-05 15:38:26 +05:30
a540581bf9 Fix {{Tadvise_test_list}} to always populate from rx_investigations
Previous implementation only built test list when investigation textarea
was empty, preventing {{Tadvise_test_list}} from showing when textarea
had content.

Changes:
- Separated test list building from textarea population logic
- {{Tadvise_test_list}} now always populates when rx_investigations exists
- {{investigation}} still gets comma-separated fallback when textarea empty
- Both placeholders now work independently

Test list HTML output format:
<ul style="margin:3px 0 0 16px;padding:0;list-style-type:disc;">
  <li>CBC (Complete Blood Count)</li>
  <li>ECG (Electrocardiogram)</li>
  <li>HBA1C</li>
</ul>
2026-06-05 15:28:01 +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
b6a2e956d8 Remove heading from combined NABH panel placeholder 2026-06-05 06:05:06 +05:30
806044ff93 Add single conditional NABH panel placeholder 2026-06-05 06:00:43 +05:30
c4a6e95933 Add explicit OPD NABH allergy raw and block placeholders 2026-06-05 05:47:16 +05:30
14fb1fd400 Fix OPD placeholder collisions for vitals and allergy blocks 2026-06-05 05:29:58 +05:30
51daaa989a Fix OPD pain/allergy placeholders and hide No Pain block 2026-06-05 04:51:05 +05:30
dc2a0da1ee Use mPDF-safe mm spacer blocks for OPD section gaps 2026-06-05 04:26:23 +05:30