Make me a ppt with topic Types of hyperparathyroidism I'm a 4th year Mbbs student Make ppt for surgery class presentation Keep it simple and with images

Reading File
Reading File
Reading File
Finding Sources
Searching the Web

types of hyperparathyroidism primary secondary tertiary surgery MBBS overview

Reading File
Searching the Web

hyperparathyroidism parathyroid gland anatomy diagram image primary secondary tertiary

Reading File
Searching the Web

osteitis fibrosa cystica brown tumor nephrolithiasis hyperparathyroidism bone changes image

Running Command

node /home/daytona/skills/shared/scripts/fetch_images.js \ "https://www.hyperp…

Running Command

node /home/daytona/skills/shared/scripts/fetch_images.js \ "https://pubs.rsna.…

Running Command

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

Writing File

~/hyperparathyroidism-ppt/build.js

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

// ─── Fetch images ───────────────────────────────────────────────────────────
const imgUrls = [
  "https://www.hyperparathyroidmd.com/wp-content/uploads/2021/06/Parathyroid-Gland-Functuion-Figure-1.jpg", // 0 parathyroid anatomy/function
  "https://upload.wikimedia.org/wikipedia/commons/4/45/3D_Medical_Animation_still_shot_Hyperparathyroidism.jpg", // 1 3D hyperparathyroidism
  "https://upload.wikimedia.org/wikipedia/commons/e/e5/Osteitis_fibrosa_cystica_tibiae_X-ray.jpg", // 2 OFC xray
  "https://figures.semanticscholar.org/65a65c939a61ba7379abff1c3dc75a37415ce627/2-Table1-1.png", // 3 comparison table
  "https://media.springernature.com/lw685/springer-static/image/art%3A10.1007%2Fs12020-017-1414-2/MediaObjects/12020_2017_1414_Fig4_HTML.gif", // 4 brown tumor
  "https://media.springernature.com/lw685/springer-static/image/art%3A10.1007%2Fs12020-017-1414-2/MediaObjects/12020_2017_1414_Fig8_HTML.gif", // 5 renal changes
];

const imgData = JSON.parse(
  execSync(
    `node /home/daytona/skills/shared/scripts/fetch_images.js ${imgUrls.map(u => `"${u}"`).join(" ")}`
  ).toString()
);

function img(idx) {
  const d = imgData[idx];
  if (d.error) return null;
  return d.base64;
}

// ─── Presentation setup ─────────────────────────────────────────────────────
const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Types of Hyperparathyroidism";
pres.author = "4th Year MBBS – Surgery Presentation";

// Colour palette
const DARK_BG   = "0D2340";  // deep navy
const ACCENT    = "1E88E5";  // vivid blue
const ACCENT2   = "29B6F6";  // lighter blue
const GOLD      = "FFB300";  // amber accent
const WHITE     = "FFFFFF";
const LIGHTGRAY = "ECF3FA";
const DARK_TEXT = "1A2D45";
const TEAL      = "00ACC1";
const GREEN     = "43A047";
const ORANGE    = "EF6C00";

// ─── Helper functions ────────────────────────────────────────────────────────
function addSlideTitle(slide, text, sub) {
  // top accent bar
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.1, fill: { color: ACCENT } });
  // title bg strip
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0.1, w: 10, h: 0.75, fill: { color: DARK_BG } });
  slide.addText(text, {
    x: 0.3, y: 0.1, w: 9.4, h: 0.75,
    fontSize: 22, bold: true, color: WHITE, valign: "middle", margin: 0
  });
  if (sub) {
    slide.addText(sub, {
      x: 0.3, y: 0.88, w: 9.4, h: 0.28,
      fontSize: 11, color: ACCENT, italic: true, margin: 0
    });
  }
}

