Make pdf with this content but content should be in chronological way ( definition , etiology, risk factor pathophysiology, relevant images, treatment and prevention, add classification and type of mi) New guidelines for chronic stable angina , and acs - unstable, nstemi,stemi , when pci required, if not available - indication thrombolysis ( everything about thrombolysis, dosage, contraindications, definitive finding), delayed pci -indication , when emergency pci in nstemi and unstable, when delayed pci (why ) in nonstemi and ustable.

Reading File
Reading File
Finding Sources
Finding Sources
Finding Sources
Searching the Web

2024 2025 ACC AHA ESC guidelines ACS STEMI NSTEMI unstable angina PCI thrombolysis

Reading File
Reading File
Reading File
Finding Sources
Reading File
Reading File
Finding Sources
Reading Web Page

https://pmc.ncbi.nlm.nih.gov/articles/PMC12907536

Reading File
Finding Sources
Searching the Web

ACC AHA 2025 ACS guidelines thrombolysis fibrinolysis contraindications dosage streptokinase alteplase tenecteplase STEMI

Reading File
Reading Web Page

https://www.ncbi.nlm.nih.gov/books/NBK482376

Reading File
Finding Sources
Reading File
Running Command

mkdir -p /home/daytona/workspace/acs-angina-pdf && ls /home/daytona/workspace/ac…

Writing File

~/acs-angina-pdf/generate_pdf.py

#!/usr/bin/env python3
"""
Comprehensive PDF: Ischemic Heart Disease, ACS & Angina Management
Based on Braunwald's Heart Disease, Goldman-Cecil Medicine, Robbins Pathology,
Rosen's Emergency Medicine, and 2025 ACC/AHA / 2024 ESC Guidelines
"""

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.lib.enums import TA_LEFT, TA_CENTER, TA_JUSTIFY
from reportlab.platypus import (
    SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
    HRFlowable, PageBreak, KeepTogether
)
from reportlab.platypus import ListFlowable, ListItem
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
import os

OUTPUT_PATH = "/home/daytona/workspace/acs-angina-pdf/IHD_ACS_Angina_Guidelines.pdf"

# ─── COLOUR PALETTE ───────────────────────────────────────────────────────────
DARK_BLUE   = colors.HexColor("#1A3A5C")
MED_BLUE    = colors.HexColor("#2E6DA4")
LIGHT_BLUE  = colors.HexColor("#D6E8F7")
ACCENT_RED  = colors.HexColor("#C0392B")
ACCENT_ORG  = colors.HexColor("#E67E22")
ACCENT_GRN  = colors.HexColor("#27AE60")
PALE_GREY   = colors.HexColor("#F4F6F9")
MID_GREY    = colors.HexColor("#BDC3C7")
WHITE       = colors.white
TEXT_DARK   = colors.HexColor("#1C1C1C")

# ─── DOCUMENT ─────────────────────────────────────────────────────────────────
doc = SimpleDocTemplate(
    OUTPUT_PATH,
    pagesize=A4,
    rightMargin=1.8*cm, leftMargin=1.8*cm,
    topMargin=2.2*cm,   bottomMargin=2.2*cm,
    title="IHD, ACS & Angina – Comprehensive Clinical Guide",
    author="Orris Medical AI",
)

styles = getSampleStyleSheet()

# ─── CUSTOM STYLES ────────────────────────────────────────────────────────────
def S(name, **kw):
    """Return a ParagraphStyle derived from 'Normal'."""
    return ParagraphStyle(name, parent=styles["Normal"], **kw)

cover_title  = S("CoverTitle",  fontSize=26, textColor=WHITE, alignment=TA_CENTER,
                  spaceAfter=6, spaceBefore=6, fontName="Helvetica-Bold", leading=34)
cover_sub    = S("CoverSub",    fontSize=13, textColor=LIGHT_BLUE, alignment=TA_CENTER,
                  spaceAfter=4, fontName="Helvetica-Oblique", leading=18)
cover_date   = S("CoverDate",   fontSize=11, textColor=MID_GREY, alignment=TA_CENTER,
                  fontName="Helvetica", spaceAfter=0)

ch_title     = S("ChTitle",     fontSize=17, textColor=WHITE, fontName="Helvetica-Bold",
                  leading=22, alignment=TA_LEFT, spaceAfter=2, spaceBefore=4)
sec_head     = S("SecHead",     fontSize=13, textColor=DARK_BLUE, fontName="Helvetica-Bold",
                  leading=18, spaceBefore=14, spaceAfter=4, borderPad=3)
sub_head     = S("SubHead",     fontSize=11, textColor=MED_BLUE, fontName="Helvetica-Bold",
                  leading=15, spaceBefore=10, spaceAfter=3)
body         = S("Body",        fontSize=10, textColor=TEXT_DARK, leading=15,
                  alignment=TA_JUSTIFY, spaceBefore=3, spaceAfter=3)
bullet_body  = S("BulletBody",  fontSize=10, textColor=TEXT_DARK, leading=14,
                  alignment=TA_LEFT, leftIndent=14, spaceBefore=1, spaceAfter=1)
bold_body    = S("BoldBody",    fontSize=10, textColor=TEXT_DARK, leading=14,
                  fontName="Helvetica-Bold", spaceBefore=2, spaceAfter=2)
caption      = S("Caption",     fontSize=8.5, textColor=colors.HexColor("#555555"),
                  alignment=TA_CENTER, leading=12, spaceBefore=2, spaceAfter=6)
table_hdr    = S("TblHdr",      fontSize=9.5, textColor=WHITE, fontName="Helvetica-Bold",
                  alignment=TA_CENTER, leading=13)
table_cell   = S("TblCell",     fontSize=9, textColor=TEXT_DARK, leading=13,
                  alignment=TA_LEFT, wordWrap="CJK")
table_cell_c = S("TblCellC",    fontSize=9, textColor=TEXT_DARK, leading=13,
                  alignment=TA_CENTER)
warn_style   = S("Warn",        fontSize=9.5, textColor=ACCENT_RED, fontName="Helvetica-Bold",
                  leading=14, spaceBefore=4, spaceAfter=4, borderPad=4)
note_style   = S("Note",        fontSize=9, textColor=colors.HexColor("#4A4A00"),
                  fontName="Helvetica-Oblique", leading=13, spaceBefore=2, spaceAfter=4)

# ─── HELPERS ──────────────────────────────────────────────────────────────────
def chapter_banner(text, color=DARK_BLUE):
    tbl = Table([[Paragraph(text, ch_title)]], colWidths=[17.4*cm])
    tbl.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,-1), color),
        ("TOPPADDING",    (0,0), (-1,-1), 10),
        ("BOTTOMPADDING", (0,0), (-1,-1), 10),
        ("LEFTPADDING",   (0,0), (-1,-1), 14),
        ("RIGHTPADDING",  (0,0), (-1,-1), 14),
        ("ROUNDEDCORNERS", [6,6,6,6]),
    ]))
    return tbl

def section_box(title, color=MED_BLUE):
    tbl = Table([[Paragraph(title, sec_head)]], colWidths=[17.4*cm])
    tbl.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,-1), LIGHT_BLUE),
        ("TOPPADDING",    (0,0), (-1,-1), 7),
        ("BOTTOMPADDING", (0,0), (-1,-1), 7),
        ("LEFTPADDING",   (0,0), (-1,-1), 10),
        ("LEFTBORDER",    (0,0), (0,-1), 5),
        ("LINEAFTER",     (0,0), (0,-1), 0, color),
        ("BOX", (0,0), (-1,-1), 0.5, color),
    ]))
    return tbl

def highlight_box(text, bg=PALE_GREY, border=MED_BLUE, style=None):
    st = style or body
    tbl = Table([[Paragraph(text, st)]], colWidths=[17.4*cm])
    tbl.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,-1), bg),
        ("BOX", (0,0), (-1,-1), 1.5, border),
        ("TOPPADDING",    (0,0), (-1,-1), 8),
        ("BOTTOMPADDING", (0,0), (-1,-1), 8),
        ("LEFTPADDING",   (0,0), (-1,-1), 12),
        ("RIGHTPADDING",  (0,0), (-1,-1), 12),
    ]))
    return tbl

def bullet(text, lvl=0):
    indent = 14 + lvl*16
    st = S(f"Blt{lvl}", parent=bullet_body, leftIndent=indent)
    prefix = "\u2022 " if lvl == 0 else "\u25E6 "
    return Paragraph(prefix + text, st)

def subbullet(text):
    return bullet(text, lvl=1)

def hr():
    return HRFlowable(width="100%", thickness=0.7, color=MID_GREY,
                       spaceAfter=6, spaceBefore=6)

def drug_table(headers, rows, col_widths=None):
    if col_widths is None:
        col_widths = [17.4*cm / len(headers)] * len(headers)
    data = [[Paragraph(h, table_hdr) for h in headers]]
    for row in rows:
        data.append([Paragraph(str(c), table_cell) for c in row])
    tbl = Table(data, colWidths=col_widths, repeatRows=1)
    style = [
        ("BACKGROUND",    (0,0), (-1,0),  MED_BLUE),
        ("TEXTCOLOR",     (0,0), (-1,0),  WHITE),
        ("ROWBACKGROUNDS",(0,1), (-1,-1), [WHITE, PALE_GREY]),
        ("GRID",          (0,0), (-1,-1), 0.4, MID_GREY),
        ("TOPPADDING",    (0,0), (-1,-1), 5),
        ("BOTTOMPADDING", (0,0), (-1,-1), 5),
        ("LEFTPADDING",   (0,0), (-1,-1), 6),
        ("RIGHTPADDING",  (0,0), (-1,-1), 6),
        ("VALIGN",        (0,0), (-1,-1), "TOP"),
    ]
    tbl.setStyle(TableStyle(style))
    return tbl

def two_col_table(left_header, right_header, rows, lw=8*cm, rw=9.4*cm):
    data = [[Paragraph(left_header, table_hdr), Paragraph(right_header, table_hdr)]]
    for l, r in rows:
        data.append([Paragraph(l, table_cell), Paragraph(r, table_cell)])
    tbl = Table(data, colWidths=[lw, rw], repeatRows=1)
    tbl.setStyle(TableStyle([
        ("BACKGROUND",    (0,0), (-1,0),  DARK_BLUE),
        ("ROWBACKGROUNDS",(0,1), (-1,-1), [WHITE, PALE_GREY]),
        ("GRID",          (0,0), (-1,-1), 0.4, MID_GREY),
        ("TOPPADDING",    (0,0), (-1,-1), 5),
        ("BOTTOMPADDING", (0,0), (-1,-1), 5),
        ("LEFTPADDING",   (0,0), (-1,-1), 6),
        ("RIGHTPADDING",  (0,0), (-1,-1), 6),
        ("VALIGN",        (0,0), (-1,-1), "TOP"),
    ]))
    return tbl

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

# ══════════════════════════════════════════════════════
# COVER PAGE
# ══════════════════════════════════════════════════════
cover_bg = Table(
    [[Paragraph("ISCHEMIC HEART DISEASE", cover_title)],
     [Paragraph("Acute Coronary Syndromes & Angina Management", cover_sub)],
     [Spacer(1, 0.3*cm)],
     [Paragraph("A Comprehensive Clinical Reference", cover_sub)],
     [Spacer(1, 0.6*cm)],
     [Paragraph("Based on: Braunwald's Heart Disease · Goldman-Cecil Medicine ·<br/>"
                "Robbins Pathology · Rosen's Emergency Medicine<br/>"
                "2025 ACC/AHA · 2024 ESC Guidelines", cover_date)],
     [Spacer(1, 0.3*cm)],
     [Paragraph("July 2026 | Orris Medical AI", cover_date)],
    ],
    colWidths=[17.4*cm]
)
cover_bg.setStyle(TableStyle([
    ("BACKGROUND", (0,0), (-1,-1), DARK_BLUE),
    ("TOPPADDING",    (0,0), (-1,-1), 18),
    ("BOTTOMPADDING", (0,0), (-1,-1), 18),
    ("LEFTPADDING",   (0,0), (-1,-1), 20),
    ("RIGHTPADDING",  (0,0), (-1,-1), 20),
    ("ROWBACKGROUNDS",(0,0), (-1,-1), [DARK_BLUE]),
]))
story += [Spacer(1, 3*cm), cover_bg, PageBreak()]

# ══════════════════════════════════════════════════════
# CHAPTER 1: DEFINITIONS
# ══════════════════════════════════════════════════════
story += [chapter_banner("CHAPTER 1: DEFINITIONS & CLASSIFICATION"), Spacer(1,0.3*cm)]

story += [section_box("1.1  Ischemic Heart Disease (IHD)"), Spacer(1,0.15*cm)]
story += [Paragraph(
    "Ischemic heart disease (IHD) encompasses all conditions in which the blood supply to the "
    "myocardium is insufficient relative to its demand - most commonly due to atherosclerotic "
    "coronary artery disease (CAD). IHD is the leading cause of death worldwide, responsible "
    "for approximately 400,000 deaths annually in the United States alone.",
    body)]

story += [section_box("1.2  Myocardial Infarction (MI) - Definition"), Spacer(1,0.15*cm)]
story += [Paragraph(
    "<b>Myocardial infarction (MI)</b> is the death (necrosis) of cardiac muscle due to prolonged, "
    "severe ischemia. The <b>Fourth Universal Definition of Myocardial Infarction (2018)</b> "
    "defines MI as detection of a rise and/or fall of cardiac biomarkers (preferably high-sensitivity "
    "troponin) with at least one value above the 99th percentile upper reference limit, together with "
    "evidence of myocardial ischemia (symptoms, ECG changes, or imaging).",
    body), Spacer(1,0.15*cm)]

story += [section_box("1.3  Classification of MI (Universal Definition)"), Spacer(1,0.15*cm)]

mi_types_data = [
    ["Type", "Name", "Mechanism"],
    ["Type 1", "Spontaneous MI", "Atherosclerotic plaque rupture/erosion → thrombus → coronary occlusion"],
    ["Type 2", "MI due to supply-demand mismatch", "Demand ischemia: tachyarrhythmia, severe hypertension, anaemia, hypotension, vasospasm; no culprit plaque rupture"],
    ["Type 3", "MI resulting in death", "Sudden cardiac death with ECG/symptoms suggesting MI; biomarkers unavailable"],
    ["Type 4a", "PCI-related MI", "Occurring within 48h of PCI; troponin rise >5x URL"],
    ["Type 4b", "Stent thrombosis MI", "Confirmed by angiography or autopsy"],
    ["Type 4c", "In-stent restenosis MI", "Restenosis at stent/balloon site"],
    ["Type 5", "CABG-related MI", "Troponin rise >10x URL within 48h of CABG"],
]
story += [drug_table(
    mi_types_data[0],
    mi_types_data[1:],
    [2*cm, 5*cm, 10.4*cm]
), Spacer(1,0.3*cm)]

story += [section_box("1.4  ACS Spectrum & Classification"), Spacer(1,0.15*cm)]
story += [Paragraph(
    "<b>Acute Coronary Syndrome (ACS)</b> is an umbrella term covering the spectrum from unstable "
    "angina (UA) to non-ST-elevation MI (NSTEMI) to ST-elevation MI (STEMI).",
    body)]
acs_class = [
    ["ACS Type", "Troponin", "ST Changes", "Mechanism"],
    ["Unstable Angina (UA)", "Negative (normal)", "Transient ST depression/T-wave changes or normal ECG", "Subtotal occlusion; no myocyte death"],
    ["NSTEMI", "Positive (elevated)", "ST depression, T-wave inversion; NO persistent ST elevation", "Subtotal occlusion or demand ischemia; myocyte necrosis present"],
    ["STEMI", "Positive (elevated)", "Persistent ST elevation ≥20 min; new LBBB (rare)", "Total thrombotic occlusion of epicardial coronary artery"],
]
story += [drug_table(
    acs_class[0],
    acs_class[1:],
    [3.5*cm, 3*cm, 5*cm, 5.9*cm]
), Spacer(1,0.3*cm)]

story += [section_box("1.5  Angina Classification (CCS Grading)"), Spacer(1,0.15*cm)]
angina_ccs = [
    ["CCS Grade", "Description"],
    ["Grade I", "Angina only with strenuous exertion; ordinary physical activity does NOT cause angina"],
    ["Grade II", "Slight limitation of ordinary activity; angina on walking >2 blocks on level or climbing >1 flight of stairs"],
    ["Grade III", "Marked limitation; angina on walking 1-2 blocks or climbing 1 flight of stairs"],
    ["Grade IV", "Inability to carry on any physical activity without discomfort; angina at rest"],
]
story += [drug_table(angina_ccs[0], angina_ccs[1:], [3*cm, 14.4*cm]), Spacer(1,0.3*cm)]

story += [PageBreak()]

# ══════════════════════════════════════════════════════
# CHAPTER 2: ETIOLOGY & RISK FACTORS
# ══════════════════════════════════════════════════════
story += [chapter_banner("CHAPTER 2: ETIOLOGY & RISK FACTORS"), Spacer(1,0.3*cm)]

story += [section_box("2.1  Etiology"), Spacer(1,0.15*cm)]
story += [Paragraph(
    "The <b>overwhelming majority</b> of IHD and MI is caused by <b>atherosclerosis</b> of the epicardial "
    "coronary arteries. Less common etiologies include:",
    body)]
for e in [
    "Coronary vasospasm (Prinzmetal / variant angina) - cocaine, ergotamine, chemotherapy",
    "Spontaneous coronary artery dissection (SCAD) - young women, peripartum",
    "Coronary artery embolism - infective endocarditis, atrial fibrillation, prosthetic valves",
    "Coronary arteritis - Kawasaki disease, Takayasu arteritis, SLE",
    "Severe anaemia, hypotension, tachyarrhythmia (Type 2 MI)",
    "Congenital coronary anomalies",
    "Hypertrophic cardiomyopathy (supply-demand mismatch)",
]:
    story.append(bullet(e))
story.append(Spacer(1, 0.2*cm))

story += [section_box("2.2  Risk Factors"), Spacer(1,0.15*cm)]

risk_data = [
    ["Non-Modifiable Risk Factors", "Modifiable Risk Factors"],
    ["Age (men >45 y, women >55 y)\nMale sex (before menopause)\nFamily history of premature CAD\n  (1st degree relative: men <55 y, women <65 y)\nGenetics / ethnicity\nMenopausal state",
     "Hypertension\nDyslipidaemia (high LDL, low HDL, high TG)\nDiabetes mellitus / insulin resistance\nSmoking / tobacco use\nObesity (BMI >30 kg/m²)\nPhysical inactivity\nChronic kidney disease\nChronic inflammatory states (RA, SLE, psoriasis)\nSleep apnoea\nHigh-sensitivity CRP elevation\nPsychosocial stress / depression\nCocaine use\nOral contraceptive pills (combined)\nHyperhomocysteinaemia"],
]
tbl = Table(
    [[Paragraph("NON-MODIFIABLE RISK FACTORS", table_hdr), Paragraph("MODIFIABLE RISK FACTORS", table_hdr)],
     [Paragraph(risk_data[1][0].replace("\n","<br/>"), table_cell),
      Paragraph(risk_data[1][1].replace("\n","<br/>"), table_cell)]],
    colWidths=[8.5*cm, 8.9*cm]
)
tbl.setStyle(TableStyle([
    ("BACKGROUND",    (0,0), (-1,0),  DARK_BLUE),
    ("TEXTCOLOR",     (0,0), (-1,0),  WHITE),
    ("BACKGROUND",    (0,1), (0,1),   colors.HexColor("#FEF9E7")),
    ("BACKGROUND",    (1,1), (1,1),   colors.HexColor("#EAF4FB")),
    ("GRID",          (0,0), (-1,-1), 0.5, MID_GREY),
    ("TOPPADDING",    (0,0), (-1,-1), 6),
    ("BOTTOMPADDING", (0,0), (-1,-1), 6),
    ("LEFTPADDING",   (0,0), (-1,-1), 8),
    ("VALIGN",        (0,0), (-1,-1), "TOP"),
]))
story += [tbl, Spacer(1, 0.3*cm)]

story += [highlight_box(
    "<b>Key Clinical Note:</b> Post-menopausal women lose the cardioprotective effect of oestrogen. "
    "Hormonal replacement therapy has NOT been shown to be protective and may increase thrombotic risk. "
    "The INTERHEART study showed 9 modifiable risk factors account for >90% of MI risk worldwide.",
    bg=colors.HexColor("#FFF3CD"), border=ACCENT_ORG
), Spacer(1,0.3*cm)]

story += [PageBreak()]

# ══════════════════════════════════════════════════════
# CHAPTER 3: PATHOPHYSIOLOGY
# ══════════════════════════════════════════════════════
story += [chapter_banner("CHAPTER 3: PATHOPHYSIOLOGY"), Spacer(1,0.3*cm)]

story += [section_box("3.1  Atherosclerosis & Plaque Formation"), Spacer(1,0.15*cm)]
story += [Paragraph(
    "Atherosclerosis begins with endothelial injury/dysfunction, allowing low-density lipoprotein "
    "(LDL) to enter and accumulate in the subintima. Oxidised LDL triggers a chronic inflammatory "
    "response: monocytes differentiate into macrophages, engulf lipids to form <b>foam cells</b>, and "
    "secrete cytokines (TNF, IL-1, IFN-γ). Smooth muscle cells migrate and proliferate, "
    "secreting a collagen-rich extracellular matrix to form a <b>fibrous cap</b> over the lipid-rich "
    "necrotic core - constituting the <b>atherosclerotic plaque</b>.",
    body)]

story += [section_box("3.2  Plaque Vulnerability & Rupture"), Spacer(1,0.15*cm)]
story += [Paragraph(
    "A <b>vulnerable (unstable) plaque</b> is characterised by a large lipid core, thin fibrous cap "
    "(&lt;65 µm), and a dense inflammatory infiltrate at the shoulder regions. Inflammatory cells "
    "secrete <b>matrix metalloproteinases (MMPs)</b> and cathepsins that degrade collagen and "
    "elastin, weakening the fibrous cap. Plaque rupture or erosion exposes the "
    "thrombogenic subendothelial matrix and lipid core to circulating blood.",
    body)]

story += [section_box("3.3  Thrombus Formation (Coronary Occlusion)"), Spacer(1,0.15*cm)]
story += [Paragraph(
    "Plaque rupture triggers the following sequence:",
    body)]
thromb_steps = [
    "<b>Platelet adhesion:</b> Exposed collagen and von Willebrand factor (vWF) bind platelet GPIb/IX/V receptors.",
    "<b>Platelet activation:</b> Platelets change shape (discoid → stellate), release ADP, thromboxane A2, serotonin; upregulate GPIIb/IIIa receptors.",
    "<b>Platelet aggregation:</b> Fibrinogen cross-links GPIIb/IIIa receptors on adjacent platelets → 'platelet plug'.",
    "<b>Coagulation cascade:</b> Tissue factor exposed → thrombin generated → fibrinogen → fibrin → stabilises thrombus.",
    "<b>Coronary occlusion:</b> Subtotal occlusion → UA/NSTEMI; Total occlusion → STEMI (absent collaterals).",
]
for s in thromb_steps:
    story.append(bullet(s))
story.append(Spacer(1,0.2*cm))

story += [section_box("3.4  Zones of Myocardial Injury"), Spacer(1,0.15*cm)]
story += [Paragraph(
    "After occlusion, the myocardium at risk undergoes a spatial gradient of injury:",
    body)]
