heart attack in detail point wise manner

Reading File
Now let me search the medical library for comprehensive heart attack content in parallel:
Finding Sources
Finding Sources
Searching PubMed

"myocardial infarction"[MeSH Terms] AND management

Now let me read the most comprehensive sections from Braunwald's Heart Disease, Ganong's, and Harrison's in parallel:
Reading File
Reading File
Reading File
Now let me read more from Robbins Pathology and also get clinical management details from Sabiston and Goldman-Cecil:
Reading File
Reading File
Reading File
Now let me get clinical presentation and management details from Harrison's and Goldman-Cecil, plus the pathological morphology from Robbins:
Finding Sources
Reading File
Now let me get the morphological changes timeline, complications, and treatment from relevant textbooks:
Reading File
Reading File
Finding Sources
Now let me read the treatment section from Symptom to Diagnosis and the morphology table from Robbins:
Reading File
Reading File
I now have comprehensive data from multiple authoritative sources. Let me compile the full detailed answer.
Loading Image
Loading Image
I now have all the information needed for a comprehensive, point-wise answer. Here is the full detailed response:

Heart Attack (Myocardial Infarction) - A Complete Point-wise Overview


1. Definition

  • Myocardial infarction (MI), commonly called a "heart attack," is necrosis of the heart muscle resulting from ischemia.
  • The 2018 joint U.S./European Cardiology task force defines it as: "The presence of acute myocardial injury detected by abnormal cardiac biomarkers in the setting of evidence of acute myocardial ischemia."
  • The underlying damage is irreversible once ischemia persists beyond 20-40 minutes - Robbins & Kumar Basic Pathology, p. 354

2. Epidemiology & Risk Factors

  • ~10% of MIs occur before age 40; ~45% occur before age 65.
  • Men are at greater risk than women; however, the gap narrows with age.
  • Women are relatively protected during reproductive years, but menopause (declining estrogen) accelerates coronary artery disease.
  • IHD is the most common cause of death in older adult women.
  • Risk factors mirror those for atherosclerosis: hypertension, dyslipidemia, diabetes, smoking, obesity, family history, sedentary lifestyle - Robbins & Kumar Basic Pathology, p. 353

3. Classification (Types of MI)

Type 1 MI:
  • Caused by atherosclerotic plaque rupture with acute thrombosis.
  • Divided into STEMI (ST-elevation MI) and NSTEMI (non-ST-elevation MI).
  • Treatment is revascularization (PCI or thrombolysis).
Type 2 MI:
  • Caused by supply-demand mismatch (demand ischemia) - not plaque rupture.
  • Examples: severe anemia, tachycardia, hypotension, hypertensive crisis.
  • Treatment targets reducing cardiac oxygen demand.
Acute Coronary Syndrome (ACS) spectrum:
  • STEMI → NSTEMI → Unstable Angina (no biomarker elevation in UA).
    • Sabiston Textbook of Surgery, p. 2928

4. Pathogenesis - The Step-by-Step Sequence

In a typical MI, the following cascade occurs:
  1. Plaque disruption - An atheromatous plaque is eroded or suddenly disrupted by endothelial injury, intraplaque hemorrhage, or mechanical forces, exposing subendothelial collagen and necrotic plaque contents to blood.
  2. Platelet activation - Platelets adhere, aggregate, and release thromboxane A₂, ADP, and serotonin, causing further platelet aggregation and vasospasm.
  3. Coagulation cascade activation - Exposure of tissue factor activates coagulation, adding to the growing thrombus.
  4. Complete occlusion - The enlarging thrombus may completely occlude the coronary artery lumen within minutes.
  • Angiography within 4 hours shows coronary thrombosis in ~90% of cases; by 12-24 hours, only 60% (some occlusions spontaneously lyse).
  • 10% of MIs occur without occlusive atherosclerosis - causes include vasospasm, embolism from atrial fibrillation, or valve vegetations. - Robbins & Kumar Basic Pathology, p. 353

5. Progression of Myocardial Necrosis

Progression of myocardial necrosis from 0 to 24 hours after coronary occlusion
  • Within seconds: aerobic metabolism ceases; ATP drops; lactic acid accumulates.
  • Within minutes: loss of contractility (reversible at this stage).
  • 20-40 minutes: irreversible damage begins; sarcolemmal membrane disruption allows intracellular macromolecules (troponins) to leak out.
  • Necrosis begins in the subendocardial zone (most vulnerable - furthest from epicardial vessels, highest intramural pressure).
  • A wavefront of cell death then moves outward toward the epicardium.
  • Without intervention, a transmural infarct develops fully in 3-6 hours. - Robbins & Kumar Basic Pathology, p. 354-355

6. Infarct Location by Artery Involved

Patterns of transmural vs. non-transmural infarction based on vessel occlusion
Artery% of MIsTerritory Affected
Left Anterior Descending (LAD)40-50%Anterior LV wall, anterior 2/3 of septum, cardiac apex
Right Coronary Artery (RCA)30-40%Right ventricle, posterior LV wall, posterior 1/3 of septum
Left Circumflex (LCX)15-20%Lateral left ventricle
  • Proximal LAD occlusions are often fatal; distal occlusions may affect only the apex.
  • Isolated RV infarcts occur in only 1-3% of IHD cases.
    • Robbins & Kumar Basic Pathology, p. 355-356

Types of Infarcts:

  • Transmural infarct - Full thickness of ventricular wall; from total epicardial vessel occlusion (classic STEMI).
  • Subendocardial infarct - Limited to inner 1/3 of myocardium; often from partial/transient occlusion or severe global hypoperfusion (NSTEMI pattern).
  • Microscopic infarct - Small-vessel occlusions (vasculitis, emboli, cocaine-induced vasospasm); may show no ECG changes.

