Meningitis

Reading File
Finding Sources
Searching PubMed

"meningitis" AND "management"

Reading File
Reading File
Reading File
Reading File
Reading File
Finding Sources
Reading File
Reading File
Reading File
Loading Image
I now have all the key information needed for a comprehensive answer. Here is a thorough clinical overview of meningitis.

Meningitis

Meningitis is inflammation of the leptomeninges within the subarachnoid space, typically caused by infection. When the inflammation extends into the underlying brain parenchyma, the condition is called meningoencephalitis. The term also applies to non-infectious contexts (e.g., carcinomatous meningitis, chemical meningitis from a ruptured epidermoid cyst).

Classification

Infectious meningitis is broadly divided into three subtypes:
TypeUsual CauseCSF Pattern
Acute pyogenicBacterialNeutrophilic pleocytosis, low glucose, high protein
Aseptic (viral)Enteroviruses, HSV, HIVLymphocytic pleocytosis, normal/near-normal glucose
ChronicTB, fungi, spirochetesLymphocytic, variable glucose
  • Robbins & Kumar Basic Pathology, p. 833

Etiology by Age Group

Causative organisms differ markedly by age:
Age GroupCommon Organisms
Neonates (<1 month)Escherichia coli, Group B streptococci, Listeria monocytogenes
Infants 1-23 monthsS. pneumoniae, N. meningitidis, H. influenzae
Adolescents/young adultsNeisseria meningitidis
Older adults (>50)S. pneumoniae, Listeria monocytogenes
N. meningitidis and S. pneumoniae colonize the nasopharyngeal mucosa and gain entry via that route. Listeria is typically food-borne and disproportionately affects those over 50, diabetics, immunosuppressed patients, and those on chronic illness. The Hib vaccine has dramatically reduced H. influenzae type b meningitis. A tetravalent meningococcal conjugate vaccine covers serogroups A, C, W-135, and Y; the MenB vaccine separately covers serogroup B and is now required at most US universities.
For viral meningitis, enteroviruses are the most common cause; others include measles, HIV, influenza, and lymphocytic choriomeningitis virus.
For fungal/chronic meningitis, Cryptococcus neoformans (especially in HIV/immunocompromised patients), Mycobacterium tuberculosis (globally the leading cause of chronic meningitis), and treponematous infections (Treponema pallidum) are key pathogens.
  • Bradley and Daroff's Neurology in Clinical Practice, p. 1698

Clinical Presentation

Classic triad: Fever + headache + nuchal rigidity (neck stiffness). Photophobia is also common.
Important caveats:
  • Immunosuppressed or geriatric patients may present with altered mental status as the only finding - a lower threshold for LP is required.
  • Neonates may only show subtle signs: behavior changes, decreased tone, poor feeding, or a bulging fontanelle. Guidelines universally recommend LP in any neonate with suspected infection.
  • Tuberculous meningitis has a subacute/chronic course - weeks to months of fever, weight loss, night sweats, malaise, with or without headache.
  • Fungal meningitis can be subtle even in healthy adults.
Physical examination signs:
  • Kernig sign - inability to extend knee when hip is flexed to 90°
  • Brudzinski sign - passive neck flexion causes involuntary hip flexion
  • Both have sensitivity <12% but high specificity; their presence is strongly suggestive.
  • Petechiae/purpura on the extremities (or anywhere) are a hallmark of meningococcemia.
  • Papilledema, focal neurologic deficits, or new seizures suggest a mass lesion - CT before LP is required in these cases.
Complications to watch for:
  • Cerebral venous thrombosis (~1% of cases) - manifests as seizures, altered sensorium, focal deficits
  • Waterhouse-Friderichsen syndrome - bilateral adrenal hemorrhage in severe meningococcemia, accompanied by DIC and purpura
  • Endotoxic shock and DIC in advanced bacterial meningitis
  • Rosen's Emergency Medicine, pp. 2270-2273

Diagnosis - Lumbar Puncture and CSF Analysis

When to CT before LP: Immunocompromised state, known CNS disease, papilledema, focal neurologic deficit, new-onset seizures, or abnormal level of consciousness. Patients without these findings may proceed directly to LP.
Critical principle: Do not delay antibiotics for CT or LP. Draw blood cultures first, then start empiric antibiotics.
Collect at least 3 numbered sterile tubes (1-1.5 mL each). Key studies: turbidity, xanthochromia, glucose, protein, cell count with differential, Gram stain, and bacterial culture.
Normal CSF specimens - clear appearance indistinguishable from water; any cloudiness is pathologic
Normal CSF - clear appearance indistinguishable from water. Any cloudiness suggests CNS infection. - Rosen's Emergency Medicine

CSF Findings by Meningitis Type

