Yeah I'll replace dhruv so my topic will be "Enumerate the indications for and describe the role of anto platelet agent in non hemorrhagic stroke" Prepare a seminar ppt for this topic

Reading File
Reading File
Reading File
Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Finding Sources
Reading File
Reading File
Finding Sources
Reading File
Reading File
Running Command

mkdir -p /tmp/workspace/antiplatelet-stroke-ppt && ls /tmp/workspace/

Writing File

~/antiplatelet-stroke-ppt/build_ppt.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
import copy

# ── Color palette (deep navy + teal accent, white text) ──
C_NAVY    = RGBColor(0x0D, 0x2B, 0x4E)   # slide bg / title
C_TEAL    = RGBColor(0x00, 0x8B, 0x8B)   # header bars
C_ACCENT  = RGBColor(0x1A, 0xBC, 0xBC)   # bullet icons / highlights
C_LIGHT   = RGBColor(0xE8, 0xF4, 0xF8)   # content bg panels
C_WHITE   = RGBColor(0xFF, 0xFF, 0xFF)
C_DARK    = RGBColor(0x1A, 0x1A, 0x2E)   # body text on light bg
C_GOLD    = RGBColor(0xF5, 0xA6, 0x23)   # emphasis

prs = Presentation()
prs.slide_width  = Inches(13.333)
prs.slide_height = Inches(7.5)
blank = prs.slide_layouts[6]  # truly blank

# ────────────────────────────────────────────────────────────────
# Helper utilities
# ────────────────────────────────────────────────────────────────
def add_rect(slide, x, y, w, h, fill_color, alpha=None):
    shape = slide.shapes.add_shape(1, Inches(x), Inches(y), Inches(w), Inches(h))
    shape.line.fill.background()
    shape.line.width = 0
    fill = shape.fill
    fill.solid()
    fill.fore_color.rgb = fill_color
    return shape