7. Morphological Changes Over Time (Pathological Timeline)

Time FrameGross FeaturesLight MicroscopyElectron Microscopy
0-30 minNone (reversible)NoneRelaxation of myofibrils; glycogen loss; mitochondrial swelling
30 min - 4 hrsNoneVariable fiber waviness at borderSarcolemmal disruption; mitochondrial amorphous densities
4-12 hrsOccasional dark mottlingCoagulation necrosis onset; edema; hemorrhage-
12-24 hrsDark mottlingCoagulation necrosis; pyknotic nuclei; hypereosinophilic myocytes; early neutrophilic infiltrate-
1-3 daysYellow-tan infarct centerCoagulation necrosis with loss of nuclei and striations; increased neutrophils-
3-7 daysHyperemic border; central softeningNeutrophil disintegration; macrophage phagocytosis begins at border-
7-10 daysMaximally yellow-tan and softWell-developed macrophage phagocytosis; early granulation tissue at margins-
10-14 daysRed-gray depressed bordersWell-established granulation tissue-
2-8 weeksGray-white scar formingCollagen deposition-
>2 monthsDense white scarDense collagen scar; fully healed-
  • Myocardial necrosis proceeds invariably to scar - no significant regeneration occurs. - Robbins & Kumar Basic Pathology, p. 357

8. Clinical Features (Symptoms)

Classic Presentation:
  • Crushing/squeezing chest pain - central, often described as "pressure," "tightness," or "heaviness"
  • Radiation - to left arm, jaw, neck, back, or epigastrium
  • Duration - typically >30 minutes (unlike angina which resolves within 20 min)
  • Diaphoresis (profuse sweating)
  • Nausea and vomiting
  • Dyspnea (shortness of breath)
  • Anxiety and sense of impending doom
  • Palpitations (from arrhythmias)
Atypical Presentations (especially in women, elderly, diabetics):
  • Epigastric pain or indigestion
  • Fatigue, weakness
  • Jaw or arm pain alone
  • Silent MI (no pain, detected only on ECG or biomarkers)
  • Women more often present without chest pain, which leads to delayed and less aggressive care - Symptom to Diagnosis, p. 175

9. ECG Changes

Three key electrical changes occur:
  1. Rapid repolarization of infarcted cells → current flows out of infarct → ST segment elevation
  2. Decreased resting membrane potential (K⁺ leaks out) → current flows into infarct during diastole → TQ depression (recorded as ST elevation)
  3. Delayed depolarization of infarcted cells → also causes ST segment elevation
ECG Evolution:
  • Acute (hours): ST segment elevation in leads overlying the infarct; reciprocal ST depression in opposite leads
  • Days to weeks: ST changes subside; Q waves appear (electrically silent dead muscle)
  • Chronic: Q waves persist as a permanent marker of prior infarction
  • NSTEMI: ST depression or T-wave changes, but no ST elevation; no Q waves typically
  • Non-Q-wave infarcts tend to be less severe but carry high risk of reinfarction - Ganong's Review of Medical Physiology, p. 534-535

10. Cardiac Biomarkers

  • Cardiac Troponin I and T - Most specific and sensitive; rise within 3-6 hours, peak at 12-24 hours, remain elevated 7-14 days (troponin T can persist up to 2 weeks).
  • CK-MB - Rises within 3-6 hours; returns to normal within 48-72 hours (useful for detecting reinfarction).
  • Myoglobin - Earliest to rise (1-3 hours) but not cardiac-specific; used for early rule-out.
  • LDH - Rises later (24-48 hrs); was used historically but largely replaced by troponins.
  • The 4th Universal Definition of MI classifies infarction based on rising/falling troponin pattern with at least one value above the 99th percentile. - Tietz Textbook of Laboratory Medicine, 7th Edition

11. Causes of Death After Acute MI

From Guyton & Hall:
  1. Decreased cardiac output (Cardiogenic shock) - Occurs when >40% of left ventricle is infarcted; mortality 40-50%. The infarcted segment undergoes systolic stretch (bulges outward during systole instead of contracting), further reducing effective pumping force.
  2. Pulmonary edema - Blood backs up into pulmonary circulation; elevated capillary pressure causes pulmonary edema, often days after the event as reduced renal perfusion leads to fluid retention.
  3. Ventricular fibrillation - Most common mechanism of sudden cardiac death; occurs in 80-90% of cardiac deaths from ischemia. Two danger windows: within 10 minutes and at 1-2 hours post-infarction. Caused by:
    • Extracellular K⁺ elevation from leaking ischemic cells (increases irritability)
    • Injury currents from partially depolarized ischemic areas
    • Sympathetic activation (baroreceptor reflex response to low BP)
    • Ventricular dilation increasing conduction pathway length
  4. Cardiac rupture - Rare; most likely between days 3-7 when the infarct is maximally soft (neutrophil-mediated dissolution), before adequate scar forms.
    • Guyton & Hall Textbook of Medical Physiology, p. 271-272

12. Complications

Early (days):
  • Arrhythmias (ventricular fibrillation, ventricular tachycardia, heart block, AF)
  • Cardiogenic shock
  • Acute left ventricular failure / pulmonary edema
  • Right ventricular infarction (with proximal RCA occlusion) - gives low-output state with clear lungs
  • Pericarditis (early, within 24-72 hours - overlies the infarct zone)
Subacute (days to weeks):
  • Papillary muscle rupture (mitral regurgitation)
  • Interventricular septum rupture (new VSD)
  • Free wall rupture (cardiac tamponade)
  • Mural thrombus formation (with risk of systemic embolism)
Late (weeks to months):
  • Left ventricular aneurysm
  • Dressler's syndrome (autoimmune pericarditis, 2-10 weeks post-MI)
  • Chronic heart failure
  • Sudden cardiac death from late arrhythmia (persistent risk)

