From 814eda6d160e9cf6f4d83636fafe0f0f4cbc8796 Mon Sep 17 00:00:00 2001 From: DevSoftTech Server Date: Sat, 6 Jun 2026 12:22:28 +0530 Subject: [PATCH] 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 --- DISCHARGE_TEMPLATE_TOKENS.md | 279 +++++++++++++++++++++++++++++++++++ 1 file changed, 279 insertions(+) create mode 100644 DISCHARGE_TEMPLATE_TOKENS.md diff --git a/DISCHARGE_TEMPLATE_TOKENS.md b/DISCHARGE_TEMPLATE_TOKENS.md new file mode 100644 index 0000000..9dcc63d --- /dev/null +++ b/DISCHARGE_TEMPLATE_TOKENS.md @@ -0,0 +1,279 @@ +# IPD Discharge Template Placeholders - Quick Reference + +## 1. Hospital Information +*From Hospital Setting table* + +``` +{{H_Name}} - Hospital name +{{H_address_1}} - Hospital address line 1 +{{H_address_2}} - Hospital address line 2 +{{H_phone_No}} - Hospital phone number +{{H_Email}} - Hospital email +{{H_logo}} - Logo filename +{{H_logo_abs}} - Absolute path to logo file +{{hospital_name}} - Hospital name (same as H_Name) +{{hospital_address}} - Combined address (address_1 + address_2) +{{hospital_phone}} - Hospital phone (same as H_phone_No) +{{hospital_email}} - Hospital email (same as H_Email) +``` + +--- + +## 2. Patient Information +*From Patient_Master table* + +``` +{{PATIENT_NAME}} - Full patient name +{{UHID}} - Patient UHID/registration code +{{AGE_GENDER}} - Age and gender combined (e.g., "26 Year / Female") +{{GUARDIAN}} - Guardian relation and name (e.g., "W/O of RAM SINGH") +{{GUARDIAN_RELATION}} - Guardian relation only (e.g., "W/O of") +{{GUARDIAN_NAME}} - Guardian name only (e.g., "RAM SINGH") +{{PATIENT_ADDRESS}} - Full patient address +{{PATIENT_PHONE}} - Patient phone number ✨ NEW +``` + +--- + +## 3. IPD Information +*From IPD_Master table* + +``` +{{IPD_CODE}} - IPD admission number (e.g., "A26050000001") +{{DEPARTMENT}} - Department name (e.g., "General Medicine") +{{ADMIT_DATE}} - Admission date (dd-mm-yyyy format) +{{DISCHARGE_DATE}} - Discharge date (dd-mm-yyyy format) +{{ADMIT_DATE_ONLY}} - Admission date (same as ADMIT_DATE) +{{DISCHARGE_DATE_ONLY}} - Discharge date (same as DISCHARGE_DATE) +{{ADMISSION_TIME}} - Admission time (HH:MM AM/PM) +{{DISCHARGE_TIME}} - Discharge time (HH:MM AM/PM) +{{ADMIT_TIME}} - Admission time (same as ADMISSION_TIME) +{{ISDELIVERY}} - Delivery case flag (1 for yes, 0 for no) +{{INSURANCE_COMPANY}} - Insurance company name (defaults to "Direct") ✨ NEW +{{DOCTOR_NAMES}} - Treating doctors with specialties ✨ NEW +{{DOCTOR_NAME}} - Same as DOCTOR_NAMES ✨ NEW +``` + +--- + +## 4. IPD Discharge Content + +### 4.1 Complete Content Token + +``` +{{CONTENT}} - All clinical sections combined (NO patient table) +``` + +### 4.2 Section Placeholders for Custom Layout/Order + +``` +{{DISCHARGE_SUMMARY}} - Discharge summary section +{{FINAL_DIAGNOSIS}} - Final diagnosis at discharge +{{SURGERY}} - Surgical procedures performed +{{PROCEDURE}} - Medical procedures +{{PERSONAL_HISTORY}} - Personal history (smoking, alcohol, etc.) +{{PRESENTING_COMPLAINTS}} - Complaints with duration and reason for admission +{{PAIN_MEASUREMENT_SCALE}} - Pain assessment scale +{{GENERAL_EXAM_ADMISSION}} - General examination on admission +{{CLINICAL_INVESTIGATION_REPORTS}} - Lab and imaging investigation reports +{{COURSE_IN_HOSPITAL}} - Course during hospitalization +{{EXAMINATION_ON_DISCHARGE}} - Examination findings at discharge +{{DRUG_ALLERGY_ADR}} - Drug allergies and adverse drug reactions +{{CO_MORBIDITIES}} - Co-morbid conditions +{{DISCHARGE_MEDICATIONS}} - Medications prescribed at discharge +{{DIETARY_ADVICE}} - Dietary advice and instructions +{{DISCHARGE_INSTRUCTIONS}} - Discharge instructions and follow-up advice +{{SIGNATURE_BLOCK}} - Signature block for consultant +``` + +### 4.3 Pre-Built Patient Table + +``` +{{PATIENT_INFO_TABLE}} - Complete patient demographic table (HTML) + Includes: Name, UHID, Age/Gender, IPD No, Guardian, + Phone, Admission, Discharge, Address, Insurance, Department +``` + +--- + +## 5. Common / Meta Tokens + +``` +{{CURRENT_DATE}} - Current date (dd-mm-yyyy format) +{{PRINT_TIME}} - Current date and time (dd-mm-yyyy HH:MM:SS) +``` + +--- + +## Token Usage Examples + +### Example 1: Minimal Template (Just Content) +```html +{{CONTENT}} +``` +**Result:** Shows only clinical sections (no patient table) + +--- + +### Example 2: With Patient Table +```html +{{PATIENT_INFO_TABLE}} +{{CONTENT}} +``` +**Result:** Patient demographics + all clinical sections + +--- + +### Example 3: Custom Layout with New Tokens +```html +