ParameterNormalBacterialViralTuberculous/Fungal
AppearanceClearTurbid/cloudyClear/slightly turbidClear/slightly turbid
Opening pressure<20 cm H₂OElevatedNormalElevated
WBC count<5/mm³>1000/mm³ (often much higher)<1000/mm³<1000/mm³
Differential-Neutrophil predominanceLymphocyte predominanceLymphocyte predominance
ProteinNormalElevatedNormal/mildly elevatedElevated
GlucoseNormalLow (<45 mg/dL or <60% serum)NormalLow
Note: Early viral presentations (<48 hours) may show neutrophilia and mimic bacterial meningitis. Some Listeria cases show <1000 cells/mm³ with lymphocyte predominance but near-normal glucose - easy to misinterpret.
Additional CSF studies based on risk: Cryptococcal antigen (HIV/immunosuppressed), AFB stain + culture ± PCR (TB suspected), VDRL (neurosyphilis), meningitis/encephalitis multiplex PCR panel.
Opening pressure: Elevated in bacterial, tuberculous, and fungal meningitis; typically normal in viral meningitis.
  • Rosen's Emergency Medicine, pp. 2272-2273

Treatment

Empiric Antibiotic Regimens

Do not delay antibiotics waiting for CSF or imaging results.
Age/SituationEmpiric Regimen
<1 monthAmpicillin + ceftazidime (or cefotaxime)
1 month and olderVancomycin + ceftriaxone
>50 years or immunocompromisedAdd ampicillin (covers Listeria)
CNS hardware infectionVancomycin + cefepime
Key antibiotic doses for CNS infections (adults, normal renal function):
DrugDose
Vancomycin40-60 mg/kg/day divided q8-12h
Ceftriaxone2 g q12h
Cefepime2 g q8h
Cefotaxime2 g q4-6h
Ampicillin2 g q4h
Aqueous penicillin G18-24 million U/day
  • Bradley and Daroff's Neurology, p. 1700; Harriet Lane Handbook 23rd ed., p. 590

Adjunctive Dexamethasone

Dexamethasone should be given just before or with the first dose of empiric antibiotics.
  • A landmark 2002 prospective, double-blinded RCT (de Gans et al.) showed dexamethasone significantly improved overall mortality and morbidity in bacterial meningitis. Benefit was primarily in S. pneumoniae meningitis.
  • Nationwide implementation of dexamethasone for pneumococcal meningitis led to a measurable decline in fatality rates.
  • A favorable trend (reduced death + hearing loss) has also been shown in meningococcal meningitis.
  • Duration: ~4 days; after that, meningeal inflammation is reduced and continuation is not needed.
  • Concern about vancomycin penetration: Early animal data suggested steroids could reduce CSF vancomycin levels. A 2007 prospective study found CSF vancomycin concentrations remained well above the MIC even with concurrent dexamethasone - this concern does not appear clinically significant.
  • In children, dexamethasone most clearly reduces hearing loss in H. influenzae type b meningitis; some experts also recommend it for pneumococcal meningitis in children/adolescents.
  • Bradley and Daroff's Neurology, p. 1700

Gram Stain Patterns for Key Organisms

OrganismGram Stain
S. pneumoniaeGram-positive diplococci in pairs
N. meningitidisGram-negative diplococci
L. monocytogenesGram-positive rods
H. influenzae type bGram-negative coccobacilli
M. tuberculosisAFB stain + PCR required
T. pallidumSerology (VDRL in CSF)
  • Bradley and Daroff's Neurology, Table 79.1

Special Situations

Tuberculous Meningitis

A 2026 Lancet Infectious Diseases clinical practice guideline (PMID 40840485) provides updated recommendations. TB meningitis has a subacute or chronic presentation (weeks to months), with fever, weight loss, night sweats, malaise ± headache. CNS involvement may be the only manifestation of TB, or may coexist with pulmonary or miliary TB. CSF shows AFB on smear and culture; PCR increases yield. Treatment follows anti-TB drug protocols (RIPE regimen), often with adjunctive dexamethasone.

Fungal Meningitis (Cryptococcus)

Common in HIV/AIDS and other immunosuppressed patients. Presentation is insidious - low-grade fever, headache, malaise, weight loss. CSF cryptococcal antigen has high sensitivity. Treatment: amphotericin B + flucytosine (induction), followed by fluconazole (consolidation/maintenance).

Aseptic (Viral) Meningitis

Typically self-limiting. Enteroviruses are the most common cause. Management is supportive. HSV meningitis (especially HSV-2) warrants consideration of acyclovir.

