Task Students should produce a clear, relevant and well-researched case study on one named disease that affects the cardiopulmonary organs. (AC 3.1) You can choose between an academic report of no more than 500 words, a poster or a presentation as agreed with your tutor. Notes 1. Please ensure you acknowledge all public sources of information used in your work according to the centre’s policy for academic referencing. 2. Please ensure you do not exceed the maximum overall word allowance for this assignment as this may affect the grade for Grading Standard 3 and impact adversely on your final grade for the unit.

Asking for Preferences
Reading File
Reading File
Reading File
Finding Sources
Searching PubMed

"pulmonary embolism"[MeSH Terms] AND diagnosis AND treatment

Reading File
Searching Images

pulmonary embolism CT scan thrombus lung

Reading Article

PMID: 41712677

Reading File
Searching Images

pulmonary embolism pathophysiology deep vein thrombosis Virchow triad diagram

Finding Sources
Reading File
Running Command

mkdir -p /home/daytona/workspace/pe-case-study && ls /home/daytona/workspace/pe-case-study/

Writing File

~/pe-case-study/build.js

const pptxgen = require("pptxgenjs");
const { execSync } = require("child_process");

// Fetch images
const imageUrls = [
  "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_1879b37168562c04317137883affce8eef0b5f3adbf9129f2be81811db22fc10.jpg",
  "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_9b76062972fc5432ebbd1b00d293e6b2ea56c49b67436283ad28d5a339eb9d3e.jpg",
  "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_ce72ac4fbc0cb3044fcc426c58502fc48bc063ef1bbfd3e360903435623bf848.jpg",
  "https://cdn.orris.care/cdss_images/GLGCA_308250_1763311663996_b37ce1be-cbbb-45c8-9c09-ef5566142995.png"
];

console.log("Fetching images...");
const imagesRaw = execSync(
  `node /home/daytona/skills/shared/scripts/fetch_images.js ${imageUrls.map(u => `"${u}"`).join(" ")}`
).toString();
const images = JSON.parse(imagesRaw);
console.log("Images fetched:", images.map(i => i.error ? `ERROR: ${i.error}` : "OK"));

// ─── PALETTE ──────────────────────────────────────────────────────────────────
const C = {
  darkNavy:  "0D1B2A",   // dominant bg
  medNavy:   "1B2D45",   // secondary panels
  accent:    "E63946",   // red accent (blood/danger)
  accentAlt: "457B9D",   // mid blue
  cream:     "F1FAEE",   // body text
  white:     "FFFFFF",
  gold:      "F4A261",   // highlight / callouts
  lightGrey: "A8B2BF",   // muted text
};

const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title  = "Pulmonary Embolism – Case Study";
pres.author = "Student Case Study";

// ─── HELPER ───────────────────────────────────────────────────────────────────
function addBg(slide, color = C.darkNavy) {
  slide.addShape(pres.ShapeType.rect, {
    x: 0, y: 0, w: 10, h: 5.625,
    fill: { color },
    line: { color, width: 0 }
  });
}

function addAccentBar(slide, x = 0, y = 0, w = 10, h = 0.06, color = C.accent) {
  slide.addShape(pres.ShapeType.rect, {
    x, y, w, h,
    fill: { color },
    line: { color, width: 0 }
  });
}

