Detailed Presentation on anemia

Asking for Preferences
Reading File
Reading File
Reading File
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Running Command

ls /home/daytona/workspace/ 2>/dev/null && echo "---" && ls /home/daytona/skills…

Running Command

mkdir -p /home/daytona/workspace/anemia-pptx

Writing File

~/anemia-pptx/build.js

const pptxgen = require("pptxgenjs");

const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Anemia – A Comprehensive Overview";
pres.author = "Medical Education";

// ─── PALETTE ───────────────────────────────────────────────────────────────
const RED     = "C0392B";   // deep crimson – dominant accent
const DARK    = "1A1A2E";   // near-black navy
const MID     = "16213E";   // dark navy
const SLATE   = "0F3460";   // rich slate blue
const LIGHT   = "F5F6FA";   // off-white
const WHITE   = "FFFFFF";
const GOLD    = "E8A838";   // warm gold highlight
const SUBTLE  = "D4D6E0";   // muted grey text
const TEAL    = "1ABC9C";   // accent teal

// ─── HELPER: draw a coloured card ──────────────────────────────────────────
function card(slide, x, y, w, h, fill, text, fontSize=13, color=WHITE, bold=false) {
  slide.addShape(pres.ShapeType.roundRect, { x, y, w, h, fill: { color: fill }, line: { color: fill }, rectRadius: 0.08 });
  slide.addText(text, { x, y, w, h, fontSize, color, bold, align: "center", valign: "middle", margin: 6 });
}

// ─── HELPER: section label ─────────────────────────────────────────────────
function sectionTag(slide, label) {
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.12, fill: { color: RED } });
  slide.addText(label.toUpperCase(), { x: 0.3, y: 0.14, w: 9, h: 0.3, fontSize: 8, color: RED, bold: true, charSpacing: 3 });
}

// ─── HELPER: dark slide background ────────────────────────────────────────
function darkBg(slide) {
  slide.background = { color: DARK };
}
function midBg(slide) {
  slide.background = { color: MID };
}
function lightBg(slide) {
  slide.background = { color: LIGHT };
}

// ══════════════════════════════════════════════════════════════════════════
// SLIDE 1 – Title
// ══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  darkBg(s);

  // Red accent bar
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.18, h: 5.625, fill: { color: RED } });
  // Gold bar
  s.addShape(pres.ShapeType.rect, { x: 0.18, y: 0, w: 0.04, h: 5.625, fill: { color: GOLD } });

  s.addText("ANEMIA", { x: 0.5, y: 1.2, w: 8.5, h: 1.4, fontSize: 72, color: WHITE, bold: true, fontFace: "Calibri" });
  s.addText("A Comprehensive Overview for Medical Students", { x: 0.5, y: 2.7, w: 8.5, h: 0.6, fontSize: 20, color: GOLD, italic: true });

  s.addShape(pres.ShapeType.line, { x: 0.5, y: 3.4, w: 6, h: 0, line: { color: RED, width: 2 } });

  s.addText([
    { text: "Classification  •  Pathophysiology  •  Clinical Features  •  Diagnosis  •  Management", options: { color: SUBTLE, fontSize: 12 } }
  ], { x: 0.5, y: 3.6, w: 9, h: 0.4 });

  s.addText("Source: Robbins & Kumar Basic Pathology", { x: 0.5, y: 5.1, w: 9, h: 0.3, fontSize: 9, color: SUBTLE, italic: true });
}

// ══════════════════════════════════════════════════════════════════════════
// SLIDE 2 – Agenda / Outline
// ══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  darkBg(s);
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.12, fill: { color: RED } });

  s.addText("LECTURE OUTLINE", { x: 0.4, y: 0.25, w: 9, h: 0.5, fontSize: 28, color: GOLD, bold: true });

  const topics = [
    ["01", "Definition & Epidemiology"],
    ["02", "Classification by Mechanism"],
    ["03", "Anemia of Blood Loss"],
    ["04", "Hemolytic Anemias"],
    ["05", "Iron Deficiency Anemia"],
    ["06", "Anemia of Chronic Inflammation"],
    ["07", "Megaloblastic Anemias"],
    ["08", "Aplastic Anemia"],
    ["09", "Diagnosis & Laboratory Work-up"],
    ["10", "Management Principles"],
  ];

  topics.forEach(([num, title], i) => {
    const col = i < 5 ? 0 : 1;
    const row = i % 5;
    const x = col === 0 ? 0.4 : 5.2;
    const y = 1.0 + row * 0.82;
    s.addShape(pres.ShapeType.rect, { x, y, w: 0.5, h: 0.5, fill: { color: RED } });
    s.addText(num, { x, y, w: 0.5, h: 0.5, fontSize: 14, color: WHITE, bold: true, align: "center", valign: "middle" });
    s.addText(title, { x: x + 0.6, y, w: 3.8, h: 0.5, fontSize: 13, color: WHITE, valign: "middle" });
  });
}

// ══════════════════════════════════════════════════════════════════════════
// SLIDE 3 – Definition & Epidemiology
// ══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  lightBg(s);
  sectionTag(s, "Definition & Epidemiology");

  s.addText("What Is Anemia?", { x: 0.4, y: 0.45, w: 9, h: 0.55, fontSize: 30, color: DARK, bold: true });
  s.addShape(pres.ShapeType.line, { x: 0.4, y: 1.05, w: 4, h: 0, line: { color: RED, width: 2.5 } });

  // Definition box
  s.addShape(pres.ShapeType.roundRect, { x: 0.4, y: 1.2, w: 9.2, h: 0.9, fill: { color: RED }, rectRadius: 0.1 });
  s.addText("A reduction in total circulating red cell mass — operationally defined as a hemoglobin below the lower limit of normal for age and sex — leading to diminished oxygen-carrying capacity of blood.", {
    x: 0.5, y: 1.2, w: 9, h: 0.9, fontSize: 14, color: WHITE, align: "center", valign: "middle", bold: false
  });

  // Key thresholds
  const thresh = [
    ["Adult Males", "Hb < 13.5 g/dL"],
    ["Adult Females", "Hb < 12 g/dL"],
    ["Children (6–59 mo)", "Hb < 11 g/dL"],
    ["Pregnant Women", "Hb < 11 g/dL"],
  ];
  thresh.forEach(([label, val], i) => {
    const x = 0.4 + i * 2.3;
    s.addShape(pres.ShapeType.roundRect, { x, y: 2.3, w: 2.1, h: 0.85, fill: { color: SLATE }, rectRadius: 0.08 });
    s.addText(label, { x, y: 2.3, w: 2.1, h: 0.42, fontSize: 11, color: GOLD, bold: true, align: "center", valign: "bottom", margin: 2 });
    s.addText(val, { x, y: 2.72, w: 2.1, h: 0.43, fontSize: 13, color: WHITE, bold: true, align: "center", valign: "top", margin: 2 });
  });

  // Epidemiology
  s.addText("Global Burden", { x: 0.4, y: 3.35, w: 9, h: 0.35, fontSize: 16, color: DARK, bold: true });
  const epi = [
    { text: "~2 billion people affected worldwide (WHO) — most common hematologic disorder globally.", options: { bullet: true, breakLine: true, fontSize: 12, color: DARK } },
    { text: "~10% of individuals in high-resource countries are anemic; up to 25–50% in low-resource settings.", options: { bullet: true, breakLine: true, fontSize: 12, color: DARK } },
    { text: "Most frequent single cause: iron deficiency anemia, especially in women of reproductive age and children.", options: { bullet: true, breakLine: true, fontSize: 12, color: DARK } },
    { text: "Significant morbidity: impaired cognition, reduced work capacity, adverse pregnancy outcomes.", options: { bullet: true, fontSize: 12, color: DARK } },
  ];
  s.addText(epi, { x: 0.4, y: 3.75, w: 9.2, h: 1.6 });
}

