can you make a ppt on uterine myoma

Reading File
Reading File
Reading File
Finding Sources
Searching Images

uterine myoma fibroid leiomyoma

Finding Sources
Searching Images

uterine fibroid types classification submucosal subserosal intramural diagram

Reading File
Reading File
Reading File
Finding Sources
Searching Images

uterine fibroid histology pathology gross specimen

Running Command

ls -la /home/daytona/workspace/ && mkdir -p /home/daytona/workspace/uterine-myoma-ppt

Running Command

mkdir -p /home/daytona/workspace/uterine-myoma-ppt && ls /home/daytona/workspace/

Writing File

~/uterine-myoma-ppt/create_ppt.js

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

// Fetch images
const imageUrls = [
  "https://cdn.orris.care/cdss_images/BAILY_1760535777660_547912ec-2990-4df1-ab9a-1cd9b191ec81.png",   // fibroid types diagram
  "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_f14e8f4a8983c1ccd8db31ede8830cd29a192b309fea7118fd534975bc71cf2f.jpg", // FIGO classification
  "https://cdn.orris.care/cdss_images/Pathology_1760056828137_2c0ce550-3a56-45da-88a1-11386eda752f.jpg",  // gross pathology whorled
  "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_ea9f3abaf6cf16b3c23061bf65f1e3f00ebb08a6354a9567a0fc049bc514a2a1.jpg", // surgical specimen
  "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_e9d7e77a3f6f68d16b86b07372724968863fa45b027e3c0cabec50c0ed957c27.jpg", // MRI before/after treatment
];

console.log("Fetching images...");
let images;
try {
  images = JSON.parse(
    execSync(
      `node /home/daytona/skills/shared/scripts/fetch_images.js ${imageUrls.map(u => `"${u}"`).join(" ")}`,
      { maxBuffer: 50 * 1024 * 1024 }
    ).toString()
  );
  console.log("Images fetched:", images.map(i => i.error ? "ERROR: " + i.error : "OK"));
} catch (e) {
  console.error("Image fetch failed:", e.message);
  images = imageUrls.map(url => ({ url, base64: null, error: e.message }));
}

const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Uterine Myoma (Leiomyoma)";
pres.author = "Orris Medical";

// ─── COLOR PALETTE ───────────────────────────────────────────────────────────
const C = {
  deep:    "1A2B4A",   // deep navy — dominant
  mid:     "2D5F8A",   // mid-blue accent
  accent:  "E8734A",   // warm orange accent
  light:   "EAF2FB",   // very light blue bg
  white:   "FFFFFF",
  subhead: "5A8CC2",   // muted blue for subheadings
  text:    "1E2D3D",   // dark navy text
  muted:   "6B7F94",
};

// ─── HELPER FUNCTIONS ────────────────────────────────────────────────────────
function addSlideHeader(slide, title, subtitle = "") {
  // Top bar
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.75, fill: { color: C.deep } });
  slide.addText(title, {
    x: 0.35, y: 0, w: 9.3, h: 0.75,
    fontSize: 22, bold: true, color: C.white, valign: "middle", margin: 0,
  });
  if (subtitle) {
    slide.addShape(pres.ShapeType.rect, { x: 0, y: 0.75, w: 10, h: 0.35, fill: { color: C.mid } });
    slide.addText(subtitle, {
      x: 0.35, y: 0.75, w: 9.3, h: 0.35,
      fontSize: 12, color: C.white, valign: "middle", margin: 0, italic: true,
    });
  }
  // Bottom accent line
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 5.42, w: 10, h: 0.2, fill: { color: C.accent } });
}

function bulletItems(items) {
  return items.map((item, i) => [
    { text: item.text, options: { bold: item.bold || false, breakLine: false } },
    ...(i < items.length - 1 ? [{ text: "", options: { breakLine: true } }] : [])
  ]).flat();
}

// ──────────────────────────────────────────────────────────────────────────────
// SLIDE 1 — TITLE SLIDE
// ──────────────────────────────────────────────────────────────────────────────
{
  const slide = pres.addSlide();
  // Background gradient via shape
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.deep } });
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 3.5, w: 10, h: 2.125, fill: { color: C.mid } });
  // Decorative accent bar
  slide.addShape(pres.ShapeType.rect, { x: 0.5, y: 1.6, w: 0.12, h: 2.4, fill: { color: C.accent } });
  // Title
  slide.addText("UTERINE MYOMA", {
    x: 0.8, y: 1.3, w: 8.5, h: 1.1,
    fontSize: 48, bold: true, color: C.white, charSpacing: 4,
  });
  // Subtitle
  slide.addText("Leiomyoma · Fibroid", {
    x: 0.8, y: 2.4, w: 6, h: 0.6,
    fontSize: 22, italic: true, color: "A8D4F5",
  });
  // Tagline
  slide.addText("Pathology · Classification · Clinical Features · Management", {
    x: 0.8, y: 3.1, w: 8, h: 0.45,
    fontSize: 13, color: "C5DCF0",
  });
  // Bottom box
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 4.9, w: 10, h: 0.7, fill: { color: "0E1C30" } });
  slide.addText("Gynecology & Obstetrics  |  Evidence-Based Review", {
    x: 0, y: 4.9, w: 10, h: 0.7,
    fontSize: 11, color: C.muted, align: "center", valign: "middle",
  });
}

