Prepare the ppt on topic - how to read basic cbc test

Reading File
Reading File
Reading File
Finding Sources
Searching the Web

how to read CBC complete blood count interpretation guide normal values

Finding Sources
Reading Web Page

https://www.ncbi.nlm.nih.gov/books/NBK604207

Running Command

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

Running Command

mkdir -p /home/daytona/workspace/cbc-ppt

Writing File

~/cbc-ppt/build.js

const pptxgen = require("pptxgenjs");

const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "How to Read a Basic CBC Test";
pres.author = "Orris Medical Education";

// ── COLOUR PALETTE ──────────────────────────────────────────────────────────
const C = {
  navy:    "0D2B55",   // dominant background
  blue:    "1565C0",   // section headers / accent bar
  teal:    "00838F",   // callout boxes
  white:   "FFFFFF",
  silver:  "E8EDF5",   // light bg for content slides
  yellow:  "FFD600",   // accent highlight
  red:     "D32F2F",
  green:   "2E7D32",
  gray:    "546E7A",
  lightGray: "CFD8DC",
};

// ── HELPER FUNCTIONS ─────────────────────────────────────────────────────────

function addAccentBar(slide, color = C.yellow) {
  slide.addShape("rect", { x: 0, y: 0, w: 0.18, h: 5.625, fill: { color } });
}

function addSectionLabel(slide, text, color = C.blue) {
  slide.addShape("rect", { x: 0.28, y: 0.22, w: 2.6, h: 0.36, fill: { color }, line: { type: "none" } });
  slide.addText(text.toUpperCase(), {
    x: 0.28, y: 0.22, w: 2.6, h: 0.36,
    fontSize: 9, bold: true, color: C.white, align: "center", valign: "middle", margin: 0,
  });
}

function addSlideNumber(slide, num) {
  slide.addText(String(num), {
    x: 9.5, y: 5.2, w: 0.4, h: 0.3,
    fontSize: 9, color: C.gray, align: "right",
  });
}

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

  // Dark background
  s.addShape("rect", { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.navy } });

  // Yellow diagonal accent stripe
  s.addShape("rect", { x: 0, y: 3.9, w: 10, h: 0.08, fill: { color: C.yellow } });

  // Decorative circles
  s.addShape("ellipse", { x: 8.5, y: -0.8, w: 2.8, h: 2.8, fill: { color: "162F5A" }, line: { type: "none" } });
  s.addShape("ellipse", { x: -0.9, y: 4.0, w: 2.2, h: 2.2, fill: { color: "162F5A" }, line: { type: "none" } });

  // Label pill
  s.addShape("rect", {
    x: 0.6, y: 1.0, w: 2.8, h: 0.4,
    fill: { color: C.teal }, line: { type: "none" },
    rectRadius: 0.08,
  });
  s.addText("MEDICAL EDUCATION", {
    x: 0.6, y: 1.0, w: 2.8, h: 0.4,
    fontSize: 9.5, bold: true, color: C.white, align: "center", valign: "middle", margin: 0,
  });

  // Main title
  s.addText("How to Read a\nBasic CBC Test", {
    x: 0.55, y: 1.55, w: 7.5, h: 1.9,
    fontSize: 46, bold: true, color: C.white, align: "left",
    lineSpacingMultiple: 1.1,
  });

  // Sub-title
  s.addText("Complete Blood Count — A Practical Interpretation Guide", {
    x: 0.55, y: 3.5, w: 7.8, h: 0.45,
    fontSize: 15, color: C.lightGray, align: "left", italic: true,
  });

  // Footer
  s.addText("Normal ranges  •  What each value means  •  When to be concerned", {
    x: 0.55, y: 5.15, w: 8.5, h: 0.3,
    fontSize: 9.5, color: C.gray, align: "left",
  });
}

// ── SLIDE 2 — WHAT IS A CBC? ──────────────────────────────────────────────────
{
  const s = pres.addSlide();
  s.addShape("rect", { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.silver } });
  addAccentBar(s, C.blue);
  addSectionLabel(s, "Overview", C.blue);
  addSlideNumber(s, 2);

  s.addText("What Is a CBC?", {
    x: 0.38, y: 0.68, w: 9, h: 0.6,
    fontSize: 28, bold: true, color: C.navy,
  });

  // Info box
  s.addShape("rect", { x: 0.38, y: 1.38, w: 9.3, h: 0.72,
    fill: { color: C.blue }, line: { type: "none" }, rectRadius: 0.08 });
  s.addText(
    "A Complete Blood Count (CBC) is one of the most commonly ordered laboratory tests. It measures the number, size, and type of cells in your blood — providing a snapshot of your overall health.",
    { x: 0.38, y: 1.38, w: 9.3, h: 0.72, fontSize: 12, color: C.white, align: "center", valign: "middle", margin: 8 }
  );

  // Three-column cards
  const cols = [
    { icon: "🔴", title: "Red Blood Cells", body: "Carry oxygen from the lungs to every cell in the body via hemoglobin", x: 0.38 },
    { icon: "⚪", title: "White Blood Cells", body: "Defend the body against infection, bacteria, viruses, and foreign invaders", x: 3.58 },
    { icon: "🟡", title: "Platelets", body: "Tiny cell fragments that stop bleeding by forming clots at injury sites", x: 6.78 },
  ];

  cols.forEach(col => {
    s.addShape("rect", { x: col.x, y: 2.28, w: 3.0, h: 2.95,
      fill: { color: C.white }, line: { color: C.lightGray, pt: 1 }, rectRadius: 0.1 });
    s.addText(col.icon, { x: col.x, y: 2.4, w: 3.0, h: 0.55, fontSize: 28, align: "center" });
    s.addText(col.title, { x: col.x + 0.1, y: 2.98, w: 2.8, h: 0.45,
      fontSize: 13, bold: true, color: C.navy, align: "center" });
    s.addShape("rect", { x: col.x + 0.9, y: 3.45, w: 1.2, h: 0.05, fill: { color: C.yellow } });
    s.addText(col.body, { x: col.x + 0.1, y: 3.55, w: 2.8, h: 1.4,
      fontSize: 11, color: C.gray, align: "center", valign: "top" });
  });
}