// ══════════════════════════════════════════════════════════════════════════
// SLIDE 4 – Classification
// ══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  midBg(s);
  sectionTag(s, "Classification");

  s.addText("Classification of Anemia", { x: 0.4, y: 0.25, w: 9, h: 0.55, fontSize: 28, color: WHITE, bold: true });
  s.addShape(pres.ShapeType.line, { x: 0.4, y: 0.85, w: 3.5, h: 0, line: { color: GOLD, width: 2 } });

  s.addText("Two major frameworks:", { x: 0.4, y: 1.0, w: 9, h: 0.35, fontSize: 14, color: SUBTLE });

  // Morphological
  s.addShape(pres.ShapeType.roundRect, { x: 0.3, y: 1.4, w: 4.5, h: 3.8, fill: { color: SLATE }, rectRadius: 0.1 });
  s.addText("MORPHOLOGICAL (MCV-based)", { x: 0.4, y: 1.45, w: 4.3, h: 0.4, fontSize: 13, color: GOLD, bold: true });
  const morph = [
    ["Microcytic (MCV <80 fL)", "Iron deficiency, Thalassemia, Sideroblastic, ACD"],
    ["Normocytic (MCV 80–100)", "Acute blood loss, Hemolysis, ACD, Aplastic anemia, CKD"],
    ["Macrocytic (MCV >100)", "Vit B12/folate deficiency, Myelodysplasia, Liver disease, Drugs"],
  ];
  morph.forEach(([type, causes], i) => {
    const y = 1.95 + i * 0.95;
    s.addShape(pres.ShapeType.roundRect, { x: 0.45, y, w: 4.1, h: 0.8, fill: { color: DARK }, rectRadius: 0.06 });
    s.addText(type, { x: 0.55, y, w: 3.9, h: 0.35, fontSize: 11, color: RED, bold: true, valign: "bottom", margin: 2 });
    s.addText(causes, { x: 0.55, y: y + 0.35, w: 3.9, h: 0.45, fontSize: 9.5, color: SUBTLE, valign: "top", margin: 2 });
  });

  // Pathophysiological
  s.addShape(pres.ShapeType.roundRect, { x: 5.1, y: 1.4, w: 4.6, h: 3.8, fill: { color: SLATE }, rectRadius: 0.1 });
  s.addText("PATHOPHYSIOLOGICAL (Mechanism)", { x: 5.2, y: 1.45, w: 4.4, h: 0.4, fontSize: 13, color: GOLD, bold: true });
  const patho = [
    ["Blood Loss", "Acute hemorrhage → normocytic\nChronic loss → iron deficiency"],
    ["Hemolytic", "Intrinsic (membrane/enzyme/Hb defects)\nExtrinsic (immune, microangiopathic)"],
    ["Diminished\nErythropoiesis", "Iron / B12 / folate deficiency\nAplastic anemia, ACD, renal anemia"],
  ];
  patho.forEach(([type, causes], i) => {
    const y = 1.95 + i * 0.95;
    s.addShape(pres.ShapeType.roundRect, { x: 5.25, y, w: 4.3, h: 0.8, fill: { color: DARK }, rectRadius: 0.06 });
    s.addText(type, { x: 5.35, y, w: 1.1, h: 0.8, fontSize: 11, color: RED, bold: true, valign: "middle", margin: 2 });
    s.addText(causes, { x: 6.45, y, w: 3.0, h: 0.8, fontSize: 9.5, color: SUBTLE, valign: "middle", margin: 2 });
  });
}

// ══════════════════════════════════════════════════════════════════════════
// SLIDE 5 – Anemia of Blood Loss
// ══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  lightBg(s);
  sectionTag(s, "Anemia of Blood Loss");

  s.addText("Anemia of Blood Loss", { x: 0.4, y: 0.45, w: 9, h: 0.55, fontSize: 28, color: DARK, bold: true });
  s.addShape(pres.ShapeType.line, { x: 0.4, y: 1.05, w: 4.5, h: 0, line: { color: RED, width: 2.5 } });

  // Acute column
  s.addShape(pres.ShapeType.roundRect, { x: 0.3, y: 1.2, w: 4.4, h: 4.1, fill: { color: DARK }, rectRadius: 0.12 });
  s.addShape(pres.ShapeType.rect, { x: 0.3, y: 1.2, w: 4.4, h: 0.5, fill: { color: RED } });
  s.addText("ACUTE HEMORRHAGE", { x: 0.35, y: 1.2, w: 4.3, h: 0.5, fontSize: 14, color: WHITE, bold: true, align: "center", valign: "middle" });
  const acute = [
    "Immediate threat: hypovolemia, shock (if blood loss >20%)",
    "RBCs and plasma lost proportionally — Hb may be normal initially",
    "After fluid resuscitation (2–3 days): hemodilution reveals full extent of anemia",
    "Morphology: normocytic, normochromic",
    "Recovery: EPO ↑ → reticulocytosis (lag 5–7 days)",
    "Serum iron/ferritin: initially normal; depleted only with chronic bleeding",
  ];
  s.addText(acute.map((t, i) => ({ text: t, options: { bullet: true, breakLine: i < acute.length - 1, fontSize: 11, color: LIGHT } })), { x: 0.5, y: 1.8, w: 4.0, h: 3.3 });

  // Chronic column
  s.addShape(pres.ShapeType.roundRect, { x: 5.1, y: 1.2, w: 4.6, h: 4.1, fill: { color: DARK }, rectRadius: 0.12 });
  s.addShape(pres.ShapeType.rect, { x: 5.1, y: 1.2, w: 4.6, h: 0.5, fill: { color: SLATE } });
  s.addText("CHRONIC BLOOD LOSS", { x: 5.15, y: 1.2, w: 4.5, h: 0.5, fontSize: 14, color: WHITE, bold: true, align: "center", valign: "middle" });
  const chronic = [
    "Gradual iron store depletion → microcytic hypochromic anemia",
    "Common causes: GI bleeding (ulcers, cancer, hookworm), menorrhagia",
    "Iron is essential for Hb synthesis; its loss leads to underproduction anemia",
    "Symptoms appear slowly: fatigue, pallor, exertional dyspnea",
    "Lab: ↓ ferritin, ↓ serum iron, ↑ TIBC",
    "Treatment: identify & stop source; oral iron supplementation",
  ];
  s.addText(chronic.map((t, i) => ({ text: t, options: { bullet: true, breakLine: i < chronic.length - 1, fontSize: 11, color: LIGHT } })), { x: 5.25, y: 1.8, w: 4.2, h: 3.3 });
}

// ══════════════════════════════════════════════════════════════════════════
// SLIDE 6 – Hemolytic Anemias Overview
// ══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  midBg(s);
  sectionTag(s, "Hemolytic Anemias");

  s.addText("Hemolytic Anemias – Overview", { x: 0.4, y: 0.25, w: 9, h: 0.55, fontSize: 27, color: WHITE, bold: true });

  // Intro
  s.addShape(pres.ShapeType.roundRect, { x: 0.3, y: 0.9, w: 9.4, h: 0.7, fill: { color: RED }, rectRadius: 0.08 });
  s.addText("Common feature: accelerated red cell destruction (RBC lifespan <120 days) → EPO release → marrow erythroid hyperplasia + peripheral reticulocytosis.", {
    x: 0.4, y: 0.9, w: 9.2, h: 0.7, fontSize: 12, color: WHITE, valign: "middle", align: "center"
  });

  // Extravascular vs Intravascular
  s.addShape(pres.ShapeType.roundRect, { x: 0.3, y: 1.72, w: 4.55, h: 3.65, fill: { color: SLATE }, rectRadius: 0.1 });
  s.addText("EXTRAVASCULAR HEMOLYSIS", { x: 0.4, y: 1.76, w: 4.35, h: 0.4, fontSize: 12, color: GOLD, bold: true });
  const ev = [
    "RBCs destroyed by splenic macrophages",
    "Cause: reduced deformability (e.g., spherocytes, sickle cells)",
    "Features:",
    "  • Hyperbilirubinemia & jaundice",
    "  • Splenomegaly (work hyperplasia)",
    "  • Pigment gallstones (bilirubin-rich) if chronic",
    "Examples: Hereditary spherocytosis, Sickle cell disease, Thalassemia, G6PD deficiency",
  ];
  s.addText(ev.map((t, i) => ({ text: t, options: { bullet: !t.startsWith("  "), breakLine: i < ev.length - 1, fontSize: 11, color: LIGHT } })), { x: 0.45, y: 2.2, w: 4.3, h: 3.0 });

  s.addShape(pres.ShapeType.roundRect, { x: 5.1, y: 1.72, w: 4.65, h: 3.65, fill: { color: SLATE }, rectRadius: 0.1 });
  s.addText("INTRAVASCULAR HEMOLYSIS", { x: 5.2, y: 1.76, w: 4.45, h: 0.4, fontSize: 12, color: GOLD, bold: true });
  const iv = [
    "RBCs lyse within circulation",
    "Causes: mechanical forces, complement, toxins",
    "Features:",
    "  • Hemoglobinemia (pink/red plasma)",
    "  • Hemoglobinuria (dark urine)",
    "  • Hemosiderinuria (iron in urine)",
    "  • Chronic: secondary iron deficiency",
    "Examples: PNH, TTP/HUS, mechanical heart valves",
  ];
  s.addText(iv.map((t, i) => ({ text: t, options: { bullet: !t.startsWith("  "), breakLine: i < iv.length - 1, fontSize: 11, color: LIGHT } })), { x: 5.25, y: 2.2, w: 4.4, h: 3.0 });
}