// ──────────────────────────────────────────────────────────────────────────────
// SLIDE 2 — OVERVIEW / TABLE OF CONTENTS
// ──────────────────────────────────────────────────────────────────────────────
{
  const slide = pres.addSlide();
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.light } });
  addSlideHeader(slide, "Overview", "Topics Covered");

  const topics = [
    { num: "01", title: "Definition & Epidemiology" },
    { num: "02", title: "Pathogenesis & Etiology" },
    { num: "03", title: "Classification (FIGO)" },
    { num: "04", title: "Clinical Features & Symptoms" },
    { num: "05", title: "Diagnosis & Imaging" },
    { num: "06", title: "Gross & Histopathology" },
    { num: "07", title: "Complications" },
    { num: "08", title: "Management" },
    { num: "09", title: "Surgical Options" },
    { num: "10", title: "Uterine Artery Embolization" },
  ];

  const cols = [topics.slice(0, 5), topics.slice(5)];
  cols.forEach((col, ci) => {
    col.forEach((t, ri) => {
      const x = 0.5 + ci * 4.9;
      const y = 1.25 + ri * 0.77;
      slide.addShape(pres.ShapeType.rect, { x, y, w: 4.5, h: 0.65, fill: { color: C.mid }, line: { color: C.mid } });
      slide.addText([
        { text: t.num + "  ", options: { bold: true, color: C.accent } },
        { text: t.title, options: { color: C.white } },
      ], { x: x + 0.15, y, w: 4.2, h: 0.65, fontSize: 13, valign: "middle" });
    });
  });
}

// ──────────────────────────────────────────────────────────────────────────────
// SLIDE 3 — DEFINITION & EPIDEMIOLOGY
// ──────────────────────────────────────────────────────────────────────────────
{
  const slide = pres.addSlide();
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.white } });
  addSlideHeader(slide, "Definition & Epidemiology");

  // Definition box
  slide.addShape(pres.ShapeType.rect, { x: 0.4, y: 1.15, w: 9.2, h: 0.95, fill: { color: C.light }, line: { color: C.mid, pt: 1.5 } });
  slide.addText([
    { text: "Definition: ", options: { bold: true, color: C.accent } },
    { text: "A benign monoclonal smooth muscle tumor originating from the myometrium of the uterus. Also known as leiomyoma or fibroid.", options: { color: C.text } },
  ], { x: 0.6, y: 1.15, w: 8.8, h: 0.95, fontSize: 13.5, valign: "middle" });

  // Stats row
  const stats = [
    { val: "20–40%", label: "reproductive-age\nwomen affected" },
    { val: "50%", label: "Black women\nhave fibroids" },
    { val: "25%", label: "White women\nhave fibroids" },
    { val: "30%", label: "become\nsymptomatic" },
  ];
  stats.forEach((s, i) => {
    const x = 0.4 + i * 2.3;
    slide.addShape(pres.ShapeType.rect, { x, y: 2.3, w: 2.1, h: 1.15, fill: { color: C.deep }, line: { color: C.deep } });
    slide.addText(s.val, { x, y: 2.35, w: 2.1, h: 0.55, fontSize: 24, bold: true, color: C.accent, align: "center" });
    slide.addText(s.label, { x, y: 2.9, w: 2.1, h: 0.55, fontSize: 10, color: C.white, align: "center" });
  });

  // Key facts
  slide.addText("Key Facts", { x: 0.4, y: 3.65, w: 3, h: 0.3, fontSize: 13, bold: true, color: C.mid });
  const facts = [
    "Most common benign pelvic tumor in women",
    "Peak incidence: 30–40 years of age",
    "Detected in 3–4% of mid-trimester ultrasound evaluations",
    "Growth stimulated by estrogen & progesterone",
    "Rare before menarche; regress after menopause",
    "More prevalent and symptomatic in African-American women",
  ];
  slide.addText(
    facts.map((f, i) => [
      { text: f, options: { bullet: true, breakLine: i < facts.length - 1 } }
    ]).flat().flat(),
    { x: 0.4, y: 3.95, w: 9.2, h: 1.4, fontSize: 12, color: C.text }
  );
}