Complications and Prognosis

  • Untreated pyogenic meningitis is often fatal.
  • With prompt antibiotic therapy, most patients recover.
  • Hearing loss is the most common neurologic sequela, particularly from pneumococcal and H. influenzae meningitis.
  • Other sequelae: cognitive impairment, seizure disorder, hydrocephalus, cerebrovascular complications.
  • Waterhouse-Friderichsen syndrome (adrenal hemorrhage with DIC) carries very high mortality.

Summary Algorithm

Suspected meningitis
        ↓
Blood cultures → start empiric Abx + dexamethasone
        ↓
Signs of mass lesion? (papilledema, focal deficit, altered consciousness, new seizures)
  YES → CT first, then LP
  NO  → LP directly
        ↓
CSF: cell count + diff, protein, glucose, Gram stain, culture, ± additional studies
        ↓
Tailor antibiotics to culture/sensitivity results

Sources: Rosen's Emergency Medicine | Bradley and Daroff's Neurology in Clinical Practice | Robbins & Kumar Basic Pathology | Harriet Lane Handbook 23rd Ed. | Lancet Infectious Diseases 2026 (TB meningitis guideline, PMID 40840485)

Create a clinical reference sheet for CSF analysis interpretation

Asking for Preferences
Reading File
Finding Sources
Reading File
Finding Sources
Reading File
Reading File
Running Command

mkdir -p /home/daytona/workspace/csf-reference && ls /home/daytona/workspace/

Writing File

~/csf-reference/build_csf_ref.py

from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.units import cm, mm
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.platypus import (
    SimpleDocTemplate, Table, TableStyle, Paragraph, Spacer,
    HRFlowable, KeepTogether
)
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_RIGHT
from reportlab.lib.colors import HexColor
import reportlab.lib.colors as rcolors

OUTPUT = "/home/daytona/workspace/csf-reference/CSF_Analysis_Reference.pdf"

# ── Palette ──────────────────────────────────────────────────────────────────
NAVY       = HexColor("#0D2B55")
TEAL       = HexColor("#1A6B8A")
LIGHT_TEAL = HexColor("#D6EEF5")
GREEN      = HexColor("#1A7A4A")
LIGHT_GREEN= HexColor("#D5EFE3")
RED        = HexColor("#A63228")
LIGHT_RED  = HexColor("#F9E0DE")
AMBER      = HexColor("#8A5E00")
LIGHT_AMB  = HexColor("#FFF3CD")
PURPLE     = HexColor("#5B2D8E")
LIGHT_PURP = HexColor("#EDE0F7")
LIGHT_GREY = HexColor("#F2F4F6")
MID_GREY   = HexColor("#B0B8C1")
DARK_GREY  = HexColor("#3A3F47")
WHITE      = colors.white

doc = SimpleDocTemplate(
    OUTPUT,
    pagesize=A4,
    leftMargin=1.2*cm, rightMargin=1.2*cm,
    topMargin=1.2*cm, bottomMargin=1.4*cm,
)
W, H = A4
PW = W - 2.4*cm   # printable width

styles = getSampleStyleSheet()

def style(name, **kw):
    return ParagraphStyle(name, **kw)

title_style = style("Title",
    fontName="Helvetica-Bold", fontSize=16, textColor=WHITE,
    alignment=TA_CENTER, leading=20)

subtitle_style = style("Subtitle",
    fontName="Helvetica", fontSize=8.5, textColor=HexColor("#CCE8F4"),
    alignment=TA_CENTER, leading=12)

section_style = style("Section",
    fontName="Helvetica-Bold", fontSize=9, textColor=WHITE,
    alignment=TA_LEFT, leading=12, leftPadding=5)

body_style = style("Body",
    fontName="Helvetica", fontSize=7.8, textColor=DARK_GREY,
    leading=10.5)

bold_body = style("BoldBody",
    fontName="Helvetica-Bold", fontSize=7.8, textColor=DARK_GREY,
    leading=10.5)

small_style = style("Small",
    fontName="Helvetica", fontSize=6.8, textColor=HexColor("#666"),
    leading=9, alignment=TA_CENTER)

label_style = style("Label",
    fontName="Helvetica-Bold", fontSize=7, textColor=DARK_GREY,
    leading=9)

footnote_style = style("Footnote",
    fontName="Helvetica-Oblique", fontSize=6.5, textColor=HexColor("#888"),
    leading=8.5, alignment=TA_LEFT)

def section_header(text, color=NAVY):
    data = [[Paragraph(text, section_style)]]
    t = Table(data, colWidths=[PW])
    t.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,-1), color),
        ("TOPPADDING", (0,0), (-1,-1), 4),
        ("BOTTOMPADDING", (0,0), (-1,-1), 4),
        ("LEFTPADDING", (0,0), (-1,-1), 8),
        ("RIGHTPADDING", (0,0), (-1,-1), 4),
        ("ROWBACKGROUNDS", (0,0), (-1,-1), [color]),
    ]))
    return t

