Give me proper notes on how to approach febrile aletrd sensorium pt when it comes to casualty include all differentials and includes investigation treatment and mainly tell me proper according to time like acute subacute how can we differenteate each from other and including mri ct csf all from standard textbook
| Feature | Meningitis | Encephalitis |
|---|---|---|
| Predominant sign | Meningism (neck stiffness, Kernig's, Brudzinski's) | Altered behavior/consciousness/focal neurology |
| Parenchymal involvement | No | Yes |
| Seizures | Late/uncommon | Common, early |
| Fever | Yes | Yes |
| CSF pleocytosis | Yes | Yes |
In practice both frequently coexist as meningoencephalitis.
| Differential | Key Clues |
|---|---|
| Bacterial meningitis (N. meningitidis) | Petechial/purpuric rash, high fever, rapid deterioration |
| Bacterial meningitis (S. pneumoniae) | Elderly, post-splenectomy, pneumonia, otitis media |
| Herpes simplex encephalitis | Temporal lobe features (temporal seizures, behavioral change) |
| Cerebral malaria | Travel history, peripheral smear |
| SAH | "Thunderclap" headache, no fever initially |
| Sepsis with encephalopathy | Source of infection elsewhere, multiorgan features |
| Differential | Key Clues |
|---|---|
| Viral meningitis (Enterovirus most common) | Younger patient, summer/monsoon season, milder course |
| HSV encephalitis | Temporal lobe focus, behavioral change, psychosis |
| West Nile virus encephalitis | Mosquito exposure, flaccid paralysis, elderly |
| Listeria meningitis | Elderly/immunosuppressed, rhombencephalitis features |
| Early brain abscess | Focal deficits, source of infection (dental, ear, lung) |
| Typhoid encephalopathy | Rose spots, relative bradycardia, endemic setting |
| Falciparum malaria | Travel, smear positive |
| Differential | Key Clues |
|---|---|
| Tuberculous meningitis (TBM) | Most common subacute cause in India; constitutional symptoms weeks prior, basilar signs, CN palsies |
| Cryptococcal meningitis | HIV/immunosuppressed, India ink positive, cryptococcal antigen |
| Japanese encephalitis | Thalamic/basal ganglia involvement, mosquito exposure |
| Autoimmune encephalitis (anti-NMDA-R) | Young female, psychiatric prodrome, movement disorder |
| Partially treated bacterial meningitis | History of antibiotics, modified CSF picture |
| Neurosyphilis | Risk factors (MSM, HIV), cranial nerve palsies, positive VDRL |
| Differential | Key Clues |
|---|---|
| TBM | Classical subacute-chronic; TB exposure, HIV |
| Cryptococcal meningitis | HIV/AIDS, minimal meningism, elevated opening pressure |
| Carcinomatous meningitis | Known malignancy, multiple CN palsies |
| Neurosyphilis | Positive RPR/VDRL, HIV co-infection |
| Neurocysticercosis | Calcifications on CT, seizures, India |
| Brucella meningitis | Animal exposure, zoonosis |
| Neurosarcoidosis | CN VII palsy, systemic sarcoid features |
| Feature | Bacterial | Viral | TBM | Cryptococcal |
|---|---|---|---|---|
| Onset | Hyperacute/acute | Acute (24-72h) | Subacute (1-3 wk) | Subacute/chronic |
| Fever | High, sudden | Moderate | Low-grade, evening | Low/variable |
| Neck stiffness | Severe | Moderate | Present | Mild/absent |
| CN palsies | Later (if complicated) | Rare | Early (III, VI, VII) | Present |
| Rash | Petechiae (meningococcus) | Vesicles (VZV/HSV) | Absent | Absent |
| Seizures | Late | Common (HSV) | Common | Late |
| Hydrocephalus | Rare early | No | Communicating, early | Raised ICP dominant |
| Constitutional symptoms | Absent | Viral prodrome | Weeks of malaise, night sweats, weight loss | Weeks |
| Setting | Any | Any | TB contact/HIV | HIV/immunocompromised |
| Condition | CT Finding |
|---|---|
| Bacterial meningitis | Often normal; may show sulcal effacement, hydrocephalus, meningeal enhancement |
| Brain abscess | Hypodense ring-enhancing lesion with surrounding edema |
| HSV encephalitis | Hypodensity in temporal lobe (early); CT often normal in first 48h |
| TBM | Basal meningeal enhancement, communicating hydrocephalus, infarcts (basal ganglia) |
| Cryptococcal meningitis | Hydrocephalus, "soap bubble" lesions (cryptococcomas), dilated Virchow-Robin spaces |
| Neurocysticercosis | Calcified cysts, "hole with a dot" (scolex), perilesional edema |
| Cerebral malaria | Diffuse cerebral edema |
| SAH | Hyperdense subarachnoid blood in cisterns |
| Condition | MRI Finding |
|---|---|
| HSV Encephalitis | T2/FLAIR hyperintensity in orbitofrontal, anterior and medial temporal lobes; DWI restriction; hemorrhagic transformation possible. Changes appear within 48h of symptom onset. Spares basal ganglia |
| TBM | T1+Gad: basal (sylvian fissure/interpeduncular cistern) meningeal enhancement; T2: hydrocephalus; DWI: ischemic infarcts (perforators); tuberculomas = target lesion (central T2 hypointense nidus) |
| Bacterial meningitis | Meningeal enhancement with Gad; complications: subdural empyema, cortical venous thrombosis, infarcts |
| Japanese Encephalitis | T2/FLAIR: bilateral thalamic hyperintensity (hallmark), substantia nigra involvement, basal ganglia |
| Anti-NMDA-R Encephalitis | Often normal MRI; may have FLAIR hyperintensity in hippocampus, cingulate, frontal lobes |
| Cryptococcal meningitis | Dilated Virchow-Robin spaces (gelatinous pseudocysts), basal meningitis, hydrocephalus |
| Brain abscess | T1: hypointense center, ring-enhancing wall; T2: hypointense capsule (distinctive); DWI: restricted diffusion in center (pus) - distinguishes from tumor |
| Cerebral venous sinus thrombosis (CVST) | MRV: absent flow in sinus; T1 iso-hyperintense clot; hemorrhagic venous infarcts |
Harrison's, p.1164: "MRI abnormalities (other than meningeal enhancement) are not seen in uncomplicated bacterial meningitis. By contrast, in HSV encephalitis, T2-weighted, FLAIR, and DWI images show high-signal-intensity lesions in the orbitofrontal, anterior, and medial temporal lobes in the majority of patients within 48h of symptom onset."
| Parameter | Normal | Bacterial Meningitis | Viral Meningitis | TBM | Cryptococcal | Brain Abscess |
|---|---|---|---|---|---|---|
| Opening pressure | 70-180 mmH2O | ↑↑ (>200; may be 400-500) | Normal to ↑ | ↑ (200-400) | ↑↑ (often >250) | Normal |
| Appearance | Clear, colorless | Turbid/purulent | Clear | Xanthochromic/fibrin web | Clear/opalescent | LP contraindicated |
| WBC count | <5 cells/μL | 10-10,000 (PMN >80%) | 50-1000 (lymphocytes) | 100-1000 (lymphocytes) | 10-500 (lymphocytes) | - |
| Glucose (mg/dL) | 45-85 | <40 (hypoglycorrhachia) | Normal (40-80) | Low (<45) | Low (<45) | - |
| CSF:Serum glucose | >0.6 | <0.4 (highly suggestive bacterial/TB/fungal) | Normal (>0.6) | <0.4 | <0.4 | - |
| Protein (mg/dL) | 15-45 | >100 (often >200) | 60-100 (mild ↑) | >100 (markedly elevated) | >100 | - |
| Gram stain | Negative | Positive >60% | Negative | Negative (AFB rare) | India Ink positive | - |
| Culture | Negative | Positive >80% | Negative (viral cx) | AFB culture (6-8 wk) | Fungal culture | - |
| Special tests | - | BioFire PCR panel | Viral PCR (HSV, enterovirus) | ADA >10 U/L, PCR MTB | Cryptococcal Ag (CRAG), India ink | - |
Source: Jawetz Medical Microbiology 28E, Table 48-2 and Harrison's 22E, Table 143-2 and Harriet Lane Handbook 23E, Table 17.8
| Age | Common organisms |
|---|---|
| Neonates (<1 month) | Group B Streptococcus (S. agalactiae), E. coli (K1), Listeria |
| Infants 1-3 months | GBS, E. coli, H. influenzae, S. pneumoniae |
| Children 3 months - 5 years | H. influenzae, S. pneumoniae, N. meningitidis |
| Adults <55 (immunocompetent) | S. pneumoniae, N. meningitidis |
| Adults >55 / alcoholic / debilitated | S. pneumoniae, N. meningitidis, Listeria monocytogenes |
| Post-neurosurgery / head trauma | S. aureus, CoNS, gram-negative rods (Klebsiella, Pseudomonas) |
| HIV/immunocompromised | Cryptococcus, Listeria, gram-negative rods |
| Sign | Sensitivity | Specificity |
|---|---|---|
| Headache | 91% | 16% |
| Nuchal rigidity | 13% | 80% |
| Kernig's sign | 2% | 97% |
| Brudzinski's sign | 2% | 98% |
| Jolt accentuation | 21% | 82% |
| Clinical Scenario | Empirical Regimen |
|---|---|
| Immunocompetent adult <55 | Ceftriaxone 2g IV q12h + Vancomycin 15-20 mg/kg IV q8-12h |
| Adult >55 / Alcoholic / Immunosuppressed | Ceftriaxone 2g IV q12h + Vancomycin + Ampicillin 2g IV q4h (cover Listeria) |
| Post-neurosurgery / Hospital-acquired | Vancomycin + Ceftazidime 2g IV q8h OR Meropenem 2g IV q8h |
| Neonates | Ampicillin + Cefotaxime |
| HSV suspected (temporal features) | Add Acyclovir 10 mg/kg IV q8h |
| TBM suspected | Start ATT (HRZE) + Dexamethasone |
| Cryptococcal suspected (HIV/immunocompromised) | Amphotericin B + Flucytosine |
| Malaria | Artesunate IV if severe |
| Antibiotic | Adult dose |
|---|---|
| Ceftriaxone | 2g IV q12h |
| Cefotaxime | 3g IV q6h (12g/day) |
| Vancomycin | 15-20 mg/kg IV q8-12h (AUC-guided dosing) |
| Ampicillin | 2g IV q4h (12g/day) |
| Meropenem | 2g IV q8h |
| Acyclovir (HSV) | 10 mg/kg IV q8h (adjust for renal function) |
| Organism | Duration |
|---|---|
| N. meningitidis | 7 days |
| S. pneumoniae | 10-14 days |
| L. monocytogenes | 21 days |
| Gram-negative rods | 21 days |
| TBM | 9-12 months total |
| Complication | How to Detect | Management |
|---|---|---|
| Raised ICP / herniation | Cushing's (HTN + bradycardia + irregular breathing), pupil changes | Mannitol 1g/kg IV, elevate HOB 30°, hyperventilate, neurosurgery |
| Seizures | EEG monitoring, clinical observation | Levetiracetam or Phenytoin; Lorazepam for status |
| Hyponatremia (SIADH) | Serum Na+, serum/urine osmolality | Fluid restriction; hypertonic saline if Na+ <120 or symptomatic |
| Septic shock | BP, lactate, urine output | Norepinephrine first-line vasopressor |
| DIC (meningococcemia) | Coagulation profile, peripheral blood smear | FFP, platelets; heparin controversial |
| Subdural empyema | MRI (contrast) | Urgent neurosurgical drainage + antibiotics |
| Communicating hydrocephalus (TBM) | CT head serial | Repeat LP (TBM); VP shunt if refractory |
| Waterhouse-Friderichsen syndrome | Hemorrhagic adrenal infarction in meningococcemia | Stress-dose hydrocortisone |
FEBRILE ALTERED SENSORIUM IN CASUALTY
|
v
STABILIZE (ABC + glucose)
|
v
TIMELINE: How long has this been going on?
| | |
<24h (ACUTE) 1-4 WEEKS >4 WEEKS
| (SUBACUTE) (CHRONIC)
| | |
Bacterial TBM, JE TBM, Cryptococcal,
meningitis, Autoimmune Carcinomatous,
HSV, Viral encephalitis Neurosyphilis,
meningitis, Neurosarcoid
Malaria
|
v
FEATURES OF RAISED ICP? (papilledema, focal deficit, GCS drop)
|
YES -- CT HEAD FIRST
NO -- LP directly (can image after)
|
v
BLOOD CULTURES + START EMPIRICAL ANTIBIOTICS (+ Acyclovir if HSV possible)
|
v
LP + CSF ANALYSIS
|
PMN pleocytosis Lymphocytic pleocytosis
Glucose LOW Glucose NORMAL Glucose LOW
Protein HIGH | |
| Viral/Aseptic TBM/Fungal/
Bacterial meningitis Meningitis Partially treated
| bacterial
Cultures, BioFire
PCR, Sensitivity
| Feature | Bacterial | HSV Encephalitis | TBM | JE | Autoimmune |
|---|---|---|---|---|---|
| Onset | Hyperacute | Acute | Subacute | Acute-subacute | Subacute |
| Fever | High | Moderate-high | Low-grade | High | Low/absent |
| Rash | Petechiae (meningococcus) | Herpetic vesicles (rare) | None | None | None |
| Psychiatric/behavior | Absent (confused) | Prominent (temporal lobe) | Late | Variable | Very prominent |
| CN palsies | Rare early | Rare | Early, common (III, VI) | Rare | Rare |
| Seizures | Late | Early, temporal | Common | Common | Orofacial dyskinesias |
| MRI | Normal/meningeal | Temporal FLAIR hyperintensity | Basal meningeal enhancement, hydrocephalus | Bilateral thalamic | Often normal |
| CSF glucose | Very low | Normal | Low | Normal | Normal |
| CSF cells | PMN >80% | Lymphocytes | Lymphocytes | Lymphocytes | Normal/mild lymphocytes |
| Setting | Any | Any (reactivation) | TB endemic, HIV | Monsoon, mosquito | Young female |
| Specific test | Gram stain, culture, BioFire | HSV PCR CSF | ADA, MTB PCR, AFB culture | JE IgM serum/CSF | Anti-NMDA-R Ab, LGI1, CASPR2 Ab |
Create a document/PDF to present this in front of my juniors and professors
ls -la /tmp/workspace/ 2>/dev/null || mkdir -p /tmp/workspace && echo "workspace ready"
mkdir -p /tmp/workspace/febrile-altered-sensorium && echo "dir created"
~/febrile-altered-sensorium/generate_pdf.py
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm, mm
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
HRFlowable, PageBreak, KeepTogether
)
from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_JUSTIFY
from reportlab.platypus import BaseDocTemplate, PageTemplate, Frame
from reportlab.lib.colors import HexColor
import datetime
OUTPUT = "/tmp/workspace/febrile-altered-sensorium/Febrile_Altered_Sensorium_Casualty_Notes.pdf"
# ── Colour palette ──────────────────────────────────────────────────────────
DARK_BLUE = HexColor("#1a3c5e")
MED_BLUE = HexColor("#2563a8")
LIGHT_BLUE = HexColor("#dbeafe")
ACCENT_RED = HexColor("#dc2626")
ACCENT_AMBER= HexColor("#d97706")
ACCENT_GREEN= HexColor("#16a34a")
LIGHT_GREY = HexColor("#f1f5f9")
MID_GREY = HexColor("#64748b")
TABLE_HEAD = HexColor("#1e40af")
TABLE_ALT = HexColor("#eff6ff")
WHITE = colors.white
BLACK = colors.black
W, H = A4
# ── Header / Footer ─────────────────────────────────────────────────────────
def draw_header_footer(canvas, doc):
canvas.saveState()
# Top bar
canvas.setFillColor(DARK_BLUE)
canvas.rect(0, H - 1.8*cm, W, 1.8*cm, fill=1, stroke=0)
canvas.setFillColor(WHITE)
canvas.setFont("Helvetica-Bold", 11)
canvas.drawString(1.2*cm, H - 1.25*cm, "FEBRILE ALTERED SENSORIUM — CASUALTY MANAGEMENT GUIDE")
canvas.setFont("Helvetica", 8)
canvas.drawRightString(W - 1.2*cm, H - 1.25*cm, f"Page {doc.page}")
# Bottom bar
canvas.setFillColor(DARK_BLUE)
canvas.rect(0, 0, W, 0.9*cm, fill=1, stroke=0)
canvas.setFillColor(WHITE)
canvas.setFont("Helvetica-Oblique", 7.5)
canvas.drawString(1.2*cm, 0.32*cm,
"Sources: Harrison's 22E · Bradley & Daroff's Neurology · Goldman-Cecil · Rosen's Emergency Medicine · Jawetz Microbiology")
canvas.restoreState()
# ── Document setup ───────────────────────────────────────────────────────────
doc = SimpleDocTemplate(
OUTPUT,
pagesize=A4,
rightMargin=1.8*cm, leftMargin=1.8*cm,
topMargin=2.6*cm, bottomMargin=1.6*cm,
title="Febrile Altered Sensorium — Casualty Notes",
author="Medical Education"
)
# ── Styles ───────────────────────────────────────────────────────────────────
base = getSampleStyleSheet()
def S(name, parent="Normal", **kw):
return ParagraphStyle(name, parent=base[parent], **kw)
sTitle = S("sTitle", "Title", fontSize=20, textColor=WHITE, alignment=TA_CENTER, spaceAfter=4)
sSub = S("sSub", "Normal", fontSize=10, textColor=LIGHT_BLUE, alignment=TA_CENTER, spaceAfter=2)
sH1 = S("sH1", "Normal", fontSize=13, textColor=WHITE, fontName="Helvetica-Bold",
backColor=DARK_BLUE, leftIndent=-5, rightIndent=-5,
spaceBefore=10, spaceAfter=4, borderPad=6)
sH2 = S("sH2", "Normal", fontSize=11, textColor=DARK_BLUE, fontName="Helvetica-Bold",
borderPad=3, spaceBefore=8, spaceAfter=3,
borderWidth=0, leftIndent=0)
sH3 = S("sH3", "Normal", fontSize=9.5, textColor=MED_BLUE, fontName="Helvetica-Bold",
spaceBefore=5, spaceAfter=2)
sBody = S("sBody", "Normal", fontSize=8.5, leading=13, spaceAfter=2)
sBullet = S("sBullet", "Normal", fontSize=8.5, leading=12,
leftIndent=14, firstLineIndent=-10, spaceAfter=1.5)
sBullet2 = S("sBullet2","Normal", fontSize=8, leading=11.5,
leftIndent=26, firstLineIndent=-10, spaceAfter=1)
sWarn = S("sWarn", "Normal", fontSize=8.5, leading=12,
backColor=HexColor("#fff7ed"), textColor=HexColor("#92400e"),
borderColor=ACCENT_AMBER, borderWidth=1, borderPad=5,
spaceBefore=4, spaceAfter=4)
sAlert = S("sAlert", "Normal", fontSize=8.5, leading=12,
backColor=HexColor("#fef2f2"), textColor=ACCENT_RED,
borderColor=ACCENT_RED, borderWidth=1, borderPad=5,
spaceBefore=4, spaceAfter=4)
sGreen = S("sGreen", "Normal", fontSize=8.5, leading=12,
backColor=HexColor("#f0fdf4"), textColor=HexColor("#14532d"),
borderColor=ACCENT_GREEN, borderWidth=1, borderPad=5,
spaceBefore=4, spaceAfter=4)
sCaption = S("sCaption","Normal", fontSize=7.5, textColor=MID_GREY,
alignment=TA_CENTER, spaceAfter=4)
# ── Helper builders ──────────────────────────────────────────────────────────
def h1(txt):
return Paragraph(f" {txt}", sH1)
def h2(txt):
return [
HRFlowable(width="100%", thickness=2, color=MED_BLUE, spaceAfter=2),
Paragraph(txt, sH2),
]
def h3(txt): return Paragraph(txt, sH3)
def body(txt): return Paragraph(txt, sBody)
def bullet(txt, level=1): return Paragraph(f"• {txt}", sBullet if level==1 else sBullet2)
def warn(txt): return Paragraph(f"⚠ {txt}", sWarn)
def alert(txt): return Paragraph(f"🔴 {txt}", sAlert)
def green(txt): return Paragraph(f"✔ {txt}", sGreen)
def sp(h=4): return Spacer(1, h)
def hr(): return HRFlowable(width="100%", thickness=0.5, color=LIGHT_GREY, spaceBefore=4, spaceAfter=4)
def make_table(headers, rows, col_widths=None, zebra=True):
"""Generic styled table."""
data = [[Paragraph(f"<b>{h}</b>", ParagraphStyle("th", fontSize=8,
textColor=WHITE, fontName="Helvetica-Bold", leading=10)) for h in headers]]
for i, row in enumerate(rows):
data.append([Paragraph(str(c), ParagraphStyle("td", fontSize=7.5, leading=10,
textColor=BLACK)) for c in row])
w = col_widths or [W/(len(headers)+1)]*(len(headers))
t = Table(data, colWidths=w, repeatRows=1)
style = [
("BACKGROUND", (0,0), (-1,0), TABLE_HEAD),
("ROWBACKGROUNDS", (0,1), (-1,-1), [WHITE, TABLE_ALT] if zebra else [WHITE]),
("GRID", (0,0), (-1,-1), 0.4, HexColor("#cbd5e1")),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
("TOPPADDING", (0,0), (-1,-1), 4),
("BOTTOMPADDING", (0,0), (-1,-1), 4),
("LEFTPADDING", (0,0), (-1,-1), 5),
]
t.setStyle(TableStyle(style))
return t
# ── Cover page ───────────────────────────────────────────────────────────────
def cover_page():
elems = []
# Big blue banner
elems.append(Spacer(1, 1*cm))
banner_data = [[Paragraph(
'<font size="22" color="white"><b>FEBRILE ALTERED SENSORIUM</b></font><br/>'
'<font size="13" color="#93c5fd">Approach in Casualty — Complete Clinical Notes</font>',
ParagraphStyle("banner", alignment=TA_CENTER, leading=30))]]
banner = Table(banner_data, colWidths=[W - 3.6*cm])
banner.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), DARK_BLUE),
("TOPPADDING", (0,0), (-1,-1), 18),
("BOTTOMPADDING", (0,0), (-1,-1), 18),
("LEFTPADDING", (0,0), (-1,-1), 20),
("RIGHTPADDING", (0,0), (-1,-1), 20),
("ROUNDEDCORNERS", [8]),
]))
elems.append(banner)
elems.append(sp(16))
# Info boxes row
boxes = [
("SCOPE", "Emergency / Casualty", MED_BLUE),
("LEVEL", "PG / Senior UG", MED_BLUE),
("SOURCES", "Harrison's · Bradley's\nGoldman-Cecil · Rosen's", MED_BLUE),
("DATE", datetime.date.today().strftime("%B %Y"), MED_BLUE),
]
box_data = []
for title, val, col in boxes:
box_data.append(
Paragraph(f'<font color="white"><b>{title}</b></font><br/>'
f'<font color="#bfdbfe" size="9">{val}</font>',
ParagraphStyle("bx", alignment=TA_CENTER, leading=14)))
brow = Table([box_data], colWidths=[(W-3.6*cm)/4]*4)
brow.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), MED_BLUE),
("TOPPADDING", (0,0), (-1,-1), 10),
("BOTTOMPADDING", (0,0), (-1,-1), 10),
("GRID", (0,0), (-1,-1), 0.5, WHITE),
]))
elems.append(brow)
elems.append(sp(20))
# Contents outline
elems.append(Paragraph("<b>Contents at a Glance</b>",
ParagraphStyle("cov", fontSize=12, textColor=DARK_BLUE, spaceAfter=8)))
sections = [
("Step 0", "Initial Stabilization — ABC + Glucose"),
("Step 1", "Define the Syndrome — Meningitis vs Encephalitis"),
("Step 2", "Temporal Classification — Hyperacute / Acute / Subacute / Chronic"),
("Step 3", "Clinical Differentiation at Bedside"),
("Step 4", "Investigations — Blood, CT, MRI, CSF"),
("Step 5", "Specific Conditions — Bacterial, HSV, TBM, Cryptococcal, JE, Autoimmune"),
("Step 6", "Empirical Treatment Protocol"),
("Step 7", "Complications and their Management"),
("Step 8", "Quick Reference Tables"),
]
for num, desc in sections:
row = Table([[
Paragraph(f"<b>{num}</b>", ParagraphStyle("cn", fontSize=9, textColor=WHITE,
alignment=TA_CENTER)),
Paragraph(desc, ParagraphStyle("cd", fontSize=9, textColor=DARK_BLUE))
]], colWidths=[2*cm, W - 3.6*cm - 2*cm])
row.setStyle(TableStyle([
("BACKGROUND", (0,0), (0,0), MED_BLUE),
("BACKGROUND", (1,0), (1,0), LIGHT_BLUE),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 8),
("GRID", (0,0), (-1,-1), 0.3, HexColor("#93c5fd")),
]))
elems.append(row)
elems.append(sp(2))
elems.append(PageBreak())
return elems
# ═══════════════════════════════════════════════════════════════════════════════
# CONTENT
# ═══════════════════════════════════════════════════════════════════════════════
story = []
story += cover_page()
# ── STEP 0 ───────────────────────────────────────────────────────────────────
story.append(h1("STEP 0 — INITIAL STABILIZATION AT CASUALTY"))
story.append(sp(6))
story += h2("Primary Survey (ABCDE + Glucose)")
story.append(sp(3))
abcde = [
("A — Airway", "Ensure patent. Jaw thrust / chin lift. Intubate if GCS ≤8 or loss of protective reflexes.", ACCENT_RED),
("B — Breathing", "High-flow O2. Target SpO2 >94%. Watch for Cheyne-Stokes or Kussmaul breathing.", MED_BLUE),
("C — Circulation", "Two large-bore IV lines. NS 500 mL bolus if hypotensive. Continuous BP + pulse oximetry.", MED_BLUE),
("D — Disability", "GCS (E+V+M), pupil size/reactivity, limb posturing (decorticate vs decerebrate).", DARK_BLUE),
("E — Exposure", "Full skin exam — petechiae? herpes vesicles? meningococcal rash? Temp, signs of trauma.", DARK_BLUE),
("G — Glucose", "BEDSIDE CAPILLARY BGL IMMEDIATELY. Give D50 50 mL IV bolus if BGL <60 mg/dL.", ACCENT_GREEN),
]
for letter, detail, col in abcde:
row = Table([[
Paragraph(f"<b>{letter}</b>", ParagraphStyle("al", fontSize=9.5, textColor=WHITE, alignment=TA_CENTER)),
Paragraph(detail, ParagraphStyle("ad", fontSize=8.5, leading=12))
]], colWidths=[3*cm, W - 3.6*cm - 3*cm])
row.setStyle(TableStyle([
("BACKGROUND", (0,0), (0,0), col),
("BACKGROUND", (1,0), (1,0), LIGHT_GREY),
("TOPPADDING", (0,0), (-1,-1), 6), ("BOTTOMPADDING", (0,0), (-1,-1), 6),
("LEFTPADDING", (0,0), (-1,-1), 8),
("GRID", (0,0), (-1,-1), 0.4, HexColor("#cbd5e1")),
]))
story.append(row); story.append(sp(2))
story.append(sp(6))
story.append(alert("Do NOT delay empirical antibiotics for CT scan or LP results in a sick patient. Time to antibiotics target: <60 minutes from door."))
# ── STEP 1 ───────────────────────────────────────────────────────────────────
story.append(PageBreak())
story.append(h1("STEP 1 — DEFINE THE SYNDROME"))
story.append(sp(6))
story += h2("Febrile Altered Sensorium = Fever + Altered Consciousness (GCS <15 or confusion)")
story.append(sp(4))
story.append(make_table(
["Feature", "Meningitis", "Meningoencephalitis / Encephalitis"],
[
["Predominant sign", "Meningism (neck stiffness, Kernig's, Brudzinski's)", "Altered behaviour / consciousness / focal neurology"],
["Parenchymal involvement", "No", "Yes"],
["Seizures", "Late / uncommon", "Common, early (especially HSV)"],
["CSF cells", "Pleocytosis", "Pleocytosis (may be normal in autoimmune)"],
["MRI changes", "Meningeal enhancement only", "Parenchymal signal change"],
],
col_widths=[3.5*cm, 6.5*cm, 6.5*cm]
))
story.append(sCaption and Paragraph("In practice, both frequently coexist as meningoencephalitis.", sCaption))
story.append(sp(8))
story += h2("Meningeal Signs — Sensitivity & Specificity (Rosen's Emergency Medicine)")
story.append(sp(3))
story.append(make_table(
["Sign", "Sensitivity", "Specificity", "Clinical Pearl"],
[
["Headache", "91%", "16%", "High sensitivity; very non-specific"],
["Nuchal rigidity", "13%", "80%", "Absence does NOT rule out meningitis"],
["Kernig's sign", "2%", "97%", "High specificity when present"],
["Brudzinski's sign", "2%", "98%", "High specificity when present"],
["Jolt accentuation", "21%", "82%", "Useful bedside sign"],
["Focal neurological deficit", "2%", "96%", "Suggests abscess / encephalitis"],
],
col_widths=[3.5*cm, 2.5*cm, 2.5*cm, 8*cm]
))
story.append(warn("Classic triad (Fever + Neck stiffness + Altered sensorium) is present together in only 44% of bacterial meningitis cases. A high index of suspicion is mandatory."))
# ── STEP 2 ───────────────────────────────────────────────────────────────────
story.append(PageBreak())
story.append(h1("STEP 2 — TEMPORAL CLASSIFICATION"))
story.append(sp(4))
timeline_blocks = [
("HYPERACUTE\n< 24 hours", ACCENT_RED, [
"Bacterial meningitis — N. meningitidis (petechial/purpuric rash, rapid deterioration)",
"Bacterial meningitis — S. pneumoniae (elderly, post-splenectomy, sinusitis/otitis)",
"Herpes simplex encephalitis (temporal lobe seizures, behavioral change)",
"Cerebral malaria (travel history, smear positive)",
"Subarachnoid haemorrhage (thunderclap headache, initially afebrile — mimic)",
"Sepsis with encephalopathy (multiorgan features, source elsewhere)",
]),
("ACUTE\n1 – 7 days", MED_BLUE, [
"Viral meningitis — Enterovirus (most common; younger patient, summer/monsoon)",
"HSV encephalitis (personality change, temporal seizures, psychosis)",
"West Nile virus encephalitis (flaccid paralysis, elderly, mosquito exposure)",
"Listeria meningitis (elderly/immunocompromised, rhombencephalitis features)",
"Early brain abscess (focal deficits, dental/ear/lung source)",
"Typhoid encephalopathy (rose spots, relative bradycardia, endemic setting)",
"Japanese encephalitis (bilateral thalamic involvement, monsoon, rural)",
]),
("SUBACUTE\n1 – 4 weeks", ACCENT_AMBER, [
"Tuberculous meningitis — TBM (most common subacute in India; constitutional prodrome, basilar CN palsies)",
"Cryptococcal meningitis (HIV, CD4 <100; headache dominant, minimal meningism)",
"Autoimmune encephalitis — anti-NMDA-R (young female, psychiatric prodrome, orofacial dyskinesias)",
"Japanese encephalitis (thalamic lesions on MRI; overlap with acute)",
"Partially treated bacterial meningitis (history of antibiotics, modified CSF)",
"Neurosyphilis (MSM, HIV, CN palsies, positive VDRL/RPR)",
]),
("CHRONIC\n> 4 weeks", DARK_BLUE, [
"TBM (classical; TB exposure, HIV, hydrocephalus, CN palsies)",
"Cryptococcal meningitis (AIDS, minimal meningism, very high ICP)",
"Carcinomatous meningitis (known malignancy, multiple CN palsies)",
"Neurosyphilis (positive serology, HIV co-infection)",
"Neurocysticercosis (calcifications CT, seizures, India endemic)",
"Neurosarcoidosis (CN VII palsy, systemic sarcoid features, hypercalcaemia)",
"Brucella meningitis (animal exposure, zoonosis)",
]),
]
for label, col, items in timeline_blocks:
hdr = Table([[Paragraph(f"<b>{label}</b>",
ParagraphStyle("th", fontSize=10, textColor=WHITE, alignment=TA_CENTER, leading=14))]],
colWidths=[W - 3.6*cm])
hdr.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), col),
("TOPPADDING", (0,0), (-1,-1), 8), ("BOTTOMPADDING", (0,0), (-1,-1), 8),
]))
story.append(hdr)
for item in items:
story.append(bullet(item))
story.append(sp(8))
# ── STEP 3 ───────────────────────────────────────────────────────────────────
story.append(PageBreak())
story.append(h1("STEP 3 — CLINICAL DIFFERENTIATION AT BEDSIDE"))
story.append(sp(4))
story.append(make_table(
["Feature", "Bacterial", "HSV Encephalitis", "TBM", "JE", "Autoimmune"],
[
["Onset", "Hyperacute", "Acute", "Subacute (1-3 wk)", "Acute-subacute", "Subacute"],
["Fever", "High, sudden", "Moderate-high", "Low-grade, evenings", "High", "Low/absent"],
["Rash", "Petechiae (meningococcus)", "Vesicles (rare)", "None", "None", "None"],
["Psychiatric Sx","Absent", "Prominent (temporal lobe)", "Late", "Variable", "Very prominent"],
["CN palsies", "Rare early", "Rare", "Early (III, VI, VII)", "Rare", "Rare"],
["Seizures", "Late", "Early, temporal", "Common", "Common", "Orofacial dyskinesias"],
["MRI", "Normal / meningeal enhancement", "Temporal FLAIR hyperintensity", "Basal meningeal enhancement + hydrocephalus", "Bilateral thalamic T2 signal", "Often normal"],
["CSF glucose", "Very low (<40)", "Normal", "Low (<45)", "Normal", "Normal"],
["CSF cells", "PMN >80%", "Lymphocytes", "Lymphocytes", "Lymphocytes", "Normal / mild lymphocytes"],
["Specific test", "Gram stain, culture, BioFire PCR", "HSV PCR (96% sens)", "ADA, MTB PCR, AFB culture", "JE IgM serum/CSF", "Anti-NMDA-R, LGI1, CASPR2 Ab"],
],
col_widths=[2.6*cm, 2.6*cm, 3*cm, 3.1*cm, 2.5*cm, 2.6*cm]
))
story.append(sp(4))
story.append(Paragraph("<i>Harrison's 22E, p.1164: \"MRI abnormalities (other than meningeal enhancement) are not seen in uncomplicated bacterial meningitis. By contrast, in HSV encephalitis, T2/FLAIR/DWI images show high-signal lesions in temporal lobes within 48h of symptom onset.\"</i>",
ParagraphStyle("q", fontSize=8, textColor=MID_GREY, leftIndent=10, spaceAfter=4)))
# ── STEP 4 — Investigations ──────────────────────────────────────────────────
story.append(PageBreak())
story.append(h1("STEP 4 — INVESTIGATIONS"))
story.append(sp(4))
story += h2("A. Immediate Blood Tests (Order Stat)")
for b in [
"CBC with differential — leucocytosis (bacterial); lymphocytosis (viral/TBM)",
"Blood culture ×2 — BEFORE antibiotics, but NEVER delay antibiotics for culture results",
"Bedside capillary glucose; serum glucose",
"Serum electrolytes, LFT, RFT, urea, creatinine (look for SIADH — hyponatraemia is common in TBM)",
"Serum Procalcitonin — >0.5 ng/mL suggests bacterial aetiology",
"CRP",
"Peripheral smear for malaria (Giemsa) — mandatory in endemic setting",
"HIV ELISA — always order (changes entire differential and management)",
"Coagulation profile (PT, APTT, platelet count) — assess DIC in meningococcaemia",
"Blood lactate — raised in sepsis; helps risk-stratify",
]:
story.append(bullet(b))
story.append(sp(6))
story += h2("B. CT Head — When to Do BEFORE LP")
story.append(alert("Perform CT head FIRST (before LP) if ANY of these are present:\nPapilledema · Focal neurological deficit · New-onset seizures · GCS <12 · Immunocompromised · Age >60 · History of CNS disease (tumour, stroke, focal infection)"))
story.append(sp(4))
story.append(green("CT normal does NOT exclude meningitis. If CT is normal, proceed to LP without further delay."))
story.append(sp(4))
story.append(make_table(
["Condition", "CT Finding"],
[
["Bacterial meningitis", "Often normal; sulcal effacement, hydrocephalus, meningeal enhancement late"],
["Brain abscess", "Hypodense ring-enhancing lesion with surrounding vasogenic oedema"],
["HSV encephalitis", "Hypodensity in temporal lobe — may be NORMAL in first 48h (MRI far superior)"],
["TBM", "Basal meningeal enhancement, communicating hydrocephalus, basal ganglia infarcts"],
["Cryptococcal meningitis", "'Soap bubble' lesions (cryptococcomas), dilated Virchow-Robin spaces, hydrocephalus"],
["Neurocysticercosis", "Calcified cysts, 'hole with a dot' (scolex), perilesional oedema"],
["Cerebral malaria", "Diffuse cerebral oedema"],
["SAH", "Hyperdense subarachnoid blood in basal cisterns, sylvian fissures"],
],
col_widths=[4.5*cm, 12*cm]
))
story.append(PageBreak())
story += h2("C. MRI Brain — Key Sequences and Findings")
story.append(sp(3))
story.append(make_table(
["Condition", "MRI Sequence", "Key Finding"],
[
["HSV Encephalitis", "T2 / FLAIR / DWI", "Hyperintensity in orbitofrontal + medial/anterior temporal lobes; DWI restriction; haemorrhage possible. Changes within 48h."],
["TBM", "T1+Gad / T2 / DWI", "Basal (sylvian / interpeduncular) meningeal enhancement; communicating hydrocephalus; ischaemic infarcts (perforators); tuberculoma = target lesion"],
["Bacterial meningitis", "T1+Gad", "Meningeal enhancement; complications: subdural empyema, cortical venous thrombosis, infarcts"],
["Japanese Encephalitis", "T2 / FLAIR", "Bilateral thalamic hyperintensity (hallmark); substantia nigra; basal ganglia"],
["Anti-NMDA-R Encephalitis", "FLAIR", "Often normal; may have hippocampal, cingulate, frontal FLAIR signal"],
["Cryptococcal meningitis", "T2 / FLAIR", "Dilated Virchow-Robin spaces (gelatinous pseudocysts); basal meningitis; hydrocephalus"],
["Brain abscess", "T1+Gad / DWI", "Ring-enhancing wall (T1); T2-hypointense capsule; DWI restricted diffusion in pus (distinguishes from tumour)"],
["CVST", "MRV / T1", "Absent flow on MRV; T1 iso-hyperintense clot in sinus; haemorrhagic venous infarcts"],
],
col_widths=[3.5*cm, 3*cm, 10*cm]
))
# ── CSF ──────────────────────────────────────────────────────────────────────
story.append(PageBreak())
story.append(h1("STEP 4D — CSF ANALYSIS (The Cornerstone)"))
story.append(sp(4))
story += h2("Contraindications to LP")
for b in [
"Signs of raised ICP — papilledema, Cushing's triad (HTN + bradycardia + irregular breathing)",
"Focal deficit suggesting mass lesion — do CT first",
"Coagulopathy — platelets <50,000 or INR >1.5",
"Infection at the proposed puncture site",
]:
story.append(bullet(b))
story.append(warn("Brain abscess: LP plays NO role in diagnosis and risks herniation. CT-guided aspiration + antibiotics is the standard."))
story.append(sp(4))
story += h2("CSF Profile Comparison")
story.append(make_table(
["Parameter", "Normal", "Bacterial", "Viral", "TBM", "Cryptococcal"],
[
["Opening pressure", "70–180 mm H₂O", ">200 (may be 400–500)", "Normal to ↑", "200–400", "↑↑ often >250"],
["Appearance", "Clear, colourless", "Turbid / purulent", "Clear", "Xanthochromic; forms cobweb", "Clear / opalescent"],
["WBC (cells/μL)", "<5", "10–10,000 (PMN >80%)", "50–1000 (lymphocytes)", "100–500 (lymphocytes)", "10–500 (lymphocytes)"],
["Glucose (mg/dL)", "45–85", "<40 (hypoglycorrhachia)", "Normal 40–80", "Low <45", "Low <45"],
["CSF:Serum glucose", ">0.6", "<0.4 (highly suggestive)", "Normal >0.6", "<0.4", "<0.4"],
["Protein (mg/dL)", "15–45", ">100 (often >200)", "60–100 (mild ↑)", ">100 (markedly ↑)", ">100"],
["Gram stain", "–", "Positive >60%", "–", "– (AFB rare)", "–"],
["Culture", "–", "Positive >80%", "Viral culture 65–75%", "AFB (6–8 wk)", "Fungal culture"],
["Special tests", "–", "BioFire PCR panel (1h result)", "Viral PCR (HSV, Enterovirus)", "ADA >10 U/L; MTB PCR; AFB", "India Ink; CrAg (>95% sens)"],
],
col_widths=[3.5*cm, 2.6*cm, 2.8*cm, 2.8*cm, 2.8*cm, 2.9*cm]
))
story.append(sp(4))
story += h2("CSF Pearls")
pearls = [
"<b>CSF lactate >3.5 mmol/L</b> strongly favours bacterial over viral meningitis — useful when Gram stain is negative.",
"<b>ADA >10 U/L</b> in CSF: sensitivity 59%, specificity 96% for TBM.",
"<b>BioFire ME Panel (multiplex PCR):</b> detects 14 pathogens (bacterial + viral + Cryptococcus) in 1 hour.",
"<b>HSV PCR:</b> sensitivity 96%, specificity 99% when performed 72h after symptom onset.",
"<b>Early enteroviral meningitis:</b> PMN may predominate in first 24–48h in ~50% of cases — can mimic bacterial.",
"<b>Cobweb clot</b> on standing CSF = classic TBM feature (high protein + fibrinogen).",
"<b>India Ink</b> positive in 60–70% of cryptococcal meningitis; Cryptococcal Antigen (CrAg) is faster and >95% sensitive.",
"<b>CSF/serum glucose <0.4</b> is highly suggestive of bacterial, fungal, or tuberculous meningitis.",
]
for p in pearls:
story.append(bullet(p))
# ── STEP 5 ───────────────────────────────────────────────────────────────────
story.append(PageBreak())
story.append(h1("STEP 5 — SPECIFIC CONDITIONS"))
story.append(sp(4))
# Bacterial
story += h2("5A. Bacterial Meningitis — Organisms by Age")
story.append(make_table(
["Age Group", "Common Organisms", "Notes"],
[
["Neonates <1 month", "GBS (S. agalactiae), E. coli (K1), Listeria", "Ampicillin + Cefotaxime empirically"],
["Infants 1–3 months", "GBS, E. coli, H. influenzae, S. pneumoniae", "Ampicillin + Cefotaxime or Ceftriaxone"],
["Children 3m – 5y", "H. influenzae, S. pneumoniae, N. meningitidis", "Hib vaccine has greatly reduced H. influenzae"],
["Adults <55 (immunocompetent)", "S. pneumoniae, N. meningitidis", "Ceftriaxone + Vancomycin"],
["Adults >55 / Alcoholic", "S. pneumoniae, N. meningitidis, Listeria", "Add Ampicillin to cover Listeria"],
["Post-neurosurgery / Trauma", "S. aureus, CoNS, Klebsiella, Pseudomonas", "Vancomycin + Ceftazidime / Meropenem"],
["HIV / Immunocompromised", "Cryptococcus, Listeria, Gram-negative rods", "Add Amphotericin if Crypto suspected"],
],
col_widths=[3.5*cm, 6*cm, 7*cm]
))
story.append(sp(6))
story += h2("5B. Herpes Simplex Encephalitis (HSE)")
for b in [
"Pathogen: HSV-1 (adults); HSV-2 (neonates, immunocompromised)",
"Predilection: temporal and orbitofrontal lobes (trigeminal ganglion reactivation route)",
"Clinical: Fever + Headache + Altered consciousness + Personality/behavioural changes (first sign, may mimic psychiatry) + Temporal lobe seizures + Aphasia + Psychosis/hallucinations",
"Diagnosis: CSF HSV PCR (sens 96%, spec 99%); MRI T2/FLAIR temporal hyperintensity (within 48h); EEG = PLEDs (periodic lateralised epileptiform discharges)",
"Treatment: Acyclovir 10 mg/kg IV q8h for 14–21 days — start EMPIRICALLY even before CSF results",
]:
story.append(bullet(b))
story.append(sp(6))
story += h2("5C. Tuberculous Meningitis (TBM)")
story.append(make_table(
["Phase", "Duration", "Features"],
[
["Prodrome", "1–3 weeks", "Malaise, fatigue, anorexia, low-grade fever, headache, mild behavioural change"],
["Meningitic", "Days–weeks", "Worsening headache, neck stiffness, vomiting, photophobia, CN palsies (III, VI, VII), hyponatraemia (SIADH)"],
["Advanced", "Late", "Stupor, coma, hemiplegia, decerebrate posturing, communicating hydrocephalus"],
],
col_widths=[3*cm, 3*cm, 10.5*cm]
))
story.append(sp(3))
story.append(h3("MRC Grading:"))
story.append(make_table(
["Grade", "Consciousness", "Deficit"],
[
["Grade I", "GCS 15", "No focal deficit"],
["Grade II", "GCS 11–14", "OR any focal deficit"],
["Grade III", "GCS ≤10", "Any neurological deficit"],
],
col_widths=[2.5*cm, 4*cm, 10*cm]
))
story.append(sp(3))
story.append(h3("Treatment — Anti-TB Therapy (ATT):"))
for b in [
"Intensive phase (2 months): HRZE — Isoniazid + Rifampicin + Pyrazinamide + Ethambutol",
"Continuation phase (7–10 months): HR (± Ethambutol)",
"STEROIDS ARE MANDATORY: Dexamethasone 0.4 mg/kg/day (Grade II/III) OR Prednisolone 60 mg/day — taper over 6–8 weeks (reduces mortality and neurological sequelae)",
"Pyridoxine 25–50 mg/day with INH to prevent peripheral neuropathy",
"Manage SIADH: fluid restriction; hypertonic saline if Na+ <120 or symptomatic",
"Communicating hydrocephalus: serial LP; VP shunt if refractory",
]:
story.append(bullet(b))
story.append(sp(6))
story += h2("5D. Cryptococcal Meningitis")
for b in [
"Setting: HIV (CD4 <100 cells/μL), transplant, steroids, lymphoma",
"Clinical: Subacute-chronic; headache dominant; fever low-grade or absent; meningism often minimal; RAISED ICP is the most dangerous feature",
"Diagnosis: CrAg (>95% sens — fastest); India Ink 60–70%; Fungal culture",
"Induction (2 wk): Liposomal Amphotericin B 3–4 mg/kg/day + Flucytosine 25 mg/kg QDS",
"Consolidation (8 wk): Fluconazole 400 mg/day",
"Maintenance: Fluconazole 200 mg/day until CD4 >200 on ART for 6 months",
"ICP management: Therapeutic LP daily until opening pressure <200 mm H₂O",
]:
story.append(bullet(b))
# ── STEP 6 ───────────────────────────────────────────────────────────────────
story.append(PageBreak())
story.append(h1("STEP 6 — EMPIRICAL TREATMENT PROTOCOL"))
story.append(sp(4))
story.append(alert("ANTIBIOTICS FIRST, INVESTIGATIONS SECOND in any critically ill patient.\nDo NOT wait for: CT scan · Blood culture results · LP results\nTime to antibiotics target: <60 minutes from patient arrival."))
story.append(sp(6))
story += h2("Empirical Regimen by Clinical Scenario (Harrison's 22E, Table 143-1)")
story.append(make_table(
["Clinical Scenario", "Empirical Regimen"],
[
["Immunocompetent adult <55", "Ceftriaxone 2g IV q12h + Vancomycin 15–20 mg/kg IV q8–12h"],
["Adult >55 / Alcoholic / Immunosuppressed", "Ceftriaxone 2g IV q12h + Vancomycin + Ampicillin 2g IV q4h (cover Listeria)"],
["Post-neurosurgery / Hospital-acquired / Neutropenic", "Vancomycin + Ceftazidime 2g IV q8h OR Meropenem 2g IV q8h"],
["HSV encephalitis suspected (temporal features)", "+ Acyclovir 10 mg/kg IV q8h — add to above regimen"],
["TBM suspected", "Start HRZE + Dexamethasone 0.4 mg/kg/day"],
["Cryptococcal suspected (HIV/immunocompromised)", "Liposomal Amphotericin B + Flucytosine"],
["Cerebral malaria", "Artesunate IV 2.4 mg/kg at 0h, 12h, 24h, then daily"],
["Neonates", "Ampicillin + Cefotaxime"],
["Rickettsial (suspected)", "Doxycycline 100 mg IV/PO q12h"],
],
col_widths=[6*cm, 10.5*cm]
))
story.append(sp(6))
story += h2("Dexamethasone as Adjunct in Bacterial Meningitis")
story.append(green("Dexamethasone 0.15 mg/kg IV q6h for 4 days.\nGive 15–20 minutes BEFORE or WITH the first antibiotic dose.\nProven benefit: reduces mortality and neurological sequelae in pneumococcal meningitis.\nDiscontinue if organism is NOT S. pneumoniae (less evidence for others)."))
story.append(sp(6))
story += h2("Antibiotic Doses (Harrison's 22E)")
story.append(make_table(
["Antibiotic", "Adult Dose", "Duration"],
[
["Ceftriaxone", "2g IV q12h", "7 days (meningococcus); 10–14 days (pneumococcus)"],
["Cefotaxime", "3g IV q6h (12g/day)", "Same as above"],
["Vancomycin", "15–20 mg/kg IV q8–12h (AUC-guided)", "With Ceftriaxone until sensitivities known"],
["Ampicillin", "2g IV q4h (12g/day)", "21 days (Listeria)"],
["Meropenem", "2g IV q8h", "21 days (gram-negative)"],
["Acyclovir", "10 mg/kg IV q8h (adjust for renal function)", "14–21 days (HSV)"],
["Metronidazole", "500 mg IV q8h", "Added for brain abscess (anaerobes)"],
],
col_widths=[3.5*cm, 5.5*cm, 7.5*cm]
))
# ── STEP 7 ───────────────────────────────────────────────────────────────────
story.append(PageBreak())
story.append(h1("STEP 7 — COMPLICATIONS AND MANAGEMENT"))
story.append(sp(4))
story.append(make_table(
["Complication", "How to Detect", "Management"],
[
["Raised ICP / Herniation", "Cushing's triad (HTN + bradycardia + irregular breathing), pupil changes, posturing", "Mannitol 1g/kg IV; elevate HOB 30°; hyperventilate to pCO₂ 30–35; urgent neurosurgery"],
["Status epilepticus", "EEG monitoring; clinical observation", "Lorazepam 0.1 mg/kg IV; then Levetiracetam or Phenytoin"],
["Hyponatraemia (SIADH)", "Serum Na+ <135; serum hypo-osmolality + urine hyperosmolality", "Fluid restriction; hypertonic saline 3% if Na+ <120 or symptomatic seizures"],
["Septic shock", "MAP <65 mmHg, lactate >2, poor urine output", "Norepinephrine first-line vasopressor; hydrocortisone if refractory"],
["DIC (meningococcaemia)", "Coagulation profile (PT↑, APTT↑, fibrinogen↓, D-dimer↑), petechiae", "FFP, platelet transfusion; address underlying infection"],
["Subdural empyema", "MRI contrast — crescentic extra-axial collection with restricted diffusion", "URGENT neurosurgical drainage + prolonged antibiotics"],
["Communicating hydrocephalus (TBM)", "Serial CT head, increasing headache, deteriorating GCS", "Serial LP (TBM); VP shunt if refractory"],
["Waterhouse-Friderichsen syndrome", "Bilateral adrenal haemorrhage in meningococcaemia; hypotension unresponsive to fluids", "Stress-dose hydrocortisone 100 mg IV q8h"],
["Cerebral venous sinus thrombosis (CVST)", "MRV; haemorrhagic venous infarcts on MRI", "Anticoagulation (LMWH / heparin) even with haemorrhage"],
["Brain herniation patterns", "Uncal: ipsilateral fixed dilated pupil + contralateral hemiplegia; Transtentorial: bilateral signs, Cushing's", "Emergency mannitol + intubation + neurosurgery"],
],
col_widths=[4*cm, 5*cm, 7.5*cm]
))
# ── STEP 8 — Quick Ref ───────────────────────────────────────────────────────
story.append(PageBreak())
story.append(h1("STEP 8 — QUICK REFERENCE SUMMARY"))
story.append(sp(4))
story += h2("8A. Decision Algorithm — LP vs CT First")
algo = [
"Patient arrives: Febrile + Altered Sensorium",
" ↓",
"STABILIZE: ABC + Bedside Glucose + IV access + O2",
" ↓",
"Papilledema? Focal deficit? GCS <12? Immunocompromised? Age >60?",
" YES → CT head FIRST → if no mass, proceed to LP",
" NO → LP directly (blood cultures + start empirical Abx simultaneously)",
" ↓",
"CSF: PMN + Low glucose + High protein → BACTERIAL → Continue Abx + Dexamethasone",
"CSF: Lymphocytes + Normal glucose → VIRAL → Acyclovir (HSV) vs Supportive",
"CSF: Lymphocytes + Low glucose + High protein → TBM/FUNGAL → ATT vs Ampho-B + CrAg",
]
for line in algo:
story.append(Paragraph(line, ParagraphStyle("algo", fontSize=8.5, fontName="Courier",
leading=13, spaceAfter=1, leftIndent=10)))
story.append(sp(6))
story += h2("8B. Duration of Antibiotics")
story.append(make_table(
["Organism", "Duration"],
[
["N. meningitidis", "7 days"],
["H. influenzae", "7–10 days"],
["S. pneumoniae", "10–14 days"],
["L. monocytogenes", "21 days"],
["Gram-negative enteric rods", "21 days"],
["TBM (ATT)", "9–12 months total (2 HRZE + 7-10 HR)"],
["Brain abscess", "6–8 weeks IV ± continued oral"],
["HSV encephalitis", "14–21 days Acyclovir"],
],
col_widths=[6*cm, 10.5*cm]
))
story.append(sp(6))
story += h2("8C. Organisms and Gram Stain Guide")
story.append(make_table(
["Organism", "Gram Stain", "Age/Risk Group"],
[
["S. pneumoniae", "Gram +ve diplococci (lancet-shaped)", "All adults; elderly; post-splenectomy"],
["N. meningitidis", "Gram –ve diplococci (kidney-shaped)", "Young adults, children; petechial rash"],
["L. monocytogenes", "Gram +ve rods", ">55, immunocompromised, pregnancy"],
["H. influenzae type b", "Gram –ve coccobacilli", "Children <5y (pre-vaccine era)"],
["E. coli", "Gram –ve rods", "Neonates"],
["Cryptococcus neoformans", "India Ink (encapsulated yeast)", "HIV, CD4 <100"],
],
col_widths=[5*cm, 5*cm, 6.5*cm]
))
story.append(sp(8))
story += h2("References")
refs = [
"Harrison's Principles of Internal Medicine 22E (2025, McGraw Hill) — Chapters 142, 143",
"Bradley and Daroff's Neurology in Clinical Practice — Chapter 79",
"Goldman-Cecil Medicine International Edition — Chapters 381, 367",
"Rosen's Emergency Medicine 9E — Chapter 95",
"Jawetz Melnick & Adelbergs Medical Microbiology 28E — Chapter 48",
"Harriet Lane Handbook 23E — Chapter 17",
"Murray & Nadel's Textbook of Respiratory Medicine — CNS Tuberculosis",
]
for r in refs:
story.append(Paragraph(f"• {r}", ParagraphStyle("ref", fontSize=8, leading=11,
textColor=MID_GREY, leftIndent=14, firstLineIndent=-10, spaceAfter=2)))
# ── BUILD ────────────────────────────────────────────────────────────────────
doc.build(story, onFirstPage=draw_header_footer, onLaterPages=draw_header_footer)
print(f"PDF generated: {OUTPUT}")
cd /tmp/workspace/febrile-altered-sensorium && python generate_pdf.py 2>&1
ls -lh /tmp/workspace/febrile-altered-sensorium/
Febrile Altered Sensorium Casualty Notes
PDF Document · PDF
| Section | Content |
|---|---|
| Cover page | Title banner, scope/level info, contents at a glance |
| Step 0 | Colour-coded ABCDEG stabilization table |
| Step 1 | Meningitis vs Encephalitis syndrome definition + meningeal sign sensitivity/specificity table |
| Step 2 | Timeline blocks — Hyperacute / Acute / Subacute / Chronic differentials |
| Step 3 | Full bedside differentiation table (Bacterial / HSV / TBM / JE / Autoimmune) |
| Step 4 | Blood tests + CT head indications + MRI findings per condition + full CSF comparison table with pearls |
| Step 5 | Organisms by age, HSE profile, TBM phases + MRC grading + ATT regimen, Cryptococcal management |
| Step 6–7 | Empirical treatment table, antibiotic doses, dexamethasone protocol, complications table |
| Step 8 | Decision algorithm, duration of antibiotics, Gram stain guide, references |
Give me a nice notes of autoimmune encephalitis from harrison and update book
autoimmune encephalitis anti-NMDA receptor diagnosis treatment
PMID: 40472799
PMID: 39893022
ls /tmp/workspace/febrile-altered-sensorium/ && python3 -c "from reportlab.lib.pagesizes import A4; print('reportlab ok')"
mkdir -p /tmp/workspace/autoimmune-encephalitis && echo "dir ready"
cd /tmp/workspace/autoimmune-encephalitis && curl -s -o pathomech.png "https://cdn.orris.care/cdss_images/de627fc24f67e3e04d6d7f7687680a3395fa8004393901625f729e249bf60f89.png" && echo "image downloaded: $(ls -lh pathomech.png)"
~/autoimmune-encephalitis/generate_ae_pdf.py
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm, mm
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
HRFlowable, PageBreak, Image, KeepTogether
)
from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_JUSTIFY
from reportlab.lib.colors import HexColor
import datetime, os
OUTPUT = "/tmp/workspace/autoimmune-encephalitis/Autoimmune_Encephalitis_Notes.pdf"
IMG_PATHOMECH = "/tmp/workspace/autoimmune-encephalitis/pathomech.png"
W, H = A4
# ── Colour palette ──────────────────────────────────────────────────────────
DARK_TEAL = HexColor("#0f4c5c")
MED_TEAL = HexColor("#0e7490")
LIGHT_TEAL = HexColor("#cffafe")
ACCENT_PURP = HexColor("#7c3aed")
ACCENT_RED = HexColor("#dc2626")
ACCENT_AMB = HexColor("#d97706")
ACCENT_GRN = HexColor("#16a34a")
LIGHT_GREY = HexColor("#f1f5f9")
MID_GREY = HexColor("#64748b")
TABLE_HEAD = HexColor("#0e7490")
TABLE_ALT = HexColor("#ecfeff")
WHITE = colors.white
BLACK = colors.black
GOLD = HexColor("#854d0e")
# ── Header/Footer ────────────────────────────────────────────────────────────
def draw_hf(canvas, doc):
canvas.saveState()
canvas.setFillColor(DARK_TEAL)
canvas.rect(0, H - 1.9*cm, W, 1.9*cm, fill=1, stroke=0)
canvas.setFillColor(WHITE)
canvas.setFont("Helvetica-Bold", 11)
canvas.drawString(1.2*cm, H - 1.3*cm, "AUTOIMMUNE ENCEPHALITIS — Complete Clinical Notes")
canvas.setFont("Helvetica", 8.5)
canvas.drawRightString(W - 1.2*cm, H - 1.3*cm, f"Page {doc.page}")
# Bottom
canvas.setFillColor(DARK_TEAL)
canvas.rect(0, 0, W, 0.9*cm, fill=1, stroke=0)
canvas.setFillColor(WHITE)
canvas.setFont("Helvetica-Oblique", 7.5)
canvas.drawString(1.2*cm, 0.32*cm,
"Sources: Harrison's 22E (2025) · Adams & Victor's Neurology 12E · Rheumatology 2022 · Washington Manual · PubMed 2025 Meta-Analysis [PMID: 40472799]")
canvas.restoreState()
# ── Document ─────────────────────────────────────────────────────────────────
doc = SimpleDocTemplate(
OUTPUT, pagesize=A4,
rightMargin=1.8*cm, leftMargin=1.8*cm,
topMargin=2.7*cm, bottomMargin=1.5*cm,
title="Autoimmune Encephalitis Notes",
author="Medical Education"
)
# ── Styles ────────────────────────────────────────────────────────────────────
base = getSampleStyleSheet()
def S(name, parent="Normal", **kw):
return ParagraphStyle(name, parent=base[parent], **kw)
sH1 = S("sH1", "Normal", fontSize=14, textColor=WHITE, fontName="Helvetica-Bold",
backColor=DARK_TEAL, spaceBefore=12, spaceAfter=5, borderPad=7)
sH2 = S("sH2", "Normal", fontSize=11, textColor=DARK_TEAL, fontName="Helvetica-Bold",
spaceBefore=9, spaceAfter=3)
sH3 = S("sH3", "Normal", fontSize=9.5, textColor=MED_TEAL, fontName="Helvetica-Bold",
spaceBefore=6, spaceAfter=2)
sBody = S("sBody","Normal", fontSize=8.5, leading=13, spaceAfter=3)
sBullet = S("sBullet","Normal", fontSize=8.5, leading=13,
leftIndent=14, firstLineIndent=-10, spaceAfter=2)
sBullet2 = S("sBullet2","Normal", fontSize=8, leading=12,
leftIndent=26, firstLineIndent=-10, spaceAfter=1.5)
sWarn = S("sWarn","Normal", fontSize=8.5, leading=12,
backColor=HexColor("#fff7ed"), textColor=HexColor("#92400e"),
borderColor=ACCENT_AMB, borderWidth=1, borderPad=5,
spaceBefore=4, spaceAfter=4)
sAlert = S("sAlert","Normal", fontSize=8.5, leading=12,
backColor=HexColor("#fef2f2"), textColor=ACCENT_RED,
borderColor=ACCENT_RED, borderWidth=1, borderPad=5,
spaceBefore=4, spaceAfter=4)
sGreen = S("sGreen","Normal", fontSize=8.5, leading=12,
backColor=HexColor("#f0fdf4"), textColor=HexColor("#14532d"),
borderColor=ACCENT_GRN, borderWidth=1, borderPad=5,
spaceBefore=4, spaceAfter=4)
sPurple = S("sPurple","Normal", fontSize=8.5, leading=12,
backColor=HexColor("#f5f3ff"), textColor=ACCENT_PURP,
borderColor=ACCENT_PURP, borderWidth=1, borderPad=5,
spaceBefore=4, spaceAfter=4)
sCaption = S("sCaption","Normal", fontSize=7.5, textColor=MID_GREY,
alignment=TA_CENTER, spaceAfter=5, spaceBefore=2)
sQuote = S("sQuote","Normal", fontSize=8, leading=12, textColor=GOLD,
leftIndent=15, rightIndent=10, spaceAfter=4,
borderWidth=0, fontName="Helvetica-Oblique")
sTH = S("sTH","Normal", fontSize=8, textColor=WHITE, fontName="Helvetica-Bold", leading=10)
sTD = S("sTD","Normal", fontSize=7.8, leading=10.5, textColor=BLACK)
# ── Helpers ───────────────────────────────────────────────────────────────────
def h1(t): return Paragraph(f" {t}", sH1)
def h2(t): return [HRFlowable(width="100%", thickness=2, color=MED_TEAL, spaceBefore=6, spaceAfter=2),
Paragraph(t, sH2)]
def h3(t): return Paragraph(t, sH3)
def body(t): return Paragraph(t, sBody)
def b1(t): return Paragraph(f"• {t}", sBullet)
def b2(t): return Paragraph(f" – {t}", sBullet2)
def warn(t): return Paragraph(f"⚠ {t}", sWarn)
def alert(t): return Paragraph(f"🔴 {t}", sAlert)
def green(t): return Paragraph(f"✔ {t}", sGreen)
def purple(t): return Paragraph(f"★ {t}", sPurple)
def sp(h=4): return Spacer(1, h)
def hr(): return HRFlowable(width="100%", thickness=0.5, color=LIGHT_GREY, spaceBefore=3, spaceAfter=3)
def tbl(headers, rows, cw=None, zebra=True):
data = [[Paragraph(f"<b>{h}</b>", sTH) for h in headers]]
for row in rows:
data.append([Paragraph(str(c), sTD) for c in row])
cw = cw or [(W-3.6*cm)/len(headers)]*len(headers)
t = Table(data, colWidths=cw, repeatRows=1)
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), TABLE_HEAD),
("ROWBACKGROUNDS",(0,1),(-1,-1),[WHITE, TABLE_ALT] if zebra else [WHITE]),
("GRID",(0,0),(-1,-1),0.35,HexColor("#a5f3fc")),
("VALIGN",(0,0),(-1,-1),"MIDDLE"),
("TOPPADDING",(0,0),(-1,-1),4),("BOTTOMPADDING",(0,0),(-1,-1),4),
("LEFTPADDING",(0,0),(-1,-1),5),("RIGHTPADDING",(0,0),(-1,-1),5),
]))
return t
CW = W - 3.6*cm # content width
# ══════════════════════════════════════════════════════════════════════════════
# BUILD STORY
# ══════════════════════════════════════════════════════════════════════════════
story = []
# ── COVER ─────────────────────────────────────────────────────────────────────
story.append(sp(8))
cover = Table([[Paragraph(
'<font size="24" color="white"><b>AUTOIMMUNE ENCEPHALITIS</b></font><br/>'
'<font size="12" color="#a5f3fc">Complete Clinical Notes — Pathogenesis · Antibodies · Diagnosis · Treatment</font>',
ParagraphStyle("cv", alignment=TA_CENTER, leading=32))]], colWidths=[CW])
cover.setStyle(TableStyle([
("BACKGROUND",(0,0),(-1,-1),DARK_TEAL),
("TOPPADDING",(0,0),(-1,-1),20),("BOTTOMPADDING",(0,0),(-1,-1),20),
("LEFTPADDING",(0,0),(-1,-1),18),
]))
story.append(cover)
story.append(sp(14))
# Info strip
info_data = [
Paragraph('<font color="white"><b>SPECIALITY</b></font><br/><font color="#a5f3fc" size="9">Neurology / Internal Medicine</font>', ParagraphStyle("inf", alignment=TA_CENTER, leading=14)),
Paragraph('<font color="white"><b>PRESENTATION</b></font><br/><font color="#a5f3fc" size="9">Subacute Encephalopathy</font>', ParagraphStyle("inf", alignment=TA_CENTER, leading=14)),
Paragraph('<font color="white"><b>PRIMARY SOURCE</b></font><br/><font color="#a5f3fc" size="9">Harrison\'s 22E (Dalmau & Graus)</font>', ParagraphStyle("inf", alignment=TA_CENTER, leading=14)),
Paragraph(f'<font color="white"><b>UPDATED</b></font><br/><font color="#a5f3fc" size="9">PubMed 2025 Meta-Analysis</font>', ParagraphStyle("inf", alignment=TA_CENTER, leading=14)),
]
info_row = Table([info_data], colWidths=[CW/4]*4)
info_row.setStyle(TableStyle([
("BACKGROUND",(0,0),(-1,-1),MED_TEAL),
("TOPPADDING",(0,0),(-1,-1),10),("BOTTOMPADDING",(0,0),(-1,-1),10),
("GRID",(0,0),(-1,-1),0.5,WHITE),
]))
story.append(info_row)
story.append(sp(16))
# Contents
story.append(Paragraph("<b>Table of Contents</b>", S("tc", fontSize=12, textColor=DARK_TEAL, spaceAfter=8)))
toc_items = [
("1", "Introduction & Epidemiology"),
("2", "Classification — Antibody Subtypes"),
("3", "Pathogenesis (Harrison's Figure 99-3)"),
("4", "Specific Syndromes — Anti-NMDA-R · LGI1 · CASPR2 · AMPA-R · GABA-B · MOG · Others"),
("5", "Clinical Approach & Diagnostic Criteria (Graus Criteria 2016)"),
("6", "Investigations — CSF · MRI · EEG · Antibody Testing · APE2 Score"),
("7", "Paraneoplastic vs Non-Paraneoplastic — Tumour Screening"),
("8", "Treatment Algorithm — First Line · Second Line · Refractory"),
("9", "Prognosis & Outcomes (2025 Meta-Analysis Update)"),
("10", "Key Differentials & Mimics"),
]
for num, desc in toc_items:
r = Table([[
Paragraph(f"<b>{num}</b>", S("tn", fontSize=9, textColor=WHITE, alignment=TA_CENTER)),
Paragraph(desc, S("td", fontSize=9, textColor=DARK_TEAL))
]], colWidths=[1.6*cm, CW-1.6*cm])
r.setStyle(TableStyle([
("BACKGROUND",(0,0),(0,0),MED_TEAL),
("BACKGROUND",(1,0),(1,0),LIGHT_TEAL),
("TOPPADDING",(0,0),(-1,-1),5),("BOTTOMPADDING",(0,0),(-1,-1),5),
("LEFTPADDING",(0,0),(-1,-1),8),
("GRID",(0,0),(-1,-1),0.3,HexColor("#67e8f9")),
]))
story.append(r); story.append(sp(2))
story.append(PageBreak())
# ── SECTION 1: INTRODUCTION ───────────────────────────────────────────────────
story.append(h1("1. INTRODUCTION & EPIDEMIOLOGY"))
story.append(sp(6))
story += h2("Definition")
story.append(body(
"Autoimmune encephalitis (AE) is a group of inflammatory brain disorders characterized by "
"<b>prominent neuropsychiatric symptoms</b> and, in most cases, autoantibodies against neural "
"(neuronal or glial) antigens. The clinical presentation occurs over a <b>subacute timeframe "
"(generally <3 months)</b> and consists of a wide spectrum of neuropsychiatric features "
"including progressive cognitive decline, memory deficits, confusion, and behavioral changes."
))
story.append(sp(4))
story += h2("Epidemiology")
for b in [
"Overall incidence of autoimmune (paraneoplastic + non-paraneoplastic) encephalitis is <b>now estimated to be similar to that of infectious encephalitis</b> — a landmark shift in clinical thinking (Adams & Victor's 12E).",
"Most frequent AE subtypes: Anti-NMDA-R encephalitis, ADEM (MOG-Ab in 60%), and Limbic Encephalitis (anti-LGI1 most frequent).",
"Anti-NMDA-R and ADEM predominate in <b>children and young adults</b>; Limbic Encephalitis (LGI1) usually affects <b>patients older than 50 years</b>.",
"Autoimmune encephalitis triggered by <b>immune checkpoint inhibitors</b> (cancer immunotherapy) is a newly recognised and increasingly common cause — always consider in oncology patients.",
"In ~60% of paraneoplastic cases, the neurologic symptoms <b>precede the cancer diagnosis</b>.",
]:
story.append(b1(b))
story.append(sp(4))
story.append(sQuote and Paragraph(
'"As the detection of autoantibodies against neuronal and glial cell surface antigens has increased '
'in recent years, it is currently estimated that the overall incidence of autoimmune encephalitis is '
'similar to that of infectious encephalitis." — Adams & Victor\'s Neurology 12E',
sQuote))
# ── SECTION 2: CLASSIFICATION ─────────────────────────────────────────────────
story.append(PageBreak())
story.append(h1("2. CLASSIFICATION OF AUTOIMMUNE ENCEPHALITIS"))
story.append(sp(6))
story += h2("Based on Antibody Target Location")
story.append(body(
"The most important classification divides AE by whether the target antigen is "
"<b>intracellular</b> or on the <b>cell surface / synaptic</b>. This distinction has "
"profound implications for pathogenesis, tumour association, and response to treatment."
))
story.append(sp(4))
story.append(tbl(
["Category", "Target", "Mechanism", "Tumour Assoc.", "Treatment Response"],
[
["Cell-surface / Synaptic antibodies\n(Low/Intermediate risk for tumour)",
"NMDAR, LGI1, CASPR2, AMPA-R, GABA-B/A, DPPX, GlyR, mGluR1",
"Antibody-mediated: receptor crosslinking & internalization (NMDAR); functional blockade (GABA-R); protein-protein disruption (LGI1)",
"Variable (rare for LGI1; 50% for AMPA-R; >45% for GABA-B)",
"Good — respond to immunotherapy"],
["Intracellular antibodies\n(High risk for tumour — >70%)",
"Hu (ANNA1), Yo (PCA1), Ri (ANNA2), CRMP5 (CV2), Ma2, Tr (DNER)",
"T-cell mediated cytotoxicity (CD8+ T cells in close contact with degenerating neurons); antibodies are markers, not pathogenic",
"Very high (>70% have underlying cancer — SCLC, ovary, breast, testis)",
"Poor — treat underlying tumour; neurological damage often irreversible"],
],
cw=[3.5*cm, 4*cm, 4*cm, 3*cm, 2.5*cm]
))
story.append(sp(4))
story += h2("Tumour Risk Classification (Harrison's 22E, Tables 99-2/3/4)")
story.append(sp(3))
story.append(tbl(
["Risk Category", "Antibodies", "Associated Tumours"],
[
["HIGH RISK >70%\n(intracellular antigens)",
"Anti-Hu (ANNA1), Anti-Yo (PCA1), Anti-Ri (ANNA2), Anti-CRMP5 (CV2), Anti-Tr (DNER), Anti-Ma2, Anti-PCA2 (MAP1B), Anti-GFAP (in some)",
"SCLC, Ovary/Breast (Yo), Hodgkin lymphoma (Tr), Testicular (Ma2), Thymoma"],
["INTERMEDIATE RISK 30–70%\n(cell-surface antigens)",
"Anti-NMDAR, Anti-AMPA-R, Anti-GABA-B, Anti-mGluR5, Anti-DNER",
"Ovarian teratoma (NMDAR in females ≥12y); SCLC (GABA-B); Breast/lung (AMPA-R)"],
["LOW RISK <30%\n(cell-surface antigens)",
"Anti-LGI1, Anti-CASPR2, Anti-GABA-A, Anti-DPPX, Anti-GlyR, Anti-IgLON5, Anti-mGluR1, Anti-neurexin-3α",
"LGI1: rarely tumour-associated; CASPR2: ~20% thymoma; GABA-A: thymoma in some"],
],
cw=[3.5*cm, 7.5*cm, 6*cm]
))
story.append(warn("High-risk (intracellular antigen) antibodies = markers of T-cell-mediated neuronal death. The antibodies themselves are NOT directly pathogenic. Therefore, immunotherapy has limited benefit — the priority is TUMOUR TREATMENT."))
# ── SECTION 3: PATHOGENESIS ───────────────────────────────────────────────────
story.append(PageBreak())
story.append(h1("3. PATHOGENESIS"))
story.append(sp(6))
story += h2("Two Main Triggers (Harrison's Figure 99-3)")
for b in [
"<b>Trigger A — Herpes Simplex Encephalitis:</b> HSV-induced neuronal destruction releases neuronal antigens. These are loaded into antigen-presenting cells (APCs/dendritic cells) and transported to deep cervical lymph nodes. Naive B cells, with CD4+ T-cell cooperation, become antigen-experienced and differentiate into antibody-producing plasma cells. Memory B cells enter the brain, undergo antigen-driven clonal expansion, and produce antibodies intrathecally.",
"<b>Trigger B — Systemic Tumours:</b> Tumor cells ectopically express neural proteins. Antigens are processed by APCs in regional lymph nodes → memory B cells → antibodies. The antibodies cross the blood-brain barrier and target similar proteins expressed on neurons.",
"<b>Other triggers:</b> Genetic susceptibility (HLA associations — IgLON5: HLA-DRB1*10:01); immune checkpoint inhibitor therapy; unknown immunologic triggers.",
]:
story.append(b1(b))
story.append(sp(6))
# Insert pathomech image
if os.path.exists(IMG_PATHOMECH):
img = Image(IMG_PATHOMECH, width=CW*0.9, height=CW*0.9*0.55)
story.append(img)
story.append(Paragraph(
"FIGURE 99-3 (Harrison's 22E) — Proposed mechanisms of disease and functional interactions of autoantibodies "
"with neuronal surface proteins. (A) HSV trigger, (B) Tumour trigger, (C) Memory B-cell intrathecal differentiation, "
"(D) GABA-R: functional blockade, (E) NMDAR: receptor crosslinking + internalization → reduced NMDAR density, "
"(F) LGI1: protein-protein disruption → decreased AMPA-R and Kv1 potassium channels.",
sCaption))
story.append(sp(4))
story += h2("Mechanisms of Antibody-Mediated Neuronal Dysfunction")
story.append(tbl(
["Antibody", "Mechanism", "Functional Effect"],
[
["NMDAR (IgG1)", "Receptor crosslinking and internalization (endocytosis)", "↓ NMDAR density on postsynaptic membrane → disinhibition of dopamine pathway (explains psychosis)"],
["GABA-A/B-R", "Functional blocking of target antigen (prevents GABA binding)", "Reduced inhibitory tone → seizures, status epilepticus"],
["LGI1 (IgG4)", "Disruption of protein-protein interaction (LGI1-ADAM22/23 complex)", "↓ AMPA-R density; ↓ Kv1 potassium channels → faciobrachial dystonic seizures, memory loss"],
["CASPR2 (IgG4)", "Disruption of CASPR2-LGI1-ADAM23 complex", "Peripheral nerve hyperexcitability (Morvan syndrome, neuromyotonia) + CNS symptoms"],
["AMPA-R", "Receptor internalization (like NMDAR)", "Memory deficits; relapsing limbic encephalitis"],
["DPPX", "Antibodies against DPPX (Kv4.2 channel regulatory protein)", "CNS hyperexcitability: seizures, myoclonus, PERM-like picture, GI dysmotility"],
],
cw=[2.5*cm, 5.5*cm, 9*cm]
))
# ── SECTION 4: SPECIFIC SYNDROMES ────────────────────────────────────────────
story.append(PageBreak())
story.append(h1("4. SPECIFIC ANTIBODY SYNDROMES"))
story.append(sp(6))
story += h2("4A. Anti-NMDA Receptor Encephalitis (Most Common)")
story.append(sp(3))
syndrome_box = Table([[Paragraph(
'<b><font color="white">DEMOGRAPHICS:</font></b> <font color="#cffafe">Young women and children predominantly; '
'men and older patients also affected. Most common autoimmune encephalitis overall.</font>',
S("sb", fontSize=9, leading=14))]],
colWidths=[CW])
syndrome_box.setStyle(TableStyle([
("BACKGROUND",(0,0),(-1,-1),DARK_TEAL),
("TOPPADDING",(0,0),(-1,-1),8),("BOTTOMPADDING",(0,0),(-1,-1),8),
("LEFTPADDING",(0,0),(-1,-1),10),
]))
story.append(syndrome_box); story.append(sp(4))
story += h2("Clinical Progression (Characteristic Stages — Harrison's 22E)")
stages = [
("Prodrome\n(Days 1–5)", "Fever, headache, malaise, viral-like illness — resembles aseptic meningitis", ACCENT_GRN),
("Psychiatric Phase\n(Days 5–14)", "Severe psychiatric symptoms: psychosis, agitation, hallucinations, paranoid delusions, bizarre behaviour. Often FIRST presentation to PSYCHIATRIST.", ACCENT_PURP),
("Unresponsive Phase\n(Weeks 2–4)", "Reduced verbal output (mutism), memory loss, catatonia, decreased consciousness, sleep dysfunction (insomnia → hypersomnia)", MED_TEAL),
("Movement Disorder Phase\n(Weeks 3–6)", "Orofacial dyskinesias (lip smacking, chewing), limb and trunk dyskinesias, dystonic postures, stereotyped movements", DARK_TEAL),
("Autonomic Instability\n(Peak illness)", "Tachycardia, bradycardia, hyperhidrosis, hypersalivation, labile BP, cardiac arrhythmia, central hypoventilation (often requires ICU)", ACCENT_RED),
("Seizures", "New-onset seizures or status epilepticus — can occur at any stage", ACCENT_AMB),
("Recovery Phase\n(Months 3–18)", "Slow, months to 1–2 years. 12–24% clinical relapse rate.", ACCENT_GRN),
]
for label, desc, col in stages:
r = Table([[
Paragraph(f"<b>{label}</b>", S("sl", fontSize=8.5, textColor=WHITE, alignment=TA_CENTER, leading=12)),
Paragraph(desc, sTD)
]], colWidths=[3.2*cm, CW-3.2*cm])
r.setStyle(TableStyle([
("BACKGROUND",(0,0),(0,0),col),
("BACKGROUND",(1,0),(1,0),LIGHT_GREY),
("TOPPADDING",(0,0),(-1,-1),6),("BOTTOMPADDING",(0,0),(-1,-1),6),
("LEFTPADDING",(0,0),(-1,-1),8),
("GRID",(0,0),(-1,-1),0.3,HexColor("#94a3b8")),
]))
story.append(r); story.append(sp(2))
story.append(sp(4))
story += h2("Key Features to Remember — Anti-NMDAR (Harrison's 22E)")
for b in [
"Monosymptomatic episodes (e.g., pure psychosis) occur in ~5% — easy to miss",
"Relapses occur in <b>12–24% of patients</b> (12% within first 2 years)",
"<b>MRI:</b> Normal in 65% of cases; 35% show mild, transient FLAIR abnormalities in cortical/subcortical regions; rarely shows contrast enhancement",
"<b>CSF:</b> Most patients have intrathecal synthesis of antibodies by infiltrating plasma cells in brain and meninges; CSF may show lymphocytic pleocytosis",
"<b>EEG:</b> 'Extreme delta brush' pattern — highly characteristic (delta-frequency oscillations with superimposed high-frequency beta bursts) — seen in ~30% of severe cases",
"<b>Tumour association:</b> 46% of females ≥12 years have uni- or bilateral <b>ovarian teratoma</b>; <7% of girls <12 years; rare in young males",
"Patients >45 years: more frequently male; ~20% have tumours (breast, ovary, lung, thymoma, Hodgkin lymphoma)",
"Common misdiagnoses: viral encephalitis · neuroleptic malignant syndrome · encephalitis lethargica · acute psychosis / schizophrenia",
]:
story.append(b1(b))
story.append(PageBreak())
story += h2("4B. Anti-LGI1 (Leucine-rich Glioma Inactivated 1) Encephalitis")
for b in [
"<b>Demographics:</b> Most commonly affects patients >50 years; slight male predominance; tumour association RARE (<5%)",
"<b>Pathognomonic feature: Faciobrachial Dystonic Seizures (FBDS)</b> — brief (<3 seconds), frequent (up to 100+/day), ipsilateral face and arm dystonic jerks. Often precede limbic encephalitis by weeks-months",
"Classical limbic encephalitis: subacute amnesia, confusion, psychiatric symptoms, seizures",
"<b>Hyponatraemia (SIADH)</b> is very common — a useful clinical clue in an older patient with confusion",
"<b>CSF:</b> Often NORMAL — does not exclude diagnosis",
"<b>MRI:</b> Often initially normal; later T2/FLAIR hyperintensity in mesial temporal lobes (hippocampus, amygdala); may also show basal ganglia signal change",
"<b>EEG:</b> Temporal lobe ictal/interictal discharges corresponding to FBDS",
"Key: FBDS does NOT respond to antiseizure medications — responds to <b>immunotherapy</b>. Early treatment prevents progression to limbic encephalitis",
]:
story.append(b1(b))
story.append(sp(6))
story += h2("4C. Anti-CASPR2 (Contactin-Associated Protein-like 2) Encephalitis")
for b in [
"Demographics: Predominantly older men; ~20% have thymoma",
"<b>Morvan Syndrome</b> = peripheral nerve hyperexcitability (neuromyotonia, cramps) + autonomic dysfunction + encephalopathy + insomnia — anti-CASPR2 is the antibody to test",
"Also causes limbic encephalitis, cerebellar ataxia",
"Often co-occurs with LGI1 antibodies (shared LGI1-CASPR2-ADAM23 complex)",
]:
story.append(b1(b))
story.append(sp(5))
story += h2("4D. Anti-AMPA Receptor Encephalitis")
for b in [
"Demographics: Middle-aged women; ~70% have underlying tumour (breast, lung, thymoma)",
"Clinical: Limbic encephalitis — subacute amnesia, confusion, psychiatric symptoms",
"Notable: <b>High relapse rate</b> after immunotherapy reduction",
"MRI: Mesial temporal T2/FLAIR hyperintensity",
]:
story.append(b1(b))
story.append(sp(5))
story += h2("4E. Anti-GABA-B Receptor Encephalitis")
for b in [
"Demographics: Older adults; ~50% have SCLC (small cell lung cancer)",
"Clinical: Limbic encephalitis with <b>prominent, often refractory seizures</b> and status epilepticus",
"Key association: Always screen for SCLC with CT chest",
"MRI: Mesial temporal signal changes",
]:
story.append(b1(b))
story.append(sp(5))
story += h2("4F. Anti-GABA-A Receptor Encephalitis")
for b in [
"Clinical: Refractory status epilepticus and multifocal seizures (distinguish from GABA-B by seizure severity)",
"MRI: Often extensive FLAIR signal in cortical and subcortical regions (not just temporal)",
"~30% associated with thymoma",
]:
story.append(b1(b))
story.append(sp(5))
story += h2("4G. Anti-DPPX (Dipeptidyl-peptidase-like protein 6) Encephalitis")
for b in [
"Key clinical triad: <b>Diarrhoea/GI dysmotility</b> (often precedes neurological symptoms by months) + CNS hyperexcitability + encephalopathy",
"Agitation, hallucinations, myoclonus, hyperekplexia (exaggerated startle), tremor, nystagmus",
"Some patients develop PERM (Progressive Encephalomyelitis with Rigidity and Myoclonus)-like picture",
"Associated B-cell neoplasms in a few cases",
]:
story.append(b1(b))
story.append(sp(5))
story += h2("4H. Anti-IgLON5 Disease")
for b in [
"Chronic/subacute encephalopathy with <b>characteristic sleep disorder</b> — REM + NREM parasomnia, obstructive sleep apnea",
"Bulbar symptoms: dysphagia, stridor (vocal cord palsy)",
"Movement disorders: chorea, craniofacial dyskinesias, oculomotor dysfunction",
"Median age: early 60s; M=F",
"Strong HLA association: HLA-DRB1*10:01 and HLA-DQB1*05 (present in 60%)",
"Neuropathology: <b>Neuronal tauopathy</b> predominantly in hypothalamus and brainstem tegmentum — suggests mixed autoimmune + neurodegeneration",
"<b>Poor response to immunotherapy</b> — important to know (unlike other AE syndromes)",
]:
story.append(b1(b))
story.append(sp(5))
story += h2("4I. MOG (Myelin Oligodendrocyte Glycoprotein) Antibody Syndromes")
for b in [
"Most patients: children and young adults",
"Phenotypes: optic neuritis, myelitis, brainstem encephalitis, ADEM, cortical encephalitis",
"~85% respond to immunotherapy; ~30% relapse",
"NOT associated with tumours",
"Small group with <b>unilateral or bilateral cortical encephalitis</b> — response variable",
"Poor prognosis phenotypes in children: ADEM-like relapses → leukodystrophy-like features; extensive cortical encephalitis → cortical atrophy",
]:
story.append(b1(b))
# ── SECTION 5: DIAGNOSTIC CRITERIA ───────────────────────────────────────────
story.append(PageBreak())
story.append(h1("5. CLINICAL APPROACH & DIAGNOSTIC CRITERIA"))
story.append(sp(6))
story += h2("Graus Criteria 2016 — Definition of Autoimmune Encephalitis")
story.append(body(
"The <b>Graus et al. (2016)</b> criteria provide the framework for diagnosing autoimmune encephalitis. "
"They require the following elements to be present:"
))
for b in [
"Subacute onset (rapid progression over <3 months) of: working memory deficits, seizures, or psychiatric symptoms",
"At least ONE of: (a) New focal CNS findings, (b) CSF pleocytosis (WBC >5 cells/μL), (c) MRI features suggesting encephalitis",
"Reasonable exclusion of alternative causes",
]:
story.append(b1(b))
story.append(sp(4))
story.append(warn(
"Important (Rheumatology 2022, Guasp & Dalmau 2025): Normal CSF findings do NOT exclude autoimmune encephalitis. "
"In anti-LGI1 encephalitis, MOST patients have normal CSF and often initially normal MRI. "
"The clinical course of rapid decline over weeks is the KEY factor."))
story.append(sp(6))
story += h2("APE2 Score (Washington Manual) — Predicts Neural-Specific Antibody Positivity")
story.append(sp(3))
ape2_data = [
["Clinical Feature", "Score"],
["New-onset, rapidly progressive mental status changes over 1–6 weeks ± new-onset seizures", "+1"],
["Neuropsychiatric changes: agitation, aggressiveness, emotional lability", "+1"],
["Autonomic dysfunction (sustained tachycardia/bradycardia, orthostatic hypotension, hyperhidrosis, labile BP, arrhythmia, GI dysmotility)", "+1"],
["Viral prodrome (rhinorrhoea, sore throat, low-grade fever) — scored if no systemic malignancy within 5 years", "+1"],
["Faciobrachial dystonic seizures", "+3"],
["Facial dyskinesias (without FBDS)", "+2"],
["Seizures refractory to ≥2 antiseizure medications", "+2"],
["CSF inflammation (protein >50 mg/dL and/or lymphocytic pleocytosis >5 cells/μL)", "+2"],
["MRI suggesting encephalitis (T2/FLAIR in mesial temporal lobes or multifocal grey/white matter)", "+2"],
]
ape2_tbl_data = []
ape2_tbl_data.append([Paragraph("<b>Clinical Feature</b>", sTH), Paragraph("<b>Score</b>", sTH)])
for feat, score in ape2_data[1:]:
ape2_tbl_data.append([Paragraph(feat, sTD), Paragraph(f"<b>{score}</b>",
S("sc", fontSize=9, textColor=ACCENT_PURP, fontName="Helvetica-Bold", alignment=TA_CENTER))])
ape2_t = Table(ape2_tbl_data, colWidths=[CW-2*cm, 2*cm], repeatRows=1)
ape2_t.setStyle(TableStyle([
("BACKGROUND",(0,0),(-1,0),ACCENT_PURP),
("ROWBACKGROUNDS",(0,1),(-1,-1),[WHITE, HexColor("#f5f3ff")]),
("GRID",(0,0),(-1,-1),0.35,HexColor("#c4b5fd")),
("VALIGN",(0,0),(-1,-1),"MIDDLE"),
("TOPPADDING",(0,0),(-1,-1),5),("BOTTOMPADDING",(0,0),(-1,-1),5),
("LEFTPADDING",(0,0),(-1,-1),6),
]))
story.append(ape2_t)
story.append(sp(4))
story.append(purple("APE2 Score ≥4 is 99% sensitive and 93% specific for neural-specific antibody positivity."))
# ── SECTION 6: INVESTIGATIONS ─────────────────────────────────────────────────
story.append(PageBreak())
story.append(h1("6. INVESTIGATIONS"))
story.append(sp(6))
story += h2("A. Blood Tests")
for b in [
"CBC, LFT, RFT, electrolytes — look for <b>hyponatraemia</b> (common in LGI1 due to SIADH)",
"Thyroid function (exclude Hashimoto encephalopathy / anti-TPO positive)",
"Anti-nuclear antibodies (ANA), dsDNA, ANCA — exclude systemic rheumatic disease (SLE, Sjögren, Behçet, sarcoidosis)",
"<b>Serum autoantibody panel</b>: NMDAR, LGI1, CASPR2, AMPA-R, GABA-A/B-R, DPPX, GlyR, mGluR1, MOG, GFAP, GAD65, IgLON5",
"HIV serology, RPR/VDRL, B12, folate (exclude infective and metabolic causes)",
"Toxicology screen (lithium, drugs of abuse)",
"Tumour markers if malignancy suspected",
]:
story.append(b1(b))
story.append(sp(5))
story += h2("B. CSF Analysis")
story.append(tbl(
["Parameter", "Typical Finding in AE", "Notes"],
[
["Opening pressure", "Normal or mildly elevated", "Markedly elevated pressure uncommon"],
["WBC", "Mild lymphocytic pleocytosis (10–100 cells/μL)", "Can be NORMAL — does not exclude AE (especially LGI1)"],
["Protein", "Mildly elevated (50–100 mg/dL)", "Can be normal"],
["Glucose", "Normal", "Hypoglycorrhachia suggests infection/TBM instead"],
["Oligoclonal bands", "Present in some (NMDAR especially)", "Intrathecal IgG synthesis"],
["CSF antibody testing", "Same panel as serum", "CSF has higher sensitivity for NMDAR (send BOTH serum and CSF)"],
["PCR (HSV, VZV, Enterovirus)", "Negative", "Must exclude infectious encephalitis first"],
],
cw=[2.8*cm, 4.5*cm, 9.7*cm]
))
story.append(alert("For anti-NMDAR encephalitis: ALWAYS test BOTH serum AND CSF antibodies. CSF is more sensitive. Serum alone may be falsely negative."))
story.append(sp(5))
story += h2("C. MRI Brain")
story.append(tbl(
["Condition", "MRI Finding"],
[
["Anti-NMDAR encephalitis", "Normal in 65%; mild transient FLAIR in cortical/subcortical regions in 35%; contrast enhancement rare"],
["Anti-LGI1 limbic encephalitis", "T2/FLAIR hyperintensity in mesial temporal lobes (hippocampus, amygdala); may show basal ganglia signal; often initially NORMAL"],
["Anti-GABA-B limbic encephalitis", "Mesial temporal T2/FLAIR hyperintensity (similar to LGI1 / paraneoplastic LE)"],
["Anti-GABA-A encephalitis", "Extensive, multifocal cortical and subcortical FLAIR signal — more widespread than other AE"],
["MOG-Ab encephalitis", "Cortical FLAIR signal; optic nerve enhancement; spinal cord involvement; ADEM pattern (large demyelinating lesions)"],
["Anti-GFAP encephalitis", "Radial perivascular enhancement from ventricles outwards — highly distinctive pattern"],
["Anti-IgLON5 disease", "Often normal or minor non-specific changes; may show hypothalamic/brainstem signal"],
],
cw=[3.5*cm, CW-3.5*cm]
))
story.append(sp(5))
story += h2("D. EEG")
story.append(tbl(
["Pattern", "Associated Antibody / Significance"],
[
["Extreme delta brush", "Anti-NMDAR encephalitis — highly characteristic (delta waves + superimposed high-frequency beta bursts); seen in ~30% of severe cases"],
["Temporal lobe ictal discharges", "LGI1 encephalitis — corresponds to FBDS; helps map seizure focus"],
["Multifocal ictal/interictal discharges", "Anti-GABA-A encephalitis; severe NMDAR encephalitis"],
["Generalised slowing", "Non-specific but confirms encephalopathy"],
["Continuous diffuse slow activity with superimposed bursts", "Severe NMDAR encephalitis in ICU phase"],
],
cw=[4.5*cm, CW-4.5*cm]
))
story.append(sp(5))
story += h2("E. Tumour Screening — Mandatory in All AE Patients (Harrison's 22E)")
for b in [
"CT chest/abdomen/pelvis — screen for SCLC, thymoma, lymphoma",
"<b>Pelvic ultrasound / transvaginal US / MRI pelvis</b> — screen for ovarian teratoma in all females ≥12 years with NMDAR-Ab",
"<b>Testicular ultrasound</b> — in young males with NMDAR-Ab or high-risk antibodies",
"<b>FDG-PET/CT</b> — if CT negative; detects occult tumours in PND; recommended if high-risk antibodies present",
"Repeat tumour screening every 6 months for 3 years if initial work-up negative with high-risk antibodies",
"Serum/urine immunofixation — exclude monoclonal gammopathy-related neuropathy",
]:
story.append(b1(b))
# ── SECTION 7: PARANEOPLASTIC vs NON-PARANEOPLASTIC ──────────────────────────
story.append(PageBreak())
story.append(h1("7. PARANEOPLASTIC vs NON-PARANEOPLASTIC AE"))
story.append(sp(6))
story.append(tbl(
["Feature", "Paraneoplastic", "Non-Paraneoplastic"],
[
["Antibody target", "Intracellular antigens (Hu, Yo, Ri, CRMP5, Ma2)", "Cell-surface/synaptic antigens (NMDAR, LGI1, CASPR2, AMPA-R)"],
["Tumour association", ">70% have underlying cancer", "Low to moderate (<30% most; AMPA-R ~70%)"],
["Pathogenic mechanism", "T-cell mediated cytotoxicity (CD8+ T cells); antibodies are MARKERS not effectors", "Antibody-mediated receptor dysfunction; antibodies ARE the effectors"],
["Neuronal damage", "Irreversible (neuronal loss, gliosis)", "Potentially reversible (receptor internalization/modulation)"],
["Response to immunotherapy", "Poor (treat the tumour)", "Good (glucocorticoids, IVIg, plasma exchange, rituximab)"],
["CSF", "Pleocytosis, oligoclonal bands, elevated protein", "Variable; often mild or normal"],
["Time course", "Rapid, relentlessly progressive", "Subacute; may plateau; often improve with treatment"],
],
cw=[3.5*cm, 6.5*cm, 7*cm]
))
story.append(sp(4))
story.append(body(
"In <b>paraneoplastic encephalitis</b>, neurologic symptoms precede the cancer diagnosis in ~60% of cases. "
"The diagnosis relies on: (1) detection of high-risk antibody, (2) demonstration of cancer, and "
"(3) exclusion of other neurological disorders. Combined CT + PET scan often uncovers tumours undetected by CT alone."
))
# ── SECTION 8: TREATMENT ──────────────────────────────────────────────────────
story.append(PageBreak())
story.append(h1("8. TREATMENT ALGORITHM"))
story.append(sp(6))
story.append(alert("Treatment for autoimmune encephalitis should be initiated AS EARLY AS FEASIBLE — the disease carries high morbidity. Early treatment hastens recovery and reduces disability and relapse. (Adams & Victor's 12E)"))
story.append(sp(6))
story += h2("Treatment Algorithm (Harrison's 22E + Adams & Victor's 12E + Expert Consensus)")
story.append(sp(4))
tx_steps = [
("SIMULTANEOUS\n(Immediate)",
"• Rule out infectious encephalitis: Start empirical Acyclovir + antibiotics until HSV PCR and cultures return\n"
"• Blood and CSF autoantibody panel\n"
"• Tumour screening (CT ± PET; pelvic US for females)\n"
"• Antiseizure medication for seizures (Levetiracetam first line)\n"
"• Manage autonomic instability (ICU if needed)\n"
"• Remove trigger if identified: Resect ovarian teratoma (in NMDAR encephalitis — tumour resection alone can improve outcome)",
DARK_TEAL),
("FIRST LINE\n(Start within 48–72h)",
"• <b>Methylprednisolone</b> 1g IV daily × 5 days (or Dexamethasone 20 mg/day × 5 days)\n"
" THEN oral Prednisolone 1 mg/kg/day with slow taper over 6 months\n"
"• <b>IVIg</b> 0.4 g/kg/day × 5 days\n"
"• <b>Plasma Exchange (PLEX)</b> — 5–7 sessions every other day\n"
"Note: Steroids + IVIg + PLEX are often combined or given sequentially.",
MED_TEAL),
("SECOND LINE\n(If no/inadequate response to\nfirst line at 2–4 weeks)",
"• <b>Rituximab</b> 375 mg/m² weekly × 4 doses OR 1000 mg × 2 doses 2 weeks apart\n"
" (Anti-CD20 B-cell depletion — most evidence for anti-NMDAR encephalitis)\n"
"• <b>Cyclophosphamide</b> 750 mg/m² IV monthly (if Rituximab unavailable or contraindicated)",
ACCENT_PURP),
("REFRACTORY / MAINTENANCE\n(Non-responders)",
"• <b>Tocilizumab</b> (anti-IL-6 receptor monoclonal antibody) — 8 mg/kg IV q4 weeks — promising results in refractory cases\n"
"• <b>Bortezomib</b> (proteasome inhibitor; depletes antibody-producing plasma cells) — refractory NMDAR-Ab encephalitis\n"
"• <b>Mycophenolate mofetil</b> 1–3 g/day OR <b>Azathioprine</b> 2–3 mg/kg/day — for relapse prevention (maintenance)\n"
"• <b>Methotrexate</b> — used in some refractory cases",
ACCENT_RED),
("TUMOUR-SPECIFIC\n(If paraneoplastic)",
"• Priority: TREAT THE UNDERLYING TUMOUR\n"
"• For intracellular antigen antibodies (Hu, Yo, Ri, Ma2): tumour treatment is the primary approach; "
"immunotherapy has limited benefit\n"
"• Ovarian teratoma resection (NMDAR-Ab): early resection improves neurological outcome\n"
"• Steroids and IVIg used as bridge to tumour treatment",
GOLD),
]
for phase, details, col in tx_steps:
r = Table([[
Paragraph(f"<b>{phase}</b>", S("ph", fontSize=9, textColor=WHITE, alignment=TA_CENTER, leading=13)),
Paragraph(details, S("dt", fontSize=8.5, leading=13))
]], colWidths=[3.2*cm, CW-3.2*cm])
r.setStyle(TableStyle([
("BACKGROUND",(0,0),(0,0),col),
("BACKGROUND",(1,0),(1,0),LIGHT_GREY),
("TOPPADDING",(0,0),(-1,-1),8),("BOTTOMPADDING",(0,0),(-1,-1),8),
("LEFTPADDING",(0,0),(-1,-1),8),
("GRID",(0,0),(-1,-1),0.3,HexColor("#94a3b8")),
("VALIGN",(0,0),(-1,-1),"TOP"),
]))
story.append(r); story.append(sp(3))
story.append(sp(6))
story += h2("Antiseizure Medications in AE — Important Notes")
for b in [
"Anti-NMDAR FBDS-equivalent seizures: do NOT respond to antiseizure drugs — respond to immunotherapy",
"LGI1 FBDS: same — antiseizure drugs have limited effect; immunotherapy is the treatment",
"Levetiracetam preferred (minimal drug interactions, IV formulation available)",
"Avoid sodium channel blockers (carbamazepine, phenytoin) in NMDAR encephalitis — may worsen dyskinesias",
"Status epilepticus in AE: treat aggressively (benzodiazepines, levetiracetam, propofol/midazolam infusion) AND escalate immunotherapy simultaneously",
]:
story.append(b1(b))
# ── SECTION 9: PROGNOSIS ──────────────────────────────────────────────────────
story.append(PageBreak())
story.append(h1("9. PROGNOSIS & OUTCOMES"))
story.append(sp(6))
story += h2("2025 Meta-Analysis Update (Hoshina et al., J Neuroimmunol 2025) [PMID: 40472799]")
story.append(sp(3))
story.append(tbl(
["Parameter", "Pre-2019 Data", "2025 Updated Data", "Trend"],
[
["First-line immunotherapy use", "91.3%", "98.3%", "↑ Significantly (p<0.001)"],
["Second-line immunotherapy use", "31.8%", "42.5%", "↑ Significantly (p<0.001)"],
["Treatment within 30 days of onset", "50.1%", "72.5%", "↑ Markedly (p<0.001)"],
["Favourable outcome (mRS 0–2)", "71.5%", "76.7%", "↑ Modest (p=0.024)"],
["Mortality", "6.3%", "6.9%", "Unchanged (p=0.714)"],
["Relapse rate", "12.6%", "13.2%", "Unchanged (p=0.789)"],
],
cw=[4*cm, 3*cm, 3*cm, 3*cm]
))
story.append(sp(4))
story.append(green(
"KEY MESSAGE (2025 Meta-Analysis): Despite earlier and more aggressive immunotherapy, "
"mortality and relapse rates have NOT significantly improved since 2019. "
"Functional outcomes (mRS 0–2) showed only modest improvement. "
"This highlights the urgent need for prospective clinical trials — there are currently NO FDA-approved treatments for anti-NMDAR encephalitis."))
story.append(sp(6))
story += h2("Prognosis by Antibody Type")
story.append(tbl(
["Antibody", "Typical Outcome", "Notes"],
[
["Anti-NMDAR", "Good recovery in ~77%; slow (months–years); 12–24% relapse", "Tumour removal + early immunotherapy = best predictor of good outcome"],
["Anti-LGI1", "Good overall; ~15–20% have residual memory deficits", "FBDS must be treated early to prevent limbic encephalitis"],
["Anti-CASPR2", "Moderate; refractory cases more common", "Morvan syndrome has more guarded prognosis"],
["Anti-AMPA-R", "Tends to relapse frequently", "Maintenance immunosuppression usually required"],
["Anti-GABA-B", "Depends on tumour control; poor if SCLC progresses", "Neurological often improves with tumour treatment"],
["Paraneoplastic (Hu, Yo, Ri)", "Generally poor neurological outcome; neuronal loss irreversible", "Focus on tumour treatment; immunotherapy rarely helps"],
["Anti-IgLON5", "Poor; progressive; tauopathy component", "Does not respond to immunotherapy"],
["MOG-Ab", "~85% respond; 30% relapse", "Overall good prognosis; relapses treatable"],
],
cw=[3*cm, 5*cm, 9*cm]
))
# ── SECTION 10: DIFFERENTIALS ─────────────────────────────────────────────────
story.append(PageBreak())
story.append(h1("10. KEY DIFFERENTIALS & MIMICS"))
story.append(sp(6))
story.append(tbl(
["Mimic / Differential", "Key Distinguishing Features", "Helpful Tests"],
[
["HSV Encephalitis", "Temporal lobe T2/FLAIR on MRI (often absent in AE); CSF pleocytosis often more prominent", "HSV PCR (CSF) — must ALWAYS rule out first; start Acyclovir empirically"],
["TBM (Subacute)", "TB exposure, basilar CN palsies, low glucose CSF, high protein; communicating hydrocephalus", "CSF ADA, MTB PCR, AFB culture"],
["Prion disease (CJD)", "Rapid dementia, myoclonus, cerebellar features; 14-3-3 protein in CSF; DWI ribbon sign", "MRI DWI, CSF 14-3-3, RT-QuIC, EEG (PSWCs)"],
["Hashimoto Encephalopathy", "Elevated anti-TPO and anti-thyroglobulin; responds to steroids; euthyroid usually", "Anti-TPO Ab, TSH — note: also can overlap with AE"],
["Primary psychiatric disorder (schizophrenia, mania)", "No fever, no CSF changes, no MRI changes; gradual onset without autonomic features", "Exclude AE in young patient with new-onset psychosis — check NMDAR Ab"],
["Viral encephalitis (JE, WNV, EBV)", "Epidemiologic clues (mosquito, travel); thalamic lesions (JE)", "Viral serology, PCR panel"],
["Metabolic encephalopathy (hepatic, uraemic, hypo-Na+)", "Reversible with correction of metabolic abnormality; no autoantibodies", "LFT, ammonia, electrolytes, RFT"],
["Neuroleptic Malignant Syndrome", "History of antipsychotic exposure; hyperthermia, rigidity, elevated CK", "CK, drug history — but can mimic or complicate AE (anti-NMDAR)"],
["Cerebral vasculitis / CNS angiitis", "Focal neurological deficits; multifocal infarcts; abnormal MRA", "MRA, conventional angiography, meningeal biopsy"],
["Lymphoma / CNS malignancy", "Mass lesion; systemic B symptoms; CSF cytology", "MRI contrast, CSF cytology, PET-CT, biopsy"],
],
cw=[3.8*cm, 6*cm, 7.2*cm]
))
story.append(sp(6))
story += h2("When to Suspect Autoimmune Encephalitis (Clinical Red Flags)")
for b in [
"<b>New-onset psychosis in a young woman</b> — always check NMDAR antibodies",
"<b>Brief facial + arm jerks</b> in an older patient (FBDS) — check LGI1",
"<b>Refractory status epilepticus</b> with no prior epilepsy — check GABA-A/B-R, NMDAR Ab",
"<b>Progressive amnesia + confusion</b> in an older male with hyponatraemia — check LGI1",
"<b>Rapid-onset encephalopathy after IVIG/checkpoint inhibitor therapy</b> (oncology) — consider immune-mediated",
"<b>GI symptoms (diarrhoea) preceding encephalopathy</b> — check DPPX antibodies",
"<b>Parasomnia + autonomic dysfunction + bulbar symptoms</b> — check IgLON5",
"<b>Encephalitis after HSV encephalitis treatment</b> — HSV may trigger NMDAR-Ab (post-HSV autoimmune encephalitis)",
]:
story.append(b1(b))
story.append(sp(8))
story += h2("References")
refs_list = [
"Harrison's Principles of Internal Medicine 22E (2025, McGraw Hill) — Chapter 99 [Dalmau J, Graus F]",
"Adams and Victor's Principles of Neurology 12th Edition — Chapter 35",
"Rheumatology, 2-Volume Set (2022, Elsevier) — Chapter 40",
"Washington Manual of Medical Therapeutics — Chapter 27",
"Guasp M, Dalmau J. Autoimmune Encephalitis. Med Clin North Am. 2025 Mar [PMID: 39893022]",
"Hoshina Y et al. Updated meta-analysis of anti-NMDAR encephalitis treatment. J Neuroimmunol. 2025 [PMID: 40472799]",
"Graus F et al. Clinical approach to diagnosis of autoimmune encephalitis. Lancet Neurol. 2016;15(4):391-404",
"Dalmau J et al. Antibody-mediated encephalitis. N Engl J Med. 2018;378:840",
]
for r in refs_list:
story.append(Paragraph(f"• {r}", S("ref", fontSize=8, leading=11,
textColor=MID_GREY, leftIndent=14, firstLineIndent=-10, spaceAfter=2)))
# ── BUILD ──────────────────────────────────────────────────────────────────────
doc.build(story, onFirstPage=draw_hf, onLaterPages=draw_hf)
print(f"PDF generated: {OUTPUT}")
cd /tmp/workspace/autoimmune-encephalitis && python generate_ae_pdf.py 2>&1
ls -lh /tmp/workspace/autoimmune-encephalitis/
Autoimmune Encephalitis Notes
PDF Document · PDF
| Section | Content |
|---|---|
| 1. Introduction & Epidemiology | Incidence now equals infectious encephalitis; checkpoint inhibitor-triggered AE highlighted |
| 2. Classification | Cell-surface vs intracellular antigen table; High/Intermediate/Low tumour-risk antibody tables (Harrison's Tables 99-2/3/4) |
| 3. Pathogenesis | Full Harrison's Figure 99-3 embedded — HSV trigger, tumour trigger, B-cell intrathecal differentiation, NMDAR crosslinking/internalization, GABA-R blockade, LGI1 protein disruption |
| 4. Specific Syndromes | Anti-NMDAR (7-stage progression) · LGI1 (FBDS) · CASPR2 (Morvan) · AMPA-R · GABA-B/A · DPPX · IgLON5 · MOG-Ab |
| 5. Diagnostic Criteria | Graus 2016 criteria + APE2 Score table (≥4 = 99% sensitive) |
| 6. Investigations | CSF profile, MRI per antibody, EEG patterns (extreme delta brush), tumour screening protocol |
| 7. Paraneoplastic vs Non-Paraneoplastic | Head-to-head comparison table |
| 8. Treatment Algorithm | 5-phase stepped algorithm — simultaneous workup → First line → Second line (Rituximab) → Refractory (Tocilizumab, Bortezomib) → Tumour-specific |
| 9. Prognosis — 2025 Update | Full data from Hoshina et al. meta-analysis [PMID: 40472799]: outcome improved modestly (71.5% → 76.7% mRS 0-2); mortality unchanged; highlights NO FDA-approved treatment exists yet |
| 10. Differentials & Red Flags | 10 mimics with distinguishing features + 8 clinical red flags for when to suspect AE |