zones = [
    ["Zone", "Description", "Reversibility"],
    ["Zone of Necrosis (infarct core)", "Central zone; ATP depleted within 20-40 min; irreversible cell death by coagulative necrosis", "IRREVERSIBLE"],
    ["Zone of Injury", "Intermediate zone; severe ischaemia; ST elevation on ECG", "May be reversible with timely reperfusion"],
    ["Zone of Ischaemia (penumbra)", "Outer zone; reduced perfusion; T-wave changes on ECG", "Recoverable with prompt reperfusion"],
]
story += [drug_table(zones[0], zones[1:], [4.5*cm, 8.5*cm, 4.4*cm]), Spacer(1,0.2*cm)]

story += [section_box("3.5  Temporal Morphology of MI"), Spacer(1,0.15*cm)]
morph_data = [
    ["Time", "Gross Changes", "Microscopic Changes"],
    ["0-6 hours", "None (normal appearance)", "Reversible: swelling, nuclear chromatin clumping; Early coagulative necrosis begins at ~4h"],
    ["6-24 hours", "Pallor, oedema beginning", "Coagulative necrosis; neutrophil infiltration begins"],
    ["1-3 days", "Pale-yellow colour", "Karyolysis; peak neutrophil infiltration"],
    ["3-7 days", "Hyperaemic rim around yellow centre", "Macrophage infiltration; removal of necrotic debris"],
    ["1-3 weeks", "Pale grey-yellow, soft (risk of rupture)", "Granulation tissue; angiogenesis; collagen deposition begins"],
    ["Weeks-months", "Firm grey-white scar", "Dense fibrous scar; complete collagen replacement"],
]
story += [drug_table(morph_data[0], morph_data[1:], [2.5*cm, 5.5*cm, 9.4*cm]), Spacer(1,0.3*cm)]

story += [highlight_box(
    "<b>Clinically Important:</b> Days 3-7 post-MI represent the highest risk of myocardial free wall "
    "rupture, ventricular septal defect, or papillary muscle rupture due to maximal softening of "
    "necrotic tissue before adequate fibrosis.",
    bg=colors.HexColor("#FDEDEC"), border=ACCENT_RED, style=warn_style
), Spacer(1,0.3*cm)]

story += [section_box("3.6  Transmural vs. Subendocardial Infarction"), Spacer(1,0.15*cm)]
story += [Paragraph(
    "<b>Transmural (full-thickness) MI:</b> Involves the entire wall thickness from endocardium to "
    "epicardium. Typically caused by total occlusion of a major epicardial coronary artery. "
    "Associated with STEMI pattern on ECG. Develops Q waves (Q-wave MI).",
    body)]
story += [Paragraph(
    "<b>Subendocardial (non-transmural) MI:</b> Involves the inner one-third to half of the myocardium. "
    "Caused by prolonged hypotension, severe anaemia, or partial coronary occlusion. "
    "Typically non-Q-wave MI; associated with ST depression on ECG.",
    body)]

story += [section_box("3.7  Coronary Artery Distribution of Infarcts"), Spacer(1,0.15*cm)]
cad_dist = [
    ["Artery", "Frequency", "Territory Infarcted"],
    ["Left Anterior Descending (LAD)", "40-50%", "Anterior LV wall near apex, anterior 2/3 of interventricular septum, LV apex (circumferentially)"],
    ["Right Coronary Artery (RCA)", "30-40%", "Inferior/posterior LV wall, posterior 1/3 of septum, RV free wall (in some), SA/AV node"],
    ["Left Circumflex (LCx)", "15-20%", "Lateral LV wall (excluding apex); posterior wall in dominant LCx"],
]
story += [drug_table(cad_dist[0], cad_dist[1:], [4.5*cm, 2.5*cm, 10.4*cm]), Spacer(1,0.3*cm)]

story += [PageBreak()]

# ══════════════════════════════════════════════════════
# CHAPTER 4: CHRONIC STABLE ANGINA
# ══════════════════════════════════════════════════════
story += [chapter_banner("CHAPTER 4: CHRONIC STABLE ANGINA (CCS / Chronic Coronary Syndrome)",
                          color=colors.HexColor("#1A5C3A")), Spacer(1,0.3*cm)]

story += [section_box("4.1  Definition & Diagnosis"), Spacer(1,0.15*cm)]
story += [Paragraph(
    "<b>Chronic Stable Angina</b> (now termed <i>Chronic Coronary Syndrome</i> [CCS] by 2024 ESC "
    "guidelines) is predictable chest pain or discomfort precipitated by exertion or stress and "
    "relieved within minutes by rest or sublingual nitrates. It results from a fixed atherosclerotic "
    "stenosis causing an imbalance between myocardial oxygen demand and supply.",
    body)]
story += [Paragraph(
    "<b>Typical Angina:</b> (1) Substernal chest discomfort with characteristic quality and duration; "
    "(2) Provoked by exertion or emotional stress; (3) Relieved by rest or nitroglycerin.",
    body)]
story += [Paragraph(
    "<i>Note: The 2024 ESC guidelines de-emphasise 'typical vs atypical' terminology. Terms like "
    "'typical' and 'atypical' have limited prognostic value; instead, focus on detailed history of "
    "quality, location, duration, triggers, and relieving factors.</i>",
    note_style)]

story += [section_box("4.2  Investigations"), Spacer(1,0.15*cm)]
invx = [
    ["Investigation", "Finding / Purpose"],
    ["Resting ECG", "ST changes, Q waves, LVH; may be normal in stable angina"],
    ["Stress ECG (Exercise Treadmill Test)", "Horizontal or downsloping ST depression ≥1mm; diagnostic for ischaemia; assess functional capacity"],
    ["Echocardiography", "LV function, wall motion abnormalities, valve disease (baseline)"],
    ["Stress Echo / Nuclear MPI", "Assess myocardial ischaemia and viability; better sensitivity than ETT"],
    ["CT Coronary Angiography (CTCA)", "First-line non-invasive imaging (Class I, 2024 ESC); rules in/out obstructive CAD; calculates CAC score"],
    ["Invasive Coronary Angiography", "Gold standard; required before revascularisation; assess anatomy, severity"],
    ["FFR / iFR", "Functional assessment of stenosis severity; FFR ≤0.80 indicates haemodynamic significance"],
    ["High-sensitivity Troponin", "Rule out ACS; elevated troponin excludes stable angina diagnosis"],
    ["CBC, lipid profile, HbA1c, TFTs", "Risk factor assessment; identify secondary causes"],
]
story += [drug_table(invx[0], invx[1:], [5*cm, 12.4*cm]), Spacer(1,0.2*cm)]

story += [section_box("4.3  Medical Treatment of Chronic Stable Angina"), Spacer(1,0.15*cm)]
story += [Paragraph(
    "<b>Goals:</b> (1) Relieve symptoms; (2) Prevent MI and death; (3) Slow disease progression.",
    bold_body)]

story += [Paragraph("<b>Anti-ischaemic / Symptom-relief Therapy:</b>", sub_head)]
antiisch = [
    ["Drug Class", "Agent (Dose)", "Mechanism / Notes"],
    ["Short-acting Nitrates", "Sublingual GTN 0.3-0.6 mg or spray", "Venodilation → preload reduction; immediate relief; first-line for acute angina episodes"],
    ["Beta-blockers (BB) [FIRST LINE]", "Metoprolol 25-200 mg BD, Bisoprolol 5-10 mg OD, Atenolol 50-100 mg OD", "Reduce HR & contractility → decrease O2 demand; reduce mortality post-MI; preferred in post-MI angina"],
    ["Calcium Channel Blockers (CCB)", "Amlodipine 5-10 mg OD (DHP); Diltiazem 60-120 mg TDS; Verapamil 80-120 mg TDS", "Dihydropyridines: vasodilation; Non-DHP: reduce HR + vasodilation; add to BB if not controlled"],
    ["Long-acting Nitrates", "Isosorbide mononitrate 20-40 mg BD (with 8h nitrate-free interval)", "Tolerance develops without nitrate-free interval; do not use with PDE5 inhibitors"],
    ["Ivabradine", "5-7.5 mg BD", "If inhibitor; reduces HR without affecting contractility or BP; if BB contraindicated/intolerant"],
    ["Ranolazine", "500-1000 mg BD", "Late Na+ current inhibitor; reduces diastolic wall tension; useful add-on; no effect on HR/BP"],
    ["Nicorandil", "10-20 mg BD", "KATP channel opener + nitrate effect; useful in refractory angina (ESC Class IIb)"],
    ["Trimetazidine", "35 mg BD (modified release)", "Metabolic agent; shifts cardiac metabolism from FA oxidation to glucose; adjunct therapy"],
]
story += [drug_table(antiisch[0], antiisch[1:], [3.5*cm, 5*cm, 8.9*cm]), Spacer(1,0.2*cm)]

story += [Paragraph("<b>Cardiovascular Risk Reduction / Prevention Therapy:</b>", sub_head)]
prevent = [
    ["Drug", "Dose", "Target / Goal"],
    ["Aspirin", "75-100 mg OD (indefinite)", "Antiplatelet; Class I recommendation for all CCS"],
    ["High-intensity statin", "Atorvastatin 40-80 mg OD / Rosuvastatin 20-40 mg OD", "LDL <1.4 mmol/L (<55 mg/dL) AND ≥50% reduction from baseline (ESC 2024 targets)"],
    ["ACE Inhibitor (ACEi) / ARB", "Ramipril 10 mg OD / Perindopril 10 mg OD", "Class I in CCS with: HFrEF, DM, HTN, CKD; Class IIa in all CCS (ESC 2024)"],
    ["Beta-blocker", "Post-MI: Carvedilol, Metoprolol, Bisoprolol", "Class I post-MI with reduced EF; reduces sudden death"],
    ["Ezetimibe", "10 mg OD", "Add if LDL not at target on maximally tolerated statin"],
    ["PCSK9 inhibitors", "Evolocumab 140 mg every 2w / Alirocumab", "When LDL remains above target despite statin + ezetimibe (very high risk)"],
    ["Clopidogrel", "75 mg OD", "Alternative antiplatelet if aspirin intolerant; or DAPT for 6-12 months post-PCI"],
    ["SGLT2 inhibitor", "Empagliflozin / Dapagliflozin", "Class I in DM with CCS; reduce HF hospitalisations and CV death"],
]
story += [drug_table(prevent[0], prevent[1:], [4*cm, 4.5*cm, 8.9*cm]), Spacer(1,0.2*cm)]

story += [section_box("4.4  When is PCI Required in Stable Angina?"), Spacer(1,0.15*cm)]
story += [Paragraph(
    "<b>Revascularisation Indications (2024 ESC / 2025 ACC/AHA):</b>",
    bold_body)]
pci_indic = [
    "Refractory angina despite optimal medical therapy (OMT) [Class I]",
    "Haemodynamically significant stenosis (FFR ≤0.80 / iFR ≤0.89) with angina symptoms [Class I]",
    "High-risk anatomy: Left main disease >50% stenosis [Class I for revascularisation]",
    "Proximal LAD stenosis >50% with objective ischaemia [Class I for revascularisation]",
    "Multivessel disease with large ischaemic burden (>10% of myocardium) [Class IIa]",
    "CCS patients with impaired LV function (EF <35%) who have viable myocardium [Class IIa for CABG]",
    "Documented large area of ischaemia (>10%) on functional imaging despite symptoms",
]
for p in pci_indic:
    story.append(bullet(p))
story.append(Spacer(1,0.15*cm))

story += [highlight_box(
    "<b>CABG vs. PCI in Stable CAD:</b> CABG preferred in: Left main disease, 3-vessel CAD with "
    "complex anatomy (SYNTAX score >22), diabetes with multivessel CAD, impaired LV function. "
    "PCI preferred in: Single/two-vessel CAD, high surgical risk, patient preference. "
    "Both are acceptable in 3-vessel CAD with SYNTAX ≤22.",
    bg=LIGHT_BLUE, border=MED_BLUE
), Spacer(1,0.3*cm)]

story += [section_box("4.5  Antithrombotic Therapy Post-PCI (Chronic Setting)"), Spacer(1,0.15*cm)]
story += [Paragraph(
    "<b>Standard DAPT post-elective PCI:</b> Aspirin 75-100 mg + Clopidogrel 75 mg for <b>6 months</b> "
    "(2024 ESC Class I). May reduce to 1-3 months if high bleeding risk. Extend to 12 months if "
    "high ischaemic risk (acute MI presentation). After DAPT, aspirin monotherapy indefinitely.",
    body)]

story += [PageBreak()]

# ══════════════════════════════════════════════════════
# CHAPTER 5: UNSTABLE ANGINA & NSTEMI
# ══════════════════════════════════════════════════════
story += [chapter_banner("CHAPTER 5: UNSTABLE ANGINA (UA) & NSTEMI",
                          color=colors.HexColor("#7B2D00")), Spacer(1,0.3*cm)]

story += [section_box("5.1  Definitions"), Spacer(1,0.15*cm)]
story += [Paragraph(
    "<b>Unstable Angina (UA):</b> ACS with chest pain at rest, new-onset severe angina, or crescendo "
    "angina (more frequent/prolonged/severe). <b>Troponin NEGATIVE</b> - no myocyte necrosis. ECG may "
    "show transient ST depression, T-wave changes, or be normal.",
    body)]
story += [Paragraph(
    "<b>NSTEMI:</b> ACS with <b>Troponin POSITIVE</b> (elevated above 99th percentile URL) WITHOUT "
    "persistent ST elevation (&gt;20 min). ST depression, T-wave inversion, or subtle ECG changes "
    "may be present. Myocyte necrosis has occurred.",
    body)]
story += [Paragraph(
    "Both UA and NSTEMI are collectively termed <b>NSTE-ACS</b>. The distinction is made retrospectively "
    "after troponin results. Both share a common pathophysiology.",
    note_style)]

story += [section_box("5.2  Pathophysiology (NSTE-ACS)"), Spacer(1,0.15*cm)]
story += [Paragraph(
    "In most cases: plaque rupture/erosion → platelet aggregation → <b>non-occlusive (subtotal) "
    "thrombus</b> → reduced but not absent coronary flow → ischaemia ± infarction. "
    "If extensive collaterals exist, even total occlusion may present as NSTEMI rather than STEMI.",
    body)]

story += [section_box("5.3  Clinical Features"), Spacer(1,0.15*cm)]
story += [Paragraph(
    "<b>Symptoms:</b> Retrosternal pressure, squeezing, or heaviness; radiation to left arm/jaw/neck; "
    "diaphoresis, nausea, dyspnoea, syncope. Atypical presentations (indigestion, fatigue, epigastric "
    "pain) more common in women, elderly, diabetics.",
    body)]
story += [Paragraph(
    "<b>ECG findings:</b> ST depression (horizontal or downsloping ≥0.5 mm) in ≥2 contiguous leads; "
    "T-wave inversion; new LBBB; or normal ECG. <b>NO persistent ST elevation.</b>",
    body)]
story += [Paragraph(
    "<b>Biomarkers:</b> High-sensitivity troponin (hsTn) serial measurement. "
    "0h/1h algorithm (ESC): if hsTn very low at 0h → rule out; if rise ≥5 pg/mL at 1h → rule in. "
    "0h/2h or 0h/3h algorithms also validated.",
    body)]

story += [section_box("5.4  Risk Stratification"), Spacer(1,0.15*cm)]
story += [Paragraph(
    "Risk stratification guides urgency of invasive strategy:",
    body)]
risk_strat = [
    ["Risk Score", "Tool", "Key Variables"],
    ["GRACE Score", "Recommended by ESC & ACC/AHA 2025", "Age, HR, BP, creatinine, cardiac arrest, ST deviation, troponin, Killip class"],
    ["TIMI Score", "0-7 points", "Age ≥65, ≥3 CAD risk factors, prior CAD, ST deviation, ≥2 angina events, aspirin use, elevated markers"],
    ["HEART Score", "ED-based", "History, ECG, Age, Risk factors, Troponin; ≤3 low risk; ≥7 high risk"],
]
story += [drug_table(risk_strat[0], risk_strat[1:], [3*cm, 4.5*cm, 9.9*cm]), Spacer(1,0.2*cm)]

story += [Paragraph(
    "<b>High-risk features requiring early invasive strategy (within 24h):</b>",
    bold_body)]
high_risk = [
    "GRACE score >140",
    "Dynamic ST/T changes (≥1mm ST depression or new T-wave inversion)",
    "Elevated troponin (especially rising pattern)",
    "Haemodynamic instability (cardiogenic shock, acute heart failure)",
    "Life-threatening arrhythmia (VT/VF)",
    "Recurrent ischaemia despite medical therapy",
    "Prior CABG or multivessel CAD with evidence of ongoing ischaemia",
]
for h in high_risk:
    story.append(bullet(h))
story.append(Spacer(1,0.15*cm))

story += [Paragraph(
    "<b>Very high-risk features requiring immediate invasive strategy (within 2h / emergent):</b>",
    bold_body)]
very_high = [
    "Haemodynamic instability / cardiogenic shock",
    "Refractory chest pain unresponsive to anti-ischaemic therapy",
    "Life-threatening arrhythmias (VF, sustained VT)",
    "Mechanical complications of MI (MR, VSD, free wall rupture)",
    "Acute heart failure attributable to NSTE-ACS",
    "Recurrent dynamic ECG changes - especially ST elevation (transient)",
]
for v in very_high:
    story.append(bullet(v))
story.append(Spacer(1,0.2*cm))

story += [section_box("5.5  Acute Medical Management of UA/NSTEMI"), Spacer(1,0.15*cm)]
story += [Paragraph("<b>MONA + Antithrombotic (Initial ED Management):</b>", sub_head)]
mona = [
    ["Drug", "Dose", "Notes"],
    ["Morphine (use cautiously)", "2-4 mg IV (if severe pain)", "2025 ACC/AHA: use with caution; may mask symptoms; possible adverse interaction with P2Y12 agents"],
    ["Oxygen", "Only if SpO2 <90%", "Routine O2 NOT recommended (AVOID-HF trial); may increase oxidative stress"],
    ["Nitrates", "SL GTN 0.4 mg q5min ×3, then IV NTG if ongoing pain", "Avoid if BP <90 mmHg, RV infarction, PDE5 inhibitor use within 24-48h"],
    ["Aspirin (MANDATORY)", "Loading: 162-325 mg chewed; then 75-100 mg OD indefinitely", "Class I; give immediately to all ACS patients unless contraindicated"],
    ["P2Y12 inhibitor", "Ticagrelor 180 mg load then 90 mg BD (PREFERRED)\nor Clopidogrel 300-600 mg load then 75 mg OD", "2025 ACC/AHA: Ticagrelor or Prasugrel preferred over Clopidogrel for NSTE-ACS. Prasugrel contraindicated if prior stroke/TIA or age >75y"],
    ["Anticoagulation", "LMWH: Enoxaparin 1 mg/kg SC BD\nor UFH: 60 U/kg bolus + infusion\nor Fondaparinux 2.5 mg SC OD (preferred if conservative strategy)", "Fondaparinux: lower bleeding risk; preferred unless PCI planned. Add UFH at time of PCI if fondaparinux was used."],
    ["Beta-blocker (oral)", "Metoprolol 25-50 mg BD, titrate up", "Start within 24h if no contraindications (HF, shock, bradycardia, heart block)"],
    ["High-intensity statin", "Atorvastatin 80 mg OD immediately", "Start in hospital; do not wait; reduces events regardless of baseline LDL"],
    ["ACE inhibitor", "Ramipril 2.5-5 mg OD (titrate)", "Start within 24h if HFrEF, HTN, DM; beneficial in all NSTEMI (ESC Class I)"],
]
story += [drug_table(mona[0], mona[1:], [3*cm, 4.5*cm, 9.9*cm]), Spacer(1,0.3*cm)]

story += [section_box("5.6  PCI Strategy in UA/NSTEMI"), Spacer(1,0.15*cm)]

pci_timing = [
    ["Risk Category", "Timing of PCI", "Indication"],
    ["VERY HIGH RISK\n(emergent)", "IMMEDIATE: within 2 hours", "Cardiogenic shock, refractory ischaemia/pain, life-threatening arrhythmia, acute HF, mechanical complications"],
    ["HIGH RISK\n(early invasive)", "EARLY: within 24 hours", "GRACE >140, dynamic ECG changes (ST depression ≥1mm, T-wave inversion), elevated troponin, TIMI ≥3 or HEART ≥7"],
    ["INTERMEDIATE RISK\n(invasive)", "Within 24-72 hours", "GRACE 109-140, elevated troponin without dynamic ECG, diabetes, eGFR <60, EF <40%, early post-infarction angina, prior CABG/PCI"],
    ["LOW RISK\n(selective/conservative)", "Elective / non-invasive workup first", "GRACE <109, HEART ≤3, TIMI 0-1, no troponin rise, no ECG changes, no recurrent symptoms"],
]
story += [drug_table(pci_timing[0], pci_timing[1:], [3.5*cm, 3.5*cm, 10.4*cm]), Spacer(1,0.2*cm)]

story += [highlight_box(
    "<b>Why Delayed PCI in NSTEMI/UA (stable high-risk patients)?</b><br/>"
    "Unlike STEMI (where immediate reperfusion is critical), NSTE-ACS involves subtotal occlusion - "
    "myocardium is still viable and partly perfused. Immediate PCI (&lt;2h) in stable NSTEMI offers NO "
    "additional benefit over early (24h) PCI (TIMACS, ICTUS, VERDICT trials). Delay allows: "
    "(1) Risk stratification; (2) Dual antiplatelet loading; (3) Anticoagulation; "
    "(4) Optimal patient preparation; (5) Identification of high-risk anatomy on angiogram. "
    "Exception: Very high-risk features mandate immediate catheterisation.",
    bg=colors.HexColor("#EAF4FB"), border=MED_BLUE
), Spacer(1,0.3*cm)]

story += [PageBreak()]

# ══════════════════════════════════════════════════════
# CHAPTER 6: STEMI
# ══════════════════════════════════════════════════════
story += [chapter_banner("CHAPTER 6: ST-ELEVATION MYOCARDIAL INFARCTION (STEMI)",
                          color=ACCENT_RED), Spacer(1,0.3*cm)]

story += [section_box("6.1  Definition & Diagnostic Criteria"), Spacer(1,0.15*cm)]
story += [Paragraph(
    "<b>STEMI</b> is ACS characterised by: (1) Acute-onset ischaemic symptoms; "
    "(2) <b>Persistent (&gt;20 min) ST elevation</b> in ≥2 contiguous leads; "
    "(3) Elevated cardiac biomarkers (troponin).",
    body)]

story += [Paragraph("<b>ECG Criteria for STEMI (2025 ACC/AHA):</b>", sub_head)]
ecg_stemi = [
    ["Lead Group", "ST Elevation Threshold"],
    ["Men ≥40 y: V2-V3", "≥2 mm"],
    ["Men <40 y: V2-V3", "≥2.5 mm"],
    ["Women: V2-V3", "≥1.5 mm"],
    ["All leads except V2-V3 and aVR", "≥1 mm"],
    ["Right-sided leads (V3R, V4R)", "≥0.5 mm (0.5-1 mm is significant for RV MI)"],
    ["Posterior leads (V7-V9)", "≥0.5 mm (posterior MI - appears as ST depression V1-V3)"],
    ["New LBBB with Sgarbossa criteria", "Treat as STEMI equivalent"],
]
story += [drug_table(ecg_stemi[0], ecg_stemi[1:], [7*cm, 10.4*cm]), Spacer(1,0.2*cm)]

story += [section_box("6.2  Initial Management of STEMI"), Spacer(1,0.15*cm)]
story += [Paragraph(
    "<b>Immediate steps (first 10-30 minutes):</b>",
    bold_body)]