13. Diagnosis - Summary

TestFinding
ECGST elevation (STEMI) or ST/T changes (NSTEMI); Q waves (old MI)
Troponin I/TRise and fall pattern; most definitive
EchoWall motion abnormality; LV function
Coronary angiographyConfirms occlusion; guides revascularization
CXRMay show pulmonary edema or widened mediastinum

14. Treatment

Acute Management (STEMI):

A. Medications:
  1. Aspirin - Immediate 300 mg loading dose; antiplatelet (inhibits TXA₂)
  2. P2Y12 inhibitors - Clopidogrel, ticagrelor, or prasugrel; dual antiplatelet therapy
  3. Anticoagulation - Unfractionated heparin, LMWH, fondaparinux, or bivalirudin
  4. Nitroglycerin - Sublingual or IV; reduces preload, relieves chest pain (avoid in RV infarction as it reduces preload and can cause catastrophic hypotension)
  5. Beta-blockers - Cardioprotective; reduce oxygen demand and risk of arrhythmia (avoid if hypotension, reduced EF, bradycardia, or cardiogenic shock)
  6. High-intensity statins - Early HMG-CoA reductase inhibitors (target LDL <70 mg/dL)
  7. Oxygen - Only if patient is hypoxic (SpO₂ <90%)
  8. Morphine - For pain not relieved by nitrates (though routine use now questioned)
B. Reperfusion (most time-critical intervention):
  • Primary PCI (percutaneous coronary intervention) with stent placement is the gold standard - lower mortality, lower hemorrhagic stroke risk vs. thrombolysis
  • Systemic thrombolysis (tPA, streptokinase) - Only if PCI cannot be delivered within 2 hours of presentation
  • Both are most effective within 12 hours of symptom onset
  • Even patients requiring transfer to a PCI-capable center have better outcomes with PCI than bedside thrombolysis
C. Post-reperfusion (secondary prevention):
  1. Beta-blockers (survival benefit)
  2. ACE inhibitors (reduce remodeling, especially if EF is reduced)
  3. Aspirin (lifelong)
  4. P2Y12 inhibitor (duration based on stent type and bleeding risk)
  5. High-intensity statins
  6. Glycoprotein IIb/IIIa inhibitors (recommended if stenting was performed)
D. NSTEMI management:
  • Similar medical therapy; PCI can be delayed up to 72 hours in many cases
  • No systemic thrombolysis
E. Type 2 MI:
  • Treat the underlying cause (correct anemia, control heart rate, treat hypotension)
    • Symptom to Diagnosis, p. 175; Sabiston Textbook of Surgery, p. 2934-2936

15. Reperfusion Injury

  • Restoring blood flow saves myocardium but can paradoxically cause additional injury.
  • Mechanisms: calcium overload, oxidative stress from reactive oxygen species, inflammatory mediators.
  • Stunned myocardium - Post-ischemic myocardium remains non-contractile for days despite restored flow; this is transient and reversible.
    • Robbins & Kumar Basic Pathology, p. 354

16. Prognosis

  • In-hospital mortality: ~10.3% in men, ~14.6% in women.
  • Women have worse outcomes partly due to presentation without chest pain, leading to delayed diagnosis and less aggressive treatment.
  • Mortality difference between sexes narrows and eventually reverses with advancing age.
  • Cardiogenic shock (>40% LV infarction) carries 40-50% short-term mortality.
  • Exercise stress testing is recommended within 3 weeks of MI (for patients not undergoing PCI/angiography) for risk stratification and functional assessment.
  • A recent 2025 meta-analysis (PMID 39298680) found that beta-blocker benefit for secondary prevention post-MI may be limited in patients without reduced ejection fraction or heart failure, suggesting potential refinement of current guidelines. - Symptom to Diagnosis, p. 175

17. Special Considerations

Subendocardial oxygen demand:
  • Cardiac muscle requires ~1.3 mL O₂/100g/min just to stay alive vs. ~8 mL O₂/100g/min delivered normally. Even 15-30% of normal resting flow can prevent cell death in marginal zones. The central infarct with near-zero flow is what undergoes irreversible necrosis. - Guyton & Hall Textbook of Medical Physiology, p. 271
Post-surgical MI:
  • In the perioperative setting, the critical distinction between Type 1 (plaque rupture - needs revascularization) and Type 2 (demand ischemia - needs oxygen demand reduction) is essential because anticoagulation for PCI may be contraindicated after recent neurosurgery or major procedures. - Sabiston Textbook of Surgery, p. 2932
Cocaine-induced MI:
  • Causes vasospasm and microscopic infarcts even in young patients without atherosclerosis - Robbins & Kumar Basic Pathology, p. 356

Sources: Robbins & Kumar Basic Pathology; Guyton & Hall Textbook of Medical Physiology; Ganong's Review of Medical Physiology; Sabiston Textbook of Surgery; Symptom to Diagnosis, 4th Edition; Tietz Textbook of Laboratory Medicine, 7th Edition

Generate a PDF quick reference guide on MI diagnosis and treatment

Reading File
Reading File
Running Command

ls /home/daytona/workspace/ 2>/dev/null || echo "workspace empty or not found"

Writing File

~/mi-quickref/generate_mi_pdf.py

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

OUTPUT_PATH = "/home/daytona/workspace/mi-quickref/MI_Quick_Reference_Guide.pdf"
os.makedirs(os.path.dirname(OUTPUT_PATH), exist_ok=True)

