give as a detailed case presentation

Reading File
Running Command

python3 << 'EOF' import pdfplumber files = { "Clinical Summary": "/tmp/workspace/attachments/3bd3769d-5aac-4188-b3c8-84f85812ea20/Clinical_Summary_Pre_Apollo_Admission.pdf", "Discharge Summary": "/tmp/workspace/attachments/3bd3769d-5aac-4188-b3c8-84f85812ea20/DischargeSummaryDyncPrint zaitoon.pdf" } for name, path in files.items(): print(f"\n{'='*60}") print(f"FILE: {name}") print('='*60) with pdfplumber.open(path) as pdf: for i, page in enumerate(pdf.pages): text = page.extract_text() if text: print(f"\n--- Page {i+1} ---\n{text}") EOF

I now have all the information needed. Here is the detailed case presentation:

Case Presentation: Tuberculous Meningoencephalitis with Communicating Hydrocephalus


PATIENT DETAILS

NameMrs. J. Saithoon Benazir
Age / Sex41 years, Female
UHIDAC01.0005824403
AddressChennai, Tamil Nadu
Primary ConsultantDr. Dhanaraj M, MD, DM - Neurology, Apollo Hospital
Date of Admission28 May 2026
Date of Discharge20 July 2026
Duration of Stay~53 days

FINAL DIAGNOSIS

  1. Tuberculous Meningitis with Arachnoiditis and Communicating Ventriculomegaly - Status post Right VP Shunt (30/5/2026) - Status post Tracheostomy (8/6/2026)
  2. Aspiration Pneumonitis with Right lower zone opacity
  3. Old healed fracture ribs
  4. Urosepsis with Septic Shock and Septicemia
  5. Tracheitis
  6. Dyslipidemia
  7. Systemic Hypertension
  8. Diabetes Mellitus

PRESENTING COMPLAINTS

  • Fever with headache - on and off for 1 month
  • Decreased responsiveness - on and off for 1 month

HISTORY OF PRESENT ILLNESS

Prodromal Phase (20 - 30 April 2026)

Around 20 April 2026, the patient developed intermittent mild headache with mild neck stiffness. Symptoms were initially moderate and did not significantly interfere with daily activities. Between 28-30 April, she received symptomatic treatment at a local clinic for a presumed viral illness / common cold. Despite treatment, the headache and neck stiffness persisted. On the night of 30 April, she developed a sudden severe headache and went to sleep with persistent pain.

First Hospital Admission - Murugan Hospital (1 - 6 May 2026)

On 1 May, she was unable to get out of bed and developed altered sensorium. She was admitted to Murugan Hospital, electively intubated for MRI Brain, and monitored in ICU.
  • MRI Brain: Small acute infarct in the right putamen
  • CSF: Negative for bacterial, viral, fungal, tuberculous, and autoimmune causes
  • Empirical treatment for meningoencephalitis was initiated
  • GCS improved to 15/15; discharged on 6 May with oral medications

Home Course (7 - 12 May 2026)

She developed intermittent fever, persistent headache, poor sleep, and restlessness. Around 10-11 May, she reported blurred ("misty") vision in the left eye.

Second Hospital Admission (13 - 20 May 2026)

Readmitted on 13 May. MRI Brain (14 May) suggested demyelination. She received:
  • IV Methylprednisolone (Solu-Medrol)
  • Repeat CSF evaluation
  • Supportive care
Fever and neck stiffness improved. Discharged on 20 May with oral steroids; follow-up planned for 26 May.

Progressive Deterioration (20 - 27 May 2026)

Persistent insomnia, intermittent fever, weakness, and increasing confusion developed. By 26 May, she became progressively drowsy, unable to stand, with recurrent altered sensorium. MRI showed progressive ventriculomegaly / hydrocephalus. On 27 May, she required intubation and mechanical ventilation. TB meningitis with hydrocephalus was suspected.

Transfer to Apollo Hospital (28 May 2026)

Transferred on 28 May 2026 for advanced neurological care. Subsequent CSF rapid molecular testing demonstrated trace positivity for Mycobacterium tuberculosis (CSF Xpert MTB). Anti-tubercular therapy (ATT) was initiated on 29 May 2026.

PAST MEDICAL HISTORY

ConditionStatus
Diabetes MellitusYes
HypertensionYes
Coronary Artery DiseaseNo
AsthmaNo
Prior surgeriesNil

SOCIAL HISTORY

  • Smoking: No
  • Alcohol: No
  • Family history: Nil significant

GENERAL EXAMINATION (at admission to Apollo)

  • Pulse: 83/min
  • Blood Pressure: 168/100 mmHg
  • Temperature: Febrile
  • Pallor / Cyanosis / Clubbing / Icterus / Lymphadenopathy: Nil
  • Oedema feet: Nil
  • Functional status: Dependent

Systemic Examination

  • CVS: S1 S2 heard, no murmurs
  • RS: Bilateral vesicular breath sounds present
  • Abdomen: Soft, bowel sounds present
  • Neurological: Decreased sensorium, intubated and ventilated on admission

INVESTIGATIONS

Haematology

ParameterOn AdmissionNadir/Notable Values
Haemoglobin8.7 g/dLLowest: 6.1 g/dL (6/6/26)
PCV31%Lowest: 21%
WBC14.31 x 10³/mm³ (leukocytosis)13.66 x 10³/mm³ (persisted)
PlateletsNormalThrombocytopenia 90 x 10³/mm³ (8/6/26)
  • Peripheral smear: Microcytic hypochromic RBCs with marked anisocytosis, few elliptocytes; neutrophilic leukocytosis; mildly reduced platelets

Biochemistry

ParameterValueSignificance
Serum Sodium128 mEq/LHyponatremia
Serum Calcium8.2 mg/dLHypocalcemia
Random Blood Sugar178 mg/dLRaised
HbA1c6.5%Raised
Serum Albumin2.55 g/dL (nadir)Hypoalbuminemia
Total Protein4.77 g/dL (nadir)Hypoproteinemia
SGPT150 U/L (peak)Raised - ATT hepatotoxicity
SGOT85 U/LRaised
Alkaline Phosphatase154 U/LRaised
GGTP61 U/LRaised
Total Bilirubin2.03 mg/dLRaised
LDL104 mg/dLRaised
Triglycerides233 mg/dLRaised
HDL32 mg/dLLow
TSH0.128 µIU/mLLow (sick euthyroid vs. hyperthyroid)
Free T31.08 pg/mLLow
Free T40.74 ng/dLLow
Serum AmmoniaNormal
PT/INR1.46 (raised 6/6/26)Coagulopathy
BD-Glucan19.3 pg/mLRaised - fungal marker
HIV 1 & 2Negative

CSF Analysis (at Apollo admission, 28-29 May 2026)

ParameterValue
Opening Pressure25 cmH₂O (raised)
Protein152.5 mg/dL (raised)
Sugar35 mg/dL (low; blood sugar ratio <0.5)
RBC100 cells
WBC225 cells
Cell differential74% lymphocytes, 26% neutrophils
AFB smearNo AFB seen
CryptococcusNegative
CSF Xpert MTB (GeneXpert)Detected (trace positive)
Bacterial cultureNo growth
Viral panel (HSV 1&2, meningoencephalitis panel)Not detected
Autoimmune encephalitis panel (CSF + serum)Negative
CytologyNegative for malignancy
AFB culture / Fungal cultureAwaited
Post-VP Shunt CSF (post-operative):
  • Protein: 77 mg/dL (decreased)
  • Sugar: 55 mg/dL (normalized)
  • WBC: 30 cells (98% lymphocytes, 2% neutrophils) - improvement

Microbiology / Cultures

SampleResult
Blood culture (admission)No growth
Blood culture (3/6/26 - fever episode)No growth
Blood culture (5/6/26 - septic shock)Pseudomonas aeruginosa (pan-sensitive)
Urine culture (3/6/26)Candida albicans
ET (endotracheal) culture (3/6/26)Pseudomonas aeruginosa + Klebsiella pneumoniae (pan-sensitive)
Urine culture (admission)Insignificant growth of Enterococci