{{H_Name}}

+

Discharge Summary

+ + + + + + + + + + + + + + + + + +
Patient Name:{{PATIENT_NAME}}UHID:{{UHID}}
Phone:{{PATIENT_PHONE}}Insurance:{{INSURANCE_COMPANY}}
Treating Doctor(s): {{DOCTOR_NAMES}}
+ +
+ +{{CONTENT}} +``` + +--- + +### Example 4: Selective Sections Only +```html +

Discharge Summary

+ +{{PATIENT_INFO_TABLE}} + +

Clinical Information

+{{FINAL_DIAGNOSIS}} +{{SURGERY}} +{{PROCEDURE}} + +

Treatment Plan

+{{DISCHARGE_MEDICATIONS}} +{{DIETARY_ADVICE}} +{{DISCHARGE_INSTRUCTIONS}} +``` +**Result:** Shows only selected sections, omits complaints, examination, etc. + +--- + +## Notes + +- **All tokens are case-insensitive** ({{PATIENT_NAME}}, {{patient_name}}, {{Patient_Name}} all work) +- **Empty values show nothing** - No need for conditionals, tokens auto-hide if data is missing +- **{{CONTENT}} never includes patient table** - Add {{PATIENT_INFO_TABLE}} explicitly if needed +- **Doctor names from ipd_master.doc_list** - Automatically formatted as "Dr. Name [Specialty]" +- **Insurance defaults to "Direct"** - Shows "Direct" when no insurance company assigned + +--- + +## Testing Your Template + +1. Create/edit template in `discharge_template` table +2. Clear cached content: `php clear_discharge_content.php [ipd_id]` +3. View discharge: `http://localhost:8080/Ipd_discharge/show_discharge/[ipd_id]/1?tpl=[template_id]` +4. Check output for correct token replacement + +--- + +## Complete Template Example (Full Featured) + +```html + + + + + + + +
+

{{H_Name}}

+

{{hospital_address}}
+ Phone: {{hospital_phone}} | Email: {{hospital_email}}

+

DISCHARGE SUMMARY

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Patient Name{{PATIENT_NAME}}UHID{{UHID}}
Age / Gender{{AGE_GENDER}}IPD No.{{IPD_CODE}}
Guardian{{GUARDIAN}}Phone{{PATIENT_PHONE}}
Address{{PATIENT_ADDRESS}}
Department{{DEPARTMENT}}Insurance{{INSURANCE_COMPANY}}
Admission Date/Time{{ADMIT_DATE}} {{ADMISSION_TIME}}Discharge Date/Time{{DISCHARGE_DATE}} {{DISCHARGE_TIME}}
Treating Doctor(s){{DOCTOR_NAMES}}
+ + + {{CONTENT}} + + + + + +``` + +This template includes: +- ✅ All new tokens (PATIENT_PHONE, INSURANCE_COMPANY, DOCTOR_NAMES) +- ✅ Complete patient demographics in custom table +- ✅ All clinical sections via {{CONTENT}} +- ✅ Professional styling +- ✅ Hospital header and footer