for s in [
    "12-lead ECG within 10 min of first medical contact (FMC)",
    "IV access, continuous ECG monitoring, pulse oximetry",
    "Aspirin 300 mg chewed (if not already on aspirin)",
    "P2Y12 inhibitor: Ticagrelor 180 mg or Prasugrel 60 mg (preferred for primary PCI) OR Clopidogrel 300-600 mg",
    "Anticoagulation: UFH 60-70 U/kg IV bolus (max 4000-5000 U) or Bivalirudin",
    "Morphine 2-4 mg IV (for pain - use cautiously; do not delay P2Y12 loading)",
    "GTN SL (if no hypotension, RV MI, or PDE5i use)",
    "Oxygen only if SpO2 <90%",
    "Immediate notification of catheterisation laboratory for primary PCI",
]:
    story.append(bullet(s))
story.append(Spacer(1,0.15*cm))

story += [section_box("6.3  Reperfusion Strategy Decision in STEMI"), Spacer(1,0.15*cm)]
story += [Paragraph(
    "<b>Primary PCI is the preferred reperfusion strategy</b> when it can be performed within "
    "<b>120 minutes of FMC</b> (at PCI-capable centre) or within <b>90 minutes of FMC</b> "
    "(at non-PCI centre with immediate transfer). "
    "Reperfusion should be achieved within 12 hours of symptom onset.",
    body)]

reperfusion_flow = [
    ["Scenario", "Action", "Time Target"],
    ["PCI-capable centre", "Primary PCI", "FMC to wire crossing ≤60 min (door-to-balloon ≤60 min)"],
    ["Non-PCI centre: transfer feasible within 120 min", "Transfer for primary PCI", "FMC to wire crossing ≤90-120 min (including transfer time)"],
    ["Non-PCI centre: PCI NOT feasible within 120 min", "Fibrinolytic therapy (if no contraindications) THEN transfer", "Lysis within 30 min of FMC; transfer after for rescue/early PCI"],
    ["Fibrinolysis failed (rescue PCI)", "Emergency PCI", "Within 3-24h of failed fibrinolysis"],
    ["Fibrinolysis successful", "Pharmacoinvasive strategy (early PCI)", "Routine coronary angiography at 2-24h post-fibrinolysis"],
    ["Symptom onset 12-48h (late presenters)", "PCI if ongoing ischaemia; conservative if stable", "Angiography within 24h if ongoing symptoms or large territory"],
    [">48h, haemodynamically stable, no ongoing ischaemia", "Medical management; elective angiography", "Not emergency; within days"],
]
story += [drug_table(reperfusion_flow[0], reperfusion_flow[1:], [4*cm, 5.5*cm, 7.9*cm]), Spacer(1,0.3*cm)]

story += [section_box("6.4  Primary PCI - Procedural Recommendations"), Spacer(1,0.15*cm)]
story += [Paragraph("<b>Key procedural recommendations (2025 ACC/AHA / 2024 ESC):</b>", bold_body)]
for p in [
    "<b>Radial access preferred</b> over femoral (lower bleeding risk, Class I)",
    "<b>Drug-eluting stent (DES)</b> over bare metal stent (BMS) - lower restenosis rate",
    "<b>Culprit-only PCI initially</b> in cardiogenic shock (CULPRIT-SHOCK trial); however, staged complete revascularisation for haemodynamically stable multivessel STEMI is now recommended (COMPLETE trial)",
    "<b>No routine thrombus aspiration</b> (TASTE, TOTAL trials - increased stroke risk)",
    "<b>Intracoronary imaging (OCT/IVUS)</b> to guide PCI in complex lesions (Class IIa)",
    "Glycoprotein IIb/IIIa inhibitors: NOT routinely recommended; may use as bailout in large thrombus burden or no-reflow (Class IIb)",
]:
    story.append(bullet(p))
story.append(Spacer(1,0.2*cm))

story += [section_box("6.5  Long-term Management Post-STEMI"), Spacer(1,0.15*cm)]
long_term = [
    ["Therapy", "Duration / Target", "Class"],
    ["Aspirin", "Indefinite (75-100 mg OD)", "Class I"],
    ["P2Y12 inhibitor (Ticagrelor/Prasugrel)", "12 months post-ACS (with aspirin = DAPT)", "Class I"],
    ["High-intensity statin", "Indefinite; LDL <1.4 mmol/L AND ≥50% reduction", "Class I"],
    ["Beta-blocker", "Indefinitely if EF <40%; ≥1 year if normal EF", "Class I (if EF reduced)"],
    ["ACE inhibitor / ARB", "Indefinitely if EF <40%, DM, HTN, CKD", "Class I"],
    ["Eplerenone / MRA", "If EF <40% + HF or DM; start within 3-7 days", "Class I"],
    ["Cardiac rehabilitation", "Enrol all post-MI patients", "Class I"],
    ["Implantable Cardioverter Defibrillator (ICD)", "If EF <35% persisting ≥3 months despite OMT", "Class I"],
]
story += [drug_table(long_term[0], long_term[1:], [4.5*cm, 6*cm, 2*cm]), Spacer(1,0.3*cm)]

story += [PageBreak()]

# ══════════════════════════════════════════════════════
# CHAPTER 7: THROMBOLYSIS (FIBRINOLYTIC THERAPY)
# ══════════════════════════════════════════════════════
story += [chapter_banner("CHAPTER 7: THROMBOLYSIS (FIBRINOLYTIC THERAPY) IN STEMI",
                          color=colors.HexColor("#4A0072")), Spacer(1,0.3*cm)]

story += [section_box("7.1  Indications for Fibrinolytic Therapy"), Spacer(1,0.15*cm)]
story += [Paragraph(
    "Fibrinolytic therapy is indicated when <b>primary PCI cannot be delivered within 120 minutes "
    "of first medical contact</b>. It is the reperfusion strategy of choice in settings where PCI is "
    "unavailable or transfer time is excessive.",
    body)]
lysis_ind = [
    "STEMI with symptom onset ≤12 hours AND PCI not available within 120 min of FMC [Class I]",
    "STEMI with persistent ST elevation ≥2mm in ≥2 contiguous chest leads OR ≥1mm in 2 limb leads",
    "New LBBB with Sgarbossa criteria positive, when PCI not available",
    "True posterior MI (ST depression in V1-V3) when PCI unavailable",
    "Pre-hospital fibrinolysis: administer if expected transport time to PCI centre >60-90 min",
]
for i in lysis_ind:
    story.append(bullet(i))
story.append(Spacer(1,0.15*cm))

story += [highlight_box(
    "<b>IMPORTANT:</b> Fibrinolysis is NOT indicated in: (1) NSTEMI or UA (ST depression only); "
    "(2) Symptom onset >12 hours unless ongoing ischaemia evidence; (3) When PCI is available "
    "within 120 min. Fibrinolysis in ST-depression-only STEMI may INCREASE mortality.",
    bg=colors.HexColor("#FDEDEC"), border=ACCENT_RED, style=warn_style
), Spacer(1,0.2*cm)]

story += [section_box("7.2  Fibrinolytic Agents - Dosage"), Spacer(1,0.15*cm)]
lysis_agents = [
    ["Agent", "Dose", "Administration", "Notes"],
    ["Alteplase (t-PA)\n[PREFERRED]", "≤67 kg: 15 mg IV bolus, then 0.75 mg/kg over 30 min (max 50 mg), then 0.5 mg/kg over 60 min (max 35 mg)\n>67 kg: 15 mg bolus, 50 mg/30 min, 35 mg/60 min\nTotal max: 100 mg", "IV infusion; weight-based", "Fibrin-specific; most widely used; shorter half-life"],
    ["Tenecteplase (TNK-tPA)\n[PREFERRED - convenient]", "Weight-based single IV bolus:\n<60 kg: 30 mg\n60-69 kg: 35 mg\n70-79 kg: 40 mg\n80-89 kg: 45 mg\n≥90 kg: 50 mg\nElderly ≥75y: HALF dose (ESC 2024 Class I)", "Single IV bolus over 5-10 seconds", "Fibrin-specific; convenient; equivalent to alteplase; HALF dose in ≥75y reduces ICH risk"],
    ["Reteplase (r-PA)", "10 U IV bolus + 10 U 30 min later (double bolus)", "Two IV boluses", "Fibrin-specific; requires two doses"],
    ["Streptokinase (SK)", "1.5 million units IV over 60 minutes", "IV infusion", "Non-fibrin-specific; older agent; antigenic (cannot use if prior SK within 5 days - 12 months); avoid repeat use; lower cost"],
]
story += [drug_table(lysis_agents[0], lysis_agents[1:], [3.5*cm, 5.5*cm, 3*cm, 5.4*cm]), Spacer(1,0.2*cm)]

story += [section_box("7.3  Adjunctive Anticoagulation with Fibrinolysis"), Spacer(1,0.15*cm)]
story += [Paragraph(
    "All patients receiving fibrinolytic therapy MUST receive concurrent anticoagulation:",
    body)]
adj_anti = [
    ["Agent", "Regimen"],
    ["Enoxaparin (PREFERRED)", "Age <75y: 30 mg IV bolus + 1 mg/kg SC q12h for ≤8 days or until revascularisation\nAge ≥75y: NO IV bolus; 0.75 mg/kg SC q12h (max 75 mg/dose); eGFR<30: 1 mg/kg SC OD only"],
    ["Unfractionated Heparin (UFH)", "60 U/kg IV bolus (max 4000 U) then 12 U/kg/h infusion; adjust to aPTT 50-70s"],
    ["Fondaparinux", "2.5 mg IV bolus THEN 2.5 mg SC OD for up to 8 days (eGFR >20)"],
]
story += [drug_table(adj_anti[0], adj_anti[1:], [4.5*cm, 12.9*cm]), Spacer(1,0.2*cm)]

story += [section_box("7.4  Contraindications to Fibrinolytic Therapy"), Spacer(1,0.15*cm)]

abs_ci = Table(
    [[Paragraph("ABSOLUTE CONTRAINDICATIONS", ParagraphStyle("AbsCI", parent=table_hdr, fontSize=11)),
      Paragraph("RELATIVE CONTRAINDICATIONS", ParagraphStyle("RelCI", parent=table_hdr, fontSize=11))]],
    colWidths=[8.5*cm, 8.9*cm]
)
abs_ci.setStyle(TableStyle([
    ("BACKGROUND", (0,0), (0,0), ACCENT_RED),
    ("BACKGROUND", (1,0), (1,0), ACCENT_ORG),
    ("TEXTCOLOR",  (0,0), (-1,-1), WHITE),
    ("TOPPADDING", (0,0), (-1,-1), 8),
    ("BOTTOMPADDING", (0,0), (-1,-1), 8),
    ("LEFTPADDING", (0,0), (-1,-1), 8),
]))
story += [abs_ci]

abs_list = [
    "Any prior intracranial haemorrhage (ICH) - lifetime",
    "Ischaemic stroke within 3 months",
    "Known intracranial neoplasm, AVM, or aneurysm",
    "Significant closed head trauma or facial trauma within 3 months",
    "Suspected aortic dissection",
    "Active bleeding or bleeding diathesis (excluding menses)",
    "Significant closed head/facial trauma within 3 months",
    "Intracranial or intraspinal surgery within 2 months",
    "Severe uncontrolled hypertension (SBP >180 mmHg / DBP >110 mmHg) - unresponsive to emergency therapy",
]
rel_list = [
    "History of chronic, severe, poorly controlled HTN",
    "SBP >150-180 mmHg on presentation (controllable)",
    "Ischaemic stroke >3 months ago; dementia; known intracranial pathology",
    "Traumatic or prolonged (>10 min) CPR or major surgery within 3 weeks",
    "Recent internal bleeding within 2-4 weeks",
    "Non-compressible vascular puncture",
    "Pregnancy",
    "Active peptic ulcer disease",
    "Oral anticoagulant therapy (current use - INR >2)",
    "Streptokinase: prior use 5 days to 2 years ago (antigenic)",
    "Advanced liver disease",
]
max_len = max(len(abs_list), len(rel_list))
abs_list += [""] * (max_len - len(abs_list))
rel_list += [""] * (max_len - len(rel_list))

ci_data = [[Paragraph("\u2022 " + a if a else "", table_cell),
            Paragraph("\u2022 " + r if r else "", table_cell)]
           for a, r in zip(abs_list, rel_list)]
ci_table = Table(ci_data, colWidths=[8.5*cm, 8.9*cm])
ci_table.setStyle(TableStyle([
    ("ROWBACKGROUNDS", (0,0), (-1,-1), [WHITE, colors.HexColor("#FFF5F5")]),
    ("GRID", (0,0), (-1,-1), 0.3, MID_GREY),
    ("TOPPADDING", (0,0), (-1,-1), 4),
    ("BOTTOMPADDING", (0,0), (-1,-1), 4),
    ("LEFTPADDING", (0,0), (-1,-1), 8),
    ("VALIGN", (0,0), (-1,-1), "TOP"),
]))
story += [ci_table, Spacer(1,0.2*cm)]

story += [section_box("7.5  Definitive Findings Confirming Successful Fibrinolysis"), Spacer(1,0.15*cm)]
story += [Paragraph(
    "<b>Signs of successful reperfusion (within 90-120 min of fibrinolytic administration):</b>",
    bold_body)]
success_lysis = [
    "<b>ST resolution ≥50%</b> in the lead with maximum initial ST elevation (most important criterion)",
    "<b>Resolution of chest pain</b> (relief of ischaemic symptoms)",
    "<b>Reperfusion arrhythmias:</b> Accelerated idioventricular rhythm (AIVR) - considered a marker of successful reperfusion; idioventricular rhythm at 60-100 bpm",
    "<b>Early peak of CK-MB</b> (washout phenomenon): peaks within 12-14h (instead of 18-24h) due to reperfusion of necrotic zone",
    "<b>Troponin early peak:</b> Rapid rise and early peaking of troponin within 12h indicates reperfusion",
]
for s in success_lysis:
    story.append(bullet(s))
story.append(Spacer(1,0.15*cm))

story += [highlight_box(
    "<b>Failed Fibrinolysis (Rescue PCI):</b> Defined as <50% ST resolution at 60-90 minutes. "
    "Immediate transfer for <b>rescue PCI is mandatory</b> (Class I, 2025 ACC/AHA). "
    "Do NOT repeat fibrinolysis (no benefit, increased bleeding risk).",
    bg=colors.HexColor("#FDEDEC"), border=ACCENT_RED, style=warn_style
), Spacer(1,0.2*cm)]

story += [section_box("7.6  Pharmacoinvasive Strategy (Post-Fibrinolysis PCI)"), Spacer(1,0.15*cm)]
pharma_inv = [
    ["Scenario", "Timing of PCI", "Recommendation"],
    ["Failed fibrinolysis (rescue PCI)", "IMMEDIATE (within 3-24h of lysis)", "Class I - mandatory; do not re-lyse"],
    ["Successful fibrinolysis + high-risk features (extensive ST elevation, anterior MI, EF<40%, HF, complex arrhythmia)", "Early: 2-24 hours", "Class I (2025 ACC/AHA, ESC 2023): routine early PCI after successful thrombolysis"],
    ["Successful fibrinolysis, stable, low-risk", "2-24 hours (pharmacoinvasive window)", "Class IIa: angiography with intent to PCI; preferred over conservative strategy"],
    ["Cardiogenic shock post-fibrinolysis", "Emergent regardless of time", "Class I: immediate angiography + PCI"],
]
story += [drug_table(pharma_inv[0], pharma_inv[1:], [4*cm, 3.5*cm, 9.9*cm]), Spacer(1,0.3*cm)]

story += [PageBreak()]

# ══════════════════════════════════════════════════════
# CHAPTER 8: PCI TIMING SUMMARY
# ══════════════════════════════════════════════════════
story += [chapter_banner("CHAPTER 8: PCI TIMING - COMPREHENSIVE SUMMARY",
                          color=colors.HexColor("#1A4A1A")), Spacer(1,0.3*cm)]

story += [section_box("8.1  When is Emergency/Immediate PCI Required?"), Spacer(1,0.15*cm)]
story += [Paragraph(
    "Emergency PCI (within 2h / as soon as possible) is required in:",
    bold_body)]
emerg_pci = [
    "<b>All STEMI within 12h of onset</b> - primary PCI preferred (Class I)",
    "<b>STEMI with cardiogenic shock</b> regardless of time since onset",
    "<b>STEMI 12-48h with ongoing ischaemia</b> or haemodynamic instability",
    "<b>NSTE-ACS with very high-risk features:</b> cardiogenic shock, refractory chest pain, life-threatening arrhythmia, acute HF, mechanical complications",
    "<b>Failed fibrinolysis</b> (rescue PCI) - any STEMI after failed lysis",
    "<b>Cardiac arrest with STEMI pattern on ECG</b> post-ROSC",
]
for e in emerg_pci:
    story.append(bullet(e))
story.append(Spacer(1,0.2*cm))

story += [section_box("8.2  When is Urgent PCI Required (Within 24h)?"), Spacer(1,0.15*cm)]
for p in [
    "High-risk NSTE-ACS: GRACE score >140, dynamic ECG changes, elevated troponin",
    "STEMI post-successful fibrinolysis (pharmacoinvasive strategy) - 2-24h window",
    "Post-ROSC after cardiac arrest without persistent STEMI but with ACS suspicion (within 24h)",
    "Recurrent ischaemia in NSTEMI/UA despite medical therapy",
]:
    story.append(bullet(p))
story.append(Spacer(1,0.2*cm))

story += [section_box("8.3  When is Delayed/Elective PCI Appropriate?"), Spacer(1,0.15*cm)]
story += [Paragraph(
    "<b>In Stable NSTEMI/UA (delayed PCI within 24-72h):</b>",
    bold_body)]
for d in [
    "Intermediate-risk NSTE-ACS without immediate high-risk features",
    "GRACE 109-140, mildly elevated troponin without dynamic ECG changes",
    "To allow DAPT loading and anticoagulation to take effect",
    "To permit risk stratification and optimal patient preparation",
    "ICTUS, TIMACS trials: early vs. delayed invasive strategy: similar outcomes in stable intermediate-risk NSTEMI",
]:
    story.append(bullet(d))
story.append(Spacer(1,0.1*cm))

story += [Paragraph(
    "<b>In Stable STEMI (late presenters, >48h, haemodynamically stable):</b>",
    bold_body)]
for d in [
    "STEMI >48h with NO ongoing ischaemia, stable haemodynamics: PCI may NOT improve outcomes (OAT trial)",
    "Elective angiography and staged PCI for residual disease",
    "Complete revascularisation of non-IRA can be staged within 19 days post-primary PCI (COMPLETE trial)",
]:
    story.append(bullet(d))
story.append(Spacer(1,0.2*cm))

story += [section_box("8.4  Complete Summary Table - PCI Timing by Presentation"), Spacer(1,0.15*cm)]
summary_tbl = [
    ["ACS Type", "Clinical State", "Timing", "Strategy"],
    ["STEMI", "All + PCI available <120 min", "IMMEDIATE (<60-90 min FMC-to-wire)", "Primary PCI"],
    ["STEMI", "PCI NOT available <120 min", "Lysis within 30 min FMC\nThen transfer", "Fibrinolysis then pharmacoinvasive PCI"],
    ["STEMI", "Post-failed fibrinolysis", "IMMEDIATE rescue PCI", "Rescue PCI"],
    ["STEMI", "Post-successful lysis", "2-24 hours", "Early PCI (pharmacoinvasive)"],
    ["STEMI", "Late presenter >48h, stable", "Elective (days)", "Medical first; staged PCI"],
    ["NSTEMI/UA", "Very high risk (shock, refractory pain, arrhythmia)", "IMMEDIATE (<2h)", "Emergency PCI"],
    ["NSTEMI/UA", "High risk (GRACE >140, dynamic ECG, +troponin)", "EARLY (<24h)", "Early invasive PCI"],
    ["NSTEMI/UA", "Intermediate risk (GRACE 109-140)", "Within 24-72h", "Invasive PCI (delayed)"],
    ["NSTEMI/UA", "Low risk (GRACE <109, -ve troponin, no ECG changes)", "Elective or conservative", "Functional testing then selective PCI"],
    ["Stable Angina", "Refractory symptoms despite OMT; high-risk anatomy", "Elective (days-weeks)", "Elective PCI or CABG"],
]
story += [drug_table(summary_tbl[0], summary_tbl[1:], [2.5*cm, 4.5*cm, 4.5*cm, 5.9*cm]), Spacer(1,0.3*cm)]

story += [PageBreak()]

# ══════════════════════════════════════════════════════
# CHAPTER 9: TREATMENT & PREVENTION
# ══════════════════════════════════════════════════════
story += [chapter_banner("CHAPTER 9: TREATMENT & PREVENTION",
                          color=colors.HexColor("#005073")), Spacer(1,0.3*cm)]

story += [section_box("9.1  In-Hospital Complications of MI & Treatment"), Spacer(1,0.15*cm)]
complications = [
    ["Complication", "Timing", "Management"],
    ["Cardiogenic Shock", "Early (within hours)", "Urgent revascularisation (PCI/CABG); inotropes (dobutamine, noradrenaline); IABP/Impella; consider ECMO in refractory cases"],
    ["Ventricular Fibrillation (VF)", "First 24-48h; primary VF", "Immediate defibrillation; amiodarone 150-300 mg IV; beta-blocker; K+/Mg2+ correction"],
    ["Ventricular Tachycardia (VT)", "First few days", "Sustained VT: cardioversion; Amiodarone; treat ischaemia; later ICD assessment"],
    ["AV Block / Bradycardia (inferior MI)", "Days 1-3", "Atropine; temporary pacing if Mobitz II or complete heart block; usually transient"],
    ["Acute Mitral Regurgitation (papillary muscle rupture)", "Days 3-7 (peak)", "Emergency surgical repair; vasodilators; IABP to stabilise"],
    ["Ventricular Septal Defect (VSD)", "Days 3-7 (peak)", "Emergency surgical repair or transcatheter closure; temporise with IABP"],
    ["Free Wall Rupture", "Days 3-7 (peak)", "Emergency surgical repair; pericardiocentesis if tamponade"],
    ["Pericarditis (Dressler syndrome)", "Weeks 2-10", "NSAIDs; Colchicine; Aspirin; avoid anticoagulation if possible"],
    ["Left Ventricular Aneurysm", "Weeks-months", "ACEi; anticoagulation if thrombus; surgical resection in refractory HF"],
    ["Mural Thrombus", "Days 3-10", "Anticoagulation (LMWH/VKA) for 3-6 months"],
]
story += [drug_table(complications[0], complications[1:], [3.5*cm, 2.5*cm, 11.4*cm]), Spacer(1,0.2*cm)]

story += [section_box("9.2  Primary & Secondary Prevention"), Spacer(1,0.15*cm)]
story += [Paragraph("<b>Lifestyle Modification (all patients):</b>", sub_head)]
for lm in [
    "Smoking cessation: most important modifiable risk factor; reduces MI risk by 50% within 1 year",
    "Regular aerobic exercise: 150 min/week moderate intensity or 75 min/week vigorous",
    "Mediterranean or DASH diet: high in vegetables, fruits, whole grains, olive oil; low in saturated fats",
    "Weight management: target BMI 20-25 kg/m²; waist circumference <94 cm (men), <80 cm (women)",
    "BP control: target <130/80 mmHg for high-risk patients (ACC/AHA 2025)",
    "HbA1c target: <7% in most diabetics; individualised approach",
    "Alcohol moderation: ≤14 units/week (no safe level for cardiovascular benefit per 2024 ESC)",
]:
    story.append(bullet(lm))
story.append(Spacer(1,0.15*cm))