// ──────────────────────────────────────────────────────────────────────────────
// SLIDE 4 — PATHOGENESIS & ETIOLOGY
// ──────────────────────────────────────────────────────────────────────────────
{
  const slide = pres.addSlide();
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.white } });
  addSlideHeader(slide, "Pathogenesis & Etiology");

  // Two-column layout
  const leftItems = [
    { heading: "Origin", points: ["Monoclonal smooth muscle tumors from myometrium", "Single transformed myocyte with clonal expansion", "Multiple fibroids likely have different clonal origins"] },
    { heading: "Hormonal Drivers", points: ["Estrogen stimulates fibroid growth", "Progesterone promotes proliferation", "GnRH regulates; anti-hormonal therapy shrinks fibroids"] },
  ];

  const rightItems = [
    { heading: "Risk Factors", points: ["Early menarche", "Nulliparity", "Obesity / high BMI", "African-American ethnicity", "Family history", "Diet high in red meat; low in green vegetables", "Alcohol / caffeine use"] },
    { heading: "Protective Factors", points: ["Multiparity", "Oral contraceptive use (controversial)", "Physical activity"] },
  ];

  let y = 1.15;
  leftItems.forEach(item => {
    slide.addText(item.heading, { x: 0.4, y, w: 4.5, h: 0.28, fontSize: 13, bold: true, color: C.mid });
    y += 0.28;
    item.points.forEach(p => {
      slide.addText([{ text: p, options: { bullet: true } }], { x: 0.4, y, w: 4.5, h: 0.3, fontSize: 11, color: C.text });
      y += 0.3;
    });
    y += 0.12;
  });

  y = 1.15;
  rightItems.forEach(item => {
    slide.addText(item.heading, { x: 5.1, y, w: 4.5, h: 0.28, fontSize: 13, bold: true, color: C.mid });
    y += 0.28;
    item.points.forEach(p => {
      slide.addText([{ text: p, options: { bullet: true } }], { x: 5.1, y, w: 4.5, h: 0.3, fontSize: 11, color: C.text });
      y += 0.3;
    });
    y += 0.12;
  });

  // Vertical divider
  slide.addShape(pres.ShapeType.line, { x: 5.0, y: 1.1, w: 0, h: 4.1, line: { color: C.subhead, pt: 1, dashType: "dash" } });
}

// ──────────────────────────────────────────────────────────────────────────────
// SLIDE 5 — CLASSIFICATION (FIGO) with image
// ──────────────────────────────────────────────────────────────────────────────
{
  const slide = pres.addSlide();
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.white } });
  addSlideHeader(slide, "Classification — FIGO System", "Location-based classification of uterine fibroids");

  const types = [
    { type: "Type 0", name: "Pedunculated Submucosal", desc: "Entirely within uterine cavity on a stalk" },
    { type: "Type 1", name: "Submucosal >50%", desc: ">50% protrudes into cavity" },
    { type: "Type 2", name: "Submucosal <50%", desc: "<50% protrudes into cavity (intramural portion dominant)" },
    { type: "Type 3", name: "Intramural (contact endometrium)", desc: "Entirely intramural, contacts endometrium" },
    { type: "Type 4", name: "Intramural", desc: "Entirely within myometrium" },
    { type: "Type 5", name: "Subserosal ≥50%", desc: "≥50% within myometrium" },
    { type: "Type 6", name: "Subserosal <50%", desc: "<50% within myometrium (serosal dominant)" },
    { type: "Type 7", name: "Pedunculated Subserosal", desc: "Attached by stalk to serosal surface" },
    { type: "Type 8", name: "Other", desc: "Cervical, parasitic, or distant location" },
  ];

  // Table
  const tblX = 0.35, tblY = 1.2;
  const rowH = 0.38;
  // Header row
  slide.addShape(pres.ShapeType.rect, { x: tblX, y: tblY, w: 9.3, h: 0.38, fill: { color: C.deep } });
  slide.addText("Type", { x: tblX + 0.05, y: tblY, w: 0.7, h: rowH, fontSize: 11, bold: true, color: C.white, valign: "middle" });
  slide.addText("Category", { x: tblX + 0.75, y: tblY, w: 2.2, h: rowH, fontSize: 11, bold: true, color: C.white, valign: "middle" });
  slide.addText("Description", { x: tblX + 2.95, y: tblY, w: 6.7, h: rowH, fontSize: 11, bold: true, color: C.white, valign: "middle" });

  types.forEach((t, i) => {
    const ry = tblY + rowH + i * rowH;
    const bg = i % 2 === 0 ? C.light : C.white;
    const typeColors = i < 3 ? "1A6B3C" : i < 5 ? "1A5B8A" : "8A3A1A";  // green=sub, blue=intra, brown=sub-serosal
    slide.addShape(pres.ShapeType.rect, { x: tblX, y: ry, w: 9.3, h: rowH, fill: { color: bg }, line: { color: "DDDDDD", pt: 0.5 } });
    slide.addText(t.type, { x: tblX + 0.05, y: ry, w: 0.7, h: rowH, fontSize: 10, bold: true, color: typeColors, valign: "middle" });
    slide.addText(t.name, { x: tblX + 0.75, y: ry, w: 2.2, h: rowH, fontSize: 10, color: C.text, valign: "middle" });
    slide.addText(t.desc, { x: tblX + 2.95, y: ry, w: 6.7, h: rowH, fontSize: 10, color: C.muted, valign: "middle" });
  });
}