def cell(text, bold=False, color=DARK_GREY, size=7.8, align=TA_LEFT):
    s = ParagraphStyle("c", fontName="Helvetica-Bold" if bold else "Helvetica",
                       fontSize=size, textColor=color, leading=10, alignment=align)
    return Paragraph(text, s)

def make_table(headers, rows, col_widths, row_bg_pairs=None,
               header_bg=NAVY, header_fg=WHITE,
               stripe_a=WHITE, stripe_b=LIGHT_GREY,
               fontsize=7.8):
    header_row = [cell(h, bold=True, color=header_fg, size=fontsize) for h in headers]
    data = [header_row]
    for r in rows:
        data.append([cell(str(c), size=fontsize) if isinstance(c, str) else c for c in r])

    style_cmds = [
        ("BACKGROUND", (0,0), (-1,0), header_bg),
        ("TOPPADDING", (0,0), (-1,-1), 3),
        ("BOTTOMPADDING", (0,0), (-1,-1), 3),
        ("LEFTPADDING", (0,0), (-1,-1), 5),
        ("RIGHTPADDING", (0,0), (-1,-1), 5),
        ("LINEBELOW", (0,0), (-1,0), 0.5, WHITE),
        ("LINEBELOW", (0,1), (-1,-1), 0.3, MID_GREY),
        ("VALIGN", (0,0), (-1,-1), "MIDDLE"),
    ]
    # zebra
    for i in range(1, len(data)):
        bg = stripe_a if i % 2 == 1 else stripe_b
        style_cmds.append(("BACKGROUND", (0,i), (-1,i), bg))

    # override specific row colours if provided
    if row_bg_pairs:
        for row_idx, bg in row_bg_pairs:
            style_cmds.append(("BACKGROUND", (0,row_idx), (-1,row_idx), bg))

    t = Table(data, colWidths=col_widths, repeatRows=1)
    t.setStyle(TableStyle(style_cmds))
    return t

# ─────────────────────────────────────────────────────────────────────────────
story = []

# ── TITLE BANNER ─────────────────────────────────────────────────────────────
banner_data = [[
    Paragraph("CSF ANALYSIS", title_style),
    Paragraph("Clinical Reference Sheet", title_style),
]]
banner = Table(banner_data, colWidths=[PW*0.45, PW*0.55])
banner.setStyle(TableStyle([
    ("BACKGROUND", (0,0), (-1,-1), NAVY),
    ("TOPPADDING", (0,0), (-1,-1), 10),
    ("BOTTOMPADDING", (0,0), (-1,-1), 2),
]))
story.append(banner)

sub_data = [[Paragraph("Cerebrospinal Fluid Interpretation · Lumbar Puncture · CNS Infection · SAH", subtitle_style)]]
sub_tbl = Table(sub_data, colWidths=[PW])
sub_tbl.setStyle(TableStyle([
    ("BACKGROUND", (0,0), (-1,-1), TEAL),
    ("TOPPADDING", (0,0), (-1,-1), 3),
    ("BOTTOMPADDING", (0,0), (-1,-1), 5),
]))
story.append(sub_tbl)
story.append(Spacer(1, 4))

# ── SECTION 1: NORMAL VALUES ─────────────────────────────────────────────────
story.append(section_header("① NORMAL CSF VALUES  (Adult, lateral decubitus position)", NAVY))
story.append(Spacer(1, 2))

normal_headers = ["Parameter", "Normal Value", "Clinical Note"]
normal_rows = [
    ["Opening Pressure", "50–170 mm H₂O\n(<28 cm H₂O in children)", "Measure in lateral decubitus only; coughing/crying falsely elevates"],
    ["Appearance", "Clear, colourless", "Turbidity visible when WBC >200–500/mm³"],
    ["Xanthochromia", "Absent", "Yellow/pink = oxyhemoglobin/bilirubin; suggests SAH if traumatic tap excluded"],
    ["Red Blood Cells", "≤5/mm³", "Traumatic tap: ≥10,000 RBC/mm³ or fewer RBCs in tube 4 vs tube 1"],
    ["White Blood Cells", "≤5/mm³; no PMNs", ">1 PMN is abnormal; any eosinophil is abnormal"],
    ["Glucose", ">40 mg/dL or\n60–70% of serum glucose", "Always compare to simultaneous serum glucose"],
    ["Protein", "<50 mg/dL", "Elevated in bacterial, TB, fungal, SAH, GBS, malignant meningitis"],
    ["Gram Stain & Culture", "Negative", "Most important tests when fluid is limited"],
]

story.append(make_table(
    normal_headers, normal_rows,
    col_widths=[PW*0.22, PW*0.25, PW*0.53],
    header_bg=NAVY, stripe_a=WHITE, stripe_b=LIGHT_GREY
))
story.append(Spacer(1, 5))