IMAGING

CT Brain with contrast (28-29 May 2026)

  • Mild leptomeningeal enhancement involving bilateral Sylvian fissures, perimesencephalic region (pons and midbrain), and ventral medulla - most suspicious for leptomeningitis/meningoencephalitis
  • Bilateral subcortical and confluent periventricular white matter hypodensities in frontoparietal and frontoparieto-occipital regions (differential: interstitial CSF seepage / chronic microvascular ischemic change)
  • Mild communicating ventriculomegaly (lateral and third ventricles) - Evans index 0.35

MRI Brain + Spine with contrast (6/6/2026)

  • FLAIR hyperintensities in basal cisterns
  • Diffuse enhancing smooth leptomeningeal and subpial thickening
  • Dilated bilateral lateral and third ventricles with subependymal edema
  • Minimal intraventricular exudates in right occipital horn
  • Diffuse smooth thickening and enhancement of the dural sac and leptomeninges at cervical, dorsal, and lumbar levels
  • Leptomeningeal enhancement along surface of conus medullaris
  • Cauda equina nerve roots: mildly thickened and enhancing
  • Features: Persisting meningitis with arachnoiditis changes

Serial CT Brain (post-shunt follow-up)

DateFindings
1/6/26 (post-op day 2)Evans index 0.32 (from 0.35); minimal intraventricular haemorrhage (new finding)
13/6/26Mild increase in hydrocephalus; VP shunt in situ, tip in left lateral ventricle; periventricular white matter hypodensities
17/6/26Evans index 0.31; decrease in hydrocephalus; bilateral subcortical hypodense areas frontoparietal regions
4/7/26Significant reduction of ventricular dilatation; VP shunt in situ; no new findings; no haemorrhage

MRI Brain with contrast (20/6/2026)

  • Diffuse enhancing smooth leptomeningeal/subpial thickening in basal cisterns (persisting)
  • Dilated ventricles with subependymal edema
  • Microhemorrhages in hypothalamus and right cerebral peduncle (new finding)
  • No acute infarcts
  • Reduction in hydrocephalus

MRI Brain + Cervical/Whole Spine with contrast (17/7/2026 - pre-discharge)

  • Mild patchy leptomeningeal enhancement involving dorsal and lumbar spine
  • Clumping of cauda equina nerve roots - consistent with adhesive arachnoiditis and radiculitis
  • Compared to 6/6/2026: No significant interval change
  • Brain: No acute infarction; mildly increased patchy meningeal thickening; reduction in hydrocephalus; VP shunt in situ

Other Imaging

  • Chest X-ray: Cardiomegaly; bilateral apical pleural thickening; bilateral dense infiltrates with right lower zone patchy interstitial pneumonitis; bilateral minimal pleural effusion; old healed rib fractures
  • Ultrasound Abdomen: Grade 1 fatty liver; cholelithiasis; bilateral minimal pleural effusion; VP shunt tip in right iliac fossa with 4cc pericatheter collection
  • Echocardiogram: Normal LV function, EF 60%
  • Venous Doppler (left upper limb): No DVT; diffuse subcutaneous edema
  • VEP (Visual Evoked Potentials): Non-recordable on right side; moderate anterior visual pathway dysfunction on left side

Electroencephalography (EEG)

  • Admission EEG: Abnormal - bilateral diffuse dysfunction
  • 12/6/26 EEG: Abnormal - evidence of metabolic encephalopathy (triphasic waves)
  • 20/6/26 EEG: Abnormal - moderate bilateral diffuse dysfunction

SURGICAL PROCEDURE

Right Ventriculoperitoneal (VP) Shunt - 30 May 2026
  • Valve: Surgilinear dome valve, medium pressure
  • Technique: Under ETGA; patient supine; right Keen's point curvilinear incision; burr hole made; dura cauterized; right hypochondrium horizontal incision; subcutaneous tunnelling; CSF noted at high pressure; shunt connected via dome valve; haemostasis; layered closure; stapled skin
  • Post-operative course: Uneventful
Tracheostomy - 8 June 2026 (by ENT surgeon); Post-procedure: Uneventful
  • Tracheostomy tube downsized (8→6) on 9 July 2026
  • Failed first capping trial (10/7/2026) due to O₂ desaturation to 90%
  • Successful decannulation on 13 July 2026 with tracheostomy closure

HOSPITAL COURSE AND MANAGEMENT

Phase 1: Admission and Stabilization (28-30 May 2026)

The patient was admitted to MDCCU in intubated, ventilated state with altered sensorium. CSF Xpert MTB confirmed TB meningitis. Anti-tubercular therapy (ATT) was initiated on 29 May 2026 with Tab. Rcinex (Rifampicin + Isoniazid), Tab. Combutol (Ethambutol), Tab. Pyzina (Pyrazinamide), along with Inj. Dexamethasone. Given communicating hydrocephalus with raised ICP, neurosurgery was consulted and a right VP shunt was performed on 30 May 2026. Tab. Diamox was added initially but later stopped due to respiratory alkalosis with compensating metabolic acidosis.

Phase 2: Septic Complications (1-10 June 2026)

The patient developed fever and tachycardia on 3 June. Cultures revealed:
  • Urine: Candida albicans
  • ET secretions: Pseudomonas aeruginosa + Klebsiella pneumoniae (pan-sensitive)
On 5 June, she developed septic shock (tachypnea, tachycardia, hypotension) with haemoglobin drop to 7.7 g/dL. Blood culture grew Pseudomonas aeruginosa. She was managed with:
  • Inj. Targocid (Teicoplanin), Inj. Tigecycline, Inj. Caspofungin (for fungal cover given raised BD-glucan)
  • Inj. Noradrenaline + Vasopressin (vasopressors)
  • Inj. Hydrocortisone infusion (sepsis protocol)
  • Inj. Isoalbumin infusion
  • 2 units PRBC transfused (nadir Hb 6.1 g/dL on 6/6/26)
  • Infectious Disease Specialist guidance followed throughout
Tracheostomy was performed on 8 June 2026 given prolonged ventilator dependence. The patient was shifted to the Tracheostomy ward on 10 June 2026 as she tolerated T-piece.

Phase 3: Neurological Monitoring and ATT Hepatotoxicity (11 June - 20 June 2026)

The patient remained drowsy on 11-12 June. EEG showed metabolic encephalopathy (triphasic waves). Levetiracetam (Levipil) was escalated to 1g IV BD. Metabolic derangements were corrected: hypokalemia, hypocalcemia, hypophosphatemia, hyponatremia. Calcium, protein, and phosphorus supplementation were initiated.
CT Brain (13 June): Minimal increase in hydrocephalus compared to prior.
Ecchymosis developed on 15 June; coagulation screen was normal (spontaneous resolution).
Raised liver enzymes (SGPT peak 150 U/L on 18/6) were attributed to ATT hepatotoxicity, and the Infectious Disease Specialist advised reducing Pyrazinamide from 1750 mg to 1250 mg daily and adding Tab. Udiliv 300 mg BD (ursodeoxycholic acid). MRI Brain (20 June) revealed new microhemorrhages in hypothalamus and right cerebral peduncle.

Phase 4: Rehabilitation and Decannulation (21 June - 20 July 2026)

The patient received:
  • Intensive chest and limb physiotherapy
  • Glycemic optimization (Diabetology)
  • Dermatology management for intertrigo (bilateral axillae, inframammary, groin regions) with Fusidic acid cream and Tab. Dazit 10 mg BD
  • Dexamethasone gradually tapered from 6 mg TDS to 4 mg OD (Inj. Dexa) then converted to oral Wysolone on discharge