story += [Paragraph("<b>Pharmacological Secondary Prevention (post-MI - all patients):</b>", sub_head)]
for drug in [
    "Aspirin 75-100 mg OD indefinitely",
    "P2Y12 inhibitor (DAPT) for 12 months post-ACS (Ticagrelor 90 mg BD or Prasugrel 10 mg OD; Clopidogrel if intolerant)",
    "High-intensity statin: LDL <1.4 mmol/L with ≥50% reduction from baseline",
    "Beta-blocker: minimum 1 year post-MI; indefinitely if EF <40%",
    "ACE inhibitor / ARB: indefinitely if EF <40%, DM, HTN",
    "Eplerenone (MRA): if EF <35% + HF symptoms or DM - start within 7 days",
    "SGLT2 inhibitor: empagliflozin/dapagliflozin - reduce HF hospitalisations and CV death in post-MI with or without DM",
    "GLP-1 agonist: semaglutide - CV benefit in obese patients with CAD (SELECT trial 2023)",
    "Influenza vaccination annually (Class I - reduces major adverse CV events)",
    "Cardiac rehabilitation: structured exercise + psychological support + education",
]:
    story.append(bullet(drug))
story.append(Spacer(1,0.2*cm)]

story += [highlight_box(
    "<b>2025 ACC/AHA Key Updates:</b> (1) DAPT for 12 months in ACS (Class I); de-escalation "
    "acceptable after 3-6 months in low-ischaemic-risk patients (Class IIa). "
    "(2) Complete revascularisation in STEMI with multivessel disease (Class I). "
    "(3) Radial access preferred (Class I). (4) SGLT2 inhibitors in all ACS patients with or "
    "without DM for HF prevention (Class I). (5) Half-dose TNK in patients ≥75 years.",
    bg=LIGHT_BLUE, border=DARK_BLUE
), Spacer(1,0.3*cm)]

story += [PageBreak()]

# ══════════════════════════════════════════════════════
# CHAPTER 10: RELEVANT IMAGES DESCRIPTION
# ══════════════════════════════════════════════════════
story += [chapter_banner("CHAPTER 10: KEY CLINICAL IMAGES & DIAGRAMS",
                          color=colors.HexColor("#2C3E50")), Spacer(1,0.3*cm)]

story += [Paragraph(
    "The following describes essential imaging findings and diagrams in IHD/ACS:",
    body)]

img_desc = [
    ["Image / Diagram", "Key Features"],
    ["ECG - STEMI (anterior)",
     "ST elevation in V1-V4 (LAD territory); reciprocal ST depression in inferior leads (II, III, aVF); evolves: ST elevation → T-wave inversion → Q waves"],
    ["ECG - Inferior STEMI",
     "ST elevation in II, III, aVF (RCA territory); reciprocal changes in I, aVL; check V3R/V4R for right ventricular involvement"],
    ["ECG - NSTEMI/UA",
     "ST depression (horizontal/downsloping) in affected leads; T-wave inversion; no persistent ST elevation; normal ECG possible"],
    ["Coronary Angiogram - STEMI",
     "TIMI 0 flow (total occlusion) in culprit artery; 'cut-off' sign; thrombus; contrast stasis"],
    ["Echocardiogram - Acute MI",
     "Regional wall motion abnormality (RWMA) - hypokinesis/akinesis in territory of infarcted artery; reduced EF in large MI; wall thinning with aneurysm formation later"],
    ["Histology - Early MI (0-24h)",
     "Coagulative necrosis; 'ghost cells' (preserved cell outline, lost nuclei); wavy fibres; contraction band necrosis at reperfusion"],
    ["Histology - Late MI (1-3 weeks)",
     "Granulation tissue; macrophages; fibroblasts; new capillaries; collagen deposition beginning"],
    ["Coronary Artery Atherosclerosis",
     "Intimal thickening; lipid-laden foam cells; fibrous cap; necrotic lipid core; calcification; intraplaque haemorrhage in vulnerable plaques"],
    ["Distribution of MI (Cardiac Anatomy)",
     "Anterior wall/septum: LAD territory; Inferior wall: RCA territory; Lateral wall: LCx territory; Posterior wall: RCA/LCx; RV: RCA"],
    ["Killip Classification (HF post-MI)",
     "Class I: no HF; Class II: rales <50% lung fields, S3; Class III: pulmonary oedema (rales >50%); Class IV: cardiogenic shock (BP<90, oliguria, cool extremities)"],
]
story += [drug_table(img_desc[0], img_desc[1:], [5*cm, 12.4*cm]), Spacer(1,0.3*cm)]

story += [section_box("10.1  Killip Classification & Haemodynamic Status"), Spacer(1,0.15*cm)]
killip = [
    ["Killip Class", "Clinical Features", "Approximate 30-day Mortality"],
    ["Class I", "No HF; no rales, no S3", "~5%"],
    ["Class II", "Mild-moderate HF; rales <50% lung fields; S3; elevated JVP", "~10%"],
    ["Class III", "Severe HF; pulmonary oedema; rales >50% lung fields", "~20%"],
    ["Class IV", "Cardiogenic shock: SBP <90 mmHg, oliguria, peripheral cyanosis, confusion", "~50%"],
]
story += [drug_table(killip[0], killip[1:], [2.5*cm, 9*cm, 5.9*cm]), Spacer(1,0.3*cm)]

# ── FINAL PAGE: QUICK REFERENCE CARD ──
story += [PageBreak()]
story += [chapter_banner("QUICK REFERENCE: REPERFUSION DECISION TREE",
                          color=colors.HexColor("#2C3E50")), Spacer(1,0.2*cm)]

decision_tree_text = """
<b>STEMI REPERFUSION ALGORITHM (2025 ACC/AHA / 2024 ESC)</b>

1. STEMI diagnosed (persistent ST elevation >20 min)
   |
   +---> PCI available AND FMC-to-wire <120 min?
   |       YES ---> PRIMARY PCI (preferred; door-to-balloon ≤60-90 min)
   |
   +---> PCI NOT available within 120 min?
           YES ---> FIBRINOLYSIS within 30 min of FMC
                     |
                     +---> 60-90 min: assess reperfusion
                     |     ST resolved ≥50%? Symptoms relieved? Reperfusion arrhythmia?
                     |
                     +---> YES (success) ---> Transfer for early PCI at 2-24h
                     |
                     +---> NO (failed) ---> IMMEDIATE rescue PCI

<b>NSTE-ACS INVASIVE STRATEGY ALGORITHM</b>

NSTE-ACS suspected → Serial troponins + ECG
   |
   +---> VERY HIGH RISK? (shock, refractory pain, VF/VT, acute HF, mechanical complication)
   |       YES ---> IMMEDIATE PCI (<2h)
   |
   +---> HIGH RISK? (GRACE>140, dynamic ECG, elevated troponin)
   |       YES ---> EARLY PCI (within 24h)
   |
   +---> INTERMEDIATE RISK? (GRACE 109-140, troponin mildly elevated)
   |       YES ---> PCI within 24-72h (delayed invasive)
   |
   +---> LOW RISK? (GRACE<109, troponin negative, no ECG changes)
           YES ---> Conservative strategy; functional testing; selective PCI if ischaemia confirmed
"""
story += [highlight_box(decision_tree_text, bg=PALE_GREY, border=DARK_BLUE), Spacer(1,0.3*cm)]

story += [Paragraph(
    "<b>Sources:</b> Braunwald's Heart Disease 2023 · Goldman-Cecil Medicine · Robbins &amp; Kumar "
    "Pathologic Basis of Disease · Rosen's Emergency Medicine · 2025 ACC/AHA/ACEP/NAEMSP/SCAI "
    "Guideline for ACS (Circulation 2025;151:e771-e862) · 2024 ESC Guidelines for Chronic Coronary "
    "Syndromes · 2023 ESC Guidelines for ACS · Australian ACS Guideline 2025",
    note_style
)]

# ─── BUILD ────────────────────────────────────────────────────────────────────
print("Building PDF…")
doc.build(story)
print(f"Done: {OUTPUT_PATH}")
Running Command

cd /home/daytona/workspace/acs-angina-pdf && python3 generate_pdf.py 2>&1

Editing File

~/acs-angina-pdf/generate_pdf.py

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/acs-angina-pdf/generate_pdf.py'
Running Command

cd /home/daytona/workspace/acs-angina-pdf && python3 generate_pdf.py 2>&1

Editing File

~/acs-angina-pdf/generate_pdf.py

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/acs-angina-pdf/generate_pdf.py'
Running Command

cd /home/daytona/workspace/acs-angina-pdf && python3 generate_pdf.py 2>&1

Your comprehensive PDF is ready:

IHD ACS Angina Guidelines

PDF Document · PDF


Here is what is covered inside, chapter by chapter in chronological order:
Chapter 1 - Definitions & Classification
  • Universal definition of MI (Types 1-5)
  • ACS spectrum table (UA vs. NSTEMI vs. STEMI - troponin, ECG, mechanism)
  • CCS angina grading (Grade I-IV)
Chapter 2 - Etiology & Risk Factors
  • Atherosclerosis as primary cause; rarer causes (SCAD, vasospasm, embolism, Kawasaki)
  • Non-modifiable vs. modifiable risk factor table
  • INTERHEART study note; post-menopausal HRT caveat
Chapter 3 - Pathophysiology
  • Plaque formation, vulnerability, rupture sequence
  • Thrombus formation step-by-step (adhesion → activation → aggregation → coagulation)
  • Zones of injury (necrosis, injury, ischaemia)
  • Temporal morphology of MI (0h to months)
  • Transmural vs. subendocardial infarction
  • Coronary artery distribution of infarcts (LAD 40-50%, RCA 30-40%, LCx 15-20%)
Chapter 4 - Chronic Stable Angina (2024 ESC Guidelines)
  • Investigations including CTCA (Class I), FFR/iFR
  • Anti-ischaemic drugs (nitrates, beta-blockers, CCBs, ivabradine, ranolazine, trimetazidine) with doses
  • Risk reduction drugs (aspirin, statins with LDL targets, ACEi, SGLT2i, PCSK9 inhibitors)
  • PCI vs. CABG indications; DAPT duration post-PCI
Chapter 5 - UA & NSTEMI (2025 ACC/AHA)
  • GRACE/TIMI/HEART risk scores
  • Very high / high / intermediate / low risk criteria for PCI timing
  • Full drug management table (MONA + DAPT + anticoagulation with doses)
  • Why delayed PCI in stable NSTEMI (TIMACS, ICTUS, VERDICT trials explained)
Chapter 6 - STEMI (2025 ACC/AHA)
  • ECG criteria by lead/sex
  • Primary PCI protocol; complete revascularisation (COMPLETE trial)
  • Reperfusion decision table (all scenarios)
  • Long-term medications post-STEMI
Chapter 7 - Thrombolysis (Everything)
  • Indications and when NOT to use
  • Dosage table: Alteplase (weight-based), Tenecteplase (single-bolus, half-dose ≥75y), Reteplase, Streptokinase
  • Adjunctive anticoagulation (enoxaparin, UFH, fondaparinux with age-adjusted dosing)
  • Absolute vs. relative contraindications (side-by-side table)
  • Definitive findings of successful reperfusion (ST resolution ≥50%, AIVR, early troponin peak)
  • Pharmacoinvasive strategy (rescue PCI, early PCI 2-24h)
Chapter 8 - PCI Timing Summary
  • Emergency, urgent, and delayed PCI decision table
  • Complete summary table covering all ACS types
Chapter 9 - Treatment & Prevention
  • In-hospital complications (cardiogenic shock, arrhythmias, rupture, VSD, Dressler) with management
  • Lifestyle modification targets
  • Secondary prevention medications (including SGLT2i, GLP-1 agonists, ICD criteria)
  • 2025 ACC/AHA key update highlights
Chapter 10 - Key Images & Quick Reference
  • ECG findings for STEMI/NSTEMI/UA described
  • Killip classification table with mortality
  • Full reperfusion decision tree algorithm

downloading is troubleshoot make it downloaded

Running Command

ls -lh /home/daytona/workspace/acs-angina-pdf/IHD_ACS_Angina_Guidelines.pdf 2>&1…

Running Command

cp /home/daytona/workspace/acs-angina-pdf/IHD_ACS_Angina_Guidelines.pdf /home/da…

Running Command

ls -lh /home/daytona/workspace/IHD_ACS_Angina_Guidelines.pdf 2>&1

The file is copied to the root workspace folder with open permissions (rw-rw-rw-). Try this direct link:

IHD ACS Angina Guidelines

PDF Document · PDF

The file is confirmed valid:
  • Size: 64 KB
  • Pages: 24
  • Format: PDF 1.4
  • Permissions: rw-rw-rw- (fully readable)
If the link still doesn't download, here are a few things to try:
  1. Right-click the link and select "Save link as..." or "Download linked file"
  2. If you're on mobile, long-press the link and choose download
  3. The file is at the exact path /home/daytona/workspace/IHD_ACS_Angina_Guidelines.pdf in the sandbox - if your interface has a file browser panel, you can navigate there directly

still unble download

Reading File
Running Command

ls /home/daytona/skills/docx/scripts/office/ 2>&1

Running Command

python3 -c "import docx; print('python-docx OK')" 2>&1 && python3 /home/daytona/…

Running Command

cd /home/daytona/workspace/acs-angina-pdf && python3 /home/daytona/skills/docx/s…

Running Command

# Try using node/docx to build the DOCX directly node --version 2>&1 && ls /home…

Writing File

~/acs-angina-pdf/build_docx.mjs

import {
  Document, Packer, Paragraph, TextRun, Table, TableRow, TableCell,
  HeadingLevel, AlignmentType, BorderStyle, WidthType, ShadingType,
  PageBreak, VerticalAlign, TableLayoutType
} from "docx";
import { writeFileSync } from "fs";

const OUT = "/home/daytona/workspace/IHD_ACS_Angina_Guidelines.docx";

// ─── COLOUR CONSTANTS ─────────────────────────────────────────────────────────
const DARK_BLUE  = "1A3A5C";
const MED_BLUE   = "2E6DA4";
const LIGHT_BLUE = "D6E8F7";
const RED        = "C0392B";
const ORANGE     = "E67E22";
const GREEN      = "1A5C3A";
const PURPLE     = "4A0072";
const TEAL       = "005073";
const DARK_GREY  = "2C3E50";
const PALE_GREY  = "F4F6F9";
const MID_GREY   = "BDC3C7";
const WHITE      = "FFFFFF";
const YELLOW_BG  = "FFF3CD";
const RED_BG     = "FDEDEC";
const BLUE_BG    = "EAF4FB";

// ─── HELPERS ──────────────────────────────────────────────────────────────────

function chapterBanner(text, color = DARK_BLUE) {
  return new Paragraph({
    children: [new TextRun({ text, bold: true, color: WHITE, size: 36 })],
    alignment: AlignmentType.LEFT,
    shading: { type: ShadingType.SOLID, color, fill: color },
    spacing: { before: 300, after: 200 },
    indent: { left: 200, right: 200 },
  });
}

function sectionHead(text) {
  return new Paragraph({
    children: [new TextRun({ text, bold: true, color: DARK_BLUE, size: 28 })],
    shading: { type: ShadingType.SOLID, color: LIGHT_BLUE, fill: LIGHT_BLUE },
    spacing: { before: 240, after: 120 },
    indent: { left: 100 },
  });
}

function subHead(text) {
  return new Paragraph({
    children: [new TextRun({ text, bold: true, color: MED_BLUE, size: 24 })],
    spacing: { before: 180, after: 80 },
  });
}

function body(text) {
  return new Paragraph({
    children: [new TextRun({ text, size: 20 })],
    alignment: AlignmentType.JUSTIFIED,
    spacing: { before: 60, after: 60 },
  });
}

function bodyBold(text) {
  return new Paragraph({
    children: [new TextRun({ text, bold: true, size: 20 })],
    spacing: { before: 80, after: 60 },
  });
}

function bullet(text, lvl = 0) {
  return new Paragraph({
    children: [new TextRun({ text: (lvl === 0 ? "• " : "◦ ") + text, size: 20 })],
    indent: { left: 400 + lvl * 360 },
    spacing: { before: 40, after: 40 },
  });
}

function note(text) {
  return new Paragraph({
    children: [new TextRun({ text, italics: true, color: "555500", size: 18 })],
    spacing: { before: 60, after: 60 },
  });
}

function warnBox(text) {
  return new Paragraph({
    children: [new TextRun({ text: "⚠ " + text, bold: true, color: RED, size: 20 })],
    shading: { type: ShadingType.SOLID, color: RED_BG, fill: RED_BG },
    spacing: { before: 120, after: 120 },
    indent: { left: 150, right: 150 },
    border: {
      top:    { style: BorderStyle.SINGLE, size: 12, color: RED },
      bottom: { style: BorderStyle.SINGLE, size: 12, color: RED },
      left:   { style: BorderStyle.SINGLE, size: 12, color: RED },
      right:  { style: BorderStyle.SINGLE, size: 12, color: RED },
    },
  });
}

function infoBox(text, bg = LIGHT_BLUE, border = MED_BLUE) {
  return new Paragraph({
    children: [new TextRun({ text, size: 20 })],
    shading: { type: ShadingType.SOLID, color: bg, fill: bg },
    spacing: { before: 120, after: 120 },
    indent: { left: 150, right: 150 },
    border: {
      top:    { style: BorderStyle.SINGLE, size: 12, color: border },
      bottom: { style: BorderStyle.SINGLE, size: 12, color: border },
      left:   { style: BorderStyle.THICK,  size: 24, color: border },
      right:  { style: BorderStyle.SINGLE, size: 12, color: border },
    },
  });
}

function pageBreak() {
  return new Paragraph({ children: [new PageBreak()] });
}

function spacer() {
  return new Paragraph({ children: [new TextRun({ text: "" })], spacing: { before: 100, after: 100 } });
}

// ─── TABLE HELPER ─────────────────────────────────────────────────────────────
function makeTable(headers, rows, widths) {
  const totalW = widths.reduce((a, b) => a + b, 0);
  const hRow = new TableRow({
    children: headers.map((h, i) => new TableCell({
      children: [new Paragraph({
        children: [new TextRun({ text: h, bold: true, color: WHITE, size: 19 })],
        alignment: AlignmentType.CENTER,
      })],
      shading: { type: ShadingType.SOLID, color: DARK_BLUE, fill: DARK_BLUE },
      width: { size: Math.round(widths[i] / totalW * 9000), type: WidthType.DXA },
      verticalAlign: VerticalAlign.CENTER,
    })),
  });

  const dataRows = rows.map((row, ri) => new TableRow({
    children: row.map((cell, ci) => new TableCell({
      children: [new Paragraph({
        children: [new TextRun({ text: String(cell), size: 18 })],
        spacing: { before: 40, after: 40 },
      })],
      shading: ri % 2 === 0
        ? { type: ShadingType.SOLID, color: WHITE, fill: WHITE }
        : { type: ShadingType.SOLID, color: PALE_GREY, fill: PALE_GREY },
      width: { size: Math.round(widths[ci] / totalW * 9000), type: WidthType.DXA },
      margins: { top: 60, bottom: 60, left: 80, right: 80 },
    })),
  }));

  return new Table({
    rows: [hRow, ...dataRows],
    width: { size: 9000, type: WidthType.DXA },
    layout: TableLayoutType.FIXED,
  });
}

// ─── COVER ────────────────────────────────────────────────────────────────────
function coverPage() {
  return [
    spacer(), spacer(), spacer(),
    new Paragraph({
      children: [new TextRun({ text: "ISCHEMIC HEART DISEASE", bold: true, color: WHITE, size: 56 })],
      alignment: AlignmentType.CENTER,
      shading: { type: ShadingType.SOLID, color: DARK_BLUE, fill: DARK_BLUE },
      spacing: { before: 200, after: 100 },
      indent: { left: 200, right: 200 },
    }),
    new Paragraph({
      children: [new TextRun({ text: "Acute Coronary Syndromes & Angina Management", italics: true, color: WHITE, size: 36 })],
      alignment: AlignmentType.CENTER,
      shading: { type: ShadingType.SOLID, color: MED_BLUE, fill: MED_BLUE },
      spacing: { before: 0, after: 0 },
      indent: { left: 200, right: 200 },
    }),
    new Paragraph({
      children: [new TextRun({ text: "A Comprehensive Clinical Reference", italics: true, color: WHITE, size: 28 })],
      alignment: AlignmentType.CENTER,
      shading: { type: ShadingType.SOLID, color: MED_BLUE, fill: MED_BLUE },
      spacing: { before: 0, after: 100 },
      indent: { left: 200, right: 200 },
    }),
    spacer(),
    new Paragraph({
      children: [new TextRun({ text: "Sources: Braunwald's Heart Disease · Goldman-Cecil Medicine · Robbins Pathology · Rosen's Emergency Medicine", size: 20, color: "333333" })],
      alignment: AlignmentType.CENTER,
      spacing: { before: 100, after: 60 },
    }),
    new Paragraph({
      children: [new TextRun({ text: "2025 ACC/AHA · 2024 ESC Guidelines | July 2026", size: 20, color: MED_BLUE, bold: true })],
      alignment: AlignmentType.CENTER,
      spacing: { before: 60, after: 200 },
    }),
    pageBreak(),
  ];
}

// ─── CHAPTER 1 ────────────────────────────────────────────────────────────────
function chapter1() {
  return [
    chapterBanner("CHAPTER 1: DEFINITIONS & CLASSIFICATION"),
    spacer(),
    sectionHead("1.1  Ischemic Heart Disease (IHD)"),
    body("Ischemic heart disease (IHD) encompasses all conditions in which the blood supply to the myocardium is insufficient relative to its demand — most commonly due to atherosclerotic coronary artery disease (CAD). IHD is the leading cause of death worldwide, responsible for approximately 400,000 deaths annually in the United States alone."),
    spacer(),
    sectionHead("1.2  Myocardial Infarction — Definition"),
    body("Myocardial infarction (MI) is the death (necrosis) of cardiac muscle due to prolonged, severe ischemia. The Fourth Universal Definition of MI (2018) defines MI as detection of a rise and/or fall of cardiac biomarkers (preferably high-sensitivity troponin) with at least one value above the 99th percentile upper reference limit (URL), together with evidence of myocardial ischemia (symptoms, ECG changes, or imaging)."),
    spacer(),
    sectionHead("1.3  Classification of MI — Universal Definition (Types 1–5)"),
    makeTable(
      ["Type", "Name", "Mechanism"],
      [
        ["Type 1", "Spontaneous MI", "Atherosclerotic plaque rupture/erosion → thrombus → coronary occlusion"],
        ["Type 2", "MI due to supply-demand mismatch", "Demand ischemia: tachyarrhythmia, severe hypertension, anaemia, hypotension, vasospasm; NO culprit plaque rupture"],
        ["Type 3", "MI resulting in death before biomarkers", "Sudden cardiac death; ECG/symptoms suggest MI; biomarkers unavailable"],
        ["Type 4a", "PCI-related MI", "Within 48h of PCI; troponin rise >5× URL"],
        ["Type 4b", "Stent thrombosis MI", "Confirmed by angiography or autopsy"],
        ["Type 4c", "In-stent restenosis MI", "At stent/balloon site with no other explanation"],
        ["Type 5", "CABG-related MI", "Troponin rise >10× URL within 48h of CABG"],
      ],
      [15, 35, 50]
    ),
    spacer(),
    sectionHead("1.4  ACS Spectrum — Classification"),
    makeTable(
      ["ACS Type", "Troponin", "ECG", "Mechanism"],
      [
        ["Unstable Angina (UA)", "NEGATIVE (normal)", "Transient ST depression / T-wave changes or normal", "Subtotal occlusion; NO myocyte death"],
        ["NSTEMI", "POSITIVE (elevated)", "ST depression, T-wave inversion; NO persistent ST elevation", "Subtotal occlusion or demand ischaemia; myocyte necrosis present"],
        ["STEMI", "POSITIVE (elevated)", "Persistent ST elevation ≥20 min; new LBBB (rare)", "Total thrombotic occlusion of epicardial coronary artery"],
      ],
      [22, 18, 32, 28]
    ),
    spacer(),
    sectionHead("1.5  Angina Classification — CCS Grading"),
    makeTable(
      ["CCS Grade", "Description"],
      [
        ["Grade I", "Angina only with strenuous exertion; ordinary physical activity does NOT cause angina"],
        ["Grade II", "Slight limitation; angina on walking >2 blocks on level or climbing >1 flight of stairs"],
        ["Grade III", "Marked limitation; angina on walking 1–2 blocks or climbing 1 flight of stairs"],
        ["Grade IV", "Inability to perform any physical activity without discomfort; angina may occur at rest"],
      ],
      [20, 80]
    ),
    pageBreak(),
  ];
}