// ── SLIDE 3 — WHY IS IT ORDERED? ─────────────────────────────────────────────
{
  const s = pres.addSlide();
  s.addShape("rect", { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.white } });
  addAccentBar(s, C.teal);
  addSectionLabel(s, "Clinical Context", C.teal);
  addSlideNumber(s, 3);

  s.addText("Why Is a CBC Ordered?", {
    x: 0.38, y: 0.68, w: 9, h: 0.6,
    fontSize: 28, bold: true, color: C.navy,
  });

  const reasons = [
    { num: "01", title: "Routine Check-up", desc: "Screening for blood disorders during annual health exams" },
    { num: "02", title: "Symptom Investigation", desc: "Fatigue, weakness, fever, bruising, or unexplained weight loss" },
    { num: "03", title: "Monitoring Chronic Illness", desc: "Track conditions like diabetes, kidney disease, or heart disease" },
    { num: "04", title: "Pre-operative Assessment", desc: "Ensure safe haemoglobin and platelet levels before surgery" },
    { num: "05", title: "Medication Monitoring", desc: "Chemotherapy, anticoagulants, and immunosuppressants can affect blood cells" },
    { num: "06", title: "Diagnosing Infections", desc: "Elevated WBC indicates bacterial or viral infection response" },
  ];

  reasons.forEach((r, i) => {
    const col = i % 2;
    const row = Math.floor(i / 2);
    const x = 0.38 + col * 4.8;
    const y = 1.55 + row * 1.2;
    s.addShape("rect", { x, y, w: 4.5, h: 1.05,
      fill: { color: i % 2 === 0 ? C.silver : "EDF4FD" }, line: { color: C.lightGray, pt: 1 }, rectRadius: 0.08 });
    s.addShape("rect", { x, y, w: 0.7, h: 1.05,
      fill: { color: C.blue }, line: { type: "none" }, rectRadius: 0.08 });
    s.addText(r.num, { x, y, w: 0.7, h: 1.05,
      fontSize: 16, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });
    s.addText(r.title, { x: x + 0.78, y: y + 0.08, w: 3.6, h: 0.36,
      fontSize: 12, bold: true, color: C.navy });
    s.addText(r.desc, { x: x + 0.78, y: y + 0.46, w: 3.6, h: 0.5,
      fontSize: 10, color: C.gray });
  });
}

// ── SLIDE 4 — RED BLOOD CELLS SECTION DIVIDER ────────────────────────────────
{
  const s = pres.addSlide();
  s.addShape("rect", { x: 0, y: 0, w: 10, h: 5.625, fill: { color: "B71C1C" } });
  s.addShape("ellipse", { x: 6.5, y: -1.5, w: 5.5, h: 5.5, fill: { color: "C62828" }, line: { type: "none" } });
  s.addShape("ellipse", { x: -1.5, y: 3.5, w: 4, h: 4, fill: { color: "C62828" }, line: { type: "none" } });

  s.addText("SECTION 1", { x: 1.5, y: 1.3, w: 5, h: 0.4,
    fontSize: 12, bold: true, color: "FFCDD2", charSpacing: 6 });
  s.addText("Red Blood\nCell Tests", { x: 1.5, y: 1.75, w: 7, h: 2.1,
    fontSize: 52, bold: true, color: C.white, lineSpacingMultiple: 1.1 });
  s.addText("RBC  •  Hemoglobin  •  Hematocrit  •  MCV  •  MCH  •  MCHC  •  RDW", {
    x: 1.5, y: 3.95, w: 7.5, h: 0.4,
    fontSize: 12, color: "FFCDD2", italic: true });
  s.addShape("rect", { x: 1.5, y: 3.85, w: 6, h: 0.06, fill: { color: C.yellow } });
}

