diff --git a/DISCHARGE_PLACEHOLDER_HTML_REFERENCE.md b/DISCHARGE_PLACEHOLDER_HTML_REFERENCE.md new file mode 100644 index 0000000..d3068ed --- /dev/null +++ b/DISCHARGE_PLACEHOLDER_HTML_REFERENCE.md @@ -0,0 +1,473 @@ +# Discharge Summary Placeholder HTML Reference + +This document shows the exact HTML structure used for each discharge summary placeholder. + +--- + +## {{DISCHARGE_SUMMARY}} + +**Source:** Auto-generated from IPD data +**HTML Structure:** +```html +

Discharge Summary

+ +

Leave Against Medical Advice

+
+ Department: General Surgery
+ Treating Doctor(s): Dr. Name [Specialization]
+ Date of Admission: 04-06-2026 +
+``` + +**Status-based headers:** +- ipd_status = 0 → "Discharge Summary" +- ipd_status = 1 → "Discharge Summary" (from DB) +- ipd_status = 2 → "Leave Against Medical Advice" +- ipd_status = 3 → "Refer To Higher Centre" +- ipd_status = 5 → "Dead Summary" +- ipd_status = 7 → "Discharge on Request" + +--- + +## {{PRESENTING_COMPLAINTS}} + +**Source:** `ipd_discharge_complaint` + `ipd_discharge_complaint_remark` +**HTML Structure:** +```html +

Presenting Complaints and Reason for Admission

+ +
Additional remark text from comp_remark field (rich text)
+``` + +--- + +## {{PAIN_MEASUREMENT_SCALE}} + +**Source:** Pain measurement data from complaint metadata +**HTML Structure:** +```html +
Pain Measurement Scale: Moderate (5)
+``` + +**If no data:** Empty string (not shown) + +--- + +## {{GENERAL_EXAM_ADMISSION}} + +**Source:** Physical examination data +**HTML Structure:** +```html +

General Examination on Admission :
+BP: 120/80 mmHg, Pulse: 78 bpm, Temp: 98.6°F, Weight: 65 kg +

+``` + +--- + +## {{PERSONAL_HISTORY}} + +**Source:** `patient_master` table personal history flags +**HTML Structure:** +```html +

Personal History

+
Smoking, Hypertension, Type 2 diabetes mellitus (DM)
+``` + +**Fields checked:** +- is_smoking → "Smoking" +- is_alcohol → "Alcohol" +- is_drug_abuse → "Drug abuse" +- is_tobacoo → "Tobacco" +- is_hypertesion → "Hypertension" +- is_niddm → "Type 2 diabetes mellitus (DM)" +- is_hbsag → "HBsAg" +- is_hcv → "HCV" +- is_hiv_I_II → "HIV I & II" + +--- + +## {{DRUG_ALLERGY_ADR}} + +**Source:** OPD history data +**HTML Structure:** +```html +

Drug Allergy / ADR

+
Drug Allergy Status: Known allergies
+
Drug Allergy Details: Penicillin, Aspirin
+
ADR History: Rash after penicillin
+
Current Medications: Metformin 500mg BD
+``` + +**If no data:** Empty string (not shown) + +--- + +## {{CO_MORBIDITIES}} + +**Source:** OPD history `co_morbidities` field +**HTML Structure:** +```html +

Co-Morbidities

+
Diabetes Mellitus, Hypertension, Chronic Kidney Disease
+``` + +--- + +## {{CLINICAL_INVESTIGATION_REPORTS}} + +**Source:** Lab pathology + non-pathology reports +**HTML Structure:** + +### With Pathology Matrix: +```html +

Clinical Investigation Reports

+
In-Hospital Lab:
+ + + + + + + + + + + + + +
TestFixed Normals23-05-202625-05-2026
Hemoglobin12-16 g/dL11.513.2
+``` + +### Non-Pathology Reports: +```html +
X-Ray / ECG / Sonography / CT / MRI:
+ +``` + +### Other Examinations: +```html +
Other Examinations / Provisional Diagnosis:
+Additional examination notes +
+``` + +--- + +## {{FINAL_DIAGNOSIS}} + +**Source:** `ipd_discharge_diagnosis` + `ipd_discharge_diagnosis_remark` +**HTML Structure:** +```html +

Final Diagnosis

