Make a ppt on myocarditis in pediatrics
mkdir -p /tmp/workspace/myocarditis-pptx && ls /tmp/workspace/myocarditis-pptx/
~/myocarditis-pptx/build_pptx.py
from pptx import Presentation
from pptx.util import Inches, Pt, Emu
from pptx.dml.color import RGBColor
from pptx.enum.text import PP_ALIGN, MSO_ANCHOR
from pptx.util import Inches, Pt
from io import BytesIO
# ── Color palette ──────────────────────────────────────────────
C_DARK_BLUE = RGBColor(0x0D, 0x2B, 0x55) # slide bg / headers
C_MED_BLUE = RGBColor(0x1A, 0x53, 0x8B) # accent boxes
C_LIGHT_BLUE = RGBColor(0xE8, 0xF4, 0xFF) # card bg
C_RED = RGBColor(0xC0, 0x39, 0x2B) # highlight
C_ORANGE = RGBColor(0xE6, 0x7E, 0x22) # accent 2
C_WHITE = RGBColor(0xFF, 0xFF, 0xFF)
C_OFFWHITE = RGBColor(0xF5, 0xF7, 0xFA)
C_TEXT_DARK = RGBColor(0x1A, 0x1A, 0x2E)
C_TEAL = RGBColor(0x00, 0x86, 0x8B)
C_GREEN = RGBColor(0x27, 0xAE, 0x60)
def prs_new():
p = Presentation()
p.slide_width = Inches(13.333)
p.slide_height = Inches(7.5)
return p
def blank(prs):
return prs.slides.add_slide(prs.slide_layouts[6])
def bg(slide, color):
from pptx.util import Emu
from pptx.oxml.ns import qn
import lxml.etree as etree
bg_elem = slide.background
fill = bg_elem.fill
fill.solid()
fill.fore_color.rgb = color
def rect(slide, x, y, w, h, fill_color, border=False, border_color=None, radius=0):
shape = slide.shapes.add_shape(
1, # MSO_SHAPE_TYPE.RECTANGLE
Inches(x), Inches(y), Inches(w), Inches(h)
)
shape.fill.solid()
shape.fill.fore_color.rgb = fill_color
if border and border_color:
shape.line.color.rgb = border_color
shape.line.width = Pt(1)
else:
shape.line.fill.background()
return shape
def txt(slide, text, x, y, w, h, size=18, bold=False, color=C_TEXT_DARK,
align=PP_ALIGN.LEFT, italic=False, wrap=True):
tb = slide.shapes.add_textbox(Inches(x), Inches(y), Inches(w), Inches(h))
tf = tb.text_frame
tf.word_wrap = wrap
tf.margin_left = 0; tf.margin_right = 0
tf.margin_top = 0; tf.margin_bottom = 0
p = tf.paragraphs[0]
p.alignment = align
r = p.add_run()
r.text = text
r.font.size = Pt(size)
r.font.bold = bold
r.font.italic = italic
r.font.color.rgb = color
r.font.name = "Calibri"
return tb
def add_bullet_box(slide, bullets, x, y, w, h, title=None,
bg_color=C_LIGHT_BLUE, title_color=C_DARK_BLUE,
bullet_color=C_TEXT_DARK, title_size=14, bullet_size=13,
icon="•", pad=0.15):
rect(slide, x, y, w, h, bg_color)
cy = y + pad
if title:
txt(slide, title, x + pad, cy, w - 2*pad, 0.35,
size=title_size, bold=True, color=title_color)
cy += 0.38
tb = slide.shapes.add_textbox(
Inches(x + pad), Inches(cy),
Inches(w - 2*pad), Inches(h - (cy - y) - pad)
)
tf = tb.text_frame
tf.word_wrap = True
tf.margin_left = 0; tf.margin_right = 0
tf.margin_top = 0; tf.margin_bottom = 0
for i, b in enumerate(bullets):
p = tf.paragraphs[0] if i == 0 else tf.add_paragraph()
p.space_before = Pt(2)
r = p.add_run()
r.text = f"{icon} {b}"
r.font.size = Pt(bullet_size)
r.font.color.rgb = bullet_color
r.font.name = "Calibri"
def divider(slide, x, y, w, color=C_MED_BLUE, thickness=3):
line = slide.shapes.add_shape(1, Inches(x), Inches(y), Inches(w), Pt(thickness))
line.fill.solid()
line.fill.fore_color.rgb = color
line.line.fill.background()
# ══════════════════════════════════════════════════════════════════
# SLIDE BUILDERS
# ══════════════════════════════════════════════════════════════════
def slide_title(prs):
s = blank(prs)
bg(s, C_DARK_BLUE)
# gradient-like overlay strip
rect(s, 0, 4.8, 13.333, 2.7, RGBColor(0x0A, 0x1E, 0x40))
# Red accent bar
rect(s, 0, 0.55, 0.18, 6.4, C_RED)
# Heart icon placeholder (text glyph)
txt(s, "♥", 0.4, 0.4, 1.2, 1.2, size=54, color=RGBColor(0xC0,0x39,0x2B))
# Title
txt(s, "MYOCARDITIS", 1.7, 0.5, 11, 1.2,
size=54, bold=True, color=C_WHITE, align=PP_ALIGN.LEFT)
txt(s, "IN PEDIATRICS", 1.7, 1.55, 11, 0.8,
size=36, bold=False, color=RGBColor(0xAD, 0xD8, 0xE6), align=PP_ALIGN.LEFT)
divider(s, 1.7, 2.45, 10.5, C_RED, 4)
txt(s, "Inflammation of the myocardium in children — etiology, diagnosis & management",
1.7, 2.65, 10.5, 0.6, size=16, italic=True,
color=RGBColor(0xCC, 0xE5, 0xFF), align=PP_ALIGN.LEFT)
# Bottom bar
txt(s, "Sources: Braunwald's Heart Disease · Tintinalli's EM · Fuster & Hurst's The Heart",
0.5, 6.9, 12, 0.5, size=11, color=RGBColor(0x88,0xAA,0xCC), align=PP_ALIGN.LEFT)
def slide_overview(prs):
s = blank(prs)
bg(s, C_OFFWHITE)
rect(s, 0, 0, 13.333, 1.0, C_DARK_BLUE)
txt(s, "OVERVIEW & EPIDEMIOLOGY", 0.4, 0.18, 12, 0.65,
size=26, bold=True, color=C_WHITE)
divider(s, 0.4, 1.12, 12.5, C_RED, 3)
# Key stats strip
stats = [
("9.21", "per 100,000\nprevalence (2019)"),
("2–5%", "sudden CV death\nin children"),
("46%", "pediatric DCM cases\ncaused by myocarditis"),
("♂>♀", "after age 15;\ninfancy is highest risk"),
]
for i, (val, lbl) in enumerate(stats):
xi = 0.35 + i * 3.25
rect(s, xi, 1.3, 2.95, 1.55, C_DARK_BLUE)
txt(s, val, xi + 0.1, 1.35, 2.75, 0.8,
size=30, bold=True, color=C_ORANGE, align=PP_ALIGN.CENTER)
txt(s, lbl, xi + 0.1, 2.0, 2.75, 0.75,
size=12, color=C_WHITE, align=PP_ALIGN.CENTER)
# Definition box
rect(s, 0.35, 3.0, 12.65, 1.05, C_LIGHT_BLUE, border=True, border_color=C_MED_BLUE)
txt(s, "DEFINITION",
0.55, 3.05, 3.0, 0.35, size=13, bold=True, color=C_MED_BLUE)
txt(s, "Myocarditis is an inflammatory disorder of the myocardium. "
"In children it is the leading cause of dilated cardiomyopathy (DCM) requiring transplantation. "
"Most cases follow viral infections or post-viral immune-mediated responses.",
0.55, 3.42, 12.2, 0.55, size=13, color=C_TEXT_DARK)
# Two columns below
add_bullet_box(s,
["Higher death rate in the first year of life than ages 1–14",
"Death rate is higher in males after age 15",
"Accounts for 5–14% of sudden death in young athletes",
"Higher rates in SE Asia, E Asia, Central & Eastern Europe",
"Myocarditis → DCM: 46% of identified pediatric DCM (US Pediatric Cardiomyopathy Registry)"],
0.35, 4.15, 6.0, 3.1,
title="EPIDEMIOLOGY — KEY FACTS", bg_color=C_LIGHT_BLUE,
title_color=C_DARK_BLUE, bullet_color=C_TEXT_DARK, bullet_size=12)
add_bullet_box(s,
["Viral: most common in children",
"Non-infectious: Kawasaki disease, JIA, SLE",
"Bacterial, rickettsial, fungal, protozoal (regional)",
"Autoimmune / immune-mediated (post-viral)",
"Toxic / drug-induced (rare)"],
6.55, 4.15, 6.45, 3.1,
title="BROAD ETIOLOGY CATEGORIES", bg_color=C_LIGHT_BLUE,
title_color=C_DARK_BLUE, bullet_color=C_TEXT_DARK, bullet_size=12)
def slide_etiology(prs):
s = blank(prs)
bg(s, C_OFFWHITE)
rect(s, 0, 0, 13.333, 1.0, C_MED_BLUE)
txt(s, "ETIOLOGY — CAUSES OF MYOCARDITIS IN CHILDREN", 0.4, 0.18, 12.5, 0.65,
size=24, bold=True, color=C_WHITE)
divider(s, 0.4, 1.12, 12.5, C_ORANGE, 3)
# 3-column layout
col_w = 3.85
cols = [
("VIRAL (Most Common)", C_MED_BLUE, [
"Parvovirus B19 — most prevalent",
"Coxsackievirus B (enterovirus) — classic",
"Adenovirus (types 2 & 5) — up to 23%",
"Human Herpesvirus 6 (HHV-6)",
"Influenza A & H1N1",
"Epstein-Barr Virus (chronic)",
"HIV-associated myocarditis",
"SARS-CoV-2 (COVID-19)",
]),
("NON-VIRAL INFECTIOUS", C_TEAL, [
"Bacterial: S. aureus, S. pneumoniae",
"Rickettsial: typhus (endemic regions)",
"Mycotic: histoplasmosis",
"Protozoal: Chagas disease (T. cruzi),\n amebiasis",
"Helminthic: schistosomiasis",
"Diphtheria (toxin-mediated)",
"Lyme disease (Borrelia burgdorferi)",
]),
("NON-INFECTIOUS", C_RED, [
"Kawasaki disease",
"Juvenile Idiopathic Arthritis (JIA)",
"Systemic Lupus Erythematosus",
"Drug/toxin-induced (rare)",
"Giant cell myocarditis (rare, severe)",
"Eosinophilic myocarditis",
"Sarcoidosis (rare in children)",
]),
]
for i, (title, color, bullets) in enumerate(cols):
xi = 0.35 + i * 4.33
rect(s, xi, 1.25, col_w, 0.5, color)
txt(s, title, xi + 0.1, 1.3, col_w - 0.2, 0.4,
size=13, bold=True, color=C_WHITE, align=PP_ALIGN.CENTER)
add_bullet_box(s, bullets, xi, 1.75, col_w, 5.5,
bg_color=C_LIGHT_BLUE, bullet_color=C_TEXT_DARK,
bullet_size=12, pad=0.12)
# Note
txt(s, "* Viral etiology spectrum is continuously evolving with new molecular diagnostic tools. "
"Enteroviruses predominate in mouse models; B19V & HHV-6 are most common in Western biopsies.",
0.35, 7.1, 12.65, 0.35, size=10, italic=True, color=RGBColor(0x55,0x55,0x55))
def slide_pathogenesis(prs):
s = blank(prs)
bg(s, C_OFFWHITE)
rect(s, 0, 0, 13.333, 1.0, C_DARK_BLUE)
txt(s, "PATHOGENESIS", 0.4, 0.18, 12, 0.65, size=26, bold=True, color=C_WHITE)
divider(s, 0.4, 1.12, 12.5, C_RED, 3)
# Phases boxes
phases = [
("PHASE 1\nViral Entry", C_RED,
"Virus enters via respiratory/GI route. "
"Coxsackievirus/adenovirus use CAR receptor. "
"B19V uses globoside (endothelial cells). "
"Direct myocyte damage by viral proteases."),
("PHASE 2\nInnate Immunity", C_ORANGE,
"Toll-like & NOD-like receptors detect pathogen. "
"Pro-inflammatory cytokines (TNF-α, IL-1) released. "
"Macrophage & NK cell recruitment. "
"Viral clearance attempted."),
("PHASE 3\nAdaptive Immunity", C_MED_BLUE,
"CD4+ & CD8+ T-lymphocyte infiltration. "
"B-cell activation → antigen-specific antibodies. "
"Molecular mimicry between viral & host antigens. "
"Autoimmune damage to myocardium."),
("PHASE 4\nRemodeling/DCM", C_TEAL,
"Persistent autoimmune reaction. "
"Myocyte necrosis → fibrosis. "
"Ventricular dilation & dysfunction. "
"Progression to dilated cardiomyopathy."),
]
for i, (title, color, body) in enumerate(phases):
xi = 0.35 + i * 3.22
rect(s, xi, 1.25, 3.05, 0.65, color)
txt(s, title, xi + 0.1, 1.28, 2.85, 0.58,
size=12, bold=True, color=C_WHITE, align=PP_ALIGN.CENTER)
rect(s, xi, 1.9, 3.05, 2.45, C_LIGHT_BLUE, border=True, border_color=color)
txt(s, body, xi + 0.12, 1.95, 2.8, 2.35,
size=11.5, color=C_TEXT_DARK, wrap=True)
# Arrow
if i < 3:
txt(s, "▶", xi + 3.07, 2.6, 0.28, 0.4, size=18, color=color)
# Bottom: outcomes
rect(s, 0.35, 4.5, 12.65, 0.4, C_DARK_BLUE)
txt(s, "OUTCOMES SPECTRUM", 0.5, 4.53, 4.0, 0.32, size=13, bold=True, color=C_WHITE)
outcomes = [
("Self-limited recovery\n(most common)", C_GREEN),
("Persistent LV dysfunction\n→ chronic DCM", C_ORANGE),
("Fulminant myocarditis\n→ cardiogenic shock", C_RED),
("Sudden cardiac death\n(arrhythmia)", RGBColor(0x7D, 0x3C, 0x98)),
]
for i, (lbl, color) in enumerate(outcomes):
xi = 0.35 + i * 3.22
rect(s, xi, 4.9, 3.05, 1.35, color)
txt(s, lbl, xi + 0.1, 5.05, 2.85, 1.1,
size=13, bold=True, color=C_WHITE, align=PP_ALIGN.CENTER)
txt(s, "Note: Molecular mimicry between viral coat proteins and cardiac myosin may perpetuate autoimmune myocardial damage beyond viral clearance.",
0.35, 6.35, 12.65, 0.4, size=10, italic=True, color=RGBColor(0x55,0x55,0x55))
def slide_clinical(prs):
s = blank(prs)
bg(s, C_OFFWHITE)
rect(s, 0, 0, 13.333, 1.0, C_RED)
txt(s, "CLINICAL FEATURES", 0.4, 0.18, 12, 0.65, size=26, bold=True, color=C_WHITE)
divider(s, 0.4, 1.12, 12.5, C_DARK_BLUE, 3)
add_bullet_box(s,
["Usually preceded by a viral respiratory illness (1–4 weeks prior)",
"Fever, generalized malaise, myalgias",
"Tachypnea, respiratory distress",
"Isolated or concurrent GI symptoms: vomiting, anorexia, abdominal pain",
"Older children: palpitations, syncope (arrhythmias), chest pain (if pericarditis)"],
0.35, 1.2, 6.1, 3.0,
title="SYMPTOMS", bg_color=C_LIGHT_BLUE,
title_color=C_DARK_BLUE, bullet_size=12)
add_bullet_box(s,
["Tachycardia (compensatory — may be disproportionate to fever)",
"Weak / thready pulses, cool extremities",
"Delayed capillary refill, skin mottling or cyanosis",
"Distant heart sounds, S3 or S4 gallop",
"Regurgitant murmur (mitral/tricuspid)",
"Signs of congestive heart failure or fulminant shock"],
6.55, 1.2, 6.45, 3.0,
title="SIGNS (PHYSICAL EXAM)", bg_color=C_LIGHT_BLUE,
title_color=C_DARK_BLUE, bullet_size=12)
# Age-specific
rect(s, 0.35, 4.3, 12.65, 0.38, C_MED_BLUE)
txt(s, "AGE-SPECIFIC PRESENTATIONS", 0.5, 4.33, 12, 0.3,
size=13, bold=True, color=C_WHITE)
age_data = [
("NEONATES /\nINFANTS", "Sudden circulatory collapse\nPoor feeding, lethargy\nHighest mortality risk"),
("TODDLERS /\nPRESCHOOL", "Irritability, refusal to feed\nRapid breathing\nAbdominal pain / vomiting"),
("SCHOOL AGE /\nADOLESCENTS", "Chest pain (pericarditis)\nExercise intolerance\nSyncope / palpitations"),
("FULMINANT\nFORM (ANY AGE)", "Rapid hemodynamic deterioration\nCardiogenic shock within hours\nRequires ICU / ECMO support"),
]
for i, (age, features) in enumerate(age_data):
xi = 0.35 + i * 3.22
color = [C_TEAL, C_MED_BLUE, C_DARK_BLUE, C_RED][i]
rect(s, xi, 4.68, 3.05, 0.52, color)
txt(s, age, xi + 0.1, 4.7, 2.85, 0.48,
size=11, bold=True, color=C_WHITE, align=PP_ALIGN.CENTER)
rect(s, xi, 5.2, 3.05, 2.1, C_LIGHT_BLUE, border=True, border_color=color)
txt(s, features, xi + 0.12, 5.25, 2.8, 2.0, size=11.5, color=C_TEXT_DARK)
def slide_diagnosis(prs):
s = blank(prs)
bg(s, C_OFFWHITE)
rect(s, 0, 0, 13.333, 1.0, C_MED_BLUE)
txt(s, "DIAGNOSIS", 0.4, 0.18, 12, 0.65, size=26, bold=True, color=C_WHITE)
divider(s, 0.4, 1.12, 12.5, C_ORANGE, 3)
txt(s, "No single test is sensitive or specific — diagnosis requires clinical integration of multiple modalities",
0.35, 1.18, 12.65, 0.38, size=13, italic=True, color=C_DARK_BLUE)
# 2x3 grid of modality boxes
modalities = [
("LABS", C_MED_BLUE, [
"CBC, serum chemistries, LFTs",
"Blood cultures (rule out sepsis)",
"ESR, CRP — elevated but nonspecific",
"Troponin T or I — elevated (myocyte damage)",
"BNP / NT-proBNP — elevated in HF; higher in fulminant",
"Viral serologies / throat/stool cultures",
]),
("ECG", C_RED, [
"Sinus tachycardia (most common)",
"Low QRS voltage (<5 mm in limb leads)",
"Flattened / inverted T waves",
"ST-segment changes",
"Prolonged QT interval",
"QRS >120 ms → poor prognosis",
"PVCs, atrial tachycardia, heart block, VT",
]),
("CHEST X-RAY", C_TEAL, [
"Cardiomegaly",
"Pulmonary edema / vascular congestion",
"Pleural effusion (with pericarditis)",
]),
("ECHOCARDIOGRAPHY", C_ORANGE, [
"Reduced LV ejection fraction",
"LV dilation (dilated cardiomyopathy pattern)",
"Wall motion abnormalities",
"Pericardial effusion",
"Rules out structural causes of HF",
"Serial echo for functional recovery",
]),
("CARDIAC MRI (CMR)", C_MED_BLUE, [
"Lake Louise Criteria (≥2 of 3):",
"1. T2: myocardial edema (SI ratio ≥2.0)",
"2. Early Gd: hyperemia (ratio ≥4.0 or +45%)",
"3. Late Gd Enhancement (LGE): subepicardial,\n non-ischemic pattern",
"LGE predicts arrhythmic events",
"Repeat CMR at 1–2 weeks if inconclusive",
]),
("ENDOMYOCARDIAL\nBIOPSY (EMB)", C_DARK_BLUE, [
"Gold standard for definitive diagnosis",
"Dallas criteria: lymphocytic infiltrate + necrosis",
"Immunohistology more sensitive than Dallas",
"PCR on tissue for viral genomes",
"Complication rate <1:1000 (experienced centers)",
"Both RV and LV biopsy now performed",
"Identifies specific myocarditis (giant cell, eosinophilic)",
]),
]
for i, (title, color, bullets) in enumerate(modalities):
row = i // 3
col = i % 3
xi = 0.35 + col * 4.33
yi = 1.65 + row * 2.95
rect(s, xi, yi, 4.1, 0.42, color)
txt(s, title, xi + 0.1, yi + 0.03, 3.9, 0.36,
size=12, bold=True, color=C_WHITE, align=PP_ALIGN.CENTER)
add_bullet_box(s, bullets, xi, yi + 0.42, 4.1, 2.4,
bg_color=C_LIGHT_BLUE, bullet_color=C_TEXT_DARK,
bullet_size=10.5, pad=0.1)
def slide_treatment(prs):
s = blank(prs)
bg(s, C_OFFWHITE)
rect(s, 0, 0, 13.333, 1.0, C_GREEN)
txt(s, "MANAGEMENT & TREATMENT", 0.4, 0.18, 12, 0.65, size=26, bold=True, color=C_WHITE)
divider(s, 0.4, 1.12, 12.5, C_DARK_BLUE, 3)
# Hemodynamic assessment
rect(s, 0.35, 1.2, 12.65, 0.38, C_DARK_BLUE)
txt(s, "STEP 1: ASSESS HEMODYNAMIC STABILITY → guides management pathway",
0.5, 1.23, 12.3, 0.3, size=13, bold=True, color=C_WHITE)
add_bullet_box(s,
["Admit ALL children with suspected myocarditis to pediatric tertiary care center",
"Cardiology (pediatric) consultation mandatory",
"Continuous cardiac monitoring (ECG, SpO2, BP)",
"Echocardiography and serial troponin",
"Restrict physical activity strictly"],
0.35, 1.65, 4.0, 3.3,
title="GENERAL MEASURES", bg_color=C_LIGHT_BLUE,
title_color=C_DARK_BLUE, bullet_size=11.5)
add_bullet_box(s,
["Afterload reduction: ACE inhibitors / ARBs",
"Diuretics: use cautiously — worsen output if preload-dependent",
"Inotropes: dopamine, dobutamine for low output",
"Beta-blockers: CONTRAINDICATED in acute phase",
"Antiarrhythmics: per arrhythmia type",
"IVIG: insufficient evidence; may use in viral encephalitis",
"Immunosuppression: NOT routine in acute viral myocarditis"],
4.5, 1.65, 4.5, 3.3,
title="PHARMACOTHERAPY", bg_color=C_LIGHT_BLUE,
title_color=C_DARK_BLUE, bullet_size=11.5)
add_bullet_box(s,
["Fulminant shock → ICU admission",
"Vasopressors: norepinephrine / epinephrine",
"Intra-aortic balloon pump (older children)",
"Ventricular Assist Device (VAD) — bridge to recovery",
"ECMO (Extracorporeal Life Support) — fulminant myocarditis",
"Heart transplantation: end-stage refractory cases"],
9.15, 1.65, 3.85, 3.3,
title="ADVANCED SUPPORT", bg_color=RGBColor(0xFF,0xEB,0xEB),
title_color=C_RED, bullet_size=11.5)
# Bottom row
rect(s, 0.35, 5.1, 12.65, 0.38, C_MED_BLUE)
txt(s, "SPECIAL THERAPEUTIC CONSIDERATIONS", 0.5, 5.13, 12, 0.3,
size=13, bold=True, color=C_WHITE)
add_bullet_box(s,
["NSAIDs: avoid in acute phase (may worsen myocyte damage)",
"Colchicine: consider in myopericarditis (pericardial involvement)",
"Steroids: not routine; may use in autoimmune/giant cell/eosinophilic forms"],
0.35, 5.55, 6.1, 1.75,
bg_color=C_LIGHT_BLUE, bullet_color=C_TEXT_DARK, bullet_size=11.5)
add_bullet_box(s,
["Anticoagulation: consider if LV thrombus or severely reduced EF",
"Exercise restriction: at least 3–6 months post-myocarditis",
"Follow-up echo at 1, 3, 6, 12 months to assess recovery"],
6.55, 5.55, 6.45, 1.75,
bg_color=C_LIGHT_BLUE, bullet_color=C_TEXT_DARK, bullet_size=11.5)
def slide_prognosis(prs):
s = blank(prs)
bg(s, C_OFFWHITE)
rect(s, 0, 0, 13.333, 1.0, C_DARK_BLUE)
txt(s, "PROGNOSIS & OUTCOMES", 0.4, 0.18, 12, 0.65, size=26, bold=True, color=C_WHITE)
divider(s, 0.4, 1.12, 12.5, C_RED, 3)
# Prognosis cards
progs = [
("FAVORABLE", C_GREEN, [
"Majority of children recover fully",
"Echocardiographic normalization within months",
"Fulminant presentation paradoxically better long-term prognosis than acute",
"Ventricular remodeling more favorable than idiopathic DCM",
]),
("UNFAVORABLE", C_RED, [
"QRS duration >120 ms at presentation",
"Persistent LV dysfunction at 6 months",
"Late gadolinium enhancement on CMR",
"Viral genomes persisting in myocardium",
"Neonatal/infant age group",
]),
("LONG-TERM RISKS", C_ORANGE, [
"Progression to chronic DCM in ~30%",
"Arrhythmic events (LGE-associated)",
"Risk of sudden cardiac death",
"Need for cardiac transplantation",
"Heart block requiring pacemaker",
]),
]
for i, (title, color, bullets) in enumerate(progs):
xi = 0.35 + i * 4.33
rect(s, xi, 1.25, 4.1, 0.5, color)
txt(s, title, xi + 0.1, 1.28, 3.9, 0.42,
size=15, bold=True, color=C_WHITE, align=PP_ALIGN.CENTER)
add_bullet_box(s, bullets, xi, 1.75, 4.1, 2.95,
bg_color=C_LIGHT_BLUE, bullet_color=C_TEXT_DARK, bullet_size=12)
# Registry data
rect(s, 0.35, 4.82, 12.65, 0.4, C_MED_BLUE)
txt(s, "U.S. PEDIATRIC CARDIOMYOPATHY REGISTRY DATA", 0.5, 4.85, 12, 0.32,
size=13, bold=True, color=C_WHITE)
add_bullet_box(s,
["Echocardiographic normalization rates are higher for myocarditis than for idiopathic DCM",
"Cardiac transplantation and death rates are lower in myocarditis vs. idiopathic DCM",
"46% of children with identified DCM etiology had myocarditis as the cause",
"Survival with functional recovery possible even after fulminant presentation if aggressive support is given"],
0.35, 5.28, 12.65, 2.0,
bg_color=C_LIGHT_BLUE, bullet_color=C_TEXT_DARK, bullet_size=12)
def slide_summary(prs):
s = blank(prs)
bg(s, C_DARK_BLUE)
rect(s, 0, 0, 0.18, 7.5, C_ORANGE)
txt(s, "KEY TAKEAWAYS", 0.4, 0.2, 12, 0.7,
size=30, bold=True, color=C_WHITE)
divider(s, 0.4, 1.05, 12.5, C_ORANGE, 4)
takeaways = [
("01", "LEADING CAUSE", "Myocarditis is the leading cause of DCM requiring transplantation in children. Etiology is predominantly viral (Parvovirus B19, Coxsackievirus B, Adenovirus)."),
("02", "CLINICAL SUSPICION", "Preceding viral illness + tachycardia + signs of low cardiac output in a child = myocarditis until proven otherwise."),
("03", "MULTIMODAL DIAGNOSIS", "No single test is diagnostic. Integrate troponin, ECG, echo, CMR (Lake Louise criteria), and biopsy (gold standard)."),
("04", "TREATMENT GOAL", "Supportive heart failure management first. Beta-blockers are CONTRAINDICATED acutely. IVIG not routinely recommended. ECMO/VAD for fulminant forms."),
("05", "PROGNOSIS", "Most children recover. Fulminant myocarditis has a paradoxically better long-term prognosis. QRS >120 ms and persistent LV dysfunction are poor prognostic markers."),
("06", "FOLLOW-UP", "Restrict activity for 3–6 months. Serial echocardiography at 1, 3, 6, 12 months. Monitor for arrhythmias and DCM progression."),
]
for i, (num, heading, body) in enumerate(takeaways):
row = i // 2
col = i % 2
xi = 0.35 + col * 6.5
yi = 1.2 + row * 2.0
rect(s, xi, yi, 0.6, 1.65, C_ORANGE)
txt(s, num, xi + 0.05, yi + 0.55, 0.5, 0.55, size=18, bold=True,
color=C_WHITE, align=PP_ALIGN.CENTER)
rect(s, xi + 0.6, yi, 5.75, 1.65, RGBColor(0x12, 0x36, 0x6B))
txt(s, heading, xi + 0.72, yi + 0.08, 5.5, 0.38,
size=13, bold=True, color=C_ORANGE)
txt(s, body, xi + 0.72, yi + 0.5, 5.5, 1.1, size=11.5, color=C_WHITE)
txt(s, "Braunwald's Heart Disease (11e) · Tintinalli's EM (9e) · Fuster & Hurst's The Heart (15e)",
0.4, 7.1, 12.5, 0.35, size=10, italic=True,
color=RGBColor(0x88, 0xAA, 0xCC))
# ══════════════════════════════════════════════════════════════════
# ASSEMBLE
# ══════════════════════════════════════════════════════════════════
prs = prs_new()
slide_title(prs)
slide_overview(prs)
slide_etiology(prs)
slide_pathogenesis(prs)
slide_clinical(prs)
slide_diagnosis(prs)
slide_treatment(prs)
slide_prognosis(prs)
slide_summary(prs)
out_path = "/tmp/workspace/myocarditis-pptx/Myocarditis_in_Pediatrics.pptx"
buf = BytesIO()
prs.save(buf)
with open(out_path, "wb") as f:
f.write(buf.getvalue())
print(f"Saved: {out_path}")
print(f"Slides: {len(prs.slides)}")
cd /tmp/workspace/myocarditis-pptx && python build_pptx.py 2>&1
Myocarditis in Pediatrics
Presentation · PPTX
| # | Slide | Content |
|---|---|---|
| 1 | Title Slide | "Myocarditis in Pediatrics" with subtitle and sources |
| 2 | Overview & Epidemiology | Definition, 4 key stat cards (prevalence, sudden death, DCM link, sex distribution), broad etiology categories |
| 3 | Etiology | 3-column layout: Viral (Parvovirus B19, Coxsackievirus B, Adenovirus, HHV-6, Influenza, HIV, COVID-19) / Non-viral infectious (Chagas, Lyme, Diphtheria) / Non-infectious (Kawasaki, JIA, SLE, giant cell) |
| 4 | Pathogenesis | 4-phase flowchart (Viral Entry → Innate Immunity → Adaptive Immunity → Remodeling) + outcomes spectrum strip |
| 5 | Clinical Features | Symptoms column, Signs column, age-specific presentation boxes (Neonates / Toddlers / School-age / Fulminant) |
| 6 | Diagnosis | 6-box grid: Labs, ECG, CXR, Echocardiography, CMR (Lake Louise Criteria), Endomyocardial Biopsy |
| 7 | Management & Treatment | General measures, Pharmacotherapy (with beta-blocker contraindication highlighted), Advanced support (ECMO/VAD/transplant), special considerations |
| 8 | Prognosis & Outcomes | Favorable vs unfavorable factors, long-term risks, U.S. Pediatric Cardiomyopathy Registry data |
| 9 | Key Takeaways | 6 numbered cards covering all major teaching points |