// ── SLIDE 5 — HEMOGLOBIN & HEMATOCRIT ────────────────────────────────────────
{
  const s = pres.addSlide();
  s.addShape("rect", { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.silver } });
  addAccentBar(s, C.red);
  addSectionLabel(s, "Red Blood Cells", C.red);
  addSlideNumber(s, 5);

  s.addText("Hemoglobin (Hb) & Hematocrit (Hct)", {
    x: 0.38, y: 0.68, w: 9.2, h: 0.6,
    fontSize: 26, bold: true, color: C.navy,
  });

  // Hemoglobin
  s.addShape("rect", { x: 0.38, y: 1.38, w: 4.55, h: 3.8,
    fill: { color: C.white }, line: { color: C.lightGray, pt: 1 }, rectRadius: 0.1 });
  s.addShape("rect", { x: 0.38, y: 1.38, w: 4.55, h: 0.5,
    fill: { color: C.red }, line: { type: "none" }, rectRadius: 0.1 });
  s.addText("Hemoglobin (Hb)", { x: 0.48, y: 1.38, w: 4.35, h: 0.5,
    fontSize: 14, bold: true, color: C.white, valign: "middle", margin: 4 });

  const hbItems = [
    ["What it measures", "Amount of hemoglobin protein in whole blood (g/dL)"],
    ["Men (normal)", "13 – 18 g/dL"],
    ["Women (normal)", "12 – 16 g/dL"],
    ["Low (Anemia)", "< 12 g/dL — fatigue, pallor, dyspnoea"],
    ["High (Polycythaemia)", "> 18 g/dL — thickened blood, clot risk"],
  ];
  hbItems.forEach(([label, val], i) => {
    const bg = i % 2 === 0 ? C.silver : C.white;
    s.addShape("rect", { x: 0.38, y: 1.92 + i * 0.55, w: 4.55, h: 0.52, fill: { color: bg } });
    s.addText(label + ":", { x: 0.48, y: 1.92 + i * 0.55, w: 1.7, h: 0.52,
      fontSize: 10, bold: true, color: C.navy, valign: "middle" });
    s.addText(val, { x: 2.2, y: 1.92 + i * 0.55, w: 2.6, h: 0.52,
      fontSize: 10, color: C.gray, valign: "middle" });
  });

  // Hematocrit
  s.addShape("rect", { x: 5.13, y: 1.38, w: 4.55, h: 3.8,
    fill: { color: C.white }, line: { color: C.lightGray, pt: 1 }, rectRadius: 0.1 });
  s.addShape("rect", { x: 5.13, y: 1.38, w: 4.55, h: 0.5,
    fill: { color: "C62828" }, line: { type: "none" }, rectRadius: 0.1 });
  s.addText("Hematocrit (Hct)", { x: 5.23, y: 1.38, w: 4.35, h: 0.5,
    fontSize: 14, bold: true, color: C.white, valign: "middle", margin: 4 });

  const hctItems = [
    ["What it measures", "% of blood volume occupied by RBCs"],
    ["Men (normal)", "41 – 53 %"],
    ["Women (normal)", "36 – 46 %"],
    ["Low", "< 36 % — anaemia, haemorrhage"],
    ["High", "> 52 % — dehydration, polycythaemia"],
  ];
  hctItems.forEach(([label, val], i) => {
    const bg = i % 2 === 0 ? C.silver : C.white;
    s.addShape("rect", { x: 5.13, y: 1.92 + i * 0.55, w: 4.55, h: 0.52, fill: { color: bg } });
    s.addText(label + ":", { x: 5.23, y: 1.92 + i * 0.55, w: 1.7, h: 0.52,
      fontSize: 10, bold: true, color: C.navy, valign: "middle" });
    s.addText(val, { x: 6.95, y: 1.92 + i * 0.55, w: 2.6, h: 0.52,
      fontSize: 10, color: C.gray, valign: "middle" });
  });
}

// ── SLIDE 6 — RBC INDICES ─────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  s.addShape("rect", { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.white } });
  addAccentBar(s, C.red);
  addSectionLabel(s, "Red Blood Cells", C.red);
  addSlideNumber(s, 6);

  s.addText("RBC Indices — Size & Colour of Red Cells", {
    x: 0.38, y: 0.68, w: 9.2, h: 0.6,
    fontSize: 25, bold: true, color: C.navy,
  });

  const indices = [
    {
      abbr: "MCV", full: "Mean Corpuscular Volume",
      normal: "80 – 100 fL",
      low: "Microcytic anaemia\n(iron deficiency, thalassaemia)",
      high: "Macrocytic anaemia\n(B12/folate deficiency)",
      x: 0.3,
    },
    {
      abbr: "MCH", full: "Mean Corpuscular Haemoglobin",
      normal: "27 – 32 pg/cell",
      low: "Hypochromic cells\n(iron deficiency)",
      high: "Hyperchromic / B12 deficiency",
      x: 3.45,
    },
    {
      abbr: "MCHC", full: "Mean Corpuscular Hb Concentration",
      normal: "32 – 36 g/dL",
      low: "Iron deficiency, thalassaemia",
      high: "Hereditary spherocytosis",
      x: 6.6,
    },
  ];

  indices.forEach(idx => {
    s.addShape("rect", { x: idx.x, y: 1.42, w: 3.0, h: 3.8,
      fill: { color: C.silver }, line: { color: C.lightGray, pt: 1 }, rectRadius: 0.1 });
    // Abbreviation badge
    s.addShape("rect", { x: idx.x, y: 1.42, w: 3.0, h: 0.82,
      fill: { color: C.red }, line: { type: "none" }, rectRadius: 0.1 });
    s.addText(idx.abbr, { x: idx.x, y: 1.42, w: 3.0, h: 0.5,
      fontSize: 22, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });
    s.addText(idx.full, { x: idx.x + 0.08, y: 1.9, w: 2.84, h: 0.48,
      fontSize: 9, color: "FFCDD2", align: "center", italic: true });

    // Normal range
    s.addShape("rect", { x: idx.x + 0.15, y: 2.35, w: 2.7, h: 0.55,
      fill: { color: C.green + "22" }, line: { color: C.green, pt: 1 }, rectRadius: 0.06 });
    s.addText("Normal: " + idx.normal, { x: idx.x + 0.15, y: 2.35, w: 2.7, h: 0.55,
      fontSize: 11, bold: true, color: C.green, align: "center", valign: "middle" });

    s.addText("LOW:", { x: idx.x + 0.15, y: 3.0, w: 0.55, h: 0.3,
      fontSize: 10, bold: true, color: C.red });
    s.addText(idx.low, { x: idx.x + 0.15, y: 3.28, w: 2.7, h: 0.7,
      fontSize: 10, color: C.gray });
    s.addText("HIGH:", { x: idx.x + 0.15, y: 3.98, w: 0.7, h: 0.3,
      fontSize: 10, bold: true, color: "B71C1C" });
    s.addText(idx.high, { x: idx.x + 0.15, y: 4.27, w: 2.7, h: 0.7,
      fontSize: 10, color: C.gray });
  });
}