// ══════════════════════════════════════════════════════════════════════════
// SLIDE 7 – Hereditary Spherocytosis & Sickle Cell
// ══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  lightBg(s);
  sectionTag(s, "Hemolytic Anemias – Intrinsic Defects");

  s.addText("Hereditary Spherocytosis  &  Sickle Cell Anemia", { x: 0.3, y: 0.45, w: 9.4, h: 0.55, fontSize: 22, color: DARK, bold: true });
  s.addShape(pres.ShapeType.line, { x: 0.4, y: 1.05, w: 7, h: 0, line: { color: RED, width: 2 } });

  // Spherocytosis
  s.addShape(pres.ShapeType.roundRect, { x: 0.3, y: 1.15, w: 4.6, h: 4.2, fill: { color: DARK }, rectRadius: 0.1 });
  s.addText("HEREDITARY SPHEROCYTOSIS", { x: 0.4, y: 1.18, w: 4.4, h: 0.45, fontSize: 12, color: RED, bold: true });
  const hs = [
    { label: "Genetics:", val: "AD (mostly); AR (severe form)" },
    { label: "Defect:", val: "Mutations in spectrin, ankyrin, band 3, or band 4.1 → weakened membrane skeleton → membrane vesicle shedding → spherocytes" },
    { label: "Pathophysiology:", val: "Spherocytes lack deformability → trapped in splenic cords → phagocytosed" },
    { label: "Clinical:", val: "Anemia, splenomegaly, jaundice; cholelithiasis in 40–50%; aplastic crises with parvovirus B19" },
    { label: "Lab:", val: "↑ osmotic fragility; spherocytes on smear (dark, no central pallor)" },
    { label: "Treatment:", val: "Splenectomy corrects anemia (spherocytes persist but not destroyed)" },
  ];
  let yy = 1.68;
  hs.forEach(({ label, val }) => {
    s.addText([
      { text: label + " ", options: { bold: true, color: GOLD, fontSize: 10.5 } },
      { text: val, options: { color: LIGHT, fontSize: 10.5 } },
    ], { x: 0.45, y: yy, w: 4.35, h: 0.55 });
    yy += 0.55;
  });

  // Sickle Cell
  s.addShape(pres.ShapeType.roundRect, { x: 5.1, y: 1.15, w: 4.65, h: 4.2, fill: { color: DARK }, rectRadius: 0.1 });
  s.addText("SICKLE CELL ANEMIA", { x: 5.2, y: 1.18, w: 4.45, h: 0.45, fontSize: 12, color: RED, bold: true });
  const sca = [
    { label: "Genetics:", val: "AR; single AA substitution — Glu→Val at β-globin position 6 → HbS" },
    { label: "Pathophysiology:", val: "Deoxygenated HbS polymerizes → sickled cells → vaso-occlusion + hemolysis; irreversible sickling with repeated episodes" },
    { label: "Factors promoting sickling:", val: "↑ HbS concentration, ↓ O₂ tension, acidosis, dehydration" },
    { label: "Clinical:", val: "Vaso-occlusive crises (bone pain, acute chest syndrome, stroke), hemolytic anemia, autosplenectomy, hand-foot syndrome in infancy" },
    { label: "Lab:", val: "HbS on electrophoresis; sickled cells + target cells on smear; Hb 6–9 g/dL" },
    { label: "Treatment:", val: "Hydroxyurea (↑ HbF), transfusions, bone marrow transplant; penicillin prophylaxis in children" },
  ];
  let yy2 = 1.68;
  sca.forEach(({ label, val }) => {
    s.addText([
      { text: label + " ", options: { bold: true, color: GOLD, fontSize: 10.5 } },
      { text: val, options: { color: LIGHT, fontSize: 10.5 } },
    ], { x: 5.25, y: yy2, w: 4.4, h: 0.55 });
    yy2 += 0.55;
  });
}

// ══════════════════════════════════════════════════════════════════════════
// SLIDE 8 – Thalassemias
// ══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  midBg(s);
  sectionTag(s, "Hemolytic Anemias – Thalassemia");

  s.addText("Thalassemias", { x: 0.4, y: 0.25, w: 9, h: 0.55, fontSize: 30, color: WHITE, bold: true });
  s.addShape(pres.ShapeType.line, { x: 0.4, y: 0.85, w: 3, h: 0, line: { color: GOLD, width: 2 } });

  s.addShape(pres.ShapeType.roundRect, { x: 0.3, y: 1.0, w: 9.4, h: 0.65, fill: { color: SLATE }, rectRadius: 0.08 });
  s.addText("Inherited disorders of haemoglobin synthesis — reduced or absent production of α- or β-globin chains → imbalanced chain accumulation → ineffective erythropoiesis + hemolysis.", {
    x: 0.4, y: 1.0, w: 9.2, h: 0.65, fontSize: 12, color: LIGHT, valign: "middle"
  });

  // β-thalassemia
  s.addShape(pres.ShapeType.roundRect, { x: 0.3, y: 1.8, w: 4.6, h: 3.55, fill: { color: DARK }, rectRadius: 0.1 });
  s.addShape(pres.ShapeType.rect, { x: 0.3, y: 1.8, w: 4.6, h: 0.45, fill: { color: RED } });
  s.addText("β-THALASSEMIA", { x: 0.35, y: 1.8, w: 4.5, h: 0.45, fontSize: 13, color: WHITE, bold: true, align: "center", valign: "middle" });
  const bt = [
    "Mutations in β-globin gene on Chr 11",
    "Excess α-chains precipitate → damage RBC membrane → ineffective erythropoiesis",
    "Minor (trait): β/β⁺ — usually asymptomatic, mild microcytosis",
    "Intermedia: moderate anemia, some transfusion need",
    "Major (Cooley's): β°/β° — severe, transfusion-dependent from infancy",
    "Marrow expansion → crew-cut skull, maxillary hypertrophy (chipmunk face)",
    "Treatment: regular transfusions + iron chelation; BMT curative",
  ];
  s.addText(bt.map((t, i) => ({ text: t, options: { bullet: true, breakLine: i < bt.length - 1, fontSize: 10.5, color: LIGHT } })), { x: 0.45, y: 2.33, w: 4.35, h: 2.9 });

  // α-thalassemia
  s.addShape(pres.ShapeType.roundRect, { x: 5.1, y: 1.8, w: 4.65, h: 3.55, fill: { color: DARK }, rectRadius: 0.1 });
  s.addShape(pres.ShapeType.rect, { x: 5.1, y: 1.8, w: 4.65, h: 0.45, fill: { color: SLATE } });
  s.addText("α-THALASSEMIA", { x: 5.15, y: 1.8, w: 4.55, h: 0.45, fontSize: 13, color: WHITE, bold: true, align: "center", valign: "middle" });
  const at = [
    "Deletion/mutation of α-globin genes on Chr 16 (4 gene loci total)",
    "1 gene deleted — silent carrier; 2 deleted — α-thal trait (mild)",
    "3 deleted — HbH disease (β-tetramers): moderate hemolytic anemia",
    "4 deleted — Hb Barts (γ-tetramers): hydrops fetalis; incompatible with life",
    "Excess β-chains form unstable tetramers that precipitate within red cells",
    "Most severe forms are common in Southeast Asia",
  ];
  s.addText(at.map((t, i) => ({ text: t, options: { bullet: true, breakLine: i < at.length - 1, fontSize: 10.5, color: LIGHT } })), { x: 5.25, y: 2.33, w: 4.4, h: 2.9 });
}