function addBullets(slide, items, opts) {
  const base = { fontSize: 13, color: DARK_TEXT, bullet: { indent: 20 }, paraSpaceAfter: 4 };
  slide.addText(
    items.map((item, i) => ({
      text: item,
      options: { ...base, ...(typeof item === "object" ? item.options : {}), bullet: true, breakLine: i < items.length - 1 }
    })),
    { ...opts }
  );
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 1 – TITLE SLIDE
// ══════════════════════════════════════════════════════════════════════════════
{
  const sl = pres.addSlide();
  sl.background = { color: DARK_BG };

  // decorative arcs
  sl.addShape(pres.ShapeType.ellipse, { x: 7.5, y: -1.5, w: 5, h: 5, fill: { color: ACCENT, transparency: 80 }, line: { type: "none" } });
  sl.addShape(pres.ShapeType.ellipse, { x: -1, y: 3,    w: 4, h: 4, fill: { color: ACCENT2, transparency: 85 }, line: { type: "none" } });

  // top line
  sl.addShape(pres.ShapeType.rect, { x: 1, y: 1.6, w: 0.08, h: 2.2, fill: { color: GOLD }, line: { type: "none" } });

  sl.addText("TYPES OF", { x: 1.3, y: 1.6, w: 8, h: 0.5, fontSize: 16, color: ACCENT2, bold: false, charSpacing: 6, margin: 0 });
  sl.addText("HYPERPARATHYROIDISM", { x: 1.3, y: 2.05, w: 8, h: 0.9, fontSize: 36, bold: true, color: WHITE, margin: 0 });
  sl.addText("Primary  |  Secondary  |  Tertiary", { x: 1.3, y: 2.95, w: 8, h: 0.4, fontSize: 16, color: GOLD, margin: 0 });
  sl.addShape(pres.ShapeType.rect, { x: 1.3, y: 3.45, w: 4, h: 0.04, fill: { color: ACCENT }, line: { type: "none" } });

  sl.addText("Surgery Class Presentation  |  4th Year MBBS", { x: 1.3, y: 3.6, w: 7, h: 0.3, fontSize: 11, color: ACCENT2, italic: true, margin: 0 });

  if (img(1)) {
    sl.addImage({ data: img(1), x: 6.6, y: 1.2, w: 3.1, h: 3.8, rounding: true });
  }
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 2 – OVERVIEW: What is Hyperparathyroidism?
// ══════════════════════════════════════════════════════════════════════════════
{
  const sl = pres.addSlide();
  sl.background = { color: LIGHTGRAY };
  addSlideTitle(sl, "What is Hyperparathyroidism?", "Parathyroid gland physiology overview");

  // image left
  if (img(0)) {
    sl.addImage({ data: img(0), x: 0.25, y: 1.2, w: 4.0, h: 3.9 });
  }

  // content right
  const bullets = [
    "4 tiny parathyroid glands sit behind the thyroid",
    "Secrete PTH (Parathyroid Hormone) — 84 amino acid polypeptide",
    "PTH normally raises serum Ca²⁺ and lowers phosphate",
    "Hyperparathyroidism = excess PTH secretion",
    "Subdivided into Primary, Secondary, and Tertiary types",
  ];
  addBullets(sl, bullets, { x: 4.5, y: 1.25, w: 5.2, h: 4.0 });

  // PTH actions box
  sl.addShape(pres.ShapeType.rect, { x: 4.5, y: 3.9, w: 5.2, h: 1.35, fill: { color: ACCENT, transparency: 85 }, line: { color: ACCENT, w: 1 } });
  sl.addText("PTH Actions", { x: 4.55, y: 3.92, w: 5.1, h: 0.28, fontSize: 11, bold: true, color: DARK_BG, margin: 0 });
  sl.addText([
    { text: "Bone: ", options: { bold: true } }, { text: "↑ osteoclast activity → Ca²⁺ release   " },
    { text: "Kidney: ", options: { bold: true } }, { text: "↑ Ca²⁺ reabsorption, ↑ 1,25(OH)₂D synthesis   " },
    { text: "Gut: ", options: { bold: true } }, { text: "↑ Ca²⁺ absorption via calcitriol" },
  ], { x: 4.55, y: 4.22, w: 5.1, h: 1.0, fontSize: 11, color: DARK_TEXT, margin: 0 });

  // bottom accent
  sl.addShape(pres.ShapeType.rect, { x: 0, y: 5.55, w: 10, h: 0.075, fill: { color: ACCENT }, line: { type: "none" } });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 3 – PRIMARY HYPERPARATHYROIDISM
// ══════════════════════════════════════════════════════════════════════════════
{
  const sl = pres.addSlide();
  sl.background = { color: WHITE };
  addSlideTitle(sl, "Primary Hyperparathyroidism", "Autonomous PTH over-secretion by the gland itself");

  // colored label
  sl.addShape(pres.ShapeType.rect, { x: 0.25, y: 1.15, w: 1.8, h: 0.35, fill: { color: ACCENT }, line: { type: "none" } });
  sl.addText("PRIMARY HPT", { x: 0.25, y: 1.15, w: 1.8, h: 0.35, fontSize: 10, bold: true, color: WHITE, align: "center", valign: "middle", margin: 0 });

  const col1 = [
    { text: "Aetiology", options: { bold: true, color: ACCENT, fontSize: 13 } },
    { text: "Adenoma (85%)  •  4-gland hyperplasia (14%)  •  Carcinoma (<1%)", options: { fontSize: 12, color: DARK_TEXT } },
    { text: "\nPathophysiology", options: { bold: true, color: ACCENT, fontSize: 13 } },
    { text: "Autonomous PTH secretion → hypercalcemia\nNegative feedback to Ca²⁺ is lost", options: { fontSize: 12, color: DARK_TEXT } },
    { text: "\nLabs", options: { bold: true, color: ACCENT, fontSize: 13 } },
    { text: "↑ PTH  |  ↑ Serum Ca²⁺  |  ↓ Phosphate\n↑ urinary Ca²⁺  |  ↑ Alk Phos (if bone involved)", options: { fontSize: 12, color: DARK_TEXT } },
    { text: "\nAssociations", options: { bold: true, color: ACCENT, fontSize: 13 } },
    { text: "MEN-1 (parathyroid + pituitary + pancreas)\nMEN-2A (parathyroid + MTC + phaeochromocytoma)", options: { fontSize: 12, color: DARK_TEXT } },
  ];

  sl.addText(col1, { x: 0.25, y: 1.6, w: 4.8, h: 4.0, margin: 4 });

  // right panel with clinical features
  sl.addShape(pres.ShapeType.rect, { x: 5.25, y: 1.15, w: 4.5, h: 4.45, fill: { color: "EBF5FF" }, line: { color: ACCENT, w: 1 } });
  sl.addText("Clinical Features – \"Bones, Stones, Groans, Psychic Moans\"", {
    x: 5.35, y: 1.2, w: 4.3, h: 0.45, fontSize: 11, bold: true, color: DARK_BG, margin: 0
  });

  const features = [
    "🦴 Bones: bone pain, pathological fractures, osteitis fibrosa cystica",
    "🪨 Stones: renal calculi (nephrolithiasis), nephrocalcinosis",
    "😣 Groans: N&V, constipation, peptic ulcer, pancreatitis",
    "🧠 Psychic: depression, confusion, fatigue, cognitive impairment",
    "Most cases now ASYMPTOMATIC — found on routine bloods",
  ];
  addBullets(sl, features, { x: 5.35, y: 1.65, w: 4.3, h: 3.8, fontSize: 11 });

  sl.addShape(pres.ShapeType.rect, { x: 0, y: 5.55, w: 10, h: 0.075, fill: { color: ACCENT }, line: { type: "none" } });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 4 – BONE CHANGES (with X-ray image)
// ══════════════════════════════════════════════════════════════════════════════
{
  const sl = pres.addSlide();
  sl.background = { color: LIGHTGRAY };
  addSlideTitle(sl, "Bone Changes in Primary HPT", "Osteitis Fibrosa Cystica – Skeletal Manifestations");

  if (img(2)) {
    sl.addImage({ data: img(2), x: 5.8, y: 1.2, w: 3.9, h: 4.1 });
    sl.addText("X-ray: OFC – subperiosteal resorption of tibiae", {
      x: 5.8, y: 5.3, w: 3.9, h: 0.25, fontSize: 9, color: DARK_TEXT, italic: true, align: "center", margin: 0
    });
  }

  const boneBullets = [
    "↑ PTH → ↑ RANKL on osteoblasts → ↑ osteoclast activation",
    "Subperiosteal resorption (classic on radial side of middle phalanx)",
    "Generalized osteoporosis: phalanges, vertebrae, proximal femur",
    "Dissecting osteitis – 'railroad track' appearance on histology",
    "Brown Tumors: reactive fibrovascular masses from microfractures + hemorrhage (hemosiderin = brown color)",
    "Cystic degeneration of brown tumors → OSTEITIS FIBROSA CYSTICA",
    "'Salt and pepper skull' – granular skull X-ray",
  ];
  addBullets(sl, boneBullets, { x: 0.25, y: 1.25, w: 5.3, h: 4.3, fontSize: 12 });

  // brown tumor callout
  sl.addShape(pres.ShapeType.rect, { x: 0.25, y: 5.1, w: 5.2, h: 0.45, fill: { color: ORANGE, transparency: 80 }, line: { color: ORANGE, w: 1 } });
  sl.addText("Brown Tumors ≠ true neoplasms; resolve after parathyroidectomy", {
    x: 0.3, y: 5.1, w: 5.1, h: 0.45, fontSize: 11, bold: true, color: ORANGE, valign: "middle", margin: 0
  });

  sl.addShape(pres.ShapeType.rect, { x: 0, y: 5.55, w: 10, h: 0.075, fill: { color: ACCENT }, line: { type: "none" } });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 5 – SECONDARY HYPERPARATHYROIDISM
// ══════════════════════════════════════════════════════════════════════════════
{
  const sl = pres.addSlide();
  sl.background = { color: WHITE };
  addSlideTitle(sl, "Secondary Hyperparathyroidism", "Compensatory PTH rise due to chronic hypocalcemia");

  sl.addShape(pres.ShapeType.rect, { x: 0.25, y: 1.15, w: 2.1, h: 0.35, fill: { color: TEAL }, line: { type: "none" } });
  sl.addText("SECONDARY HPT", { x: 0.25, y: 1.15, w: 2.1, h: 0.35, fontSize: 10, bold: true, color: WHITE, align: "center", valign: "middle", margin: 0 });

  // flow diagram
  const boxStyle = { fill: { color: "E3F2FD" }, line: { color: TEAL, w: 1.5 } };
  const arrowOpts = { color: TEAL, bold: true, align: "center", fontSize: 20 };

  const steps = [
    { text: "Chronic Renal Failure\n(CKD → ↓ 1,25(OH)₂D, hyperphosphatemia)", x: 0.3, y: 1.65, w: 3.5, h: 0.75 },
    { text: "Persistent Hypocalcemia", x: 0.3, y: 2.8, w: 3.5, h: 0.55 },
    { text: "Parathyroid Gland HYPERPLASIA\n(all 4 glands)", x: 0.3, y: 3.7, w: 3.5, h: 0.7 },
    { text: "↑ PTH (REACTIVE / compensatory)\nSerum Ca²⁺ low-normal", x: 0.3, y: 4.7, w: 3.5, h: 0.7 },
  ];

  steps.forEach(s => {
    sl.addShape(pres.ShapeType.rect, { x: s.x, y: s.y, w: s.w, h: s.h, ...boxStyle });
    sl.addText(s.text, { x: s.x + 0.05, y: s.y, w: s.w - 0.1, h: s.h, fontSize: 11, color: DARK_TEXT, valign: "middle", align: "center", margin: 3 });
  });

  // arrows
  [2.42, 3.37, 4.42].forEach(y => {
    sl.addText("↓", { x: 0.3, y, w: 3.5, h: 0.38, ...arrowOpts });
  });

  // right panel – causes
  sl.addShape(pres.ShapeType.rect, { x: 4.1, y: 1.15, w: 5.6, h: 4.45, fill: { color: "E0F7FA" }, line: { color: TEAL, w: 1 } });
  sl.addText("Common Causes", { x: 4.2, y: 1.2, w: 5.4, h: 0.35, fontSize: 13, bold: true, color: TEAL, margin: 0 });

  const causes = [
    "CKD / End-stage renal disease (most common)",
    "Vitamin D deficiency / malabsorption",
    "Osteomalacia / Rickets",
    "Malabsorption syndromes (Crohn's, coeliac)",
    "Hypomagnesemia",
  ];
  addBullets(sl, causes, { x: 4.2, y: 1.6, w: 5.3, h: 1.8, fontSize: 12 });

  sl.addText("Key Distinguishing Features", { x: 4.2, y: 3.5, w: 5.4, h: 0.35, fontSize: 13, bold: true, color: TEAL, margin: 0 });
  sl.addText([
    { text: "PTH: ", options: { bold: true } }, { text: "↑↑   " },
    { text: "Ca²⁺: ", options: { bold: true } }, { text: "Normal or ↓   " },
    { text: "PO₄: ", options: { bold: true } }, { text: "↑ (renal failure)" },
  ], { x: 4.2, y: 3.87, w: 5.3, h: 0.5, fontSize: 12, color: DARK_TEXT, margin: 0 });

  sl.addShape(pres.ShapeType.rect, { x: 4.2, y: 4.45, w: 5.3, h: 0.5, fill: { color: TEAL, transparency: 85 }, line: { color: TEAL, w: 1 } });
  sl.addText("Renal Osteodystrophy: osteomalacia + subperiosteal resorption + OFC", {
    x: 4.2, y: 4.45, w: 5.3, h: 0.5, fontSize: 11, color: DARK_TEXT, valign: "middle", margin: 4
  });

  sl.addShape(pres.ShapeType.rect, { x: 0, y: 5.55, w: 10, h: 0.075, fill: { color: TEAL }, line: { type: "none" } });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 6 – TERTIARY HYPERPARATHYROIDISM
// ══════════════════════════════════════════════════════════════════════════════
{
  const sl = pres.addSlide();
  sl.background = { color: LIGHTGRAY };
  addSlideTitle(sl, "Tertiary Hyperparathyroidism", "Autonomous PTH secretion after prolonged secondary HPT");

  sl.addShape(pres.ShapeType.rect, { x: 0.25, y: 1.15, w: 2.0, h: 0.35, fill: { color: ORANGE }, line: { type: "none" } });
  sl.addText("TERTIARY HPT", { x: 0.25, y: 1.15, w: 2.0, h: 0.35, fontSize: 10, bold: true, color: WHITE, align: "center", valign: "middle", margin: 0 });

  // evolution diagram
  sl.addText("Evolution: Secondary → Tertiary HPT", { x: 0.25, y: 1.6, w: 9.5, h: 0.3, fontSize: 13, bold: true, color: DARK_BG, margin: 0 });

  const evo = [
    { label: "Secondary HPT\n(prolonged)", color: TEAL, x: 0.3 },
    { label: "Persistent\nstimulation", color: "888888", x: 2.5 },
    { label: "Autonomous\nadenoma forms", color: ORANGE, x: 4.7 },
    { label: "Tertiary HPT\n(autonomous)", color: "C62828", x: 6.9 },
  ];
  evo.forEach((e, i) => {
    sl.addShape(pres.ShapeType.rect, { x: e.x, y: 2.0, w: 2.0, h: 0.7, fill: { color: e.color }, line: { type: "none" } });
    sl.addText(e.label, { x: e.x, y: 2.0, w: 2.0, h: 0.7, fontSize: 10, bold: true, color: WHITE, align: "center", valign: "middle", margin: 0 });
    if (i < 3) sl.addText("→", { x: e.x + 1.98, y: 2.0, w: 0.52, h: 0.7, fontSize: 20, bold: true, color: DARK_BG, align: "center", valign: "middle", margin: 0 });
  });

  const col1 = [
    { text: "Pathophysiology", options: { bold: true, color: ORANGE, fontSize: 13 } },
    { text: "Prolonged stimulation of parathyroid glands (in secondary HPT) leads to monoclonal expansion and autonomous PTH secretion, even after correction of the underlying cause (e.g. renal transplant).", options: { fontSize: 12, color: DARK_TEXT } },
    { text: "\nTrigger / Context", options: { bold: true, color: ORANGE, fontSize: 13 } },
    { text: "Seen in long-standing CKD or post-renal transplant patients\nGland becomes independent of Ca²⁺ feedback", options: { fontSize: 12, color: DARK_TEXT } },
    { text: "\nLabs", options: { bold: true, color: ORANGE, fontSize: 13 } },
    { text: "↑↑ PTH   |   ↑ Ca²⁺ (hypercalcemia – like primary)\nLooks like primary HPT in a renal failure patient", options: { fontSize: 12, color: DARK_TEXT } },
  ];
  sl.addText(col1, { x: 0.25, y: 2.85, w: 4.8, h: 2.7, margin: 4 });

  // right box
  sl.addShape(pres.ShapeType.rect, { x: 5.2, y: 2.85, w: 4.5, h: 2.7, fill: { color: "FFF3E0" }, line: { color: ORANGE, w: 1 } });
  sl.addText("Treatment Insight", { x: 5.3, y: 2.9, w: 4.3, h: 0.35, fontSize: 13, bold: true, color: ORANGE, margin: 0 });
  const txBullets = [
    "Subtotal parathyroidectomy (3.5 glands removed)",
    "Total parathyroidectomy + autotransplant",
    "Occurs even after successful renal transplant",
    "Distinguish from primary HPT by history of CKD/dialysis",
  ];
  addBullets(sl, txBullets, { x: 5.3, y: 3.3, w: 4.3, h: 2.15, fontSize: 12 });

  sl.addShape(pres.ShapeType.rect, { x: 0, y: 5.55, w: 10, h: 0.075, fill: { color: ORANGE }, line: { type: "none" } });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 7 – COMPARISON TABLE
// ══════════════════════════════════════════════════════════════════════════════
{
  const sl = pres.addSlide();
  sl.background = { color: WHITE };
  addSlideTitle(sl, "Comparison at a Glance", "Primary  vs  Secondary  vs  Tertiary");

  const rows = [
    [
      { text: "Feature",        options: { bold: true, color: WHITE, fill: { color: DARK_BG } } },
      { text: "Primary",        options: { bold: true, color: WHITE, fill: { color: ACCENT  } } },
      { text: "Secondary",      options: { bold: true, color: WHITE, fill: { color: TEAL    } } },
      { text: "Tertiary",       options: { bold: true, color: WHITE, fill: { color: ORANGE  } } },
    ],
    ["Cause",               "Adenoma / Hyperplasia / Ca",      "CKD / Vit D def",          "Prolonged 2° HPT"],
    ["Feedback",            "Autonomous (lost feedback)",      "Reactive (appropriate)",   "Autonomous (like 1°)"],
    ["PTH",                 "↑",                               "↑↑",                       "↑↑"],
    ["Serum Ca²⁺",         "↑ (hypercalcemia)",               "Low / Normal",             "↑ (hypercalcemia)"],
    ["Phosphate",           "↓",                               "↑ (renal failure)",        "Variable"],
    ["Glands",              "Single adenoma (usually)",        "All 4 hyperplastic",       "1–2 autonomous glands"],
    ["Treatment",           "Parathyroidectomy (single gland)","Treat underlying cause\n± cinacalcet", "Subtotal PTX or total + autograft"],
  ];

  const colW = [2.1, 2.4, 2.4, 2.6];
  const colX = [0.25, 2.35, 4.75, 7.15];

  rows.forEach((row, r) => {
    row.forEach((cell, c) => {
      const isHeader = r === 0;
      const isFeatureCol = c === 0 && r > 0;
      const cellText = typeof cell === "object" ? cell.text : cell;
      const cellBg = isHeader
        ? (typeof cell === "object" ? cell.options.fill.color : DARK_BG)
        : isFeatureCol ? "F0F4F8" : (r % 2 === 0 ? WHITE : "F7FAFF");

      sl.addShape(pres.ShapeType.rect, {
        x: colX[c], y: 1.25 + r * 0.53, w: colW[c], h: 0.53,
        fill: { color: cellBg }, line: { color: "D0D8E4", w: 0.5 }
      });
      sl.addText(cellText, {
        x: colX[c] + 0.05, y: 1.25 + r * 0.53, w: colW[c] - 0.1, h: 0.53,
        fontSize: 10, color: isHeader ? WHITE : DARK_TEXT,
        bold: isHeader || isFeatureCol, valign: "middle", align: "center", margin: 2
      });
    });
  });

  sl.addShape(pres.ShapeType.rect, { x: 0, y: 5.55, w: 10, h: 0.075, fill: { color: ACCENT }, line: { type: "none" } });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 8 – DIAGNOSIS
// ══════════════════════════════════════════════════════════════════════════════
{
  const sl = pres.addSlide();
  sl.background = { color: LIGHTGRAY };
  addSlideTitle(sl, "Diagnosis of Hyperparathyroidism", "Clinical + Biochemical + Imaging approach");

  const diagBoxes = [
    { title: "History", color: ACCENT, items: ["Renal stones, fractures, abdominal pain", "Family history of MEN syndromes", "CKD / long-term dialysis", "Incidental hypercalcemia on bloods"] },
    { title: "Biochemistry", color: TEAL, items: ["↑ Serum PTH (intact PTH assay)", "Serum Ca²⁺ and albumin (corrected Ca)", "Serum phosphate, Mg²⁺, ALP", "24-hr urinary calcium", "Vit D (25-OH-D) levels"] },
    { title: "Imaging", color: ORANGE, items: ["USG neck – adenoma detection", "Sestamibi (Tc-99m) scan – gold standard localisation", "4D-CT / SPECT-CT", "DEXA scan for bone density"] },
  ];

  diagBoxes.forEach((b, i) => {
    const x = 0.25 + i * 3.2;
    sl.addShape(pres.ShapeType.rect, { x, y: 1.2, w: 3.0, h: 0.4, fill: { color: b.color }, line: { type: "none" } });
    sl.addText(b.title, { x, y: 1.2, w: 3.0, h: 0.4, fontSize: 13, bold: true, color: WHITE, align: "center", valign: "middle", margin: 0 });
    sl.addShape(pres.ShapeType.rect, { x, y: 1.6, w: 3.0, h: 3.95, fill: { color: WHITE }, line: { color: b.color, w: 1 } });
    addBullets(sl, b.items, { x: x + 0.05, y: 1.65, w: 2.9, h: 3.85, fontSize: 11 });
  });

  sl.addShape(pres.ShapeType.rect, { x: 0, y: 5.55, w: 10, h: 0.075, fill: { color: ACCENT }, line: { type: "none" } });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 9 – MANAGEMENT / SURGERY
// ══════════════════════════════════════════════════════════════════════════════
{
  const sl = pres.addSlide();
  sl.background = { color: WHITE };
  addSlideTitle(sl, "Management & Surgical Treatment", "When to operate and what to do");

  // medical
  sl.addShape(pres.ShapeType.rect, { x: 0.25, y: 1.15, w: 4.5, h: 0.38, fill: { color: TEAL }, line: { type: "none" } });
  sl.addText("Medical Management (asymptomatic / temporising)", { x: 0.3, y: 1.15, w: 4.4, h: 0.38, fontSize: 11, bold: true, color: WHITE, valign: "middle", margin: 0 });
  const medItems = [
    "Hydration + loop diuretics (acute hypercalcaemia)",
    "Bisphosphonates – protect bone density",
    "Cinacalcet (calcimimetic) – for secondary HPT",
    "Vit D + phosphate binders (secondary HPT/CKD)",
    "Monitor Ca²⁺, renal function, bone density",
  ];
  addBullets(sl, medItems, { x: 0.3, y: 1.6, w: 4.4, h: 2.0, fontSize: 12 });

  // indications for surgery
  sl.addShape(pres.ShapeType.rect, { x: 0.25, y: 3.65, w: 4.5, h: 0.38, fill: { color: ACCENT }, line: { type: "none" } });
  sl.addText("Indications for Surgery (Primary HPT)", { x: 0.3, y: 3.65, w: 4.4, h: 0.38, fontSize: 11, bold: true, color: WHITE, valign: "middle", margin: 0 });
  const surgInd = [
    "Symptomatic HPT (stones, bones, groans)",
    "Serum Ca²⁺ > 1 mg/dL above normal",
    "Osteoporosis (T-score ≤ −2.5)",
    "eGFR < 60 mL/min",
    "Age < 50 years",
  ];
  addBullets(sl, surgInd, { x: 0.3, y: 4.1, w: 4.4, h: 1.45, fontSize: 12 });

  // surgical types
  sl.addShape(pres.ShapeType.rect, { x: 4.95, y: 1.15, w: 4.8, h: 4.45, fill: { color: "EBF5FF" }, line: { color: ACCENT, w: 1 } });
  sl.addText("Surgical Procedures", { x: 5.05, y: 1.2, w: 4.6, h: 0.38, fontSize: 13, bold: true, color: DARK_BG, margin: 0 });

  const surgProc = [
    { title: "Primary HPT", detail: "Focused minimally invasive parathyroidectomy (MIPTH) – excise single adenoma; bilateral neck exploration if multiglandular" },
    { title: "Secondary HPT", detail: "Subtotal parathyroidectomy (remove 3.5 glands) OR total parathyroidectomy with autotransplant to forearm" },
    { title: "Tertiary HPT", detail: "Subtotal or total parathyroidectomy + autotransplant; urgent in post-transplant hypercalcemia" },
    { title: "Intraoperative PTH (ioPTH)", detail: "Drop >50% from baseline = successful resection (Miami criterion)" },
  ];

  surgProc.forEach((p, i) => {
    sl.addShape(pres.ShapeType.rect, { x: 5.05, y: 1.65 + i * 0.95, w: 1.5, h: 0.82, fill: { color: ACCENT }, line: { type: "none" } });
    sl.addText(p.title, { x: 5.05, y: 1.65 + i * 0.95, w: 1.5, h: 0.82, fontSize: 10, bold: true, color: WHITE, align: "center", valign: "middle", margin: 0 });
    sl.addText(p.detail, { x: 6.6, y: 1.68 + i * 0.95, w: 3.05, h: 0.78, fontSize: 10, color: DARK_TEXT, valign: "middle", margin: 2 });
  });

  sl.addShape(pres.ShapeType.rect, { x: 0, y: 5.55, w: 10, h: 0.075, fill: { color: ACCENT }, line: { type: "none" } });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 10 – KEY TAKEAWAYS + SUMMARY
// ══════════════════════════════════════════════════════════════════════════════
{
  const sl = pres.addSlide();
  sl.background = { color: DARK_BG };

  sl.addShape(pres.ShapeType.ellipse, { x: 7.5, y: -1, w: 4.5, h: 4.5, fill: { color: ACCENT, transparency: 85 }, line: { type: "none" } });
  sl.addShape(pres.ShapeType.ellipse, { x: -1.5, y: 3.5, w: 4, h: 4, fill: { color: TEAL, transparency: 85 }, line: { type: "none" } });

  sl.addText("KEY TAKEAWAYS", { x: 0.4, y: 0.2, w: 9, h: 0.5, fontSize: 14, bold: true, color: GOLD, charSpacing: 6, margin: 0 });
  sl.addText("Types of Hyperparathyroidism", { x: 0.4, y: 0.68, w: 9, h: 0.55, fontSize: 26, bold: true, color: WHITE, margin: 0 });
  sl.addShape(pres.ShapeType.rect, { x: 0.4, y: 1.25, w: 3.5, h: 0.05, fill: { color: GOLD }, line: { type: "none" } });

  const takeaways = [
    { label: "1°", color: ACCENT, text: "Autonomous PTH from adenoma → hypercalcemia. Definitive Rx = parathyroidectomy." },
    { label: "2°", color: TEAL,   text: "Reactive HPT to chronic hypocalcemia (usually CKD). Treat underlying cause ± surgery." },
    { label: "3°", color: ORANGE, text: "Autonomy develops after prolonged 2° HPT. Hypercalcemia despite correction of cause." },
    { label: "🦴", color: GOLD,   text: "Bones: OFC & brown tumors; 🪨 Stones: nephrolithiasis; 😣 Groans; 🧠 Psychic moans" },
    { label: "🔬", color: "A5D6A7", text: "Diagnosis: ↑ PTH + ↑ Ca²⁺ (1° & 3°); ↑ PTH + ↓/N Ca²⁺ (2°). Localise with sestamibi." },
  ];

  takeaways.forEach((t, i) => {
    sl.addShape(pres.ShapeType.rect, { x: 0.4, y: 1.45 + i * 0.75, w: 0.55, h: 0.6, fill: { color: t.color }, line: { type: "none" } });
    sl.addText(t.label, { x: 0.4, y: 1.45 + i * 0.75, w: 0.55, h: 0.6, fontSize: 14, bold: true, color: WHITE, align: "center", valign: "middle", margin: 0 });
    sl.addText(t.text, { x: 1.05, y: 1.48 + i * 0.75, w: 8.6, h: 0.6, fontSize: 12, color: WHITE, valign: "middle", margin: 0 });
  });

  sl.addText("Thank you — Any Questions?", { x: 0.4, y: 5.28, w: 9, h: 0.3, fontSize: 12, color: GOLD, italic: true, margin: 0 });
}

// ─── Write file ──────────────────────────────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/workspace/hyperparathyroidism-ppt/Hyperparathyroidism_Types.pptx" })
  .then(() => console.log("DONE"))
  .catch(e => { console.error(e); process.exit(1); });
Running Command

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

Running Command

cd /home/daytona/workspace/hyperparathyroidism-ppt && \ node /home/daytona/skill…

Editing File

~/hyperparathyroidism-ppt/build.js

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

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

Running Command

ls -lh /home/daytona/workspace/hyperparathyroidism-ppt/Hyperparathyroidism_Types…

Your presentation is ready! Here's the download link:

Hyperparathyroidism Types

Presentation · PPTX


Here's what's inside (10 slides, navy/blue surgical theme with real images):
SlideContent
1Title slide - with parathyroid 3D anatomy image
2What is Hyperparathyroidism? - PTH physiology, gland location, with parathyroid function diagram
3Primary HPT - adenoma/hyperplasia, "Bones Stones Groans Psychic Moans" mnemonic, MEN associations
4Bone Changes - OFC, brown tumors, dissecting osteitis, with real X-ray image
5Secondary HPT - CKD cascade flowchart, all 4 gland hyperplasia, renal osteodystrophy
6Tertiary HPT - evolution diagram (2° → 3°), post-transplant context, treatment options
7Comparison Table - Primary vs Secondary vs Tertiary side by side (PTH, Ca²⁺, PO₄, glands, treatment)
8Diagnosis - History / Biochemistry / Imaging in 3-column layout
9Management & Surgery - indications for surgery, procedures (MIPTx, subtotal PTX, ioPTH Miami criterion)
10Key Takeaways - dark summary slide with all 3 types + mnemonics
Content sourced from Robbins & Kumar Basic Pathology and cross-referenced with current surgical guidelines. Good luck with the presentation!
This is a shared conversation. Sign in to Orris to start your own chat.