# ── Colour palette ──────────────────────────────────────────────────────────
RED       = colors.HexColor("#C0392B")
DARK_RED  = colors.HexColor("#922B21")
ORANGE    = colors.HexColor("#E67E22")
TEAL      = colors.HexColor("#1A6B7C")
TEAL_LIGHT= colors.HexColor("#D6EEF3")
GREY_BG   = colors.HexColor("#F4F6F7")
GREY_LINE = colors.HexColor("#BDC3C7")
WHITE     = colors.white
BLACK     = colors.HexColor("#1C2833")
GREEN     = colors.HexColor("#1E8449")
GREEN_LIGHT= colors.HexColor("#D5F5E3")
AMBER     = colors.HexColor("#D68910")
AMBER_LIGHT= colors.HexColor("#FEF9E7")
BLUE_HEAD = colors.HexColor("#1B4F72")

# ── Styles ───────────────────────────────────────────────────────────────────
styles = getSampleStyleSheet()

def S(name, **kw):
    return ParagraphStyle(name, **kw)

Title = S("Title",
    fontName="Helvetica-Bold", fontSize=22, textColor=WHITE,
    leading=28, alignment=TA_CENTER, spaceAfter=2)

Subtitle = S("Subtitle",
    fontName="Helvetica", fontSize=11, textColor=colors.HexColor("#FDFEFE"),
    leading=16, alignment=TA_CENTER)

SectionHead = S("SectionHead",
    fontName="Helvetica-Bold", fontSize=11, textColor=WHITE,
    leading=15, spaceBefore=6, spaceAfter=3,
    leftIndent=6, rightIndent=6)

SubHead = S("SubHead",
    fontName="Helvetica-Bold", fontSize=9.5, textColor=BLUE_HEAD,
    leading=13, spaceBefore=5, spaceAfter=2)

Body = S("Body",
    fontName="Helvetica", fontSize=8.5, textColor=BLACK,
    leading=12, spaceAfter=2)

BulletStyle = S("Bullet",
    fontName="Helvetica", fontSize=8.5, textColor=BLACK,
    leading=12, leftIndent=12, firstLineIndent=-8, spaceAfter=1)

BoldBody = S("BoldBody",
    fontName="Helvetica-Bold", fontSize=8.5, textColor=BLACK,
    leading=12, spaceAfter=2)

SmallGrey = S("SmallGrey",
    fontName="Helvetica-Oblique", fontSize=7.5, textColor=colors.HexColor("#7F8C8D"),
    leading=10, alignment=TA_CENTER)

CellHead = S("CellHead",
    fontName="Helvetica-Bold", fontSize=8.5, textColor=WHITE,
    leading=11, alignment=TA_CENTER)

CellBody = S("CellBody",
    fontName="Helvetica", fontSize=8, textColor=BLACK, leading=11)

CellBold = S("CellBold",
    fontName="Helvetica-Bold", fontSize=8, textColor=BLACK, leading=11)

AlertRed = S("AlertRed",
    fontName="Helvetica-Bold", fontSize=9, textColor=RED,
    leading=13, spaceAfter=2)

def bullet(text, bold_prefix=None):
    if bold_prefix:
        return Paragraph(f'<bullet>\u2022</bullet> <b>{bold_prefix}</b> {text}', BulletStyle)
    return Paragraph(f'<bullet>\u2022</bullet> {text}', BulletStyle)

def section_bar(text, bg=TEAL):
    data = [[Paragraph(text, SectionHead)]]
    t = Table(data, colWidths=[175*mm])
    t.setStyle(TableStyle([
        ('BACKGROUND', (0,0), (-1,-1), bg),
        ('TOPPADDING', (0,0), (-1,-1), 5),
        ('BOTTOMPADDING', (0,0), (-1,-1), 5),
        ('LEFTPADDING', (0,0), (-1,-1), 8),
        ('RIGHTPADDING', (0,0), (-1,-1), 8),
        ('ROUNDEDCORNERS', [4, 4, 4, 4]),
    ]))
    return t

def hr(color=GREY_LINE, thickness=0.5):
    return HRFlowable(width="100%", thickness=thickness, color=color, spaceAfter=3, spaceBefore=3)

# ── Document setup ────────────────────────────────────────────────────────────
doc = SimpleDocTemplate(
    OUTPUT_PATH,
    pagesize=A4,
    leftMargin=15*mm, rightMargin=15*mm,
    topMargin=12*mm, bottomMargin=12*mm,
    title="MI Quick Reference Guide",
    author="Orris Medical Reference",
    subject="Myocardial Infarction – Diagnosis & Treatment"
)

story = []
W = 175*mm  # usable width

# ═══════════════════════════════════════════════════════════════════════════
# HEADER BANNER
# ═══════════════════════════════════════════════════════════════════════════
header_data = [[
    Paragraph("MYOCARDIAL INFARCTION", Title),
    Paragraph("Quick Reference Guide  |  Diagnosis &amp; Treatment", Subtitle),
    Paragraph("Based on Braunwald's, Robbins, Harrison's, Guyton &amp; Hall", SmallGrey)
]]
header = Table([[
    Paragraph("MYOCARDIAL INFARCTION", Title)
], [
    Paragraph("Quick Reference Guide  \u2022  Diagnosis &amp; Treatment", Subtitle)
], [
    Paragraph("Braunwald's  \u2022  Robbins  \u2022  Harrison's  \u2022  Guyton &amp; Hall  \u2022  Sabiston", SmallGrey)
]], colWidths=[W])
header.setStyle(TableStyle([
    ('BACKGROUND', (0,0), (-1,-1), RED),
    ('TOPPADDING', (0,0), (-1,-1), 10),
    ('BOTTOMPADDING', (0,0), (-1,-1), 10),
    ('LEFTPADDING', (0,0), (-1,-1), 10),
    ('RIGHTPADDING', (0,0), (-1,-1), 10),
    ('ROUNDEDCORNERS', [6, 6, 6, 6]),
]))
story.append(header)
story.append(Spacer(1, 6))