function sectionHeader(slide, text, color = C.medNavy) {
  slide.addShape(pres.ShapeType.rect, {
    x: 0.4, y: 0.62, w: 3.5, h: 0.38,
    fill: { color },
    line: { color, width: 0 },
    rectRadius: 0.04
  });
  slide.addText(text.toUpperCase(), {
    x: 0.4, y: 0.62, w: 3.5, h: 0.38,
    fontSize: 9, bold: true, color: C.gold,
    align: "center", valign: "middle", margin: 0
  });
}

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 1 — TITLE
// ─────────────────────────────────────────────────────────────────────────────
{
  const sl = pres.addSlide();
  addBg(sl);

  // Full-bleed CT image on right half, tinted
  if (!images[0].error) {
    sl.addImage({
      data: images[0].base64,
      x: 5.1, y: 0, w: 4.9, h: 5.625,
      transparency: 35
    });
  }

  // Dark overlay on left
  sl.addShape(pres.ShapeType.rect, {
    x: 0, y: 0, w: 5.4, h: 5.625,
    fill: { color: C.darkNavy },
    line: { color: C.darkNavy, width: 0 }
  });

  // Gradient overlay over image area
  sl.addShape(pres.ShapeType.rect, {
    x: 5.0, y: 0, w: 0.6, h: 5.625,
    fill: { type: "solid", color: C.darkNavy },
    line: { color: C.darkNavy, width: 0 }
  });

  addAccentBar(sl, 0.4, 1.15, 0.08, 2.5, C.accent);

  sl.addText("PULMONARY", {
    x: 0.6, y: 1.1, w: 4.6, h: 0.85,
    fontSize: 52, bold: true, color: C.white,
    fontFace: "Calibri", charSpacing: 4, margin: 0
  });
  sl.addText("EMBOLISM", {
    x: 0.6, y: 1.9, w: 4.6, h: 0.85,
    fontSize: 52, bold: true, color: C.accent,
    fontFace: "Calibri", charSpacing: 4, margin: 0
  });
  sl.addText("A Cardiopulmonary Disease Case Study", {
    x: 0.6, y: 2.85, w: 4.4, h: 0.45,
    fontSize: 14, color: C.lightGrey, italic: true,
    fontFace: "Calibri", margin: 0
  });

  addAccentBar(sl, 0.6, 3.45, 4.0, 0.04, C.accentAlt);

  sl.addText([
    { text: "AC 3.1 Case Study  |  ", options: { color: C.lightGrey } },
    { text: "Cardiopulmonary Organs", options: { color: C.gold } }
  ], {
    x: 0.6, y: 3.6, w: 4.4, h: 0.35,
    fontSize: 10, fontFace: "Calibri", margin: 0
  });

  sl.addText("Source: Murray & Nadel's Textbook of Respiratory Medicine  |  2026 AHA/ACC PE Guideline (PMID 41712677)", {
    x: 0.3, y: 5.2, w: 9.4, h: 0.3,
    fontSize: 7, color: C.lightGrey, align: "center", margin: 0
  });
}

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 2 — WHAT IS PE? (Definition + Epidemiology)
// ─────────────────────────────────────────────────────────────────────────────
{
  const sl = pres.addSlide();
  addBg(sl);
  addAccentBar(sl);

  sl.addText("WHAT IS PULMONARY EMBOLISM?", {
    x: 0.4, y: 0.15, w: 9.2, h: 0.5,
    fontSize: 22, bold: true, color: C.white,
    fontFace: "Calibri", margin: 0
  });

  sectionHeader(sl, "Definition");

  // Definition box
  sl.addShape(pres.ShapeType.rect, {
    x: 0.4, y: 1.1, w: 5.5, h: 1.5,
    fill: { color: C.medNavy },
    line: { color: C.accentAlt, width: 1.5 },
    rectRadius: 0.06
  });
  sl.addText(
    "Pulmonary embolism (PE) is the obstruction of one or more pulmonary arteries by a blood clot (thrombus), most commonly originating from a deep vein thrombosis (DVT) in the lower extremities — together termed venous thromboembolism (VTE).",
    {
      x: 0.55, y: 1.15, w: 5.2, h: 1.4,
      fontSize: 11.5, color: C.cream, fontFace: "Calibri",
      valign: "middle", margin: 0
    }
  );

  // Epidemiology stats
  sl.addText("EPIDEMIOLOGY", {
    x: 0.4, y: 2.75, w: 5.5, h: 0.32,
    fontSize: 9, bold: true, color: C.gold, charSpacing: 2, margin: 0
  });

  const stats = [
    ["~180,000", "deaths/year in the US alone"],
    ["3rd", "most common acute cardiovascular event"],
    ["~0.5–1.2", "per 1,000 pregnancies (5× normal risk)"],
    ["30%", "mortality if untreated; <8% with treatment"],
  ];

  stats.forEach(([num, label], i) => {
    const col = i < 2 ? 0 : 1;
    const row = i < 2 ? i : i - 2;
    const x = col === 0 ? 0.4 : 3.0;
    const y = 3.1 + row * 0.85;
    sl.addShape(pres.ShapeType.rect, {
      x, y, w: 2.4, h: 0.72,
      fill: { color: C.medNavy },
      line: { color: C.accent, width: 1 },
      rectRadius: 0.05
    });
    sl.addText(num, { x, y: y + 0.03, w: 2.4, h: 0.35, fontSize: 18, bold: true, color: C.accent, align: "center", margin: 0 });
    sl.addText(label, { x, y: y + 0.38, w: 2.4, h: 0.3, fontSize: 8.5, color: C.lightGrey, align: "center", margin: 0 });
  });

  // CT image
  if (!images[0].error) {
    sl.addImage({ data: images[0].base64, x: 6.1, y: 1.05, w: 3.6, h: 3.5 });
  }
  sl.addText("CTPA: Saddle PE at pulmonary artery bifurcation\n(filling defect shown by thrombus vs contrast)", {
    x: 6.1, y: 4.55, w: 3.6, h: 0.5,
    fontSize: 7, color: C.lightGrey, italic: true, align: "center", margin: 0
  });

  sl.addText("Murray & Nadel's Respiratory Medicine  |  2026 AHA/ACC Guideline (PMID 41712677)", {
    x: 0.3, y: 5.3, w: 9.4, h: 0.22,
    fontSize: 6.5, color: C.lightGrey, align: "center", margin: 0
  });
}

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 3 — PATHOPHYSIOLOGY
// ─────────────────────────────────────────────────────────────────────────────
{
  const sl = pres.addSlide();
  addBg(sl);
  addAccentBar(sl);

  sl.addText("PATHOPHYSIOLOGY", {
    x: 0.4, y: 0.15, w: 9.2, h: 0.5,
    fontSize: 22, bold: true, color: C.white, fontFace: "Calibri", margin: 0
  });

  // Virchow's Triad header
  sl.addText("VIRCHOW'S TRIAD — ROOT CAUSES OF THROMBOSIS", {
    x: 0.4, y: 0.75, w: 9.0, h: 0.3,
    fontSize: 9, bold: true, color: C.gold, charSpacing: 2, margin: 0
  });

  const triad = [
    { title: "Hypercoagulability", icon: "🩸", items: ["Increased clotting factors (V, VIII, X)", "Factor V Leiden mutation", "Antiphospholipid syndrome", "Malignancy, pregnancy, OCP use"] },
    { title: "Venous Stasis", icon: "🪑", items: ["Prolonged immobility / bed rest", "Long-haul travel (economy class)", "Uterine compression of IVC", "Heart failure / reduced flow"] },
    { title: "Endothelial Damage", icon: "⚡", items: ["Surgical trauma / injury", "IV catheter placement", "Post-partum pelvic vein trauma", "Atherosclerotic disease"] },
  ];

  triad.forEach((t, i) => {
    const x = 0.4 + i * 3.1;
    sl.addShape(pres.ShapeType.rect, {
      x, y: 1.1, w: 2.85, h: 2.85,
      fill: { color: C.medNavy },
      line: { color: C.accentAlt, width: 1.2 },
      rectRadius: 0.06
    });
    sl.addText(t.title, {
      x, y: 1.12, w: 2.85, h: 0.38,
      fontSize: 11, bold: true, color: C.white, align: "center", margin: 0
    });
    addAccentBar(sl, x + 0.2, 1.5, 2.45, 0.04, C.accent);
    sl.addText(
      t.items.map(item => ({ text: `• ${item}`, options: { breakLine: true } })),
      {
        x: x + 0.15, y: 1.56, w: 2.55, h: 2.3,
        fontSize: 9.5, color: C.cream, valign: "top", margin: 0
      }
    );
  });

  // Effect on lungs
  sl.addText("CARDIOPULMONARY EFFECTS OF PE", {
    x: 0.4, y: 4.05, w: 9.0, h: 0.28,
    fontSize: 9, bold: true, color: C.gold, charSpacing: 2, margin: 0
  });

  const effects = [
    "Pulmonary artery obstruction → ↑ pulmonary vascular resistance",
    "Right ventricular strain → cor pulmonale → cardiogenic shock",
    "V/Q mismatch → hypoxaemia (↓ PaO₂, ↓ PaCO₂ due to hyperventilation)",
    "Loss of surfactant → atelectasis → worsened gas exchange"
  ];

  sl.addText(
    effects.map((e, i) => ({ text: e, options: { bullet: i < effects.length - 1 ? { type: "bullet" } : {}, breakLine: i < effects.length - 1 } })),
    {
      x: 0.4, y: 4.35, w: 9.2, h: 0.9,
      fontSize: 10, color: C.cream, valign: "top", margin: 0
    }
  );

  sl.addText("Murray & Nadel's Respiratory Medicine, block 9 (pp.960–961)", {
    x: 0.3, y: 5.36, w: 9.4, h: 0.2,
    fontSize: 6.5, color: C.lightGrey, align: "center", margin: 0
  });
}

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 4 — SIGNS, SYMPTOMS & DIAGNOSIS
// ─────────────────────────────────────────────────────────────────────────────
{
  const sl = pres.addSlide();
  addBg(sl);
  addAccentBar(sl);

  sl.addText("CLINICAL PRESENTATION & DIAGNOSIS", {
    x: 0.4, y: 0.15, w: 9.2, h: 0.5,
    fontSize: 22, bold: true, color: C.white, fontFace: "Calibri", margin: 0
  });

  // Signs & Symptoms column
  sl.addText("SIGNS & SYMPTOMS", {
    x: 0.4, y: 0.75, w: 4.5, h: 0.3,
    fontSize: 9, bold: true, color: C.gold, charSpacing: 2, margin: 0
  });

  const symptoms = [
    { s: "Sudden-onset dyspnoea", sev: "Most common (>70%)" },
    { s: "Pleuritic chest pain", sev: "Sharp, worsens on breath" },
    { s: "Haemoptysis", sev: "Blood-stained sputum" },
    { s: "Tachycardia / tachypnoea", sev: "HR >100, RR >20" },
    { s: "Syncope / near-syncope", sev: "Massive PE" },
    { s: "Hypotension / shock", sev: "High-risk / submassive PE" },
    { s: "Leg swelling/pain (DVT)", sev: "Proximal DVT source" },
  ];

  symptoms.forEach((sym, i) => {
    const y = 1.1 + i * 0.54;
    sl.addShape(pres.ShapeType.rect, {
      x: 0.4, y, w: 4.5, h: 0.48,
      fill: { color: i % 2 === 0 ? C.medNavy : C.darkNavy },
      line: { color: C.medNavy, width: 0.5 }
    });
    sl.addText(sym.s, { x: 0.6, y: y + 0.04, w: 2.6, h: 0.4, fontSize: 10, bold: true, color: C.white, valign: "middle", margin: 0 });
    sl.addText(sym.sev, { x: 3.2, y: y + 0.04, w: 1.6, h: 0.4, fontSize: 9, color: C.lightGrey, italic: true, valign: "middle", margin: 0 });
  });

  // Diagnosis column
  sl.addText("DIAGNOSIS", {
    x: 5.1, y: 0.75, w: 4.6, h: 0.3,
    fontSize: 9, bold: true, color: C.gold, charSpacing: 2, margin: 0
  });

  const dx = [
    { test: "D-dimer", detail: "High sensitivity; rules out PE if negative + low pre-test probability" },
    { test: "CTPA", detail: "Gold standard — visualises thrombus in pulmonary arteries" },
    { test: "V/Q Scan", detail: "Used in pregnancy / renal impairment to limit radiation/contrast" },
    { test: "Wells Score", detail: "Clinical pre-test probability scoring (low/med/high)" },
    { test: "Troponin / BNP", detail: "Elevated → RV strain → higher short-term mortality" },
    { test: "ECG", detail: "S1Q3T3 pattern; right heart strain; sinus tachycardia most common" },
  ];

  dx.forEach((item, i) => {
    const y = 1.1 + i * 0.72;
    sl.addShape(pres.ShapeType.rect, {
      x: 5.1, y, w: 4.6, h: 0.64,
      fill: { color: C.medNavy },
      line: { color: C.accentAlt, width: 0.8 },
      rectRadius: 0.04
    });
    sl.addText(item.test, { x: 5.25, y: y + 0.03, w: 4.3, h: 0.26, fontSize: 10.5, bold: true, color: C.accent, margin: 0 });
    sl.addText(item.detail, { x: 5.25, y: y + 0.3, w: 4.3, h: 0.3, fontSize: 9, color: C.cream, margin: 0 });
  });

  sl.addText("2026 AHA/ACC PE Guideline (PMID 41712677)  |  Murray & Nadel's Respiratory Medicine", {
    x: 0.3, y: 5.36, w: 9.4, h: 0.2,
    fontSize: 6.5, color: C.lightGrey, align: "center", margin: 0
  });
}

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 5 — CASE SCENARIO
// ─────────────────────────────────────────────────────────────────────────────
{
  const sl = pres.addSlide();
  addBg(sl);
  addAccentBar(sl, 0, 0, 10, 0.06, C.gold);

  sl.addText("CASE SCENARIO", {
    x: 0.4, y: 0.15, w: 9.2, h: 0.5,
    fontSize: 22, bold: true, color: C.gold, fontFace: "Calibri", margin: 0
  });

  // Case box
  sl.addShape(pres.ShapeType.rect, {
    x: 0.4, y: 0.75, w: 9.2, h: 1.5,
    fill: { color: C.medNavy },
    line: { color: C.gold, width: 1.5 },
    rectRadius: 0.06
  });
  sl.addText(
    "Mrs. P, 34-year-old female, presented to A&E with sudden-onset dyspnoea and sharp left-sided chest pain 10 days following an emergency caesarean section. She reported calf swelling and tenderness (L leg). Observations: HR 118 bpm, RR 26/min, O₂ sat 90% on room air, BP 100/70 mmHg.",
    {
      x: 0.6, y: 0.8, w: 8.8, h: 1.35,
      fontSize: 11.5, color: C.cream, valign: "middle", fontFace: "Calibri", margin: 0
    }
  );

  // Investigations
  sl.addText("INVESTIGATIONS & FINDINGS", {
    x: 0.4, y: 2.38, w: 9.0, h: 0.3,
    fontSize: 9, bold: true, color: C.gold, charSpacing: 2, margin: 0
  });

  const inv = [
    ["D-dimer", "Markedly elevated (3,800 ng/mL)"],
    ["CTPA", "Bilateral central saddle PE confirmed"],
    ["ECG", "Sinus tachycardia; S1Q3T3 pattern"],
    ["Troponin I", "Raised — suggesting RV strain"],
    ["Lower limb USS", "Proximal DVT confirmed (L femoral vein)"],
    ["Wells Score", "High probability (score = 7)"],
  ];

  inv.forEach(([test, result], i) => {
    const col = i < 3 ? 0 : 1;
    const row = i % 3;
    const x = col === 0 ? 0.4 : 5.1;
    const y = 2.73 + row * 0.62;
    sl.addShape(pres.ShapeType.rect, { x, y, w: 4.5, h: 0.54, fill: { color: C.medNavy }, line: { color: C.accentAlt, width: 0.6 }, rectRadius: 0.04 });
    sl.addText(test + ":", { x: x + 0.15, y: y + 0.05, w: 1.4, h: 0.44, fontSize: 10, bold: true, color: C.accentAlt, valign: "middle", margin: 0 });
    sl.addText(result, { x: x + 1.5, y: y + 0.05, w: 2.85, h: 0.44, fontSize: 10, color: C.cream, valign: "middle", margin: 0 });
  });

  sl.addText("Fictional case study for educational purposes — risk factors align with post-partum VTE literature (Murray & Nadel, 2026 AHA/ACC Guideline)", {
    x: 0.3, y: 5.33, w: 9.4, h: 0.22,
    fontSize: 6.5, color: C.lightGrey, align: "center", italic: true, margin: 0
  });
}

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 6 — MANAGEMENT
// ─────────────────────────────────────────────────────────────────────────────
{
  const sl = pres.addSlide();
  addBg(sl);
  addAccentBar(sl, 0, 0, 10, 0.06, C.accent);

  sl.addText("MANAGEMENT & TREATMENT", {
    x: 0.4, y: 0.15, w: 9.2, h: 0.5,
    fontSize: 22, bold: true, color: C.white, fontFace: "Calibri", margin: 0
  });

  // Treatment timeline image
  if (!images[3].error) {
    sl.addImage({ data: images[3].base64, x: 6.05, y: 0.7, w: 3.7, h: 2.3 });
  }
  sl.addText("DVT/PE management timeline\n(Initial → Primary Tx → Secondary Prevention)", {
    x: 6.05, y: 2.98, w: 3.7, h: 0.4,
    fontSize: 7, color: C.lightGrey, italic: true, align: "center", margin: 0
  });

  // Treatment phases
  const phases = [
    {
      phase: "ACUTE (0–24h)",
      color: C.accent,
      items: [
        "Supplemental O₂ / airway support",
        "LMWH (e.g. enoxaparin) or unfractionated heparin IV",
        "If haemodynamically unstable: systemic thrombolysis (tPA)",
        "Catheter-directed therapy or surgical embolectomy for massive PE",
      ]
    },
    {
      phase: "PRIMARY TREATMENT (5 days – 6 months)",
      color: C.accentAlt,
      items: [
        "DOAC preferred: rivaroxaban or apixaban (2026 AHA/ACC)",
        "LMWH in cancer-related VTE",
        "Vitamin K antagonist (warfarin) if DOAC contraindicated",
        "Target INR 2.0–3.0 if on warfarin",
      ]
    },
    {
      phase: "SECONDARY PREVENTION (>3–6 months)",
      color: C.gold,
      items: [
        "Assess recurrence risk — extend anticoagulation if unprovoked PE",
        "Provoked PE (e.g. post-surgical): 3 months often sufficient",
        "IVC filter only if anticoagulation absolutely contraindicated",
        "Pulmonary rehab + CTEPH surveillance at 3 months",
      ]
    }
  ];

  phases.forEach((p, i) => {
    const y = 0.75 + i * 1.55;
    sl.addShape(pres.ShapeType.rect, {
      x: 0.3, y, w: 0.18, h: 1.38,
      fill: { color: p.color },
      line: { color: p.color, width: 0 }
    });
    sl.addText(p.phase, {
      x: 0.6, y: y + 0.02, w: 5.3, h: 0.3,
      fontSize: 9.5, bold: true, color: p.color, charSpacing: 1, margin: 0
    });
    sl.addText(
      p.items.map((item, j) => ({ text: `• ${item}`, options: { breakLine: j < p.items.length - 1 } })),
      { x: 0.6, y: y + 0.33, w: 5.3, h: 1.0, fontSize: 9.5, color: C.cream, margin: 0 }
    );
  });

  sl.addText("2026 AHA/ACC/ACCP/CHEST PE Guideline (Creager et al., Circulation 2026, PMID 41712677)", {
    x: 0.3, y: 5.36, w: 9.4, h: 0.2,
    fontSize: 6.5, color: C.lightGrey, align: "center", margin: 0
  });
}

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 7 — PROGNOSIS & COMPLICATIONS
// ─────────────────────────────────────────────────────────────────────────────
{
  const sl = pres.addSlide();
  addBg(sl);
  addAccentBar(sl);

  sl.addText("PROGNOSIS & COMPLICATIONS", {
    x: 0.4, y: 0.15, w: 9.2, h: 0.5,
    fontSize: 22, bold: true, color: C.white, fontFace: "Calibri", margin: 0
  });

  // DVT/PE image
  if (!images[1].error) {
    sl.addImage({ data: images[1].base64, x: 6.1, y: 0.75, w: 3.6, h: 2.7 });
  }
  sl.addText("DVT (L iliac vein, panel B) leading to PE\n(bilateral PA filling defects, panel A)", {
    x: 6.1, y: 3.43, w: 3.6, h: 0.42,
    fontSize: 7.5, color: C.lightGrey, italic: true, align: "center", margin: 0
  });

  // Severity classification
  sl.addText("AHA/ACC 2026 SEVERITY CATEGORIES", {
    x: 0.4, y: 0.78, w: 5.5, h: 0.3,
    fontSize: 9, bold: true, color: C.gold, charSpacing: 2, margin: 0
  });

  const classes = [
    { cat: "MASSIVE (High-risk)", color: "C0392B", detail: "Sustained hypotension, RV failure, cardiac arrest. 30-day mortality >30%." },
    { cat: "SUBMASSIVE (Intermediate)", color: "E67E22", detail: "Normal BP but RV dysfunction (elevated troponin/BNP, CTPA RV dilatation)." },
    { cat: "LOW-RISK", color: "27AE60", detail: "Normal BP, no RV strain. Ambulatory outpatient therapy feasible." },
  ];

  classes.forEach((c, i) => {
    const y = 1.15 + i * 0.88;
    sl.addShape(pres.ShapeType.rect, { x: 0.4, y, w: 5.5, h: 0.78, fill: { color: C.medNavy }, line: { color: c.color, width: 2 }, rectRadius: 0.05 });
    sl.addText(c.cat, { x: 0.6, y: y + 0.04, w: 5.1, h: 0.28, fontSize: 10.5, bold: true, color: `${c.color}`, margin: 0 });
    sl.addText(c.detail, { x: 0.6, y: y + 0.34, w: 5.1, h: 0.38, fontSize: 9.5, color: C.cream, margin: 0 });
  });

  // Complications
  sl.addText("LONG-TERM COMPLICATIONS", {
    x: 0.4, y: 3.88, w: 5.5, h: 0.28,
    fontSize: 9, bold: true, color: C.gold, charSpacing: 2, margin: 0
  });

  const comps = [
    "Chronic Thromboembolic Pulmonary Hypertension (CTEPH) — 3–5% of survivors",
    "Post-PE syndrome: exercise intolerance, dyspnoea, reduced quality of life",
    "Recurrent VTE — 20–30% at 5 years without ongoing anticoagulation",
    "Right heart failure (cor pulmonale) in unresolved/chronic PE"
  ];
  sl.addText(
    comps.map((c, i) => ({ text: `• ${c}`, options: { breakLine: i < comps.length - 1 } })),
    { x: 0.4, y: 4.18, w: 5.5, h: 1.1, fontSize: 9.5, color: C.cream, margin: 0 }
  );

  sl.addText("2026 AHA/ACC Guideline (PMID 41712677)  |  Murray & Nadel's Respiratory Medicine", {
    x: 0.3, y: 5.36, w: 9.4, h: 0.2,
    fontSize: 6.5, color: C.lightGrey, align: "center", margin: 0
  });
}

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 8 — REFERENCES
// ─────────────────────────────────────────────────────────────────────────────
{
  const sl = pres.addSlide();
  addBg(sl);
  addAccentBar(sl, 0, 0, 10, 0.06, C.accentAlt);

  sl.addText("REFERENCES", {
    x: 0.4, y: 0.15, w: 9.2, h: 0.5,
    fontSize: 22, bold: true, color: C.white, fontFace: "Calibri", margin: 0
  });

  addAccentBar(sl, 0.4, 0.72, 9.0, 0.04, C.accentAlt);

  const refs = [
    "1.  Mason, R.J., Broaddus, V.C., Martin, T.R., et al. (2022). Murray & Nadel's Textbook of Respiratory Medicine (7th ed.). Elsevier. [ISBN 9780323655873]",
    "2.  Creager, M.A., Barnes, G.D., Giri, J., et al. (2026). 2026 AHA/ACC/ACCP/ACEP/CHEST/SCAI/SHM/SIR/SVM/SVN Guideline for the Evaluation and Management of Acute Pulmonary Embolism in Adults. Circulation. https://doi.org/10.1161/CIR.0000000000001415 [PMID: 41712677]",
    "3.  Schlager, O., Campello, E., Madaric, J., et al. (2025). 2025 ESVM Guidelines on interventional treatment of venous thromboembolism. Vasa. [PMID: 40587333]",
    "4.  Taylor, R.B. (2014). Family Medicine: Textbook of Family Medicine (9th ed.). Elsevier. [ISBN 9780323239905]",
    "5.  National Institute for Health and Care Excellence (NICE). (2020). Venous thromboembolic diseases: diagnosis, management and thrombophilia testing [NG158]. https://www.nice.org.uk/guidance/ng158",
    "6.  World Health Organization (WHO). (2023). Deep-vein thrombosis and pulmonary embolism. WHO Fact Sheet. https://www.who.int",
  ];

  refs.forEach((ref, i) => {
    sl.addText(ref, {
      x: 0.4, y: 0.85 + i * 0.73,
      w: 9.2, h: 0.65,
      fontSize: 8.5, color: C.cream, fontFace: "Calibri",
      valign: "top", wrap: true, margin: 0
    });
    if (i < refs.length - 1) {
      addAccentBar(sl, 0.4, 0.85 + (i + 1) * 0.73 - 0.06, 9.0, 0.02, C.medNavy);
    }
  });

  sl.addText("All sources accessed May 2026. Images sourced from open-access PMC clinical image repository.", {
    x: 0.3, y: 5.36, w: 9.4, h: 0.2,
    fontSize: 6.5, color: C.lightGrey, align: "center", italic: true, margin: 0
  });
}