# ── SECTION 2: PATTERN COMPARISON ────────────────────────────────────────────
story.append(section_header("② CSF PATTERN COMPARISON BY DIAGNOSIS", TEAL))
story.append(Spacer(1, 2))

comp_headers = ["Parameter", "Normal", "Bacterial", "Viral (Aseptic)", "TB / Fungal", "SAH"]
comp_rows = [
    ["Opening Pressure",
     cell("Normal", size=7.5),
     cell("↑↑ Elevated", bold=True, color=RED, size=7.5),
     cell("Normal / ↑", size=7.5),
     cell("↑ Elevated", color=AMBER, size=7.5),
     cell("↑↑ Elevated", bold=True, color=RED, size=7.5)],

    ["Appearance",
     cell("Clear", color=GREEN, size=7.5),
     cell("Turbid / cloudy", bold=True, color=RED, size=7.5),
     cell("Clear / slightly turbid", size=7.5),
     cell("Clear / cloudy", color=AMBER, size=7.5),
     cell("Bloody / xanthochromic", bold=True, color=RED, size=7.5)],

    ["WBC /mm³",
     cell("≤5", size=7.5),
     cell("500–10,000+", bold=True, color=RED, size=7.5),
     cell("6–1,000", size=7.5),
     cell("10–500", color=AMBER, size=7.5),
     cell("Normal or mildly ↑", size=7.5)],

    ["Differential",
     cell("—", size=7.5),
     cell("Neutrophil (PMN)\npredominance", bold=True, color=RED, size=7.5),
     cell("Lymphocyte\npredominance", color=GREEN, size=7.5),
     cell("Lymphocyte\npredominance", color=AMBER, size=7.5),
     cell("RBC predominance\n± xanthochromia", size=7.5)],

    ["Glucose",
     cell(">40 mg/dL\n(60–70% serum)", size=7.5),
     cell("↓↓ Low\n0–40 mg/dL", bold=True, color=RED, size=7.5),
     cell("Normal", color=GREEN, size=7.5),
     cell("↓ Low (may be\nvery low in TB)", color=AMBER, size=7.5),
     cell("Normal", size=7.5)],

    ["Protein",
     cell("<50 mg/dL", size=7.5),
     cell("↑↑ >50 mg/dL\n(often >100)", bold=True, color=RED, size=7.5),
     cell("Normal or\nmildly ↑", size=7.5),
     cell("↑ Elevated\n(TB may be very high)", color=AMBER, size=7.5),
     cell("↑ Elevated", size=7.5)],

    ["Gram Stain / Smear",
     cell("—", size=7.5),
     cell("Positive\n~60–80%", bold=True, color=RED, size=7.5),
     cell("Negative", size=7.5),
     cell("AFB smear\n(low sensitivity)", color=AMBER, size=7.5),
     cell("Negative", size=7.5)],

    ["Special Tests",
     cell("—", size=7.5),
     cell("Culture, PCR panel,\nlatex agglutination", size=7.5),
     cell("Viral PCR\n(enterovirus, HSV)", size=7.5),
     cell("AFB culture, PCR\nIndia ink / CrAg\n(fungal)", color=PURPLE, size=7.5),
     cell("No visible\nxanthochromia <2 h;\ntake tube 4 for spectrophotometry", size=7.5)],
]

comp_table = Table(
    [[cell(h, bold=True, color=WHITE, size=7.5) for h in comp_headers]] +
    [[
        cell(str(r[0]) if isinstance(r[0], str) else "", size=7.5, bold=True),
        r[1], r[2], r[3], r[4], r[5]
    ] for r in comp_rows],
    colWidths=[PW*0.13, PW*0.11, PW*0.165, PW*0.165, PW*0.185, PW*0.175]
)

comp_cmds = [
    ("BACKGROUND", (0,0), (-1,0), TEAL),
    ("TOPPADDING", (0,0), (-1,-1), 3),
    ("BOTTOMPADDING", (0,0), (-1,-1), 3),
    ("LEFTPADDING", (0,0), (-1,-1), 4),
    ("RIGHTPADDING", (0,0), (-1,-1), 4),
    ("LINEBELOW", (0,0), (-1,0), 0.5, WHITE),
    ("LINEBELOW", (0,1), (-1,-1), 0.3, MID_GREY),
    ("LINEBEFORE", (1,0), (-1,-1), 0.3, MID_GREY),
    ("VALIGN", (0,0), (-1,-1), "TOP"),
    ("BACKGROUND", (2,1), (2,-1), HexColor("#FFF0EE")),  # bacterial column
    ("BACKGROUND", (3,1), (3,-1), HexColor("#F0F8FF")),  # viral column
    ("BACKGROUND", (4,1), (4,-1), HexColor("#FFFBF0")),  # TB column
    ("BACKGROUND", (5,1), (5,-1), HexColor("#F5F0FB")),  # SAH column
]
for i in range(1, len(comp_rows)+1):
    comp_cmds.append(("BACKGROUND", (0,i), (0,i), LIGHT_GREY))
