attachment
attachment

23 years old female with chest pain and epigastric pain and heaviness

analyse_media
Reading File
Finding Sources
Finding Sources
Searching PubMed

chest pain young women diagnosis management

Finding Sources
Finding Sources
Finding Sources
Finding Sources
Reading File
Reading File
Loading Image
Finding Sources
Here is a full, structured clinical interpretation for this patient:

ECG Interpretation - 23F with Chest Pain + Epigastric Pain + Heaviness

ECG Findings (12-lead, 25mm/s, 10mm/mV)

ParameterFinding
Rate~75-80 bpm
RhythmNormal sinus rhythm
AxisNormal (~+60-70°)
P wavesNormal, upright in I, II, aVF
PR intervalNormal (~140-160 ms)
QRS durationNarrow (<100 ms), no BBB
Pathological Q wavesNone
R-wave progressionNormal (transition at V3-V4)
ST segmentsIsoelectric - no elevation or depression
T wavesUpright V2-V6; prominent/peaked in V3-V5 (normal variant pattern, asymmetric - not hyperacute)
QTcNormal
Overall: Normal ECG. No signs of STEMI, NSTEMI pattern, or prior infarction. The prominent T waves in the mid-precordial leads (V3-V5) are consistent with a benign early repolarization pattern, which is common in young individuals.

Clinical Assessment

This ECG does NOT show:

  • ST elevation (no STEMI)
  • ST depression (no subendocardial ischemia)
  • Diffuse concave ("saddle-shaped") ST elevation of pericarditis
  • Hyperacute T waves of early MI
  • PR depression (pericarditis)
  • Delta waves (WPW)
  • QT prolongation

Differential Diagnosis - 23F, Chest + Epigastric Pain + Heaviness

Given her age, sex, symptom triad, and normal ECG, the most likely causes are non-cardiac, though cardiac causes must be excluded:

Gastrointestinal (Most Likely Given Symptom Pattern)

  • GERD / Gastroesophageal Reflux - epigastric burning + retrosternal heaviness is classic; worsened by meals, lying flat
  • Peptic Ulcer Disease (PUD) - epigastric pain + chest radiation, especially if NSAID use
  • Functional dyspepsia - epigastric heaviness/pressure in young women
  • Esophageal spasm - can mimic chest pain and radiate to the epigastrium
  • Gastritis / Helicobacter pylori - common in young adults

Cardiac (Must Exclude)

  • Pericarditis / Myocarditis - chest pain in young patients after viral illness; ECG may show diffuse ST changes (absent here), but early/focal forms can have normal ECG
  • Myocarditis - especially post-viral; troponin elevation would be key
  • Prinzmetal (vasospastic) angina - can occur in young women, ECG often normal between episodes
  • Hypertrophic cardiomyopathy (HOCM) - usually shows LVH, deep Q waves (not seen here)

Pulmonary

  • Pleuritis / Pleurisy - sharp, positional chest pain
  • Pulmonary embolism - must consider in young women (especially if on OCPs); sinus tachycardia is the most common ECG finding (not present here)

Musculoskeletal

  • Costochondritis - reproducible tenderness on palpation
  • Tietze syndrome

Other

  • Anxiety / panic disorder - common in young women, "chest tightness/heaviness"
  • Anemia - heaviness and exertional symptoms

Recommended Workup

TestRationale
Serum troponin I/T (serial x2, 3h apart)Rule out ACS/myocarditis - single normal ECG is insufficient
CK-MBAdditional cardiac marker
CBCAnemia, infection
CRP / ESRPericarditis/myocarditis inflammation markers
Urea / H. pylori testIf PUD/gastritis suspected
Upper GI endoscopyIf GI cause suspected and no cardiac resolution
EchoIf myocarditis/pericarditis or structural disease considered
D-dimer / CTPAIf PE is suspected (OCP use, immobility, risk factors)
Urine pregnancy testMandatory in reproductive-age females before further workup

Key Clinical Points

  1. A normal ECG does not rule out ACS - serial troponins are mandatory in a patient presenting with chest pain, regardless of ECG findings. This is especially true because young women often have atypical presentations of ACS.
  2. The combination of chest pain + epigastric pain + heaviness in a 23-year-old female strongly points toward a GI etiology (GERD, gastritis, PUD) as the most common cause, particularly if symptoms are meal-related or positional.
  3. Pericarditis/myocarditis must be considered in young patients - look for a recent viral illness (URI, flu), fever, positional pleuritic component, and pericardial friction rub on auscultation.
  4. Oral contraceptive use should be asked about - significantly raises PE risk in young women.
  5. The prominent T waves in V3-V5 are a normal finding in young patients and should NOT be over-interpreted as ischemic.
Clinical bottom line: This is a normal ECG in a young woman with a symptom profile most consistent with a GI cause, but ACS and myocarditis/pericarditis must be actively excluded with serial troponins, inflammatory markers, and clinical assessment before attributing the pain to a benign etiology.
Sources: Frameworks for Internal Medicine (chest pain differential, GI causes); Fuster and Hurst's The Heart 15E (acute pericarditis); Tintinalli's Emergency Medicine (ST evaluation, early repolarization); ROSEN's Emergency Medicine (ECG in chest pain)

Can give ketorolac injection

Finding Sources
Finding Sources
Finding Sources
Finding Sources
Reading File
Reading File
Finding Sources
Reading File

Ketorolac Injection - Decision Guide for This Patient

Short Answer: Use with Caution / Consider Alternatives First


Drug Profile - Ketorolac (Tromethamine)