// ── SLIDE 7 — WHITE BLOOD CELLS DIVIDER ──────────────────────────────────────
{
  const s = pres.addSlide();
  s.addShape("rect", { x: 0, y: 0, w: 10, h: 5.625, fill: { color: "0D47A1" } });
  s.addShape("ellipse", { x: 6.5, y: -1.5, w: 5.5, h: 5.5, fill: { color: "1565C0" }, line: { type: "none" } });
  s.addShape("ellipse", { x: -1.5, y: 3.5, w: 4, h: 4, fill: { color: "1565C0" }, line: { type: "none" } });

  s.addText("SECTION 2", { x: 1.5, y: 1.3, w: 5, h: 0.4,
    fontSize: 12, bold: true, color: "BBDEFB", charSpacing: 6 });
  s.addText("White Blood\nCell Tests", { x: 1.5, y: 1.75, w: 7, h: 2.1,
    fontSize: 52, bold: true, color: C.white, lineSpacingMultiple: 1.1 });
  s.addText("Total WBC Count  •  Differential  •  Neutrophils  •  Lymphocytes  •  More", {
    x: 1.5, y: 3.95, w: 8, h: 0.4,
    fontSize: 12, color: "BBDEFB", italic: true });
  s.addShape("rect", { x: 1.5, y: 3.85, w: 6.5, h: 0.06, fill: { color: C.yellow } });
}

// ── SLIDE 8 — TOTAL WBC COUNT ─────────────────────────────────────────────────
{
  const s = pres.addSlide();
  s.addShape("rect", { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.silver } });
  addAccentBar(s, C.blue);
  addSectionLabel(s, "White Blood Cells", C.blue);
  addSlideNumber(s, 8);

  s.addText("Total WBC Count", {
    x: 0.38, y: 0.68, w: 9.2, h: 0.6,
    fontSize: 28, bold: true, color: C.navy,
  });

  // Normal range banner
  s.addShape("rect", { x: 0.38, y: 1.38, w: 9.3, h: 0.65,
    fill: { color: C.blue }, line: { type: "none" }, rectRadius: 0.08 });
  s.addText("Normal Range in Adults: 4,500 – 11,000 cells/µL", {
    x: 0.38, y: 1.38, w: 9.3, h: 0.65,
    fontSize: 16, bold: true, color: C.white, align: "center", valign: "middle" });

  // Low / Normal / High visual
  const zones = [
    { label: "LEUKOPENIA", sub: "< 4,500/µL", desc: "Bone marrow suppression\nViral infections (HIV, hepatitis)\nAutoimmune disorders\nChemotherapy side effect", color: "E3F2FD", border: C.blue, icon: "⬇" },
    { label: "NORMAL", sub: "4,500 – 11,000/µL", desc: "No further WBC-related\nconcern in most cases", color: "E8F5E9", border: C.green, icon: "✓" },
    { label: "LEUKOCYTOSIS", sub: "> 11,000/µL", desc: "Bacterial infection\nInflammatory conditions\nLeukaemia\nPhysical or emotional stress", color: "FFEBEE", border: C.red, icon: "⬆" },
  ];

  zones.forEach((z, i) => {
    const x = 0.38 + i * 3.15;
    s.addShape("rect", { x, y: 2.2, w: 2.95, h: 3.05,
      fill: { color: z.color }, line: { color: z.border, pt: 1.5 }, rectRadius: 0.1 });
    s.addText(z.icon, { x, y: 2.28, w: 2.95, h: 0.52, fontSize: 24, align: "center" });
    s.addText(z.label, { x, y: 2.82, w: 2.95, h: 0.38,
      fontSize: 13, bold: true, color: z.border, align: "center" });
    s.addText(z.sub, { x, y: 3.2, w: 2.95, h: 0.35,
      fontSize: 10, color: C.gray, align: "center", italic: true });
    s.addShape("rect", { x: x + 0.3, y: 3.56, w: 2.35, h: 0.04, fill: { color: z.border } });
    s.addText(z.desc, { x: x + 0.1, y: 3.65, w: 2.75, h: 1.45,
      fontSize: 10, color: C.navy, align: "left" });
  });
}

