Give me mcq regarding toxic shock syndrome
Create a study guide PDF comparing staphylococcal vs streptococcal TSS00% in the question?
mkdir -p /home/daytona/workspace/tss-study-guide
~/tss-study-guide/generate_tss_pdf.py
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.units import cm
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
HRFlowable, KeepTogether
)
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.platypus import PageBreak
OUTPUT_PATH = "/home/daytona/workspace/tss-study-guide/TSS_Study_Guide.pdf"
# ── Colours ────────────────────────────────────────────────────────────────────
DARK_BLUE = colors.HexColor("#1A3A5C")
MED_BLUE = colors.HexColor("#2E6DA4")
LIGHT_BLUE = colors.HexColor("#D6E8F7")
STAPH_COL = colors.HexColor("#1A5276") # deep blue for staph column header
STREP_COL = colors.HexColor("#1D6A33") # deep green for strep column header
STAPH_LIGHT = colors.HexColor("#D6EAF8")
STREP_LIGHT = colors.HexColor("#D5F5E3")
ALT_GREY = colors.HexColor("#F2F3F4")
GOLD = colors.HexColor("#D4AC0D")
WHITE = colors.white
RED_DARK = colors.HexColor("#922B21")
ORANGE = colors.HexColor("#CA6F1E")
# ── Styles ─────────────────────────────────────────────────────────────────────
styles = getSampleStyleSheet()
def s(name, **kw):
base = styles[name] if name in styles else styles["Normal"]
return ParagraphStyle(name + "_custom_" + str(id(kw)), parent=base, **kw)
TITLE_STYLE = s("Title",
fontSize=26, textColor=WHITE, alignment=TA_CENTER,
fontName="Helvetica-Bold", spaceAfter=4, leading=30)
SUBTITLE_STYLE = s("Normal",
fontSize=13, textColor=colors.HexColor("#AED6F1"),
alignment=TA_CENTER, fontName="Helvetica", spaceAfter=2)
SECTION_STYLE = s("Normal",
fontSize=14, textColor=WHITE, fontName="Helvetica-Bold",
alignment=TA_LEFT, leading=18, spaceAfter=2, spaceBefore=10)
SUBSECTION_STYLE = s("Normal",
fontSize=11, textColor=DARK_BLUE, fontName="Helvetica-Bold",
spaceAfter=4, spaceBefore=8)
BODY_STYLE = s("Normal",
fontSize=9.5, textColor=colors.HexColor("#2C2C2C"),
fontName="Helvetica", leading=14, spaceAfter=3, alignment=TA_JUSTIFY)
BULLET_STYLE = s("Normal",
fontSize=9.5, textColor=colors.HexColor("#2C2C2C"),
fontName="Helvetica", leading=13, leftIndent=14, spaceAfter=2)
TABLE_HEADER_STYLE = s("Normal",
fontSize=9.5, textColor=WHITE, fontName="Helvetica-Bold",
alignment=TA_CENTER, leading=12)
TABLE_CELL_STYLE = s("Normal",
fontSize=9, textColor=colors.HexColor("#1C1C1C"),
fontName="Helvetica", leading=12, alignment=TA_LEFT)
TABLE_CELL_CENTER = s("Normal",
fontSize=9, textColor=colors.HexColor("#1C1C1C"),
fontName="Helvetica", leading=12, alignment=TA_CENTER)
CAPTION_STYLE = s("Normal",
fontSize=8, textColor=colors.HexColor("#7F8C8D"),
fontName="Helvetica-Oblique", alignment=TA_CENTER)
MNEMONIC_STYLE = s("Normal",
fontSize=10, textColor=DARK_BLUE, fontName="Helvetica-Bold",
leading=15, leftIndent=10, spaceAfter=2)
WARNING_STYLE = s("Normal",
fontSize=9, textColor=RED_DARK, fontName="Helvetica-BoldOblique",
leading=13, leftIndent=10, spaceAfter=2)
NOTE_STYLE = s("Normal",
fontSize=8.5, textColor=colors.HexColor("#7D6608"),
fontName="Helvetica-Oblique", leading=12, alignment=TA_CENTER)
# ── Helper: section banner ─────────────────────────────────────────────────────
def section_banner(title, bg=DARK_BLUE):
data = [[Paragraph(title, SECTION_STYLE)]]
t = Table(data, colWidths=[17.5 * cm])
t.setStyle(TableStyle([
("BACKGROUND", (0, 0), (-1, -1), bg),
("TOPPADDING", (0, 0), (-1, -1), 6),
("BOTTOMPADDING", (0, 0), (-1, -1), 6),
("LEFTPADDING", (0, 0), (-1, -1), 10),
("RIGHTPADDING", (0, 0), (-1, -1), 10),
("ROUNDEDCORNERS", [4]),
]))
return t
def bullet(text):
return Paragraph(f"• {text}", BULLET_STYLE)
def body(text):
return Paragraph(text, BODY_STYLE)
def spacer(h=0.3):
return Spacer(1, h * cm)
def hr(color=MED_BLUE, thickness=1):
return HRFlowable(width="100%", thickness=thickness,
color=color, spaceAfter=4, spaceBefore=4)
# ── Main comparison table ──────────────────────────────────────────────────────
def build_comparison_table():
col_w = [4.5 * cm, 6.5 * cm, 6.5 * cm]
def hdr(txt, bg):
return Paragraph(txt, TABLE_HEADER_STYLE)
def c(txt):
return Paragraph(txt, TABLE_CELL_STYLE)
def cc(txt):
return Paragraph(txt, TABLE_CELL_CENTER)
rows = [
# Header row
[Paragraph("Feature", TABLE_HEADER_STYLE),
Paragraph("Staphylococcal TSS", TABLE_HEADER_STYLE),
Paragraph("Streptococcal TSS", TABLE_HEADER_STYLE)],
# Causative organism
[c("Causative Organism"),
c("Staphylococcus aureus (incl. MRSA)"),
c("Group A Streptococcus (S. pyogenes); rarely Group G")],
# Toxins
[c("Key Toxin(s)"),
c("TSST-1 (menstrual TSS 100%)\nSEA, SEB, SEC (non-menstrual)"),
c("Pyrogenic exotoxins A, B, C (SPE-A/B/C)\nStreptococcal superantigen (SSA)\nMitogenic exotoxin Z")],
# Mechanism
[c("Mechanism"),
c("Superantigen → binds MHC class II + T-cell Vβ receptor → massive cytokine release (TNF-α, IL-1)"),
c("Superantigen + SPE-B (cysteine protease) → cytokine storm (TNF-α, TNF-β, IL-1, IL-2, IL-6)")],
# Risk Factors
[c("Risk Factors"),
c("Tampon use (menstrual); nasal packing; surgical wounds; burns; postpartum; osteomyelitis; abscess"),
c("Invasive soft tissue infections (necrotizing fasciitis, myositis); bacteremia; pneumonia; skin disruption")],
# Typical Age
[c("Typical Age"),
c("Previously healthy adults 20–50 yrs"),
c("Adults 20–50 yrs; also children (mean ~5 yrs)")],
# Bacteremia
[c("Bacteremia"),
c("Uncommon: ~5–15% blood culture +ve"),
c("Common: ~50% blood culture +ve")],
# Rash
[c("Rash Character"),
c("Diffuse blanching macular erythroderma (sunburn-like); very common"),
c("Generalized blanching macular erythema; less common than staph TSS; blistering more likely")],
# Desquamation
[c("Desquamation"),
c("Full-thickness; palms & soles; 1–2 weeks after onset; very prominent"),
c("Occurs in ~20% of patients; palms & soles; less prominent")],
# Soft Tissue Infection
[c("Soft Tissue Involvement"),
c("Usually occult; skin/mucous membrane portal"),
c("Necrotizing fasciitis or myositis in many cases; violaceous hue/bullae/necrosis = worse prognosis")],
# Mucous membranes
[c("Mucous Membrane Findings"),
c("Strawberry tongue; non-exudative conjunctivitis; pharyngitis; vaginitis"),
c("Less prominent mucous membrane involvement compared to staphylococcal TSS")],
# Onset
[c("Onset / Progression"),
c("Acute; rapid onset of fever, rash, hypotension"),
c("May be insidious initially (flu-like); shock develops 48–72 h after onset")],
# Diagnostic criteria
[c("Diagnostic Criteria"),
c("Fever ≥38.9°C + hypotension (SBP <90) + rash + ≥3 organ systems; negative blood / CSF cultures"),
c("GAS from sterile site + hypotension + ≥2 organ systems (definite); or GAS non-sterile site + same")],
# Organ systems
[c("Organ Systems Involved"),
c("GI, muscular, CNS, renal, hepatic, hematologic (≥3 required)"),
c("Renal impairment, coagulopathy, liver impairment, ARDS, soft tissue necrosis (≥2 required)")],
# Lab findings
[c("Key Lab Findings"),
c("↑Creatinine, ↑LFTs, thrombocytopenia (<100,000/mm³), negative cultures usually"),
c("↑Creatinine (early), ↑CPK (necrotizing fasciitis), leukocytosis with left shift, DIC, ARDS")],
# Treatment - antibiotics
[c("Antibiotic Rx\n(MSSA)"),
c("Oxacillin or Nafcillin (2g IV q4h) OR Cefazolin (2g IV q8h) + Clindamycin (900mg IV q8h)"),
c("Penicillin G (4M units IV q4h) + Clindamycin (900mg IV q8h); alt: ceftriaxone or vancomycin")],
# Treatment - MRSA
[c("Antibiotic Rx\n(MRSA / resistant)"),
c("Vancomycin (15–20 mg/kg q8–12h, max 2g/dose) + Clindamycin (900mg IV q8h)"),
c("N/A for MRSA; alternatives: ceftriaxone, cefazolin, vancomycin, daptomycin (6mg/kg IV q24h)")],
# Why clindamycin?
[c("Role of Clindamycin"),
c("Suppresses toxin synthesis; added to β-lactam regardless of MSSA or MRSA"),
c("Suppresses SPE toxin production; first-line partner to penicillin G; linezolid is alternative")],
# Surgery
[c("Surgical Intervention"),
c("Source control (drainage, debridement of focus)"),
c("Early, aggressive surgical debridement / fasciotomy / amputation — often life-saving")],
# Other supportive
[c("Other Therapy"),
c("IV fluids, vasopressors, ventilatory support; IVIg (may neutralize toxins)"),
c("IV fluids, vasopressors, ventilatory support; IVIg to neutralize toxins (evidence supports)")],
# Mortality
[c("Mortality"),
c("~5–15%"),
c("30–60% (up to 5× higher than staphylococcal TSS)")],
# Recurrence
[c("Recurrence Risk"),
c("Higher — menstrual TSS can recur with continued tampon use"),
c("Lower recurrence risk; single invasive episode common")],
]
tbl = Table(rows, colWidths=col_w, repeatRows=1)
style = TableStyle([
# Header
("BACKGROUND", (0, 0), (0, 0), DARK_BLUE),
("BACKGROUND", (1, 0), (1, 0), STAPH_COL),
("BACKGROUND", (2, 0), (2, 0), STREP_COL),
("TEXTCOLOR", (0, 0), (-1, 0), WHITE),
("FONTNAME", (0, 0), (-1, 0), "Helvetica-Bold"),
("FONTSIZE", (0, 0), (-1, 0), 9.5),
("ALIGN", (0, 0), (-1, 0), "CENTER"),
# Feature column
("BACKGROUND", (0, 1), (0, -1), colors.HexColor("#EBF5FB")),
("FONTNAME", (0, 1), (0, -1), "Helvetica-Bold"),
("FONTSIZE", (0, 1), (0, -1), 8.5),
# Alternating row colours
*[("BACKGROUND", (1, i), (1, i), STAPH_LIGHT if i % 2 == 0 else WHITE)
for i in range(1, len(rows))],
*[("BACKGROUND", (2, i), (2, i), STREP_LIGHT if i % 2 == 0 else WHITE)
for i in range(1, len(rows))],
# Grid
("GRID", (0, 0), (-1, -1), 0.5, colors.HexColor("#BDC3C7")),
("VALIGN", (0, 0), (-1, -1), "TOP"),
("TOPPADDING", (0, 0), (-1, -1), 5),
("BOTTOMPADDING", (0, 0), (-1, -1), 5),
("LEFTPADDING", (0, 0), (-1, -1), 5),
("RIGHTPADDING", (0, 0), (-1, -1), 5),
("FONTSIZE", (1, 1), (-1, -1), 8.5),
("ROWBACKGROUNDS",(0, 0), (-1, -1), [None]),
])
tbl.setStyle(style)
return tbl
# ── Diagnostic criteria box ────────────────────────────────────────────────────
def build_criteria_table():
col_w = [8.5 * cm, 9 * cm]
rows = [
[Paragraph("STAPHYLOCOCCAL TSS CRITERIA", TABLE_HEADER_STYLE),
Paragraph("STREPTOCOCCAL TSS CRITERIA", TABLE_HEADER_STYLE)],
[
Paragraph(
"<b>ALL of the following:</b><br/>"
"1. Fever: temperature ≥38.9°C (102°F)<br/>"
"2. Rash: diffuse macular erythroderma<br/>"
"3. Desquamation: 1–2 weeks after onset (palms & soles)<br/>"
"4. Hypotension: SBP <90 mmHg (adults)<br/>"
"5. Multisystem involvement (≥3 organ systems):<br/>"
" • GI • Muscular • CNS<br/>"
" • Renal • Hepatic • Hematologic<br/>"
"6. Negative: Blood/CSF cultures, RMSF serology, leptospirosis, measles",
TABLE_CELL_STYLE),
Paragraph(
"<b>DEFINITE case:</b> GAS from sterile site<br/>"
" (blood, CSF, tissue biopsy, surgical wound)<br/><br/>"
"<b>PROBABLE case:</b> GAS from non-sterile site<br/>"
" (throat, sputum, vagina, superficial lesion)<br/><br/>"
"<b>PLUS all of:</b><br/>"
"• Hypotension: SBP <90 mmHg (adults)<br/>"
"• ≥2 of the following:<br/>"
" – Renal impairment<br/>"
" – Coagulopathy (plt <100,000 or DIC)<br/>"
" – Liver impairment<br/>"
" – ARDS<br/>"
" – Erythematous rash ± desquamation<br/>"
" – Soft tissue necrosis",
TABLE_CELL_STYLE),
]
]
tbl = Table(rows, colWidths=col_w)
tbl.setStyle(TableStyle([
("BACKGROUND", (0, 0), (0, 0), STAPH_COL),
("BACKGROUND", (1, 0), (1, 0), STREP_COL),
("TEXTCOLOR", (0, 0), (-1, 0), WHITE),
("FONTNAME", (0, 0), (-1, 0), "Helvetica-Bold"),
("ALIGN", (0, 0), (-1, 0), "CENTER"),
("BACKGROUND", (0, 1), (0, 1), STAPH_LIGHT),
("BACKGROUND", (1, 1), (1, 1), STREP_LIGHT),
("GRID", (0, 0), (-1, -1), 0.5, colors.HexColor("#BDC3C7")),
("VALIGN", (0, 0), (-1, -1), "TOP"),
("TOPPADDING", (0, 0), (-1, -1), 7),
("BOTTOMPADDING", (0, 0), (-1, -1), 7),
("LEFTPADDING", (0, 0), (-1, -1), 7),
("RIGHTPADDING", (0, 0), (-1, -1), 7),
("FONTSIZE", (0, 1), (-1, -1), 8.5),
]))
return tbl
# ── Treatment comparison table ─────────────────────────────────────────────────
def build_treatment_table():
col_w = [3.5 * cm, 7 * cm, 7 * cm]
rows = [
[Paragraph("", TABLE_HEADER_STYLE),
Paragraph("STAPHYLOCOCCAL TSS", TABLE_HEADER_STYLE),
Paragraph("STREPTOCOCCAL TSS", TABLE_HEADER_STYLE)],
[Paragraph("Supportive", TABLE_CELL_STYLE),
Paragraph("IV fluids, vasopressors, ventilatory support", TABLE_CELL_STYLE),
Paragraph("Aggressive IV fluids, vasopressors, ventilatory support", TABLE_CELL_STYLE)],
[Paragraph("MSSA\n(1st line)", TABLE_CELL_STYLE),
Paragraph("Oxacillin/Nafcillin 2g IV q4h\nOR Cefazolin 2g IV q8h\n+ Clindamycin 900mg IV q8h", TABLE_CELL_STYLE),
Paragraph("Penicillin G 4 million units IV q4h\n+ Clindamycin 900mg IV q8h", TABLE_CELL_STYLE)],
[Paragraph("MRSA", TABLE_CELL_STYLE),
Paragraph("Vancomycin 15–20mg/kg IV q8–12h (max 2g/dose)\n+ Clindamycin 900mg IV q8h", TABLE_CELL_STYLE),
Paragraph("Not applicable (GAS penicillin-sensitive)\nAlternatives: Ceftriaxone, Vancomycin, Daptomycin 6mg/kg IV q24h", TABLE_CELL_STYLE)],
[Paragraph("Toxin suppression", TABLE_CELL_STYLE),
Paragraph("Clindamycin (blocks ribosomal 50S → inhibits toxin synthesis)", TABLE_CELL_STYLE),
Paragraph("Clindamycin; alternatively Linezolid\n(both block toxin production)", TABLE_CELL_STYLE)],
[Paragraph("IVIg", TABLE_CELL_STYLE),
Paragraph("May be considered to neutralize TSST-1", TABLE_CELL_STYLE),
Paragraph("IVIg beneficial — neutralizes streptococcal superantigens; recommended in severe/refractory cases", TABLE_CELL_STYLE)],
[Paragraph("Surgery", TABLE_CELL_STYLE),
Paragraph("Source control: drain/debride focus of infection", TABLE_CELL_STYLE),
Paragraph("Early aggressive surgical debridement / fasciotomy / amputation — often life-saving in necrotizing fasciitis", TABLE_CELL_STYLE)],
[Paragraph("Source removal", TABLE_CELL_STYLE),
Paragraph("Remove tampon / nasal packing / foreign body", TABLE_CELL_STYLE),
Paragraph("Identify and treat portal of entry", TABLE_CELL_STYLE)],
]
tbl = Table(rows, colWidths=col_w, repeatRows=1)
tbl.setStyle(TableStyle([
("BACKGROUND", (0, 0), (0, 0), DARK_BLUE),
("BACKGROUND", (1, 0), (1, 0), STAPH_COL),
("BACKGROUND", (2, 0), (2, 0), STREP_COL),
("TEXTCOLOR", (0, 0), (-1, 0), WHITE),
("FONTNAME", (0, 0), (-1, 0), "Helvetica-Bold"),
("ALIGN", (0, 0), (-1, 0), "CENTER"),
("BACKGROUND", (0, 1), (0, -1), colors.HexColor("#EBF5FB")),
("FONTNAME", (0, 1), (0, -1), "Helvetica-Bold"),
("FONTSIZE", (0, 1), (0, -1), 8),
*[("BACKGROUND", (1, i), (1, i), STAPH_LIGHT if i % 2 == 1 else WHITE)
for i in range(1, len(rows))],
*[("BACKGROUND", (2, i), (2, i), STREP_LIGHT if i % 2 == 1 else WHITE)
for i in range(1, len(rows))],
("GRID", (0, 0), (-1, -1), 0.5, colors.HexColor("#BDC3C7")),
("VALIGN", (0, 0), (-1, -1), "TOP"),
("TOPPADDING", (0, 0), (-1, -1), 5),
("BOTTOMPADDING", (0, 0), (-1, -1), 5),
("LEFTPADDING", (0, 0), (-1, -1), 5),
("RIGHTPADDING", (0, 0), (-1, -1), 5),
("FONTSIZE", (1, 1), (-1, -1), 8.5),
]))
return tbl
# ── High-yield facts box ───────────────────────────────────────────────────────
def high_yield_box():
staph_items = [
"TSST-1 is responsible for <b>100%</b> of menstrual/tampon-associated TSS",
"TSST-1 gene found in only ~<b>20%</b> of S. aureus isolates (incl. MRSA)",
"Blood cultures positive in only <b>5–15%</b> of cases",
"Desquamation of palms & soles occurs <b>1–2 weeks</b> after onset",
"Strawberry tongue + non-exudative conjunctivitis = classic mucous membrane findings",
"Recurrence can occur with continued tampon use",
"Mortality: <b>5–15%</b>",
"Rash fades within <b>3 days</b>, desquamation follows",
]
strep_items = [
"Most cases associated with <b>necrotizing fasciitis</b> or myositis",
"Blood cultures positive in ~<b>50%</b> of cases (much higher than staph TSS)",
"Shock develops <b>48–72 hours</b> after symptom onset",
"CPK elevation indicates necrotizing fasciitis / myonecrosis",
"Rash and desquamation <b>less prominent</b> than in staphylococcal TSS",
"NSAIDs can <b>mask early signs</b> — delay diagnosis and worsen outcome",
"Mortality: <b>30–60%</b> (up to 5× that of staph TSS)",
"Early surgery is often <b>life-saving</b>",
]
col_w = [8.5 * cm, 9 * cm]
rows = [
[Paragraph("⭐ HIGH-YIELD: STAPHYLOCOCCAL TSS", TABLE_HEADER_STYLE),
Paragraph("⭐ HIGH-YIELD: STREPTOCOCCAL TSS", TABLE_HEADER_STYLE)],
[
"\n".join([f"• {i}" for i in staph_items]),
"\n".join([f"• {i}" for i in strep_items]),
]
]
# Build cell content as Paragraphs
body_rows = [rows[0]]
cell_staph = [Paragraph(f"• {item}", ParagraphStyle("hy", parent=styles["Normal"],
fontSize=8.5, fontName="Helvetica", leading=14, spaceAfter=2,
textColor=colors.HexColor("#1A2F45"))) for item in staph_items]
cell_strep = [Paragraph(f"• {item}", ParagraphStyle("hy2", parent=styles["Normal"],
fontSize=8.5, fontName="Helvetica", leading=14, spaceAfter=2,
textColor=colors.HexColor("#145A32"))) for item in strep_items]
from reportlab.platypus import ListFlowable, ListItem
body_rows.append([cell_staph, cell_strep])
tbl = Table(body_rows, colWidths=col_w)
tbl.setStyle(TableStyle([
("BACKGROUND", (0, 0), (0, 0), STAPH_COL),
("BACKGROUND", (1, 0), (1, 0), STREP_COL),
("TEXTCOLOR", (0, 0), (-1, 0), WHITE),
("FONTNAME", (0, 0), (-1, 0), "Helvetica-Bold"),
("ALIGN", (0, 0), (-1, 0), "CENTER"),
("BACKGROUND", (0, 1), (0, 1), STAPH_LIGHT),
("BACKGROUND", (1, 1), (1, 1), STREP_LIGHT),
("GRID", (0, 0), (-1, -1), 0.5, colors.HexColor("#BDC3C7")),
("VALIGN", (0, 0), (-1, -1), "TOP"),
("TOPPADDING", (0, 0), (-1, -1), 7),
("BOTTOMPADDING", (0, 0), (-1, -1), 7),
("LEFTPADDING", (0, 0), (-1, -1), 7),
("RIGHTPADDING", (0, 0), (-1, -1), 7),
]))
return tbl
# ── Title page header ──────────────────────────────────────────────────────────
def title_block():
data = [[
Paragraph("TOXIC SHOCK SYNDROME", TITLE_STYLE),
Paragraph("Staphylococcal vs Streptococcal — Comprehensive Study Guide", SUBTITLE_STYLE),
Paragraph("Sources: Goldman-Cecil Medicine · Rosen's Emergency Medicine · Dermatology 5e · Jawetz Medical Microbiology · Tietz Laboratory Medicine", CAPTION_STYLE),
]]
# stack vertically in one column
inner = [[Paragraph("TOXIC SHOCK SYNDROME", TITLE_STYLE)],
[Paragraph("Staphylococcal vs Streptococcal — Comprehensive Study Guide", SUBTITLE_STYLE)],
[Spacer(1, 0.2 * cm)],
[Paragraph("Sources: Goldman-Cecil Medicine · Rosen's Emergency Medicine · Dermatology 5e · Jawetz Medical Microbiology · Tietz Laboratory Medicine", CAPTION_STYLE)]]
t = Table(inner, colWidths=[17.5 * cm])
t.setStyle(TableStyle([
("BACKGROUND", (0, 0), (-1, -1), DARK_BLUE),
("TOPPADDING", (0, 0), (-1, -1), 10),
("BOTTOMPADDING", (0, 0), (-1, -1), 8),
("LEFTPADDING", (0, 0), (-1, -1), 14),
("RIGHTPADDING", (0, 0), (-1, -1), 14),
]))
return t
# ── Mnemonic box ──────────────────────────────────────────────────────────────
def mnemonic_box():
items = [
["F", "Fever (≥38.9°C / 102°F)"],
["R", "Rash — diffuse macular erythroderma"],
["A", "And Hypotension (SBP <90 mmHg)"],
["S", "Skin Desquamation (palms & soles, 1–2 weeks later)"],
["H", "Hypotension (multiorgan ≥3 systems in staph; ≥2 in strep)"],
]
note = "Mnemonic: F-R-A-S-H for Staphylococcal TSS diagnostic features"
rows = []
for letter, meaning in items:
rows.append([
Paragraph(f"<b>{letter}</b>", ParagraphStyle("ml", parent=styles["Normal"],
fontSize=14, textColor=GOLD, fontName="Helvetica-Bold", alignment=TA_CENTER)),
Paragraph(meaning, ParagraphStyle("mm", parent=styles["Normal"],
fontSize=9.5, textColor=DARK_BLUE, fontName="Helvetica", leading=13)),
])
tbl = Table(rows, colWidths=[1.2 * cm, 16 * cm])
tbl.setStyle(TableStyle([
("BACKGROUND", (0, 0), (-1, -1), colors.HexColor("#FEF9E7")),
("GRID", (0, 0), (-1, -1), 0.3, colors.HexColor("#F9E79F")),
("VALIGN", (0, 0), (-1, -1), "MIDDLE"),
("TOPPADDING", (0, 0), (-1, -1), 4),
("BOTTOMPADDING", (0, 0), (-1, -1), 4),
("LEFTPADDING", (0, 0), (-1, -1), 6),
]))
return [Paragraph(note, NOTE_STYLE), spacer(0.2), tbl]
# ── Quick differentiator box ───────────────────────────────────────────────────
def quick_diff_box():
rows = [
[Paragraph("KEY DIFFERENTIATORS", TABLE_HEADER_STYLE)],
[Paragraph(
"• <b>Blood culture positive</b>: ~50% in Strep TSS vs 5–15% in Staph TSS<br/>"
"• <b>Necrotizing fasciitis</b>: characteristic of Strep TSS, not Staph TSS<br/>"
"• <b>Mortality</b>: Strep TSS (30–60%) is 5× higher than Staph TSS (5–15%)<br/>"
"• <b>Rash prominence</b>: more diffuse and reliable in Staph TSS; less common in Strep TSS<br/>"
"• <b>Tampon/nasal packing</b>: classic risk factor for Staph TSS only<br/>"
"• <b>TSST-1</b> = 100% of menstrual TSS (staph); <b>SPE A/B/C</b> = strep toxins<br/>"
"• <b>Desquamation</b>: 100% in staph TSS; ~20% in strep TSS<br/>"
"• <b>IVIg</b>: stronger evidence in strep TSS than staph TSS",
ParagraphStyle("kd", parent=styles["Normal"], fontSize=9.5,
fontName="Helvetica", leading=15, textColor=DARK_BLUE)
)]
]
tbl = Table(rows, colWidths=[17.5 * cm])
tbl.setStyle(TableStyle([
("BACKGROUND", (0, 0), (-1, 0), MED_BLUE),
("BACKGROUND", (0, 1), (-1, 1), colors.HexColor("#EBF5FB")),
("TEXTCOLOR", (0, 0), (-1, 0), WHITE),
("FONTNAME", (0, 0), (-1, 0), "Helvetica-Bold"),
("ALIGN", (0, 0), (-1, 0), "CENTER"),
("GRID", (0, 0), (-1, -1), 0.5, MED_BLUE),
("TOPPADDING", (0, 0), (-1, -1), 7),
("BOTTOMPADDING", (0, 0), (-1, -1), 7),
("LEFTPADDING", (0, 0), (-1, -1), 10),
("RIGHTPADDING", (0, 0), (-1, -1), 10),
]))
return tbl
# ── Pathogenesis table ─────────────────────────────────────────────────────────
def pathogenesis_table():
col_w = [8.5 * cm, 9 * cm]
rows = [
[Paragraph("STAPHYLOCOCCAL TSS — Pathogenesis", TABLE_HEADER_STYLE),
Paragraph("STREPTOCOCCAL TSS — Pathogenesis", TABLE_HEADER_STYLE)],
[
Paragraph(
"<b>Organism:</b> S. aureus (coagulase +ve)<br/><br/>"
"<b>Toxin:</b> TSST-1 (= enterotoxin F) — the prototypical superantigen<br/><br/>"
"<b>Superantigen mechanism:</b> Binds MHC class II molecules on APCs without intracellular processing + binds Vβ region of TCR → massive non-specific T cell proliferation (5–30% of circulating T cells vs 0.01% for conventional antigen)<br/><br/>"
"<b>Cytokine storm:</b> TNF-α, IL-1 — mediate fever, erythema, shock, organ dysfunction<br/><br/>"
"<b>Gene location:</b> Chromosomal pathogenicity island (interacts with bacteriophages)",
TABLE_CELL_STYLE),
Paragraph(
"<b>Organism:</b> Group A Streptococcus (S. pyogenes; M types 1 & 3 virulent)<br/><br/>"
"<b>Toxins:</b> SPE-A, B, C (pyrogenic exotoxins); streptococcal superantigen (SSA); mitogenic exotoxin Z; SPE-B (cysteine protease cleaves pre-IL-1β)<br/><br/>"
"<b>Superantigen mechanism:</b> Same Vβ/MHC II binding → 5–30% T cell activation → cytokine storm<br/><br/>"
"<b>Cytokine storm:</b> TNF-α, TNF-β, IL-1, IL-2, IL-6 — also upregulates TLR-2 & TLR-4 → amplifies endotoxin effects<br/><br/>"
"<b>Streptolysin O:</b> Acts synergistically with SPE-A",
TABLE_CELL_STYLE),
]
]
tbl = Table(rows, colWidths=col_w)
tbl.setStyle(TableStyle([
("BACKGROUND", (0, 0), (0, 0), STAPH_COL),
("BACKGROUND", (1, 0), (1, 0), STREP_COL),
("TEXTCOLOR", (0, 0), (-1, 0), WHITE),
("FONTNAME", (0, 0), (-1, 0), "Helvetica-Bold"),
("ALIGN", (0, 0), (-1, 0), "CENTER"),
("BACKGROUND", (0, 1), (0, 1), STAPH_LIGHT),
("BACKGROUND", (1, 1), (1, 1), STREP_LIGHT),
("GRID", (0, 0), (-1, -1), 0.5, colors.HexColor("#BDC3C7")),
("VALIGN", (0, 0), (-1, -1), "TOP"),
("TOPPADDING", (0, 0), (-1, -1), 7),
("BOTTOMPADDING", (0, 0), (-1, -1), 7),
("LEFTPADDING", (0, 0), (-1, -1), 7),
("RIGHTPADDING", (0, 0), (-1, -1), 7),
("FONTSIZE", (0, 1), (-1, 1), 8.5),
]))
return tbl
# ── Footer ─────────────────────────────────────────────────────────────────────
def add_page_number(canvas, doc):
canvas.saveState()
canvas.setFont("Helvetica", 7.5)
canvas.setFillColor(colors.HexColor("#7F8C8D"))
canvas.drawString(2 * cm, 1.2 * cm, "TSS Comparison Study Guide | Orris Medical Education")
canvas.drawRightString(19 * cm, 1.2 * cm, f"Page {doc.page}")
canvas.restoreState()
# ── Build document ─────────────────────────────────────────────────────────────
def build():
doc = SimpleDocTemplate(
OUTPUT_PATH,
pagesize=A4,
topMargin=1.5 * cm,
bottomMargin=2 * cm,
leftMargin=2 * cm,
rightMargin=2 * cm,
title="Toxic Shock Syndrome — Staphylococcal vs Streptococcal Study Guide",
author="Orris Medical Education",
)
story = []
# ── TITLE ──────────────────────────────────────────────────────────────────
story.append(title_block())
story.append(spacer(0.5))
# ── OVERVIEW ───────────────────────────────────────────────────────────────
story.append(section_banner("1. OVERVIEW"))
story.append(spacer(0.3))
story.append(body(
"Toxic Shock Syndrome (TSS) is an acute, life-threatening febrile illness caused by the systemic effects "
"of bacterial exotoxins acting as superantigens. Two distinct forms exist, caused by different organisms "
"with overlapping but distinguishable presentations. Both types trigger a massive cytokine storm through "
"non-specific T-cell stimulation, leading to fever, rash, hypotension, and multiorgan dysfunction."
))
story.append(spacer(0.2))
# ── PATHOGENESIS ───────────────────────────────────────────────────────────
story.append(section_banner("2. PATHOGENESIS"))
story.append(spacer(0.3))
story.append(pathogenesis_table())
story.append(spacer(0.4))
# ── MASTER COMPARISON TABLE ────────────────────────────────────────────────
story.append(section_banner("3. MASTER COMPARISON TABLE"))
story.append(spacer(0.3))
story.append(build_comparison_table())
story.append(spacer(0.5))
story.append(Paragraph("Table sources: Goldman-Cecil Medicine, Rosen's Emergency Medicine, Dermatology 5e, Jawetz Medical Microbiology, Tietz Laboratory Medicine", CAPTION_STYLE))
story.append(spacer(0.5))
# ── DIAGNOSTIC CRITERIA ────────────────────────────────────────────────────
story.append(section_banner("4. FORMAL DIAGNOSTIC CRITERIA"))
story.append(spacer(0.3))
story.append(build_criteria_table())
story.append(spacer(0.4))
# Mnemonic
story.append(section_banner("5. MNEMONIC (Staph TSS)", bg=colors.HexColor("#7D6608")))
story.append(spacer(0.3))
for item in mnemonic_box():
story.append(item)
story.append(spacer(0.4))
# ── TREATMENT ──────────────────────────────────────────────────────────────
story.append(section_banner("6. TREATMENT"))
story.append(spacer(0.3))
story.append(build_treatment_table())
story.append(spacer(0.3))
story.append(Paragraph(
"⚠ Clindamycin is added in BOTH types to suppress toxin synthesis (ribosomal 50S inhibitor). "
"Do NOT use clindamycin as sole antibiotic — always combine with a cell-wall active agent.",
ParagraphStyle("warn", parent=styles["Normal"], fontSize=9, fontName="Helvetica-BoldOblique",
textColor=RED_DARK, leading=13, leftIndent=8, spaceAfter=4)
))
story.append(spacer(0.4))
# ── HIGH YIELD ─────────────────────────────────────────────────────────────
story.append(section_banner("7. HIGH-YIELD EXAM FACTS", bg=colors.HexColor("#117A65")))
story.append(spacer(0.3))
story.append(high_yield_box())
story.append(spacer(0.4))
# ── KEY DIFFERENTIATORS ────────────────────────────────────────────────────
story.append(section_banner("8. KEY DIFFERENTIATORS AT A GLANCE"))
story.append(spacer(0.3))
story.append(quick_diff_box())
story.append(spacer(0.5))
# ── QUICK REFERENCE SUMMARY ────────────────────────────────────────────────
story.append(section_banner("9. QUICK REFERENCE SUMMARY", bg=colors.HexColor("#4A235A")))
story.append(spacer(0.3))
summary_rows = [
[Paragraph("", TABLE_HEADER_STYLE),
Paragraph("STAPH TSS", TABLE_HEADER_STYLE),
Paragraph("STREP TSS", TABLE_HEADER_STYLE)],
[Paragraph("Organism", TABLE_CELL_STYLE), Paragraph("S. aureus", TABLE_CELL_STYLE), Paragraph("S. pyogenes (GAS)", TABLE_CELL_STYLE)],
[Paragraph("Key Toxin", TABLE_CELL_STYLE), Paragraph("TSST-1", TABLE_CELL_STYLE), Paragraph("SPE-A/B/C, SSA", TABLE_CELL_STYLE)],
[Paragraph("Bacteremia", TABLE_CELL_STYLE), Paragraph("5–15%", TABLE_CELL_STYLE), Paragraph("~50%", TABLE_CELL_STYLE)],
[Paragraph("Mortality", TABLE_CELL_STYLE), Paragraph("5–15%", TABLE_CELL_STYLE), Paragraph("30–60%", TABLE_CELL_STYLE)],
[Paragraph("Classic Risk", TABLE_CELL_STYLE), Paragraph("Tampon / nasal packing", TABLE_CELL_STYLE), Paragraph("Necrotizing fasciitis", TABLE_CELL_STYLE)],
[Paragraph("Rash", TABLE_CELL_STYLE), Paragraph("Very prominent macular erythroderma", TABLE_CELL_STYLE), Paragraph("Less common; blistering more likely", TABLE_CELL_STYLE)],
[Paragraph("Desquamation", TABLE_CELL_STYLE), Paragraph("Prominent (palms & soles)", TABLE_CELL_STYLE), Paragraph("Only ~20%", TABLE_CELL_STYLE)],
[Paragraph("Antibiotics", TABLE_CELL_STYLE), Paragraph("Oxacillin/Nafcillin + Clindamycin\n(MRSA: Vancomycin + Clinda)", TABLE_CELL_STYLE), Paragraph("Penicillin G + Clindamycin", TABLE_CELL_STYLE)],
[Paragraph("Surgery", TABLE_CELL_STYLE), Paragraph("Source control", TABLE_CELL_STYLE), Paragraph("Early aggressive debridement", TABLE_CELL_STYLE)],
]
sumtbl = Table(summary_rows, colWidths=[3.5 * cm, 7 * cm, 7 * cm], repeatRows=1)
sumtbl.setStyle(TableStyle([
("BACKGROUND", (0, 0), (0, 0), colors.HexColor("#4A235A")),
("BACKGROUND", (1, 0), (1, 0), STAPH_COL),
("BACKGROUND", (2, 0), (2, 0), STREP_COL),
("TEXTCOLOR", (0, 0), (-1, 0), WHITE),
("FONTNAME", (0, 0), (-1, 0), "Helvetica-Bold"),
("ALIGN", (0, 0), (-1, 0), "CENTER"),
("BACKGROUND", (0, 1), (0, -1), colors.HexColor("#EBF5FB")),
("FONTNAME", (0, 1), (0, -1), "Helvetica-Bold"),
("FONTSIZE", (0, 1), (0, -1), 8),
*[("BACKGROUND", (1, i), (1, i), STAPH_LIGHT if i % 2 == 1 else WHITE) for i in range(1, 11)],
*[("BACKGROUND", (2, i), (2, i), STREP_LIGHT if i % 2 == 1 else WHITE) for i in range(1, 11)],
("GRID", (0, 0), (-1, -1), 0.5, colors.HexColor("#BDC3C7")),
("VALIGN", (0, 0), (-1, -1), "TOP"),
("TOPPADDING", (0, 0), (-1, -1), 5),
("BOTTOMPADDING", (0, 0), (-1, -1), 5),
("LEFTPADDING", (0, 0), (-1, -1), 5),
("RIGHTPADDING", (0, 0), (-1, -1), 5),
("FONTSIZE", (1, 1), (-1, -1), 8.5),
]))
story.append(sumtbl)
story.append(spacer(0.5))
# ── REFERENCES ─────────────────────────────────────────────────────────────
story.append(hr())
story.append(Paragraph(
"<b>References:</b> Goldman-Cecil Medicine (International Ed.) · Rosen's Emergency Medicine 9e · "
"Dermatology 2-Volume Set 5e (Elsevier) · Jawetz, Melnick & Adelberg's Medical Microbiology 28e · "
"Tietz Textbook of Laboratory Medicine 7e · Medical Microbiology 9e",
CAPTION_STYLE
))
doc.build(story, onFirstPage=add_page_number, onLaterPages=add_page_number)
print(f"PDF saved to: {OUTPUT_PATH}")
if __name__ == "__main__":
build()
cd /home/daytona/workspace/tss-study-guide && python generate_tss_pdf.py 2>&1
ls -lh /home/daytona/workspace/tss-study-guide/TSS_Study_Guide.pdf
cd /home/daytona/workspace/tss-study-guide && python -c "from pypdf import PdfRe…
cd /home/daytona/workspace/tss-study-guide && python -c " from pypdf import PdfR…
TSS Study Guide
PDF Document · PDF