comp_table.setStyle(TableStyle(comp_cmds))
story.append(comp_table)

story.append(Spacer(1, 2))
story.append(Paragraph(
    "⚠ Note: Early bacterial meningitis (<48 h) may show lymphocytic predominance mimicking viral. "
    "Listeria meningitis may show <1000 WBC/mm³ with lymphocyte predominance and near-normal glucose. "
    "Pre-treatment with antibiotics reduces Gram stain/culture yield but does not alter cell count or protein.",
    footnote_style))
story.append(Spacer(1, 5))

# ── SECTION 3: ORGANISMS BY AGE ──────────────────────────────────────────────
story.append(section_header("③ COMMON PATHOGENS BY AGE (Bacterial Meningitis)", GREEN))
story.append(Spacer(1, 2))

org_headers = ["Age Group", "Key Organisms", "Gram Stain Appearance", "Empiric Treatment"]
org_rows = [
    ["Neonates\n(<1 month)",
     "E. coli, Group B Streptococcus,\nListeria monocytogenes",
     "GBS: gram+ cocci in chains\nE. coli: gram− rods\nListeria: gram+ rods",
     "Ampicillin +\nCeftazidime\n(or Cefotaxime)"],
    ["Infants\n(1–23 months)",
     "S. pneumoniae, N. meningitidis,\nH. influenzae, GBS",
     "Pneumo: gram+ diplococci\nMeningo: gram− diplococci\nHib: gram− coccobacilli",
     "Vancomycin +\nCeftriaxone"],
    ["Children/Adults\n(2–50 years)",
     "N. meningitidis,\nS. pneumoniae",
     "Gram− diplococci (Meningo)\nGram+ diplococci (Pneumo)",
     "Vancomycin +\nCeftriaxone\n+ Dexamethasone"],
    ["Older Adults\n(>50 years /\nimmunosuppressed)",
     "S. pneumoniae, Listeria\nmonocytogenes, gram− bacilli",
     "Pneumo: gram+ diplococci\nListeria: gram+ rods",
     "Vancomycin + Ceftriaxone\n+ Ampicillin\n(covers Listeria)"],
]
story.append(make_table(
    org_headers, org_rows,
    col_widths=[PW*0.14, PW*0.32, PW*0.30, PW*0.24],
    header_bg=GREEN, stripe_a=WHITE, stripe_b=LIGHT_GREEN
))
story.append(Spacer(1, 5))

# ── SECTION 4: ANTIBIOTIC DOSES & DEXAMETHASONE ──────────────────────────────
story.append(section_header("④ KEY ANTIBIOTIC DOSES (Adult, Normal Renal Function) & ADJUNCTIVE THERAPY", NAVY))
story.append(Spacer(1, 2))

# Two side-by-side tables
abx_headers = ["Drug", "CNS Dose (Adult)"]
abx_rows = [
    ["Vancomycin", "40–60 mg/kg/day ÷ q8–12h"],
    ["Ceftriaxone", "2 g IV q12h"],
    ["Cefepime", "2 g IV q8h"],
    ["Cefotaxime", "2 g IV q4–6h"],
    ["Ampicillin", "2 g IV q4h"],
    ["Metronidazole", "500 mg IV q6h"],
    ["Aqueous Penicillin G", "18–24 million U/day continuous or ÷ q4h"],
    ["Acyclovir (HSV)", "10 mg/kg IV q8h × 14–21 days"],
]

dexa_text = (
    "<b>Dexamethasone (Adjunctive)</b><br/>"
    "• Give BEFORE or WITH first antibiotic dose<br/>"
    "• Dose: 0.15 mg/kg IV q6h × 4 days (adult)<br/>"
    "• Most evidence: S. pneumoniae meningitis<br/>"
    "• Reduces mortality + hearing loss (pneumococcal)<br/>"
    "• Reduces hearing loss in H. influenzae Hib meningitis<br/>"
    "• Continues for 4 days; concurrent dexamethasone<br/>"
    "&nbsp;&nbsp;does NOT significantly reduce CSF vancomycin levels<br/><br/>"
    "<b>Do NOT delay antibiotics for CT or LP.</b><br/>"
    "Draw blood cultures → start Abx + dexa → then LP / CT"
)

left_t = make_table(abx_headers, abx_rows, col_widths=[PW*0.26, PW*0.32], header_bg=NAVY)