// ─── CHAPTER 2 ────────────────────────────────────────────────────────────────
function chapter2() {
  return [
    chapterBanner("CHAPTER 2: ETIOLOGY & RISK FACTORS"),
    spacer(),
    sectionHead("2.1  Etiology"),
    body("The overwhelming majority of IHD and MI is caused by atherosclerosis of the epicardial coronary arteries. Less common etiologies include:"),
    bullet("Coronary vasospasm (Prinzmetal / variant angina) — cocaine, ergotamine, chemotherapy agents"),
    bullet("Spontaneous coronary artery dissection (SCAD) — young women, peripartum period"),
    bullet("Coronary artery embolism — infective endocarditis, atrial fibrillation, prosthetic valves"),
    bullet("Coronary arteritis — Kawasaki disease, Takayasu arteritis, SLE"),
    bullet("Severe anaemia, hypotension, tachyarrhythmia (Type 2 MI — supply-demand mismatch)"),
    bullet("Congenital coronary anomalies"),
    bullet("Hypertrophic cardiomyopathy (dynamic outflow obstruction + supply-demand mismatch)"),
    spacer(),
    sectionHead("2.2  Risk Factors"),
    makeTable(
      ["NON-MODIFIABLE RISK FACTORS", "MODIFIABLE RISK FACTORS"],
      [
        [
          "Age (men >45y, women >55y)\nMale sex (before menopause)\nFamily history of premature CAD (1st degree relative: men <55y, women <65y)\nGenetics / ethnicity\nPost-menopausal state",
          "Hypertension\nDyslipidaemia (high LDL, low HDL, high TG)\nDiabetes mellitus / insulin resistance\nSmoking / tobacco use\nObesity (BMI >30 kg/m²)\nPhysical inactivity\nChronic kidney disease\nChronic inflammatory disorders (RA, SLE, psoriasis)\nSleep apnoea\nHigh-sensitivity CRP elevation\nPsychosocial stress / depression\nCocaine use\nOral contraceptive pills (combined)\nHyperhomocysteinaemia"
        ]
      ],
      [45, 55]
    ),
    spacer(),
    infoBox("KEY NOTE: Post-menopausal women lose the cardioprotective effect of oestrogen. Hormone replacement therapy has NOT been shown to be protective and may increase thrombotic risk. The INTERHEART study showed 9 modifiable risk factors account for >90% of MI risk worldwide.", YELLOW_BG, ORANGE),
    pageBreak(),
  ];
}

// ─── CHAPTER 3 ────────────────────────────────────────────────────────────────
function chapter3() {
  return [
    chapterBanner("CHAPTER 3: PATHOPHYSIOLOGY"),
    spacer(),
    sectionHead("3.1  Atherosclerosis & Plaque Formation"),
    body("Atherosclerosis begins with endothelial injury/dysfunction, allowing low-density lipoprotein (LDL) to enter and accumulate in the subintima. Oxidised LDL triggers a chronic inflammatory response: monocytes differentiate into macrophages, engulf lipids to form foam cells, and secrete cytokines (TNF, IL-1, IFN-γ). Smooth muscle cells migrate and proliferate, secreting a collagen-rich extracellular matrix to form a fibrous cap over the lipid-rich necrotic core — constituting the atherosclerotic plaque."),
    spacer(),
    sectionHead("3.2  Plaque Vulnerability & Rupture"),
    body("A vulnerable (unstable) plaque is characterised by a large lipid core, thin fibrous cap (<65 µm), and a dense inflammatory infiltrate at the shoulder regions. Inflammatory cells secrete matrix metalloproteinases (MMPs) and cathepsins that degrade collagen and elastin, weakening the fibrous cap. Sites of low shear stress (vessel bifurcations) are particularly prone to plaque development and instability. Plaque rupture or erosion exposes the thrombogenic subendothelial matrix and lipid core to circulating blood."),
    spacer(),
    sectionHead("3.3  Thrombus Formation (Coronary Occlusion)"),
    body("Plaque rupture triggers the following sequence:"),
    bullet("Platelet adhesion: Exposed collagen and von Willebrand factor (vWF) bind platelet GPIb/IX/V receptors."),
    bullet("Platelet activation: Platelets change shape (discoid → stellate), release ADP, thromboxane A2, serotonin; upregulate GPIIb/IIIa receptors."),
    bullet("Platelet aggregation: Fibrinogen cross-links GPIIb/IIIa receptors on adjacent platelets → 'platelet plug'."),
    bullet("Coagulation cascade: Tissue factor exposed → thrombin generated → fibrinogen → fibrin → stabilises thrombus."),
    bullet("Coronary occlusion: Subtotal occlusion → UA/NSTEMI; Total occlusion → STEMI (absent collaterals)."),
    spacer(),
    sectionHead("3.4  Zones of Myocardial Injury"),
    makeTable(
      ["Zone", "Description", "Reversibility"],
      [
        ["Zone of Necrosis (infarct core)", "Central zone; ATP depleted within 20–40 min; irreversible cell death by coagulative necrosis", "IRREVERSIBLE"],
        ["Zone of Injury", "Intermediate zone; severe ischaemia; ST elevation on ECG", "May be reversible with timely reperfusion"],
        ["Zone of Ischaemia (penumbra)", "Outer zone; reduced perfusion; T-wave changes on ECG", "Recoverable with prompt reperfusion"],
      ],
      [30, 50, 20]
    ),
    spacer(),
    sectionHead("3.5  Temporal Morphology of MI"),
    makeTable(
      ["Time", "Gross Changes", "Microscopic Changes"],
      [
        ["0–6 hours", "None (normal appearance)", "Reversible: swelling, chromatin clumping; Early coagulative necrosis ~4h"],
        ["6–24 hours", "Pallor, oedema beginning", "Coagulative necrosis; neutrophil infiltration begins"],
        ["1–3 days", "Pale-yellow colour", "Karyolysis; peak neutrophil infiltration"],
        ["3–7 days", "Hyperaemic rim around yellow centre", "Macrophage infiltration; removal of necrotic debris"],
        ["1–3 weeks", "Pale grey-yellow, soft (risk of rupture)", "Granulation tissue; angiogenesis; collagen deposition begins"],
        ["Weeks–months", "Firm grey-white scar", "Dense fibrous scar; complete collagen replacement"],
      ],
      [18, 35, 47]
    ),
    spacer(),
    warnBox("Days 3–7 post-MI = HIGHEST RISK of myocardial free wall rupture, ventricular septal defect, or papillary muscle rupture due to maximal softening of necrotic tissue before adequate fibrosis."),
    spacer(),
    sectionHead("3.6  Transmural vs. Subendocardial Infarction"),
    body("TRANSMURAL (full-thickness) MI: Involves the entire wall thickness from endocardium to epicardium. Caused by total occlusion of a major epicardial coronary artery. Associated with STEMI (ST elevation) on ECG. Evolves to Q-wave MI."),
    body("SUBENDOCARDIAL (non-transmural) MI: Involves the inner one-third to half of the myocardium. Caused by prolonged hypotension, severe anaemia, or partial coronary occlusion. Typically non-Q-wave MI; associated with ST depression on ECG."),
    spacer(),
    sectionHead("3.7  Coronary Artery Distribution of Infarcts"),
    makeTable(
      ["Artery", "Frequency", "Territory Infarcted"],
      [
        ["Left Anterior Descending (LAD)", "40–50%", "Anterior LV wall near apex; anterior 2/3 of interventricular septum; LV apex (circumferentially)"],
        ["Right Coronary Artery (RCA)", "30–40%", "Inferior/posterior LV wall; posterior 1/3 of septum; RV free wall; SA/AV node (in dominant RCA)"],
        ["Left Circumflex (LCx)", "15–20%", "Lateral LV wall (excluding apex); posterior wall in dominant LCx system"],
      ],
      [28, 15, 57]
    ),
    pageBreak(),
  ];
}

// ─── CHAPTER 4 ────────────────────────────────────────────────────────────────
function chapter4() {
  const bannerColor = "1A5C3A";
  return [
    chapterBanner("CHAPTER 4: CHRONIC STABLE ANGINA (Chronic Coronary Syndrome)", bannerColor),
    spacer(),
    sectionHead("4.1  Definition & Diagnosis (2024 ESC Guidelines)"),
    body("Chronic Stable Angina (now termed Chronic Coronary Syndrome [CCS] by the 2024 ESC guidelines) is predictable chest pain or discomfort precipitated by exertion or stress and relieved within minutes by rest or sublingual nitrates. It results from a fixed atherosclerotic stenosis causing a supply-demand imbalance."),
    body("TYPICAL ANGINA: (1) Substernal chest discomfort with characteristic quality and duration; (2) Provoked by exertion or emotional stress; (3) Relieved by rest or nitroglycerin."),
    note("The 2024 ESC guidelines de-emphasise 'typical vs. atypical' terminology — terms like 'typical' and 'atypical' have limited prognostic value. Focus on detailed history of quality, location, duration, triggers, and relieving factors instead."),
    spacer(),
    sectionHead("4.2  Investigations"),
    makeTable(
      ["Investigation", "Finding / Purpose"],
      [
        ["Resting ECG", "ST changes, Q waves, LVH; may be normal in stable angina"],
        ["Exercise Treadmill Test (ETT)", "Horizontal or downsloping ST depression ≥1mm; assess functional capacity; Bruce protocol"],
        ["Echocardiography", "LV function, wall motion abnormalities, valve disease (baseline assessment)"],
        ["Stress Echo / Nuclear MPI", "Assess myocardial ischaemia and viability; better sensitivity than ETT alone"],
        ["CT Coronary Angiography (CTCA)", "FIRST-LINE non-invasive imaging (Class I, 2024 ESC); rules in/out obstructive CAD; calcium score"],
        ["Invasive Coronary Angiography", "Gold standard; required before revascularisation; assess anatomy and severity"],
        ["FFR / iFR", "Functional assessment of stenosis significance; FFR ≤0.80 = haemodynamically significant"],
        ["High-sensitivity Troponin", "Rule out ACS; elevated troponin excludes stable angina diagnosis"],
        ["CBC, lipid profile, HbA1c, TFTs", "Risk factor assessment; identify secondary causes"],
      ],
      [35, 65]
    ),
    spacer(),
    sectionHead("4.3  Medical Treatment of Chronic Stable Angina"),
    subHead("Anti-ischaemic / Symptom-relief Therapy"),
    makeTable(
      ["Drug Class", "Agent (Dose)", "Notes"],
      [
        ["Short-acting Nitrates", "SL GTN 0.3–0.6 mg or spray", "Venodilation → preload reduction; immediate relief; first-line for acute episodes"],
        ["Beta-blockers [FIRST LINE]", "Metoprolol 25–200 mg BD; Bisoprolol 5–10 mg OD; Atenolol 50–100 mg OD", "Reduce HR & contractility → decrease O2 demand; preferred post-MI"],
        ["Calcium Channel Blockers", "Amlodipine 5–10 mg OD (DHP); Diltiazem 60–120 mg TDS; Verapamil 80–120 mg TDS", "DHP: vasodilation; Non-DHP: reduce HR + vasodilate; add to BB if not controlled"],
        ["Long-acting Nitrates", "Isosorbide mononitrate 20–40 mg BD (with 8h nitrate-free interval)", "Tolerance develops without nitrate-free interval; DO NOT use with PDE5 inhibitors"],
        ["Ivabradine", "5–7.5 mg BD", "If inhibitor; reduces HR only; use if BB contraindicated/intolerant"],
        ["Ranolazine", "500–1000 mg BD", "Late Na+ current inhibitor; reduces diastolic wall tension; add-on therapy"],
        ["Nicorandil", "10–20 mg BD", "KATP channel opener + nitrate effect; useful in refractory angina (ESC IIb)"],
        ["Trimetazidine", "35 mg BD (modified release)", "Metabolic agent; shifts cardiac metabolism from FA to glucose oxidation"],
      ],
      [28, 35, 37]
    ),
    spacer(),
    subHead("Cardiovascular Risk Reduction / Prevention Therapy"),
    makeTable(
      ["Drug", "Dose", "Target / Goal"],
      [
        ["Aspirin", "75–100 mg OD (indefinite)", "Class I — all CCS patients; antiplatelet"],
        ["High-intensity statin", "Atorvastatin 40–80 mg OD / Rosuvastatin 20–40 mg OD", "LDL <1.4 mmol/L (<55 mg/dL) AND ≥50% reduction from baseline (ESC 2024)"],
        ["ACE Inhibitor / ARB", "Ramipril 10 mg OD / Perindopril 10 mg OD", "Class I with HFrEF, DM, HTN, CKD; Class IIa in all CCS (ESC 2024)"],
        ["Beta-blocker", "Post-MI: Carvedilol, Metoprolol, Bisoprolol", "Class I post-MI with reduced EF; reduces sudden death"],
        ["Ezetimibe", "10 mg OD", "Add if LDL not at target on maximally tolerated statin"],
        ["PCSK9 inhibitors", "Evolocumab 140 mg every 2w / Alirocumab", "When LDL above target despite statin + ezetimibe (very high risk)"],
        ["SGLT2 inhibitor", "Empagliflozin / Dapagliflozin", "Class I in DM with CCS; reduce HF hospitalisations and CV death"],
      ],
      [28, 35, 37]
    ),
    spacer(),
    sectionHead("4.4  When is PCI Required in Stable Angina?"),
    body("Revascularisation Indications (2024 ESC / 2025 ACC/AHA):"),
    bullet("Refractory angina despite optimal medical therapy (OMT) [Class I]"),
    bullet("Haemodynamically significant stenosis (FFR ≤0.80 / iFR ≤0.89) with angina symptoms [Class I]"),
    bullet("Left main disease >50% stenosis [Class I for revascularisation]"),
    bullet("Proximal LAD stenosis >50% with objective ischaemia [Class I]"),
    bullet("Multivessel disease with large ischaemic burden (>10% of myocardium) [Class IIa]"),
    bullet("CCS patients with impaired LV function (EF <35%) with viable myocardium [Class IIa for CABG]"),
    spacer(),
    infoBox("CABG vs. PCI in Stable CAD: CABG preferred in: Left main disease, 3-vessel CAD with complex anatomy (SYNTAX >22), diabetes with multivessel CAD, impaired LV function. PCI preferred in: Single/two-vessel CAD, high surgical risk, patient preference. Both acceptable in 3-vessel CAD with SYNTAX ≤22.", LIGHT_BLUE, MED_BLUE),
    pageBreak(),
  ];
}

// ─── CHAPTER 5 ────────────────────────────────────────────────────────────────
function chapter5() {
  return [
    chapterBanner("CHAPTER 5: UNSTABLE ANGINA (UA) & NSTEMI", "7B2D00"),
    spacer(),
    sectionHead("5.1  Definitions"),
    body("UNSTABLE ANGINA (UA): ACS with chest pain at rest, new-onset severe angina, or crescendo angina (more frequent/prolonged/severe). TROPONIN NEGATIVE — no myocyte necrosis. ECG may show transient ST depression, T-wave changes, or be normal."),
    body("NSTEMI: ACS with TROPONIN POSITIVE (elevated above 99th percentile URL) WITHOUT persistent ST elevation (>20 min). ST depression, T-wave inversion, or subtle ECG changes may be present. Myocyte necrosis has occurred."),
    note("Both UA and NSTEMI are collectively termed NSTE-ACS. The distinction is made retrospectively after troponin results. Both share a common pathophysiology."),
    spacer(),
    sectionHead("5.2  Pathophysiology"),
    body("In most cases: plaque rupture/erosion → platelet aggregation → non-occlusive (subtotal) thrombus → reduced but not absent coronary flow → ischaemia ± infarction. If extensive collaterals exist, even total occlusion may present as NSTEMI rather than STEMI. Type 2 MI (supply-demand mismatch) accounts for a minority."),
    spacer(),
    sectionHead("5.3  Clinical Features & Diagnosis"),
    body("SYMPTOMS: Retrosternal pressure, squeezing, or heaviness; radiation to left arm/jaw/neck; diaphoresis, nausea, dyspnoea, syncope. Atypical presentations (indigestion, fatigue, epigastric pain) more common in women, elderly, and diabetics."),
    body("ECG: ST depression (horizontal or downsloping ≥0.5 mm) in ≥2 contiguous leads; T-wave inversion; new LBBB; or NORMAL ECG. NO persistent ST elevation."),
    body("BIOMARKERS: High-sensitivity troponin (hsTn) serial measurement. 0h/1h algorithm (ESC): if hsTn very low at 0h → rule out. If rise ≥5 pg/mL at 1h → rule in. 0h/2h and 0h/3h algorithms also validated."),
    spacer(),
    sectionHead("5.4  Risk Stratification"),
    makeTable(
      ["Risk Score", "Tool", "Key Variables"],
      [
        ["GRACE Score", "Recommended by ESC & 2025 ACC/AHA", "Age, HR, BP, creatinine, cardiac arrest, ST deviation, troponin, Killip class"],
        ["TIMI Score (0–7)", "Widely used", "Age ≥65, ≥3 CAD risk factors, prior CAD, ST deviation, ≥2 angina events, aspirin use, elevated markers"],
        ["HEART Score", "ED-based tool", "History, ECG, Age, Risk factors, Troponin; ≤3 low risk; ≥7 high risk"],
      ],
      [20, 30, 50]
    ),
    spacer(),
    bodyBold("Very High Risk — Immediate PCI (<2h) required:"),
    bullet("Haemodynamic instability / cardiogenic shock"),
    bullet("Refractory chest pain unresponsive to anti-ischaemic therapy"),
    bullet("Life-threatening arrhythmias (VF, sustained VT)"),
    bullet("Mechanical complications of MI (acute MR, VSD, free wall rupture)"),
    bullet("Acute heart failure attributable to NSTE-ACS"),
    bullet("Recurrent dynamic ECG changes — especially transient ST elevation"),
    spacer(),
    bodyBold("High Risk — Early PCI (within 24h) required:"),
    bullet("GRACE score >140"),
    bullet("Dynamic ST/T changes (≥1mm ST depression or new T-wave inversion)"),
    bullet("Elevated troponin (especially rising pattern)"),
    bullet("Recurrent ischaemia despite medical therapy"),
    bullet("Prior CABG or multivessel CAD with ongoing ischaemia"),
    spacer(),
    sectionHead("5.5  Acute Medical Management of UA/NSTEMI"),
    makeTable(
      ["Drug", "Dose", "Notes"],
      [
        ["Aspirin [MANDATORY]", "Loading: 162–325 mg chewed; then 75–100 mg OD indefinitely", "Class I — give immediately to ALL ACS patients unless contraindicated"],
        ["P2Y12 inhibitor", "Ticagrelor 180 mg load then 90 mg BD (PREFERRED)\nor Prasugrel 60 mg load then 10 mg OD\nor Clopidogrel 300–600 mg load then 75 mg OD", "2025 ACC/AHA: Ticagrelor or Prasugrel preferred over Clopidogrel. Prasugrel CONTRAINDICATED if prior stroke/TIA or age >75y"],
        ["Anticoagulation", "Enoxaparin 1 mg/kg SC BD (PREFERRED)\nor UFH: 60 U/kg bolus + infusion\nor Fondaparinux 2.5 mg SC OD (preferred in conservative strategy)", "Fondaparinux: lower bleeding risk; preferred if PCI NOT immediately planned. Add UFH at time of PCI if fondaparinux was used."],
        ["Beta-blocker (oral)", "Metoprolol 25–50 mg BD, titrate up", "Start within 24h if no contraindications (HF, shock, bradycardia, heart block)"],
        ["Nitrates", "SL GTN 0.4 mg q5min ×3, then IV NTG if ongoing pain", "Avoid if BP <90 mmHg, RV infarction, or PDE5 inhibitor use within 24–48h"],
        ["High-intensity statin", "Atorvastatin 80 mg OD immediately", "Start in hospital; do not wait for LDL result; reduces events regardless of baseline LDL"],
        ["ACE inhibitor", "Ramipril 2.5–5 mg OD (titrate to 10 mg)", "Start within 24h if HFrEF, HTN, DM; beneficial in all NSTEMI (Class I)"],
        ["Morphine", "2–4 mg IV (if severe pain)", "2025 ACC/AHA: use with CAUTION; may mask symptoms and delay P2Y12 absorption"],
        ["Oxygen", "Only if SpO2 <90%", "Routine O2 NOT recommended — may increase oxidative stress"],
      ],
      [25, 38, 37]
    ),
    spacer(),
    sectionHead("5.6  PCI Strategy & Timing in UA/NSTEMI"),
    makeTable(
      ["Risk Category", "PCI Timing", "Indication"],
      [
        ["VERY HIGH RISK", "IMMEDIATE (<2 hours)", "Cardiogenic shock, refractory ischaemia, life-threatening arrhythmia, acute HF, mechanical complications"],
        ["HIGH RISK", "EARLY (within 24 hours)", "GRACE >140, dynamic ECG changes, elevated troponin, TIMI ≥3 or HEART ≥7"],
        ["INTERMEDIATE RISK", "Within 24–72 hours", "GRACE 109–140, elevated troponin without dynamic ECG, diabetes, eGFR <60, EF <40%, early post-MI angina"],
        ["LOW RISK", "Elective / conservative", "GRACE <109, HEART ≤3, troponin negative, no ECG changes, no recurrent symptoms"],
      ],
      [22, 22, 56]
    ),
    spacer(),
    infoBox("WHY DELAYED PCI IN STABLE NSTEMI/UA?\n\nUnlike STEMI (where immediate reperfusion is critical), NSTE-ACS involves subtotal occlusion — myocardium is still viable and partly perfused. Immediate PCI (<2h) in STABLE NSTEMI offers NO additional benefit over early (24h) PCI (TIMACS, ICTUS, VERDICT trials). Delay allows: (1) Risk stratification; (2) Dual antiplatelet loading; (3) Anticoagulation; (4) Optimal patient preparation. EXCEPTION: Very high-risk features mandate immediate catheterisation.", BLUE_BG, MED_BLUE),
    pageBreak(),
  ];
}