// ── SLIDE 9 — WBC DIFFERENTIAL ───────────────────────────────────────────────
{
  const s = pres.addSlide();
  s.addShape("rect", { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.white } });
  addAccentBar(s, C.blue);
  addSectionLabel(s, "WBC Differential", C.blue);
  addSlideNumber(s, 9);

  s.addText("WBC Differential — Types of White Cells", {
    x: 0.38, y: 0.68, w: 9.2, h: 0.6,
    fontSize: 26, bold: true, color: C.navy,
  });

  const cells = [
    { name: "Neutrophils", pct: "50 – 70 %", abs: "1,800 – 7,700/µL", role: "First-line defence against bacteria and fungi", high: "Bacterial infection, steroid use", low: "Chemotherapy, aplastic anaemia", color: "1565C0" },
    { name: "Lymphocytes", pct: "20 – 40 %", abs: "1,000 – 4,800/µL", role: "B-cells (antibodies) & T-cells (cell immunity)", high: "Viral infections, CLL", low: "HIV, immunodeficiency", color: "00838F" },
    { name: "Monocytes", pct: "2 – 8 %", abs: "200 – 800/µL", role: "Clean up debris; present antigens to lymphocytes", high: "Chronic infection, monocytic leukaemia", low: "Aplastic anaemia, steroid use", color: "4527A0" },
    { name: "Eosinophils", pct: "1 – 4 %", abs: "100 – 500/µL", role: "Combat parasites and mediate allergic reactions", high: "Allergies, asthma, parasitic infection", low: "Steroid excess (Cushing's)", color: "E65100" },
    { name: "Basophils", pct: "0.5 – 1 %", abs: "20 – 100/µL", role: "Release histamine in allergic/inflammatory response", high: "Allergic reactions, CML", low: "Acute infection, hyperthyroidism", color: "AD1457" },
  ];

  // Table header
  const headers = ["Cell Type", "% Range", "Absolute Range", "Function & Clinical Notes"];
  const colW = [1.9, 1.2, 1.7, 4.8];
  const colX = [0.28, 2.18, 3.38, 5.08];

  s.addShape("rect", { x: 0.28, y: 1.38, w: 9.42, h: 0.42,
    fill: { color: C.navy }, line: { type: "none" } });
  headers.forEach((h, i) => {
    s.addText(h, { x: colX[i], y: 1.38, w: colW[i], h: 0.42,
      fontSize: 11, bold: true, color: C.white, valign: "middle", margin: 4 });
  });

  cells.forEach((c, i) => {
    const y = 1.82 + i * 0.72;
    const bg = i % 2 === 0 ? C.silver : C.white;
    s.addShape("rect", { x: 0.28, y, w: 9.42, h: 0.7, fill: { color: bg } });
    s.addShape("rect", { x: 0.28, y, w: 0.12, h: 0.7, fill: { color: c.color } });

    s.addText(c.name, { x: 0.45, y, w: 1.7, h: 0.7,
      fontSize: 11, bold: true, color: c.color, valign: "middle" });
    s.addText(c.pct, { x: colX[1], y, w: colW[1], h: 0.7,
      fontSize: 11, color: C.navy, valign: "middle", align: "center" });
    s.addText(c.abs, { x: colX[2], y, w: colW[2], h: 0.7,
      fontSize: 10, color: C.gray, valign: "middle" });
    s.addText([
      { text: c.role + "\n", options: { bold: false } },
      { text: "↑ ", options: { bold: true, color: C.red } },
      { text: c.high + "  ", options: {} },
      { text: "↓ ", options: { bold: true, color: C.blue } },
      { text: c.low, options: {} },
    ], { x: colX[3], y, w: colW[3], h: 0.7, fontSize: 9, color: C.navy, valign: "middle" });
  });
}

// ── SLIDE 10 — PLATELETS DIVIDER ──────────────────────────────────────────────
{
  const s = pres.addSlide();
  s.addShape("rect", { x: 0, y: 0, w: 10, h: 5.625, fill: { color: "1B5E20" } });
  s.addShape("ellipse", { x: 6.5, y: -1.5, w: 5.5, h: 5.5, fill: { color: "2E7D32" }, line: { type: "none" } });
  s.addShape("ellipse", { x: -1.5, y: 3.5, w: 4, h: 4, fill: { color: "2E7D32" }, line: { type: "none" } });

  s.addText("SECTION 3", { x: 1.5, y: 1.3, w: 5, h: 0.4,
    fontSize: 12, bold: true, color: "C8E6C9", charSpacing: 6 });
  s.addText("Platelet\nTests", { x: 1.5, y: 1.75, w: 7, h: 2.1,
    fontSize: 52, bold: true, color: C.white, lineSpacingMultiple: 1.1 });
  s.addText("Platelet Count  •  MPV  •  Thrombocytopenia  •  Thrombocytosis", {
    x: 1.5, y: 3.95, w: 8, h: 0.4,
    fontSize: 12, color: "C8E6C9", italic: true });
  s.addShape("rect", { x: 1.5, y: 3.85, w: 5.5, h: 0.06, fill: { color: C.yellow } });
}