right_p = ParagraphStyle("Dexa", fontName="Helvetica", fontSize=7.5,
                         textColor=DARK_GREY, leading=11, leftPadding=8)
right_block = Table(
    [[Paragraph(dexa_text, right_p)]],
    colWidths=[PW*0.38]
)
right_block.setStyle(TableStyle([
    ("BACKGROUND", (0,0), (-1,-1), LIGHT_TEAL),
    ("BOX", (0,0), (-1,-1), 0.5, TEAL),
    ("TOPPADDING", (0,0), (-1,-1), 6),
    ("BOTTOMPADDING", (0,0), (-1,-1), 6),
    ("LEFTPADDING", (0,0), (-1,-1), 8),
]))

combo = Table([[left_t, right_block]], colWidths=[PW*0.60, PW*0.40])
combo.setStyle(TableStyle([
    ("VALIGN", (0,0), (-1,-1), "TOP"),
    ("LEFTPADDING", (0,0), (-1,-1), 0),
    ("RIGHTPADDING", (0,0), (-1,-1), 0),
    ("TOPPADDING", (0,0), (-1,-1), 0),
    ("BOTTOMPADDING", (0,0), (-1,-1), 0),
]))
story.append(combo)
story.append(Spacer(1, 5))

# ── SECTION 5: TRAUMATIC TAP vs SAH ─────────────────────────────────────────
story.append(section_header("⑤ TRAUMATIC TAP vs SUBARACHNOID HEMORRHAGE", RED))
story.append(Spacer(1, 2))

tt_headers = ["Feature", "Traumatic Tap", "Subarachnoid Hemorrhage (SAH)"]
tt_rows = [
    ["RBC count", "High in tube 1, clears by tube 4\n(decreasing trend)", "Uniformly elevated across all 4 tubes\n(≥100,000 cells/μL typical; does NOT clear)"],
    ["Xanthochromia", "Absent (develops only if >2 h old)", "Present (develops within 2–4 h; persists days–weeks)\nYellow/pink – oxyhemoglobin then bilirubin"],
    ["Clotting", "CSF may clot (blood contamination)", "CSF does NOT clot"],
    ["Opening Pressure", "Normal or artefactually elevated", "Elevated"],
    ["Protein", "May be elevated (blood contamination):\nsubtract 1 mg/dL protein per 1000 RBCs", "Independently elevated"],
    ["WBC correction\n(traumatic)", "Subtract 1 WBC per 500–1000 RBCs\n(inconsistent evidence)", "Not applicable"],
    ["Gold standard", "—", "Spectrophotometry of tube 4\n(detects xanthochromia even when visual inspection normal)"],
]
story.append(make_table(
    tt_headers, tt_rows,
    col_widths=[PW*0.20, PW*0.38, PW*0.42],
    header_bg=RED, stripe_a=WHITE, stripe_b=LIGHT_RED
))
story.append(Spacer(1, 5))

# ── SECTION 6: SPECIAL PATTERNS ─────────────────────────────────────────────
story.append(section_header("⑥ SPECIAL & LESS-COMMON CSF PATTERNS", PURPLE))
story.append(Spacer(1, 2))

sp_headers = ["Condition", "Key CSF Finding(s)", "Additional Tests"]
sp_rows = [
    ["Cryptococcal meningitis\n(HIV / immunocompromised)",
     "Lymphocytic pleocytosis, ↓glucose;\nIndia ink: encapsulated yeast\nOpening pressure often very high",
     "Serum + CSF cryptococcal antigen (CrAg)\nFungal culture"],
    ["Tuberculous meningitis",
     "Lymphocytic, protein very high (may be >500);\nglucose very low (can be <20 mg/dL);\nSubacute/chronic onset",
     "AFB smear (30–40% sens), AFB culture (gold std)\nCSF PCR; send 20–30 mL for best yield"],
    ["HSV Encephalitis",
     "Lymphocytic pleocytosis\nCSF may show RBCs (haemorrhagic necrosis)\nNormal glucose",
     "CSF HSV PCR (>95% sensitivity)\nMRI: temporal lobe enhancement"],
    ["Guillain-Barré Syndrome (GBS)",
     "ALBUMINOCYTOLOGIC DISSOCIATION:\n↑↑ Protein (>100 mg/dL) with normal/near-normal WBC",
     "Nerve conduction studies\nAnti-ganglioside antibodies"],
    ["Multiple Sclerosis",
     "Normal opening pressure, WBC, glucose, protein\n(usually normal overall)",
     "Oligoclonal IgG bands (CSF only, not serum)\nIgG index elevated"],
    ["Carcinomatous / Leptomeningeal\nMetastasis",
     "↑ protein, ↓ glucose, lymphocytic pleocytosis;\nMay mimic TB meningitis",
     "CSF cytology (multiple LPs increase yield)\nFlow cytometry"],
    ["Neurosyphilis",
     "Lymphocytic pleocytosis, ↑ protein\n(may be subtle or normal)",
     "CSF VDRL (specific but insensitive)\nSerum RPR/TPPA/FTA-ABS"],
]
story.append(make_table(
    sp_headers, sp_rows,
    col_widths=[PW*0.23, PW*0.43, PW*0.34],
    header_bg=PURPLE, stripe_a=WHITE, stripe_b=LIGHT_PURP
))
story.append(Spacer(1, 5))