# ═══════════════════════════════════════════════════════════════════════════
# ROW 1: DEFINITION + CLASSIFICATION  (2 columns)
# ═══════════════════════════════════════════════════════════════════════════
def box(content_rows, bg=GREY_BG, width=None):
    t = Table([[c] for c in content_rows], colWidths=[width or 84*mm])
    t.setStyle(TableStyle([
        ('BACKGROUND', (0,0), (-1,-1), bg),
        ('TOPPADDING', (0,0), (-1,-1), 5),
        ('BOTTOMPADDING', (0,0), (-1,-1), 5),
        ('LEFTPADDING', (0,0), (-1,-1), 7),
        ('RIGHTPADDING', (0,0), (-1,-1), 7),
        ('BOX', (0,0), (-1,-1), 0.5, GREY_LINE),
        ('ROUNDEDCORNERS', [4, 4, 4, 4]),
    ]))
    return t

col_w = 84*mm
gap = 7*mm

# ── DEFINITION box ──────────────────────────────────────────────────────────
def_content = [
    section_bar("DEFINITION", DARK_RED),
    Spacer(1, 4),
    Paragraph("Necrosis of heart muscle from sustained ischemia.", Body),
    Paragraph('<b>2018 Universal Definition:</b> "Acute myocardial injury detected by abnormal cardiac biomarkers in the setting of evidence of acute myocardial ischemia."', Body),
    hr(),
    Paragraph("<b>Key time thresholds:</b>", BoldBody),
    bullet("<b>Seconds:</b> Aerobic metabolism ceases; ATP falls"),
    bullet("<b>Minutes:</b> Loss of contractility (reversible)"),
    bullet("<b>20-40 min:</b> Irreversible cell death begins"),
    bullet("<b>3-6 hrs:</b> Full transmural infarct if untreated"),
]

# ── CLASSIFICATION box ───────────────────────────────────────────────────────
class_content = [
    section_bar("CLASSIFICATION", TEAL),
    Spacer(1, 4),
    Paragraph("<b>Type 1 MI</b> – Plaque rupture / thrombosis", BoldBody),
    bullet("STEMI: ST elevation + biomarker rise"),
    bullet("NSTEMI: No ST elevation; biomarker rise"),
    bullet("UA: Ischemia symptoms; no biomarker rise"),
    hr(),
    Paragraph("<b>Type 2 MI</b> – Supply/demand mismatch", BoldBody),
    bullet("Tachycardia, anemia, hypotension, hypertension"),
    bullet("Treatment: reduce cardiac O<sub rise='2'>2</sub> demand"),
    hr(),
    Paragraph("<b>ACS Spectrum:</b> STEMI &gt; NSTEMI &gt; Unstable Angina", Body),
]

row1 = Table([[
    Table([[c] for c in def_content], colWidths=[col_w]),
    Spacer(gap, 1),
    Table([[c] for c in class_content], colWidths=[col_w]),
]], colWidths=[col_w, gap, col_w])
row1.setStyle(TableStyle([
    ('VALIGN', (0,0), (-1,-1), 'TOP'),
    ('LEFTPADDING', (0,0), (-1,-1), 0),
    ('RIGHTPADDING', (0,0), (-1,-1), 0),
    ('TOPPADDING', (0,0), (-1,-1), 0),
    ('BOTTOMPADDING', (0,0), (-1,-1), 0),
]))
story.append(row1)
story.append(Spacer(1, 5))

# ═══════════════════════════════════════════════════════════════════════════
# SYMPTOMS & ECG  (2 columns)
# ═══════════════════════════════════════════════════════════════════════════
symp_content = [
    section_bar("SYMPTOMS", colors.HexColor("#6C3483")),
    Spacer(1, 4),
    Paragraph("<b>Classic (Type 1):</b>", BoldBody),
    bullet("Central crushing/squeezing chest pain >30 min"),
    bullet("Radiation: left arm, jaw, neck, back, epigastrium"),
    bullet("Diaphoresis, nausea/vomiting, dyspnea"),
    bullet("Anxiety, sense of impending doom"),
    hr(),
    Paragraph("<b>Atypical</b> (women, elderly, diabetics):", BoldBody),
    bullet("Epigastric pain or indigestion"),
    bullet("Fatigue, jaw or arm pain alone"),
    bullet("Silent MI (no pain) – ECG/biomarkers only"),
    Paragraph('<font color="#C0392B"><b>! Women presenting without chest pain receive delayed care – higher in-hospital mortality (14.6% vs 10.3%)</b></font>', Body),
]

ecg_content = [
    section_bar("ECG CHANGES", colors.HexColor("#1A5276")),
    Spacer(1, 4),
    Paragraph("<b>Hyperacute (minutes):</b>", BoldBody),
    bullet("Tall, peaked T waves"),
    Paragraph("<b>Acute STEMI:</b>", BoldBody),
    bullet("ST elevation in leads over infarct"),
    bullet("Reciprocal ST depression in opposite leads"),
    Paragraph("<b>Hours to days:</b>", BoldBody),
    bullet("T-wave inversion"),
    bullet("Q waves appear (electrically silent necrosis)"),
    Paragraph("<b>NSTEMI / UA:</b>", BoldBody),
    bullet("ST depression or T-wave changes"),
    bullet("No ST elevation; no Q waves"),
    hr(),
    Paragraph("<b>Lead localisation:</b>", BoldBody),
    bullet("V1-V4: Anterior (LAD)"),
    bullet("II, III, aVF: Inferior (RCA)"),
    bullet("I, aVL, V5-V6: Lateral (LCX)"),
]

