Commit Graph

3 Commits

Author SHA1 Message Date
49d83dd105 Add PATIENT_TITLE discharge placeholder 2026-08-01 16:13:13 +05:30
16348d12db Fix placeholder tokens: DISCHARGE_SUMMARY, DOCTOR_NAMES, DEPARTMENT
- Add 'Discharge Summary' section to buildAutoDischargeContent with department, doctors, and dates so {{DISCHARGE_SUMMARY}} token extracts properly
- Improve getDischargeDepartmentName to support dept_id, department_id fields and check both hc_department and ipd_department tables
- Improve getDischargeDoctorNames to fallback to doctor_id, doc_id, consultant_id if doc_list is empty
- Update DISCHARGE_TEMPLATE_TOKENS.md to clarify what {{DISCHARGE_SUMMARY}} contains
- Clear cached content for IPD 1 to regenerate with new logic

Fixes issue where {{DISCHARGE_SUMMARY}}, {{DOCTOR_NAMES}}, {{DEPARTMENT}} tokens were not working (replaced with empty values)
2026-06-06 13:00:52 +05:30
814eda6d16 Add discharge template tokens quick reference guide
Created comprehensive quick reference organized by user's requested categories:

1. Hospital Information (11 tokens)
   - H_Name, H_address_1, H_address_2, H_phone_No, H_Email, H_logo, etc.

2. Patient Information (8 tokens)
   - PATIENT_NAME, UHID, AGE_GENDER, GUARDIAN, PATIENT_ADDRESS
   - NEW: PATIENT_PHONE

3. IPD Information (13 tokens)
   - IPD_CODE, DEPARTMENT, ADMIT_DATE, DISCHARGE_DATE, ADMISSION_TIME, etc.
   - NEW: INSURANCE_COMPANY, DOCTOR_NAMES, DOCTOR_NAME

4. IPD Discharge Content (19 tokens)
   - CONTENT (all sections combined)
   - PATIENT_INFO_TABLE (pre-built table)
   - Individual sections: FINAL_DIAGNOSIS, SURGERY, PROCEDURE, DISCHARGE_MEDICATIONS, etc.

5. Common/Meta (2 tokens)
   - CURRENT_DATE, PRINT_TIME

Includes:
- 4 usage examples (minimal, with table, custom layout, selective sections)
- Complete full-featured template example
- Testing instructions
- Usage notes (case-insensitive, auto-hide empty values, etc.)

This is a printer-friendly quick reference version of DISCHARGE_TEMPLATE_GUIDE.md
2026-06-06 12:22:28 +05:30