# ── SECTION 7: CT BEFORE LP DECISION ────────────────────────────────────────
story.append(section_header("⑦ WHEN TO CT BEFORE LP", AMBER))
story.append(Spacer(1, 2))

ct_text = (
    "<b>CT REQUIRED BEFORE LP if ANY of the following present:</b><br/>"
    "• Immunocompromised state (HIV, steroids, transplant)<br/>"
    "• Known or suspected CNS structural disease (mass, hydrocephalus)<br/>"
    "• Papilledema on fundoscopy or elevated optic nerve sheath diameter on bedside US<br/>"
    "• Focal neurologic deficit (new or changing)<br/>"
    "• New-onset seizures<br/>"
    "• Abnormal level of consciousness / GCS decline<br/><br/>"
    "<b>If NONE of the above → proceed directly to LP.</b><br/>"
    "⚠ Do NOT delay antibiotics + dexamethasone for CT or LP. Obtain blood cultures, start treatment, then image/puncture."
)
ct_block = Table(
    [[Paragraph(ct_text, ParagraphStyle("ct", fontName="Helvetica", fontSize=7.8,
                                         textColor=DARK_GREY, leading=11))]],
    colWidths=[PW]
)
ct_block.setStyle(TableStyle([
    ("BACKGROUND", (0,0), (-1,-1), LIGHT_AMB),
    ("BOX", (0,0), (-1,-1), 1, AMBER),
    ("TOPPADDING", (0,0), (-1,-1), 7),
    ("BOTTOMPADDING", (0,0), (-1,-1), 7),
    ("LEFTPADDING", (0,0), (-1,-1), 10),
    ("RIGHTPADDING", (0,0), (-1,-1), 10),
]))
story.append(ct_block)
story.append(Spacer(1, 5))

# ── FOOTER ───────────────────────────────────────────────────────────────────
story.append(HRFlowable(width=PW, thickness=0.5, color=MID_GREY))
story.append(Spacer(1, 2))
story.append(Paragraph(
    "Sources: Rosen's Emergency Medicine | Tintinalli's Emergency Medicine | Roberts & Hedges' Clinical Procedures | "
    "Bradley & Daroff's Neurology in Clinical Practice | Robbins & Kumar Basic Pathology | "
    "Harriet Lane Handbook 23rd Ed. | Goldman-Cecil Medicine | Neuroanatomy Through Clinical Cases 3e  ·  "
    "For educational use only. Always correlate with clinical context.",
    footnote_style))

# ── BUILD ────────────────────────────────────────────────────────────────────
doc.build(story)
print("PDF created:", OUTPUT)
Running Command

cd /home/daytona/workspace/csf-reference && python build_csf_ref.py 2>&1

Running Command

ls -lh /home/daytona/workspace/csf-reference/CSF_Analysis_Reference.pdf

Your clinical reference sheet is ready:

CSF Analysis Reference

PDF Document · PDF


The single-page A4 PDF covers 7 color-coded sections:
  1. Normal CSF Values - opening pressure, appearance, xanthochromia, RBC/WBC, glucose, protein with clinical notes
  2. Pattern Comparison Table - side-by-side columns for Normal / Bacterial / Viral / TB-Fungal / SAH across all key parameters, with color-coded abnormal values (red for bacterial, amber for TB, purple for fungal)
  3. Common Pathogens by Age - neonates through elderly with Gram stain appearance and empiric regimen per group
  4. Antibiotic Doses + Dexamethasone - CNS dosing table alongside a highlighted dexamethasone box with evidence summary and the "don't delay antibiotics" reminder
  5. Traumatic Tap vs SAH - RBC trends, xanthochromia timing, clotting, WBC correction formula
  6. Special Patterns - Cryptococcal, TB, HSV encephalitis, GBS (albuminocytologic dissociation), MS (oligoclonal bands), carcinomatous meningitis, neurosyphilis
  7. CT Before LP Decision Rule - highlighted amber box with all indications
Sources: Rosen's Emergency Medicine, Tintinalli's, Roberts & Hedges, Bradley & Daroff's Neurology, Robbins & Kumar, Harriet Lane Handbook 23rd Ed., Goldman-Cecil Medicine.
This is a shared conversation. Sign in to Orris to start your own chat.