// ══════════════════════════════════════════════════════════════════════════
// SLIDE 9 – G6PD & PNH
// ══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  lightBg(s);
  sectionTag(s, "Hemolytic Anemias – Enzyme & Complement Defects");

  s.addText("G6PD Deficiency  &  Paroxysmal Nocturnal Hemoglobinuria", { x: 0.3, y: 0.45, w: 9.4, h: 0.55, fontSize: 20, color: DARK, bold: true });
  s.addShape(pres.ShapeType.line, { x: 0.4, y: 1.05, w: 8, h: 0, line: { color: RED, width: 2 } });

  // G6PD
  s.addShape(pres.ShapeType.roundRect, { x: 0.3, y: 1.15, w: 4.6, h: 4.2, fill: { color: DARK }, rectRadius: 0.1 });
  s.addText("G6PD DEFICIENCY", { x: 0.4, y: 1.18, w: 4.4, h: 0.4, fontSize: 13, color: GOLD, bold: true });
  const g6 = [
    { label: "Inheritance:", val: "X-linked recessive (>400 variants)" },
    { label: "Mechanism:", val: "↓ G6PD → ↓ GSH → oxidant stress → Heinz bodies → bite cells → intravascular hemolysis" },
    { label: "Triggers:", val: "Drugs (primaquine, sulfa, nitrofurantoin), infections, fava beans" },
    { label: "G6PD A-:", val: "African variant; only old RBCs affected; hemolysis self-limited" },
    { label: "G6PD Mediterranean:", val: "More severe; found in Middle East" },
    { label: "Lab:", val: "Heinz bodies (supravital stain), bite cells on smear; ↓ G6PD enzyme assay" },
    { label: "Treatment:", val: "Avoid triggers; supportive; transfusion if severe" },
  ];
  let y6 = 1.65;
  g6.forEach(({ label, val }) => {
    s.addText([
      { text: label + " ", options: { bold: true, color: GOLD, fontSize: 10.5 } },
      { text: val, options: { color: LIGHT, fontSize: 10.5 } },
    ], { x: 0.45, y: y6, w: 4.35, h: 0.52 });
    y6 += 0.52;
  });

  // PNH
  s.addShape(pres.ShapeType.roundRect, { x: 5.1, y: 1.15, w: 4.65, h: 4.2, fill: { color: DARK }, rectRadius: 0.1 });
  s.addText("PAROXYSMAL NOCTURNAL\nHEMOGLOBINURIA (PNH)", { x: 5.2, y: 1.18, w: 4.45, h: 0.6, fontSize: 12, color: GOLD, bold: true });
  const pnh = [
    { label: "Mutation:", val: "Somatic mutation in PIG-A gene (X-linked) → deficient GPI-anchored proteins (CD55, CD59)" },
    { label: "Mechanism:", val: "Loss of CD55 (DAF) and CD59 → uncontrolled complement activation → intravascular hemolysis" },
    { label: "Clinical triad:", val: "Intravascular hemolysis, thrombosis (unusual sites: hepatic, portal, sagittal sinus), cytopenias" },
    { label: "Classic finding:", val: "Dark morning urine (hemoglobinuria concentrates overnight)" },
    { label: "Lab:", val: "Flow cytometry — ↓ CD55/CD59 on RBCs; Ham test (historical)" },
    { label: "Treatment:", val: "Eculizumab (anti-C5 antibody) blocks complement; allogenic BMT curative" },
  ];
  let yp = 1.82;
  pnh.forEach(({ label, val }) => {
    s.addText([
      { text: label + " ", options: { bold: true, color: GOLD, fontSize: 10.5 } },
      { text: val, options: { color: LIGHT, fontSize: 10.5 } },
    ], { x: 5.25, y: yp, w: 4.4, h: 0.55 });
    yp += 0.55;
  });
}

// ══════════════════════════════════════════════════════════════════════════
// SLIDE 10 – Iron Deficiency Anemia
// ══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: "F8F9FB" };
  sectionTag(s, "Anemia of Diminished Erythropoiesis");

  s.addText("Iron Deficiency Anemia", { x: 0.4, y: 0.45, w: 9, h: 0.55, fontSize: 30, color: DARK, bold: true });
  s.addShape(pres.ShapeType.line, { x: 0.4, y: 1.05, w: 5, h: 0, line: { color: RED, width: 2.5 } });

  s.addShape(pres.ShapeType.roundRect, { x: 0.3, y: 1.15, w: 9.4, h: 0.62, fill: { color: RED }, rectRadius: 0.08 });
  s.addText("Most common nutritional deficiency worldwide. ~10% of individuals in high-resource and 25–50% in low-resource countries are anemic, with iron deficiency as the leading cause.", {
    x: 0.4, y: 1.15, w: 9.2, h: 0.62, fontSize: 12, color: WHITE, valign: "middle"
  });

  // Two columns
  s.addShape(pres.ShapeType.roundRect, { x: 0.3, y: 1.9, w: 4.6, h: 3.45, fill: { color: DARK }, rectRadius: 0.1 });
  s.addText("PATHOPHYSIOLOGY & CAUSES", { x: 0.4, y: 1.93, w: 4.4, h: 0.38, fontSize: 11, color: GOLD, bold: true });
  const ipath = [
    "Normal body iron: 2.5 g (F) – 3.5 g (M); 80% in Hb/myoglobin",
    "Storage pool: ferritin & hemosiderin in macrophages (liver, spleen, marrow)",
    "Normal serum ferritin reflects stores; transferrin saturation ~33%",
    "Iron loss: 1–2 mg/day via epithelial shedding",
    "Causes of deficiency:",
    "  • Inadequate intake (infants, vegetarians, elderly)",
    "  • Increased demand (pregnancy, growth)",
    "  • Chronic blood loss (GI bleed, menorrhagia, hookworm)",
    "  • Malabsorption (celiac disease, gastrectomy)",
  ];
  s.addText(ipath.map((t, i) => ({ text: t, options: { bullet: !t.startsWith("  "), breakLine: i < ipath.length - 1, fontSize: 10, color: LIGHT } })), { x: 0.45, y: 2.35, w: 4.35, h: 2.9 });

  s.addShape(pres.ShapeType.roundRect, { x: 5.1, y: 1.9, w: 4.65, h: 3.45, fill: { color: DARK }, rectRadius: 0.1 });
  s.addText("CLINICAL & LABORATORY", { x: 5.2, y: 1.93, w: 4.45, h: 0.38, fontSize: 11, color: GOLD, bold: true });
  const iclin = [
    "Stages: iron store depletion → latent deficiency → overt anemia",
    "Symptoms: fatigue, pallor, exertional dyspnea, palpitations",
    "Specific signs: koilonychia (spoon nails), glossitis, angular stomatitis, pica",
    "Plummer-Vinson syndrome: IDA + esophageal webs + dysphagia",
    "Lab findings:",
    "  • ↓ Hb, ↓ MCV (microcytic), ↓ MCH (hypochromic)",
    "  • ↓ Serum ferritin (most sensitive early marker)",
    "  • ↓ Serum iron, ↑ TIBC",
    "  • ↑ RDW (anisocytosis)",
    "Smear: pencil cells, target cells, poikilocytosis",
    "Treatment: oral ferrous sulfate 325 mg TDS; identify cause",
  ];
  s.addText(iclin.map((t, i) => ({ text: t, options: { bullet: !t.startsWith("  "), breakLine: i < iclin.length - 1, fontSize: 10, color: LIGHT } })), { x: 5.25, y: 2.35, w: 4.4, h: 2.9 });
}