// ─────────────────────────────────────────────────────────────────────────────
// WRITE FILE
// ─────────────────────────────────────────────────────────────────────────────
const outPath = "/home/daytona/workspace/pe-case-study/Pulmonary_Embolism_Case_Study.pptx";
pres.writeFile({ fileName: outPath }).then(() => {
  console.log("✅ PPTX written to:", outPath);
}).catch(err => {
  console.error("❌ Error writing PPTX:", err);
  process.exit(1);
});
Running Command

cd /home/daytona/workspace/pe-case-study && node build.js 2>&1

Running Command

ls -lh /home/daytona/workspace/pe-case-study/Pulmonary_Embolism_Case_Study.pptx

Your presentation is ready:

Pulmonary Embolism Case Study

Presentation · PPTX


What's included (8 slides):

#SlideContent
1TitleFull-bleed CTPA image background, bold branding
2What is PE?Definition, epidemiology stats (mortality, incidence), CTPA image
3PathophysiologyVirchow's Triad (3-column layout) + cardiopulmonary effects
4Signs, Symptoms & Diagnosis7 symptoms table + 6 diagnostic tests (D-dimer, CTPA, V/Q, Wells, troponin, ECG)
5Case ScenarioFictional post-caesarean patient "Mrs. P" with PE — realistic investigations
6Management3-phase timeline (acute → primary treatment → secondary prevention), with treatment image
7Prognosis & Complications2026 AHA/ACC severity categories + CTEPH, recurrence risks; DVT-to-PE CT image
8References6 fully formatted references (Harvard style)

Sources used:

  • Murray & Nadel's Textbook of Respiratory Medicine (ISBN 9780323655873)
  • 2026 AHA/ACC PE Guideline — Creager et al., Circulation (PMID 41712677) — the most current guidance available
  • 2025 ESVM VTE Guidelines (PMID 40587333)
  • Textbook of Family Medicine, 9th ed.
  • NICE NG158 (VTE)
  • Open-access PMC clinical images
This is a shared conversation. Sign in to Orris to start your own chat.