// ── SLIDE 11 — PLATELETS ──────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  s.addShape("rect", { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.silver } });
  addAccentBar(s, C.green);
  addSectionLabel(s, "Platelets", C.green);
  addSlideNumber(s, 11);

  s.addText("Platelet Count", {
    x: 0.38, y: 0.68, w: 9.2, h: 0.6,
    fontSize: 28, bold: true, color: C.navy,
  });

  // Normal banner
  s.addShape("rect", { x: 0.38, y: 1.38, w: 9.3, h: 0.58,
    fill: { color: C.green }, line: { type: "none" }, rectRadius: 0.08 });
  s.addText("Normal Range: 150,000 – 400,000 /µL   |   Role: Haemostasis & Clot Formation", {
    x: 0.38, y: 1.38, w: 9.3, h: 0.58,
    fontSize: 13, bold: true, color: C.white, align: "center", valign: "middle" });

  // Two columns
  // Thrombocytopenia
  s.addShape("rect", { x: 0.38, y: 2.1, w: 4.55, h: 3.15,
    fill: { color: C.white }, line: { color: C.red, pt: 1.5 }, rectRadius: 0.1 });
  s.addShape("rect", { x: 0.38, y: 2.1, w: 4.55, h: 0.52,
    fill: { color: C.red }, line: { type: "none" }, rectRadius: 0.1 });
  s.addText("THROMBOCYTOPENIA  (Low Platelets < 150,000)", {
    x: 0.5, y: 2.1, w: 4.35, h: 0.52,
    fontSize: 11, bold: true, color: C.white, valign: "middle", margin: 4 });

  const thrombLow = [
    "Mild (100–150k): Usually no symptoms",
    "Moderate (50–100k): Increased bruising risk",
    "Severe (< 50k): Spontaneous bleeding risk",
    "< 20k: Life-threatening haemorrhage",
    "Causes: ITP, DIC, dengue, B12 deficiency,",
    "  hypersplenism, chemotherapy",
  ];
  thrombLow.forEach((t, i) => {
    s.addText(t, { x: 0.52, y: 2.72 + i * 0.4, w: 4.2, h: 0.38,
      fontSize: 10, color: i < 4 ? C.navy : C.gray, bullet: i >= 0 });
  });

  // Thrombocytosis
  s.addShape("rect", { x: 5.13, y: 2.1, w: 4.55, h: 3.15,
    fill: { color: C.white }, line: { color: C.teal, pt: 1.5 }, rectRadius: 0.1 });
  s.addShape("rect", { x: 5.13, y: 2.1, w: 4.55, h: 0.52,
    fill: { color: C.teal }, line: { type: "none" }, rectRadius: 0.1 });
  s.addText("THROMBOCYTOSIS  (High Platelets > 400,000)", {
    x: 5.25, y: 2.1, w: 4.35, h: 0.52,
    fontSize: 11, bold: true, color: C.white, valign: "middle", margin: 4 });

  const thrombHigh = [
    "Reactive (most common): inflammatory response",
    "Causes: infection, iron deficiency, surgery,",
    "  post-splenectomy, inflammatory disease",
    "Primary / Essential Thrombocythaemia:",
    "  Bone marrow overproduction",
    "Risk: clot formation if very elevated",
  ];
  thrombHigh.forEach((t, i) => {
    s.addText(t, { x: 5.27, y: 2.72 + i * 0.4, w: 4.2, h: 0.38,
      fontSize: 10, color: i < 3 ? C.navy : C.gray });
  });
}

// ── SLIDE 12 — COMPLETE REFERENCE TABLE ──────────────────────────────────────
{
  const s = pres.addSlide();
  s.addShape("rect", { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.white } });
  addAccentBar(s, C.navy);
  addSectionLabel(s, "Quick Reference", C.navy);
  addSlideNumber(s, 12);

  s.addText("CBC Normal Ranges — At a Glance", {
    x: 0.38, y: 0.68, w: 9.2, h: 0.55,
    fontSize: 26, bold: true, color: C.navy,
  });

  const rows = [
    ["Parameter", "Normal Range", "Low Concern", "High Concern", "hdr"],
    ["Haemoglobin (Men)", "13 – 18 g/dL", "Anaemia / bleeding", "Polycythaemia", "red"],
    ["Haemoglobin (Women)", "12 – 16 g/dL", "Anaemia", "Polycythaemia", "red"],
    ["Hematocrit (Men)", "41 – 53 %", "Anaemia", "Dehydration / polycythaemia", "red"],
    ["RBC (Men/Women)", "4.6–6.2 / 4.2–5.4 M/µL", "Anaemia", "Polycythaemia", "red"],
    ["MCV", "80 – 100 fL", "Microcytic (iron def)", "Macrocytic (B12/folate def)", "red"],
    ["WBC", "4,500 – 11,000 /µL", "Infection risk / BM failure", "Infection / leukaemia", "blue"],
    ["Neutrophils", "50 – 70 %", "Neutropenia (chemo, viral)", "Bacterial infection", "blue"],
    ["Lymphocytes", "20 – 40 %", "HIV / immunodeficiency", "Viral / CLL", "blue"],
    ["Platelets", "150,000 – 400,000 /µL", "Bleeding risk", "Thrombosis risk", "green"],
  ];

  const colW2 = [2.1, 2.0, 2.5, 2.85];
  const colX2 = [0.28, 2.38, 4.38, 6.88];

  rows.forEach((r, ri) => {
    const y = 1.35 + ri * 0.42;
    const isHdr = r[4] === "hdr";
    const bg = isHdr ? C.navy : (ri % 2 === 0 ? C.silver : C.white);
    s.addShape("rect", { x: 0.28, y, w: 9.42, h: 0.42, fill: { color: bg } });

    // Left accent by type
    if (!isHdr) {
      const accentColor = r[4] === "red" ? C.red : r[4] === "blue" ? C.blue : C.green;
      s.addShape("rect", { x: 0.28, y, w: 0.1, h: 0.42, fill: { color: accentColor } });
    }

    r.slice(0, 4).forEach((cell, ci) => {
      s.addText(cell, {
        x: colX2[ci] + (ci === 0 ? 0.14 : 0), y, w: colW2[ci], h: 0.42,
        fontSize: isHdr ? 11 : 10,
        bold: isHdr || ci === 0,
        color: isHdr ? C.white : ci === 0 ? C.navy : C.gray,
        valign: "middle", margin: 3,
      });
    });
  });
}