// ─── CHAPTER 6 ────────────────────────────────────────────────────────────────
function chapter6() {
  return [
    chapterBanner("CHAPTER 6: ST-ELEVATION MYOCARDIAL INFARCTION (STEMI)", RED),
    spacer(),
    sectionHead("6.1  Definition & Diagnostic Criteria"),
    body("STEMI is ACS characterised by: (1) Acute-onset ischaemic symptoms; (2) Persistent (>20 min) ST elevation in ≥2 contiguous leads; (3) Elevated cardiac biomarkers (troponin)."),
    subHead("ECG Criteria for STEMI (2025 ACC/AHA)"),
    makeTable(
      ["Lead Group", "ST Elevation Threshold"],
      [
        ["Men ≥40y: V2–V3", "≥2 mm"],
        ["Men <40y: V2–V3", "≥2.5 mm"],
        ["Women: V2–V3", "≥1.5 mm"],
        ["All other leads (except V2–V3, aVR)", "≥1 mm"],
        ["Right-sided leads (V3R, V4R)", "≥0.5 mm — RV MI"],
        ["Posterior leads (V7–V9)", "≥0.5 mm (posterior MI — appears as ST depression V1–V3)"],
        ["New LBBB with Sgarbossa criteria", "Treat as STEMI equivalent"],
      ],
      [50, 50]
    ),
    spacer(),
    sectionHead("6.2  Initial Management of STEMI"),
    bodyBold("Immediate steps (first 10–30 minutes):"),
    bullet("12-lead ECG within 10 min of first medical contact (FMC)"),
    bullet("IV access, continuous ECG monitoring, pulse oximetry"),
    bullet("Aspirin 300 mg chewed (if not already on aspirin)"),
    bullet("P2Y12 inhibitor: Ticagrelor 180 mg OR Prasugrel 60 mg (preferred for primary PCI) OR Clopidogrel 300–600 mg"),
    bullet("Anticoagulation: UFH 60–70 U/kg IV bolus (max 4000–5000 U) or Bivalirudin 0.75 mg/kg bolus + 1.75 mg/kg/h"),
    bullet("Morphine 2–4 mg IV (cautiously; do not delay P2Y12 loading)"),
    bullet("GTN sublingual (if no hypotension, RV MI, or PDE5 inhibitor use)"),
    bullet("Oxygen ONLY if SpO2 <90%"),
    bullet("Activate catheterisation laboratory IMMEDIATELY for primary PCI"),
    spacer(),
    sectionHead("6.3  Reperfusion Strategy in STEMI"),
    body("Primary PCI is the preferred reperfusion strategy when it can be performed within 120 minutes of FMC. At PCI-capable centres: FMC-to-wire crossing ≤60 min. At non-PCI centres with transfer: FMC-to-wire ≤90–120 min."),
    spacer(),
    makeTable(
      ["Scenario", "Action", "Time Target"],
      [
        ["PCI-capable centre", "Primary PCI", "FMC to wire ≤60 min (door-to-balloon ≤60 min)"],
        ["Non-PCI centre: transfer feasible within 120 min", "Transfer for primary PCI", "FMC to wire ≤90–120 min including transfer"],
        ["Non-PCI centre: PCI NOT feasible within 120 min", "Fibrinolysis THEN transfer", "Lysis within 30 min FMC; then pharmacoinvasive PCI"],
        ["Fibrinolysis failed (rescue PCI)", "Emergency rescue PCI", "Within 3–24h of failed fibrinolysis"],
        ["Fibrinolysis successful", "Early PCI (pharmacoinvasive)", "Routine angiography at 2–24h post-fibrinolysis"],
        ["Late presenter (12–48h, ongoing ischaemia)", "PCI if unstable; conservative if stable", "Angiography within 24h if ongoing symptoms"],
        [">48h, haemodynamically stable, no ischaemia", "Medical management; elective angiography", "Not emergency; within days"],
      ],
      [30, 38, 32]
    ),
    spacer(),
    sectionHead("6.4  Primary PCI — Key Procedural Recommendations (2025 ACC/AHA)"),
    bullet("Radial access PREFERRED over femoral (lower bleeding risk — Class I)"),
    bullet("Drug-eluting stent (DES) over bare metal stent (BMS) — lower restenosis rate"),
    bullet("Culprit-only PCI initially in cardiogenic shock (CULPRIT-SHOCK trial); staged complete revascularisation for stable multivessel STEMI (COMPLETE trial — Class I)"),
    bullet("No routine thrombus aspiration (TASTE, TOTAL trials — increased stroke risk)"),
    bullet("Intracoronary imaging (OCT/IVUS) to guide PCI in complex lesions (Class IIa)"),
    bullet("Glycoprotein IIb/IIIa inhibitors: NOT routinely recommended; may use as bailout in large thrombus burden (Class IIb)"),
    spacer(),
    sectionHead("6.5  Long-term Management Post-STEMI"),
    makeTable(
      ["Therapy", "Duration / Target", "Class"],
      [
        ["Aspirin", "Indefinite (75–100 mg OD)", "I"],
        ["P2Y12 inhibitor (Ticagrelor/Prasugrel)", "12 months post-ACS (DAPT)", "I"],
        ["High-intensity statin", "Indefinite; LDL <1.4 mmol/L AND ≥50% reduction", "I"],
        ["Beta-blocker", "Indefinitely if EF <40%; ≥1 year if normal EF", "I"],
        ["ACE inhibitor / ARB", "Indefinitely if EF <40%, DM, HTN, CKD", "I"],
        ["MRA (Eplerenone)", "If EF <40% + HF symptoms or DM; start within 3–7 days", "I"],
        ["ICD", "If EF <35% persisting ≥3 months despite OMT", "I"],
        ["Cardiac Rehabilitation", "Enrol ALL post-MI patients", "I"],
        ["SGLT2 inhibitor", "Empagliflozin/Dapagliflozin — with or without DM", "I"],
      ],
      [40, 45, 15]
    ),
    pageBreak(),
  ];
}

// ─── CHAPTER 7 ────────────────────────────────────────────────────────────────
function chapter7() {
  return [
    chapterBanner("CHAPTER 7: THROMBOLYSIS (FIBRINOLYTIC THERAPY) IN STEMI", PURPLE),
    spacer(),
    sectionHead("7.1  Indications for Fibrinolytic Therapy"),
    body("Fibrinolytic therapy is indicated when PRIMARY PCI CANNOT BE DELIVERED within 120 minutes of first medical contact. It is the reperfusion strategy of choice where PCI is unavailable or transfer time is excessive."),
    bullet("STEMI with symptom onset ≤12 hours AND PCI not available within 120 min of FMC [Class I]"),
    bullet("STEMI with persistent ST elevation ≥2mm in ≥2 contiguous chest leads OR ≥1mm in 2 limb leads"),
    bullet("New LBBB with Sgarbossa criteria positive, when PCI not available"),
    bullet("True posterior MI (ST depression V1–V3) when PCI unavailable"),
    bullet("Pre-hospital fibrinolysis: administer if expected transport time to PCI centre >60–90 min"),
    spacer(),
    warnBox("IMPORTANT: Fibrinolysis is NOT indicated in NSTEMI or UA (ST depression only), symptom onset >12h (unless ongoing ischaemia), or when PCI is available within 120 min. Fibrinolysis in ST-depression-only NSTE-ACS may INCREASE mortality."),
    spacer(),
    sectionHead("7.2  Fibrinolytic Agents — Dosage"),
    makeTable(
      ["Agent", "Dose", "Administration", "Notes"],
      [
        ["Alteplase (t-PA) [PREFERRED]", "≤67 kg: 15 mg IV bolus, then 0.75 mg/kg over 30 min (max 50 mg), then 0.5 mg/kg over 60 min (max 35 mg).\n>67 kg: 15 mg bolus, 50 mg/30 min, 35 mg/60 min. Total max: 100 mg", "IV infusion; weight-based", "Fibrin-specific; most widely used; shorter half-life (~5 min)"],
        ["Tenecteplase (TNK-tPA) [CONVENIENT]", "<60 kg: 30 mg\n60–69 kg: 35 mg\n70–79 kg: 40 mg\n80–89 kg: 45 mg\n≥90 kg: 50 mg\nELDERLY ≥75y: HALF DOSE (ESC Class I, 2023)", "Single IV bolus over 5–10 seconds", "Fibrin-specific; single bolus — most convenient; HALF DOSE in age ≥75y reduces ICH risk"],
        ["Reteplase (r-PA)", "10 U IV bolus + 10 U 30 min later (double bolus)", "Two IV boluses 30 min apart", "Fibrin-specific; requires two doses; simpler than alteplase"],
        ["Streptokinase (SK)", "1.5 million units IV over 60 minutes", "IV infusion over 60 min", "Non-fibrin-specific; ANTIGENIC — cannot reuse within 5 days to 12 months; lower cost; older agent"],
      ],
      [22, 38, 18, 22]
    ),
    spacer(),
    sectionHead("7.3  Adjunctive Anticoagulation with Fibrinolysis"),
    body("All patients receiving fibrinolytic therapy MUST receive concurrent anticoagulation:"),
    makeTable(
      ["Agent", "Regimen"],
      [
        ["Enoxaparin (PREFERRED)", "Age <75y: 30 mg IV bolus THEN 1 mg/kg SC q12h for ≤8 days or until revascularisation\nAge ≥75y: NO IV bolus; 0.75 mg/kg SC q12h (max 75 mg/dose)\neGFR <30: 1 mg/kg SC OD only"],
        ["UFH", "60 U/kg IV bolus (max 4000 U) then 12 U/kg/h infusion; adjust to aPTT 50–70 seconds"],
        ["Fondaparinux", "2.5 mg IV bolus THEN 2.5 mg SC OD for up to 8 days (only if eGFR >20 mL/min)"],
      ],
      [25, 75]
    ),
    spacer(),
    sectionHead("7.4  Contraindications to Fibrinolytic Therapy"),
    makeTable(
      ["ABSOLUTE CONTRAINDICATIONS", "RELATIVE CONTRAINDICATIONS"],
      [
        ["Any prior intracranial haemorrhage (ICH) — lifetime", "History of chronic, severe, poorly controlled hypertension"],
        ["Ischaemic stroke within 3 months", "SBP 150–180 mmHg on presentation (if controllable, acceptable risk)"],
        ["Known intracranial neoplasm, AVM, or aneurysm", "Ischaemic stroke >3 months ago or intracranial pathology not listed as absolute CI"],
        ["Significant closed head/facial trauma within 3 months", "Traumatic / prolonged CPR (>10 min) or major surgery within 3 weeks"],
        ["Suspected aortic dissection", "Recent internal bleeding within 2–4 weeks"],
        ["Active bleeding or bleeding diathesis (excluding menses)", "Non-compressible vascular puncture sites"],
        ["Intracranial or intraspinal surgery within 2 months", "Pregnancy"],
        ["Severe uncontrolled HTN (SBP >180 / DBP >110) unresponsive to emergency therapy", "Active peptic ulcer disease"],
        ["", "Oral anticoagulant therapy (current use, INR >2)"],
        ["", "Streptokinase only: prior use 5 days to 2 years ago (antigenic reaction risk)"],
      ],
      [50, 50]
    ),
    spacer(),
    sectionHead("7.5  Signs of Successful Fibrinolysis (Definitive Findings)"),
    body("Assess at 60–90 minutes after fibrinolytic administration:"),
    bullet("ST resolution ≥50% in the lead with maximum initial ST elevation (MOST IMPORTANT criterion)"),
    bullet("Resolution of chest pain — relief of ischaemic symptoms"),
    bullet("Reperfusion arrhythmia: Accelerated idioventricular rhythm (AIVR) at 60–100 bpm — a specific marker of successful reperfusion"),
    bullet("Early peak of CK-MB (washout phenomenon): peaks within 12–14h (instead of 18–24h) due to reperfusion"),
    bullet("Rapid rise and early peaking of troponin within 12h after fibrinolysis indicates successful reperfusion"),
    spacer(),
    warnBox("FAILED FIBRINOLYSIS (RESCUE PCI): Defined as <50% ST resolution at 60–90 minutes. Immediate transfer for RESCUE PCI is MANDATORY (Class I, 2025 ACC/AHA). Do NOT repeat fibrinolysis — no benefit and increased bleeding risk."),
    spacer(),
    sectionHead("7.6  Pharmacoinvasive Strategy (Post-Fibrinolysis PCI)"),
    makeTable(
      ["Scenario", "Timing of PCI", "Recommendation"],
      [
        ["Failed fibrinolysis (rescue PCI)", "IMMEDIATE (within 3–24h)", "Class I — mandatory; transfer urgently; do NOT re-lyse"],
        ["Successful fibrinolysis + high-risk features (large MI, anterior, EF<40%, HF)", "EARLY: 2–24 hours", "Class I (2025 ACC/AHA): routine early angiography with intent to PCI"],
        ["Successful fibrinolysis, stable, low-risk", "2–24 hours (pharmacoinvasive window)", "Class IIa: angiography preferred over conservative strategy"],
        ["Cardiogenic shock post-fibrinolysis", "EMERGENT regardless of time since lysis", "Class I: immediate angiography + PCI or CABG"],
      ],
      [30, 25, 45]
    ),
    pageBreak(),
  ];
}

// ─── CHAPTER 8 ────────────────────────────────────────────────────────────────
function chapter8() {
  return [
    chapterBanner("CHAPTER 8: PCI TIMING — COMPREHENSIVE SUMMARY", "1A4A1A"),
    spacer(),
    sectionHead("8.1  When is Emergency / Immediate PCI Required?"),
    bodyBold("Emergency PCI (within 2h / as soon as possible):"),
    bullet("ALL STEMI within 12h of onset — primary PCI preferred (Class I)"),
    bullet("STEMI with cardiogenic shock — regardless of time since onset"),
    bullet("STEMI 12–48h with ongoing ischaemia or haemodynamic instability"),
    bullet("NSTE-ACS with very high-risk features: cardiogenic shock, refractory chest pain, VF/VT, acute HF, mechanical complications"),
    bullet("Failed fibrinolysis (rescue PCI) — any STEMI after failed lysis"),
    bullet("Cardiac arrest with STEMI pattern post-ROSC"),
    spacer(),
    sectionHead("8.2  When is Urgent PCI Required (Within 24h)?"),
    bullet("High-risk NSTE-ACS: GRACE score >140, dynamic ECG changes, elevated troponin"),
    bullet("STEMI post-successful fibrinolysis (pharmacoinvasive strategy) — 2–24h window"),
    bullet("Post-ROSC after cardiac arrest without persistent STEMI but with ACS suspicion"),
    bullet("Recurrent ischaemia in NSTEMI/UA despite medical therapy"),
    spacer(),
    sectionHead("8.3  When is Delayed / Elective PCI Appropriate?"),
    bodyBold("In Stable NSTEMI/UA (delayed PCI within 24–72h):"),
    bullet("Intermediate-risk NSTE-ACS without immediate high-risk features"),
    bullet("GRACE 109–140, mildly elevated troponin without dynamic ECG changes"),
    bullet("To allow DAPT loading and anticoagulation to take effect"),
    bullet("To permit risk stratification and optimal patient preparation"),
    bullet("Evidence: ICTUS, TIMACS trials — early vs. delayed invasive strategy showed similar outcomes in stable intermediate-risk NSTEMI"),
    spacer(),
    bodyBold("In Stable STEMI (late presenters, >48h, haemodynamically stable):"),
    bullet("STEMI >48h with NO ongoing ischaemia and stable haemodynamics: PCI may NOT improve outcomes (OAT trial)"),
    bullet("Elective angiography and staged PCI for residual/multivessel disease"),
    bullet("Complete revascularisation of non-IRA can be staged within 19 days post-primary PCI (COMPLETE trial — Class I)"),
    spacer(),
    sectionHead("8.4  Complete PCI Timing Summary Table"),
    makeTable(
      ["ACS Type", "Clinical State", "PCI Timing", "Strategy"],
      [
        ["STEMI", "PCI available within 120 min", "IMMEDIATE (<60–90 min FMC-to-wire)", "Primary PCI"],
        ["STEMI", "PCI NOT available within 120 min", "Lysis within 30 min FMC, then transfer", "Fibrinolysis → Pharmacoinvasive PCI"],
        ["STEMI", "Post-failed fibrinolysis", "IMMEDIATE rescue PCI", "Rescue PCI"],
        ["STEMI", "Post-successful lysis", "2–24 hours", "Early PCI (pharmacoinvasive)"],
        ["STEMI", "Late presenter >48h, stable, no ongoing ischaemia", "Elective (days)", "Medical first; staged PCI for residual disease"],
        ["NSTEMI/UA", "Very high risk (shock, refractory pain, VF/VT)", "IMMEDIATE (<2h)", "Emergency PCI"],
        ["NSTEMI/UA", "High risk (GRACE >140, dynamic ECG, +troponin)", "EARLY (<24h)", "Early invasive PCI"],
        ["NSTEMI/UA", "Intermediate risk (GRACE 109–140)", "Within 24–72h", "Delayed invasive PCI"],
        ["NSTEMI/UA", "Low risk (GRACE <109, negative troponin)", "Elective or conservative", "Functional testing → selective PCI"],
        ["Stable Angina", "Refractory to OMT; high-risk anatomy (FFR +ve)", "Elective (days–weeks)", "Elective PCI or CABG"],
      ],
      [18, 32, 25, 25]
    ),
    pageBreak(),
  ];
}

// ─── CHAPTER 9 ────────────────────────────────────────────────────────────────
function chapter9() {
  return [
    chapterBanner("CHAPTER 9: TREATMENT & PREVENTION", TEAL),
    spacer(),
    sectionHead("9.1  In-Hospital Complications of MI & Their Management"),
    makeTable(
      ["Complication", "Timing", "Management"],
      [
        ["Cardiogenic Shock", "Early (hours)", "Urgent PCI/CABG; inotropes (dobutamine, noradrenaline); IABP/Impella; ECMO in refractory cases"],
        ["Ventricular Fibrillation (VF)", "First 24–48h (primary VF)", "Immediate defibrillation; Amiodarone 150–300 mg IV; beta-blocker; K+/Mg2+ correction"],
        ["Ventricular Tachycardia (VT)", "First few days", "Sustained VT: cardioversion; Amiodarone; treat ischaemia; ICD assessment later"],
        ["AV Block / Bradycardia (inferior MI)", "Days 1–3", "Atropine; temporary transvenous pacing if Mobitz II or complete heart block; usually transient"],
        ["Acute Mitral Regurgitation (papillary muscle rupture)", "Days 3–7 (peak)", "Emergency surgical repair; vasodilators; IABP bridge to surgery"],
        ["Ventricular Septal Defect (VSD)", "Days 3–7 (peak)", "Emergency surgical repair or transcatheter closure; IABP to stabilise"],
        ["Free Wall Rupture", "Days 3–7 (peak)", "Emergency surgical repair; pericardiocentesis if haemopericardium/tamponade"],
        ["Pericarditis / Dressler Syndrome", "Weeks 2–10", "NSAIDs; Colchicine; Aspirin; avoid anticoagulation if possible"],
        ["Left Ventricular Aneurysm", "Weeks–months", "ACEi; anticoagulation if mural thrombus; surgical resection in refractory HF"],
        ["Mural Thrombus", "Days 3–10", "Anticoagulation (LMWH/VKA) for 3–6 months"],
      ],
      [28, 18, 54]
    ),
    spacer(),
    sectionHead("9.2  Killip Classification (HF Severity Post-MI)"),
    makeTable(
      ["Killip Class", "Clinical Features", "~30-day Mortality"],
      [
        ["Class I", "No heart failure; no rales, no S3 gallop", "~5%"],
        ["Class II", "Mild-moderate HF; rales <50% lung fields; S3; elevated JVP", "~10%"],
        ["Class III", "Severe HF; pulmonary oedema; rales >50% lung fields", "~20%"],
        ["Class IV", "Cardiogenic shock: SBP <90 mmHg, oliguria, peripheral cyanosis", "~50%"],
      ],
      [18, 55, 27]
    ),
    spacer(),
    sectionHead("9.3  Primary & Secondary Prevention"),
    subHead("Lifestyle Modification (all patients)"),
    bullet("Smoking cessation — most important modifiable risk factor; reduces MI risk by 50% within 1 year"),
    bullet("Regular aerobic exercise: 150 min/week moderate intensity or 75 min/week vigorous"),
    bullet("Mediterranean or DASH diet: high in vegetables, fruits, whole grains, olive oil; low in saturated fats"),
    bullet("Weight management: target BMI 20–25 kg/m²; waist <94 cm (men), <80 cm (women)"),
    bullet("BP control: target <130/80 mmHg for high-risk patients (2025 ACC/AHA)"),
    bullet("HbA1c target: <7% in most diabetics; individualised approach"),
    bullet("Alcohol: limit to ≤14 units/week (no safe level for CV benefit per 2024 ESC)"),
    spacer(),
    subHead("Pharmacological Secondary Prevention (post-MI)"),
    bullet("Aspirin 75–100 mg OD indefinitely"),
    bullet("P2Y12 inhibitor (DAPT): Ticagrelor 90 mg BD or Prasugrel 10 mg OD for 12 months post-ACS"),
    bullet("High-intensity statin: LDL <1.4 mmol/L with ≥50% reduction from baseline"),
    bullet("Beta-blocker: minimum 1 year post-MI; indefinitely if EF <40%"),
    bullet("ACE inhibitor / ARB: indefinitely if EF <40%, DM, HTN"),
    bullet("MRA (Eplerenone): if EF <35% + HF symptoms or DM — start within 7 days of STEMI"),
    bullet("SGLT2 inhibitor: empagliflozin/dapagliflozin — reduce HF hospitalisations and CV death with or without DM"),
    bullet("GLP-1 agonist: semaglutide — CV benefit in obese patients with CAD (SELECT trial 2023)"),
    bullet("Annual influenza vaccination (Class I — reduces major adverse CV events)"),
    bullet("Cardiac rehabilitation: structured exercise + psychological support + education"),
    spacer(),
    infoBox("2025 ACC/AHA KEY UPDATES: (1) DAPT for 12 months in ACS (Class I); de-escalation acceptable after 3–6 months in low-ischaemic-risk patients (Class IIa). (2) Complete revascularisation in STEMI with multivessel disease (Class I). (3) Radial access preferred (Class I). (4) SGLT2 inhibitors in all ACS patients for HF prevention (Class I). (5) Half-dose tenecteplase (TNK) in patients ≥75 years (Class I).", LIGHT_BLUE, DARK_BLUE),
    pageBreak(),
  ];
}