Ophthalmology review (22 June): No menace reflexes bilaterally. VEP (pre-discharge): Non-recordable right side, moderate anterior visual pathway dysfunction left side - consistent with optic pathway involvement from TBM.
CT Brain (4 July 2026): Significant reduction in ventricular dilatation; VP shunt in situ; no new findings.
Tracheostomy decannulation successfully completed on 13 July 2026. MRI Brain and spine (17 July 2026): Persistent leptomeningeal enhancement and arachnoiditis; no acute infarction; reduction in hydrocephalus.
Multidisciplinary team (Neurosurgery, ENT, Diabetology, Infectious Diseases) reviewed and agreed the patient was clinically stable for discharge.

MULTIDISCIPLINARY TEAM INVOLVED

Neurology (primary) | Neurosurgery | Pulmonology | Infectious Disease | Medical Gastroenterology | Gynecology | Diabetology | Cardiology | ENT | Ophthalmology | Dermatology

CONDITION AT DISCHARGE

  • Vitals: Stable, afebrile, hemodynamically stable
  • GCS: 15/15
  • Motor power: Both upper limbs 4/5; Both lower limbs 1-2/5 (residual limb weakness)
  • Tracheostomy: Decannulated and closed (13/7/26)
  • VP Shunt: In situ, functioning
  • Vision: Impaired (VEP abnormal bilaterally)
  • Neurological status: Status quo - no significant interval change in higher functions or limb power at discharge

DISCHARGE MEDICATIONS

Anti-Tubercular Therapy

  • Tab. R-Cinex (Rifampicin 600/Isoniazid 300 mg) OD - till 28/7/26
  • Tab. Combutol (Ethambutol) 1 g OD - till 28/7/26
  • Tab. Pyzina (Pyrazinamide) 1250 mg OD - till 28/7/26
  • Tab. Benadon (Pyridoxine 40 mg) OD - continue till review (neuroprotection against INH)

Steroids (tapering schedule)

  • Tab. Wysolone 30 mg OD x 1 week → 20 mg x 3 days → 10 mg x 2 days → 5 mg x 2 days → stop

Anticonvulsant

  • Tab. Levipil (Levetiracetam) 500 mg BD

Antihypertensive

  • Tab. Telma (Telmisartan) 40 mg OD

Anticoagulation

  • Inj. Clexane (Enoxaparin) 40 mg SC OD - continue till review

Antidiabetic

  • Inj. Lupisulin 30/70 SC 6 units before breakfast; monitor for hypoglycemia

Liver Protection

  • Tab. Udiliv (UDCA) 300 mg BD

Gastroprotection / Bone

  • Tab. Pan (Pantoprazole) 40 mg BD
  • Tab. Shelcal (Calcium carbonate 500 mg) OD

Neurological

  • Tab. Modalert (Modafinil 200 mg) OD (for hypersomnia/drowsiness)

Nutritional Support

  • NoviMeal High Protein Powder 1 scoop in 100 mL water TDS
  • Diet: 1800 kcal, 90 g protein, 6 g salt, low fat, low cholesterol, low purine - diabetic RT feeds at 50 mL/hr

Skin/Wound Care

  • Fusidic acid cream (intertrigo)
  • Tab. Dazit (Desloratadine 10 mg) BD (intertrigo)
  • Dermocalm Lotion BD
  • Cetaphil Pro Urea 4% Lotion BD
  • Dersol 12% Ointment (foot) OD
  • Cap. Becozymes OD (multivitamin)
  • Syp. Cremafin 15 mL BD (laxative)

FOLLOW-UP PLAN

TeamTimeframe
Neurology (Dr. Dhanaraj)After 15 days as OPD with prior appointment
Cardiology (Dr. K.P. Pramodkumar)After 15 days
Diabetology (Dr. Shantharam)After 3 days with fasting and postprandial glucose reports
Infectious Diseases (Dr. Senthur Nambi)28 July 2026 - for ATT continuation and monitoring
ENTIf breathing difficulty or stridor develops
PhysiotherapyContinue intensive chest and limb physiotherapy and rehabilitation
Neurosurgery advice: Continue VP shunt pumping twice daily (20 pumps/session); review after 2 weeks.
ENT advice: Alternate-day dressing of tracheostomy closure site for 3 weeks (normal saline + T-Bact ointment); ENT review after 3 weeks.
Red flag symptoms for emergency (1066): Fever >101°F, new/worsening pain, vomiting, breathing difficulty, altered sensorium, worsening neurological deficit.

CLINICAL SUMMARY / LEARNING POINTS

This is a case of subacute TB meningoencephalitis with communicating hydrocephalus in a middle-aged diabetic woman, illustrating several key challenges:
  1. Delayed diagnosis - The patient was treated empirically for viral meningoencephalitis and demyelination across two prior hospitalizations before definitive CSF Xpert MTB confirmed TBM at Apollo - highlighting the diagnostic difficulty of TBM mimicking other conditions.
  2. Steroid paradox - IV methylprednisolone was given for presumed demyelination, temporarily improving symptoms, before the true diagnosis was established.
  3. Hydrocephalus management - Communicating hydrocephalus (Evans index 0.35) required surgical VP shunt; gradual reduction to 0.31 with adequate CSF diversion was demonstrated on serial CT.
  4. Extensive arachnoiditis - MRI demonstrated pan-spinal arachnoiditis with cauda equina clumping, explaining the lower limb weakness (1-2/5) at discharge.
  5. ATT hepatotoxicity - Pyrazinamide-related liver enzyme elevation (SGPT peak 150 U/L) necessitated dose reduction and hepatoprotective therapy.
  6. Optic pathway involvement - Absent menace reflexes and VEP abnormality bilaterally indicate anterior visual pathway dysfunction, a recognized complication of TBM.
  7. Hospital-acquired infections - Urosepsis (Candida), ventilator-associated pneumonia (Pseudomonas + Klebsiella), and septic shock complicated the course, requiring broad-spectrum antimicrobials and antifungals.
  8. Multidisciplinary care - Nine specialties were involved, reflecting the systemic complexity of severe TBM in a patient with diabetes and hypertension as co-morbidities.

Generate a clinical summary document for referral or teaching purposes

Reading File
Running Command