// ══════════════════════════════════════════════════════════════════════════
// SLIDE 11 – Anemia of Chronic Inflammation (ACI)
// ══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  midBg(s);
  sectionTag(s, "Anemia of Diminished Erythropoiesis");

  s.addText("Anemia of Chronic Inflammation (ACI)", { x: 0.4, y: 0.25, w: 9, h: 0.55, fontSize: 26, color: WHITE, bold: true });
  s.addShape(pres.ShapeType.line, { x: 0.4, y: 0.85, w: 5.5, h: 0, line: { color: GOLD, width: 2 } });

  // Mechanism flow
  s.addText("Pathophysiology", { x: 0.4, y: 0.98, w: 9, h: 0.35, fontSize: 15, color: GOLD, bold: true });
  const steps = [
    "Chronic inflammation\n(infection, autoimmune,\nmalignancy, CKD)",
    "↑ IL-6 / cytokines\n→ ↑ Hepcidin from liver",
    "Hepcidin ↓ ferroportin\n→ iron sequestered in\nmacrophages",
    "↓ Iron availability\nfor erythropoiesis\n+ ↓ EPO response",
    "Normocytic-normochromic\nanemia (may become\nmicrocytic over time)",
  ];
  const colors5 = [SLATE, RED, RED, SLATE, DARK];
  steps.forEach((t, i) => {
    const x = 0.3 + i * 1.9;
    s.addShape(pres.ShapeType.roundRect, { x, y: 1.38, w: 1.7, h: 1.0, fill: { color: colors5[i] }, rectRadius: 0.08 });
    s.addText(t, { x, y: 1.38, w: 1.7, h: 1.0, fontSize: 9, color: WHITE, align: "center", valign: "middle" });
    if (i < 4) {
      s.addText("→", { x: x + 1.7, y: 1.6, w: 0.2, h: 0.5, fontSize: 18, color: GOLD, bold: true, align: "center", valign: "middle" });
    }
  });

  // Key features
  s.addShape(pres.ShapeType.roundRect, { x: 0.3, y: 2.55, w: 4.5, h: 2.8, fill: { color: SLATE }, rectRadius: 0.1 });
  s.addText("KEY FEATURES & LABS", { x: 0.4, y: 2.6, w: 4.3, h: 0.35, fontSize: 12, color: GOLD, bold: true });
  const kf = [
    "Usually mild to moderate (Hb 7–12 g/dL)",
    "Normocytic-normochromic (can be mildly microcytic)",
    "↓ Serum iron AND ↓ TIBC (both low — key differentiator from IDA)",
    "↑ Ferritin (acute phase reactant — iron is trapped, not depleted)",
    "↑ Serum hepcidin",
    "Low reticulocyte count",
    "Bone marrow shows adequate iron stores",
  ];
  s.addText(kf.map((t, i) => ({ text: t, options: { bullet: true, breakLine: i < kf.length - 1, fontSize: 11, color: LIGHT } })), { x: 0.45, y: 3.0, w: 4.3, h: 2.2 });

  // Distinction table vs IDA
  s.addShape(pres.ShapeType.roundRect, { x: 5.0, y: 2.55, w: 4.7, h: 2.8, fill: { color: DARK }, rectRadius: 0.1 });
  s.addText("ACI vs IRON DEFICIENCY", { x: 5.1, y: 2.6, w: 4.5, h: 0.35, fontSize: 12, color: GOLD, bold: true });
  const headers = ["Lab", "IDA", "ACI"];
  const rows = [
    ["Serum Iron", "↓", "↓"],
    ["TIBC", "↑", "↓"],
    ["Ferritin", "↓", "↑"],
    ["Transferrin sat.", "↓", "↓"],
    ["Hepcidin", "↓", "↑"],
    ["BM iron stores", "Absent", "Present"],
  ];
  // Header row
  headers.forEach((h, ci) => {
    const cols = [5.1, 6.7, 8.3];
    s.addShape(pres.ShapeType.rect, { x: cols[ci], y: 3.0, w: ci === 0 ? 1.5 : 1.5, h: 0.3, fill: { color: RED } });
    s.addText(h, { x: cols[ci], y: 3.0, w: 1.5, h: 0.3, fontSize: 10, color: WHITE, bold: true, align: "center", valign: "middle" });
  });
  rows.forEach((row, ri) => {
    const cols = [5.1, 6.7, 8.3];
    row.forEach((cell, ci) => {
      const fill = ri % 2 === 0 ? SLATE : MID;
      s.addShape(pres.ShapeType.rect, { x: cols[ci], y: 3.35 + ri * 0.3, w: 1.5, h: 0.3, fill: { color: fill } });
      s.addText(cell, { x: cols[ci], y: 3.35 + ri * 0.3, w: 1.5, h: 0.3, fontSize: 9.5, color: LIGHT, align: "center", valign: "middle" });
    });
  });

  // Treatment
  s.addShape(pres.ShapeType.roundRect, { x: 5.0, y: 5.0, w: 4.7, h: 0.45, fill: { color: TEAL }, rectRadius: 0.06 });
  s.addText("Treatment: Treat underlying disease; EPO-stimulating agents in CKD/cancer; IV iron if severe.", {
    x: 5.05, y: 5.0, w: 4.6, h: 0.45, fontSize: 9.5, color: WHITE, valign: "middle"
  });
}

// ══════════════════════════════════════════════════════════════════════════
// SLIDE 12 – Megaloblastic Anemias
// ══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: "F8F9FB" };
  sectionTag(s, "Anemia of Diminished Erythropoiesis");

  s.addText("Megaloblastic Anemias", { x: 0.4, y: 0.45, w: 9, h: 0.55, fontSize: 30, color: DARK, bold: true });
  s.addShape(pres.ShapeType.line, { x: 0.4, y: 1.05, w: 4.5, h: 0, line: { color: RED, width: 2.5 } });

  s.addShape(pres.ShapeType.roundRect, { x: 0.3, y: 1.15, w: 9.4, h: 0.6, fill: { color: SLATE }, rectRadius: 0.08 });
  s.addText("Deficiency of B12 or folate → impaired dTMP synthesis → blocked DNA replication → megaloblastic changes in all rapidly dividing cells (marrow, GI epithelium).", {
    x: 0.4, y: 1.15, w: 9.2, h: 0.6, fontSize: 12, color: LIGHT, valign: "middle"
  });

  // B12 deficiency
  s.addShape(pres.ShapeType.roundRect, { x: 0.3, y: 1.88, w: 4.55, h: 3.5, fill: { color: DARK }, rectRadius: 0.1 });
  s.addShape(pres.ShapeType.rect, { x: 0.3, y: 1.88, w: 4.55, h: 0.45, fill: { color: RED } });
  s.addText("VITAMIN B12 DEFICIENCY", { x: 0.35, y: 1.88, w: 4.45, h: 0.45, fontSize: 13, color: WHITE, bold: true, align: "center", valign: "middle" });
  const b12 = [
    "Rarely dietary (except strict vegans); usually absorption problem",
    "Requires intrinsic factor (IF) from gastric parietal cells for ileal absorption",
    "Pernicious anemia: autoimmune — antibodies against IF or parietal cells",
    "Other causes: gastrectomy, ileal resection, Crohn's disease, fish tapeworm",
    "Symptoms: fatigue + NEUROLOGICAL — subacute combined degeneration of spinal cord (posterior + lateral column demyelination), peripheral neuropathy, cognitive changes",
    "Lab: macrocytic anemia, hypersegmented neutrophils (>5 lobes), ↓ B12, ↑ MMA, ↑ homocysteine",
    "Treatment: IM hydroxocobalamin or cyanocobalamin",
  ];
  s.addText(b12.map((t, i) => ({ text: t, options: { bullet: true, breakLine: i < b12.length - 1, fontSize: 10, color: LIGHT } })), { x: 0.45, y: 2.38, w: 4.3, h: 2.9 });

  // Folate deficiency
  s.addShape(pres.ShapeType.roundRect, { x: 5.1, y: 1.88, w: 4.65, h: 3.5, fill: { color: DARK }, rectRadius: 0.1 });
  s.addShape(pres.ShapeType.rect, { x: 5.1, y: 1.88, w: 4.65, h: 0.45, fill: { color: SLATE } });
  s.addText("FOLATE DEFICIENCY", { x: 5.15, y: 1.88, w: 4.55, h: 0.45, fontSize: 13, color: WHITE, bold: true, align: "center", valign: "middle" });
  const folate = [
    "Folate present in all foods; destroyed by cooking (10–15 min)",
    "Common causes: poor diet, increased demand (pregnancy, hemolytic anemia), malabsorption (celiac), drugs (methotrexate, phenytoin, alcohol)",
    "Role: tetrahydrofolate is required for dTMP synthesis (via DHFR)",
    "Clinical: megaloblastic anemia + GI symptoms (glossitis, sore tongue); NO neurological features",
    "Lab: macrocytic anemia, ↓ serum & RBC folate, ↑ homocysteine; MMA is NORMAL (differentiates from B12)",
    "Treatment: oral folic acid 5 mg/day; supplement in pregnancy to prevent NTDs",
  ];
  s.addText(folate.map((t, i) => ({ text: t, options: { bullet: true, breakLine: i < folate.length - 1, fontSize: 10, color: LIGHT } })), { x: 5.25, y: 2.38, w: 4.4, h: 2.9 });

  // Key differentiator
  s.addShape(pres.ShapeType.roundRect, { x: 0.3, y: 5.47, w: 9.4, h: 0.45, fill: { color: GOLD }, rectRadius: 0.06 });
  s.addText("⚠  KEY DIFFERENTIATOR: Neurological signs (subacute combined degeneration) = B12 deficiency. Folate deficiency does NOT cause neurological abnormalities.", {
    x: 0.4, y: 5.47, w: 9.2, h: 0.45, fontSize: 11, color: DARK, bold: true, valign: "middle"
  });
}