// ─── CHAPTER 10 ───────────────────────────────────────────────────────────────
function chapter10() {
  return [
    chapterBanner("CHAPTER 10: KEY CLINICAL IMAGES & ECG FINDINGS", DARK_GREY),
    spacer(),
    sectionHead("10.1  ECG Findings Summary"),
    makeTable(
      ["Presentation", "ECG Findings"],
      [
        ["Anterior STEMI (LAD territory)", "ST elevation in V1–V4; reciprocal ST depression in II, III, aVF; evolves to T-wave inversion → Q waves"],
        ["Inferior STEMI (RCA territory)", "ST elevation in II, III, aVF; reciprocal changes in I, aVL; check V3R/V4R for RV involvement"],
        ["Lateral STEMI (LCx territory)", "ST elevation in I, aVL, V5–V6; reciprocal depression in II, III, aVF"],
        ["Posterior MI", "ST depression in V1–V3 (mirror image); R wave > S wave in V1–V2; use V7–V9 leads to confirm"],
        ["RV Infarction (RCA)", "ST elevation in V3R, V4R ≥0.5 mm; inferior ST elevation; bradycardia; hypotension; clear lungs"],
        ["NSTEMI/UA", "ST depression ≥0.5 mm (horizontal or downsloping); T-wave inversion; NO persistent ST elevation; possibly normal"],
        ["Stable Angina", "Normal at rest; ST depression on exertion (exercise test); returns to normal with rest"],
        ["Sgarbossa Criteria (LBBB/STEMI equivalent)", "Concordant ST elevation ≥1 mm in any lead (5 pts); concordant ST depression ≥1 mm in V1–V3 (3 pts); excessively discordant ST elevation ≥5 mm (2 pts); ≥3 points = STEMI equivalent"],
      ],
      [35, 65]
    ),
    spacer(),
    sectionHead("10.2  Key Histological & Anatomical Images (Descriptions)"),
    makeTable(
      ["Image / Diagram", "Key Features"],
      [
        ["Atherosclerotic plaque (gross)", "Intimal thickening; lipid-laden foam cells; fibrous cap; necrotic lipid core; calcification; intraplaque haemorrhage in vulnerable plaques"],
        ["Foam cells / fatty streak (microscopy)", "Lipid-laden macrophages (foam cells) in subintima; earliest lesion of atherosclerosis (seen from childhood)"],
        ["Coagulative necrosis (0–24h MI)", "'Ghost cells' — preserved cell outlines, lost nuclei; wavy fibres; contraction band necrosis at reperfusion"],
        ["Neutrophilic infiltration (1–3 days)", "Dense neutrophil infiltration; karyolysis; early removal of necrotic debris"],
        ["Granulation tissue (1–3 weeks)", "Macrophages, fibroblasts, new capillaries; collagen deposition beginning; soft zone at risk of rupture"],
        ["Fibrous scar (months)", "Dense type I collagen; pale, firm scar; wall thinning; aneurysm formation possible"],
        ["Distribution of MI diagram", "Anterior wall/septum: LAD; Inferior wall: RCA; Lateral wall: LCx; Posterior wall: RCA/LCx; RV: right marginal branch of RCA"],
        ["Coronary angiogram — STEMI", "TIMI 0 flow (total occlusion); 'cut-off' sign; contrast stasis; thrombus shadow"],
        ["Echocardiogram — Acute MI", "Regional wall motion abnormality (RWMA); hypokinesis/akinesis in infarcted territory; reduced EF in large MI"],
      ],
      [35, 65]
    ),
    spacer(),
    sectionHead("10.3  Reperfusion Decision Algorithm — Quick Reference"),
    infoBox(
      "STEMI REPERFUSION ALGORITHM (2025 ACC/AHA)\n\n" +
      "STEMI confirmed (persistent ST elevation >20 min)\n" +
      "|\n" +
      "+-> PCI available AND FMC-to-wire <120 min?\n" +
      "|     YES -> PRIMARY PCI (door-to-balloon ≤60 min)\n" +
      "|\n" +
      "+-> PCI NOT available within 120 min?\n" +
      "      YES -> FIBRINOLYSIS within 30 min of FMC\n" +
      "              |\n" +
      "              +-> At 60-90 min: ST resolved ≥50%? Pain relieved? AIVR?\n" +
      "              |\n" +
      "              +-> YES (SUCCESS) -> Transfer; early PCI at 2-24h\n" +
      "              +-> NO (FAILED)   -> IMMEDIATE rescue PCI\n\n" +
      "NSTE-ACS ALGORITHM\n\n" +
      "VERY HIGH RISK (shock, VF, refractory pain, acute HF) -> IMMEDIATE PCI <2h\n" +
      "HIGH RISK (GRACE>140, dynamic ECG, troponin rise)       -> EARLY PCI <24h\n" +
      "INTERMEDIATE RISK (GRACE 109-140)                        -> PCI within 24-72h\n" +
      "LOW RISK (GRACE<109, troponin negative, normal ECG)     -> Conservative / functional test",
      PALE_GREY, DARK_BLUE
    ),
    spacer(),
    note("Sources: Braunwald's Heart Disease (2023) · Goldman-Cecil Medicine · Robbins & Kumar Pathologic Basis of Disease · Rosen's Emergency Medicine · 2025 ACC/AHA/ACEP/NAEMSP/SCAI Guideline for ACS (Circulation 2025;151:e771-e862) · 2024 ESC Guidelines for Chronic Coronary Syndromes · 2023 ESC Guidelines for ACS · Australian ACS Clinical Guideline 2025"),
  ];
}

// ─── BUILD DOCUMENT ───────────────────────────────────────────────────────────
const children = [
  ...coverPage(),
  ...chapter1(),
  ...chapter2(),
  ...chapter3(),
  ...chapter4(),
  ...chapter5(),
  ...chapter6(),
  ...chapter7(),
  ...chapter8(),
  ...chapter9(),
  ...chapter10(),
];

const doc = new Document({
  creator: "Orris Medical AI",
  title: "IHD, ACS & Angina – Comprehensive Clinical Guide",
  description: "Based on 2025 ACC/AHA and 2024 ESC Guidelines",
  sections: [{ children }],
});

Packer.toBuffer(doc).then(buffer => {
  writeFileSync(OUT, buffer);
  console.log("Done:", OUT, `(${(buffer.length / 1024).toFixed(1)} KB)`);
}).catch(err => {
  console.error("Error:", err.message);
  process.exit(1);
});
Running Command

cd /home/daytona/workspace/acs-angina-pdf && node build_docx.mjs 2>&1

Running Command

# Find where docx is actually installed npm root -g 2>&1 && ls $(npm root -g)/do…

Running Command

# Convert .mjs to CommonJS require syntax and use the CJS path directly cd /home…

where is pdf ?

Running Command