// ── SLIDE 13 — ANEMIA CLASSIFICATION ─────────────────────────────────────────
{
  const s = pres.addSlide();
  s.addShape("rect", { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.silver } });
  addAccentBar(s, C.red);
  addSectionLabel(s, "Clinical Application", C.red);
  addSlideNumber(s, 13);

  s.addText("Using CBC to Classify Anaemia", {
    x: 0.38, y: 0.68, w: 9.2, h: 0.6,
    fontSize: 26, bold: true, color: C.navy,
  });

  const types = [
    {
      title: "Microcytic Anaemia", color: C.red, x: 0.28, y: 1.45,
      markers: "MCV < 80 fL • Low MCH",
      causes: ["Iron deficiency anaemia", "Thalassaemia", "Anaemia of chronic disease", "Lead poisoning"],
    },
    {
      title: "Normocytic Anaemia", color: C.blue, x: 3.45, y: 1.45,
      markers: "MCV 80–100 fL • Normal MCH",
      causes: ["Acute blood loss", "Haemolytic anaemia", "Aplastic anaemia", "Renal failure"],
    },
    {
      title: "Macrocytic Anaemia", color: C.teal, x: 6.62, y: 1.45,
      markers: "MCV > 100 fL • High MCH",
      causes: ["Vit B12 deficiency", "Folate deficiency", "Hypothyroidism", "Alcoholism"],
    },
  ];

  types.forEach(t => {
    s.addShape("rect", { x: t.x, y: t.y, w: 3.0, h: 3.9,
      fill: { color: C.white }, line: { color: t.color, pt: 2 }, rectRadius: 0.1 });
    s.addShape("rect", { x: t.x, y: t.y, w: 3.0, h: 0.65,
      fill: { color: t.color }, line: { type: "none" }, rectRadius: 0.1 });
    s.addText(t.title, { x: t.x, y: t.y, w: 3.0, h: 0.65,
      fontSize: 13, bold: true, color: C.white, align: "center", valign: "middle" });
    s.addShape("rect", { x: t.x + 0.1, y: t.y + 0.75, w: 2.8, h: 0.45,
      fill: { color: t.color + "22" }, line: { type: "none" }, rectRadius: 0.05 });
    s.addText(t.markers, { x: t.x + 0.1, y: t.y + 0.75, w: 2.8, h: 0.45,
      fontSize: 10, bold: true, color: t.color, align: "center", valign: "middle" });
    s.addText("Common Causes:", { x: t.x + 0.15, y: t.y + 1.35, w: 2.7, h: 0.3,
      fontSize: 11, bold: true, color: C.navy });
    t.causes.forEach((c, i) => {
      s.addText("• " + c, { x: t.x + 0.15, y: t.y + 1.65 + i * 0.48, w: 2.7, h: 0.45,
        fontSize: 11, color: C.gray });
    });
  });

  s.addText("Tip: RDW (normal 11.5–14.5%) helps differentiate iron deficiency (high RDW) from thalassaemia (normal RDW) in microcytic anaemia.", {
    x: 0.28, y: 5.18, w: 9.44, h: 0.35,
    fontSize: 9.5, color: C.teal, italic: true,
  });
}

// ── SLIDE 14 — WHEN TO SEEK MEDICAL ATTENTION ────────────────────────────────
{
  const s = pres.addSlide();
  s.addShape("rect", { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.white } });
  addAccentBar(s, C.yellow);
  addSectionLabel(s, "Warning Signs", "E65100");
  addSlideNumber(s, 14);

  s.addText("When to Seek Medical Attention", {
    x: 0.38, y: 0.68, w: 9.2, h: 0.6,
    fontSize: 26, bold: true, color: C.navy,
  });

  const warnings = [
    { icon: "🔴", label: "CRITICAL — Immediate", items: ["Hb < 7 g/dL (severe anaemia)", "Platelets < 20,000/µL (bleeding risk)", "WBC > 30,000/µL (possible leukaemia)", "Absolute neutrophils < 500/µL (severe risk)"], color: C.red },
    { icon: "🟡", label: "URGENT — Same Day", items: ["Hb 7–9 g/dL with symptoms", "Platelets 20–50k with bruising", "WBC > 20,000 with fever / chills", "Blast cells seen on differential"], color: "E65100" },
    { icon: "🟢", label: "ROUTINE — Follow Up", items: ["Mild isolated anaemia (Hb 10–12)", "Mild thrombocytosis (400–600k)", "Borderline WBC (11–15k, no symptoms)", "RDW or MCV mildly out of range"], color: C.green },
  ];

  warnings.forEach((w, i) => {
    const x = 0.35 + i * 3.18;
    s.addShape("rect", { x, y: 1.45, w: 3.0, h: 3.85,
      fill: { color: C.silver }, line: { color: w.color, pt: 2 }, rectRadius: 0.1 });
    s.addShape("rect", { x, y: 1.45, w: 3.0, h: 0.72,
      fill: { color: w.color }, line: { type: "none" }, rectRadius: 0.1 });
    s.addText(w.icon + "  " + w.label, { x, y: 1.45, w: 3.0, h: 0.72,
      fontSize: 12, bold: true, color: C.white, align: "center", valign: "middle" });
    w.items.forEach((item, j) => {
      s.addShape("rect", { x: x + 0.1, y: 2.28 + j * 0.77, w: 2.8, h: 0.68,
        fill: { color: C.white }, line: { color: C.lightGray, pt: 1 }, rectRadius: 0.06 });
      s.addText("• " + item, { x: x + 0.2, y: 2.28 + j * 0.77, w: 2.6, h: 0.68,
        fontSize: 10, color: C.navy, valign: "middle" });
    });
  });
}