// ══════════════════════════════════════════════════════════════════════════
// SLIDE 13 – Aplastic Anemia
// ══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  midBg(s);
  sectionTag(s, "Aplastic Anemia");

  s.addText("Aplastic Anemia", { x: 0.4, y: 0.25, w: 9, h: 0.55, fontSize: 32, color: WHITE, bold: true });
  s.addShape(pres.ShapeType.line, { x: 0.4, y: 0.85, w: 3.5, h: 0, line: { color: GOLD, width: 2 } });

  s.addShape(pres.ShapeType.roundRect, { x: 0.3, y: 0.98, w: 9.4, h: 0.6, fill: { color: RED }, rectRadius: 0.08 });
  s.addText("Failure of hematopoiesis due to destruction or suppression of multipotent myeloid stem cells → pancytopenia (anemia + neutropenia + thrombocytopenia) with a hypocellular bone marrow.", {
    x: 0.4, y: 0.98, w: 9.2, h: 0.6, fontSize: 12, color: WHITE, valign: "middle"
  });

  // Etiology
  s.addShape(pres.ShapeType.roundRect, { x: 0.3, y: 1.7, w: 4.55, h: 3.65, fill: { color: SLATE }, rectRadius: 0.1 });
  s.addText("ETIOLOGY", { x: 0.4, y: 1.73, w: 4.35, h: 0.38, fontSize: 13, color: GOLD, bold: true });
  const etio = [
    { h: "Idiopathic (~65%)", b: "Most common; likely immune-mediated T-cell destruction of stem cells" },
    { h: "Secondary — Drugs:", b: "Chloramphenicol, sulfonamides, antiepileptics, NSAIDs, cytotoxics" },
    { h: "Viral infections:", b: "EBV, HIV, hepatitis (seronegative hepatitis), parvovirus B19" },
    { h: "Radiation exposure", b: "Dose-dependent suppression" },
    { h: "Constitutional:", b: "Fanconi anemia (AR); Dyskeratosis congenita" },
  ];
  let yet = 2.18;
  etio.forEach(({ h, b }) => {
    s.addText([
      { text: h + ": ", options: { bold: true, color: GOLD, fontSize: 10.5 } },
      { text: b, options: { color: LIGHT, fontSize: 10.5 } },
    ], { x: 0.45, y: yet, w: 4.3, h: 0.62 });
    yet += 0.62;
  });

  // Clinical + Treatment
  s.addShape(pres.ShapeType.roundRect, { x: 5.1, y: 1.7, w: 4.65, h: 3.65, fill: { color: DARK }, rectRadius: 0.1 });
  s.addText("CLINICAL & MANAGEMENT", { x: 5.2, y: 1.73, w: 4.45, h: 0.38, fontSize: 13, color: GOLD, bold: true });
  const aclin = [
    "Symptoms from pancytopenia:",
    "  • Anemia → fatigue, pallor",
    "  • Neutropenia → infections (oral ulcers, pneumonia)",
    "  • Thrombocytopenia → bleeding (purpura, epistaxis)",
    "Bone marrow biopsy: hypocellular marrow replaced by fat cells (diagnostic)",
    "Severity classification:",
    "  • Severe: ANC <500/μL; platelets <20,000; retics <20,000",
    "  • Very severe: ANC <200/μL",
    "Treatment:",
    "  • <40 yrs + HLA-matched sibling: Allogeneic BMT (curative)",
    "  • Others: Immunosuppression — anti-thymocyte globulin (ATG) + cyclosporine",
    "  • Eltrombopag (TPO agonist) added to IST improves response",
    "  • Supportive: transfusions, G-CSF, infection prevention",
  ];
  s.addText(aclin.map((t, i) => ({ text: t, options: { bullet: !t.startsWith("  "), breakLine: i < aclin.length - 1, fontSize: 10, color: LIGHT } })), { x: 5.25, y: 2.18, w: 4.4, h: 3.1 });
}

// ══════════════════════════════════════════════════════════════════════════
// SLIDE 14 – Autoimmune & Microangiopathic Hemolytic Anemia
// ══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: "F8F9FB" };
  sectionTag(s, "Hemolytic Anemias – Extrinsic Defects");

  s.addText("Autoimmune & Microangiopathic Hemolytic Anemias", { x: 0.3, y: 0.45, w: 9.4, h: 0.55, fontSize: 21, color: DARK, bold: true });
  s.addShape(pres.ShapeType.line, { x: 0.4, y: 1.05, w: 8, h: 0, line: { color: RED, width: 2 } });

  // AIHA
  s.addShape(pres.ShapeType.roundRect, { x: 0.3, y: 1.15, w: 4.6, h: 4.2, fill: { color: DARK }, rectRadius: 0.1 });
  s.addText("AUTOIMMUNE HEMOLYTIC\nANEMIA (AIHA)", { x: 0.4, y: 1.18, w: 4.4, h: 0.55, fontSize: 12, color: GOLD, bold: true });
  const aiha = [
    { label: "Mechanism:", val: "Auto-antibodies coat RBCs → Fc receptor-mediated splenic phagocytosis (extravascular)" },
    { label: "Warm AIHA (IgG):", val: "Most common (70–80%); Abs active at 37°C; associated with SLE, CLL, drugs (methyldopa, penicillin)" },
    { label: "Cold AIHA (IgM):", val: "Abs maximally active <30°C; complement activation; linked to Mycoplasma, EBV, lymphoma" },
    { label: "Lab:", val: "Positive direct Coombs (DAT); spherocytes; ↑ bilirubin; ↑ LDH; ↓ haptoglobin" },
    { label: "Treatment:", val: "Warm: steroids, rituximab, splenectomy. Cold: avoid cold, rituximab" },
  ];
  let ya = 1.78;
  aiha.forEach(({ label, val }) => {
    s.addText([
      { text: label + " ", options: { bold: true, color: GOLD, fontSize: 10.5 } },
      { text: val, options: { color: LIGHT, fontSize: 10.5 } },
    ], { x: 0.45, y: ya, w: 4.35, h: 0.6 });
    ya += 0.6;
  });

  // MAHA
  s.addShape(pres.ShapeType.roundRect, { x: 5.1, y: 1.15, w: 4.65, h: 4.2, fill: { color: DARK }, rectRadius: 0.1 });
  s.addText("MICROANGIOPATHIC\nHEMOLYTIC ANEMIA (MAHA)", { x: 5.2, y: 1.18, w: 4.45, h: 0.55, fontSize: 12, color: GOLD, bold: true });
  const maha = [
    { label: "Mechanism:", val: "Fibrin strands or mechanical forces in vessels shear RBCs → schistocytes (helmet cells)" },
    { label: "Causes:", val: "TTP (ADAMTS13 deficiency), HUS (E. coli O157:H7), DIC, pre-eclampsia/HELLP, malignant HTN, prosthetic heart valves" },
    { label: "Lab:", val: "Schistocytes on smear (pathognomonic); intravascular hemolysis labs (↑ LDH, ↓ haptoglobin, hemoglobinuria); thrombocytopenia often co-present" },
    { label: "TTP pentad:", val: "MAHA + thrombocytopenia + neurological symptoms + fever + renal failure" },
    { label: "Treatment:", val: "TTP: plasma exchange + steroids. HUS: supportive. DIC: treat cause" },
  ];
  let ym = 1.78;
  maha.forEach(({ label, val }) => {
    s.addText([
      { text: label + " ", options: { bold: true, color: GOLD, fontSize: 10.5 } },
      { text: val, options: { color: LIGHT, fontSize: 10.5 } },
    ], { x: 5.25, y: ym, w: 4.4, h: 0.6 });
    ym += 0.6;
  });
}