ParameterDetails
ClassPotent NSAID - non-selective COX-1/COX-2 inhibitor
RouteIM / IV / oral / intranasal
Standard adult dose30 mg IM or 15-30 mg IV
OnsetRapid (30 min IM, faster IV)
Duration6-8 hours
Max duration of use≤5 days total (systemic)
Analgesic potencyComparable to morphine
(Goodman & Gilman's Pharmacological Basis of Therapeutics)

Why It Is Problematic in THIS Patient

This 23-year-old has epigastric pain + chest heaviness - a classic GI symptom pattern. Ketorolac's most significant side effects are:
  • GI pain (13%), dyspepsia (12%), nausea (12%) - directly overlapping with her presenting symptoms
  • Serious adverse GI reactions including ulceration and bleeding via COX-1 inhibition (prostaglandin depletion in gastric mucosa)
  • If the underlying cause is gastritis, GERD, or PUD, ketorolac will worsen the condition
Additionally, per ROSEN's Emergency Medicine:
"For acute pain management, ketorolac is rarely indicated in the patient able to receive oral medications, given that 60 mg IM ketorolac is not clinically superior to 800 mg oral ibuprofen."

Specific Contraindications / Risk Factors to Check

Per ROSEN's Box 6.6 - High-risk patients for NSAID adverse events:
Risk FactorStatus in This Patient
GI symptoms (epigastric pain)PRESENT - HIGH RISK
History of peptic ulcer / gastritisAsk before giving
H. pylori infectionUnknown
Tobacco / alcohol useAsk
Pregnancy (3rd trimester)Rule out - urine pregnancy test mandatory
Renal impairmentCheck if any signs of dehydration
Aspirin hypersensitivity / asthmaAsk
Dehydration / hypovolemiaAssess clinically

Key Clinical Concern - Cardiac Not Yet Excluded

If this patient has myocarditis or pericarditis (on the differential from the previous assessment):
  • NSAIDs like ibuprofen and aspirin are actually the first-line treatment for pericarditis
  • However, myocarditis is a contraindication to NSAIDs (can worsen inflammation and promote arrhythmia)
  • Until troponin results are back, avoid if myocarditis is suspected

Recommendation

ScenarioAction
GI cause (GERD/gastritis) suspectedAvoid ketorolac - give PPI (pantoprazole/omeprazole) + antacid instead
Troponins pending / cardiac not excludedHold ketorolac - musculoskeletal or non-GI pain: consider paracetamol (acetaminophen) 500-1000 mg IV/oral first
Pericarditis confirmedUse ibuprofen 400-600 mg TDS + colchicine (not ketorolac specifically)
Myocarditis suspectedAvoid all NSAIDs
Musculoskeletal / pleuritic pain, GI cause excludedKetorolac 15-30 mg IV or 30 mg IM is reasonable, single dose

Safer Immediate Alternatives for This Patient

  1. Paracetamol (Acetaminophen) 1g IV or oral - safest first-line, no GI risk, no cardiac concern
  2. Antacid + PPI (pantoprazole 40 mg IV/oral) - if GI cause is suspected
  3. Avoid ketorolac unless GI pathology is confidently excluded
Bottom line: Do NOT give ketorolac as a reflex analgesic in this patient until you know the troponins and have assessed whether the epigastric pain is from GI pathology. Paracetamol is the safer bridge analgesic while workup proceeds.
Sources: Goodman & Gilman's Pharmacological Basis of Therapeutics; ROSEN's Emergency Medicine; Goodman & Gilman

Tell me management of STEMI

Finding Sources
Searching PubMed

"ST-elevation myocardial infarction" AND "management guidelines"

Finding Sources
Searching PubMed

"STEMI" AND "reperfusion" AND "guideline"

Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Loading Image
Here is a comprehensive, textbook-based STEMI management guide:

Management of STEMI

Core principle: Mortality is directly proportional to total ischemia time. Every minute of delay = more myocardium lost. "Time is muscle."

STEP 1 - Immediate Recognition & Stabilization (First 10 Minutes)

ActionDetail
12-lead ECGWithin 10 minutes of arrival - mandatory
IV accessTwo large-bore IVs
O2Only if SpO2 <90% (avoid hyperoxia)
Continuous telemetryMonitor for arrhythmias (VF causes 50% of STEMI deaths)
Portable CXRRule out pulmonary edema, aortic dissection
LabsTroponin, CBC, coagulation (aPTT/PT/INR), BMP, Mg, lipid profile, type & screen
Urine pregnancy testAll women of reproductive age
Do NOT wait for troponin results to initiate reperfusion - ECG + clinical picture is sufficient.

STEP 2 - Upstream Medical Therapy (Give Immediately)

Antiplatelets (Dual Antiplatelet Therapy - DAPT)

DrugLoading DoseMaintenance
Aspirin162-325 mg chewed/crushed81 mg/day indefinitely
Ticagrelor (preferred with PCI)180 mg90 mg twice daily
Prasugrel (preferred with PCI)60 mg10 mg/day (avoid if >75y, <60kg, hx stroke/TIA)
Clopidogrel (if fibrinolysis)300-600 mg75 mg/day

Anticoagulation

DrugDoseWhen
UFH (preferred for PCI)60 units/kg IV bolus (max 4000 U), then 12 units/kg/hPCI or fibrinolysis
Enoxaparin (LMWH)30 mg IV bolus → 1 mg/kg SC q12hFibrinolysis (preferred)
Bivalirudin0.75 mg/kg bolus → 1.75 mg/kg/hPCI (choice in HIT)
Fondaparinux2.5 mg IV → 2.5 mg SC dailyFibrinolysis (if no PCI)

Anti-ischemic Therapy

DrugDoseNotes
NitroglycerinSL or IV infusionAvoid if SBP <90, HR >100 or <50, RV infarct, PDE5 inhibitor use in 48h
Morphine2-4 mg IVRefractory pain only - may mask symptoms
Beta-blocker (metoprolol)12.5-25 mg oral q6hStart within 24h; avoid if HF, shock, bradycardia, or hypotension

STEP 3 - Reperfusion Strategy (The Most Critical Decision)

STEMI Reperfusion Flowchart

Option A - Primary PCI (Gold Standard)

  • Preferred when door-to-balloon time is ≤90 minutes from first medical contact
  • Superior to fibrinolysis: better vessel patency, less reinfarction, less intracranial hemorrhage, improved survival
  • Always preferred over fibrinolysis in:
    • Cardiogenic shock
    • Severe heart failure / pulmonary edema
    • Contraindications to fibrinolysis
    • Symptom onset >3 hours ago (large clot burden, fibrinolysis less effective)
    • Uncertain diagnosis

Option B - Fibrinolytic Therapy

  • Use when PCI is not available within 90-120 minutes and symptoms <12 hours
  • Target: door-to-needle ≤30 minutes
AgentDoseNotes
Tenecteplase (TNK-tPA)0.5 mg/kg IV single bolus (30-50 mg)Agent of choice - single bolus, lower bleeding
Alteplase (rt-PA)15 mg bolus → 0.75 mg/kg/30 min → 0.5 mg/kg/60 minFibrin-selective
Reteplase (r-PA)Two 10-unit boluses 30 min apart
Streptokinase1.5 million units IV over 60 minNon-selective; cheapest; allergic reactions possible

Absolute Contraindications to Fibrinolysis:

  • Prior intracranial hemorrhage / hemorrhagic stroke
  • Ischemic stroke within 3 months
  • Known cerebrovascular AVM / aneurysm / tumor
  • Closed head injury within 3 months
  • Active aortic dissection
  • Active bleeding or bleeding diathesis
  • Acute pericarditis
  • SBP >180 / DBP >110 mm Hg (severe uncontrolled HTN)

Signs of Successful Reperfusion:

  • Relief of chest pain
  • >50% reduction in ST elevation at 90 minutes
  • Reperfusion arrhythmia (accelerated idioventricular rhythm)

Rescue PCI: if fibrinolysis fails (persistent pain, <50% ST resolution at 90 min)


STEP 4 - Post-Reperfusion / CCU Care

  • CCU admission with continuous telemetry for ≥24 hours
  • Daily ECG, assessment for recurrent ischemia, new murmurs, HF signs
  • Echocardiogram (baseline EF, wall motion abnormalities, thrombus)
  • Pacing may be needed: AV block in anterior MI is unstable and usually requires permanent pacemaker

STEP 5 - Long-Term Post-STEMI Medical Therapy (the "ABCDE" drugs)

Drug ClassDrug & DoseDuration/Goal
Aspirin81 mg/dayIndefinitely
P2Y12 inhibitorTicagrelor 90 mg BD or Clopidogrel 75 mgMinimum 12 months (regardless of stent type)
Beta-blockerMetoprolol succinate (titrate)Indefinitely; start within 24h
ACE inhibitorCaptopril 6.25 mg → titrate upWithin 24h; all patients, especially EF <40%, anterior MI, DM, HTN
ARBLosartan/ValsartanIf ACE-I intolerant
Statin (high-intensity)Atorvastatin 40-80 mg or Rosuvastatin 20-40 mgIndefinitely; target LDL <70 mg/dL or ≥50% reduction
Aldosterone antagonistEplerenone/SpironolactoneEF <40% + HF or DM
Anticoagulation (if needed)Warfarin or NOACIf LV thrombus, AF, or DVT/PE

ECG-Based Territory Localization

ST Elevation InTerritoryCulprit Artery
V1-V6 / LBBBAnterior + SeptalProximal LAD or Left Main
V2-V4Anterior wallLAD
V5-V6Lateral wallLCX
II, III, aVFInferior wallRCA or LCX
I, aVLHigh lateralDiagonal or proximal LCX
V1-V2 depression → get V7-V9PosteriorRCA or LCX
For inferior STEMI: always get right-sided leads (V3R/V4R) to rule out RV infarction - critical because management differs (avoid nitrates, needs IV fluids).

Key Time Targets (AHA/ACC)

TargetTime
ECG from arrival≤10 minutes
Door-to-balloon (PCI)≤90 minutes
First medical contact to PCI (transfer)≤120 minutes
Door-to-needle (fibrinolysis)≤30 minutes
Symptom onset to fibrinolysis benefit<12 hours
Sources: The Washington Manual of Medical Therapeutics; Goldman-Cecil Medicine (Welt & Fang); Fuster and Hurst's The Heart 15E

Create a STEMI management algorithm PDF for ED reference

Reading File
Running Command

ls -la /home/daytona/workspace/ 2>/dev/null || echo "workspace not found"

Running Command

mkdir -p /home/daytona/workspace/stemi-pdf && python3 -c "import reportlab; prin…

Writing File

~/stemi-pdf/create_stemi_pdf.py

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

OUTPUT = "/home/daytona/workspace/stemi-pdf/STEMI_ED_Algorithm.pdf"

# ── Colour palette ──────────────────────────────────────────────────────────
RED        = colors.HexColor("#C0392B")
DARK_RED   = colors.HexColor("#922B21")
ORANGE     = colors.HexColor("#E67E22")
YELLOW_BG  = colors.HexColor("#FEF9E7")
GREEN      = colors.HexColor("#1E8449")
GREEN_BG   = colors.HexColor("#EAFAF1")
BLUE       = colors.HexColor("#1A5276")
BLUE_LIGHT = colors.HexColor("#D6EAF8")
BLUE_BG    = colors.HexColor("#EBF5FB")
GREY_BG    = colors.HexColor("#F2F3F4")
GREY_DARK  = colors.HexColor("#566573")
WHITE      = colors.white
BLACK      = colors.HexColor("#1C2833")

# ── Document setup ───────────────────────────────────────────────────────────
doc = SimpleDocTemplate(
    OUTPUT,
    pagesize=A4,
    leftMargin=14*mm, rightMargin=14*mm,
    topMargin=14*mm,  bottomMargin=14*mm,
    title="STEMI ED Management Algorithm",
    author="Orris Clinical Reference",
)

W, H = A4
CW = W - 28*mm   # content width

styles = getSampleStyleSheet()

def S(name, **kw):
    """Quick style factory."""
    base = styles["Normal"]
    return ParagraphStyle(name, parent=base, **kw)

# ── Reusable styles ──────────────────────────────────────────────────────────
h_banner  = S("h_banner",  fontSize=18, textColor=WHITE,    alignment=TA_CENTER,
               fontName="Helvetica-Bold", leading=22)
h_sub     = S("h_sub",     fontSize=10, textColor=WHITE,    alignment=TA_CENTER,
               fontName="Helvetica", leading=13)
step_hdr  = S("step_hdr",  fontSize=9.5, textColor=WHITE,   fontName="Helvetica-Bold",
               alignment=TA_CENTER, leading=12)
body      = S("body",      fontSize=8.2, textColor=BLACK,   leading=11)
body_bold = S("body_bold", fontSize=8.2, textColor=BLACK,   fontName="Helvetica-Bold", leading=11)
cell_hdr  = S("cell_hdr",  fontSize=8,   textColor=WHITE,   fontName="Helvetica-Bold",
               alignment=TA_CENTER, leading=10)
cell_body = S("cell_body", fontSize=7.8, textColor=BLACK,   leading=10)
cell_bold = S("cell_bold", fontSize=7.8, textColor=BLACK,   fontName="Helvetica-Bold", leading=10)
small     = S("small",     fontSize=7,   textColor=GREY_DARK, leading=9)
warn_text = S("warn_text", fontSize=8,   textColor=DARK_RED, fontName="Helvetica-Bold", leading=10)
green_txt = S("green_txt", fontSize=8,   textColor=GREEN,    fontName="Helvetica-Bold", leading=10)
footer_s  = S("footer_s",  fontSize=6.5, textColor=GREY_DARK, alignment=TA_CENTER, leading=9)

# ── Helper: section header box ───────────────────────────────────────────────
def section_box(title, subtitle=None, bg=BLUE):
    rows = [[Paragraph(title, step_hdr)]]
    if subtitle:
        rows.append([Paragraph(subtitle, h_sub)])
    t = Table(rows, colWidths=[CW])
    t.setStyle(TableStyle([
        ("BACKGROUND",  (0,0), (-1,-1), bg),
        ("TOPPADDING",  (0,0), (-1,-1), 4),
        ("BOTTOMPADDING",(0,0),(-1,-1), 4),
        ("LEFTPADDING", (0,0), (-1,-1), 6),
        ("RIGHTPADDING",(0,0), (-1,-1), 6),
        ("ROUNDEDCORNERS", [3]),
    ]))
    return t

# ── Helper: alert box ────────────────────────────────────────────────────────
def alert_box(text, bg=YELLOW_BG, tc=DARK_RED):
    st = S("_al", fontSize=8, textColor=tc, fontName="Helvetica-Bold",
           leading=10, alignment=TA_CENTER)
    t = Table([[Paragraph(text, st)]], colWidths=[CW])
    t.setStyle(TableStyle([
        ("BACKGROUND",  (0,0),(-1,-1), bg),
        ("BOX",         (0,0),(-1,-1), 1.2, tc),
        ("TOPPADDING",  (0,0),(-1,-1), 5),
        ("BOTTOMPADDING",(0,0),(-1,-1), 5),
        ("LEFTPADDING", (0,0),(-1,-1), 8),
        ("RIGHTPADDING",(0,0),(-1,-1), 8),
    ]))
    return t

# ── Helper: two-col table ────────────────────────────────────────────────────
def two_col(headers, rows_data, col_w=None, hdr_bg=BLUE):
    if col_w is None:
        col_w = [CW*0.38, CW*0.62]
    data = [[Paragraph(h, cell_hdr) for h in headers]]
    for r in rows_data:
        data.append([Paragraph(str(c), cell_body) for c in r])
    t = Table(data, colWidths=col_w)
    style = [
        ("BACKGROUND",   (0,0), (-1,0), hdr_bg),
        ("BACKGROUND",   (0,1), (-1,-1), GREY_BG),
        ("ROWBACKGROUNDS",(0,1),(-1,-1), [WHITE, GREY_BG]),
        ("GRID",         (0,0), (-1,-1), 0.4, colors.HexColor("#BFC9CA")),
        ("TOPPADDING",   (0,0), (-1,-1), 3),
        ("BOTTOMPADDING",(0,0), (-1,-1), 3),
        ("LEFTPADDING",  (0,0), (-1,-1), 5),
        ("RIGHTPADDING", (0,0), (-1,-1), 5),
        ("VALIGN",       (0,0), (-1,-1), "MIDDLE"),
    ]
    t.setStyle(TableStyle(style))
    return t

# ── Helper: three-col table ──────────────────────────────────────────────────
def three_col(headers, rows_data, col_w=None, hdr_bg=BLUE):
    if col_w is None:
        col_w = [CW*0.30, CW*0.36, CW*0.34]
    data = [[Paragraph(h, cell_hdr) for h in headers]]
    for r in rows_data:
        data.append([Paragraph(str(c), cell_body) for c in r])
    t = Table(data, colWidths=col_w)
    t.setStyle(TableStyle([
        ("BACKGROUND",    (0,0), (-1,0), hdr_bg),
        ("ROWBACKGROUNDS",(0,1),(-1,-1), [WHITE, GREY_BG]),
        ("GRID",          (0,0), (-1,-1), 0.4, colors.HexColor("#BFC9CA")),
        ("TOPPADDING",    (0,0), (-1,-1), 3),
        ("BOTTOMPADDING", (0,0), (-1,-1), 3),
        ("LEFTPADDING",   (0,0), (-1,-1), 5),
        ("RIGHTPADDING",  (0,0), (-1,-1), 5),
        ("VALIGN",        (0,0), (-1,-1), "MIDDLE"),
    ]))
    return t

# ── Helper: bullet list ──────────────────────────────────────────────────────
def bullet_table(items, bg=BLUE_BG, tc=BLACK):
    rows = []
    for item in items:
        rows.append([
            Paragraph("•", S("_b", fontSize=8, textColor=RED, fontName="Helvetica-Bold", leading=10)),
            Paragraph(item, S("_bi", fontSize=7.8, textColor=tc, leading=10))
        ])
    t = Table(rows, colWidths=[6*mm, CW - 6*mm])
    t.setStyle(TableStyle([
        ("BACKGROUND",   (0,0),(-1,-1), bg),
        ("TOPPADDING",   (0,0),(-1,-1), 2),
        ("BOTTOMPADDING",(0,0),(-1,-1), 2),
        ("LEFTPADDING",  (0,0),(-1,-1), 3),
        ("RIGHTPADDING", (0,0),(-1,-1), 3),
        ("VALIGN",       (0,0),(-1,-1), "TOP"),
    ]))
    return t

sp = lambda n=4: Spacer(1, n*mm)

# ════════════════════════════════════════════════════════════════════════════
# BUILD STORY
# ════════════════════════════════════════════════════════════════════════════
story = []

# ── BANNER ───────────────────────────────────────────────────────────────────
banner_data = [
    [Paragraph("🫀  STEMI  MANAGEMENT  ALGORITHM", h_banner)],
    [Paragraph("Emergency Department Quick Reference  •  AHA/ACC Guidelines", h_sub)],
]
banner = Table(banner_data, colWidths=[CW])
banner.setStyle(TableStyle([
    ("BACKGROUND",   (0,0),(-1,-1), DARK_RED),
    ("TOPPADDING",   (0,0),(-1,-1), 8),
    ("BOTTOMPADDING",(0,0),(-1,-1), 8),
    ("LEFTPADDING",  (0,0),(-1,-1), 10),
    ("RIGHTPADDING", (0,0),(-1,-1), 10),
    ("ROUNDEDCORNERS", [5]),
]))
story.append(banner)
story.append(sp(3))

# ── KEY PRINCIPLE ────────────────────────────────────────────────────────────
story.append(alert_box(
    "⏱  TIME IS MUSCLE  —  Mortality is directly proportional to total ischemia time.  "
    "Every 30-minute delay in reperfusion = ~7.5% increase in 1-year mortality.",
    bg=colors.HexColor("#FDEDEC"), tc=DARK_RED
))
story.append(sp(3))

# ════════════════  STEP 1  ════════════════════════════════════════════════════
story.append(section_box("STEP 1  —  IMMEDIATE RECOGNITION & STABILIZATION  (First 10 Minutes)", bg=RED))
story.append(sp(2))

step1_rows = [
    ["12-lead ECG", "<b>Within 10 minutes of arrival</b> — paramount to diagnosis"],
    ["IV Access", "Two large-bore IVs; draw bloods simultaneously"],
    ["Supplemental O₂", "Only if SpO₂ <90% — avoid routine hyperoxia"],
    ["Continuous Telemetry", "VF causes ~50% of STEMI deaths — monitor immediately"],
    ["Portable CXR", "Rule out pulmonary oedema, aortic dissection"],
    ["Urine Pregnancy Test", "Mandatory in all women of reproductive age"],
    ["Labs", "Troponin, CBC, aPTT/PT/INR, BMP, Mg²⁺, lipid profile, type & screen"],
]
# render with bold in second col
step1_data = [[Paragraph("Action", cell_hdr), Paragraph("Detail", cell_hdr)]]
for r in step1_rows:
    step1_data.append([
        Paragraph(r[0], cell_bold),
        Paragraph(r[1], cell_body),
    ])
step1_t = Table(step1_data, colWidths=[CW*0.30, CW*0.70])
step1_t.setStyle(TableStyle([
    ("BACKGROUND",    (0,0),(-1,0), RED),
    ("ROWBACKGROUNDS",(0,1),(-1,-1),[WHITE, GREY_BG]),
    ("GRID",          (0,0),(-1,-1), 0.4, colors.HexColor("#BFC9CA")),
    ("TOPPADDING",    (0,0),(-1,-1), 3), ("BOTTOMPADDING",(0,0),(-1,-1), 3),
    ("LEFTPADDING",   (0,0),(-1,-1), 5), ("RIGHTPADDING", (0,0),(-1,-1), 5),
    ("VALIGN",        (0,0),(-1,-1), "MIDDLE"),
]))
story.append(step1_t)
story.append(sp(2))
story.append(alert_box(
    "⚠  Do NOT wait for troponin results to initiate reperfusion — ECG + clinical picture is sufficient.",
    bg=YELLOW_BG, tc=colors.HexColor("#784212")
))
story.append(sp(3))

# ════════════════  ECG LOCALISATION  ══════════════════════════════════════════
story.append(section_box("ECG-BASED TERRITORY LOCALISATION", bg=GREY_DARK))
story.append(sp(2))

ecg_rows = [
    ["V₁–V₆ or new LBBB", "Anterior + Septal (large)", "Proximal LAD or Left Main"],
    ["V₂–V₄",             "Anterior wall",             "LAD"],
    ["V₅–V₆",             "Lateral wall",              "LCX"],
    ["II, III, aVF",       "Inferior wall",             "RCA or LCX"],
    ["I, aVL",             "High lateral wall",         "Diagonal / Proximal LCX"],
    ["V₁–V₂ depression → get V₇–V₉", "Posterior",     "RCA or LCX"],
]
story.append(three_col(
    ["ST Elevation In", "Territory", "Culprit Artery"],
    ecg_rows,
    col_w=[CW*0.36, CW*0.32, CW*0.32],
    hdr_bg=GREY_DARK
))
story.append(sp(1))
story.append(Paragraph(
    "⚠  For <b>inferior STEMI</b>: always obtain right-sided leads (V3R / V4R) — "
    "RV infarction changes management (IV fluids, avoid nitrates).",
    S("_inf", fontSize=7.5, textColor=DARK_RED, fontName="Helvetica-Bold", leading=10)
))
story.append(sp(3))

# ════════════════  STEP 2  ════════════════════════════════════════════════════
story.append(section_box("STEP 2  —  UPSTREAM MEDICAL THERAPY  (Give Immediately)", bg=BLUE))
story.append(sp(2))

# Antiplatelets
story.append(Paragraph("DUAL ANTIPLATELET THERAPY (DAPT)", S("_sh2", fontSize=8.5,
    fontName="Helvetica-Bold", textColor=BLUE, leading=11)))
story.append(sp(1))
apt_rows = [
    ["<b>Aspirin (ASA)</b>",     "162–325 mg chewed/crushed",    "81 mg/day indefinitely"],
    ["<b>Ticagrelor</b> (preferred for PCI)", "180 mg loading", "90 mg twice daily + ASA 81 mg"],
    ["<b>Prasugrel</b> (alt for PCI)",  "60 mg loading",  "10 mg/day — Avoid if >75y, <60kg, stroke/TIA"],
    ["<b>Clopidogrel</b> (if fibrinolysis)", "300–600 mg loading", "75 mg/day"],
]
apt_data = [[Paragraph("Drug", cell_hdr), Paragraph("Loading Dose", cell_hdr),
             Paragraph("Maintenance / Notes", cell_hdr)]]
for r in apt_rows:
    apt_data.append([Paragraph(c, cell_body) for c in r])
apt_t = Table(apt_data, colWidths=[CW*0.30, CW*0.25, CW*0.45])
apt_t.setStyle(TableStyle([
    ("BACKGROUND",    (0,0),(-1,0), BLUE),
    ("ROWBACKGROUNDS",(0,1),(-1,-1),[WHITE, GREY_BG]),
    ("GRID",          (0,0),(-1,-1), 0.4, colors.HexColor("#BFC9CA")),
    ("TOPPADDING",    (0,0),(-1,-1), 3), ("BOTTOMPADDING",(0,0),(-1,-1), 3),
    ("LEFTPADDING",   (0,0),(-1,-1), 5), ("RIGHTPADDING", (0,0),(-1,-1), 5),
    ("VALIGN",        (0,0),(-1,-1), "MIDDLE"),
]))
story.append(apt_t)
story.append(sp(2))

# Anticoagulation
story.append(Paragraph("ANTICOAGULATION", S("_sh3", fontSize=8.5,
    fontName="Helvetica-Bold", textColor=BLUE, leading=11)))
story.append(sp(1))
ac_rows = [
    ["<b>UFH</b> (preferred for PCI)",    "60 U/kg IV bolus (max 4000 U)\nthen 12 U/kg/h",  "PCI or fibrinolysis; real-time monitoring with ACT"],
    ["<b>Enoxaparin (LMWH)</b>",          "30 mg IV bolus → 1 mg/kg SC q12h",              "Preferred with fibrinolysis"],
    ["<b>Bivalirudin</b>",                 "0.75 mg/kg bolus → 1.75 mg/kg/h",               "PCI; agent of choice in HIT; lower bleeding vs GPIIb/IIIa"],
    ["<b>Fondaparinux</b>",                "2.5 mg IV → 2.5 mg SC daily",                   "Fibrinolysis when no PCI planned"],
]
ac_data = [[Paragraph("Drug", cell_hdr), Paragraph("Dose", cell_hdr),
            Paragraph("Notes", cell_hdr)]]
for r in ac_rows:
    ac_data.append([Paragraph(c, cell_body) for c in r])
ac_t = Table(ac_data, colWidths=[CW*0.28, CW*0.33, CW*0.39])
ac_t.setStyle(TableStyle([
    ("BACKGROUND",    (0,0),(-1,0), BLUE),
    ("ROWBACKGROUNDS",(0,1),(-1,-1),[WHITE, GREY_BG]),
    ("GRID",          (0,0),(-1,-1), 0.4, colors.HexColor("#BFC9CA")),
    ("TOPPADDING",    (0,0),(-1,-1), 3), ("BOTTOMPADDING",(0,0),(-1,-1), 3),
    ("LEFTPADDING",   (0,0),(-1,-1), 5), ("RIGHTPADDING", (0,0),(-1,-1), 5),
    ("VALIGN",        (0,0),(-1,-1), "MIDDLE"),
]))
story.append(ac_t)
story.append(sp(2))

# Anti-ischaemic
story.append(Paragraph("ANTI-ISCHAEMIC THERAPY", S("_sh4", fontSize=8.5,
    fontName="Helvetica-Bold", textColor=BLUE, leading=11)))
story.append(sp(1))
ai_rows = [
    ["<b>Nitroglycerin</b>", "SL or IV infusion (titrate to SBP 100–140)",
     "<b>AVOID</b> if: SBP <90, HR >100 or <50, RV infarct, PDE5-inhibitor use in 48h"],
    ["<b>Morphine</b>", "2–4 mg IV (titrate)",
     "Refractory pain only — may mask ischaemic symptoms; use judiciously"],
    ["<b>Beta-blocker</b> (Metoprolol)", "12.5–25 mg oral q6h",
     "<b>AVOID</b> if: HF, cardiogenic shock, bradycardia, or hypotension (SBP <100)"],
]
ai_data = [[Paragraph("Drug", cell_hdr), Paragraph("Dose", cell_hdr),
            Paragraph("Notes / Contraindications", cell_hdr)]]
for r in ai_rows:
    ai_data.append([Paragraph(c, cell_body) for c in r])
ai_t = Table(ai_data, colWidths=[CW*0.28, CW*0.30, CW*0.42])
ai_t.setStyle(TableStyle([
    ("BACKGROUND",    (0,0),(-1,0), BLUE),
    ("ROWBACKGROUNDS",(0,1),(-1,-1),[WHITE, GREY_BG]),
    ("GRID",          (0,0),(-1,-1), 0.4, colors.HexColor("#BFC9CA")),
    ("TOPPADDING",    (0,0),(-1,-1), 3), ("BOTTOMPADDING",(0,0),(-1,-1), 3),
    ("LEFTPADDING",   (0,0),(-1,-1), 5), ("RIGHTPADDING", (0,0),(-1,-1), 5),
    ("VALIGN",        (0,0),(-1,-1), "MIDDLE"),
]))
story.append(ai_t)
story.append(sp(3))

# ════════════════  STEP 3  ════════════════════════════════════════════════════
story.append(section_box("STEP 3  —  REPERFUSION STRATEGY  (Most Critical Decision)", bg=GREEN))
story.append(sp(2))

# Reperfusion decision flowchart as a table
rep_decision = [
    [
        # PCI column
        Table([
            [Paragraph("PRIMARY PCI", S("_pcih", fontSize=9, fontName="Helvetica-Bold",
                textColor=WHITE, alignment=TA_CENTER, leading=11))],
            [Paragraph("Gold Standard", S("_pcis", fontSize=7.5, textColor=WHITE,
                alignment=TA_CENTER, leading=9))],
        ], colWidths=[(CW-4*mm)*0.5],
        style=[("BACKGROUND",(0,0),(-1,-1),GREEN),
               ("TOPPADDING",(0,0),(-1,-1),4),
               ("BOTTOMPADDING",(0,0),(-1,-1),4)]),
        # Fibrinolysis column
        Table([
            [Paragraph("FIBRINOLYSIS", S("_fibh", fontSize=9, fontName="Helvetica-Bold",
                textColor=WHITE, alignment=TA_CENTER, leading=11))],
            [Paragraph("When PCI not available in time", S("_fibs", fontSize=7.5,
                textColor=WHITE, alignment=TA_CENTER, leading=9))],
        ], colWidths=[(CW-4*mm)*0.5],
        style=[("BACKGROUND",(0,0),(-1,-1),ORANGE),
               ("TOPPADDING",(0,0),(-1,-1),4),
               ("BOTTOMPADDING",(0,0),(-1,-1),4)]),
    ]
]
rep_hdr = Table(rep_decision, colWidths=[(CW-4*mm)*0.5, (CW-4*mm)*0.5],
    style=[("TOPPADDING",(0,0),(-1,-1),0),("BOTTOMPADDING",(0,0),(-1,-1),0),
           ("LEFTPADDING",(0,0),(-1,-1),2),("RIGHTPADDING",(0,0),(-1,-1),2)])
story.append(rep_hdr)
story.append(sp(1))

rep_body = [
    [
        # PCI bullets
        Table([
            [Paragraph("• Door-to-balloon ≤ <b>90 min</b> from first medical contact", cell_body)],
            [Paragraph("• Transfer centres: first medical contact to PCI ≤ <b>120 min</b>", cell_body)],
            [Paragraph("• Superior vessel patency (TIMI-3), less reinfarction, less ICH", cell_body)],
            [Paragraph("• Symptoms <b>12–24 h</b>: PCI still beneficial if ongoing symptoms", cell_body)],
            [Paragraph("• <b>Always preferred</b>: cardiogenic shock, severe HF, fibrinolysis CI, uncertain diagnosis", cell_body)],
        ], colWidths=[(CW-4*mm)*0.5],
        style=[("BACKGROUND",(0,0),(-1,-1),GREEN_BG),
               ("TOPPADDING",(0,0),(-1,-1),2),("BOTTOMPADDING",(0,0),(-1,-1),2),
               ("LEFTPADDING",(0,0),(-1,-1),5),("RIGHTPADDING",(0,0),(-1,-1),5)]),
        # Fibrinolysis bullets
        Table([
            [Paragraph("• Use when PCI not available within <b>90–120 min</b>", cell_body)],
            [Paragraph("• Symptoms onset <b>< 12 hours</b>", cell_body)],
            [Paragraph("• Door-to-needle ≤ <b>30 min</b>", cell_body)],
            [Paragraph("• After fibrinolysis: transfer for angiography within <b>3–24 h</b>", cell_body)],
            [Paragraph("• <b>Rescue PCI</b> if: chest pain persists, <50% ST reduction at 90 min", cell_body)],
        ], colWidths=[(CW-4*mm)*0.5],
        style=[("BACKGROUND",(0,0),(-1,-1),colors.HexColor("#FEF5E7")),
               ("TOPPADDING",(0,0),(-1,-1),2),("BOTTOMPADDING",(0,0),(-1,-1),2),
               ("LEFTPADDING",(0,0),(-1,-1),5),("RIGHTPADDING",(0,0),(-1,-1),5)]),
    ]
]
rep_body_t = Table(rep_body, colWidths=[(CW-4*mm)*0.5, (CW-4*mm)*0.5],
    style=[("TOPPADDING",(0,0),(-1,-1),0),("BOTTOMPADDING",(0,0),(-1,-1),0),
           ("LEFTPADDING",(0,0),(-1,-1),2),("RIGHTPADDING",(0,0),(-1,-1),2),
           ("VALIGN",(0,0),(-1,-1),"TOP")])
story.append(rep_body_t)
story.append(sp(2))

# ── Fibrinolytic agents ───────────────────────────────────────────────────────
story.append(Paragraph("FIBRINOLYTIC AGENTS", S("_fib_hdr", fontSize=8.5,
    fontName="Helvetica-Bold", textColor=ORANGE, leading=11)))
story.append(sp(1))
fib_rows = [
    ["<b>Tenecteplase (TNK-tPA)</b> ★ Preferred", "0.5 mg/kg IV single bolus (30–50 mg)",
     "Single bolus — convenient; equivalent mortality benefit, lowest bleeding"],
    ["Alteplase (rt-PA)",      "15 mg IV bolus → 0.75 mg/kg/30 min → 0.5 mg/kg/60 min", "Fibrin-selective; no allergic reactions"],
    ["Reteplase (r-PA)",       "Two 10-unit IV boluses 30 min apart",                    "Double bolus; equivalent to rt-PA"],
    ["Streptokinase",          "1.5 million units IV over 60 min",                       "Cheapest; non-selective; allergic reactions 1–2%; avoid if prior use"],
]
fib_data = [[Paragraph("Agent", cell_hdr), Paragraph("Dose", cell_hdr),
             Paragraph("Notes", cell_hdr)]]
for r in fib_rows:
    fib_data.append([Paragraph(c, cell_body) for c in r])
fib_t = Table(fib_data, colWidths=[CW*0.30, CW*0.34, CW*0.36])
fib_t.setStyle(TableStyle([
    ("BACKGROUND",    (0,0),(-1,0), ORANGE),
    ("ROWBACKGROUNDS",(0,1),(-1,-1),[WHITE, GREY_BG]),
    ("GRID",          (0,0),(-1,-1), 0.4, colors.HexColor("#BFC9CA")),
    ("TOPPADDING",    (0,0),(-1,-1), 3), ("BOTTOMPADDING",(0,0),(-1,-1), 3),
    ("LEFTPADDING",   (0,0),(-1,-1), 5), ("RIGHTPADDING", (0,0),(-1,-1), 5),
    ("VALIGN",        (0,0),(-1,-1), "MIDDLE"),
]))
story.append(fib_t)
story.append(sp(2))

# ── Fibrinolysis contraindications ────────────────────────────────────────────
ci_left = [
    "<b>ABSOLUTE CONTRAINDICATIONS</b>",
    "Prior intracranial haemorrhage / haemorrhagic stroke",
    "Ischaemic stroke within 3 months",
    "Known cerebrovascular AVM / aneurysm / tumour",
    "Closed head injury within 3 months",
    "Active aortic dissection",
    "Active bleeding or bleeding diathesis",
    "Acute pericarditis",
    "SBP >180 or DBP >110 mmHg (uncontrolled)",
]
ci_right = [
    "<b>RELATIVE CONTRAINDICATIONS</b>",
    "Prior ischaemic stroke >3 months ago",
    "Recent internal bleeding (2–4 weeks)",
    "Major surgery within 3 weeks",
    "Prolonged / traumatic CPR >10 min",
    "Active peptic ulcer disease",
    "Non-compressible vascular punctures",
    "Pregnancy",
    "Oral anticoagulant use",
]
ci_rows = []
for i in range(max(len(ci_left), len(ci_right))):
    l = ci_left[i]  if i < len(ci_left)  else ""
    r = ci_right[i] if i < len(ci_right) else ""
    lc = S("_cil", fontSize=7.5, textColor=DARK_RED if i==0 else BLACK,
           fontName="Helvetica-Bold" if i==0 else "Helvetica", leading=10)
    rc = S("_cir", fontSize=7.5, textColor=DARK_RED if i==0 else BLACK,
           fontName="Helvetica-Bold" if i==0 else "Helvetica", leading=10)
    ci_rows.append([Paragraph(l, lc), Paragraph(r, rc)])
ci_t = Table(ci_rows, colWidths=[CW*0.50, CW*0.50])
ci_t.setStyle(TableStyle([
    ("BACKGROUND",    (0,0),(0,-1), colors.HexColor("#FDEDEC")),
    ("BACKGROUND",    (1,0),(1,-1), colors.HexColor("#FEF9E7")),
    ("GRID",          (0,0),(-1,-1), 0.4, colors.HexColor("#BFC9CA")),
    ("TOPPADDING",    (0,0),(-1,-1), 2), ("BOTTOMPADDING",(0,0),(-1,-1), 2),
    ("LEFTPADDING",   (0,0),(-1,-1), 5), ("RIGHTPADDING", (0,0),(-1,-1), 5),
    ("VALIGN",        (0,0),(-1,-1), "MIDDLE"),
]))
story.append(Paragraph("CONTRAINDICATIONS TO FIBRINOLYSIS", S("_ci_hdr", fontSize=8.5,
    fontName="Helvetica-Bold", textColor=DARK_RED, leading=11)))
story.append(sp(1))
story.append(ci_t)
story.append(sp(2))

# ── Signs of successful reperfusion ──────────────────────────────────────────
rep_signs = [
    "Relief of chest pain / angina",
    ">50% reduction in ST-segment elevation at 90 minutes",
    "Reperfusion arrhythmia (accelerated idioventricular rhythm)",
]
story.append(Paragraph("SIGNS OF SUCCESSFUL REPERFUSION", S("_rep_hdr", fontSize=8.5,
    fontName="Helvetica-Bold", textColor=GREEN, leading=11)))
story.append(sp(1))
story.append(bullet_table(rep_signs, bg=GREEN_BG))
story.append(sp(3))

# ════════════════  STEP 4 — POST-STEMI THERAPY  ════════════════════════════
story.append(section_box("STEP 4  —  POST-STEMI LONG-TERM MEDICAL THERAPY", bg=DARK_RED))
story.append(sp(2))

post_rows = [
    ["<b>Aspirin (ASA)</b>",           "81 mg/day",                                  "Indefinitely"],
    ["<b>P2Y12 Inhibitor (DAPT)</b>",  "Ticagrelor 90 mg BD  OR  Clopidogrel 75 mg/day", "Minimum <b>12 months</b>"],
    ["<b>Beta-blocker</b>",            "Metoprolol succinate (titrate up)",           "Indefinitely — start within 24 h"],
    ["<b>ACE Inhibitor</b>",           "Captopril 6.25 mg → titrate  OR  Ramipril",  "All patients; within 24 h; EF <40% derives most benefit"],
    ["<b>ARB</b>",                      "Valsartan / Losartan",                       "If ACE-I intolerant"],
    ["<b>High-intensity Statin</b>",   "Atorvastatin 40–80 mg  OR  Rosuvastatin 20–40 mg",
     "Target LDL <70 mg/dL or ≥50% reduction; add PCSK9i / ezetimibe if needed"],
    ["<b>Aldosterone Antagonist</b>",  "Eplerenone / Spironolactone",                "EF <40% + HF or diabetes; caution in hyperkalaemia / renal impairment"],
]
post_data = [[Paragraph("Drug Class", cell_hdr), Paragraph("Agent / Dose", cell_hdr),
              Paragraph("Duration / Notes", cell_hdr)]]
for r in post_rows:
    post_data.append([Paragraph(c, cell_body) for c in r])
post_t = Table(post_data, colWidths=[CW*0.25, CW*0.37, CW*0.38])
post_t.setStyle(TableStyle([
    ("BACKGROUND",    (0,0),(-1,0), DARK_RED),
    ("ROWBACKGROUNDS",(0,1),(-1,-1),[WHITE, GREY_BG]),
    ("GRID",          (0,0),(-1,-1), 0.4, colors.HexColor("#BFC9CA")),
    ("TOPPADDING",    (0,0),(-1,-1), 3), ("BOTTOMPADDING",(0,0),(-1,-1), 3),
    ("LEFTPADDING",   (0,0),(-1,-1), 5), ("RIGHTPADDING", (0,0),(-1,-1), 5),
    ("VALIGN",        (0,0),(-1,-1), "MIDDLE"),
]))
story.append(post_t)
story.append(sp(3))

# ════════════════  KEY TIME TARGETS  ══════════════════════════════════════════
story.append(section_box("KEY TIME TARGETS  —  AHA/ACC", bg=colors.HexColor("#117A65")))
story.append(sp(2))

time_data = [
    [Paragraph("Target", cell_hdr), Paragraph("Time", cell_hdr), Paragraph("Notes", cell_hdr)],
    [Paragraph("ECG from patient arrival", cell_body),
     Paragraph("<b>≤ 10 min</b>", S("_tm1",fontSize=8,fontName="Helvetica-Bold",
               textColor=DARK_RED,leading=10)),
     Paragraph("Paramount — initiate MI protocol immediately", cell_body)],
    [Paragraph("Door-to-balloon (PCI at same centre)", cell_body),
     Paragraph("<b>≤ 90 min</b>", S("_tm2",fontSize=8,fontName="Helvetica-Bold",
               textColor=DARK_RED,leading=10)),
     Paragraph("From first medical contact", cell_body)],
    [Paragraph("First medical contact to PCI (transfer)", cell_body),
     Paragraph("<b>≤ 120 min</b>", S("_tm3",fontSize=8,fontName="Helvetica-Bold",
               textColor=DARK_RED,leading=10)),
     Paragraph("Transfer if PCI achievable within this window", cell_body)],
    [Paragraph("Door-to-needle (fibrinolysis)", cell_body),
     Paragraph("<b>≤ 30 min</b>", S("_tm4",fontSize=8,fontName="Helvetica-Bold",
               textColor=DARK_RED,leading=10)),
     Paragraph("If PCI not available within 90–120 min window", cell_body)],
    [Paragraph("Symptom onset — fibrinolysis benefit", cell_body),
     Paragraph("<b>< 12 h</b>", S("_tm5",fontSize=8,fontName="Helvetica-Bold",
               textColor=DARK_RED,leading=10)),
     Paragraph("Greatest benefit in first 3 hours", cell_body)],
]
time_t = Table(time_data, colWidths=[CW*0.40, CW*0.20, CW*0.40])
time_t.setStyle(TableStyle([
    ("BACKGROUND",    (0,0),(-1,0), colors.HexColor("#117A65")),
    ("ROWBACKGROUNDS",(0,1),(-1,-1),[WHITE, GREY_BG]),
    ("GRID",          (0,0),(-1,-1), 0.4, colors.HexColor("#BFC9CA")),
    ("TOPPADDING",    (0,0),(-1,-1), 3), ("BOTTOMPADDING",(0,0),(-1,-1), 3),
    ("LEFTPADDING",   (0,0),(-1,-1), 5), ("RIGHTPADDING", (0,0),(-1,-1), 5),
    ("VALIGN",        (0,0),(-1,-1), "MIDDLE"),
    ("ALIGN",         (1,0),(1,-1), "CENTER"),
]))
story.append(time_t)
story.append(sp(3))

# ════════════════  CCU / PERI-INFARCT CARE  ══════════════════════════════════
story.append(section_box("CCU ADMISSION ORDERS & MONITORING", bg=GREY_DARK))
story.append(sp(2))
ccu_items = [
    "Admit to CCU / coronary care with continuous telemetry for ≥24 hours",
    "Vital signs q1h until stable; notify if HR >100 or <50, SBP <90 or >150, SpO₂ <90%",
    "Activity: bed rest >12 h; light activity when stable and pain-free",
    "Diet: NPO (sips of water) until pain-free; then 2 g sodium heart-healthy diet",
    "Serial ECGs daily; assess for recurrent chest pain, new murmurs, HF signs",
    "Baseline echocardiogram: document EF, wall motion, valvular lesions, LV thrombus",
    "Pacing readiness: AV block in anterior MI is unstable — requires temporary then permanent pacemaker",
    "Stool softener, anxiolytic/hypnotic as needed",
]
story.append(bullet_table(ccu_items, bg=BLUE_BG))
story.append(sp(3))

# ════════════════  COMPLICATIONS TO WATCH  ═══════════════════════════════════
story.append(section_box("MECHANICAL COMPLICATIONS TO WATCH", bg=colors.HexColor("#6C3483")))
story.append(sp(2))
comp_rows = [
    ["<b>Free wall rupture</b>",      "Sudden haemodynamic collapse, tamponade",                       "Emergency surgery — mortality 90%"],
    ["<b>VSD (papillary / septal)</b>","New harsh pan-systolic murmur + haemodynamic deterioration",   "Emergency surgery / percutaneous closure"],
    ["<b>Papillary muscle rupture</b>","Sudden pulmonary oedema, new mitral regurgitation murmur",      "Emergency mitral valve surgery"],
    ["<b>RV infarction</b>",          "Inferior STEMI + hypotension + JVD + clear lungs",              "IV fluids, avoid nitrates / diuretics"],
    ["<b>LV thrombus</b>",            "EF <40%, anterior MI — echocardiography",                       "Anticoagulation 3–6 months"],
    ["<b>Ventricular fibrillation</b>","Accounts for ~50% early STEMI mortality",                      "Immediate defibrillation; telemetry mandatory"],
]
comp_data = [[Paragraph("Complication", cell_hdr), Paragraph("Presentation", cell_hdr),
              Paragraph("Management", cell_hdr)]]
for r in comp_rows:
    comp_data.append([Paragraph(c, cell_body) for c in r])
comp_t = Table(comp_data, colWidths=[CW*0.27, CW*0.37, CW*0.36])
comp_t.setStyle(TableStyle([
    ("BACKGROUND",    (0,0),(-1,0), colors.HexColor("#6C3483")),
    ("ROWBACKGROUNDS",(0,1),(-1,-1),[WHITE, GREY_BG]),
    ("GRID",          (0,0),(-1,-1), 0.4, colors.HexColor("#BFC9CA")),
    ("TOPPADDING",    (0,0),(-1,-1), 3), ("BOTTOMPADDING",(0,0),(-1,-1), 3),
    ("LEFTPADDING",   (0,0),(-1,-1), 5), ("RIGHTPADDING", (0,0),(-1,-1), 5),
    ("VALIGN",        (0,0),(-1,-1), "MIDDLE"),
]))
story.append(comp_t)
story.append(sp(3))

# ════════════════  FOOTER  ════════════════════════════════════════════════════
story.append(HRFlowable(width=CW, thickness=0.5, color=GREY_DARK))
story.append(sp(1))
story.append(Paragraph(
    "Sources: The Washington Manual of Medical Therapeutics • Goldman-Cecil Medicine • "
    "Fuster & Hurst's The Heart 15E • AHA/ACC STEMI Guidelines  |  "
    "Generated by Orris Clinical AI  •  For clinical decision support only — always apply individual patient judgement.",
    footer_s
))

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

cd /home/daytona/workspace/stemi-pdf && python3 create_stemi_pdf.py 2>&1

Running Command

ls -lh /home/daytona/workspace/stemi-pdf/STEMI_ED_Algorithm.pdf

Running Command

python3 -c " from pypdf import PdfReader r = PdfReader('/home/daytona/workspace/…

Your STEMI ED Algorithm PDF is ready - 3 pages, fully formatted for clinical quick reference.

STEMI ED Algorithm

PDF Document · PDF


What's Inside (3 pages):

SectionContent
Banner + Key PrincipleTime-is-muscle alert with mortality stats
Step 1 - Immediate Stabilization10-minute actions, O2, IV, telemetry, labs table
ECG Territory Localisation6-lead territory/coronary artery table + RV infarct warning
Step 2 - Upstream Medical TherapyDAPT table (aspirin/ticagrelor/prasugrel/clopidogrel) + anticoagulation table (UFH/LMWH/bivalirudin) + anti-ischaemic drugs
Step 3 - Reperfusion StrategyPCI vs Fibrinolysis side-by-side with time targets, fibrinolytic agents (TNK preferred), absolute/relative contraindications to thrombolysis, signs of successful reperfusion
Step 4 - Post-STEMI TherapyLong-term drug table (ASA, P2Y12, BB, ACEi, statin, aldosterone antagonist)
Key Time TargetsAll AHA/ACC targets in one colour-coded table
CCU Admission OrdersMonitoring, diet, activity, pacing guidance
Mechanical ComplicationsFree wall rupture, VSD, papillary rupture, RV infarct, LV thrombus, VF
FooterSource citations

Management of Non STEMI

Finding Sources
Searching PubMed

"NSTEMI" AND "management" AND "guidelines"

Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Loading Image
Loading Image
Here is the full, structured NSTEMI/UA management guide:

Management of NSTEMI / Unstable Angina (UA)

Key distinction from STEMI: NSTEMI involves incomplete coronary occlusion with subendocardial ischemia. There is no immediate mandatory reperfusion window - the priority is risk stratification, antithrombotic therapy, and timing the invasive strategy appropriately.

Definition & Key Differences

FeatureUANSTEMI
TroponinNegativePositive (myocardial necrosis)
ECGNo persistent ST elevationNo ST elevation; may have depression, T-wave inversion
MechanismPartial occlusion, no necrosisPartial occlusion + necrosis
MortalityLower short-termHigher short-term than UA, similar long-term to STEMI
Approximately 70% of all ACS presentations are NSTEMI/UA. At 1 year: ~6% death, ~11% recurrent MI, ~50-60% need revascularization.

STEP 1 - Immediate Assessment & Diagnosis

ECG (within 10 minutes)

  • ~50% of NSTEMI/UA patients have significant ECG changes
  • ST depression ≥0.5 mm in V2-V3 or ≥1 mm in other leads = myocardial ischemia
  • ST depression in multiple leads + ST elevation in aVR/V1 = left main or multivessel disease (high risk)
  • Wellens syndrome (biphasic or deeply inverted T waves in V2-V4 + QT prolongation) = critical proximal LAD lesion - do NOT stress test; go straight to angiography
  • Serial ECGs to detect dynamic changes

Biomarkers

  • High-sensitivity Troponin (hsTn): at 0h, 1h, 3h - most sensitive/specific marker
  • CK-MB no longer recommended as initial diagnostic marker
  • BNP elevation in ACS = large infarct, worse prognosis, consider urgent angiography

STEP 2 - Risk Stratification

TIMI Risk Score (1 point each = 7 total)

TIMI Risk Score outcomes
Criterion1 Point
Age >65 years
Known CAD (stenosis >50%)
≥2 angina episodes in 24 hours
ST-segment or T-wave changes
Elevated cardiac biomarkers
Aspirin use in last 7 days
≥3 CAD risk factors (family hx, DM, HTN, hyperlipidaemia, smoking)
Score 0-1: Low risk (~4%) | Score 2: ~7% | Score 3-4: ~12-19% | Score 5: ~26% | Score 6-7: ~41% (14-day death, MI, or urgent revascularization)

STEP 3 - Invasive Strategy Selection

NSTEMI ACS management flowchart
StrategyTimingIndications
Immediate/Urgent Invasive<2 hours (like STEMI)Refractory angina; haemodynamic instability/shock; new HF/MR; sustained VT or VF
Early Invasive<24 hoursTIMI ≥3 or GRACE >140; rapid troponin rise; new ST depressions
Delayed Invasive24-72 hoursDiabetes; renal insufficiency (GFR <60); EF <40%; prior PCI <6 months; prior CABG; TIMI ≥2 or GRACE 109-140
Ischaemia-Driven (Conservative)No routine angioLow risk (TIMI ≤1, GRACE <109); low-risk biomarker-negative females; patient preference
In the ischaemia-driven approach: if no high-risk features develop, perform non-invasive stress testing - must be angina-free ≥12 hours prior. Proceed to angiography if high-risk stress test, LVEF <40%, or recurrent symptoms.

STEP 4 - Medical Therapy (All Patients, All Strategies)

Anti-Ischaemic Therapy

DrugDoseNotes
Nitroglycerin (SL)0.3-0.6 mg SL q5 min x3First-line for ischaemic pain
Nitroglycerin (IV)5-10 µg/min, increase by 10 µg/min q3-5 min (max 200 µg/min)For recurrent angina, uncontrolled HTN, or HF; avoid if SBP <90, PDE5 inhibitor use within 24-48h, RV infarct
Beta-blocker (Metoprolol)Target HR 50-60 bpm (oral preferred)Start early; avoid if acute/severe HF, low cardiac output, bradycardia, heart block, active bronchospasm
Calcium channel blocker (Diltiazem/Verapamil)Per dosingIf persistent ischaemia despite full-dose nitrates + BB, or if BB contraindicated
Morphine1-5 mg IV q5-30 minRefractory severe pain only; use judiciously - may mask symptoms
O2Titrate to SpO2 ≥90%Only if hypoxaemic - routine O2 is not indicated

Antiplatelet Therapy (DAPT - Mandatory)

DrugLoading DoseMaintenanceNotes
Aspirin (ASA)162-325 mg chewed75-100 mg/day indefinitelyFirst-line; give immediately
Ticagrelor (preferred)180 mg90 mg twice daily (≤100 mg ASA)Superior to clopidogrel; higher bleeding; avoid if prior intracranial haemorrhage
Prasugrel60 mg10 mg/dayOnly for PCI; avoid if >75y, <60kg, history of stroke/TIA
Clopidogrel300-600 mg75 mg/dayUse if ticagrelor/prasugrel unavailable or contraindicated
GPIIb/IIIa inhibitors (eptifibatide, tirofiban)Per protocolInfusionReserve for high thrombus burden during PCI or thrombotic PCI complications - not routine
DAPT duration: Minimum 12 months regardless of revascularization. May shorten to 3-6 months in high bleeding risk + low ischaemic risk patients.

Anticoagulation

DrugDoseNotes
UFH60 U/kg IV bolus (max 4000 U) → 12 U/kg/h (aPTT 1.5-2x normal)Standard for PCI; easy to reverse
Enoxaparin (LMWH)1 mg/kg SC q12hPreferred with fibrinolysis; continue until discharge or up to 8 days
Bivalirudin0.75 mg/kg bolus → 1.75 mg/kg/hPCI alternative; choice in HIT; lower bleeding
Fondaparinux2.5 mg SC dailyConservative strategy; least bleeding risk; do NOT use alone at PCI (risk of catheter thrombosis)
Anticoagulation should be initiated in all NSTEMI/UA patients regardless of chosen strategy.

STEP 5 - Long-Term Secondary Prevention

DrugTarget/DurationNotes
Aspirin 75-100 mgIndefinitely
P2Y12 inhibitor (ticagrelor or prasugrel preferred over clopidogrel)12 months minimumExtend >12 months in high thrombotic risk; reduce ticagrelor to 60 mg BD after 1 year
Beta-blockerIndefinitely
ACE inhibitor / ARBIndefinitelyAll ACS patients; especially EF <40%, DM, HTN
High-intensity statinLDL <55 mg/dL (ESC) or LDL <70 mg/dL (ACC/AHA); ≥50% reductionAtorvastatin 80 mg or Rosuvastatin 40 mg; add ezetimibe or PCSK9 inhibitor if target not reached
SGLT2 inhibitor / GLP-1 RAPer indicationIn patients with type 2 diabetes; cardiovascular outcome benefit
Aldosterone antagonistEF <40% + HF or DMEplerenone/Spironolactone
LDL target: ESC 2023 guidelines recommend <55 mg/dL with ≥50% reduction from baseline for very high-risk patients (post-ACS). - Harrison's 22E (2025)

Key Differences: NSTEMI vs STEMI Management

FeatureSTEMINSTEMI/UA
Reperfusion urgencyImmediate (door-to-balloon ≤90 min)Risk-stratified (urgent only if haemodynamically unstable)
FibrinolysisYes (if PCI unavailable)No - fibrinolysis not indicated
DAPTImmediateImmediate
AnticoagulationYesYes
Timing of angiographyImmediate2h / 24h / 72h based on risk

Special Notes

  • Women with NSTEMI/UA have worse short- and long-term outcomes and are undertreated - ensure equal application of guideline-directed therapy
  • Wellens syndrome (critical LAD lesion) - ECG may be normal or show T-wave changes between episodes; do not stress test; proceed to urgent angiography
  • ST depression multivessel pattern + aVR elevation = left main disease - treat as very high risk
  • If triple therapy (ASA + P2Y12 + anticoagulant for AF): keep triple therapy duration minimal; stop ASA at discharge or 1 week, continue anticoagulant + clopidogrel until month 12, then anticoagulant alone
Sources: The Washington Manual of Medical Therapeutics; Harrison's Principles of Internal Medicine 22E (2025); Goldman-Cecil Medicine
This is a shared conversation. Sign in to Orris to start your own chat.