mkdir -p /tmp/workspace/tbm-case && python3 << 'PYEOF' from docx import Document from docx.shared import Pt, Inches, RGBColor, Cm from docx.enum.text import WD_ALIGN_PARAGRAPH from docx.enum.table import WD_TABLE_ALIGNMENT, WD_ALIGN_VERTICAL from docx.oxml.ns import qn from docx.oxml import OxmlElement import copy doc = Document() # ── Page margins ────────────────────────────────────────────────────────────── section = doc.sections[0] section.top_margin = Cm(2.0) section.bottom_margin = Cm(2.0) section.left_margin = Cm(2.2) section.right_margin = Cm(2.2) # ── Default style ───────────────────────────────────────────────────────────── normal = doc.styles["Normal"] normal.font.name = "Calibri" normal.font.size = Pt(10.5) # ── Helper: set cell shading ────────────────────────────────────────────────── def shade_cell(cell, fill_hex): tc = cell._tc tcPr = tc.get_or_add_tcPr() shd = OxmlElement("w:shd") shd.set(qn("w:val"), "clear") shd.set(qn("w:color"), "auto") shd.set(qn("w:fill"), fill_hex) tcPr.append(shd) def set_cell_border(cell, **kwargs): tc = cell._tc tcPr = tc.get_or_add_tcPr() tcBorders = OxmlElement("w:tcBorders") for edge in ("top","left","bottom","right","insideH","insideV"): if edge in kwargs: tag = OxmlElement(f"w:{edge}") tag.set(qn("w:val"), kwargs[edge].get("val","single")) tag.set(qn("w:sz"), kwargs[edge].get("sz","4")) tag.set(qn("w:space"), "0") tag.set(qn("w:color"), kwargs[edge].get("color","auto")) tcBorders.append(tag) tcPr.append(tcBorders) def add_table_header_row(table, headers, fill="1F4E79"): row = table.rows[0] for i, h in enumerate(headers): cell = row.cells[i] cell.text = "" p = cell.paragraphs[0] run = p.add_run(h) run.bold = True run.font.color.rgb = RGBColor(0xFF, 0xFF, 0xFF) run.font.size = Pt(10) p.alignment = WD_ALIGN_PARAGRAPH.CENTER shade_cell(cell, fill) def add_data_row(table, values, shade=None, bold_first=False): row = table.add_row() for i, v in enumerate(values): cell = row.cells[i] p = cell.paragraphs[0] run = p.add_run(str(v)) run.font.size = Pt(10) if bold_first and i == 0: run.bold = True if shade: shade_cell(cell, shade) return row # ══════════════════════════════════════════════════════════════════════════════ # HEADER BANNER # ══════════════════════════════════════════════════════════════════════════════ banner_tbl = doc.add_table(rows=1, cols=1) banner_tbl.alignment = WD_TABLE_ALIGNMENT.CENTER banner_cell = banner_tbl.cell(0, 0) shade_cell(banner_cell, "1F4E79") bp = banner_cell.paragraphs[0] bp.alignment = WD_ALIGN_PARAGRAPH.CENTER r1 = bp.add_run("CLINICAL CASE SUMMARY") r1.bold = True r1.font.size = Pt(16) r1.font.color.rgb = RGBColor(0xFF, 0xFF, 0xFF) bp.add_run("\n") r2 = bp.add_run("Tuberculous Meningoencephalitis with Communicating Hydrocephalus") r2.font.size = Pt(11) r2.font.color.rgb = RGBColor(0xBD, 0xD7, 0xEE) doc.add_paragraph() # spacer # ══════════════════════════════════════════════════════════════════════════════ # SECTION HELPER # ══════════════════════════════════════════════════════════════════════════════ def section_heading(text, color_hex="1F4E79"): p = doc.add_paragraph() p.paragraph_format.space_before = Pt(10) p.paragraph_format.space_after = Pt(2) run = p.add_run(f" {text} ") run.bold = True run.font.size = Pt(11) run.font.color.rgb = RGBColor(0xFF, 0xFF, 0xFF) # paragraph shading pPr = p._p.get_or_add_pPr() shd = OxmlElement("w:shd") shd.set(qn("w:val"), "clear") shd.set(qn("w:color"), "auto") shd.set(qn("w:fill"), color_hex) pPr.append(shd) return p def sub_heading(text): p = doc.add_paragraph() p.paragraph_format.space_before = Pt(6) p.paragraph_format.space_after = Pt(1) run = p.add_run(text) run.bold = True run.font.size = Pt(10.5) run.font.color.rgb = RGBColor(0x1F, 0x4E, 0x79) return p def body_para(text, italic=False, bullet=False): p = doc.add_paragraph() p.paragraph_format.space_after = Pt(2) if bullet: p.style = doc.styles["List Bullet"] run = p.add_run(text) run.font.size = Pt(10.5) run.italic = italic return p def kv_pair(label, value): p = doc.add_paragraph() p.paragraph_format.space_after = Pt(1) r1 = p.add_run(f"{label}: ") r1.bold = True r1.font.size = Pt(10.5) r2 = p.add_run(value) r2.font.size = Pt(10.5) return p # ══════════════════════════════════════════════════════════════════════════════ # 1. PATIENT INFORMATION # ══════════════════════════════════════════════════════════════════════════════ section_heading("1. PATIENT INFORMATION") doc.add_paragraph() pt_tbl = doc.add_table(rows=1, cols=4) pt_tbl.style = "Table Grid" add_table_header_row(pt_tbl, ["Field", "Details", "Field", "Details"], fill="2E75B6") rows_data = [ ("Name", "Mrs. J. Saithoon Benazir", "UHID", "AC01.0005824403"), ("Age / Sex", "41 years, Female", "Patient ID", "CMHIP525038"), ("Date of Admission", "28 May 2026", "Date of Discharge", "20 July 2026"), ("Duration of Stay", "~53 days", "Ward", "1st Floor, Transit, TR122"), ("Primary Consultant","Dr. Dhanaraj M, MD, DM (Neurology)","Hospital", "Apollo Hospital, Chennai"), ("Blood Group", "O Positive", "Allergies", "Not known"), ] for i, (f1, v1, f2, v2) in enumerate(rows_data): row = pt_tbl.add_row() fill = "EBF3FB" if i % 2 == 0 else "FFFFFF" for ci, txt in enumerate([f1, v1, f2, v2]): cell = row.cells[ci] p = cell.paragraphs[0] run = p.add_run(txt) run.font.size = Pt(10) if ci in (0, 2): run.bold = True shade_cell(cell, fill) doc.add_paragraph() # ══════════════════════════════════════════════════════════════════════════════ # 2. FINAL DIAGNOSES # ══════════════════════════════════════════════════════════════════════════════ section_heading("2. FINAL DIAGNOSES") doc.add_paragraph() dx_tbl = doc.add_table(rows=1, cols=2) dx_tbl.style = "Table Grid" add_table_header_row(dx_tbl, ["#", "Diagnosis"], fill="2E75B6") dx_list = [ ("1 (PRIMARY)", "Tuberculous Meningitis with Arachnoiditis and Communicating Ventriculomegaly\n" " • Status post Right VP Shunt (30 May 2026)\n" " • Status post Tracheostomy (8 June 2026)"), ("2", "Aspiration Pneumonitis with Right Lower Zone Opacity"), ("3", "Urosepsis with Septic Shock and Septicemia"), ("4", "Tracheitis"), ("5", "Old Healed Rib Fractures"), ("6", "Systemic Hypertension"), ("7", "Diabetes Mellitus"), ("8", "Dyslipidemia"), ] for i, (num, diag) in enumerate(dx_list): row = dx_tbl.add_row() fill = "EBF3FB" if i % 2 == 0 else "FFFFFF" c0 = row.cells[0] c1 = row.cells[1] p0 = c0.paragraphs[0] run0 = p0.add_run(num) run0.bold = True run0.font.size = Pt(10) p1 = c1.paragraphs[0] run1 = p1.add_run(diag) run1.font.size = Pt(10) if i == 0: run1.bold = True shade_cell(c0, fill) shade_cell(c1, fill) doc.add_paragraph() # ══════════════════════════════════════════════════════════════════════════════ # 3. PRESENTING COMPLAINT & BACKGROUND # ══════════════════════════════════════════════════════════════════════════════ section_heading("3. PRESENTING COMPLAINTS & BACKGROUND") doc.add_paragraph() kv_pair("Presenting Complaints", "Fever with headache (on and off, 1 month); Decreased responsiveness (on and off, 1 month)") kv_pair("Co-morbidities", "Diabetes Mellitus, Systemic Hypertension") kv_pair("Smoking / Alcohol", "None") kv_pair("Surgical History", "Nil prior to this admission") kv_pair("Family History", "Nil significant") doc.add_paragraph() # ══════════════════════════════════════════════════════════════════════════════ # 4. TIMELINE OF ILLNESS # ══════════════════════════════════════════════════════════════════════════════ section_heading("4. TIMELINE OF ILLNESS (PRE-APOLLO)") doc.add_paragraph() tl_tbl = doc.add_table(rows=1, cols=3) tl_tbl.style = "Table Grid" add_table_header_row(tl_tbl, ["Period", "Phase", "Key Events"], fill="2E75B6") tl_data = [ ("20 – 30 Apr 2026", "Prodromal", "Intermittent headache + neck stiffness; treated at local clinic as viral illness; sudden severe headache night of 30 Apr"), ("1 – 6 May 2026", "1st Admission\n(Murugan Hospital)", "Altered sensorium; elective intubation for MRI; MRI: small right putamen infarct; CSF: all causes negative; treated empirically for meningoencephalitis; discharged GCS 15/15"), ("7 – 12 May 2026", "Home Course", "Intermittent fever, persistent headache, restlessness; blurred/misty vision left eye (10–11 May)"), ("13 – 20 May 2026", "2nd Admission\n(Murugan Hospital)", "MRI: demyelination pattern; IV methylprednisolone; CSF repeated; improved; discharged on oral steroids"), ("20 – 27 May 2026", "Progressive\nDeterioration", "Increasing confusion, drowsiness, inability to stand; MRI: progressive ventriculomegaly/hydrocephalus; intubated 27 May; TB meningitis suspected"), ("28 May 2026", "Transfer", "Transferred to Apollo Hospital for advanced neurological care; CSF Xpert MTB detected (trace positive); ATT commenced 29 May"), ] for i, (period, phase, events) in enumerate(tl_data): row = tl_tbl.add_row() fill = "EBF3FB" if i % 2 == 0 else "FFFFFF" for ci, txt in enumerate([period, phase, events]): cell = row.cells[ci] p = cell.paragraphs[0] run = p.add_run(txt) run.font.size = Pt(10) if ci < 2: run.bold = True shade_cell(cell, fill) doc.add_paragraph() # ══════════════════════════════════════════════════════════════════════════════ # 5. EXAMINATION AT APOLLO ADMISSION # ══════════════════════════════════════════════════════════════════════════════ section_heading("5. EXAMINATION AT APOLLO ADMISSION") doc.add_paragraph() ex_tbl = doc.add_table(rows=1, cols=4) ex_tbl.style = "Table Grid" add_table_header_row(ex_tbl, ["Parameter", "Finding", "Parameter", "Finding"], fill="2E75B6") ex_data = [ ("Pulse", "83/min", "BP", "168/100 mmHg"), ("Temperature", "Febrile", "Sensorium", "Altered (intubated/ventilated)"), ("CVS", "S1 S2 heard", "Respiratory", "Bilateral vesicular breath sounds"), ("Abdomen", "Soft, BS present", "Pallor/Icterus", "Nil"), ("Oedema", "Nil", "Lymphadenopathy","Nil"), ("Functional", "Fully dependent", "Cyanosis/Clubbing","Nil"), ] for i, (f1, v1, f2, v2) in enumerate(ex_data): row = ex_tbl.add_row() fill = "EBF3FB" if i % 2 == 0 else "FFFFFF" for ci, txt in enumerate([f1, v1, f2, v2]): cell = row.cells[ci] p = cell.paragraphs[0] run = p.add_run(txt) run.font.size = Pt(10) if ci in (0, 2): run.bold = True shade_cell(cell, fill) doc.add_paragraph() # ══════════════════════════════════════════════════════════════════════════════ # 6. KEY INVESTIGATIONS # ══════════════════════════════════════════════════════════════════════════════ section_heading("6. KEY INVESTIGATIONS") doc.add_paragraph() # 6A CSF sub_heading("A. CSF Analysis (Apollo Admission — 28–29 May 2026)") csf_tbl = doc.add_table(rows=1, cols=3) csf_tbl.style = "Table Grid" add_table_header_row(csf_tbl, ["Parameter", "Result", "Significance"], fill="2E75B6") csf_data = [ ("Opening Pressure", "25 cmH₂O", "Raised (normal <20)"), ("Protein", "152.5 mg/dL", "Markedly raised (normal 15–45)"), ("Glucose", "35 mg/dL (blood glucose ~178)","Low CSF:blood ratio (<0.5)"), ("WBC count", "225 cells/µL", "Pleocytosis"), ("Cell differential","74% lymphocytes, 26% neutrophils","Lymphocytic predominance"), ("RBC", "100 cells", "Traumatic tap vs. haemorrhage"), ("CSF Xpert MTB", "DETECTED (trace positive)", "Confirms TBM — KEY finding"), ("AFB smear", "No AFB seen", "Expected in TBM (low sensitivity)"), ("Cryptococcus", "Negative", "Alternate excluded"), ("Autoimmune panel", "Negative (CSF + serum)", "Autoimmune encephalitis excluded"), ("HSV 1&2 PCR", "Not detected", "Viral encephalitis excluded"), ("Meningoencephalitis panel", "Not detected", "Bacterial/viral causes excluded"), ("Malignant cells", "Negative", "Leptomeningeal carcinomatosis excluded"), ("Culture", "No growth", "Awaiting AFB/fungal culture"), ] for i, (p, r, s) in enumerate(csf_data): row = csf_tbl.add_row() fill = "FFF2CC" if p == "CSF Xpert MTB" else ("EBF3FB" if i % 2 == 0 else "FFFFFF") for ci, txt in enumerate([p, r, s]): cell = row.cells[ci] para = cell.paragraphs[0] run = para.add_run(txt) run.font.size = Pt(10) if ci == 0 or p == "CSF Xpert MTB": run.bold = True shade_cell(cell, fill) doc.add_paragraph() # 6B Haematology sub_heading("B. Haematology — Key Values") hb_tbl = doc.add_table(rows=1, cols=4) hb_tbl.style = "Table Grid" add_table_header_row(hb_tbl, ["Parameter", "Admission", "Nadir / Peak", "Trend"], fill="2E75B6") hb_data = [ ("Haemoglobin (g/dL)", "8.7", "6.1 (6/6/26)", "Improved to 10–11 with transfusion"), ("PCV (%)", "31", "21 (6/6/26)", "Improved with PRBC"), ("WBC (×10³/mm³)", "14.31","13.66 (leukocytosis persisted)", "Persistent leukocytosis"), ("Platelets (×10³/mm³)", "Normal","90 (8/6/26) — thrombocytopenia", "Recovered to 110–132"), ] for i, row_data in enumerate(hb_data): row = hb_tbl.add_row() fill = "EBF3FB" if i % 2 == 0 else "FFFFFF" for ci, txt in enumerate(row_data): cell = row.cells[ci] p = cell.paragraphs[0] run = p.add_run(txt) run.font.size = Pt(10) if ci == 0: run.bold = True shade_cell(cell, fill) doc.add_paragraph() # 6C Biochemistry sub_heading("C. Biochemistry — Selected Values") bio_tbl = doc.add_table(rows=1, cols=3) bio_tbl.style = "Table Grid" add_table_header_row(bio_tbl, ["Parameter", "Notable Value", "Comment"], fill="2E75B6") bio_data = [ ("Serum Sodium", "128 mEq/L", "Hyponatremia — common in TBM (SIADH)"), ("Serum Calcium", "8.2 mg/dL", "Hypocalcemia"), ("Random Blood Sugar", "178 mg/dL", "Raised; HbA1c 6.5%"), ("Serum Albumin", "2.55 g/dL (nadir)", "Severe hypoalbuminemia"), ("SGPT", "150 U/L (peak 18/6)", "ATT hepatotoxicity — PZA dose reduced"), ("SGOT", "85 U/L", "ATT hepatotoxicity"), ("Alkaline Phosphatase","154 U/L", "Raised"), ("Total Bilirubin", "2.03 mg/dL", "Raised transiently"), ("LDL", "104 mg/dL", "Raised — dyslipidemia"), ("Triglycerides", "233 mg/dL", "Raised"), ("TSH", "0.128 µIU/mL", "Low — sick euthyroid / subclinical hyperthyroid"), ("BD-Glucan", "19.3 pg/mL", "Raised — fungal screen; antifungal added"), ("INR", "1.46 (6/6/26)", "Coagulopathy during septic phase"), ] for i, (p, v, c) in enumerate(bio_data): row = bio_tbl.add_row() fill = "EBF3FB" if i % 2 == 0 else "FFFFFF" for ci, txt in enumerate([p, v, c]): cell = row.cells[ci] para = cell.paragraphs[0] run = para.add_run(txt) run.font.size = Pt(10) if ci == 0: run.bold = True shade_cell(cell, fill) doc.add_paragraph() # 6D Microbiology sub_heading("D. Microbiology / Culture Results") mic_tbl = doc.add_table(rows=1, cols=3) mic_tbl.style = "Table Grid" add_table_header_row(mic_tbl, ["Sample (Date)", "Organism", "Significance"], fill="2E75B6") mic_data = [ ("Blood culture (admission)", "No growth", "—"), ("Urine culture (admission)", "Insignificant Enterococci", "—"), ("ET culture (3/6/26)", "Pseudomonas aeruginosa + Klebsiella pneumoniae (both pan-sensitive)", "VAP pathogens"), ("Urine culture (3/6/26)", "Candida albicans", "Fungal UTI — antifungal initiated"), ("Blood culture (5/6/26)", "Pseudomonas aeruginosa (pan-sensitive)","Bacteraemia / septic shock"), ] for i, (s, o, sig) in enumerate(mic_data): row = mic_tbl.add_row() fill = "EBF3FB" if i % 2 == 0 else "FFFFFF" for ci, txt in enumerate([s, o, sig]): cell = row.cells[ci] p = cell.paragraphs[0] run = p.add_run(txt) run.font.size = Pt(10) shade_cell(cell, fill) doc.add_paragraph() # ══════════════════════════════════════════════════════════════════════════════ # 7. IMAGING SUMMARY # ══════════════════════════════════════════════════════════════════════════════ section_heading("7. IMAGING SUMMARY") doc.add_paragraph() img_tbl = doc.add_table(rows=1, cols=3) img_tbl.style = "Table Grid" add_table_header_row(img_tbl, ["Study & Date", "Key Findings", "Action Taken"], fill="2E75B6") img_data = [ ("MRI Brain\n1 May 2026\n(Murugan Hospital)", "Small acute infarct right putamen", "Empirical meningoencephalitis treatment"), ("MRI Brain\n14 May 2026\n(2nd admission)", "Suggested demyelination pattern", "IV methylprednisolone commenced"), ("CT Brain with contrast\n28–29 May 2026\n(Apollo)", "Leptomeningeal enhancement (Sylvian fissures, perimesencephalic, ventral medulla); " "bilateral periventricular white matter hypodensities; communicating ventriculomegaly (Evans index 0.35)", "Neurosurgery consulted; VP Shunt planned"), ("CT Brain\n1 June 2026\n(Post-shunt day 2)", "Evans index 0.32 (from 0.35); new minimal intraventricular haemorrhage", "Monitored; no intervention"), ("MRI Brain + Whole Spine with contrast\n6 June 2026", "FLAIR hyperintensities basal cisterns; dilated ventricles + subependymal oedema; " "diffuse smooth leptomeningeal/dural enhancement cervical-dorsal-lumbar spine; " "cauda equina thickening and enhancement — PAN-SPINAL ARACHNOIDITIS", "Confirmed spinal involvement; continued ATT + steroids"), ("CT Brain\n13 June 2026", "Mild increase in hydrocephalus; VP shunt in situ", "Neurosurgery review; abdominal US for shunt tip"), ("CT Brain\n17 June 2026", "Evans index 0.31; decrease in hydrocephalus; bilateral subcortical frontoparietal hypodense areas", "Improvement confirmed"), ("MRI Brain with contrast\n20 June 2026", "Persisting meningitis; reduction in hydrocephalus; NEW microhemorrhages in hypothalamus and right cerebral peduncle", "Monitored; no new intervention"), ("CT Brain plain\n4 July 2026", "Significant reduction of ventricular dilatation; VP shunt in situ; no haemorrhage", "Discharge planning initiated"), ("MRI Brain + Cervical/Whole Spine\n17 July 2026\n(Pre-discharge)", "Mild patchy leptomeningeal enhancement dorsal/lumbar spine; cauda equina clumping (adhesive arachnoiditis); " "no acute infarct; no new intracranial abnormality", "Discharge planned; physiotherapy and rehabilitation advised"), ("VEP\n(Pre-discharge)", "Right: non-recordable. Left: moderate anterior visual pathway dysfunction", "Optic pathway involvement confirmed; ophthalmology follow-up"), ("EEG (serial)", "Admission: bilateral diffuse dysfunction. 12/6: metabolic encephalopathy (triphasic waves). 20/6: moderate bilateral diffuse dysfunction", "Levetiracetam escalated; metabolic correction"), ("Echo / ECG", "Normal LV function; EF 60%", "No cardiac intervention needed"), ("Chest X-ray", "Cardiomegaly; bilateral apical pleural thickening; lower zone infiltrates; bilateral pleural effusion; old rib fractures", "Pulmonology consulted; CT chest advised"), ("USG Abdomen", "Grade 1 fatty liver; cholelithiasis; minimal pleural effusion; shunt tip in right iliac fossa with 4cc pericatheter collection", "Monitored; GI consult for elevated enzymes"), ] for i, (study, findings, action) in enumerate(img_data): row = img_tbl.add_row() fill = "EBF3FB" if i % 2 == 0 else "FFFFFF" for ci, txt in enumerate([study, findings, action]): cell = row.cells[ci] p = cell.paragraphs[0] run = p.add_run(txt) run.font.size = Pt(9.5) if ci == 0: run.bold = True shade_cell(cell, fill) doc.add_paragraph() # ══════════════════════════════════════════════════════════════════════════════ # 8. PROCEDURES PERFORMED # ══════════════════════════════════════════════════════════════════════════════ section_heading("8. PROCEDURES PERFORMED") doc.add_paragraph() proc_tbl = doc.add_table(rows=1, cols=3) proc_tbl.style = "Table Grid" add_table_header_row(proc_tbl, ["Procedure", "Date", "Details / Outcome"], fill="2E75B6") proc_data = [ ("Lumbar Puncture", "28–29 May 2026", "CSF Xpert MTB detected (trace positive); high opening pressure 25 cmH₂O; confirmed TBM"), ("Right VP Shunt\n(Surgilinear dome valve, medium pressure)", "30 May 2026", "For communicating hydrocephalus (Evans index 0.35); ETGA; right Keen's point approach; " "subcutaneous tunnelling to right hypochondrium; high pressure CSF; post-op uneventful; " "Evans index improved to 0.31 by 17/6/26"), ("Tracheostomy", "8 June 2026", "For prolonged ventilator dependence; by ENT surgeon; uneventful; " "downsized 8→6 on 9/7/26; decannulated 13/7/26"), ("PRBC Transfusion\n(2 units)", "6 June 2026", "For symptomatic anaemia (Hb nadir 6.1 g/dL)"), ] for i, (proc, date, details) in enumerate(proc_data): row = proc_tbl.add_row() fill = "EBF3FB" if i % 2 == 0 else "FFFFFF" for ci, txt in enumerate([proc, date, details]): cell = row.cells[ci] p = cell.paragraphs[0] run = p.add_run(txt) run.font.size = Pt(10) if ci == 0: run.bold = True shade_cell(cell, fill) doc.add_paragraph() # ══════════════════════════════════════════════════════════════════════════════ # 9. HOSPITAL COURSE SUMMARY # ══════════════════════════════════════════════════════════════════════════════ section_heading("9. HOSPITAL COURSE — SUMMARY") doc.add_paragraph() hc_tbl = doc.add_table(rows=1, cols=3) hc_tbl.style = "Table Grid" add_table_header_row(hc_tbl, ["Phase", "Period", "Key Events & Management"], fill="2E75B6") hc_data = [ ("Phase 1\nStabilization", "28 May – 30 May", "ATT initiated (HRZE + Dexamethasone); VP Shunt 30/5; Meropenem empirically; Levetiracetam for seizure prophylaxis; " "Noradrenaline for haemodynamic support"), ("Phase 2\nSeptic Complications", "1 – 10 June", "Pseudomonas bacteraemia + Candida UTI + VAP; septic shock 5/6; Targocid + Tigecycline + Caspofungin + vasopressors; " "hydrocortisone stress protocol; 2u PRBC; tracheostomy 8/6; shifted to tracheostomy ward 10/6"), ("Phase 3\nNeurological & Hepatic", "11 – 20 June", "Metabolic encephalopathy (triphasic EEG); electrolyte correction; Levetiracetam escalated; " "ATT hepatotoxicity — PZA reduced 1750→1250 mg; Udiliv added; " "Dexa changed from hydrocort per ID team (arachnoiditis); microhemorrhages on MRI 20/6"), ("Phase 4\nRehabilitation & Decannulation", "21 June – 20 July", "Physiotherapy; glycemic optimization; intertrigo treated; Dexa tapered to OD then switched to oral Wysolone; " "VEP: anterior visual pathway dysfunction bilaterally; tracheostomy decannulation 13/7; " "CT Brain 4/7: significant ventricular reduction; MRI Spine 17/7: persisting arachnoiditis; discharged 20/7"), ] for i, (phase, period, events) in enumerate(hc_data): row = hc_tbl.add_row() fill = "EBF3FB" if i % 2 == 0 else "FFFFFF" for ci, txt in enumerate([phase, period, events]): cell = row.cells[ci] p = cell.paragraphs[0] run = p.add_run(txt) run.font.size = Pt(10) if ci < 2: run.bold = True shade_cell(cell, fill) doc.add_paragraph() # ══════════════════════════════════════════════════════════════════════════════ # 10. DISCHARGE MEDICATIONS # ══════════════════════════════════════════════════════════════════════════════ section_heading("10. DISCHARGE MEDICATIONS") doc.add_paragraph() med_tbl = doc.add_table(rows=1, cols=4) med_tbl.style = "Table Grid" add_table_header_row(med_tbl, ["Category", "Drug", "Dose / Frequency", "Duration"], fill="2E75B6") med_data = [ ("Anti-TB", "Tab. R-Cinex (Rifampicin/Isoniazid 600/300 mg)", "OD (morning)", "Till 28/7/26"), ("Anti-TB", "Tab. Combutol (Ethambutol 1 g)", "OD", "Till 28/7/26"), ("Anti-TB", "Tab. Pyzina (Pyrazinamide 1250 mg)", "OD", "Till 28/7/26"), ("Anti-TB", "Tab. Benadon (Pyridoxine B6 40 mg)", "OD", "Till review"), ("Steroid taper","Tab. Wysolone (Prednisolone)", "30 mg×1wk → 20 mg×3d → 10 mg×2d → 5 mg×2d → stop", "Tapering"), ("Anticonvulsant","Tab. Levipil (Levetiracetam 500 mg)", "BD", "Till review — do NOT stop without Neurologist advice"), ("Antihypertensive","Tab. Telma (Telmisartan 40 mg)", "OD", "Till review"), ("Anticoagulation","Inj. Clexane (Enoxaparin 40 mg) SC", "OD", "Till review"), ("Antidiabetic", "Inj. Lupisulin 30/70 SC 6 units", "Before breakfast","Monitor for hypoglycemia"), ("Hepatoprotective","Tab. Udiliv (UDCA 300 mg)", "BD", "Till review"), ("Gastroprotection","Tab. Pan (Pantoprazole 40 mg)", "BD", "Till review"), ("Calcium", "Tab. Shelcal 500 mg", "OD", "Till review"), ("CNS stimulant", "Tab. Modalert (Modafinil 200 mg)", "OD", "Till review — for hypersomnolence"), ("Nutrition", "NoviMeal High Protein Powder", "1 scoop in 100 mL TDS", "Till review"), ("Laxative", "Syp. Cremafin 15 mL", "BD", "Till review"), ("Skin (intertrigo)","Fusidic acid cream (local)", "BD", "Till review"), ("Skin (intertrigo)","Tab. Dazit (Desloratadine 10 mg)", "BD", "Till review"), ("Multivitamin", "Cap. Becozymes", "OD", "Till review"), ] for i, (cat, drug, dose, dur) in enumerate(med_data): row = med_tbl.add_row() fill = "EBF3FB" if i % 2 == 0 else "FFFFFF" for ci, txt in enumerate([cat, drug, dose, dur]): cell = row.cells[ci] p = cell.paragraphs[0] run = p.add_run(txt) run.font.size = Pt(9.5) if ci == 0: run.bold = True shade_cell(cell, fill) doc.add_paragraph() # ══════════════════════════════════════════════════════════════════════════════ # 11. CONDITION AT DISCHARGE # ══════════════════════════════════════════════════════════════════════════════ section_heading("11. CONDITION AT DISCHARGE") doc.add_paragraph() disch_tbl = doc.add_table(rows=1, cols=2) disch_tbl.style = "Table Grid" add_table_header_row(disch_tbl, ["Parameter", "Status at Discharge"], fill="2E75B6") disch_data = [ ("Vitals", "Stable, afebrile, haemodynamically stable"), ("GCS", "15/15"), ("Upper limb power", "4/5 bilaterally"), ("Lower limb power", "1–2/5 bilaterally (residual weakness — arachnoiditis)"), ("Tracheostomy", "Decannulated and closed (13 July 2026)"), ("VP Shunt", "In situ and functioning; Evans index reduced to 0.31"), ("Vision", "Impaired — VEP: non-recordable right, moderate dysfunction left (optic pathway involvement)"), ("Higher functions", "Status quo — no acute deterioration"), ("Respiratory", "Room air, no ventilatory support"), ("Nutrition", "Via Ryle's tube (RT feeds at 50 mL/hr); 1800 kcal/day"), ] for i, (param, status) in enumerate(disch_data): row = disch_tbl.add_row() fill = "EBF3FB" if i % 2 == 0 else "FFFFFF" for ci, txt in enumerate([param, status]): cell = row.cells[ci] p = cell.paragraphs[0] run = p.add_run(txt) run.font.size = Pt(10) if ci == 0: run.bold = True shade_cell(cell, fill) doc.add_paragraph() # ══════════════════════════════════════════════════════════════════════════════ # 12. FOLLOW-UP PLAN # ══════════════════════════════════════════════════════════════════════════════ section_heading("12. FOLLOW-UP PLAN") doc.add_paragraph() fu_tbl = doc.add_table(rows=1, cols=3) fu_tbl.style = "Table Grid" add_table_header_row(fu_tbl, ["Team / Specialist", "Timeframe", "Purpose"], fill="2E75B6") fu_data = [ ("Neurology — Dr. Dhanaraj M", "15 days (with prior appointment)", "ATT monitoring, seizure review, neurological status"), ("Cardiology — Dr. K.P. Pramodkumar", "15 days", "BP management, cardiac monitoring"), ("Diabetology — Dr. Shantharam", "3 days (with FBS + PPBS reports)", "Glycemic optimization"), ("Infectious Diseases — Dr. Senthur Nambi","28 July 2026", "ATT continuation, liver function monitoring"), ("ENT", "If stridor/breathing difficulty", "Tracheostomy closure site care (alt. day dressing ×3 weeks)"), ("Neurosurgery", "2 weeks", "VP shunt check (2×daily pumping — 20 pumps/session)"), ("Physiotherapy", "Ongoing", "Intensive chest + limb rehab; aspiration precautions"), ("Ophthalmology", "As required", "Visual pathway dysfunction — VEP follow-up"), ] for i, (team, time, purpose) in enumerate(fu_data): row = fu_tbl.add_row() fill = "EBF3FB" if i % 2 == 0 else "FFFFFF" for ci, txt in enumerate([team, time, purpose]): cell = row.cells[ci] p = cell.paragraphs[0] run = p.add_run(txt) run.font.size = Pt(10) if ci == 0: run.bold = True shade_cell(cell, fill) doc.add_paragraph() # ══════════════════════════════════════════════════════════════════════════════ # 13. TEACHING POINTS # ══════════════════════════════════════════════════════════════════════════════ section_heading("13. KEY TEACHING POINTS", color_hex="833C00") doc.add_paragraph() teaching_points = [ ("Diagnostic challenge of TBM", "This patient was treated for presumed viral meningoencephalitis and then demyelination across two prior hospital admissions. " "TBM was only confirmed on CSF Xpert MTB at the tertiary centre. This highlights how TBM can mimic both inflammatory/autoimmune " "and demyelinating disease, and the low sensitivity of AFB smear mandates molecular testing (Xpert MTB/RIF) early in the diagnostic workup."), ("Steroid paradox", "IV methylprednisolone given for presumed demyelination temporarily improved symptoms before the correct diagnosis was established. " "Steroids do have a role in TBM (dexamethasone reduces mortality in confirmed TBM), but empirical use for misdiagnosed TBM " "delays appropriate ATT and may mask clinical signs."), ("Communicating hydrocephalus in TBM", "Hydrocephalus is a common and serious complication of TBM, resulting from basal exudates blocking CSF resorption. " "This case required a VP shunt (Evans index 0.35 at presentation), with gradual improvement to 0.31 on serial CT. " "Acetazolamide (Diamox) was initially added but stopped due to respiratory alkalosis — an important drug interaction to remember."), ("Pan-spinal arachnoiditis", "MRI on 6 June demonstrated leptomeningeal and dural enhancement from cervical to lumbar levels with cauda equina clumping — " "a finding that explains the severe lower limb weakness (1–2/5) at discharge. Adhesive arachnoiditis is a recognized complication " "of TBM and portends a difficult rehabilitation course."), ("ATT hepatotoxicity", "Raised transaminases (SGPT peak 150 U/L) were attributed to pyrazinamide. The Infectious Disease team recommended dose reduction " "(1750→1250 mg) and ursodeoxycholic acid (Udiliv). Isoniazid and rifampicin were continued. Regular LFT monitoring during ATT is essential."), ("Anterior visual pathway involvement", "Absent menace reflexes noted at 22 June; VEP pre-discharge confirmed non-recordable responses on the right and moderate dysfunction " "on the left — consistent with optic chiasm/nerve involvement by basal meningeal exudates. This is a recognized but often under-appreciated " "complication of TBM."), ("Hospital-acquired infections (HAI) in intubated TBM", "The patient developed VAP (Pseudomonas + Klebsiella), Candida UTI, and Pseudomonas bacteraemia with septic shock — all superimposed " "on severe TBM. Management required broad-spectrum antibiotics (Tigecycline, Ceftazidime) and antifungals (Caspofungin). " "HAI surveillance and early tracheostomy (to facilitate ventilator weaning) are critical in prolonged TBM admissions."), ("Multidisciplinary care is non-negotiable", "Nine specialties were actively involved (Neurology, Neurosurgery, Pulmonology, Infectious Diseases, Gastroenterology, " "Gynaecology, Diabetology, Cardiology, ENT, Ophthalmology, Dermatology). This case illustrates the systemic complexity of severe TBM " "in a patient with diabetes and hypertension and the importance of protocolised multi-team collaboration."), ("Modafinil in TBM-related hypersomnia", "The patient had persistent drowsiness throughout the admission. Modafinil (Modalert 100 mg then 200 mg OD) was added as a " "wake-promoting agent — a pragmatic intervention in TBM with diffuse cortical dysfunction, though evidence is extrapolated from " "TBI/encephalopathy literature."), ] tp_tbl = doc.add_table(rows=1, cols=3) tp_tbl.style = "Table Grid" add_table_header_row(tp_tbl, ["#", "Point", "Clinical Lesson"], fill="833C00") for i, (point, lesson) in enumerate(teaching_points): row = tp_tbl.add_row() fill = "FFF2E8" if i % 2 == 0 else "FFFFFF" for ci, txt in enumerate([str(i+1), point, lesson]): cell = row.cells[ci] p = cell.paragraphs[0] run = p.add_run(txt) run.font.size = Pt(9.5) if ci == 1: run.bold = True shade_cell(cell, fill) doc.add_paragraph() # ══════════════════════════════════════════════════════════════════════════════ # 14. RED FLAG SYMPTOMS FOR EMERGENCY # ══════════════════════════════════════════════════════════════════════════════ section_heading("14. RED FLAG SYMPTOMS — SEEK IMMEDIATE CARE", color_hex="C00000") doc.add_paragraph() rf_tbl = doc.add_table(rows=2, cols=3) rf_tbl.style = "Table Grid" rf_items = ["Fever >101°F", "New or worsening headache", "Seizures", "Altered level of consciousness", "Breathing difficulty / stridor", "New neurological deficit or weakness"] r0 = rf_tbl.rows[0] r1 = rf_tbl.rows[1] for ci, txt in enumerate(rf_items[:3]): cell = r0.cells[ci] p = cell.paragraphs[0] run = p.add_run(txt) run.bold = True run.font.size = Pt(10) shade_cell(cell, "FFE6E6") for ci, txt in enumerate(rf_items[3:]): cell = r1.cells[ci] p = cell.paragraphs[0] run = p.add_run(txt) run.bold = True run.font.size = Pt(10) shade_cell(cell, "FFE6E6") doc.add_paragraph() p = doc.add_paragraph() run = p.add_run("Emergency Contact: Apollo Hospitals — 1066 | Enquiry & Appointment: 044-28293333") run.bold = True run.font.size = Pt(10.5) run.font.color.rgb = RGBColor(0xC0, 0x00, 0x00) p.alignment = WD_ALIGN_PARAGRAPH.CENTER doc.add_paragraph() # ══════════════════════════════════════════════════════════════════════════════ # FOOTER NOTE # ══════════════════════════════════════════════════════════════════════════════ footer_tbl = doc.add_table(rows=1, cols=1) footer_cell = footer_tbl.cell(0, 0) shade_cell(footer_cell, "EBF3FB") fp = footer_cell.paragraphs[0] fp.alignment = WD_ALIGN_PARAGRAPH.CENTER r = fp.add_run( "Document prepared for referral / teaching purposes | Apollo Hospital, Chennai | " "Compiled: August 2026 | Primary Consultant: Dr. Dhanaraj M, MD, DM (Neurology)" ) r.italic = True r.font.size = Pt(9) r.font.color.rgb = RGBColor(0x44, 0x44, 0x44) # ── Save ────────────────────────────────────────────────────────────────────── output_path = "/tmp/workspace/tbm-case/TBM_Clinical_Summary_Saithoon_Benazir.docx" doc.save(output_path) print(f"Saved: {output_path}") PYEOF