// ══════════════════════════════════════════════════════════════════════════
// SLIDE 15 – Diagnostic Work-up
// ══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  darkBg(s);
  sectionTag(s, "Diagnosis");

  s.addText("Diagnostic Approach to Anemia", { x: 0.4, y: 0.25, w: 9, h: 0.55, fontSize: 27, color: WHITE, bold: true });
  s.addShape(pres.ShapeType.line, { x: 0.4, y: 0.85, w: 5.5, h: 0, line: { color: GOLD, width: 2 } });

  // Step boxes
  const steps2 = [
    { num: "1", title: "History & Exam", pts: ["Duration, onset, rate\nDiet, meds, family Hx\nMenstruation, GI bleeding\nPallor, jaundice, splenomegaly\nNeurological signs (B12?)"] },
    { num: "2", title: "CBC + Indices", pts: ["Hb/Hct, RBC count\nMCV → micro/normo/macro\nMCH, MCHC\nRDW (anisocytosis)\nReticulocyte count"] },
    { num: "3", title: "Peripheral Smear", pts: ["Spherocytes → HS/AIHA\nSickle cells → SCA\nTarget cells → thal/IDA\nSchistocytes → MAHA\nHyperseg neutrophils → megaloblastic"] },
    { num: "4", title: "Targeted Tests", pts: ["Iron studies (ferritin, TIBC)\nB12, folate levels\nMMA, homocysteine\nDirect Coombs (DAT)\nHb electrophoresis\nFlow cytometry (CD55/59 for PNH)\nBone marrow biopsy if needed"] },
  ];
  steps2.forEach(({ num, title, pts }, i) => {
    const x = 0.3 + i * 2.38;
    s.addShape(pres.ShapeType.roundRect, { x, y: 1.0, w: 2.2, h: 4.35, fill: { color: SLATE }, rectRadius: 0.1 });
    s.addShape(pres.ShapeType.rect, { x, y: 1.0, w: 2.2, h: 0.5, fill: { color: RED } });
    s.addText(num, { x, y: 1.0, w: 0.4, h: 0.5, fontSize: 20, color: WHITE, bold: true, align: "center", valign: "middle" });
    s.addText(title, { x: x + 0.4, y: 1.0, w: 1.8, h: 0.5, fontSize: 12, color: WHITE, bold: true, valign: "middle" });
    s.addText(pts[0], { x: x + 0.1, y: 1.55, w: 2.0, h: 3.7, fontSize: 10, color: LIGHT });
  });
}

// ══════════════════════════════════════════════════════════════════════════
// SLIDE 16 – Management Principles
// ══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: "F8F9FB" };
  sectionTag(s, "Management");

  s.addText("Management Principles", { x: 0.4, y: 0.45, w: 9, h: 0.55, fontSize: 30, color: DARK, bold: true });
  s.addShape(pres.ShapeType.line, { x: 0.4, y: 1.05, w: 4, h: 0, line: { color: RED, width: 2.5 } });

  const mgmt = [
    { icon: "1.", title: "Treat the Underlying Cause", body: "Most important step. GI source for iron deficiency, autoimmune work-up for AIHA, drug review for aplastic anemia, infection screening for hemolytic crises." },
    { icon: "2.", title: "Nutritional Replacement", body: "Iron (oral ferrous sulfate preferred; IV if intolerance/malabsorption). Folic acid (oral). Vitamin B12 (IM hydroxocobalamin if pernicious anemia; oral if dietary cause)." },
    { icon: "3.", title: "Blood Transfusion", body: "Reserve for symptomatic, severe, or life-threatening anemia (Hb <7 g/dL in stable patients, <8 in cardiac disease). Risks: alloimmunization, iron overload (chronic), transfusion reactions." },
    { icon: "4.", title: "EPO-Stimulating Agents", body: "Erythropoietin or darbepoetin for CKD-related anemia and chemotherapy-induced anemia. Must ensure adequate iron stores." },
    { icon: "5.", title: "Immunosuppression", body: "ATG + cyclosporine for aplastic anemia. Steroids/rituximab for AIHA. Eculizumab for PNH." },
    { icon: "6.", title: "Curative / Definitive Therapies", body: "Allogeneic BMT: aplastic anemia, thalassemia major, sickle cell disease. Splenectomy: hereditary spherocytosis, refractory ITP/AIHA. Hydroxyurea: sickle cell (↑ HbF)." },
  ];
  mgmt.forEach(({ icon, title, body }, i) => {
    const col = i < 3 ? 0 : 1;
    const row = i % 3;
    const x = col === 0 ? 0.3 : 5.1;
    const y = 1.2 + row * 1.38;
    s.addShape(pres.ShapeType.roundRect, { x, y, w: 4.55, h: 1.25, fill: { color: DARK }, rectRadius: 0.1 });
    s.addShape(pres.ShapeType.rect, { x, y, w: 0.45, h: 1.25, fill: { color: RED } });
    s.addText(icon, { x, y, w: 0.45, h: 1.25, fontSize: 16, color: WHITE, bold: true, align: "center", valign: "middle" });
    s.addText(title, { x: x + 0.5, y, w: 3.95, h: 0.42, fontSize: 11, color: GOLD, bold: true, valign: "bottom", margin: 4 });
    s.addText(body, { x: x + 0.5, y: y + 0.42, w: 3.95, h: 0.83, fontSize: 9.5, color: LIGHT, valign: "top", margin: 4 });
  });
}

