Commit Graph

103 Commits

Author SHA1 Message Date
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
dbda578d68 Harden OPD block spacing and add debug_html output mode 2026-06-05 04:18:48 +05:30
f358bbd66c More spacing between OPD print blocks; add margin around medicine table 2026-06-05 04:13:21 +05:30
3a06c32dc5 Increase spacing between OPD print placeholder blocks 2026-06-05 04:08:20 +05:30
6bdef9bb9d Improve OPD print block typography for professional output 2026-06-05 03:54:52 +05:30
a1ba8f0e6b Enhance OPD template placeholders and list rendering 2026-06-05 03:48:24 +05:30
4ed366ccb2 feat: commit all pending page and ABDM gateway updates 2026-05-26 06:04:34 +05:30
f311d50745 OPD consult: add women history fields, persist in history, update print sections 2026-05-12 12:52:13 +05:30
be6f0cd6d0 Set OPD appointment list default order to descending 2026-05-05 22:56:57 +05:30
0aa0edbbce Fix OPD confirm payment flow and DataTable initialization
- Opd.php: mode-0 (zero amount) no longer inserts payment_history row
  and skips HealthPlix sync for faster confirm
- Opd.php: added spid-based idempotency for cash/card to prevent
  duplicate payment_history rows on retry
- Opd.php: invoice view hides 0-amount payment_history rows
- opd_appointment_list.php: fix isDataTable call (DataTable -> dataTable)
- jquery.dataTables.min.js: replace non-functional shim with real
  DataTables 1.13.8 (supports ext.search, isDataTable, rows() API)
2026-04-28 12:01:53 +05:30
5226fde8a0 Fix OPD appointment datetime display and date filtering 2026-04-28 10:59:04 +05:30
bd274a3fc3 Add OPD appointment time capture and storage with date+time display 2026-04-28 07:59:47 +05:30