+ +
Additional diagnosis remarks (rich text)
+``` + +--- + +## {{COURSE_IN_HOSPITAL}} + +**Source:** `ipd_discharge_course` + `ipd_discharge_course_remark` +**HTML Structure:** +```html +

Course in the hospital

+ +
Additional course remarks (rich text)
+``` + +--- + +## {{EXAMINATION_ON_DISCHARGE}} + +**Source:** Discharge examination data +**HTML Structure:** +```html +

Examination on Discharge : +BP: 130/85 mmHg, Pulse: 72 bpm, General condition: Stable +

+``` + +--- + +## {{SURGERY}} + +**Source:** `ipd_discharge_surgery` table +**HTML Structure:** +```html +

Surgery

+ + + + + + + + + + + +
NameDateRemark
Laparoscopy05-06-2026I & D WITH L. N. EXCISION DONE UNDER GA
+``` + +**Alternative format (if no table structure):** +```html +

Surgery

+ +``` + +--- + +## {{PROCEDURE}} + +**Source:** `ipd_discharge_procedure` table +**HTML Structure:** +```html +

Procedure

+ + + + + + + + + + + +
NameDateRemark
Procedure TEST03-06-2026
+``` + +--- + +## {{DISCHARGE_MEDICATIONS}} + +**Source:** `ipd_discharge_prescrption_prescribed` or `ipd_discharge_drug` + +### Format 1 (New prescriptions with full details): +```html +

Discharge Medications

+ + + + + + + + + + + + + + + +
#MedicineQtyDaysNotes
1Tab Paracetamol 500mg305 days1-0-1 After Food
+``` + +### Format 2 (Simple drug list): +```html +

Discharge Medications

+
    +
  1. Paracetamol 500mg [5 days]
  2. +
  3. Amoxicillin 250mg [7 days]
  4. +
+``` + +--- + +## {{DIETARY_ADVICE}} + +**Source:** Dietary master data selected for patient +**HTML Structure:** +```html +
Dietary Advice:
+
    +
  1. High Protein Diet: Include eggs, chicken, fish, pulses
  2. +
  3. Avoid Spicy Food: No chilli, pepper, masala
  4. +
  5. Low Salt: Reduce salt intake to less than 5g per day
  6. +
+``` + +**If no data:** Empty string (not shown) + +--- + +## {{DISCHARGE_INSTRUCTIONS}} + +**Source:** `ipd_discharge_instructions` table +**HTML Structure:** +```html +

Discharge Advice/Instructions/Summary

+ + +
Dietary Advice:
+
    +
  1. Low Fat: Avoid fried foods
  2. +
+ + +
Other Advice: Take adequate rest
+ + +
+ Additional discharge instructions and advice text (can contain HTML formatting) +
+ + +
Review after 7 Days (14-06-2026) days / as and when required
+ + +
Emergency contact information
+``` + +--- + +## {{SIGNATURE_BLOCK}} + +**Source:** Auto-generated signature table +**HTML Structure:** +```html + + + + + + + + + + + + + + +
   
___________________________________________________________________________
Signature of ConsultantSignature of Medical OfficerSignature of Receiver / Date
+``` + +--- + +## Additional Placeholders (Not in Section Content) + +### {{PATIENT_INFO_TABLE}} + +**Source:** `buildAutoDischargeSummaryTable()` +**HTML Structure:** +```html +

Discharge Summary

+ +

Leave Against Medical Advice

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameSUNITA DEVIUHIDP26061331171
Age & Gender40 Year / FemaleIPD No.A26061007144
GuardianWife of JOGENDRA KUMARAdmission04-06-2026
Phone No.9520497324Discharge07-06-2026
AddressMALDHAN*****Org. NameDirect
DepartmentGeneral Surgery
+
+``` + +--- + +## Style Guidelines + +### Common CSS Classes Used: +- `margin:16px 0 8px 0` - Standard heading margins +- `margin:0 0 10px 20px` - List indentation +- `color:#475569` - Secondary/remark text color +- `border-collapse:collapse` - Table borders +- `text-align:left` - Default text alignment +- `vertical-align:middle` - Table cell alignment + +### HTML Tags Used: +- `

` - Section headers (16px top margin, 8px bottom) +- `

` - Main title headers +- `
` - Content blocks +- `