Make a PPT on myocardial infraction
mkdir -p /home/daytona/workspace/mi-pptx && ls /home/daytona/workspace/mi-pptx
~/mi-pptx/build.js
const pptxgen = require("pptxgenjs");
const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.author = "Orris Medical";
pres.title = "Myocardial Infarction";
// ─── COLOR PALETTE ──────────────────────────────────────────────────────────
const C = {
crimson: "B31B1B", // dominant dark red
darkBg: "1A1A2E", // near-black navy (title / dark slides)
midBg: "16213E", // dark navy
accent: "E94560", // hot red-pink accent
gold: "F5A623", // amber/gold for highlights
white: "FFFFFF",
offWhite: "F0F4F8",
lightGray: "C8D6E5",
subtleGray:"8899AA",
cardBg: "0F3460", // card backgrounds
};
// ─── HELPERS ─────────────────────────────────────────────────────────────────
function sectionHeader(slide, text) {
slide.addShape(pres.ShapeType.rect, {
x: 0, y: 0, w: "100%", h: 0.7,
fill: { color: C.crimson },
line: { type: "none" },
});
slide.addText(text, {
x: 0.4, y: 0, w: 9.2, h: 0.7,
fontSize: 13, bold: true, color: C.white,
valign: "middle", margin: 0,
});
}
function slideTitle(slide, title, subtitle) {
slide.addText(title, {
x: 0.5, y: 0.75, w: 9, h: 0.6,
fontSize: 26, bold: true, color: C.white, margin: 0,
});
if (subtitle) {
slide.addText(subtitle, {
x: 0.5, y: 1.35, w: 9, h: 0.35,
fontSize: 13, color: C.lightGray, margin: 0, italic: true,
});
}
}
function bulletList(slide, items, opts = {}) {
const {
x = 0.5, y = 1.85, w = 9, h = 3.4,
fontSize = 14, color = C.offWhite,
indentLevel = 0,
} = opts;
const textArr = items.map((item, i) => ({
text: item.text || item,
options: {
bullet: { type: "bullet" },
indentLevel: item.indent || indentLevel,
fontSize: item.fontSize || fontSize,
color: item.color || color,
bold: item.bold || false,
breakLine: i < items.length - 1,
},
}));
slide.addText(textArr, { x, y, w, h, valign: "top" });
}
function addCard(slide, x, y, w, h, title, body, titleColor, bodyColor) {
slide.addShape(pres.ShapeType.roundRect, {
x, y, w, h,
fill: { color: C.cardBg },
line: { color: C.accent, width: 1.5 },
rectRadius: 0.12,
});
slide.addText(title, {
x: x + 0.15, y: y + 0.08, w: w - 0.3, h: 0.38,
fontSize: 11, bold: true, color: titleColor || C.gold, margin: 0,
});
slide.addText(body, {
x: x + 0.15, y: y + 0.46, w: w - 0.3, h: h - 0.54,
fontSize: 10, color: bodyColor || C.offWhite,
valign: "top", wrap: true, margin: 0,
});
}
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 1 — TITLE
// ═══════════════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
// Full dark background
sl.addShape(pres.ShapeType.rect, {
x: 0, y: 0, w: "100%", h: "100%",
fill: { color: C.darkBg }, line: { type: "none" },
});
// Left accent bar
sl.addShape(pres.ShapeType.rect, {
x: 0, y: 0, w: 0.18, h: "100%",
fill: { color: C.crimson }, line: { type: "none" },
});
// Red decorative band
sl.addShape(pres.ShapeType.rect, {
x: 0.18, y: 2.2, w: "100%", h: 0.06,
fill: { color: C.accent }, line: { type: "none" },
});
sl.addText("MYOCARDIAL", {
x: 0.6, y: 1.0, w: 9, h: 0.9,
fontSize: 58, bold: true, color: C.white, margin: 0, charSpacing: 4,
});
sl.addText("INFARCTION", {
x: 0.6, y: 1.85, w: 9, h: 0.9,
fontSize: 58, bold: true, color: C.accent, margin: 0, charSpacing: 4,
});
sl.addText("A Comprehensive Clinical Overview", {
x: 0.6, y: 2.85, w: 8, h: 0.45,
fontSize: 16, color: C.lightGray, italic: true, margin: 0,
});
sl.addText("For Clinicians & Residents | Based on Robbins Pathology & Braunwald's Heart Disease", {
x: 0.6, y: 4.9, w: 9, h: 0.4,
fontSize: 9.5, color: C.subtleGray, margin: 0,
});
}
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 2 — OVERVIEW & EPIDEMIOLOGY
// ═══════════════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
sl.addShape(pres.ShapeType.rect, {
x: 0, y: 0, w: "100%", h: "100%",
fill: { color: C.midBg }, line: { type: "none" },
});
sectionHeader(sl, "OVERVIEW & EPIDEMIOLOGY");
slideTitle(sl, "What is Myocardial Infarction?");
sl.addText([
{ text: "Definition: ", options: { bold: true, color: C.gold } },
{ text: "Necrosis of cardiac muscle due to prolonged ischemia, most commonly from acute coronary artery thrombosis following atherosclerotic plaque disruption.", options: { color: C.offWhite } },
], { x: 0.5, y: 1.8, w: 9, h: 0.65, fontSize: 13 });
// Stat cards row
addCard(sl, 0.3, 2.65, 2.8, 1.5, "~800,000 / year", "MIs occur annually in the United States — nearly one every 40 seconds", C.accent, C.lightGray);
addCard(sl, 3.35, 2.65, 2.8, 1.5, "~400,000 deaths", "Annual US mortality attributable to acute MI", C.accent, C.lightGray);
addCard(sl, 6.4, 2.65, 2.8, 1.5, "10% under 40 yrs", "45% of MIs occur before age 65. Frequency rises with age & risk factors", C.accent, C.lightGray);
bulletList(sl, [
{ text: "Atherosclerosis is the major underlying cause in >90% of cases", bold: false },
{ text: "Male sex increases relative risk; gap narrows post-menopause", bold: false },
{ text: "Postmenopausal women: IHD is the most common cause of death", bold: false },
{ text: "Non-atherosclerotic causes (~10%): vasospasm, embolism (AF, valve vegetations), vasculitis", bold: false },
], { x: 0.5, y: 4.3, w: 9, h: 1.15, fontSize: 12 });
}
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 3 — PATHOGENESIS & CORONARY ARTERY OCCLUSION
// ═══════════════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
sl.addShape(pres.ShapeType.rect, {
x: 0, y: 0, w: "100%", h: "100%",
fill: { color: C.midBg }, line: { type: "none" },
});
sectionHeader(sl, "PATHOGENESIS");
slideTitle(sl, "Coronary Artery Occlusion — Step-by-Step");
const steps = [
{ num: "1", text: "Atheromatous plaque erosion or disruption exposes subendothelial collagen & necrotic plaque contents to blood" },
{ num: "2", text: "Platelet adhesion, aggregation & activation — release of TXA₂, ADP, serotonin → further platelet aggregation & vasospasm" },
{ num: "3", text: "Coagulation cascade activated by tissue factor exposure → expanding thrombus" },
{ num: "4", text: "Within minutes, thrombus can completely occlude the coronary lumen" },
{ num: "5", text: "Angiography within 4 hrs shows thrombosis in ~90% of MI cases; after 12–24 hrs only 60% (some resolve spontaneously)" },
];
steps.forEach((s, i) => {
const yPos = 1.72 + i * 0.72;
sl.addShape(pres.ShapeType.ellipse, {
x: 0.3, y: yPos, w: 0.42, h: 0.42,
fill: { color: C.crimson }, line: { type: "none" },
});
sl.addText(s.num, {
x: 0.3, y: yPos, w: 0.42, h: 0.42,
fontSize: 13, bold: true, color: C.white, align: "center", valign: "middle", margin: 0,
});
sl.addText(s.text, {
x: 0.85, y: yPos + 0.02, w: 8.8, h: 0.5,
fontSize: 12, color: C.offWhite, valign: "middle", margin: 0,
});
if (i < steps.length - 1) {
sl.addShape(pres.ShapeType.line, {
x: 0.51, y: yPos + 0.43, w: 0, h: 0.29,
line: { color: C.accent, width: 1.5 },
});
}
});
sl.addText("Key: Most MIs arise from plaques causing <70% stenosis prior to rupture (not \"critical\" lesions)", {
x: 0.5, y: 5.2, w: 9, h: 0.32,
fontSize: 10.5, italic: true, color: C.gold, margin: 0,
});
}
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 4 — CLASSIFICATION: STEMI vs NSTEMI
// ═══════════════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
sl.addShape(pres.ShapeType.rect, {
x: 0, y: 0, w: "100%", h: "100%",
fill: { color: C.midBg }, line: { type: "none" },
});
sectionHeader(sl, "CLASSIFICATION");
slideTitle(sl, "STEMI vs NSTEMI vs Unstable Angina");
// STEMI box
sl.addShape(pres.ShapeType.roundRect, {
x: 0.3, y: 1.75, w: 2.85, h: 3.6,
fill: { color: "3B0000" }, line: { color: C.crimson, width: 2 },
rectRadius: 0.12,
});
sl.addText("STEMI", {
x: 0.3, y: 1.75, w: 2.85, h: 0.5,
fontSize: 16, bold: true, color: C.crimson, align: "center", margin: 0,
});
bulletList(sl, [
"ST-elevation on ECG",
"Complete occlusion",
"Full-thickness infarct (transmural)",
"Troponin markedly elevated",
"Requires urgent reperfusion",
"Higher immediate mortality",
], { x: 0.4, y: 2.3, w: 2.65, h: 2.9, fontSize: 11, color: C.lightGray });
// NSTEMI box
sl.addShape(pres.ShapeType.roundRect, {
x: 3.4, y: 1.75, w: 2.85, h: 3.6,
fill: { color: "001A3B" }, line: { color: C.accent, width: 2 },
rectRadius: 0.12,
});
sl.addText("NSTEMI", {
x: 3.4, y: 1.75, w: 2.85, h: 0.5,
fontSize: 16, bold: true, color: C.accent, align: "center", margin: 0,
});
bulletList(sl, [
"No ST-elevation",
"Partial or transient occlusion",
"Subendocardial infarct",
"Troponin elevated",
"Urgent risk stratification",
"Requires antithrombotic Rx",
], { x: 3.5, y: 2.3, w: 2.65, h: 2.9, fontSize: 11, color: C.lightGray });
// Unstable Angina box
sl.addShape(pres.ShapeType.roundRect, {
x: 6.5, y: 1.75, w: 2.85, h: 3.6,
fill: { color: "001A1A" }, line: { color: C.gold, width: 2 },
rectRadius: 0.12,
});
sl.addText("UNSTABLE ANGINA", {
x: 6.5, y: 1.75, w: 2.85, h: 0.5,
fontSize: 13.5, bold: true, color: C.gold, align: "center", margin: 0,
});
bulletList(sl, [
"No ST-elevation",
"Plaque disruption + thrombus",
"No troponin rise",
"Harbinger of MI",
"Risk stratify urgently",
"ACS pathway activation",
], { x: 6.6, y: 2.3, w: 2.65, h: 2.9, fontSize: 11, color: C.lightGray });
}
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 5 — CLINICAL FEATURES & DIAGNOSIS
// ═══════════════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
sl.addShape(pres.ShapeType.rect, {
x: 0, y: 0, w: "100%", h: "100%",
fill: { color: C.midBg }, line: { type: "none" },
});
sectionHeader(sl, "CLINICAL PRESENTATION & DIAGNOSIS");
slideTitle(sl, "Recognition of Acute MI");
// Symptoms column
sl.addShape(pres.ShapeType.roundRect, {
x: 0.3, y: 1.7, w: 4.4, h: 3.75,
fill: { color: C.cardBg }, line: { color: C.crimson, width: 1.5 },
rectRadius: 0.12,
});
sl.addText("Symptoms", {
x: 0.45, y: 1.75, w: 4.1, h: 0.4,
fontSize: 14, bold: true, color: C.gold, margin: 0,
});
bulletList(sl, [
"Severe, crushing central chest pain (>20 min)",
"Radiation to left arm, jaw, neck, back",
"Diaphoresis, nausea, vomiting",
"Dyspnea, sense of impending doom",
"Silent MI: especially in diabetics & elderly",
"Atypical: epigastric pain, fatigue (women)",
], { x: 0.45, y: 2.2, w: 4.1, h: 3.0, fontSize: 12, color: C.offWhite });
// Investigations column
sl.addShape(pres.ShapeType.roundRect, {
x: 5.0, y: 1.7, w: 4.6, h: 3.75,
fill: { color: C.cardBg }, line: { color: C.accent, width: 1.5 },
rectRadius: 0.12,
});
sl.addText("Investigations", {
x: 5.15, y: 1.75, w: 4.3, h: 0.4,
fontSize: 14, bold: true, color: C.gold, margin: 0,
});
bulletList(sl, [
{ text: "ECG (12-lead):", bold: true },
{ text: " ST elevation (STEMI) | T-wave inversion | new LBBB", indent: 1 },
{ text: "Cardiac Biomarkers:", bold: true },
{ text: " Troponin I/T — rises 3–6 hrs, peaks 12–24 hrs; gold standard", indent: 1 },
{ text: " CK-MB — rises 4–8 hrs; useful for reinfarction", indent: 1 },
{ text: "Imaging:", bold: true },
{ text: " Echo: wall motion abnormalities, EF assessment", indent: 1 },
{ text: " Coronary angiography: definitive anatomy", indent: 1 },
], { x: 5.15, y: 2.2, w: 4.3, h: 3.1, fontSize: 11.5, color: C.offWhite });
}
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 6 — MORPHOLOGIC EVOLUTION (timeline table)
// ═══════════════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
sl.addShape(pres.ShapeType.rect, {
x: 0, y: 0, w: "100%", h: "100%",
fill: { color: C.midBg }, line: { type: "none" },
});
sectionHeader(sl, "PATHOLOGY");
slideTitle(sl, "Morphologic Evolution of Myocardial Infarction");
const rows = [
["Time", "Gross Features", "Light Microscopy"],
["0–0.5 hr", "None visible", "Normal; mitochondrial swelling (EM)"],
["0.5–4 hr", "None", "Wavy fibers at border (occasional)"],
["4–12 hr", "Dark mottling (occasional)", "Early coagulative necrosis; edema; hemorrhage"],
["12–24 hr", "Dark mottling", "Coagulative necrosis; nuclear pyknosis; neutrophilic infiltrate begins"],
["1–3 days", "Mottling; yellow-tan centre", "Loss of nuclei & striations; brisk neutrophil infiltrate"],
["3–7 days", "Yellow-tan, soft; hyperemic rim", "Macrophage infiltration; dissolving fibres (risk of rupture)"],
["1–3 wks", "Gray-white, firm edges", "Granulation tissue; fibroblast proliferation"],
["Months", "White fibrous scar", "Dense collagen scar; complete remodelling"],
];
const colW = [1.45, 3.55, 4.55];
const colX = [0.25, 1.7, 5.25];
const rowH = 0.49;
const startY = 1.65;
rows.forEach((row, ri) => {
row.forEach((cell, ci) => {
const isHeader = ri === 0;
sl.addShape(pres.ShapeType.rect, {
x: colX[ci], y: startY + ri * rowH,
w: colW[ci], h: rowH,
fill: { color: isHeader ? C.crimson : (ri % 2 === 0 ? C.cardBg : "0B2545") },
line: { color: "334466", width: 0.5 },
});
sl.addText(cell, {
x: colX[ci] + 0.07, y: startY + ri * rowH,
w: colW[ci] - 0.14, h: rowH,
fontSize: isHeader ? 11 : 10,
color: isHeader ? C.white : (ci === 0 ? C.gold : C.offWhite),
bold: isHeader,
valign: "middle", margin: 0, wrap: true,
});
});
});
}
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 7 — INFARCT LOCATION & TERRITORY
// ═══════════════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
sl.addShape(pres.ShapeType.rect, {
x: 0, y: 0, w: "100%", h: "100%",
fill: { color: C.midBg }, line: { type: "none" },
});
sectionHeader(sl, "INFARCT TERRITORY");
slideTitle(sl, "Coronary Artery Territories & Affected Regions");
const arteries = [
{
name: "LAD (Left Anterior Descending)",
territory: "Anterior wall LV, anterior 2/3 of septum, apex",
notes: "Most common infarct-related artery; anterior STEMI",
color: C.crimson,
},
{
name: "RCA (Right Coronary Artery)",
territory: "Inferior/posterior wall LV, posterior septum, RV",
notes: "Inferior STEMI; may cause AV block; RV infarction in 15–30%",
color: C.accent,
},
{
name: "LCx (Left Circumflex)",
territory: "Lateral & posterolateral wall LV",
notes: "Lateral STEMI; often ECG-silent (posterior leads needed)",
color: C.gold,
},
];
arteries.forEach((a, i) => {
const yPos = 1.8 + i * 1.25;
sl.addShape(pres.ShapeType.roundRect, {
x: 0.3, y: yPos, w: 9.1, h: 1.1,
fill: { color: C.cardBg }, line: { color: a.color, width: 2 },
rectRadius: 0.12,
});
sl.addText(a.name, {
x: 0.5, y: yPos + 0.08, w: 3.5, h: 0.4,
fontSize: 13, bold: true, color: a.color, margin: 0,
});
sl.addText("Territory: " + a.territory, {
x: 0.5, y: yPos + 0.5, w: 5.5, h: 0.35,
fontSize: 11, color: C.lightGray, margin: 0,
});
sl.addText(a.notes, {
x: 5.5, y: yPos + 0.1, w: 3.7, h: 0.9,
fontSize: 10.5, color: C.offWhite, italic: true, valign: "middle", wrap: true, margin: 0,
});
});
sl.addText("Note: Isolated RV infarction is rare (1–3%). Atrial infarction is uncommon.", {
x: 0.5, y: 5.55, w: 9, h: 0.35,
fontSize: 10.5, italic: true, color: C.subtleGray, margin: 0,
});
}
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 8 — COMPLICATIONS
// ═══════════════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
sl.addShape(pres.ShapeType.rect, {
x: 0, y: 0, w: "100%", h: "100%",
fill: { color: C.midBg }, line: { type: "none" },
});
sectionHeader(sl, "COMPLICATIONS");
slideTitle(sl, "Post-MI Complications");
const comps = [
{
title: "Arrhythmias (most common)",
body: "~90% of patients. VF greatest risk in first hour. Includes heart block, VT, SVT, asystole.",
color: C.crimson,
},
{
title: "Myocardial Rupture (1–3%)",
body: "Free wall → tamponade; Septal → VSD; Papillary muscle → acute MR. Peak risk: days 3–7.",
color: C.accent,
},
{
title: "LV Failure / Cardiogenic Shock",
body: "Occurs with large infarcts. Progressive pump failure; 40–50% of ventricle loss → shock.",
color: C.gold,
},
{
title: "Pericarditis",
body: "2–3 days post-MI. Friction rub, pleuritic chest pain. Dressler syndrome weeks later (autoimmune).",
color: "4FC3F7",
},
{
title: "Mural Thrombus & Embolism",
body: "Wall motion abnormality + stasis. Risk of systemic embolism; anticoagulation indicated.",
color: "80CBC4",
},
{
title: "LV Aneurysm",
body: "Late complication. Paradoxical bulge, persistent ST elevation, arrhythmias, CHF, thrombus.",
color: "CE93D8",
},
];
const cols = 3;
const cardW = 2.9;
const cardH = 1.4;
const gapX = 0.25;
const gapY = 0.22;
const startX = 0.3;
const startY = 1.75;
comps.forEach((c, i) => {
const col = i % cols;
const row = Math.floor(i / cols);
const x = startX + col * (cardW + gapX);
const y = startY + row * (cardH + gapY);
sl.addShape(pres.ShapeType.roundRect, {
x, y, w: cardW, h: cardH,
fill: { color: C.cardBg }, line: { color: c.color, width: 1.5 },
rectRadius: 0.12,
});
sl.addText(c.title, {
x: x + 0.12, y: y + 0.1, w: cardW - 0.24, h: 0.36,
fontSize: 11, bold: true, color: c.color, margin: 0,
});
sl.addText(c.body, {
x: x + 0.12, y: y + 0.48, w: cardW - 0.24, h: cardH - 0.56,
fontSize: 10, color: C.offWhite, valign: "top", wrap: true, margin: 0,
});
});
}
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 9 — MANAGEMENT: IMMEDIATE
// ═══════════════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
sl.addShape(pres.ShapeType.rect, {
x: 0, y: 0, w: "100%", h: "100%",
fill: { color: C.midBg }, line: { type: "none" },
});
sectionHeader(sl, "MANAGEMENT");
slideTitle(sl, "Immediate Management of ACS");
// MONA + acronym display
const monaItems = [
{ letter: "M", word: "Morphine", desc: "IV opioid analgesia — use judiciously (may mask symptoms)" },
{ letter: "O", word: "Oxygen", desc: "Supplemental O₂ if SpO₂ <94% (avoid hyperoxia)" },
{ letter: "N", word: "Nitrates", desc: "Sublingual/IV GTN for pain relief & preload reduction" },
{ letter: "A", word: "Aspirin", desc: "300 mg loading dose immediately; indefinite 75–100 mg/day" },
];
sl.addText("Initial Pharmacotherapy", {
x: 0.4, y: 1.7, w: 4.5, h: 0.4,
fontSize: 14, bold: true, color: C.gold, margin: 0,
});
monaItems.forEach((m, i) => {
const y = 2.15 + i * 0.77;
sl.addShape(pres.ShapeType.rect, {
x: 0.35, y, w: 0.45, h: 0.55,
fill: { color: C.crimson }, line: { type: "none" },
});
sl.addText(m.letter, {
x: 0.35, y, w: 0.45, h: 0.55,
fontSize: 18, bold: true, color: C.white, align: "center", valign: "middle", margin: 0,
});
sl.addText(m.word + ": ", {
x: 0.9, y: y + 0.03, w: 4.2, h: 0.28,
fontSize: 12, bold: true, color: C.offWhite, margin: 0,
});
sl.addText(m.desc, {
x: 0.9, y: y + 0.29, w: 4.2, h: 0.26,
fontSize: 10.5, color: C.lightGray, margin: 0, italic: true,
});
});
// Additional therapy column
sl.addShape(pres.ShapeType.roundRect, {
x: 5.2, y: 1.7, w: 4.35, h: 3.7,
fill: { color: C.cardBg }, line: { color: C.accent, width: 1.5 },
rectRadius: 0.12,
});
sl.addText("Additional Agents", {
x: 5.35, y: 1.78, w: 4.0, h: 0.38,
fontSize: 13, bold: true, color: C.gold, margin: 0,
});
bulletList(sl, [
{ text: "P2Y12 inhibitor (clopidogrel / ticagrelor / prasugrel) — dual antiplatelet", bold: false },
{ text: "Anticoagulation: UFH, LMWH (enoxaparin), or fondaparinux", bold: false },
{ text: "Beta-blockers (metoprolol): reduce HR, O₂ demand, arrhythmia risk", bold: false },
{ text: "ACE inhibitor: early initiation post-MI, especially anterior STEMI", bold: false },
{ text: "High-intensity statin: atorvastatin 80 mg — plaque stabilisation", bold: false },
{ text: "GPIIb/IIIa inhibitors: PCI adjunct in high-risk NSTEMI", bold: false },
], { x: 5.35, y: 2.2, w: 4.0, h: 3.0, fontSize: 11, color: C.offWhite });
}
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 10 — REPERFUSION STRATEGIES
// ═══════════════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
sl.addShape(pres.ShapeType.rect, {
x: 0, y: 0, w: "100%", h: "100%",
fill: { color: C.midBg }, line: { type: "none" },
});
sectionHeader(sl, "REPERFUSION STRATEGIES");
slideTitle(sl, "Restoring Coronary Flow — Time is Muscle");
sl.addText('"Time is muscle" — each minute of ischemia = irreversible cardiomyocyte loss', {
x: 0.5, y: 1.7, w: 9, h: 0.4,
fontSize: 13, italic: true, color: C.gold, margin: 0,
});
// Primary PCI box
sl.addShape(pres.ShapeType.roundRect, {
x: 0.3, y: 2.2, w: 4.45, h: 3.15,
fill: { color: "1E0505" }, line: { color: C.crimson, width: 2 },
rectRadius: 0.12,
});
sl.addText("PRIMARY PCI (Preferred)", {
x: 0.45, y: 2.28, w: 4.15, h: 0.42,
fontSize: 13, bold: true, color: C.crimson, margin: 0,
});
bulletList(sl, [
"Gold standard for STEMI if PCI-capable centre within 90 min",
"Door-to-balloon time goal: ≤90 minutes",
"Restores TIMI 3 flow in >90% of cases",
"Superior to thrombolysis: lower mortality, reinfarction, stroke",
"Also preferred in cardiogenic shock, failed thrombolysis",
"Radial access preferred: lower bleeding risk",
], { x: 0.45, y: 2.75, w: 4.15, h: 2.45, fontSize: 11, color: C.lightGray });
// Thrombolysis box
sl.addShape(pres.ShapeType.roundRect, {
x: 5.05, y: 2.2, w: 4.45, h: 3.15,
fill: { color: "00001E" }, line: { color: C.accent, width: 2 },
rectRadius: 0.12,
});
sl.addText("THROMBOLYSIS (When PCI unavailable)", {
x: 5.2, y: 2.28, w: 4.15, h: 0.42,
fontSize: 12.5, bold: true, color: C.accent, margin: 0,
});
bulletList(sl, [
"Administer if PCI cannot be achieved within 120 min of FMC",
"Agents: alteplase, tenecteplase, reteplase",
"Door-to-needle time: ≤30 minutes",
"Contraindicated: prior haemorrhagic stroke, recent surgery, uncontrolled HTN",
"If successful → pharmacoinvasive strategy: angiography within 24 hrs",
"If failed → rescue PCI",
], { x: 5.2, y: 2.75, w: 4.15, h: 2.45, fontSize: 11, color: C.lightGray });
sl.addText("Reperfusion injury: paradoxical myocardial damage on restoration of blood flow — mitochondrial Ca²⁺ overload, ROS generation, no-reflow phenomenon", {
x: 0.5, y: 5.5, w: 9, h: 0.35,
fontSize: 9.5, italic: true, color: C.subtleGray, margin: 0,
});
}
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 11 — SECONDARY PREVENTION
// ═══════════════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
sl.addShape(pres.ShapeType.rect, {
x: 0, y: 0, w: "100%", h: "100%",
fill: { color: C.midBg }, line: { type: "none" },
});
sectionHeader(sl, "SECONDARY PREVENTION");
slideTitle(sl, "Post-MI Long-term Management");
const drugs = [
{ drug: "Aspirin", dose: "75–100 mg OD lifelong", reason: "Antiplatelet — prevents reinfarction" },
{ drug: "P2Y12 Inhibitor", dose: "Dual therapy for 12 months (ticagrelor/prasugrel preferred post-PCI)", reason: "DAPT reduces stent thrombosis & recurrent ACS" },
{ drug: "Beta-Blocker", dose: "Lifelong if LV dysfunction present (EF <40%)", reason: "Reduces mortality, sudden death, arrhythmias" },
{ drug: "ACE Inhibitor / ARB", dose: "All post-MI patients, especially with LV dysfunction or DM", reason: "Prevents cardiac remodelling, reduces CHF" },
{ drug: "High-Intensity Statin", dose: "Atorvastatin 40–80 mg or rosuvastatin 20–40 mg", reason: "LDL target <1.4 mmol/L; plaque stabilisation" },
{ drug: "Eplerenone / Spironolactone", dose: "Post-MI EF ≤40% + HF or DM", reason: "Aldosterone antagonist — reduces mortality" },
];
drugs.forEach((d, i) => {
const yPos = 1.75 + i * 0.64;
sl.addShape(pres.ShapeType.roundRect, {
x: 0.3, y: yPos, w: 9.1, h: 0.58,
fill: { color: i % 2 === 0 ? C.cardBg : "0B2545" },
line: { color: "334466", width: 0.5 }, rectRadius: 0.08,
});
sl.addText(d.drug, {
x: 0.45, y: yPos + 0.1, w: 2.2, h: 0.38,
fontSize: 12, bold: true, color: C.gold, margin: 0,
});
sl.addText(d.dose, {
x: 2.75, y: yPos + 0.1, w: 3.4, h: 0.38,
fontSize: 11, color: C.lightGray, margin: 0,
});
sl.addText(d.reason, {
x: 6.2, y: yPos + 0.1, w: 3.0, h: 0.38,
fontSize: 10.5, color: C.accent, italic: true, margin: 0,
});
});
sl.addText("Additional: Cardiac rehabilitation | Smoking cessation | BP control | Glycaemic control | Weight management | Annual influenza vaccine", {
x: 0.4, y: 5.7, w: 9, h: 0.35,
fontSize: 10, color: C.subtleGray, italic: true, margin: 0,
});
}
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 12 — PROGNOSIS & RISK STRATIFICATION
// ═══════════════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
sl.addShape(pres.ShapeType.rect, {
x: 0, y: 0, w: "100%", h: "100%",
fill: { color: C.midBg }, line: { type: "none" },
});
sectionHeader(sl, "PROGNOSIS & RISK STRATIFICATION");
slideTitle(sl, "Predictors of Outcome Post-MI");
// Left — poor prognosis factors
sl.addShape(pres.ShapeType.roundRect, {
x: 0.3, y: 1.7, w: 4.3, h: 3.6,
fill: { color: "2A0000" }, line: { color: C.crimson, width: 2 },
rectRadius: 0.12,
});
sl.addText("Poor Prognosis Factors", {
x: 0.45, y: 1.78, w: 4.0, h: 0.42,
fontSize: 13, bold: true, color: C.crimson, margin: 0,
});
bulletList(sl, [
"Large infarct size (high troponin peak)",
"Low LVEF (<40%)",
"Cardiogenic shock at presentation",
"Age >70 years",
"Multivessel coronary disease",
"Anterior STEMI / LBBB",
"Delayed reperfusion (>6 hrs)",
"Renal impairment, diabetes",
"Previous MI or CHF",
], { x: 0.45, y: 2.25, w: 4.0, h: 2.8, fontSize: 11.5, color: C.lightGray });
// Right — risk scores
sl.addShape(pres.ShapeType.roundRect, {
x: 5.0, y: 1.7, w: 4.6, h: 3.6,
fill: { color: C.cardBg }, line: { color: C.accent, width: 2 },
rectRadius: 0.12,
});
sl.addText("Risk Scores & Follow-up", {
x: 5.15, y: 1.78, w: 4.3, h: 0.42,
fontSize: 13, bold: true, color: C.accent, margin: 0,
});
bulletList(sl, [
{ text: "TIMI Risk Score (STEMI/NSTEMI):", bold: true },
{ text: " 7-variable score; predicts 30-day mortality", indent: 1 },
{ text: "GRACE Score:", bold: true },
{ text: " Age, HR, BP, Cr, Killip class, cardiac arrest, ST deviation, troponin", indent: 1 },
{ text: "Killip Classification:", bold: true },
{ text: " Class I–IV: correlates with 30-day mortality (I: ~6% → IV: ~80%)", indent: 1 },
{ text: "Follow-up Echo at 6–12 weeks to assess for LV remodelling", bold: false },
{ text: "Cardiac MRI: gold standard for viability & scar assessment", bold: false },
], { x: 5.15, y: 2.25, w: 4.3, h: 2.8, fontSize: 11, color: C.offWhite });
}
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 13 — SPECIAL POPULATIONS
// ═══════════════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
sl.addShape(pres.ShapeType.rect, {
x: 0, y: 0, w: "100%", h: "100%",
fill: { color: C.midBg }, line: { type: "none" },
});
sectionHeader(sl, "SPECIAL POPULATIONS");
slideTitle(sl, "MI in Special Populations");
const pops = [
{
title: "Women",
points: [
"Atypical presentation: fatigue, nausea, jaw/back pain",
"Under-represented in trials historically",
"Worse outcomes post-NSTEMI vs men",
"Spontaneous coronary artery dissection (SCAD) — young women",
"Postmenopausal decline in oestrogen → ↑ risk",
],
color: "F48FB1",
},
{
title: "Diabetics",
points: [
"Silent / painless MI more common",
"Larger infarcts, more multivessel disease",
"Higher mortality and heart failure risk",
"SGLT2 inhibitors & GLP-1 agonists reduce CV mortality",
"Tight glycaemic control post-MI may reduce events",
],
color: "80CBC4",
},
{
title: "Elderly (>75 yrs)",
points: [
"Atypical symptoms: dyspnoea, syncope, confusion",
"Higher procedural risk but benefit from PCI preserved",
"Bleeding risk — dose adjustment for anticoagulants",
"Frailty assessment influences treatment intensity",
"Polypharmacy and renal function require close monitoring",
],
color: C.gold,
},
];
pops.forEach((p, i) => {
const x = 0.28 + i * 3.23;
sl.addShape(pres.ShapeType.roundRect, {
x, y: 1.7, w: 3.0, h: 3.75,
fill: { color: C.cardBg }, line: { color: p.color, width: 2 },
rectRadius: 0.12,
});
sl.addText(p.title, {
x: x + 0.15, y: 1.78, w: 2.7, h: 0.4,
fontSize: 14, bold: true, color: p.color, align: "center", margin: 0,
});
bulletList(sl, p.points, {
x: x + 0.15, y: 2.25, w: 2.7, h: 3.0, fontSize: 11, color: C.offWhite,
});
});
}
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 14 — KEY CONCEPTS SUMMARY
// ═══════════════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
sl.addShape(pres.ShapeType.rect, {
x: 0, y: 0, w: "100%", h: "100%",
fill: { color: C.midBg }, line: { type: "none" },
});
sectionHeader(sl, "SUMMARY");
slideTitle(sl, "Key Concepts — Myocardial Infarction");
const keyPoints = [
"MI = necrosis of cardiac muscle from prolonged ischemia; most commonly caused by acute coronary thrombosis on a disrupted atherosclerotic plaque.",
"Plaque rupture activates platelets (TXA₂, ADP) and coagulation cascade → within minutes can completely occlude the lumen.",
"Loss of cardiac function occurs within 1–2 min of ischemia; irreversible necrosis begins after 20–30 min.",
"Classified as STEMI (transmural; complete occlusion) or NSTEMI (subendocardial; partial occlusion).",
"Diagnosis: clinical features + ECG changes + cardiac troponins (rise 3–6 hrs; peak 12–24 hrs).",
"Complications: arrhythmias (~90%), rupture (1–3%), LV failure, pericarditis, aneurysm, mural thrombus.",
"Reperfusion: primary PCI preferred (door-to-balloon ≤90 min); thrombolysis if PCI not available within 120 min.",
"Secondary prevention: DAPT, beta-blocker, ACEi/ARB, high-dose statin, aldosterone antagonist if EF ≤40%.",
];
keyPoints.forEach((pt, i) => {
const yPos = 1.72 + i * 0.48;
sl.addShape(pres.ShapeType.rect, {
x: 0.3, y: yPos + 0.1, w: 0.28, h: 0.28,
fill: { color: i < 2 ? C.crimson : i < 4 ? C.accent : i < 6 ? C.gold : "4FC3F7" },
line: { type: "none" },
});
sl.addText(String(i + 1), {
x: 0.3, y: yPos + 0.1, w: 0.28, h: 0.28,
fontSize: 9, bold: true, color: C.white, align: "center", valign: "middle", margin: 0,
});
sl.addText(pt, {
x: 0.72, y: yPos, w: 8.8, h: 0.46,
fontSize: 11, color: C.offWhite, valign: "middle", margin: 0, wrap: true,
});
});
}
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 15 — REFERENCES
// ═══════════════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
sl.addShape(pres.ShapeType.rect, {
x: 0, y: 0, w: "100%", h: "100%",
fill: { color: C.darkBg }, line: { type: "none" },
});
sl.addShape(pres.ShapeType.rect, {
x: 0, y: 0, w: 0.18, h: "100%",
fill: { color: C.crimson }, line: { type: "none" },
});
sl.addText("REFERENCES", {
x: 0.5, y: 0.3, w: 9, h: 0.55,
fontSize: 22, bold: true, color: C.white, margin: 0, charSpacing: 3,
});
sl.addShape(pres.ShapeType.line, {
x: 0.5, y: 0.88, w: 9, h: 0,
line: { color: C.crimson, width: 2 },
});
const refs = [
"Kumar V, Abbas AK, Aster JC. Robbins & Kumar Basic Pathology, 11th ed. Elsevier, 2023.",
"Kumar V et al. Robbins, Cotran & Kumar Pathologic Basis of Disease, 10th ed. Elsevier, 2021.",
"Libby P, Bonow RO et al. Braunwald's Heart Disease: A Textbook of Cardiovascular Medicine, 12th ed. Elsevier, 2022.",
"Goldman L, Schafer AI. Goldman-Cecil Medicine, 27th ed. Elsevier, 2024.",
"Fuster V et al. Fuster and Hurst's The Heart, 15th ed. McGraw-Hill, 2022.",
"Collet JP et al. 2020 ESC Guidelines for the management of acute coronary syndromes in patients presenting without ST-segment elevation. Eur Heart J. 2021;42(14):1289–1367.",
"Ibanez B et al. 2017 ESC Guidelines for the management of acute myocardial infarction in patients presenting with ST-segment elevation. Eur Heart J. 2018;39(2):119–177.",
];
refs.forEach((r, i) => {
sl.addText(`${i + 1}. ${r}`, {
x: 0.5, y: 1.0 + i * 0.6, w: 9.1, h: 0.55,
fontSize: 11, color: i < 5 ? C.lightGray : C.subtleGray,
valign: "top", wrap: true, margin: 0,
});
});
}
// ─── WRITE FILE ───────────────────────────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/workspace/mi-pptx/Myocardial_Infarction.pptx" })
.then(() => console.log("DONE: /home/daytona/workspace/mi-pptx/Myocardial_Infarction.pptx"))
.catch(err => { console.error(err); process.exit(1); });
cd /home/daytona/workspace/mi-pptx && node build.js 2>&1
ls -lh /home/daytona/workspace/mi-pptx/Myocardial_Infarction.pptx
Myocardial Infarction
Presentation · PPTX
| Slide | Content |
|---|---|
| 1 | Title slide |
| 2 | Overview & Epidemiology (stat cards: 800k/yr, ~400k deaths, 10% under 40) |
| 3 | Pathogenesis — 5-step coronary occlusion sequence |
| 4 | Classification: STEMI vs NSTEMI vs Unstable Angina |
| 5 | Clinical features & Investigations (ECG, troponins, imaging) |
| 6 | Morphologic evolution table (0.5 hr → months) |
| 7 | Coronary artery territories: LAD, RCA, LCx |
| 8 | Complications: arrhythmias, rupture, LV failure, pericarditis, aneurysm, mural thrombus |
| 9 | Immediate management: MONA + antiplatelets, anticoagulation, statins, ACEi, beta-blockers |
| 10 | Reperfusion: Primary PCI vs Thrombolysis, door-to-balloon/needle targets |
| 11 | Secondary prevention drug table (DAPT, beta-blocker, ACEi, statin, aldosterone antagonist) |
| 12 | Prognosis & risk stratification (TIMI, GRACE, Killip class) |
| 13 | Special populations: Women, Diabetics, Elderly |
| 14 | 8-point key concepts summary |
| 15 | References (Robbins, Braunwald, Goldman-Cecil, ESC Guidelines 2017/2020) |