def add_textbox(slide, x, y, w, h, text, font_size, bold=False, color=C_WHITE,
                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 = Pt(0)
    tf.margin_right = Pt(0)
    tf.margin_top = Pt(2)
    tf.margin_bottom = Pt(2)
    p = tf.paragraphs[0]
    p.alignment = align
    run = p.add_run()
    run.text = text
    run.font.size = Pt(font_size)
    run.font.bold = bold
    run.font.italic = italic
    run.font.color.rgb = color
    run.font.name = "Calibri"
    return tb

def add_multiline_tb(slide, x, y, w, h, lines, font_size, color=C_DARK,
                     bold_first=False, line_spacing=1.15, align=PP_ALIGN.LEFT):
    """lines = list of (text, bold, color_override)"""
    tb = slide.shapes.add_textbox(Inches(x), Inches(y), Inches(w), Inches(h))
    tf = tb.text_frame
    tf.word_wrap = True
    tf.margin_left  = Pt(4)
    tf.margin_right = Pt(4)
    tf.margin_top   = Pt(4)
    tf.margin_bottom= Pt(4)
    from pptx.oxml.ns import qn
    from lxml import etree
    first = True
    for (text, bold, col_ov) in lines:
        if first:
            p = tf.paragraphs[0]
            first = False
        else:
            p = tf.add_paragraph()
        p.alignment = align
        # line spacing
        p.space_after = Pt(3)
        run = p.add_run()
        run.text = text
        run.font.size = Pt(font_size)
        run.font.bold = bold
        run.font.name = "Calibri"
        run.font.color.rgb = col_ov if col_ov else color
    return tb

# ────────────────────────────────────────────────────────────────
# SLIDE 1 — Title slide
# ────────────────────────────────────────────────────────────────
slide = prs.slides.add_slide(blank)

# Full dark bg
add_rect(slide, 0, 0, 13.333, 7.5, C_NAVY)

# Teal top accent bar
add_rect(slide, 0, 0, 13.333, 0.6, C_TEAL)

# Teal bottom accent bar
add_rect(slide, 0, 6.9, 13.333, 0.6, C_TEAL)

# Left vertical accent line
add_rect(slide, 0.6, 1.5, 0.08, 4.5, C_ACCENT)

# Title text
add_textbox(slide, 0.9, 1.5, 11.5, 1.6,
            "ANTIPLATELET AGENTS IN", 38, bold=True, color=C_WHITE, align=PP_ALIGN.LEFT)
add_textbox(slide, 0.9, 3.0, 11.5, 1.4,
            "NON-HEMORRHAGIC STROKE", 42, bold=True, color=C_GOLD, align=PP_ALIGN.LEFT)

# Subtitle / description
add_textbox(slide, 0.9, 4.4, 11.5, 0.5,
            "Indications, Mechanisms, Clinical Evidence & Current Guidelines", 16,
            bold=False, color=C_ACCENT, align=PP_ALIGN.LEFT)

# Separator line
add_rect(slide, 0.9, 4.95, 10.5, 0.04, C_TEAL)

# Institution / presenter line
add_textbox(slide, 0.9, 5.1, 11.5, 0.45,
            "Seminar Presentation  |  Department of Medicine", 13,
            color=RGBColor(0xB0, 0xC4, 0xDE), align=PP_ALIGN.LEFT)
add_textbox(slide, 0.9, 5.55, 11.5, 0.45,
            "July 2026", 12, color=RGBColor(0xB0, 0xC4, 0xDE), align=PP_ALIGN.LEFT)

# ────────────────────────────────────────────────────────────────
# Helper: standard content slide frame
# ────────────────────────────────────────────────────────────────
def make_content_slide(title_text):
    s = prs.slides.add_slide(blank)
    # bg
    add_rect(s, 0, 0, 13.333, 7.5, C_LIGHT)
    # top header band
    add_rect(s, 0, 0, 13.333, 1.0, C_NAVY)
    # teal accent under header
    add_rect(s, 0, 1.0, 13.333, 0.07, C_TEAL)
    # title text
    add_textbox(s, 0.35, 0.12, 12.5, 0.8, title_text, 24, bold=True,
                color=C_WHITE, align=PP_ALIGN.LEFT)
    # bottom footer bar
    add_rect(s, 0, 7.15, 13.333, 0.35, C_NAVY)
    add_textbox(s, 0.3, 7.16, 9, 0.3,
                "Antiplatelet Agents in Non-Hemorrhagic Stroke  |  Seminar 2026",
                9, color=RGBColor(0xB0, 0xC4, 0xDE))
    return s

def bullet_block(slide, x, y, w, h, items, font_size=15, title=None, title_size=16):
    """items = list of (indent_level, text). indent_level 0=main, 1=sub"""
    if title:
        add_textbox(slide, x, y, w, 0.38, title, title_size, bold=True,
                    color=C_NAVY, align=PP_ALIGN.LEFT)
        y += 0.38
        h -= 0.38
    tb = slide.shapes.add_textbox(Inches(x), Inches(y), Inches(w), Inches(h))
    tf = tb.text_frame
    tf.word_wrap = True
    tf.margin_left   = Pt(6)
    tf.margin_right  = Pt(4)
    tf.margin_top    = Pt(4)
    tf.margin_bottom = Pt(4)
    first = True
    for (lvl, text) in items:
        p = tf.paragraphs[0] if first else tf.add_paragraph()
        first = False
        p.space_after = Pt(4 if lvl == 0 else 2)
        run = p.add_run()
        bullet = "• " if lvl == 0 else "  – "
        run.text = bullet + text
        run.font.size  = Pt(font_size if lvl == 0 else font_size - 1)
        run.font.bold  = (lvl == 0)
        run.font.name  = "Calibri"
        run.font.color.rgb = C_NAVY if lvl == 0 else RGBColor(0x2C, 0x3E, 0x50)

def colored_box(slide, x, y, w, h, header_text, body_lines, header_color=C_TEAL,
                body_color=C_WHITE, text_color=C_DARK, font_size=13):
    # header
    add_rect(slide, x, y, w, 0.4, header_color)
    add_textbox(slide, x+0.1, y+0.03, w-0.2, 0.36, header_text, 13, bold=True,
                color=C_WHITE, align=PP_ALIGN.CENTER)
    # body
    add_rect(slide, x, y+0.4, w, h-0.4, body_color)
    yy = y + 0.45
    for line in body_lines:
        add_textbox(slide, x+0.1, yy, w-0.2, 0.32, line, font_size,
                    color=text_color, align=PP_ALIGN.LEFT)
        yy += 0.31

# ────────────────────────────────────────────────────────────────
# SLIDE 2 — Contents / Outline
# ────────────────────────────────────────────────────────────────
slide = make_content_slide("OUTLINE")

topics = [
    "01  Introduction — Non-Hemorrhagic Stroke",
    "02  Pathophysiology of Ischemic Stroke",
    "03  Role of Platelets in Thrombogenesis",
    "04  Antiplatelet Agents — Overview & Classification",
    "05  Mechanisms of Action",
    "06  Indications for Antiplatelet Therapy",
    "07  Acute Treatment Phase — Evidence",
    "08  Secondary Prevention — Evidence",
    "09  Dual Antiplatelet Therapy (DAPT) — Trials",
    "10  Individual Agents — Clinical Data",
    "11  Dosage, Contraindications & Monitoring",
    "12  Current Guidelines Summary",
    "13  Conclusion",
]
col1 = topics[:7]
col2 = topics[7:]

tb1 = slide.shapes.add_textbox(Inches(0.5), Inches(1.2), Inches(5.8), Inches(5.8))
tf1 = tb1.text_frame; tf1.word_wrap = True
tf1.margin_left = Pt(6); tf1.margin_right = Pt(4)
first=True
for t in col1:
    p = tf1.paragraphs[0] if first else tf1.add_paragraph()
    first=False
    p.space_after = Pt(8)
    r = p.add_run(); r.text = t
    r.font.size = Pt(15); r.font.name = "Calibri"
    num, rest = t.split("  ", 1)
    r.font.bold = False; r.font.color.rgb = C_DARK

# Re-render with two runs per line for color split
tb1.text_frame.clear()
first=True
for t in col1:
    p = tb1.text_frame.paragraphs[0] if first else tb1.text_frame.add_paragraph()
    first=False; p.space_after = Pt(8)
    num, rest = t.split("  ", 1)
    r1 = p.add_run(); r1.text = num + "  "
    r1.font.size = Pt(15); r1.font.bold = True
    r1.font.color.rgb = C_TEAL; r1.font.name = "Calibri"
    r2 = p.add_run(); r2.text = rest
    r2.font.size = Pt(15); r2.font.bold = False
    r2.font.color.rgb = C_DARK; r2.font.name = "Calibri"

tb2 = slide.shapes.add_textbox(Inches(7.0), Inches(1.2), Inches(5.8), Inches(5.8))
tf2 = tb2.text_frame; tf2.word_wrap = True
tf2.margin_left = Pt(6); tf2.margin_right = Pt(4)
first=True
for t in col2:
    p = tf2.paragraphs[0] if first else tf2.add_paragraph()
    first=False; p.space_after = Pt(8)
    num, rest = t.split("  ", 1)
    r1 = p.add_run(); r1.text = num + "  "
    r1.font.size = Pt(15); r1.font.bold = True
    r1.font.color.rgb = C_TEAL; r1.font.name = "Calibri"
    r2 = p.add_run(); r2.text = rest
    r2.font.size = Pt(15); r2.font.bold = False
    r2.font.color.rgb = C_DARK; r2.font.name = "Calibri"

# divider
add_rect(slide, 6.6, 1.2, 0.06, 5.9, C_TEAL)

# ────────────────────────────────────────────────────────────────
# SLIDE 3 — Introduction
# ────────────────────────────────────────────────────────────────
slide = make_content_slide("INTRODUCTION — NON-HEMORRHAGIC STROKE")

add_rect(slide, 0.4, 1.15, 5.9, 5.8, C_WHITE)
bullet_block(slide, 0.55, 1.15, 5.6, 5.8,
    [
        (0, "Definition"),
        (1, "Sudden onset of focal neurological deficit due to ischemia (infarction)"),
        (1, "Accounts for ~85% of all strokes worldwide"),
        (0, "Types of Non-Hemorrhagic Stroke"),
        (1, "Ischemic stroke (thrombotic or embolic)"),
        (1, "Transient Ischemic Attack (TIA)"),
        (1, "Lacunar infarcts (small vessel disease)"),
        (0, "Epidemiology"),
        (1, "Leading cause of disability globally"),
        (1, "Recurrence risk: ~8-10% per year after first event"),
        (1, "TIA: 10-15% risk of stroke within 90 days"),
        (0, "Goals of Therapy"),
        (1, "Acute: limit infarct size, prevent extension"),
        (1, "Secondary: prevent recurrence"),
    ], font_size=14)

add_rect(slide, 6.9, 1.15, 5.9, 5.8, C_WHITE)
bullet_block(slide, 7.05, 1.15, 5.65, 5.8,
    [
        (0, "Etiological Classification (TOAST)"),
        (1, "Large artery atherosclerosis (~20%)"),
        (1, "Cardioembolism (~20%)"),
        (1, "Small vessel occlusion / lacunar (~25%)"),
        (1, "Other determined etiology"),
        (1, "Cryptogenic / undetermined"),
        (0, "Key Risk Factors"),
        (1, "Hypertension, diabetes mellitus"),
        (1, "Dyslipidemia, atrial fibrillation"),
        (1, "Smoking, carotid artery stenosis"),
        (1, "Prior TIA or stroke"),
        (0, "Role of Antiplatelets"),
        (1, "Central in arterial thrombosis pathways"),
        (1, "NOT indicated in hemorrhagic stroke"),
    ], font_size=14)

# ────────────────────────────────────────────────────────────────
# SLIDE 4 — Pathophysiology
# ────────────────────────────────────────────────────────────────
slide = make_content_slide("PATHOPHYSIOLOGY OF ISCHEMIC STROKE")

add_rect(slide, 0.4, 1.15, 12.5, 5.8, C_WHITE)

# Three step boxes
boxes = [
    ("VASCULAR INJURY", ["Atherosclerotic plaque", "Endothelial disruption", "Lipid core exposure", "Von Willebrand factor release"], C_NAVY),
    ("PLATELET ACTIVATION", ["Adhesion via GP Ib-IX-V", "Shape change & degranulation", "TXA₂ & ADP release", "Amplification loop"], C_TEAL),
    ("THROMBUS FORMATION", ["GP IIb/IIIa activation", "Fibrinogen cross-linking", "Platelet aggregation", "Vessel occlusion → infarct"], C_ACCENT),
]
for i, (hdr, lines, col) in enumerate(boxes):
    bx = 0.55 + i*4.25
    add_rect(slide, bx, 1.3, 4.0, 0.5, col)
    add_textbox(slide, bx+0.1, 1.32, 3.8, 0.46, hdr, 14, bold=True,
                color=C_WHITE, align=PP_ALIGN.CENTER)
    add_rect(slide, bx, 1.8, 4.0, 2.2, RGBColor(0xF0, 0xF8, 0xFF))
    yy = 1.85
    for ln in lines:
        add_textbox(slide, bx+0.2, yy, 3.6, 0.42, "• " + ln, 13, color=C_DARK)
        yy += 0.42
    # Arrow
    if i < 2:
        add_textbox(slide, bx+4.05, 2.7, 0.2, 0.4, "▶", 20,
                    color=C_TEAL, align=PP_ALIGN.CENTER)

# Penumbra concept
add_rect(slide, 0.55, 4.15, 12.2, 0.45, C_NAVY)
add_textbox(slide, 0.65, 4.17, 12.0, 0.42,
            "Ischemic Penumbra: Viable tissue surrounding core infarct — key therapeutic window (4.5 h for thrombolysis; 24 h for thrombectomy in selected patients)",
            12, color=C_WHITE)

bullet_block(slide, 0.55, 4.7, 12.2, 1.9,
    [
        (0, "Why Antiplatelets Are Relevant"),
        (1, "Platelets are central mediators of arterial thrombus in large and small vessel disease"),
        (1, "Antiplatelet agents interrupt the adhesion-activation-aggregation cascade"),
        (1, "Ineffective against cardioembolic stroke (anticoagulation preferred)"),
        (1, "Contraindicated in hemorrhagic stroke — verify non-hemorrhagic etiology before use"),
    ], font_size=14)

# ────────────────────────────────────────────────────────────────
# SLIDE 5 — Classification of Antiplatelet Agents
# ────────────────────────────────────────────────────────────────
slide = make_content_slide("ANTIPLATELET AGENTS — CLASSIFICATION")

classes = [
    ("COX-1 Inhibitors",        C_NAVY,   ["Aspirin (Acetylsalicylic acid)"]),
    ("P2Y12 ADP Antagonists",   C_TEAL,   ["Clopidogrel (thienopyridine — prodrug)",
                                            "Ticagrelor (cyclopentyltriazolopyrimidine)",
                                            "Prasugrel (thienopyridine)"]),
    ("PDE Inhibitors",          RGBColor(0x5F, 0x6C, 0xAD), ["Dipyridamole (± aspirin combination)",
                                            "Cilostazol"]),
    ("GP IIb/IIIa Antagonists", RGBColor(0x6A, 0x5A, 0xCD), ["Abciximab, Tirofiban, Eptifibatide",
                                            "(limited role in acute ischemic stroke)"]),
    ("Others",                  RGBColor(0x2E, 0x8B, 0x57), ["Triflusal",
                                            "Omega-3 (alternative if others contraindicated)"]),
]
positions = [(0.4, 1.2), (4.5, 1.2), (8.6, 1.2), (0.4, 4.1), (4.5, 4.1)]
for idx, ((cls_name, col, agents), (bx, by)) in enumerate(zip(classes, positions)):
    w = 3.8
    add_rect(slide, bx, by, w, 0.5, col)
    add_textbox(slide, bx+0.1, by+0.04, w-0.2, 0.44, cls_name, 14, bold=True,
                color=C_WHITE, align=PP_ALIGN.CENTER)
    body_h = len(agents) * 0.42 + 0.15
    add_rect(slide, bx, by+0.5, w, body_h, RGBColor(0xF7, 0xFB, 0xFF))
    yy = by + 0.54
    for ag in agents:
        add_textbox(slide, bx+0.2, yy, w-0.3, 0.4, "• " + ag, 12, color=C_DARK)
        yy += 0.4

# Note box at bottom right
add_rect(slide, 8.6, 4.1, 4.3, 2.8, RGBColor(0xFF, 0xF5, 0xE0))
add_rect(slide, 8.6, 4.1, 4.3, 0.45, C_GOLD)
add_textbox(slide, 8.7, 4.12, 4.1, 0.42, "KEY CLINICAL POINT", 12, bold=True,
            color=C_DARK, align=PP_ALIGN.CENTER)
notes = [
    "First-line agents in clinical practice:",
    "1. Aspirin (acute + secondary prevention)",
    "2. Clopidogrel (secondary prevention)",
    "3. Aspirin + Clopidogrel DAPT (TIA/minor stroke)",
    "4. Aspirin + Dipyridamole ER (secondary prevention)",
    "",
    "Cardioembolic stroke → Anticoagulation preferred",
    "Hemorrhagic stroke → Antiplatelets CONTRAINDICATED",
]
yy = 4.6
for n in notes:
    add_textbox(slide, 8.7, yy, 4.1, 0.32, n, 11, color=C_DARK)
    yy += 0.28

# ────────────────────────────────────────────────────────────────
# SLIDE 6 — Mechanisms of Action
# ────────────────────────────────────────────────────────────────
slide = make_content_slide("MECHANISMS OF ACTION")

moa_data = [
    ("ASPIRIN", C_NAVY, [
        "Irreversibly acetylates Cyclooxygenase-1 (COX-1)",
        "Blocks synthesis of Thromboxane A₂ (TXA₂)",
        "TXA₂: potent platelet aggregator & vasoconstrictor",
        "Effect permanent for platelet lifetime (8–10 days)",
        "Also inhibits endothelial prostacyclin (PGI₂) — but transient effect, endothelial cells regenerate",
        "Low dose (75–100 mg/d): selective TXA₂ inhibition",
    ]),
    ("CLOPIDOGREL / TICAGRELOR", C_TEAL, [
        "Block P2Y12 ADP receptor on platelet surface",
        "Prevent ADP-mediated activation of GP IIb/IIIa receptor",
        "Inhibit fibrinogen binding → block platelet aggregation",
        "Clopidogrel: prodrug → hepatic activation (CYP2C19)",
        "CYP2C19 poor metabolizers — reduced efficacy",
        "Ticagrelor: direct-acting, reversible inhibition",
    ]),
    ("DIPYRIDAMOLE", RGBColor(0x5F, 0x6C, 0xAD), [
        "Inhibits cyclic nucleotide phosphodiesterase (PDE)",
        "↑ cAMP & cGMP in platelets → inhibits aggregation",
        "Inhibits adenosine uptake by vascular cells",
        "Accumulated adenosine = antiplatelet effect",
        "Potentiates PGI₂ and nitric oxide (NO) from endothelium",
        "ER formulation combined with aspirin 25 mg preferred",
    ]),
    ("CILOSTAZOL", RGBColor(0x2E, 0x8B, 0x57), [
        "Selective PDE-3 inhibitor",
        "↑ cAMP in platelets and vascular smooth muscle",
        "Dual: antiplatelet + vasodilatory effects",
        "Shown superior to aspirin in Asian populations",
        "Non-cardioembolic strokes — used in Japan/Asia",
        "Contraindicated in heart failure",
    ]),
]
positions_moa = [(0.4, 1.15), (6.9, 1.15), (0.4, 4.1), (6.9, 4.1)]
for (label, col, pts), (bx, by) in zip(moa_data, positions_moa):
    w = 6.1
    add_rect(slide, bx, by, w, 0.45, col)
    add_textbox(slide, bx+0.1, by+0.04, w-0.2, 0.4, label, 14, bold=True,
                color=C_WHITE, align=PP_ALIGN.CENTER)
    body_h = 2.9
    add_rect(slide, bx, by+0.45, w, body_h, RGBColor(0xF7, 0xFB, 0xFF))
    yy = by + 0.5
    for pt in pts:
        add_textbox(slide, bx+0.2, yy, w-0.4, 0.38, "• " + pt, 12, color=C_DARK)
        yy += 0.37

# ────────────────────────────────────────────────────────────────
# SLIDE 7 — Indications Part 1
# ────────────────────────────────────────────────────────────────
slide = make_content_slide("INDICATIONS FOR ANTIPLATELET THERAPY (1/2)")

add_rect(slide, 0.4, 1.15, 12.5, 0.5, C_NAVY)
add_textbox(slide, 0.55, 1.17, 12.2, 0.46, "ACUTE PHASE INDICATIONS", 15, bold=True, color=C_WHITE)

ind_acute = [
    ("A", "Acute Ischemic Stroke (Non-Hemorrhagic)",
     ["Aspirin 160–300 mg orally within 24–48 hours of onset",
      "UNLESS thrombolysis given — wait 24 hours before aspirin",
      "Evidence: IST + CAST trials (40,000 patients)",
      "Reduces early stroke recurrence and mortality",
      "9 deaths/non-fatal strokes prevented per 1000 treated",
      "Do NOT use if CT/MRI shows hemorrhage"]),
    ("B", "Transient Ischemic Attack (TIA)",
     ["Aspirin started immediately after TIA diagnosis",
      "DAPT (aspirin + clopidogrel) for high-risk TIA (ABCD2 ≥4)",
      "CHANCE and POINT trials: DAPT for 21–30 days",
      "Reduces 90-day stroke risk by ~25–30%",
      "Cardioembolic TIA → prefer anticoagulation"]),
]
yy = 1.75
for letter, title, pts in ind_acute:
    add_rect(slide, 0.4, yy, 0.6, len(pts)*0.33+0.45, C_TEAL)
    add_textbox(slide, 0.43, yy+0.1, 0.54, 0.4, letter, 20, bold=True,
                color=C_WHITE, align=PP_ALIGN.CENTER)
    add_rect(slide, 1.05, yy, 11.7, 0.42, RGBColor(0xE0, 0xF0, 0xF8))
    add_textbox(slide, 1.15, yy+0.02, 11.4, 0.4, title, 14, bold=True, color=C_NAVY)
    add_rect(slide, 1.05, yy+0.42, 11.7, len(pts)*0.33)
    pyy = yy + 0.45
    for pt in pts:
        add_textbox(slide, 1.2, pyy, 11.4, 0.32, "• " + pt, 12, color=C_DARK)
        pyy += 0.33
    yy += len(pts)*0.33 + 0.42 + 0.15

# ────────────────────────────────────────────────────────────────
# SLIDE 8 — Indications Part 2
# ────────────────────────────────────────────────────────────────
slide = make_content_slide("INDICATIONS FOR ANTIPLATELET THERAPY (2/2)")

add_rect(slide, 0.4, 1.15, 12.5, 0.5, C_NAVY)
add_textbox(slide, 0.55, 1.17, 12.2, 0.46, "SECONDARY PREVENTION INDICATIONS", 15, bold=True, color=C_WHITE)

ind_sec = [
    ("C", "Prior Ischemic Stroke (Secondary Prevention)",
     ["ALL patients with prior ischemic stroke should receive antiplatelet therapy",
      "Unless anticoagulation is indicated (e.g., AF, cardioembolic source)",
      "Average annual recurrence risk: 8–10% — benefit clearly outweighs risk",
      "Reduces relative risk of non-fatal stroke by ~25–30%"]),
    ("D", "Large Artery Atherosclerosis (Carotid/Intracranial Stenosis)",
     ["Antiplatelet therapy for all patients with atherosclerotic stroke",
      "Aspirin 81–325 mg/d or clopidogrel 75 mg/d",
      "CAPRIE: clopidogrel marginally superior to aspirin",
      "Symptomatic moderate-to-severe carotid stenosis: antiplatelet + statin + BP control"]),
    ("E", "Small Vessel / Lacunar Stroke",
     ["Single antiplatelet therapy preferred (aspirin or clopidogrel)",
      "SPS3 trial: DAPT (clopidogrel + aspirin) showed no benefit and ↑ hemorrhage and death",
      "Long-term DAPT NOT recommended in lacunar stroke"]),
    ("F", "Cervical Artery Dissection",
     ["Antiplatelet therapy to prevent occlusion and hemispheric stroke",
      "Anticoagulation may be used alternatively in acute phase",
      "Both approaches show similar efficacy per CADISS trial"]),
]
yy = 1.75
for letter, title, pts in ind_sec:
    h = len(pts)*0.32+0.42
    add_rect(slide, 0.4, yy, 0.6, h, C_NAVY)
    add_textbox(slide, 0.43, yy+0.1, 0.54, 0.4, letter, 20, bold=True,
                color=C_WHITE, align=PP_ALIGN.CENTER)
    add_rect(slide, 1.05, yy, 11.7, 0.42, RGBColor(0xE0, 0xF0, 0xF8))
    add_textbox(slide, 1.15, yy+0.02, 11.4, 0.4, title, 14, bold=True, color=C_NAVY)
    pyy = yy + 0.45
    for pt in pts:
        add_textbox(slide, 1.2, pyy, 11.4, 0.32, "• " + pt, 12, color=C_DARK)
        pyy += 0.32
    yy += h + 0.12

# ────────────────────────────────────────────────────────────────
# SLIDE 9 — Acute Treatment Evidence
# ────────────────────────────────────────────────────────────────
slide = make_content_slide("ACUTE TREATMENT — CLINICAL EVIDENCE")

trial_data = [
    ("IST\n(1997)", "19,435 patients", "Aspirin 300 mg within 48 h vs. none",
     "↓ recurrent stroke 2.8→3.9%\n↓ 14-day mortality 9.0→9.4%\nNo excess hemorrhagic stroke"),
    ("CAST\n(1997)", "21,106 patients", "Aspirin 160 mg within 48 h for 4 weeks",
     "↓ early mortality 3.3→3.9%\n↓ ischemic stroke 1.6→2.1%\n↓ death/dependence at discharge"),
    ("IST + CAST\nPooled", "~40,000 patients", "Combined analysis",
     "9 deaths/non-fatal strokes prevented per 1000 treated\n13 fewer dead/dependent at 6 months"),
    ("CHANCE\n(2013)", "5,170 Chinese patients", "Minor stroke/TIA: ASA+Clopi vs ASA alone",
     "↓ 90-day stroke: 11.7%→8.2% (p<0.001)\nNo ↑ major hemorrhage\nHazard ratio 0.68 (CI 0.57–0.81)"),
    ("POINT\n(2018)", "4,881 patients (intl.)", "Minor stroke/TIA: DAPT 90 days",
     "↓ 90-day stroke (HR 0.75)\n↑ major systemic hemorrhage\nBenefit concentrated in first 7 days"),
    ("THALES\n(2020)", "11,016 patients", "TIA/minor stroke: ASA+Ticagrelor vs ASA",
     "↓ stroke/death at 30 days: 5.5%→6.7%\n↑ severe bleeding (0.5 vs 0.1%)"),
]
headers = ["Trial", "Patients", "Intervention", "Key Outcome"]
# Table
col_widths = [1.35, 1.6, 3.5, 5.85]
col_x = [0.4]
for w in col_widths[:-1]:
    col_x.append(col_x[-1]+w+0.02)
row_y = [1.15, 1.65]
row_heights = [0.45] + [0.85]*len(trial_data)
# Header row
for ci, (hdr, cw, cx) in enumerate(zip(headers, col_widths, col_x)):
    add_rect(slide, cx, 1.15, cw, 0.45, C_NAVY)
    add_textbox(slide, cx+0.05, 1.17, cw-0.1, 0.42, hdr, 13, bold=True,
                color=C_WHITE, align=PP_ALIGN.CENTER)
# Data rows
ry = 1.62
for ri, (t, pat, interv, out) in enumerate(trial_data):
    row_h = 0.84
    bg = RGBColor(0xF7, 0xFB, 0xFF) if ri%2==0 else C_WHITE
    row_vals = [t, pat, interv, out]
    for ci, (val, cw, cx) in enumerate(zip(row_vals, col_widths, col_x)):
        add_rect(slide, cx, ry, cw, row_h, bg)
        add_textbox(slide, cx+0.07, ry+0.05, cw-0.12, row_h-0.08, val, 11,
                    color=C_DARK, align=PP_ALIGN.CENTER)
    ry += row_h + 0.01

# ────────────────────────────────────────────────────────────────
# SLIDE 10 — Secondary Prevention Evidence
# ────────────────────────────────────────────────────────────────
slide = make_content_slide("SECONDARY PREVENTION — KEY TRIALS")

trial2 = [
    ("CAPRIE (1996)", "Clopidogrel vs Aspirin", "17,636 pts with stroke/MI/PAD",
     "Clopidogrel marginally superior (RRR 8.7%)\nFDA-approved for stroke prevention"),
    ("ESPS-2 (1996)", "ASA + Dipyridamole ER vs ASA alone", "6602 pts with prior stroke/TIA",
     "Combination superior: 23% RRR vs aspirin\nApproved for secondary stroke prevention"),
    ("ESPRIT (2006)", "ASA + Dipyridamole ER vs ASA alone", "2739 pts, TIA/minor stroke",
     "15.7%→12.7% events; RRR ~20%\nConfirmed ESPS-2 findings"),
    ("ProFESS (2008)", "ASA+Dip-ER vs Clopidogrel", "20,332 pts with recent stroke",
     "No significant difference in recurrent stroke\nHigher hemorrhage with ASA+Dip-ER"),
    ("MATCH (2004)", "Clopidogrel + ASA vs Clopidogrel alone", "7599 pts post-TIA/stroke",
     "No benefit of DAPT long-term\n↑ major bleeding 3 vs 1% — NOT recommended"),
    ("SPS3 (2012)", "Long-term DAPT vs clopidogrel alone", "3020 lacunar stroke pts",
     "No improvement; ↑ hemorrhage and death\nLong-term DAPT NOT recommended in lacunar"),
    ("CHARISMA", "Clopi+ASA vs ASA alone (prior stroke subgroup)", "High-risk vascular pts",
     "No benefit of combination vs ASA alone\nNo routine long-term DAPT recommended"),
]
col_widths2 = [2.1, 3.0, 2.8, 4.8]
col_x2 = [0.4]
for w in col_widths2[:-1]:
    col_x2.append(col_x2[-1]+w+0.03)
hdrs2 = ["Trial (Year)", "Intervention", "Population", "Key Outcome"]
for ci, (hdr, cw, cx) in enumerate(zip(hdrs2, col_widths2, col_x2)):
    add_rect(slide, cx, 1.15, cw, 0.45, C_TEAL)
    add_textbox(slide, cx+0.05, 1.17, cw-0.1, 0.42, hdr, 13, bold=True,
                color=C_WHITE, align=PP_ALIGN.CENTER)
ry = 1.62
for ri, (t, interv, pop, out) in enumerate(trial2):
    row_h = 0.72
    bg = RGBColor(0xF0, 0xF8, 0xFF) if ri%2==0 else C_WHITE
    for ci, (val, cw, cx) in enumerate(zip([t,interv,pop,out], col_widths2, col_x2)):
        add_rect(slide, cx, ry, cw, row_h, bg)
        fs = 10 if ci==3 else 11
        add_textbox(slide, cx+0.06, ry+0.04, cw-0.1, row_h-0.06, val, fs,
                    color=C_DARK, align=PP_ALIGN.LEFT)
    ry += row_h + 0.01

# ────────────────────────────────────────────────────────────────
# SLIDE 11 — DAPT — When to Use
# ────────────────────────────────────────────────────────────────
slide = make_content_slide("DUAL ANTIPLATELET THERAPY (DAPT) — CURRENT GUIDANCE")

# Left panel
add_rect(slide, 0.4, 1.15, 5.9, 5.8, C_WHITE)
bullet_block(slide, 0.5, 1.15, 5.7, 5.8, [
    (0, "WHEN TO USE DAPT"),
    (1, "Minor ischemic stroke (NIHSS ≤5)"),
    (1, "High-risk TIA (ABCD2 score ≥4)"),
    (1, "Within 24 hours of symptom onset"),
    (0, "REGIMEN"),
    (1, "Aspirin 75–100 mg/d"),
    (1, "Clopidogrel: 300–600 mg loading dose, then 75 mg/d"),
    (1, "OR Ticagrelor: 180 mg load, then 90 mg BD"),
    (0, "DURATION"),
    (1, "21–30 days DAPT (CHANCE/POINT protocols)"),
    (1, "Then switch to monotherapy (aspirin 81 mg or clopi 75 mg)"),
    (0, "GENETIC CONSIDERATION"),
    (1, "CYP2C19 poor metabolizers → reduced clopidogrel effect"),
    (1, "Consider ticagrelor in poor metabolizers"),
], font_size=14)

# Right panel
add_rect(slide, 6.6, 1.15, 6.3, 5.8, C_WHITE)
# When NOT to use DAPT
add_rect(slide, 6.6, 1.15, 6.3, 0.45, RGBColor(0xC0, 0x39, 0x2B))
add_textbox(slide, 6.7, 1.17, 6.1, 0.42, "WHEN NOT TO USE DAPT (Long-Term)", 13, bold=True, color=C_WHITE)
dont = [
    "Lacunar / small vessel stroke (SPS3 trial — ↑ harm)",
    "Routine long-term (>30 days) — ↑ bleeding risk",
    "MATCH trial: no benefit + ↑ major bleeding 3%",
    "CHARISMA: no benefit of long-term combo",
]
yy = 1.65
for d in dont:
    add_textbox(slide, 6.7, yy, 6.0, 0.35, "✗ " + d, 12, color=RGBColor(0xC0, 0x39, 0x2B))
    yy += 0.34

add_rect(slide, 6.6, yy+0.1, 6.3, 0.4, C_NAVY)
add_textbox(slide, 6.7, yy+0.12, 6.1, 0.37, "NUMBER NEEDED TO TREAT (NNT)", 13, bold=True, color=C_WHITE)
yy += 0.55
nnt_data = [("CHANCE trial:", "NNT = 29 to prevent 1 stroke in 90 days"),
            ("POINT trial:", "15 ischemic events prevented per 1000 pts (90 days)"),
            ("IST + CAST:", "NNT ≈ 111 for acute aspirin (1 week)"),
            ("All antiplatelet Rx:", "NNT ≈ 10–15 over 5 years for secondary prevention")]
for label, val in nnt_data:
    tb = slide.shapes.add_textbox(Inches(6.7), Inches(yy), Inches(6.1), Inches(0.38))
    tf = tb.text_frame; tf.word_wrap = True
    p = tf.paragraphs[0]
    r1 = p.add_run(); r1.text = label + " "
    r1.font.size = Pt(12); r1.font.bold = True; r1.font.color.rgb = C_TEAL; r1.font.name="Calibri"
    r2 = p.add_run(); r2.text = val
    r2.font.size = Pt(12); r2.font.color.rgb = C_DARK; r2.font.name="Calibri"
    yy += 0.36

# ────────────────────────────────────────────────────────────────
# SLIDE 12 — Individual Agents
# ────────────────────────────────────────────────────────────────
slide = make_content_slide("INDIVIDUAL AGENTS — DOSAGE & CLINICAL ROLE")

agent_rows = [
    ("ASPIRIN",         "75–325 mg/d\n(acute: 160–300 mg\nloading dose)",
     "• Acute ischemic stroke (within 48 h)\n• Secondary prevention\n• TIA",
     "GI ulceration, bleeding\nAspirin-exacerbated respiratory disease\nReye syndrome (children)"),
    ("CLOPIDOGREL",     "75 mg/d\n(load: 300–600 mg)",
     "• Secondary prevention (alternative to aspirin)\n• DAPT with aspirin (21–30 days post-TIA/minor stroke)\n• Aspirin intolerance",
     "Rash, TTP (rare)\nCYP2C19 poor metabolizers — reduced efficacy\n↑ bleeding with long-term DAPT"),
    ("TICAGRELOR",      "90 mg BD\n(load: 180 mg)",
     "• DAPT with aspirin for TIA/minor stroke (21 days)\n• Alternative to clopidogrel\n• Not inferior to clopidogrel; direct acting",
     "Dyspnoea, bleeding\nAvoid if prior intracranial hemorrhage\nReversible — stop 5 days pre-surgery"),
    ("ASPIRIN +\nDIPYRIDAMOLE ER", "ASA 25 mg + Dip 200 mg BD\n(Aggrenox formulation)",
     "• Secondary prevention after ischemic stroke/TIA\n• Non-cardioembolic stroke\n• Approved by FDA/AHA for stroke prevention",
     "Headache (dipyridamole)\nGI distress\nAvoid if coronary artery disease"),
    ("CILOSTAZOL",      "100 mg BD",
     "• Secondary prevention (especially Asian populations)\n• Non-cardioembolic stroke\n• Superior to aspirin in Asian RCTs",
     "Headache, palpitations\nCONTRAINDICATED in heart failure\nNot widely used outside Asia"),
]
col_widths3 = [1.8, 2.2, 4.4, 4.4]
col_x3 = [0.4]
for w in col_widths3[:-1]:
    col_x3.append(col_x3[-1]+w+0.02)
hdrs3 = ["Agent", "Dose", "Indications", "Side Effects / Cautions"]
for ci, (hdr, cw, cx) in enumerate(zip(hdrs3, col_widths3, col_x3)):
    add_rect(slide, cx, 1.15, cw, 0.45, C_NAVY)
    add_textbox(slide, cx+0.05, 1.17, cw-0.1, 0.42, hdr, 13, bold=True,
                color=C_WHITE, align=PP_ALIGN.CENTER)
ry = 1.62
for ri, (agent, dose, ind, se) in enumerate(agent_rows):
    row_h = 1.0
    bg = RGBColor(0xF0, 0xF8, 0xFF) if ri%2==0 else C_WHITE
    for ci, (val, cw, cx) in enumerate(zip([agent,dose,ind,se], col_widths3, col_x3)):
        add_rect(slide, cx, ry, cw, row_h, bg)
        fs = 12 if ci==0 else 10
        add_textbox(slide, cx+0.07, ry+0.04, cw-0.12, row_h-0.06, val, fs,
                    bold=(ci==0), color=C_NAVY if ci==0 else C_DARK)
    ry += row_h + 0.02

# ────────────────────────────────────────────────────────────────
# SLIDE 13 — Contraindications
# ────────────────────────────────────────────────────────────────
slide = make_content_slide("CONTRAINDICATIONS & PRECAUTIONS")

add_rect(slide, 0.4, 1.15, 5.9, 5.8, C_WHITE)
add_rect(slide, 0.4, 1.15, 5.9, 0.45, RGBColor(0xC0, 0x39, 0x2B))
add_textbox(slide, 0.5, 1.17, 5.7, 0.42, "ABSOLUTE CONTRAINDICATIONS", 14, bold=True, color=C_WHITE)
bullet_block(slide, 0.5, 1.65, 5.6, 4.7, [
    (0, "Active Hemorrhage"),
    (1, "Any intracranial or intraspinal hemorrhage"),
    (1, "Active GI or genitourinary bleeding"),
    (0, "Hemorrhagic Stroke"),
    (1, "Antiplatelet therapy strictly contraindicated"),
    (1, "Must confirm non-hemorrhagic etiology via CT/MRI first"),
    (0, "Aspirin-Specific"),
    (1, "Hypersensitivity to salicylates"),
    (1, "Aspirin-exacerbated respiratory disease (AERD)"),
    (1, "Severe hepatic failure"),
    (1, "Reye syndrome risk in children <16 years"),
    (0, "Clopidogrel-Specific"),
    (1, "Active pathological bleeding"),
    (1, "TTP (rare — discontinue if occurs)"),
    (0, "Cilostazol"),
    (1, "Heart failure (any severity)"),
], font_size=13)

add_rect(slide, 6.8, 1.15, 6.1, 5.8, C_WHITE)
add_rect(slide, 6.8, 1.15, 6.1, 0.45, C_NAVY)
add_textbox(slide, 6.9, 1.17, 5.9, 0.42, "PRECAUTIONS & MONITORING", 14, bold=True, color=C_WHITE)
bullet_block(slide, 6.9, 1.65, 5.8, 4.7, [
    (0, "Before Initiating Therapy"),
    (1, "CT head: exclude hemorrhagic stroke"),
    (1, "Check platelet count, renal/hepatic function"),
    (1, "Assess bleeding risk (peptic ulcer, warfarin use)"),
    (0, "During Treatment"),
    (1, "Monitor for GI symptoms — add PPI if needed"),
    (1, "Watch for bleeding signs (skin, gum, stool)"),
    (1, "Do not combine long-term DAPT without clear indication"),
    (0, "Special Populations"),
    (1, "Elderly: ↑ bleeding risk — use lowest effective dose"),
    (1, "Renal impairment: use with caution (aspirin/clopidogrel)"),
    (1, "Pregnancy: aspirin only in specific indications"),
    (0, "Drug Interactions"),
    (1, "NSAIDs ↑ bleeding risk with aspirin"),
    (1, "PPIs may reduce clopidogrel efficacy (CYP2C19)"),
    (1, "Anticoagulants: avoid combination unless AF with stent"),
], font_size=13)

# ────────────────────────────────────────────────────────────────
# SLIDE 14 — Guidelines Summary
# ────────────────────────────────────────────────────────────────
slide = make_content_slide("CURRENT GUIDELINES SUMMARY (AHA/ASA 2024)")

add_rect(slide, 0.4, 1.15, 12.5, 5.8, C_WHITE)

guideline_items = [
    ("I", "A", "Aspirin 160–300 mg within 24–48 h of acute ischemic stroke (not after thrombolysis within 24 h)"),
    ("I", "A", "Antiplatelet therapy for secondary prevention in all non-cardioembolic ischemic stroke/TIA patients without anticoagulation indication"),
    ("I", "A", "Aspirin 81–325 mg, clopidogrel 75 mg, or aspirin+dipyridamole ER acceptable for secondary prevention"),
    ("I", "A", "DAPT (aspirin+clopidogrel) for 21–30 days after high-risk TIA or minor ischemic stroke (NIHSS≤5)"),
    ("IIa","B", "Ticagrelor+aspirin as alternative to clopidogrel+aspirin for TIA/minor stroke"),
    ("III","A", "Long-term DAPT NOT recommended for secondary prevention of ischemic stroke (↑ bleeding, no benefit in SPS3/MATCH)"),
    ("III","A", "Antiplatelet agents NOT appropriate for cardioembolic stroke (anticoagulation preferred)"),
    ("III","A", "Antiplatelet agents CONTRAINDICATED in hemorrhagic stroke"),
]

# Header
col_ws = [0.7, 0.7, 11.35]
col_xs = [0.4, 1.15, 1.9]
hdrs_g = ["Class", "LOE", "Recommendation"]
for ci, (hdr, cw, cx) in enumerate(zip(hdrs_g, col_ws, col_xs)):
    add_rect(slide, cx, 1.15, cw, 0.42, C_TEAL)
    add_textbox(slide, cx+0.03, 1.17, cw-0.06, 0.38, hdr, 12, bold=True,
                color=C_WHITE, align=PP_ALIGN.CENTER)
ry = 1.59
for cls, loe, txt in guideline_items:
    rh = 0.56
    cls_col = RGBColor(0x27, 0xAE, 0x60) if cls=="I" else (RGBColor(0xF3, 0x9C, 0x12) if cls=="IIa" else RGBColor(0xC0, 0x39, 0x2B))
    bg = RGBColor(0xF7, 0xFB, 0xFF)
    add_rect(slide, 0.4, ry, 0.7, rh, cls_col)
    add_textbox(slide, 0.43, ry+0.1, 0.64, 0.38, cls, 13, bold=True, color=C_WHITE, align=PP_ALIGN.CENTER)
    add_rect(slide, 1.15, ry, 0.7, rh, RGBColor(0xE8, 0xF8, 0xE8))
    add_textbox(slide, 1.18, ry+0.1, 0.64, 0.38, loe, 13, bold=True, color=C_DARK, align=PP_ALIGN.CENTER)
    add_rect(slide, 1.9, ry, 11.35, rh, bg)
    add_textbox(slide, 2.0, ry+0.07, 11.1, rh-0.1, txt, 12, color=C_DARK)
    ry += rh + 0.02

# Legend
add_textbox(slide, 0.4, 6.8, 12.5, 0.3,
    "Class I = Benefit >> Risk  |  Class IIa = Benefit > Risk  |  Class III = Harm   |   LOE A = Multiple RCTs  |  LOE B = Single RCT or meta-analysis",
    9, color=RGBColor(0x55, 0x55, 0x55))

# ────────────────────────────────────────────────────────────────
# SLIDE 15 — Algorithm Flowchart
# ────────────────────────────────────────────────────────────────
slide = make_content_slide("CLINICAL ALGORITHM — ANTIPLATELET USE IN STROKE")

# Patient box
add_rect(slide, 4.5, 1.15, 4.3, 0.55, C_NAVY)
add_textbox(slide, 4.6, 1.18, 4.1, 0.5, "PATIENT WITH ACUTE STROKE / TIA", 13, bold=True, color=C_WHITE, align=PP_ALIGN.CENTER)
add_textbox(slide, 6.4, 1.72, 0.3, 0.3, "▼", 14, color=C_TEAL, align=PP_ALIGN.CENTER)

# CT/MRI decision
add_rect(slide, 3.6, 2.0, 6.1, 0.55, C_TEAL)
add_textbox(slide, 3.7, 2.03, 5.9, 0.5, "CT/MRI: Hemorrhagic or Non-Hemorrhagic?", 13, bold=True, color=C_WHITE, align=PP_ALIGN.CENTER)
add_textbox(slide, 6.4, 2.57, 0.3, 0.3, "▼", 14, color=C_TEAL, align=PP_ALIGN.CENTER)

# Two branches
add_rect(slide, 0.4, 2.85, 4.5, 0.5, RGBColor(0xC0, 0x39, 0x2B))
add_textbox(slide, 0.5, 2.87, 4.3, 0.47, "HEMORRHAGIC STROKE", 13, bold=True, color=C_WHITE, align=PP_ALIGN.CENTER)
add_rect(slide, 0.4, 3.4, 4.5, 0.65, RGBColor(0xFF, 0xE5, 0xE5))
add_textbox(slide, 0.5, 3.43, 4.3, 0.6, "Antiplatelets CONTRAINDICATED\n→ Neurosurgical / supportive management", 11, color=RGBColor(0xC0, 0x39, 0x2B))

add_rect(slide, 8.4, 2.85, 4.5, 0.5, RGBColor(0x27, 0xAE, 0x60))
add_textbox(slide, 8.5, 2.87, 4.3, 0.47, "NON-HEMORRHAGIC STROKE", 13, bold=True, color=C_WHITE, align=PP_ALIGN.CENTER)
add_textbox(slide, 6.65, 2.87, 1.6, 0.5, "◄─────────────►", 13, color=C_TEAL, align=PP_ALIGN.CENTER)

# Non-hem branch
add_rect(slide, 8.4, 3.4, 4.5, 0.5, C_TEAL)
add_textbox(slide, 8.5, 3.42, 4.3, 0.47, "Determine Etiology (TOAST)", 12, bold=True, color=C_WHITE, align=PP_ALIGN.CENTER)
add_textbox(slide, 10.4, 3.93, 0.3, 0.3, "▼", 14, color=C_TEAL, align=PP_ALIGN.CENTER)

sub_boxes = [
    (8.4, 4.2, "AF / Cardioembolic", "ANTICOAGULATION\n(not antiplatelet)", RGBColor(0xF3, 0x9C, 0x12)),
    (11.0, 4.2, "Atherosclerotic /\nSmall Vessel", "ANTIPLATELET THERAPY\n(see next branch)", RGBColor(0x27, 0xAE, 0x60)),
]
for (bx, by, title, action, col) in sub_boxes:
    add_rect(slide, bx, by, 2.5, 0.45, col)
    add_textbox(slide, bx+0.1, by+0.03, 2.3, 0.42, title, 11, bold=True, color=C_WHITE, align=PP_ALIGN.CENTER)
    add_rect(slide, bx, by+0.45, 2.5, 0.7, RGBColor(0xF7, 0xFB, 0xFF))
    add_textbox(slide, bx+0.1, by+0.5, 2.3, 0.62, action, 10, color=C_DARK, align=PP_ALIGN.CENTER)

# Antiplatelet algorithm
add_rect(slide, 5.1, 4.2, 2.9, 0.45, C_NAVY)
add_textbox(slide, 5.2, 4.22, 2.7, 0.42, "ANTIPLATELET SELECTION", 11, bold=True, color=C_WHITE, align=PP_ALIGN.CENTER)
add_rect(slide, 5.1, 4.65, 2.9, 2.0, RGBColor(0xE8, 0xF4, 0xF8))
ap_lines = [
    "Acute (<48h): Aspirin 160–300 mg",
    "TIA/Minor stroke: DAPT x21–30d",
    "Secondary prevention: ASA or Clopido",
    "Alt: ASA + Dipyridamole ER",
    "Cilostazol (non-cardioembolic, Asian pts)",
]
yy = 4.70
for ln in ap_lines:
    add_textbox(slide, 5.15, yy, 2.8, 0.35, "• "+ln, 10, color=C_DARK)
    yy += 0.36

# ────────────────────────────────────────────────────────────────
# SLIDE 16 — Conclusion
# ────────────────────────────────────────────────────────────────
slide = prs.slides.add_slide(blank)
add_rect(slide, 0, 0, 13.333, 7.5, C_NAVY)
add_rect(slide, 0, 0, 13.333, 0.6, C_TEAL)
add_rect(slide, 0, 6.9, 13.333, 0.6, C_TEAL)
add_rect(slide, 0.6, 1.5, 0.08, 4.8, C_ACCENT)

add_textbox(slide, 0.9, 1.2, 11.5, 0.8, "CONCLUSION", 34, bold=True, color=C_GOLD, align=PP_ALIGN.LEFT)
add_rect(slide, 0.9, 2.0, 10.5, 0.04, C_TEAL)

conc_points = [
    ("1.", "Antiplatelet therapy is the cornerstone of acute treatment and secondary prevention in NON-hemorrhagic ischemic stroke."),
    ("2.", "Aspirin within 24–48 h of acute ischemic stroke is standard of care (IST, CAST — Class I, Level A)."),
    ("3.", "DAPT (aspirin + clopidogrel) for 21–30 days is recommended for TIA and minor ischemic stroke (NIHSS ≤5) — supported by CHANCE and POINT trials."),
    ("4.", "Long-term DAPT is NOT recommended — no benefit and increased bleeding risk (SPS3, MATCH, CHARISMA)."),
    ("5.", "Choice of antiplatelet agent should be individualized: consider etiology, genetic metabolism (CYP2C19), tolerance, and comorbidities."),
    ("6.", "Cardioembolic stroke should be treated with anticoagulation; hemorrhagic stroke is an absolute contraindication to antiplatelets."),
    ("7.", "All antiplatelets reduce risk of all-cause vascular events by ~25%; the absolute benefit depends on baseline risk."),
]
yy = 2.15
for num, text in conc_points:
    tb = slide.shapes.add_textbox(Inches(0.9), Inches(yy), Inches(11.0), Inches(0.52))
    tf = tb.text_frame; tf.word_wrap = True
    p = tf.paragraphs[0]; p.space_after = Pt(4)
    r1 = p.add_run(); r1.text = num + "  "
    r1.font.size = Pt(14); r1.font.bold = True; r1.font.color.rgb = C_GOLD; r1.font.name="Calibri"
    r2 = p.add_run(); r2.text = text
    r2.font.size = Pt(14); r2.font.color.rgb = C_WHITE; r2.font.name="Calibri"
    yy += 0.54

add_textbox(slide, 0.9, 6.55, 11.5, 0.38,
    "References: Harrison's 22E, Adams & Victor's Neurology 12E, Bradley & Daroff's Neurology, Tintinalli's EM, Fuster & Hurst's The Heart 15E",
    10, color=RGBColor(0xB0, 0xC4, 0xDE), align=PP_ALIGN.LEFT)

# ────────────────────────────────────────────────────────────────
# SAVE
# ────────────────────────────────────────────────────────────────
out_path = "/tmp/workspace/antiplatelet-stroke-ppt/Antiplatelet_Agents_NonHemorrhagic_Stroke.pptx"
prs.save(out_path)
print(f"Saved: {out_path}")
print(f"Total slides: {len(prs.slides)}")
Running Command

cd /tmp/workspace/antiplatelet-stroke-ppt && python build_ppt.py

Editing File

~/antiplatelet-stroke-ppt/build_ppt.py

Error: String not found in file: '    add_rect(slide, 1.05, yy+0.42, 11.7, len(pts)*0.33)
        pyy = yy + 0.45'
Reading File
Editing File

~/antiplatelet-stroke-ppt/build_ppt.py

Successfully replaced 1 instance(s) of the string in '/tmp/workspace/antiplatelet-stroke-ppt/build_ppt.py'
Running Command

cd /tmp/workspace/antiplatelet-stroke-ppt && python build_ppt.py 2>&1

Your seminar PPT is ready! Here's the download link:

Antiplatelet Agents NonHemorrhagic Stroke

Presentation · PPTX


What's Inside (16 Slides)

SlideContent
1Title Slide - Professional navy/teal design
2Outline - 13-topic overview
3Introduction - Definition, TOAST classification, epidemiology
4Pathophysiology - 3-step cascade (Vascular Injury → Platelet Activation → Thrombus), ischemic penumbra
5Classification - COX-1 inhibitors, P2Y12 antagonists, PDE inhibitors, GP IIb/IIIa antagonists
6Mechanisms of Action - Aspirin, Clopidogrel/Ticagrelor, Dipyridamole, Cilostazol (4 panels)
7Indications Part 1 - Acute ischemic stroke, TIA (with evidence)
8Indications Part 2 - Secondary prevention, large artery disease, lacunar stroke, dissection
9Acute Phase Evidence - IST, CAST, CHANCE, POINT, THALES (comparison table)
10Secondary Prevention Trials - CAPRIE, ESPS-2, ESPRIT, ProFESS, MATCH, SPS3, CHARISMA
11DAPT Guidance - When to use/avoid, NNT data, CYP2C19 genetics
12Individual Agents Table - Dosage, indications, side effects for each drug
13Contraindications & Monitoring - Absolute contraindications, special populations, drug interactions
14AHA/ASA Guidelines - Color-coded Class I/IIa/III recommendations with Level of Evidence
15Clinical Algorithm Flowchart - Decision tree from stroke presentation to agent selection
16Conclusion - 7 key take-home points

Key sources used: Harrison's Principles of Internal Medicine 22E, Adams & Victor's Principles of Neurology 12E, Bradley & Daroff's Neurology, Tintinalli's Emergency Medicine, and Fuster & Hurst's The Heart 15E.
This is a shared conversation. Sign in to Orris to start your own chat.