// ── SLIDE 15 — KEY TAKEAWAYS & CLOSING ───────────────────────────────────────
{
  const s = pres.addSlide();
  s.addShape("rect", { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.navy } });
  s.addShape("ellipse", { x: 7.2, y: -1, w: 4.5, h: 4.5, fill: { color: "162F5A" }, line: { type: "none" } });
  s.addShape("rect", { x: 0, y: 4.8, w: 10, h: 0.825, fill: { color: "162F5A" } });

  s.addShape("rect", { x: 0.5, y: 0.3, w: 2.5, h: 0.4,
    fill: { color: C.teal }, line: { type: "none" }, rectRadius: 0.08 });
  s.addText("KEY TAKEAWAYS", { x: 0.5, y: 0.3, w: 2.5, h: 0.4,
    fontSize: 11, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });

  s.addText("Reading a CBC — Summary", { x: 0.5, y: 0.82, w: 8, h: 0.65,
    fontSize: 30, bold: true, color: C.white });

  const takes = [
    { n: "1", t: "Always compare to lab reference ranges", d: "Normal values vary slightly by laboratory and patient demographics." },
    { n: "2", t: "Look at the pattern, not one value", d: "MCV + MCH + RDW together reveal anaemia type better than Hb alone." },
    { n: "3", t: "Differential gives WBC meaning", d: "A high WBC from neutrophilia suggests bacterial infection; lymphocytosis suggests viral." },
    { n: "4", t: "Platelets + clinical picture matter", d: "Mild thrombocytopenia with no bleeding may require only monitoring." },
    { n: "5", t: "Repeat tests confirm trends", d: "A single abnormal CBC often needs repeat testing before diagnosis." },
  ];

  takes.forEach((t, i) => {
    const y = 1.62 + i * 0.62;
    s.addShape("ellipse", { x: 0.5, y: y + 0.05, w: 0.42, h: 0.42,
      fill: { color: C.yellow }, line: { type: "none" } });
    s.addText(t.n, { x: 0.5, y: y + 0.05, w: 0.42, h: 0.42,
      fontSize: 13, bold: true, color: C.navy, align: "center", valign: "middle", margin: 0 });
    s.addText(t.t + "  —  ", { x: 1.06, y, w: 3.5, h: 0.55,
      fontSize: 12, bold: true, color: C.white, valign: "middle" });
    s.addText(t.d, { x: 4.4, y, w: 5.2, h: 0.55,
      fontSize: 11, color: C.lightGray, valign: "middle" });
  });

  s.addText("This presentation is intended for educational purposes only. Always consult a healthcare professional for medical interpretation.", {
    x: 0.5, y: 5.0, w: 9, h: 0.4,
    fontSize: 8.5, color: C.gray, italic: true, align: "center" });
}

// ── WRITE FILE ────────────────────────────────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/workspace/cbc-ppt/How_to_Read_a_Basic_CBC_Test.pptx" })
  .then(() => console.log("SUCCESS: PPTX written"))
  .catch(e => { console.error("ERROR:", e); process.exit(1); });
Running Command

cd /home/daytona/workspace/cbc-ppt && node build.js 2>&1

Editing File

~/cbc-ppt/build.js

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/cbc-ppt/build.js'
Editing File

~/cbc-ppt/build.js

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/cbc-ppt/build.js'
Running Command

cd /home/daytona/workspace/cbc-ppt && node build.js 2>&1

Clean build with no warnings. Your presentation is ready!

How to Read a Basic CBC Test

Presentation · PPTX


Here's what's inside the 15-slide deck:
SlideContent
1Title slide — bold navy design with subtitle
2What is a CBC? — 3-column card layout (RBC / WBC / Platelets)
3Why is a CBC ordered? — 6 numbered reason tiles
4Section divider — Red Blood Cell Tests (deep red)
5Haemoglobin & Hematocrit — side-by-side tables with normal ranges
6RBC Indices — MCV, MCH, MCHC cards with low/high causes
7Section divider — White Blood Cell Tests (deep blue)
8Total WBC Count — Leukopenia / Normal / Leukocytosis zones
9WBC Differential — full table: Neutrophils, Lymphocytes, Monocytes, Eosinophils, Basophils
10Section divider — Platelet Tests (dark green)
11Platelet Count — Thrombocytopenia vs Thrombocytosis side-by-side
12Complete CBC Quick Reference Table — all values in one view
13Anaemia Classification — Microcytic / Normocytic / Macrocytic with causes
14When to Seek Medical Attention — Critical / Urgent / Routine triage
15Key Takeaways — 5 essential reading principles
The design uses a navy/teal/red medical color palette with distinct color-coded sections for RBC (red), WBC (blue), and Platelets (green).
This is a shared conversation. Sign in to Orris to start your own chat.