ls -lh /home/daytona/workspace/*.pdf /home/daytona/workspace/acs-angina-pdf/*.pd…

The PDF exists and is valid (64 KB, 24 pages). Here it is - click to download:

IHD ACS Angina Guidelines

PDF Document · PDF

If that link doesn't trigger a download in your browser, try this one (subfolder path):

IHD ACS Angina Guidelines

PDF Document · PDF


If you still can't download, here's why and what to do:
The sandbox file system is only accessible through this chat interface's built-in file delivery. If neither link works, it means your current interface/browser is blocking the sandbox file protocol. In that case:
  1. Tell me your preferred format - I can output the entire document as formatted text right here in the chat, which you can copy-paste into Word or Google Docs
  2. Or I can base64-encode the PDF and give you a data URI you can paste directly into your browser address bar to force a download
  3. Or I can convert it to a .docx - Word files sometimes download more reliably through this interface
Which would you prefer?

Paste the PDF as plain text here so I can copy it

Running Command

python3 -c " from pypdf import PdfReader reader = PdfReader('/home/daytona/works…

Here is the full content of the PDF — all 24 pages — ready to copy:

ISCHEMIC HEART DISEASE

Acute Coronary Syndromes & Angina Management

A Comprehensive Clinical Reference

Based on: Braunwald's Heart Disease · Goldman-Cecil Medicine · Robbins Pathology · Rosen's Emergency Medicine · 2025 ACC/AHA · 2024 ESC Guidelines | July 2026

CHAPTER 1: DEFINITIONS & CLASSIFICATION

1.1 Ischemic Heart Disease (IHD)

Ischemic heart disease (IHD) encompasses all conditions in which the blood supply to the myocardium is insufficient relative to its demand - most commonly due to atherosclerotic coronary artery disease (CAD). IHD is the leading cause of death worldwide, responsible for approximately 400,000 deaths annually in the United States alone.

1.2 Myocardial Infarction (MI) - Definition

Myocardial infarction (MI) is the death (necrosis) of cardiac muscle due to prolonged, severe ischemia. The Fourth Universal Definition of MI (2018) defines MI as detection of a rise and/or fall of cardiac biomarkers (preferably high-sensitivity troponin) with at least one value above the 99th percentile upper reference limit, together with evidence of myocardial ischemia (symptoms, ECG changes, or imaging).

1.3 Classification of MI (Universal Definition)

TypeNameMechanism
Type 1Spontaneous MIAtherosclerotic plaque rupture/erosion → thrombus → coronary occlusion
Type 2MI due to supply-demand mismatchDemand ischemia: tachyarrhythmia, severe hypertension, anaemia, hypotension, vasospasm; no culprit plaque rupture
Type 3MI resulting in deathSudden cardiac death with ECG/symptoms suggesting MI; biomarkers unavailable
Type 4aPCI-related MIOccurring within 48h of PCI; troponin rise >5x URL
Type 4bStent thrombosis MIConfirmed by angiography or autopsy
Type 4cIn-stent restenosis MIRestenosis at stent/balloon site
Type 5CABG-related MITroponin rise >10x URL within 48h of CABG

1.4 ACS Spectrum & Classification

Acute Coronary Syndrome (ACS) is an umbrella term covering the spectrum from unstable angina (UA) to non-ST-elevation MI (NSTEMI) to ST-elevation MI (STEMI).
ACS TypeTroponinST ChangesMechanism
Unstable Angina (UA)NEGATIVE (normal)Transient ST depression/T-wave changes or normal ECGSubtotal occlusion; no myocyte death
NSTEMIPOSITIVE (elevated)ST depression, T-wave inversion; NO persistent ST elevationSubtotal occlusion or demand ischemia; myocyte necrosis present
STEMIPOSITIVE (elevated)Persistent ST elevation ≥20 min; new LBBB (rare)Total thrombotic occlusion of epicardial coronary artery

1.5 Angina Classification (CCS Grading)

CCS GradeDescription
Grade IAngina only with strenuous exertion; ordinary physical activity does NOT cause angina
Grade IISlight limitation; angina on walking >2 blocks on level or climbing >1 flight of stairs
Grade IIIMarked limitation; angina on walking 1-2 blocks or climbing 1 flight of stairs
Grade IVInability to carry on any physical activity without discomfort; angina at rest

CHAPTER 2: ETIOLOGY & RISK FACTORS

2.1 Etiology

The overwhelming majority of IHD and MI is caused by atherosclerosis of the epicardial coronary arteries. Less common etiologies include:
  • Coronary vasospasm (Prinzmetal / variant angina) - cocaine, ergotamine, chemotherapy
  • Spontaneous coronary artery dissection (SCAD) - young women, peripartum
  • Coronary artery embolism - infective endocarditis, atrial fibrillation, prosthetic valves
  • Coronary arteritis - Kawasaki disease, Takayasu arteritis, SLE
  • Severe anaemia, hypotension, tachyarrhythmia (Type 2 MI)
  • Congenital coronary anomalies
  • Hypertrophic cardiomyopathy (supply-demand mismatch)

2.2 Risk Factors

NON-MODIFIABLE RISK FACTORSMODIFIABLE RISK FACTORS
Age (men >45y, women >55y)Hypertension
Male sex (before menopause)Dyslipidaemia (high LDL, low HDL, high TG)
Family history of premature CAD (1st degree: men <55y, women <65y)Diabetes mellitus / insulin resistance
Genetics / ethnicitySmoking / tobacco use
Post-menopausal stateObesity (BMI >30 kg/m²)
Physical inactivity
Chronic kidney disease
Chronic inflammatory states (RA, SLE, psoriasis)
Sleep apnoea
High-sensitivity CRP elevation
Psychosocial stress / depression
Cocaine use
Oral contraceptive pills (combined)
Hyperhomocysteinaemia
KEY NOTE: Post-menopausal women lose the cardioprotective effect of oestrogen. Hormonal replacement therapy has NOT been shown to be protective and may increase thrombotic risk. The INTERHEART study showed 9 modifiable risk factors account for >90% of MI risk worldwide.

CHAPTER 3: PATHOPHYSIOLOGY

3.1 Atherosclerosis & Plaque Formation

Atherosclerosis begins with endothelial injury/dysfunction, allowing LDL to enter and accumulate in the subintima. Oxidised LDL triggers a chronic inflammatory response: monocytes differentiate into macrophages, engulf lipids to form foam cells, and secrete cytokines (TNF, IL-1, IFN-γ). Smooth muscle cells migrate and proliferate, secreting a collagen-rich extracellular matrix to form a fibrous cap over the lipid-rich necrotic core - constituting the atherosclerotic plaque.

3.2 Plaque Vulnerability & Rupture

A vulnerable (unstable) plaque is characterised by a large lipid core, thin fibrous cap (<65 µm), and a dense inflammatory infiltrate at the shoulder regions. Inflammatory cells secrete matrix metalloproteinases (MMPs) and cathepsins that degrade collagen and elastin, weakening the fibrous cap. Sites of low shear stress (vessel bifurcations) are particularly prone. Plaque rupture or erosion exposes the thrombogenic subendothelial matrix and lipid core to circulating blood.

3.3 Thrombus Formation (Coronary Occlusion)

Plaque rupture triggers the following sequence:
  • Platelet adhesion: Exposed collagen and von Willebrand factor (vWF) bind platelet GPIb/IX/V receptors.
  • Platelet activation: Platelets change shape (discoid → stellate), release ADP, thromboxane A2, serotonin; upregulate GPIIb/IIIa receptors.
  • Platelet aggregation: Fibrinogen cross-links GPIIb/IIIa receptors on adjacent platelets → 'platelet plug'.
  • Coagulation cascade: Tissue factor exposed → thrombin generated → fibrinogen → fibrin → stabilises thrombus.
  • Coronary occlusion: Subtotal occlusion → UA/NSTEMI; Total occlusion → STEMI (absent collaterals).

3.4 Zones of Myocardial Injury

ZoneDescriptionReversibility
Zone of Necrosis (infarct core)Central zone; ATP depleted within 20-40 min; irreversible cell death by coagulative necrosisIRREVERSIBLE
Zone of InjuryIntermediate zone; severe ischaemia; ST elevation on ECGMay be reversible with timely reperfusion
Zone of Ischaemia (penumbra)Outer zone; reduced perfusion; T-wave changes on ECGRecoverable with prompt reperfusion

3.5 Temporal Morphology of MI

TimeGross ChangesMicroscopic Changes
0-6 hoursNone (normal appearance)Reversible: swelling, chromatin clumping; Early coagulative necrosis ~4h
6-24 hoursPallor, oedema beginningCoagulative necrosis; neutrophil infiltration begins
1-3 daysPale-yellow colourKaryolysis; peak neutrophil infiltration
3-7 daysHyperaemic rim around yellow centreMacrophage infiltration; removal of necrotic debris
1-3 weeksPale grey-yellow, soft (RISK OF RUPTURE)Granulation tissue; angiogenesis; collagen deposition begins
Weeks-monthsFirm grey-white scarDense fibrous scar; complete collagen replacement
⚠ CLINICALLY IMPORTANT: Days 3-7 post-MI = HIGHEST RISK of myocardial free wall rupture, ventricular septal defect, or papillary muscle rupture due to maximal softening of necrotic tissue before adequate fibrosis.

3.6 Transmural vs. Subendocardial Infarction

  • Transmural (full-thickness) MI: Involves entire wall thickness from endocardium to epicardium. Total occlusion of major epicardial artery. STEMI pattern on ECG. Develops Q waves (Q-wave MI).
  • Subendocardial (non-transmural) MI: Involves inner one-third to half of myocardium. Prolonged hypotension, severe anaemia, or partial occlusion. Non-Q-wave MI; associated with ST depression on ECG.

3.7 Coronary Artery Distribution of Infarcts

ArteryFrequencyTerritory Infarcted
Left Anterior Descending (LAD)40-50%Anterior LV wall near apex, anterior 2/3 of interventricular septum, LV apex
Right Coronary Artery (RCA)30-40%Inferior/posterior LV wall, posterior 1/3 of septum, RV free wall, SA/AV node
Left Circumflex (LCx)15-20%Lateral LV wall (excluding apex); posterior wall in dominant LCx

CHAPTER 4: CHRONIC STABLE ANGINA (Chronic Coronary Syndrome)

4.1 Definition & Diagnosis (2024 ESC Guidelines)

Chronic Stable Angina (now termed Chronic Coronary Syndrome [CCS] by 2024 ESC) is predictable chest pain or discomfort precipitated by exertion or stress and relieved within minutes by rest or sublingual nitrates. Fixed atherosclerotic stenosis causing supply-demand imbalance.
Typical Angina: (1) Substernal chest discomfort with characteristic quality and duration; (2) Provoked by exertion or emotional stress; (3) Relieved by rest or nitroglycerin.
Note: 2024 ESC guidelines de-emphasise 'typical vs atypical' terminology - focus on detailed history of quality, location, duration, triggers, and relieving factors.

4.2 Investigations

InvestigationFinding / Purpose
Resting ECGST changes, Q waves, LVH; may be normal in stable angina
Stress ECG (Exercise Treadmill Test)Horizontal or downsloping ST depression ≥1mm; assess functional capacity
EchocardiographyLV function, wall motion abnormalities, valve disease (baseline)
Stress Echo / Nuclear MPIAssess myocardial ischaemia and viability; better sensitivity than ETT
CT Coronary Angiography (CTCA)FIRST-LINE non-invasive imaging (Class I, 2024 ESC); rules in/out CAD; calcium score
Invasive Coronary AngiographyGold standard; required before revascularisation; assess anatomy
FFR / iFRFunctional assessment; FFR ≤0.80 = haemodynamically significant
High-sensitivity TroponinRule out ACS; elevated troponin excludes stable angina
CBC, lipid profile, HbA1c, TFTsRisk factor assessment; identify secondary causes

4.3 Medical Treatment of Chronic Stable Angina

Goals: (1) Relieve symptoms; (2) Prevent MI and death; (3) Slow disease progression.
Anti-ischaemic / Symptom-relief Therapy:
Drug ClassAgent (Dose)Mechanism / Notes
Short-acting NitratesSL GTN 0.3-0.6 mg or sprayVenodilation → preload reduction; immediate relief; first-line for acute episodes
Beta-blockers (BB) [FIRST LINE]Metoprolol 25-200 mg BD; Bisoprolol 5-10 mg OD; Atenolol 50-100 mg ODReduce HR & contractility → decrease O2 demand; preferred post-MI
Calcium Channel Blockers (CCB)Amlodipine 5-10 mg OD (DHP); Diltiazem 60-120 mg TDS; Verapamil 80-120 mg TDSDHP: vasodilation; Non-DHP: reduce HR + vasodilation; add to BB if uncontrolled
Long-acting NitratesIsosorbide mononitrate 20-40 mg BD (with 8h nitrate-free interval)Tolerance develops without nitrate-free interval; DO NOT use with PDE5 inhibitors
Ivabradine5-7.5 mg BDIf inhibitor; reduces HR only; if BB contraindicated/intolerant
Ranolazine500-1000 mg BDLate Na+ current inhibitor; reduces diastolic wall tension; add-on therapy
Nicorandil10-20 mg BDKATP channel opener + nitrate effect; refractory angina (ESC Class IIb)
Trimetazidine35 mg BD (modified release)Metabolic agent; shifts cardiac metabolism from FA to glucose oxidation
Cardiovascular Risk Reduction / Prevention Therapy:
DrugDoseTarget / Goal
Aspirin75-100 mg OD (indefinite)Class I - all CCS patients
High-intensity statinAtorvastatin 40-80 mg OD / Rosuvastatin 20-40 mg ODLDL <1.4 mmol/L (<55 mg/dL) AND ≥50% reduction from baseline (ESC 2024)
ACE Inhibitor / ARBRamipril 10 mg OD / Perindopril 10 mg ODClass I with HFrEF, DM, HTN, CKD; Class IIa in all CCS (ESC 2024)
Beta-blockerPost-MI: Carvedilol, Metoprolol, BisoprololClass I post-MI with reduced EF; reduces sudden death
Ezetimibe10 mg ODAdd if LDL not at target on maximally tolerated statin
PCSK9 inhibitorsEvolocumab 140 mg every 2w / AlirocumabLDL above target despite statin + ezetimibe (very high risk)
Clopidogrel75 mg ODAlternative antiplatelet if aspirin intolerant; DAPT 6-12 months post-PCI
SGLT2 inhibitorEmpagliflozin / DapagliflozinClass I in DM with CCS; reduce HF hospitalisations and CV death

4.4 When is PCI Required in Stable Angina?

Revascularisation Indications (2024 ESC / 2025 ACC/AHA):
  • Refractory angina despite optimal medical therapy (OMT) [Class I]
  • Haemodynamically significant stenosis (FFR ≤0.80 / iFR ≤0.89) with angina symptoms [Class I]
  • Left main disease >50% stenosis [Class I for revascularisation]
  • Proximal LAD stenosis >50% with objective ischaemia [Class I]
  • Multivessel disease with large ischaemic burden (>10% of myocardium) [Class IIa]
  • CCS with impaired LV function (EF <35%) + viable myocardium [Class IIa for CABG]
CABG vs. PCI in Stable CAD: CABG preferred in: Left main disease, 3-vessel CAD with SYNTAX >22, diabetes with multivessel CAD, impaired LV function. PCI preferred in: Single/two-vessel CAD, high surgical risk, patient preference. Both acceptable in 3-vessel CAD with SYNTAX ≤22.

4.5 Antithrombotic Therapy Post-PCI (Chronic Setting)

Standard DAPT post-elective PCI: Aspirin 75-100 mg + Clopidogrel 75 mg for 6 months (2024 ESC Class I). May reduce to 1-3 months if high bleeding risk. Extend to 12 months if high ischaemic risk. After DAPT: aspirin monotherapy indefinitely.

CHAPTER 5: UNSTABLE ANGINA (UA) & NSTEMI

5.1 Definitions

  • Unstable Angina (UA): ACS with chest pain at rest, new-onset severe angina, or crescendo angina. Troponin NEGATIVE - no myocyte necrosis. ECG may show transient ST depression, T-wave changes, or be normal.
  • NSTEMI: ACS with Troponin POSITIVE (elevated above 99th percentile URL) WITHOUT persistent ST elevation (>20 min). ST depression, T-wave inversion, or subtle ECG changes may be present. Myocyte necrosis has occurred.
  • Both are collectively termed NSTE-ACS. The distinction is made retrospectively after troponin results.

5.2 Pathophysiology (NSTE-ACS)

In most cases: plaque rupture/erosion → platelet aggregation → non-occlusive (subtotal) thrombus → reduced but not absent coronary flow → ischaemia ± infarction. If extensive collaterals exist, even total occlusion may present as NSTEMI rather than STEMI.

5.3 Clinical Features

  • Symptoms: Retrosternal pressure, squeezing, or heaviness; radiation to left arm/jaw/neck; diaphoresis, nausea, dyspnoea, syncope. Atypical presentations more common in women, elderly, diabetics.
  • ECG findings: ST depression (horizontal or downsloping ≥0.5 mm) in ≥2 contiguous leads; T-wave inversion; new LBBB; or normal ECG. NO persistent ST elevation.
  • Biomarkers: High-sensitivity troponin (hsTn) serial measurement. ESC 0h/1h algorithm: if hsTn very low at 0h → rule out; if rise ≥5 pg/mL at 1h → rule in.

5.4 Risk Stratification

Risk ScoreToolKey Variables
GRACE ScoreRecommended by ESC & 2025 ACC/AHAAge, HR, BP, creatinine, cardiac arrest, ST deviation, troponin, Killip class
TIMI Score (0-7)Widely usedAge ≥65, ≥3 CAD risk factors, prior CAD, ST deviation, ≥2 angina events, aspirin use, elevated markers
HEART ScoreED-basedHistory, ECG, Age, Risk factors, Troponin; ≤3 low risk; ≥7 high risk
High-risk features requiring EARLY invasive strategy (within 24h):
  • GRACE score >140
  • Dynamic ST/T changes (≥1mm ST depression or new T-wave inversion)
  • Elevated troponin (especially rising pattern)
  • Haemodynamic instability (cardiogenic shock, acute heart failure)
  • Life-threatening arrhythmia (VT/VF)
  • Recurrent ischaemia despite medical therapy
  • Prior CABG or multivessel CAD with evidence of ongoing ischaemia
Very high-risk features requiring IMMEDIATE invasive strategy (within 2h):
  • Haemodynamic instability / cardiogenic shock
  • Refractory chest pain unresponsive to anti-ischaemic therapy
  • Life-threatening arrhythmias (VF, sustained VT)
  • Mechanical complications of MI (MR, VSD, free wall rupture)
  • Acute heart failure attributable to NSTE-ACS
  • Recurrent dynamic ECG changes - especially transient ST elevation

5.5 Acute Medical Management of UA/NSTEMI

DrugDoseNotes
Morphine (use cautiously)2-4 mg IV (if severe pain)2025 ACC/AHA: use with caution; may mask symptoms; adverse interaction with P2Y12 agents
OxygenOnly if SpO2 <90%Routine O2 NOT recommended; may increase oxidative stress
NitratesSL GTN 0.4 mg q5min ×3, then IV NTG if ongoing painAvoid if BP <90 mmHg, RV infarction, PDE5 inhibitor use within 24-48h
Aspirin [MANDATORY]Loading: 162-325 mg chewed; then 75-100 mg OD indefinitelyClass I; give immediately to ALL ACS patients unless contraindicated
P2Y12 inhibitorTicagrelor 180 mg load then 90 mg BD (PREFERRED) or Clopidogrel 300-600 mg load then 75 mg OD2025 ACC/AHA: Ticagrelor or Prasugrel preferred. Prasugrel CONTRAINDICATED if prior stroke/TIA or age >75y
AnticoagulationLMWH: Enoxaparin 1 mg/kg SC BD or UFH: 60 U/kg bolus + infusion or Fondaparinux 2.5 mg SC OD (preferred in conservative strategy)Fondaparinux: lower bleeding risk; add UFH at time of PCI if fondaparinux used
Beta-blocker (oral)Metoprolol 25-50 mg BD, titrate upStart within 24h if no contraindications
High-intensity statinAtorvastatin 80 mg OD immediatelyStart in hospital; do not wait; reduces events regardless of baseline LDL
ACE inhibitorRamipril 2.5-5 mg OD (titrate)Start within 24h if HFrEF, HTN, DM; beneficial in all NSTEMI (Class I)

5.6 PCI Strategy in UA/NSTEMI

Risk CategoryTiming of PCIIndication
VERY HIGH RISK (emergent)IMMEDIATE: within 2 hoursCardiogenic shock, refractory ischaemia/pain, life-threatening arrhythmia, acute HF, mechanical complications
HIGH RISK (early invasive)EARLY: within 24 hoursGRACE >140, dynamic ECG changes, elevated troponin, TIMI ≥3 or HEART ≥7
INTERMEDIATE RISKWithin 24-72 hoursGRACE 109-140, elevated troponin without dynamic ECG, diabetes, eGFR <60, EF <40%, prior CABG/PCI
LOW RISK (conservative)Elective / non-invasive workup firstGRACE <109, HEART ≤3, TIMI 0-1, no troponin rise, no ECG changes
WHY DELAYED PCI IN STABLE NSTEMI/UA? Unlike STEMI, NSTE-ACS involves subtotal occlusion - myocardium is still viable and partly perfused. Immediate PCI (<2h) in STABLE NSTEMI offers NO additional benefit over early (24h) PCI (TIMACS, ICTUS, VERDICT trials). Delay allows: (1) Risk stratification; (2) DAPT loading; (3) Anticoagulation; (4) Optimal patient preparation; (5) Identification of high-risk anatomy. EXCEPTION: Very high-risk features mandate immediate catheterisation.

CHAPTER 6: ST-ELEVATION MYOCARDIAL INFARCTION (STEMI)

6.1 Definition & Diagnostic Criteria

STEMI is ACS characterised by: (1) Acute-onset ischaemic symptoms; (2) Persistent (>20 min) ST elevation in ≥2 contiguous leads; (3) Elevated cardiac biomarkers (troponin).
ECG Criteria for STEMI (2025 ACC/AHA):
Lead GroupST Elevation Threshold
Men ≥40y: V2-V3≥2 mm
Men <40y: V2-V3≥2.5 mm
Women: V2-V3≥1.5 mm
All leads except V2-V3 and aVR≥1 mm
Right-sided leads (V3R, V4R)≥0.5 mm (RV MI)
Posterior leads (V7-V9)≥0.5 mm (posterior MI - appears as ST depression V1-V3)
New LBBB with Sgarbossa criteriaTreat as STEMI equivalent

6.2 Initial Management of STEMI

Immediate steps (first 10-30 minutes):
  • 12-lead ECG within 10 min of first medical contact (FMC)
  • IV access, continuous ECG monitoring, pulse oximetry
  • Aspirin 300 mg chewed
  • P2Y12 inhibitor: Ticagrelor 180 mg or Prasugrel 60 mg (preferred) OR Clopidogrel 300-600 mg
  • Anticoagulation: UFH 60-70 U/kg IV bolus (max 4000-5000 U) or Bivalirudin
  • Morphine 2-4 mg IV (cautiously; do not delay P2Y12 loading)
  • GTN SL (if no hypotension, RV MI, or PDE5i use)
  • Oxygen ONLY if SpO2 <90%
  • Activate catheterisation laboratory IMMEDIATELY for primary PCI

6.3 Reperfusion Strategy Decision in STEMI

Primary PCI is preferred when feasible within 120 minutes of FMC.
ScenarioActionTime Target
PCI-capable centrePrimary PCIFMC to wire ≤60 min (door-to-balloon ≤60 min)
Non-PCI centre: transfer feasible within 120 minTransfer for primary PCIFMC to wire ≤90-120 min including transfer
Non-PCI centre: PCI NOT feasible within 120 minFibrinolysis THEN transferLysis within 30 min of FMC; then pharmacoinvasive PCI
Fibrinolysis failed (rescue PCI)Emergency PCIWithin 3-24h of failed fibrinolysis
Fibrinolysis successfulEarly PCI (pharmacoinvasive)Routine angiography at 2-24h post-fibrinolysis
Symptom onset 12-48h (late presenters)PCI if ongoing ischaemia; conservative if stableAngiography within 24h if ongoing symptoms
>48h, haemodynamically stable, no ongoing ischaemiaMedical management; elective angiographyNot emergency; within days

6.4 Primary PCI - Procedural Recommendations

  • Radial access preferred over femoral (Class I)
  • Drug-eluting stent (DES) over bare metal stent (BMS)
  • Culprit-only PCI initially in cardiogenic shock (CULPRIT-SHOCK trial); staged complete revascularisation in stable multivessel STEMI (COMPLETE trial)
  • No routine thrombus aspiration (TASTE, TOTAL trials)
  • Intracoronary imaging (OCT/IVUS) in complex lesions (Class IIa)
  • Glycoprotein IIb/IIIa inhibitors: NOT routinely recommended; bailout use only (Class IIb)

6.5 Long-term Management Post-STEMI

TherapyDuration / TargetClass
AspirinIndefinite (75-100 mg OD)I
P2Y12 inhibitor (Ticagrelor/Prasugrel)12 months post-ACS (DAPT)I
High-intensity statinIndefinite; LDL <1.4 mmol/L AND ≥50% reductionI
Beta-blockerIndefinitely if EF <40%; ≥1 year if normal EFI
ACE inhibitor / ARBIndefinitely if EF <40%, DM, HTN, CKDI
Eplerenone / MRAIf EF <40% + HF or DM; start within 3-7 daysI
Cardiac rehabilitationEnrol all post-MI patientsI
ICDIf EF <35% persisting ≥3 months despite OMTI
SGLT2 inhibitorEmpagliflozin/Dapagliflozin - with or without DMI

CHAPTER 7: THROMBOLYSIS (FIBRINOLYTIC THERAPY) IN STEMI

7.1 Indications for Fibrinolytic Therapy

Fibrinolytic therapy is indicated when primary PCI cannot be delivered within 120 minutes of first medical contact.
  • STEMI with symptom onset ≤12 hours AND PCI not available within 120 min of FMC [Class I]
  • STEMI with persistent ST elevation ≥2mm in ≥2 contiguous chest leads OR ≥1mm in 2 limb leads
  • New LBBB with Sgarbossa criteria positive, when PCI not available
  • True posterior MI (ST depression in V1-V3) when PCI unavailable
  • Pre-hospital fibrinolysis: administer if expected transport time to PCI centre >60-90 min
⚠ IMPORTANT: Fibrinolysis is NOT indicated in: (1) NSTEMI or UA (ST depression only); (2) Symptom onset >12 hours unless ongoing ischaemia; (3) When PCI is available within 120 min. Fibrinolysis in ST-depression-only may INCREASE mortality.

7.2 Fibrinolytic Agents - Dosage

AgentDoseAdministrationNotes
Alteplase (t-PA) [PREFERRED]≤67 kg: 15 mg IV bolus, then 0.75 mg/kg over 30 min (max 50 mg), then 0.5 mg/kg over 60 min (max 35 mg). >67 kg: 15 mg bolus, 50 mg/30 min, 35 mg/60 min. Total max: 100 mgIV infusion; weight-basedFibrin-specific; most widely used; shorter half-life
Tenecteplase (TNK-tPA) [CONVENIENT]<60 kg: 30 mg / 60-69 kg: 35 mg / 70-79 kg: 40 mg / 80-89 kg: 45 mg / ≥90 kg: 50 mg. ELDERLY ≥75y: HALF DOSE (ESC 2024 Class I)Single IV bolus over 5-10 secondsFibrin-specific; single bolus; HALF DOSE in ≥75y reduces ICH risk
Reteplase (r-PA)10 U IV bolus + 10 U 30 min later (double bolus)Two IV bolusesFibrin-specific; requires two doses
Streptokinase (SK)1.5 million units IV over 60 minutesIV infusion over 60 minNon-fibrin-specific; ANTIGENIC - cannot reuse within 5 days to 12 months; lower cost

7.3 Adjunctive Anticoagulation with Fibrinolysis

AgentRegimen
Enoxaparin (PREFERRED)Age <75y: 30 mg IV bolus + 1 mg/kg SC q12h for ≤8 days or until revascularisation. Age ≥75y: NO IV bolus; 0.75 mg/kg SC q12h (max 75 mg/dose). eGFR <30: 1 mg/kg SC OD only
UFH60 U/kg IV bolus (max 4000 U) then 12 U/kg/h infusion; adjust to aPTT 50-70 seconds
Fondaparinux2.5 mg IV bolus THEN 2.5 mg SC OD for up to 8 days (eGFR >20)

7.4 Contraindications to Fibrinolytic Therapy

ABSOLUTE CONTRAINDICATIONS:
  • Any prior intracranial haemorrhage (ICH) - lifetime
  • Ischaemic stroke within 3 months
  • Known intracranial neoplasm, AVM, or aneurysm
  • Significant closed head or facial trauma within 3 months
  • Suspected aortic dissection
  • Active bleeding or bleeding diathesis (excluding menses)
  • Intracranial or intraspinal surgery within 2 months
  • Severe uncontrolled hypertension (SBP >180 mmHg / DBP >110 mmHg) unresponsive to emergency therapy
RELATIVE CONTRAINDICATIONS:
  • History of chronic, severe, poorly controlled hypertension
  • SBP >150-180 mmHg on presentation (if controllable, acceptable risk)
  • Ischaemic stroke >3 months ago; dementia; known intracranial pathology
  • Traumatic or prolonged CPR (>10 min) or major surgery within 3 weeks
  • Recent internal bleeding within 2-4 weeks
  • Non-compressible vascular puncture sites
  • Pregnancy
  • Active peptic ulcer disease
  • Oral anticoagulant therapy (current use, INR >2)
  • Streptokinase: prior use 5 days to 2 years ago (antigenic reaction risk)
  • Advanced liver disease

7.5 Definitive Findings Confirming Successful Fibrinolysis

Assess at 60-90 minutes after fibrinolytic administration:
  • ST resolution ≥50% in the lead with maximum initial ST elevation (MOST IMPORTANT criterion)
  • Resolution of chest pain (relief of ischaemic symptoms)
  • Reperfusion arrhythmia: Accelerated idioventricular rhythm (AIVR) at 60-100 bpm - specific marker of successful reperfusion
  • Early peak of CK-MB (washout phenomenon): peaks within 12-14h (instead of 18-24h) due to reperfusion
  • Rapid rise and early peaking of troponin within 12h indicates successful reperfusion
⚠ FAILED FIBRINOLYSIS (RESCUE PCI): Defined as <50% ST resolution at 60-90 minutes. Immediate transfer for rescue PCI is MANDATORY (Class I, 2025 ACC/AHA). Do NOT repeat fibrinolysis.

7.6 Pharmacoinvasive Strategy (Post-Fibrinolysis PCI)

ScenarioTiming of PCIRecommendation
Failed fibrinolysis (rescue PCI)IMMEDIATE (within 3-24h)Class I - mandatory; do NOT re-lyse
Successful fibrinolysis + high-risk features (large MI, anterior, EF<40%, HF)EARLY: 2-24 hoursClass I (2025 ACC/AHA): routine early PCI after successful thrombolysis
Successful fibrinolysis, stable, low-risk2-24 hours (pharmacoinvasive window)Class IIa: angiography preferred over conservative strategy
Cardiogenic shock post-fibrinolysisEMERGENT regardless of timeClass I: immediate angiography + PCI

CHAPTER 8: PCI TIMING - COMPREHENSIVE SUMMARY

8.1 When is Emergency/Immediate PCI Required?

  • All STEMI within 12h of onset - primary PCI preferred (Class I)
  • STEMI with cardiogenic shock regardless of time since onset
  • STEMI 12-48h with ongoing ischaemia or haemodynamic instability
  • NSTE-ACS with very high-risk features: cardiogenic shock, refractory chest pain, VF/VT, acute HF, mechanical complications
  • Failed fibrinolysis (rescue PCI) - any STEMI after failed lysis
  • Cardiac arrest with STEMI pattern on ECG post-ROSC

8.2 When is Urgent PCI Required (Within 24h)?

  • High-risk NSTE-ACS: GRACE >140, dynamic ECG changes, elevated troponin
  • STEMI post-successful fibrinolysis (pharmacoinvasive strategy) - 2-24h window
  • Post-ROSC after cardiac arrest without persistent STEMI but with ACS suspicion
  • Recurrent ischaemia in NSTEMI/UA despite medical therapy

8.3 When is Delayed/Elective PCI Appropriate?

In Stable NSTEMI/UA (delayed PCI within 24-72h):
  • Intermediate-risk NSTE-ACS without immediate high-risk features
  • GRACE 109-140, mildly elevated troponin without dynamic ECG changes
  • To allow DAPT loading and anticoagulation to take effect
  • To permit risk stratification and optimal patient preparation
  • Evidence: ICTUS, TIMACS trials - similar outcomes in stable intermediate-risk NSTEMI whether early or delayed PCI
In Stable STEMI (late presenters, >48h, haemodynamically stable):
  • STEMI >48h with NO ongoing ischaemia and stable haemodynamics: PCI may NOT improve outcomes (OAT trial)
  • Elective angiography and staged PCI for residual disease
  • Complete revascularisation of non-IRA can be staged within 19 days post-primary PCI (COMPLETE trial - Class I)

8.4 Complete PCI Timing Summary Table

ACS TypeClinical StateTimingStrategy
STEMIAll + PCI available <120 minIMMEDIATE (<60-90 min FMC-to-wire)Primary PCI
STEMIPCI NOT available <120 minLysis within 30 min FMC, then transferFibrinolysis then pharmacoinvasive PCI
STEMIPost-failed fibrinolysisIMMEDIATE rescue PCIRescue PCI
STEMIPost-successful lysis2-24 hoursEarly PCI (pharmacoinvasive)
STEMILate presenter >48h, stable, no ongoing ischaemiaElective (days)Medical first; staged PCI
NSTEMI/UAVery high risk (shock, refractory pain, VF/VT)IMMEDIATE (<2h)Emergency PCI
NSTEMI/UAHigh risk (GRACE >140, dynamic ECG, +troponin)EARLY (<24h)Early invasive PCI
NSTEMI/UAIntermediate risk (GRACE 109-140)Within 24-72hDelayed invasive PCI
NSTEMI/UALow risk (GRACE <109, negative troponin, normal ECG)Elective or conservativeFunctional testing then selective PCI
Stable AnginaRefractory to OMT; high-risk anatomy (FFR positive)Elective (days-weeks)Elective PCI or CABG

CHAPTER 9: TREATMENT & PREVENTION

9.1 In-Hospital Complications of MI & Treatment

ComplicationTimingManagement
Cardiogenic ShockEarly (hours)Urgent PCI/CABG; inotropes (dobutamine, noradrenaline); IABP/Impella; ECMO in refractory cases
Ventricular Fibrillation (VF)First 24-48h (primary VF)Immediate defibrillation; Amiodarone 150-300 mg IV; beta-blocker; K+/Mg2+ correction
Ventricular Tachycardia (VT)First few daysSustained VT: cardioversion; Amiodarone; treat ischaemia; ICD assessment later
AV Block / Bradycardia (inferior MI)Days 1-3Atropine; temporary pacing if Mobitz II or complete heart block; usually transient
Acute Mitral Regurgitation (papillary muscle rupture)Days 3-7 (peak)Emergency surgical repair; vasodilators; IABP bridge to surgery
Ventricular Septal Defect (VSD)Days 3-7 (peak)Emergency surgical repair or transcatheter closure; IABP to stabilise
Free Wall RuptureDays 3-7 (peak)Emergency surgical repair; pericardiocentesis if tamponade
Pericarditis / Dressler SyndromeWeeks 2-10NSAIDs; Colchicine; Aspirin; avoid anticoagulation if possible
Left Ventricular AneurysmWeeks-monthsACEi; anticoagulation if mural thrombus; surgical resection in refractory HF
Mural ThrombusDays 3-10Anticoagulation (LMWH/VKA) for 3-6 months

9.2 Killip Classification (HF Severity Post-MI)

Killip ClassClinical Features~30-day Mortality
Class INo heart failure; no rales, no S3~5%
Class IIMild-moderate HF; rales <50% lung fields; S3; elevated JVP~10%
Class IIISevere HF; pulmonary oedema; rales >50% lung fields~20%
Class IVCardiogenic shock: SBP <90 mmHg, oliguria, peripheral cyanosis~50%

9.3 Primary & Secondary Prevention

Lifestyle Modification (all patients):
  • Smoking cessation: most important modifiable risk factor; reduces MI risk by 50% within 1 year
  • Regular aerobic exercise: 150 min/week moderate intensity or 75 min/week vigorous
  • Mediterranean or DASH diet: high in vegetables, fruits, whole grains, olive oil; low in saturated fats
  • Weight management: target BMI 20-25 kg/m²; waist <94 cm (men), <80 cm (women)
  • BP control: target <130/80 mmHg for high-risk patients (2025 ACC/AHA)
  • HbA1c target: <7% in most diabetics
  • Alcohol: ≤14 units/week (2024 ESC: no safe level for CV benefit)
Pharmacological Secondary Prevention (post-MI):
  • Aspirin 75-100 mg OD indefinitely
  • P2Y12 inhibitor (DAPT): Ticagrelor 90 mg BD or Prasugrel 10 mg OD for 12 months post-ACS
  • High-intensity statin: LDL <1.4 mmol/L with ≥50% reduction from baseline
  • Beta-blocker: minimum 1 year post-MI; indefinitely if EF <40%
  • ACE inhibitor / ARB: indefinitely if EF <40%, DM, HTN
  • MRA (Eplerenone): if EF <35% + HF symptoms or DM - start within 7 days
  • SGLT2 inhibitor: empagliflozin/dapagliflozin - reduce HF hospitalisations and CV death with or without DM
  • GLP-1 agonist: semaglutide - CV benefit in obese patients with CAD (SELECT trial 2023)
  • Annual influenza vaccination (Class I)
  • Cardiac rehabilitation: structured exercise + psychological support + education
2025 ACC/AHA KEY UPDATES: (1) DAPT for 12 months in ACS (Class I); de-escalation after 3-6 months in low-risk patients (Class IIa). (2) Complete revascularisation in STEMI with multivessel disease (Class I). (3) Radial access preferred (Class I). (4) SGLT2 inhibitors in all ACS patients (Class I). (5) Half-dose TNK in patients ≥75 years (Class I).

CHAPTER 10: KEY CLINICAL IMAGES & DIAGRAMS

10.1 ECG & Imaging Findings Summary

Image / DiagramKey Features
ECG - STEMI (anterior)ST elevation in V1-V4 (LAD territory); reciprocal ST depression in II, III, aVF; evolves: ST elevation → T-wave inversion → Q waves
ECG - Inferior STEMIST elevation in II, III, aVF (RCA territory); reciprocal changes in I, aVL; check V3R/V4R for RV involvement
ECG - NSTEMI/UAST depression (horizontal/downsloping) in affected leads; T-wave inversion; no persistent ST elevation; normal ECG possible
Coronary Angiogram - STEMITIMI 0 flow (total occlusion); 'cut-off' sign; thrombus; contrast stasis
Echocardiogram - Acute MIRegional wall motion abnormality (RWMA); hypokinesis/akinesis in infarcted territory; reduced EF in large MI
Histology - Early MI (0-24h)Coagulative necrosis; 'ghost cells'; wavy fibres; contraction band necrosis at reperfusion
Histology - Late MI (1-3 weeks)Granulation tissue; macrophages; fibroblasts; new capillaries; collagen deposition beginning
Coronary Artery AtherosclerosisIntimal thickening; foam cells; fibrous cap; necrotic lipid core; calcification; intraplaque haemorrhage in vulnerable plaques
Distribution of MIAnterior/septum: LAD; Inferior wall: RCA; Lateral wall: LCx; Posterior wall: RCA/LCx; RV: RCA
Sgarbossa Criteria (LBBB)Concordant ST elevation ≥1mm (5 pts); Concordant ST depression ≥1mm V1-V3 (3 pts); Discordant ST elevation ≥5mm (2 pts); ≥3 points = STEMI equivalent

QUICK REFERENCE: REPERFUSION DECISION TREE

STEMI REPERFUSION ALGORITHM (2025 ACC/AHA / 2024 ESC)
STEMI confirmed (persistent ST elevation >20 min)
|
+---> PCI available AND FMC-to-wire <120 min?
|       YES ---> PRIMARY PCI (door-to-balloon ≤60 min)
|
+---> PCI NOT available within 120 min?
        YES ---> FIBRINOLYSIS within 30 min of FMC
                  |
                  +---> At 60-90 min: ST resolved ≥50%? Pain relieved? AIVR?
                  |
                  +---> YES (SUCCESS) ---> Transfer; early PCI at 2-24h
                  +---> NO (FAILED)   ---> IMMEDIATE rescue PCI
NSTE-ACS INVASIVE STRATEGY ALGORITHM
VERY HIGH RISK (shock, VF, refractory pain, acute HF) ---> IMMEDIATE PCI <2h
HIGH RISK (GRACE>140, dynamic ECG, troponin rise)      ---> EARLY PCI <24h
INTERMEDIATE RISK (GRACE 109-140)                       ---> PCI within 24-72h
LOW RISK (GRACE<109, troponin negative, normal ECG)    ---> Conservative / functional test

Sources: Braunwald's Heart Disease (2023) · Goldman-Cecil Medicine · Robbins & Kumar Pathologic Basis of Disease · Rosen's Emergency Medicine · 2025 ACC/AHA/ACEP/NAEMSP/SCAI Guideline for ACS (Circulation 2025;151:e771-e862) · 2024 ESC Guidelines for Chronic Coronary Syndromes · 2023 ESC Guidelines for ACS · Australian ACS Clinical Guideline 2025
This is a shared conversation. Sign in to Orris to start your own chat.