row2 = Table([[
    Table([[c] for c in symp_content], colWidths=[col_w]),
    Spacer(gap, 1),
    Table([[c] for c in ecg_content], colWidths=[col_w]),
]], colWidths=[col_w, gap, col_w])
row2.setStyle(TableStyle([
    ('VALIGN', (0,0), (-1,-1), 'TOP'),
    ('LEFTPADDING', (0,0), (-1,-1), 0),
    ('RIGHTPADDING', (0,0), (-1,-1), 0),
    ('TOPPADDING', (0,0), (-1,-1), 0),
    ('BOTTOMPADDING', (0,0), (-1,-1), 0),
]))
story.append(row2)
story.append(Spacer(1, 5))

# ═══════════════════════════════════════════════════════════════════════════
# BIOMARKERS TABLE (full width)
# ═══════════════════════════════════════════════════════════════════════════
story.append(section_bar("CARDIAC BIOMARKERS", colors.HexColor("#784212")))
story.append(Spacer(1, 3))

bio_head = [
    Paragraph("Marker", CellHead),
    Paragraph("Rises", CellHead),
    Paragraph("Peaks", CellHead),
    Paragraph("Returns to Normal", CellHead),
    Paragraph("Notes", CellHead),
]
bio_data = [
    ["Troponin I / T", "3-6 hrs", "12-24 hrs", "7-14 days (TnT up to 2 wks)", "Most specific & sensitive. Gold standard."],
    ["CK-MB", "3-6 hrs", "18-24 hrs", "48-72 hrs", "Useful for reinfarction detection"],
    ["Myoglobin", "1-3 hrs", "6-9 hrs", "24 hrs", "Earliest; not cardiac-specific. Rule-out only."],
    ["LDH", "24-48 hrs", "3-6 days", "8-14 days", "Historical; largely replaced by troponins"],
]
bio_rows = [bio_head] + [[Paragraph(c, CellBody) for c in row] for row in bio_data]
bio_col = [28*mm, 18*mm, 18*mm, 45*mm, 66*mm]
bio_table = Table(bio_rows, colWidths=bio_col, repeatRows=1)
bio_table.setStyle(TableStyle([
    ('BACKGROUND', (0,0), (-1,0), colors.HexColor("#784212")),
    ('BACKGROUND', (0,1), (-1,1), GREY_BG),
    ('BACKGROUND', (0,2), (-1,2), WHITE),
    ('BACKGROUND', (0,3), (-1,3), GREY_BG),
    ('BACKGROUND', (0,4), (-1,4), WHITE),
    ('GRID', (0,0), (-1,-1), 0.4, GREY_LINE),
    ('TOPPADDING', (0,0), (-1,-1), 4),
    ('BOTTOMPADDING', (0,0), (-1,-1), 4),
    ('LEFTPADDING', (0,0), (-1,-1), 5),
    ('RIGHTPADDING', (0,0), (-1,-1), 5),
    ('VALIGN', (0,0), (-1,-1), 'MIDDLE'),
]))
story.append(bio_table)
story.append(Spacer(1, 5))

# ═══════════════════════════════════════════════════════════════════════════
# INFARCT LOCATION TABLE (full width)
# ═══════════════════════════════════════════════════════════════════════════
story.append(section_bar("INFARCT LOCATION BY VESSEL", colors.HexColor("#1A6B7C")))
story.append(Spacer(1, 3))

loc_head = [
    Paragraph("Artery", CellHead),
    Paragraph("% of MIs", CellHead),
    Paragraph("Territory Affected", CellHead),
    Paragraph("ECG Leads", CellHead),
]
loc_data = [
    ["Left Anterior Descending (LAD)", "40-50%", "Anterior LV wall, anterior 2/3 septum, cardiac apex", "V1-V4"],
    ["Right Coronary Artery (RCA)", "30-40%", "Right ventricle, posterior LV wall, posterior 1/3 septum", "II, III, aVF"],
    ["Left Circumflex (LCX)", "15-20%", "Lateral left ventricle", "I, aVL, V5-V6"],
]
loc_rows = [loc_head] + [[Paragraph(c, CellBody) for c in row] for row in loc_data]
loc_col = [50*mm, 22*mm, 73*mm, 30*mm]
loc_table = Table(loc_rows, colWidths=loc_col, repeatRows=1)
loc_table.setStyle(TableStyle([
    ('BACKGROUND', (0,0), (-1,0), TEAL),
    ('BACKGROUND', (0,1), (-1,1), TEAL_LIGHT),
    ('BACKGROUND', (0,2), (-1,2), WHITE),
    ('BACKGROUND', (0,3), (-1,3), TEAL_LIGHT),
    ('GRID', (0,0), (-1,-1), 0.4, GREY_LINE),
    ('TOPPADDING', (0,0), (-1,-1), 4),
    ('BOTTOMPADDING', (0,0), (-1,-1), 4),
    ('LEFTPADDING', (0,0), (-1,-1), 5),
    ('RIGHTPADDING', (0,0), (-1,-1), 5),
    ('VALIGN', (0,0), (-1,-1), 'MIDDLE'),
]))
story.append(loc_table)
story.append(Spacer(1, 5))