// ──────────────────────────────────────────────────────────────────────────────
// SLIDE 6 — FIBROID TYPES DIAGRAM (image slide)
// ──────────────────────────────────────────────────────────────────────────────
{
  const slide = pres.addSlide();
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.deep } });
  addSlideHeader(slide, "Fibroid Locations — Anatomical Overview");

  // Left: image
  const img0 = images[0];  // Bailey anatomy diagram
  if (img0 && !img0.error && img0.base64) {
    slide.addImage({ data: img0.base64, x: 0.3, y: 0.95, w: 5.2, h: 4.4 });
  }

  // Right: legend
  const legends = [
    { color: "3498DB", label: "Intramural", desc: "Within the uterine muscular wall. Most common type." },
    { color: "27AE60", label: "Submucosal", desc: "Below the endometrial lining. Most symptomatic — causes heavy bleeding." },
    { color: "E67E22", label: "Subserosal", desc: "Beneath the serosal surface — causes pelvic bulk/pressure." },
    { color: "9B59B6", label: "Pedunculated", desc: "Attached by a stalk — can be submucosal or subserosal." },
  ];
  legends.forEach((l, i) => {
    const y = 1.35 + i * 0.9;
    slide.addShape(pres.ShapeType.rect, { x: 5.8, y, w: 0.18, h: 0.55, fill: { color: l.color } });
    slide.addText(l.label, { x: 6.1, y, w: 3.7, h: 0.28, fontSize: 13, bold: true, color: C.white });
    slide.addText(l.desc, { x: 6.1, y: y + 0.27, w: 3.7, h: 0.32, fontSize: 10.5, color: "C5DCF0" });
  });
}

// ──────────────────────────────────────────────────────────────────────────────
// SLIDE 7 — CLINICAL FEATURES
// ──────────────────────────────────────────────────────────────────────────────
{
  const slide = pres.addSlide();
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.white } });
  addSlideHeader(slide, "Clinical Features", "Signs & Symptoms by Location");

  const boxes = [
    {
      title: "Menstrual Symptoms",
      color: C.deep,
      items: ["Menorrhagia (heavy menstrual bleeding)", "Dysmenorrhea (painful periods)", "Intermenstrual bleeding", "Iron-deficiency anemia (chronic)", "Dyspareunia"],
    },
    {
      title: "Bulk / Pressure Symptoms",
      color: "1A6B6B",
      items: ["Pelvic pressure or fullness", "Urinary frequency / retention", "Constipation", "Abdominal distension", "Enlarged uterus on exam"],
    },
    {
      title: "Reproductive Complications",
      color: "6B1A1A",
      items: ["Subfertility / infertility", "Recurrent pregnancy loss", "Preterm labor", "Placenta previa (OR 2.2)", "Placental abruption (OR 2.6)", "Fetal malpresentation"],
    },
    {
      title: "Acute Symptoms",
      color: C.accent,
      items: ["Red degeneration (pregnancy)", "Torsion of pedunculated fibroid", "Acute urinary retention", "Severe acute pelvic pain", "Fever & leukocytosis (degeneration)"],
    },
  ];

  boxes.forEach((box, i) => {
    const x = 0.3 + (i % 2) * 4.85;
    const y = 1.1 + Math.floor(i / 2) * 2.2;
    slide.addShape(pres.ShapeType.rect, { x, y, w: 4.55, h: 0.38, fill: { color: box.color } });
    slide.addText(box.title, { x: x + 0.1, y, w: 4.35, h: 0.38, fontSize: 12, bold: true, color: C.white, valign: "middle" });
    slide.addShape(pres.ShapeType.rect, { x, y: y + 0.38, w: 4.55, h: 1.72, fill: { color: C.light }, line: { color: box.color, pt: 1 } });
    slide.addText(
      box.items.map((item, idx) => [
        { text: item, options: { bullet: true, breakLine: idx < box.items.length - 1 } }
      ]).flat().flat(),
      { x: x + 0.1, y: y + 0.38, w: 4.35, h: 1.72, fontSize: 11, color: C.text, valign: "top" }
    );
  });

  // Note: 50% asymptomatic
  slide.addShape(pres.ShapeType.rect, { x: 0.3, y: 5.14, w: 9.4, h: 0.28, fill: { color: "FFF3E0" }, line: { color: C.accent, pt: 1 } });
  slide.addText("★  Note: ~50–70% of fibroids are asymptomatic and require no treatment", {
    x: 0.4, y: 5.14, w: 9.2, h: 0.28, fontSize: 10.5, color: C.accent, bold: true, valign: "middle",
  });
}

