Commit Graph

3 Commits

Author SHA1 Message Date
a929100d4d Add text alignment and enhanced CKEditor tools to IPD discharge templates
ENHANCEMENT: Expanded CKEditor toolbar in discharge template editor

NEW TOOLBAR BUTTONS:
1. Text Alignment:
   - JustifyLeft (align left)
   - JustifyCenter (align center)
   - JustifyRight (align right)
   - JustifyBlock (justify)

2. Enhanced Basic Styles:
   - Strike (strikethrough)
   - Subscript
   - Superscript

3. Enhanced Insert Tools:
   - Image
   - PageBreak

4. Enhanced Tools:
   - ShowBlocks (show/hide block elements)

CONFIGURATION:
- Added extraPlugins: 'justify,pagebreak' to enable alignment and page break
- Added allowedContent: true to allow all HTML content
- Added entities: false, basicEntities: false to preserve special characters
- Added fillEmptyBlocks: false for cleaner HTML output

FILE: app/Views/Setting/Template/discharge_templates.php (lines 473-495)
ROUTE: /setting/template/discharge_template_get/{id}

BENEFIT: Template editors now have full control over text alignment, formatting, and layout
2026-06-07 11:07:29 +05:30
89c150324f Add refresh parameter to force regenerate cached discharge content in PDF
Problem:
- PDF shows old cached content with 'Date of Discharge: 2026-06-05'
- Debug page shows correct new format (status header only)
- Discharge content is cached in ipd_discharge table
- PDF generation uses cached content from database
- Fix only affects newly generated content, not cached content

Root Cause:
When discharge is first created, content is generated and saved to DB.
PDF generation flow (show_discharge method):
1. Load cached content from ipd_discharge table
2. Only regenerate if content is empty
3. Apply template and render PDF

So old discharges still have old format cached.

Solution:
Added 'refresh' parameter to show_discharge() method:
- If refresh=1, ignore cached content and regenerate
- Regenerate using buildAutoDischargeContent() (has fix)
- Save new content to database
- Then render PDF

Code Change (line 5900-5913):
Added:
  \ = (int) (\->request->getGet('refresh') ?? 0) === 1;

Changed:
  if (\ || trim(strip_tags(\)) === '') {

Usage:
1. Original URL (uses cache):
   http://localhost:8080/Ipd_discharge/show_discharge/1/1?tpl=1

2. Force refresh (regenerates):
   http://localhost:8080/Ipd_discharge/show_discharge/1/1?tpl=1&refresh=1

3. After first refresh, cache is updated with new format
   Subsequent views will use new cached content

Note:
- preview_discharge_report() already has 'regen=1' parameter
- Same functionality, different parameter name
- Both methods now support force regeneration

For existing discharges:
- Add &refresh=1 to URL once to update cache
- Or recreate discharge from edit page
- Or clear ipd_discharge.content for that IPD ID"
2026-06-07 08:24:38 +05:30
5dccbc8d12 Complete Surgery/Procedure autocomplete implementation and testing docs
COMPLETED ALL TODO ITEMS:

✅ Task 1: Enhanced Surgery autocomplete with SNOMED/ICD codes
✅ Task 2: Enhanced Procedure autocomplete with SNOMED/ICD codes
✅ Task 3: Verified Master CRUD integration (modal already working)
✅ Task 4: Created comprehensive testing documentation

KEY FIXES:
- Removed conflicting bindSurgeryTermLookup() calls from initSurgeryTools()
- Old datalist code no longer interferes with new custom dropdown
- Both autocompletes work independently with separate dropdown containers

TESTING DOCUMENT INCLUDES:
- 10 detailed test scenarios with expected results
- Database verification queries
- Troubleshooting guide
- Edge case handling
- Performance checks
- User acceptance checklist
- Future enhancement suggestions

FILE: SURGERY_PROCEDURE_AUTOCOMPLETE_TESTING.md

Ready for QA testing and user acceptance.
2026-06-06 06:35:32 +05:30