# ═══════════════════════════════════════════════════════════════════════════
# TREATMENT  (2 columns: Acute Meds | Reperfusion)
# ═══════════════════════════════════════════════════════════════════════════
med_content = [
    section_bar("ACUTE MEDICATIONS", RED),
    Spacer(1, 4),
    Paragraph("<b>Antiplatelet:</b>", BoldBody),
    bullet("Aspirin 300 mg loading (immediate)"),
    bullet("P2Y12 inhibitor: clopidogrel / ticagrelor / prasugrel"),
    bullet("GP IIb/IIIa inhibitor (if PCI performed)"),
    Paragraph("<b>Anticoagulation:</b>", BoldBody),
    bullet("UFH, LMWH, fondaparinux, or bivalirudin"),
    Paragraph("<b>Nitrates:</b>", BoldBody),
    bullet("Sublingual or IV nitroglycerin"),
    Paragraph('<font color="#C0392B"><b>! Avoid nitrates in RV infarction – reduces preload causing catastrophic hypotension</b></font>', Body),
    Paragraph("<b>Beta-blockers:</b>", BoldBody),
    bullet("Cardioprotective; reduce O2 demand + arrhythmia risk"),
    Paragraph('<font color="#C0392B"><b>! Avoid if: hypotension, low EF, bradycardia, cardiogenic shock</b></font>', Body),
    Paragraph("<b>Statins:</b>", BoldBody),
    bullet("High-intensity (target LDL &lt;70 mg/dL); start early"),
    Paragraph("<b>ACE Inhibitors:</b>", BoldBody),
    bullet("Reduce ventricular remodeling; start within 24 hrs"),
    Paragraph("<b>Oxygen:</b>", BoldBody),
    bullet("Only if SpO2 &lt;90% (hyperoxia is harmful)"),
    Paragraph("<b>Morphine:</b>", BoldBody),
    bullet("Pain unrelieved by nitrates (routine use now questioned)"),
]

reperf_content = [
    section_bar("REPERFUSION STRATEGY", GREEN),
    Spacer(1, 4),
    Paragraph('<b><font color="#1E8449">Primary PCI</font></b> – Gold Standard', BoldBody),
    bullet("Percutaneous coronary intervention + stent"),
    bullet("Lower mortality than thrombolysis"),
    bullet("Lower hemorrhagic stroke risk"),
    bullet("<b>Target: &lt;90 min door-to-balloon time</b>"),
    bullet("Effective up to 12 hrs from symptom onset"),
    hr(),
    Paragraph('<b><font color="#D68910">Thrombolysis</font></b> – If PCI unavailable within 2 hrs', BoldBody),
    bullet("tPA (alteplase), streptokinase, tenecteplase"),
    bullet("Most effective within 12 hrs of symptom onset"),
    bullet("Higher bleeding/stroke risk than PCI"),
    bullet("Contraindicated: recent surgery, stroke, active bleeding"),
    hr(),
    Paragraph("<b>NSTEMI:</b>", BoldBody),
    bullet("PCI can be delayed up to 72 hrs in stable patients"),
    bullet("No systemic thrombolysis"),
    hr(),
    Paragraph("<b>Post-Reperfusion (long-term):</b>", BoldBody),
    bullet("Beta-blockers + ACE inhibitors + Aspirin"),
    bullet("P2Y12 inhibitor (duration per stent/bleeding risk)"),
    bullet("High-intensity statin"),
    bullet("Exercise test 3 wks post-MI (if no angio/PCI)"),
]

row3 = Table([[
    Table([[c] for c in med_content], colWidths=[col_w]),
    Spacer(gap, 1),
    Table([[c] for c in reperf_content], colWidths=[col_w]),
]], colWidths=[col_w, gap, col_w])
row3.setStyle(TableStyle([
    ('VALIGN', (0,0), (-1,-1), 'TOP'),
    ('LEFTPADDING', (0,0), (-1,-1), 0),
    ('RIGHTPADDING', (0,0), (-1,-1), 0),
    ('TOPPADDING', (0,0), (-1,-1), 0),
    ('BOTTOMPADDING', (0,0), (-1,-1), 0),
]))
story.append(row3)
story.append(Spacer(1, 5))

# ═══════════════════════════════════════════════════════════════════════════
# COMPLICATIONS  (full width, 2-col layout inside table)
# ═══════════════════════════════════════════════════════════════════════════
story.append(section_bar("COMPLICATIONS", colors.HexColor("#6E2F12")))
story.append(Spacer(1, 3))

comp_early = [
    Paragraph("<b>Early (hours - days):</b>", BoldBody),
    bullet("Ventricular fibrillation / tachycardia"),
    bullet("Cardiogenic shock (&gt;40% LV involved; mortality 40-50%)"),
    bullet("Acute LV failure / pulmonary oedema"),
    bullet("Heart block / bradyarrhythmia (inferior MI - RCA)"),
    bullet("RV infarction: low output + clear lungs + JVD"),
    bullet("Early pericarditis (24-72 hrs; overlying infarct)"),
]
comp_late = [
    Paragraph("<b>Subacute / Late (days - weeks):</b>", BoldBody),
    bullet("Papillary muscle rupture - acute mitral regurgitation"),
    bullet("VSD from septal rupture (new pansystolic murmur)"),
    bullet("Free wall rupture - cardiac tamponade (days 3-7)"),
    bullet("Mural thrombus - systemic embolism"),
    bullet("LV aneurysm (weeks to months)"),
    bullet("Dressler's syndrome: autoimmune pericarditis (2-10 wks)"),
    bullet("Chronic heart failure"),
]

comp_table = Table([[
    Table([[c] for c in comp_early], colWidths=[col_w]),
    Spacer(gap, 1),
    Table([[c] for c in comp_late], colWidths=[col_w]),
]], colWidths=[col_w, gap, col_w])
comp_table.setStyle(TableStyle([
    ('VALIGN', (0,0), (-1,-1), 'TOP'),
    ('LEFTPADDING', (0,0), (-1,-1), 0),
    ('RIGHTPADDING', (0,0), (-1,-1), 0),
    ('TOPPADDING', (0,0), (-1,-1), 0),
    ('BOTTOMPADDING', (0,0), (-1,-1), 0),
]))
story.append(comp_table)
story.append(Spacer(1, 5))