// ──────────────────────────────────────────────────────────────────────────────
// SLIDE 8 — DIAGNOSIS & IMAGING
// ──────────────────────────────────────────────────────────────────────────────
{
  const slide = pres.addSlide();
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.white } });
  addSlideHeader(slide, "Diagnosis & Imaging");

  // Left column — modalities
  const modalities = [
    {
      icon: "🔬", title: "Pelvic Ultrasound (First-Line)",
      points: ["Sensitivity ≈ MRI for detecting fibroids", "Well-defined, hypoechoic spherical mass", "Doppler: peripheral blood flow pattern", "TVS better than TAS for small lesions"],
    },
    {
      icon: "🧲", title: "MRI Pelvis (Gold Standard)",
      points: ["Best for fibroid mapping before surgery", "T2: hypointense mass within myometrium", "Distinguishes fibroid subtypes accurately", "Evaluates degeneration types"],
    },
    {
      icon: "💧", title: "Saline Infusion Sonohysterography",
      points: ["Excellent for submucosal fibroids", "Evaluates cavity distortion", "Guides hysteroscopic planning"],
    },
    {
      icon: "🔭", title: "Hysteroscopy",
      points: ["Direct visualization of submucosal fibroids", "Simultaneous diagnostic & therapeutic"],
    },
  ];

  let y = 1.1;
  modalities.forEach(m => {
    slide.addText(`${m.icon}  ${m.title}`, { x: 0.35, y, w: 5.8, h: 0.32, fontSize: 12.5, bold: true, color: C.mid });
    y += 0.32;
    m.points.forEach(p => {
      slide.addText([{ text: p, options: { bullet: true } }], { x: 0.35, y, w: 5.8, h: 0.27, fontSize: 10.5, color: C.text });
      y += 0.27;
    });
    y += 0.12;
  });

  // Right column — MRI image
  const mriImg = images[4];
  if (mriImg && !mriImg.error && mriImg.base64) {
    slide.addImage({ data: mriImg.base64, x: 6.4, y: 1.05, w: 3.3, h: 3.0 });
    slide.addText("MRI pelvis: T2 sagittal views — before & after GnRH antagonist treatment", {
      x: 6.4, y: 4.05, w: 3.3, h: 0.55, fontSize: 9, italic: true, color: C.muted, align: "center",
    });
  }

  // Divider
  slide.addShape(pres.ShapeType.line, { x: 6.2, y: 1.1, w: 0, h: 4.1, line: { color: C.subhead, pt: 1, dashType: "dash" } });
}

// ──────────────────────────────────────────────────────────────────────────────
// SLIDE 9 — GROSS & HISTOPATHOLOGY
// ──────────────────────────────────────────────────────────────────────────────
{
  const slide = pres.addSlide();
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: "0E1C30" } });
  addSlideHeader(slide, "Gross Pathology & Histology");

  // Two gross pathology images
  const grossImg = images[2]; // whorled cut surface
  const specImg = images[3];  // surgical specimen
  if (grossImg && !grossImg.error && grossImg.base64) {
    slide.addImage({ data: grossImg.base64, x: 0.3, y: 0.95, w: 4.1, h: 3.0 });
    slide.addText("Classic whorled cut surface — intramural leiomyoma", {
      x: 0.3, y: 3.95, w: 4.1, h: 0.4, fontSize: 9.5, italic: true, color: "8DB4D4", align: "center",
    });
  }
  if (specImg && !specImg.error && specImg.base64) {
    slide.addImage({ data: specImg.base64, x: 4.7, y: 0.95, w: 4.1, h: 3.0 });
    slide.addText("Subserous leiomyoma surgical specimen — myomectomy", {
      x: 4.7, y: 3.95, w: 4.1, h: 0.4, fontSize: 9.5, italic: true, color: "8DB4D4", align: "center",
    });
  }

  // Histology bullets at bottom
  const histPoints = [
    "Well-circumscribed benign smooth muscle tumor; encapsulated by a fibrous pseudocapsule",
    "Intersecting bundles of smooth muscle fibers in a whorled pattern",
    "Uniform spindle cells with elongated nuclei and eosinophilic cytoplasm (no atypia)",
    "Degeneration types: hyaline (most common), cystic, red/carneous, calcific, myxoid",
  ];
  slide.addText(
    histPoints.map((p, i) => [
      { text: p, options: { bullet: true, breakLine: i < histPoints.length - 1 } }
    ]).flat().flat(),
    { x: 0.3, y: 4.45, w: 9.4, h: 1.0, fontSize: 10.5, color: "D0E8F5" }
  );
}

// ──────────────────────────────────────────────────────────────────────────────
// SLIDE 10 — DEGENERATION TYPES
// ──────────────────────────────────────────────────────────────────────────────
{
  const slide = pres.addSlide();
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.white } });
  addSlideHeader(slide, "Degeneration of Fibroids", "Occurs due to outgrowth of blood supply");

  const types = [
    { name: "Hyaline", pct: "65%", color: "5B8DB8", desc: "Most common. Collagen replacement. Firm, white on cut section." },
    { name: "Cystic", pct: "4%", color: "27AE60", desc: "Liquefaction of hyalinized areas. Fluid-filled spaces on imaging." },
    { name: "Red (Carneous)", pct: "3%", color: "E74C3C", desc: "Hemorrhagic infarction. Classic in pregnancy — acute pain, fever, leukocytosis." },
    { name: "Myxoid", pct: "~2%", color: "9B59B6", desc: "Myxoid matrix. Can mimic sarcoma — require careful histology." },
    { name: "Calcific", pct: "~4%", color: "95A5A6", desc: "Late stage. Calcium deposits. Post-menopausal. Visible on plain X-ray." },
    { name: "Sarcomatous", pct: "<1%", color: C.accent, desc: "Malignant transformation (leiomyosarcoma). Rare but serious." },
  ];

  types.forEach((t, i) => {
    const x = 0.3 + (i % 3) * 3.2;
    const y = 1.1 + Math.floor(i / 3) * 2.1;
    slide.addShape(pres.ShapeType.rect, { x, y, w: 3.0, h: 0.38, fill: { color: t.color } });
    slide.addText(`${t.name}  (${t.pct})`, { x: x + 0.1, y, w: 2.8, h: 0.38, fontSize: 12, bold: true, color: C.white, valign: "middle" });
    slide.addShape(pres.ShapeType.rect, { x, y: y + 0.38, w: 3.0, h: 1.6, fill: { color: C.light }, line: { color: t.color, pt: 1 } });
    slide.addText(t.desc, { x: x + 0.1, y: y + 0.45, w: 2.8, h: 1.45, fontSize: 11, color: C.text, valign: "top" });
  });
}