Running Command

python3 -c " from docx import Document doc = Document('/tmp/workspace/tbm-case/TBM_Clinical_Summary_Saithoon_Benazir.docx') print(f'Pages/paragraphs: {len(doc.paragraphs)}, Tables: {len(doc.tables)}') # Verify key sections present text_sample = ' '.join([p.text for p in doc.paragraphs[:30]]) print(text_sample[:500]) "

Your clinical summary document is ready for download:

TBM Clinical Summary Saithoon Benazir

Word Document · DOCX


Here is what the document contains across its 14 fully formatted sections (18 colour-coded tables):
SectionContent
1. Patient InformationDemographics, UHID, admission/discharge dates, primary consultant
2. Final DiagnosesAll 8 diagnoses with the primary (TBM + VP Shunt + Tracheostomy) highlighted
3. Presenting Complaints & BackgroundChief complaints, co-morbidities, social/family history
4. Timeline of Illness (Pre-Apollo)6-phase chronological table from prodrome to transfer
5. Examination at Apollo AdmissionVitals and systemic findings at entry
6. Key InvestigationsCSF analysis (with Xpert MTB highlighted), haematology trends, biochemistry, microbiology/cultures
7. Imaging Summary15 studies tabulated with date, findings, and action taken - from first MRI to pre-discharge spine survey
8. Procedures PerformedVP Shunt, Tracheostomy, LP, PRBC transfusion with operative details
9. Hospital Course Summary4-phase narrative table (stabilization → sepsis → neurological/hepatic → rehab/decannulation)
10. Discharge Medications18 drugs categorized with dose, frequency, and duration
11. Condition at DischargeVitals, GCS, limb power, tracheostomy status, shunt, vision, nutrition
12. Follow-up Plan8 teams with timeframes and specific purpose
13. Key Teaching Points9 clinical learning points in an orange-themed table (suitable for teaching rounds or grand rounds)
14. Red Flag SymptomsEmergency warning signs with Apollo emergency contact numbers
The document uses a navy blue header banner, alternating row shading, bold labels, and a footer identifying it as a referral/teaching document. It is ready to print or email as-is.
This is a shared conversation. Sign in to Orris to start your own chat.