// ══════════════════════════════════════════════════════════════════════════
// SLIDE 17 – Summary Table
// ══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  darkBg(s);
  sectionTag(s, "Summary");

  s.addText("Quick Reference Summary", { x: 0.4, y: 0.25, w: 9, h: 0.5, fontSize: 26, color: WHITE, bold: true });
  s.addShape(pres.ShapeType.line, { x: 0.4, y: 0.78, w: 5, h: 0, line: { color: GOLD, width: 2 } });

  const headers = ["Type", "MCV", "Key Finding", "Ferritin", "Treatment"];
  const rows = [
    ["Iron Deficiency Anemia", "↓", "Koilonychia, ↑ TIBC, pencil cells", "↓↓", "Oral iron + cause"],
    ["Anemia of Chron. Inflam.", "N/↓", "↓ TIBC, underlying disease", "↑", "Treat cause, EPO"],
    ["B12 Deficiency", "↑", "Neurological signs, hyperseg PMNs, ↑ MMA", "N", "IM B12"],
    ["Folate Deficiency", "↑", "Hyperseg PMNs, ↑ homocysteine, NO neuro signs", "N", "Oral folate"],
    ["Aplastic Anemia", "N", "Pancytopenia, hypocellular BM", "↑", "BMT / IST"],
    ["Hereditary Spherocytosis", "N", "Spherocytes, ↑ osmotic fragility", "N", "Splenectomy"],
    ["Sickle Cell Disease", "N", "Sickle cells, HbS on electrophoresis", "N", "Hydroxyurea, BMT"],
    ["Thalassemia Major", "↓↓", "Target cells, HbA2/HbF ↑, BM expansion", "↑", "Transfuse + chelate"],
    ["G6PD Deficiency", "N", "Bite cells, Heinz bodies, triggered by oxidants", "N", "Avoid triggers"],
    ["PNH", "N", "Dark urine, thrombosis, ↓ CD55/59", "N", "Eculizumab / BMT"],
    ["AIHA (warm)", "N", "Spherocytes, positive DAT", "N", "Steroids, rituximab"],
    ["MAHA (TTP/HUS)", "N", "Schistocytes, thrombocytopenia", "N", "Plasma exchange"],
  ];

  const colW = [2.4, 0.55, 2.55, 0.7, 1.7];
  const colX = [0.25, 2.65, 3.2, 5.75, 6.45];

  // Header
  headers.forEach((h, ci) => {
    s.addShape(pres.ShapeType.rect, { x: colX[ci], y: 0.85, w: colW[ci], h: 0.35, fill: { color: RED } });
    s.addText(h, { x: colX[ci], y: 0.85, w: colW[ci], h: 0.35, fontSize: 9.5, color: WHITE, bold: true, align: "center", valign: "middle" });
  });

  rows.forEach((row, ri) => {
    const fill = ri % 2 === 0 ? SLATE : MID;
    row.forEach((cell, ci) => {
      s.addShape(pres.ShapeType.rect, { x: colX[ci], y: 1.22 + ri * 0.35, w: colW[ci], h: 0.35, fill: { color: fill } });
      s.addText(cell, {
        x: colX[ci] + 0.03, y: 1.22 + ri * 0.35, w: colW[ci] - 0.06, h: 0.35,
        fontSize: ci === 0 ? 9 : 9, color: ci === 0 ? GOLD : LIGHT, align: ci === 0 ? "left" : "center", valign: "middle", bold: ci === 0
      });
    });
  });
}

// ══════════════════════════════════════════════════════════════════════════
// SLIDE 18 – Key Clinical Pearls
// ══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: "F8F9FB" };
  sectionTag(s, "Clinical Pearls");

  s.addText("High-Yield Clinical Pearls", { x: 0.4, y: 0.45, w: 9, h: 0.55, fontSize: 28, color: DARK, bold: true });
  s.addShape(pres.ShapeType.line, { x: 0.4, y: 1.05, w: 5, h: 0, line: { color: RED, width: 2.5 } });

  const pearls = [
    ["Ferritin is the first test to fall in iron deficiency", "Serum ferritin drops before serum iron or Hb changes — it is the most sensitive early marker."],
    ["Neurological symptoms = B12, not folate", "Both cause megaloblastic anemia, but subacute combined degeneration of the cord is exclusively B12 deficiency."],
    ["ACI: both serum iron AND TIBC are low", "This distinguishes ACI from IDA (where TIBC is high). Ferritin is also raised (acute phase reactant)."],
    ["Reticulocytosis = bone marrow response", "A rising reticulocyte count indicates the marrow is responding (e.g., post-iron therapy, post-hemorrhage). Absent reticulocytosis in anemia suggests bone marrow failure."],
    ["Schistocytes on smear = emergency", "Fragmented red cells (schistocytes) indicate MAHA — think TTP/HUS/DIC. TTP requires immediate plasma exchange."],
    ["Parvovirus B19 + hemolytic anemia = aplastic crisis", "In patients with chronic hemolytic anemias (HS, SCA), parvovirus B19 infects erythroblasts, transiently halting red cell production and causing sudden severe anemia."],
  ];

  pearls.forEach(([title, body], i) => {
    const col = i < 3 ? 0 : 1;
    const row = i % 3;
    const x = col === 0 ? 0.3 : 5.1;
    const y = 1.2 + row * 1.42;
    s.addShape(pres.ShapeType.roundRect, { x, y, w: 4.55, h: 1.3, fill: { color: DARK }, rectRadius: 0.1 });
    s.addShape(pres.ShapeType.rect, { x, y, w: 4.55, h: 0.38, fill: { color: GOLD } });
    s.addText(title, { x: x + 0.1, y, w: 4.35, h: 0.38, fontSize: 11, color: DARK, bold: true, valign: "middle" });
    s.addText(body, { x: x + 0.1, y: y + 0.42, w: 4.35, h: 0.88, fontSize: 10.5, color: LIGHT, valign: "top" });
  });
}

// ══════════════════════════════════════════════════════════════════════════
// SLIDE 19 – Thank You / References
// ══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  darkBg(s);

  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.18, h: 5.625, fill: { color: RED } });
  s.addShape(pres.ShapeType.rect, { x: 0.18, y: 0, w: 0.04, h: 5.625, fill: { color: GOLD } });

  s.addText("Thank You", { x: 0.5, y: 1.0, w: 9, h: 1.1, fontSize: 64, color: WHITE, bold: true, fontFace: "Calibri" });
  s.addText("Questions & Discussion", { x: 0.5, y: 2.2, w: 9, h: 0.5, fontSize: 22, color: GOLD, italic: true });
  s.addShape(pres.ShapeType.line, { x: 0.5, y: 2.85, w: 6, h: 0, line: { color: RED, width: 2 } });

  s.addText("References", { x: 0.5, y: 3.05, w: 9, h: 0.35, fontSize: 14, color: GOLD, bold: true });
  const refs = [
    "Kumar V, Abbas AK, Aster JC. Robbins & Kumar Basic Pathology, 11th ed. Elsevier, 2023.",
    "WHO. Haemoglobin concentrations for the diagnosis of anaemia and assessment of severity. 2011.",
    "Camaschella C. Iron-deficiency anemia. N Engl J Med. 2015;372:1832-1843.",
    "Schrier SL. Approach to the adult patient with anemia. UpToDate. 2024.",
    "Goldman-Cecil Medicine, 27th ed. Elsevier, 2024.",
  ];
  s.addText(refs.map((r, i) => ({ text: r, options: { bullet: true, breakLine: i < refs.length - 1, fontSize: 10, color: SUBTLE } })), { x: 0.5, y: 3.45, w: 9, h: 1.9 });
}

// ── WRITE FILE ──────────────────────────────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/workspace/anemia-pptx/Anemia_Comprehensive_Overview.pptx" })
  .then(() => console.log("DONE: Anemia_Comprehensive_Overview.pptx created"))
  .catch(e => { console.error("ERROR:", e); process.exit(1); });
Running Command

cd /home/daytona/workspace/anemia-pptx && node build.js 2>&1

Running Command

ls -lh /home/daytona/workspace/anemia-pptx/

Your presentation is ready! Download it here:

Anemia Comprehensive Overview

Presentation · PPTX


What's Inside (19 slides)

The deck uses a bold crimson/navy/gold color scheme designed specifically for a hematology topic. Here's the full breakdown:
SlideContent
1Title slide
2Lecture outline (10 topics)
3Definition & Epidemiology (WHO thresholds, global burden)
4Classification — morphological (MCV-based) vs pathophysiological
5Anemia of Blood Loss — acute vs chronic hemorrhage
6Hemolytic Anemias overview — extravascular vs intravascular
7Hereditary Spherocytosis & Sickle Cell Anemia
8Thalassemias — α and β types, severity spectrum
9G6PD Deficiency & PNH
10Iron Deficiency Anemia — pathophysiology, stages, labs, treatment
11Anemia of Chronic Inflammation — hepcidin pathway + ACI vs IDA comparison table
12Megaloblastic Anemias — B12 vs folate with key differentiator callout
13Aplastic Anemia — etiology, pancytopenia, BMT vs IST
14Autoimmune & Microangiopathic Hemolytic Anemias (TTP pentad)
15Diagnostic work-up — 4-step approach (history → CBC → smear → targeted tests)
16Management principles — 6 pillars
17Quick-reference summary table (12 anemia types)
18High-yield clinical pearls (6 exam-focused tips)
19Thank you + references
Content is drawn from Robbins & Kumar Basic Pathology and Goldman-Cecil Medicine.
This is a shared conversation. Sign in to Orris to start your own chat.