// ──────────────────────────────────────────────────────────────────────────────
// SLIDE 11 — COMPLICATIONS
// ──────────────────────────────────────────────────────────────────────────────
{
  const slide = pres.addSlide();
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.white } });
  addSlideHeader(slide, "Complications");

  const comps = [
    { icon: "🩸", title: "Anemia", detail: "Chronic iron-deficiency anemia from menorrhagia. May require transfusion." },
    { icon: "🤰", title: "Infertility", detail: "Submucosal fibroids distort cavity; impair implantation and sperm migration." },
    { icon: "👶", title: "Obstetric Complications", detail: "Preterm labour, placenta previa (OR 2.2), abruption (OR 2.6), malpresentation." },
    { icon: "💊", title: "Red Degeneration", detail: "Hemorrhagic infarction in pregnancy — acute abdomen, fever, raised WBC." },
    { icon: "🔄", title: "Torsion", detail: "Pedunculated fibroids can twist on their pedicle — acute surgical emergency." },
    { icon: "⚠️", title: "Malignant Change", detail: "Leiomyosarcoma — rare (<1%). Suspect if rapid growth or post-menopausal growth." },
    { icon: "🚽", title: "Urinary Symptoms", detail: "Bladder compression → frequency, urgency, acute urinary retention." },
    { icon: "🔪", title: "Haemorrhage", detail: "Rare spontaneous rupture of surface vessel → haemoperitoneum." },
  ];

  comps.forEach((c, i) => {
    const x = 0.3 + (i % 4) * 2.35;
    const y = 1.1 + Math.floor(i / 4) * 2.15;
    slide.addShape(pres.ShapeType.rect, { x, y, w: 2.15, h: 2.0, fill: { color: C.light }, line: { color: C.mid, pt: 1.5 } });
    slide.addText(c.icon, { x, y: y + 0.12, w: 2.15, h: 0.45, fontSize: 22, align: "center" });
    slide.addText(c.title, { x: x + 0.05, y: y + 0.56, w: 2.05, h: 0.3, fontSize: 11, bold: true, color: C.mid, align: "center" });
    slide.addText(c.detail, { x: x + 0.1, y: y + 0.86, w: 1.95, h: 1.05, fontSize: 9.5, color: C.text, align: "center" });
  });
}

// ──────────────────────────────────────────────────────────────────────────────
// SLIDE 12 — MANAGEMENT ALGORITHM
// ──────────────────────────────────────────────────────────────────────────────
{
  const slide = pres.addSlide();
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.white } });
  addSlideHeader(slide, "Management Overview", "Tailored to symptoms, fertility desire, and fibroid characteristics");

  // Three pathways
  const paths = [
    {
      title: "Expectant Management",
      color: "27AE60",
      sub: "Asymptomatic fibroids",
      items: [
        "No treatment needed",
        "Regular surveillance (6–12 monthly US)",
        "Reassure patient",
        "Review if symptoms develop",
      ],
    },
    {
      title: "Medical Management",
      color: C.mid,
      sub: "Symptomatic — fertility-preserving or bridge therapy",
      items: [
        "GnRH agonists (leuprolide): shrink fibroid ≈50%; pre-op use",
        "GnRH antagonists (elagolix, linzagolix): oral, reduce HMB",
        "Levonorgestrel IUS: reduces HMB",
        "Combined OCP / progestins: cycle control",
        "Tranexamic acid / NSAIDs: symptomatic HMB relief",
        "Iron supplementation: correct anaemia",
      ],
    },
    {
      title: "Surgical / Interventional",
      color: C.accent,
      sub: "Definitive or fertility-preserving surgery",
      items: [
        "Myomectomy: fibroid removal, uterus preserved",
        "Hysteroscopic myomectomy: submucosal (Type 0–2)",
        "Hysterectomy: definitive cure — no desire for fertility",
        "Uterine Artery Embolization (UAE): non-surgical",
        "MRI-guided focused ultrasound (MRgFUS): non-invasive",
        "Endometrial ablation: for HMB (no submucosal fibroids)",
      ],
    },
  ];

  paths.forEach((p, i) => {
    const x = 0.25 + i * 3.2;
    const y = 1.1;
    slide.addShape(pres.ShapeType.rect, { x, y, w: 3.0, h: 0.42, fill: { color: p.color } });
    slide.addText(p.title, { x: x + 0.08, y, w: 2.85, h: 0.42, fontSize: 12.5, bold: true, color: C.white, valign: "middle" });
    slide.addShape(pres.ShapeType.rect, { x, y: y + 0.42, w: 3.0, h: 0.3, fill: { color: "E0ECF8" } });
    slide.addText(p.sub, { x: x + 0.08, y: y + 0.42, w: 2.85, h: 0.3, fontSize: 9, italic: true, color: C.muted, valign: "middle" });
    slide.addShape(pres.ShapeType.rect, { x, y: y + 0.72, w: 3.0, h: 3.78, fill: { color: C.light }, line: { color: p.color, pt: 1 } });
    slide.addText(
      p.items.map((item, idx) => [
        { text: item, options: { bullet: true, breakLine: idx < p.items.length - 1 } }
      ]).flat().flat(),
      { x: x + 0.1, y: y + 0.8, w: 2.8, h: 3.55, fontSize: 10.5, color: C.text, valign: "top" }
    );
  });
}