# ═══════════════════════════════════════════════════════════════════════════
# MORPHOLOGY TIMELINE (condensed table)
# ═══════════════════════════════════════════════════════════════════════════
story.append(section_bar("MORPHOLOGICAL TIMELINE OF MI (Robbins Pathology)", colors.HexColor("#4A235A")))
story.append(Spacer(1, 3))

morph_head = [
    Paragraph("Time", CellHead),
    Paragraph("Gross Features", CellHead),
    Paragraph("Microscopy", CellHead),
]
morph_data = [
    ["0-4 hrs", "None visible", "Waviness of fibers at border; sarcolemmal disruption on EM"],
    ["4-24 hrs", "Dark mottling", "Coagulation necrosis; pyknotic nuclei; hypereosinophilic myocytes; neutrophil infiltrate"],
    ["1-3 days", "Yellow-tan center", "Necrosis with loss of nuclei/striations; heavy neutrophil infiltrate"],
    ["3-10 days", "Hyperemic border; yellow-tan soft center", "Neutrophil disintegration; macrophage phagocytosis; early granulation tissue"],
    ["10 days - 8 wks", "Red-gray depressed borders; grey-white scar forming", "Progressive collagen deposition; granulation tissue replaced by scar"],
    [">2 months", "Dense white scar", "Dense collagen scar - fully healed (no regeneration)"],
]
morph_rows = [morph_head] + [[Paragraph(c, CellBody) for c in row] for row in morph_data]
morph_col = [28*mm, 45*mm, 102*mm]
morph_table = Table(morph_rows, colWidths=morph_col, repeatRows=1)
row_colors = [colors.HexColor("#4A235A"), GREY_BG, WHITE, GREY_BG, WHITE, GREY_BG, WHITE]
morph_style = [
    ('BACKGROUND', (0,0), (-1,0), colors.HexColor("#4A235A")),
    ('GRID', (0,0), (-1,-1), 0.4, GREY_LINE),
    ('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), 'TOP'),
]
for i, c in enumerate(row_colors[1:], 1):
    morph_style.append(('BACKGROUND', (0,i), (-1,i), c))
morph_table.setStyle(TableStyle(morph_style))
story.append(morph_table)
story.append(Spacer(1, 5))

# ═══════════════════════════════════════════════════════════════════════════
# FOOTER
# ═══════════════════════════════════════════════════════════════════════════
footer_data = [[
    Paragraph(
        "Sources: Robbins &amp; Kumar Basic Pathology | Braunwald's Heart Disease | Guyton &amp; Hall Medical Physiology | "
        "Ganong's Review of Medical Physiology | Sabiston Textbook of Surgery | Symptom to Diagnosis (4th Ed) | "
        "Tietz Textbook of Laboratory Medicine | Harrison's Principles of Internal Medicine",
        SmallGrey
    )
]]
footer = Table(footer_data, colWidths=[W])
footer.setStyle(TableStyle([
    ('BACKGROUND', (0,0), (-1,-1), colors.HexColor("#EAECEE")),
    ('TOPPADDING', (0,0), (-1,-1), 5),
    ('BOTTOMPADDING', (0,0), (-1,-1), 5),
    ('LEFTPADDING', (0,0), (-1,-1), 8),
    ('RIGHTPADDING', (0,0), (-1,-1), 8),
    ('BOX', (0,0), (-1,-1), 0.5, GREY_LINE),
]))
story.append(footer)

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

cd /home/daytona/workspace/mi-quickref && python generate_mi_pdf.py 2>&1

Running Command

ls -lh /home/daytona/workspace/mi-quickref/MI_Quick_Reference_Guide.pdf

The file is only 12 KB which is suspiciously small - let me verify it rendered correctly and check page count:
Running Command

cd /home/daytona/workspace/mi-quickref && python -c " from pypdf import PdfReader r = PdfReader('MI_Quick_Reference_Guide.pdf') print(f'Pages: {len(r.pages)}') for i, p in enumerate(r.pages): txt = p.extract_text() print(f'Page {i+1}: {len(txt)} chars -- snippet: {txt[:120]}') "

3 pages, all content rendering correctly. The file size is small because it's text-only (no embedded images). Let me verify the content is complete across all 3 pages:
Running Command

cd /home/daytona/workspace/mi-quickref && python -c " from pypdf import PdfReader r = PdfReader('MI_Quick_Reference_Guide.pdf') for i, p in enumerate(r.pages): print(f'=== PAGE {i+1} ===') print(p.extract_text()[:800]) print() "

All 3 pages are rendering correctly with complete content.Your MI Quick Reference Guide PDF is ready:

MI Quick Reference Guide

PDF Document · PDF

What's inside (3 pages, A4):
SectionContent
HeaderRed title banner with source attribution
Definition & Classification2018 Universal Definition, key time thresholds, Type 1 vs Type 2 MI, ACS spectrum
Symptoms & ECG ChangesClassic vs atypical presentation, ECG evolution (hyperacute → acute → chronic), lead localisation table
Cardiac BiomarkersColour-coded table: Troponin I/T, CK-MB, Myoglobin, LDH - with rise/peak/normalisation times
Infarct LocationLAD / RCA / LCX with % frequency, territory, and ECG leads
Acute MedicationsAntiplatelet, anticoagulation, nitrates, beta-blockers, statins, ACE inhibitors, oxygen - with red warning boxes for nitrates in RV infarction and beta-blocker contraindications
Reperfusion StrategyPrimary PCI vs thrombolysis decision guide, door-to-balloon target, NSTEMI approach, post-reperfusion secondary prevention
ComplicationsEarly (VF, cardiogenic shock, pulmonary oedema) and late (papillary rupture, VSD, free wall rupture, Dressler's)
Morphological TimelineRobbins-based table from 0 hrs to >2 months
FooterFull source list from 8 authoritative textbooks
This is a shared conversation. Sign in to Orris to start your own chat.