// ──────────────────────────────────────────────────────────────────────────────
// SLIDE 13 — SURGICAL OPTIONS
// ──────────────────────────────────────────────────────────────────────────────
{
  const slide = pres.addSlide();
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.white } });
  addSlideHeader(slide, "Surgical Options in Detail");

  const surgeries = [
    {
      name: "Hysteroscopic Myomectomy",
      ind: "Submucosal (FIGO 0–2); HMB; infertility",
      approach: "Resectoscope via cervix — no incision",
      pros: "Day case; rapid recovery; uterus preserved",
      cons: "Limited to cavity lesions; fluid overload risk",
    },
    {
      name: "Laparoscopic Myomectomy",
      ind: "Intramural/subserosal ≤10 cm; limited number",
      approach: "Minimally invasive; laparoscopic dissection",
      pros: "Less blood loss; faster recovery vs open",
      cons: "Longer OR time; requires expertise; morcellation risk",
    },
    {
      name: "Open (Abdominal) Myomectomy",
      ind: "Multiple/large fibroids; complex anatomy",
      approach: "Laparotomy — Pfannenstiel or midline incision",
      pros: "Complete resection; any location/size",
      cons: "Longer recovery; adhesion risk; blood loss",
    },
    {
      name: "Hysterectomy",
      ind: "Completed family; failed conservative Rx; large/multiple fibroids",
      approach: "Vaginal / laparoscopic / open",
      pros: "Definitive cure; no recurrence",
      cons: "Loss of fertility; surgical risks; hormonal impact",
    },
  ];

  // Column headers
  const cols = ["Procedure", "Indication", "Approach", "Advantages", "Disadvantages"];
  const colW = [2.3, 2.1, 2.2, 1.7, 1.7];
  let cx = 0.2;
  slide.addShape(pres.ShapeType.rect, { x: 0.2, y: 1.1, w: 9.6, h: 0.32, fill: { color: C.deep } });
  cols.forEach((col, i) => {
    slide.addText(col, { x: cx + 0.04, y: 1.1, w: colW[i] - 0.08, h: 0.32, fontSize: 10, bold: true, color: C.white, valign: "middle" });
    cx += colW[i];
  });

  surgeries.forEach((s, ri) => {
    const ry = 1.42 + ri * 0.97;
    const bg = ri % 2 === 0 ? C.light : C.white;
    slide.addShape(pres.ShapeType.rect, { x: 0.2, y: ry, w: 9.6, h: 0.97, fill: { color: bg }, line: { color: "CCCCCC", pt: 0.5 } });
    const vals = [s.name, s.ind, s.approach, s.pros, s.cons];
    let vx = 0.2;
    vals.forEach((v, vi) => {
      slide.addText(v, {
        x: vx + 0.04, y: ry + 0.04, w: colW[vi] - 0.08, h: 0.88,
        fontSize: 9.5, color: vi === 0 ? C.mid : C.text, bold: vi === 0, valign: "middle",
      });
      vx += colW[vi];
    });
  });
}

// ──────────────────────────────────────────────────────────────────────────────
// SLIDE 14 — UAE & NOVEL TREATMENTS
// ──────────────────────────────────────────────────────────────────────────────
{
  const slide = pres.addSlide();
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.white } });
  addSlideHeader(slide, "Uterine Artery Embolization & Novel Therapies");

  // UAE box
  slide.addShape(pres.ShapeType.rect, { x: 0.35, y: 1.15, w: 9.3, h: 0.38, fill: { color: C.mid } });
  slide.addText("Uterine Artery Embolization (UAE)", { x: 0.45, y: 1.15, w: 9.0, h: 0.38, fontSize: 14, bold: true, color: C.white, valign: "middle" });
  const uaeItems = [
    "Percutaneous fluoroscopic-guided embolization of uterine arteries via femoral access",
    "Polyvinyl alcohol (PVA) particles / microspheres used to occlude arterial supply to fibroids",
    "Fibroid volume reduction of 40–70% at 6 months; symptom improvement in 85–90%",
    "Ontario UFE Trial: significant reduction in bleeding, pain, and bulk symptoms",
    "Contraindicated: desire for future pregnancy (relative), infection, malignancy suspicion",
    "Complications: post-embolization syndrome (fever, pain), ovarian failure (rare), expulsion of fibroid",
  ];
  slide.addText(
    uaeItems.map((item, i) => [
      { text: item, options: { bullet: true, breakLine: i < uaeItems.length - 1 } }
    ]).flat().flat(),
    { x: 0.35, y: 1.53, w: 9.3, h: 1.9, fontSize: 11, color: C.text }
  );

  // Novel therapies
  slide.addShape(pres.ShapeType.rect, { x: 0.35, y: 3.55, w: 9.3, h: 0.35, fill: { color: C.accent } });
  slide.addText("Novel & Emerging Therapies", { x: 0.45, y: 3.55, w: 9.0, h: 0.35, fontSize: 13, bold: true, color: C.white, valign: "middle" });
  const novelItems = [
    { name: "MRI-guided Focused Ultrasound (MRgFUS / HIFU):", desc: "Non-invasive thermal ablation. FDA-approved. Best for ≤3 fibroids, anterior intramural." },
    { name: "Radiofrequency Ablation (Acessa™):", desc: "Laparoscopic US-guided probe. Reduces uterine volume. Fertility-preserving." },
    { name: "GnRH Antagonists (Linzagolix, Relugolix):", desc: "Oral, rapid onset. Approved for HMB associated with fibroids. Add-back HRT reduces bone loss." },
  ];
  novelItems.forEach((n, i) => {
    const y = 3.96 + i * 0.42;
    slide.addText([
      { text: n.name + "  ", options: { bold: true, color: C.mid } },
      { text: n.desc, options: { color: C.text } },
    ], { x: 0.35, y, w: 9.3, h: 0.4, fontSize: 10.5, valign: "middle" });
  });
}

// ──────────────────────────────────────────────────────────────────────────────
// SLIDE 15 — KEY POINTS / SUMMARY
// ──────────────────────────────────────────────────────────────────────────────
{
  const slide = pres.addSlide();
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.deep } });
  addSlideHeader(slide, "Key Takeaways");

  const points = [
    { num: "1", text: "Uterine myomas are the most common benign pelvic tumors in women; ~20–40% of reproductive-age women are affected." },
    { num: "2", text: "Monoclonal smooth muscle tumors, hormonally driven by estrogen and progesterone." },
    { num: "3", text: "FIGO classification (Types 0–8) guides treatment approach — submucosal fibroids are most symptomatic." },
    { num: "4", text: "Most common symptoms: menorrhagia, dysmenorrhea, pelvic pressure, infertility." },
    { num: "5", text: "50–70% are asymptomatic — expectant management is appropriate for many patients." },
    { num: "6", text: "Ultrasound is first-line imaging; MRI is the gold standard for fibroid mapping pre-operatively." },
    { num: "7", text: "Medical options (GnRH agonists/antagonists, LNG-IUS) are temporizing; surgical options offer more durable relief." },
    { num: "8", text: "Myomectomy preserves fertility; hysterectomy is curative. UAE is an effective non-surgical option." },
  ];

  points.forEach((p, i) => {
    const y = 1.15 + i * 0.54;
    slide.addShape(pres.ShapeType.rect, { x: 0.35, y: y + 0.04, w: 0.42, h: 0.38, fill: { color: C.accent } });
    slide.addText(p.num, { x: 0.35, y: y + 0.04, w: 0.42, h: 0.38, fontSize: 13, bold: true, color: C.white, align: "center", valign: "middle" });
    slide.addText(p.text, { x: 0.87, y, w: 8.8, h: 0.52, fontSize: 11.5, color: "D0E8F5", valign: "middle" });
  });
}

// ──────────────────────────────────────────────────────────────────────────────
// WRITE FILE
// ──────────────────────────────────────────────────────────────────────────────
const outPath = "/home/daytona/workspace/uterine-myoma-ppt/Uterine_Myoma.pptx";
pres.writeFile({ fileName: outPath })
  .then(() => console.log("✅  Saved:", outPath))
  .catch(err => { console.error("❌  Error:", err); process.exit(1); });
Running Command

cd /home/daytona/workspace/uterine-myoma-ppt && node create_ppt.js 2>&1

Your presentation is ready!

Uterine Myoma

Presentation · PPTX


Here's what's inside the 15-slide deck (navy/blue color theme with orange accents):
SlideContent
1Title slide
2Table of contents
3Definition & Epidemiology (stats: 20–40% prevalence, racial disparity)
4Pathogenesis & Etiology (monoclonal origin, hormonal drivers, risk factors)
5FIGO Classification table (Types 0–8)
6Fibroid Locations — anatomy diagram with image from Bailey & Love's Surgery
7Clinical Features (menstrual, bulk, reproductive, acute symptoms)
8Diagnosis & Imaging (USG, MRI, SIS, hysteroscopy) with MRI comparison image
9Gross Pathology & Histology — 2 real specimen photos (whorled cut surface, surgical specimen)
10Degeneration types (hyaline, cystic, red/carneous, myxoid, calcific, sarcomatous)
11Complications (8 categories with icons)
12Management Overview — 3-pathway algorithm (expectant / medical / surgical)
13Surgical Options comparison table (hysteroscopic, laparoscopic, open, hysterectomy)
14UAE & Novel Therapies (MRgFUS, radiofrequency ablation, GnRH antagonists)
15Key Takeaways
Content sourced from Creasy & Resnik's Maternal-Fetal Medicine, Berek & Novak's Gynecology, Tintinalli's Emergency Medicine, and Bailey & Love's Surgery.

you can take info from here and combine it with the previous presentation you made

Reading File
You've run out of free credits. Sign up for a free account to continue using Orris.
This is a shared conversation. Sign in to Orris to start your own chat.