attachment
attachment

Make ppt based mention topics in aploded pic

analyse_media
The image topic is clear: Classify OCPs. MOA, Contraindications, and Adverse Effects of OCPs. Let me read the PPTX skill and query the medical library in parallel.
Reading File
Reading File
Now let me read the pptxgenjs.md and query the medical library for OCP content simultaneously.
Reading File
Finding Sources
Now let me query the medical library for detailed OCP content (classification, MOA, contraindications, adverse effects) in parallel:
Finding Sources
Finding Sources
Finding Sources
Found a key reference in Goodman & Gilman's. Let me read that block and also search for more OCP content:
Reading File
Finding Sources
Finding Sources
Excellent content from Goodman & Gilman's. I have rich content about OCPs. I now have enough medical knowledge to build a comprehensive, high-quality PPTX. Let me create it now:
Running Command

mkdir -p /home/daytona/workspace/ocp-ppt && ls /home/daytona/workspace/ocp-ppt/

Writing File

~/ocp-ppt/ocp_presentation.js

const pptxgen = require("pptxgenjs");

let pres = new pptxgen();
pres.layout = 'LAYOUT_WIDE';
pres.title = 'Oral Contraceptive Pills (OCPs)';

// ─── THEME COLORS ───────────────────────────────────────────────────
const C = {
  deepPurple:  "2D1B69",
  purple:      "5C3BC8",
  lightPurple: "7B5EA7",
  accent:      "E91E8C",
  accentLight: "F48FB1",
  white:       "FFFFFF",
  lightGray:   "F3F0FC",
  darkText:    "1A1035",
  midText:     "4A3B8C",
  cardBg:      "EDE8FC",
  cardBg2:     "FCE4F3",
  cardBg3:     "E8F4E8",
  cardBg4:     "FFF3E0",
  green:       "2E7D32",
  orange:      "E65100",
  red:         "C62828",
  teal:        "00695C",
};

// Helper: add a slide with dark-gradient background
function addBgRect(slide, color1, color2) {
  slide.addShape(pres.ShapeType.rect, {
    x: 0, y: 0, w: "100%", h: "100%",
    fill: { type: "solid", color: color1 },
    line: { type: "none" },
  });
}

// Helper: section tag (colored pill)
function addTag(slide, text, x, y, color) {
  slide.addShape(pres.ShapeType.roundRect, {
    x, y, w: 2.5, h: 0.32,
    fill: { type: "solid", color: color },
    line: { type: "none" },
    rectRadius: 0.16,
  });
  slide.addText(text, {
    x, y, w: 2.5, h: 0.32,
    fontSize: 9, bold: true, color: C.white,
    align: "center", valign: "middle", margin: 0,
  });
}

// ════════════════════════════════════════════════════
// SLIDE 1 β€” TITLE
// ════════════════════════════════════════════════════
{
  let sl = pres.addSlide();
  // Deep purple bg
  addBgRect(sl, C.deepPurple, C.purple);
  // Decorative accent bar (left)
  sl.addShape(pres.ShapeType.rect, {
    x: 0, y: 0, w: 0.18, h: "100%",
    fill: { type: "solid", color: C.accent },
    line: { type: "none" },
  });
  // Right decorative circle
  sl.addShape(pres.ShapeType.ellipse, {
    x: 10.5, y: -1, w: 3.5, h: 3.5,
    fill: { type: "solid", color: C.purple },
    line: { type: "none" },
  });
  sl.addShape(pres.ShapeType.ellipse, {
    x: 11.2, y: 4.2, w: 2.5, h: 2.5,
    fill: { type: "solid", color: C.accent },
    line: { type: "none" },
  });

  // Pill icon (decorative circles to simulate pill)
  sl.addShape(pres.ShapeType.ellipse, {
    x: 0.9, y: 1.2, w: 1.1, h: 1.1,
    fill: { type: "solid", color: C.accentLight },
    line: { type: "none" },
  });
  sl.addShape(pres.ShapeType.ellipse, {
    x: 1.6, y: 1.55, w: 0.55, h: 0.55,
    fill: { type: "solid", color: C.accent },
    line: { type: "none" },
  });

  sl.addText("ORAL CONTRACEPTIVE PILLS", {
    x: 0.4, y: 0.6, w: 9.5, h: 0.6,
    fontSize: 13, bold: true, color: C.accentLight,
    charSpacing: 4, align: "left",
  });
  sl.addText("OCPs", {
    x: 0.4, y: 1.15, w: 9.0, h: 2.0,
    fontSize: 72, bold: true, color: C.white,
    align: "left",
  });
  sl.addText("Classification  β€’  Mechanism of Action\nContraindications  β€’  Adverse Effects", {
    x: 0.4, y: 3.1, w: 9.0, h: 0.9,
    fontSize: 18, color: C.accentLight,
    align: "left",
  });
  sl.addText("Pharmacology | Reproductive Medicine", {
    x: 0.4, y: 4.2, w: 6, h: 0.4,
    fontSize: 11, color: "9B8EC4",
    align: "left",
  });
}

// ════════════════════════════════════════════════════
// SLIDE 2 β€” CLASSIFICATION OF OCPs
// ════════════════════════════════════════════════════
{
  let sl = pres.addSlide();
  addBgRect(sl, C.lightGray, C.lightGray);

  // Header bar
  sl.addShape(pres.ShapeType.rect, {
    x: 0, y: 0, w: "100%", h: 1.0,
    fill: { type: "solid", color: C.deepPurple },
    line: { type: "none" },
  });
  sl.addShape(pres.ShapeType.rect, {
    x: 0, y: 0.88, w: "100%", h: 0.12,
    fill: { type: "solid", color: C.accent },
    line: { type: "none" },
  });
  sl.addText("CLASSIFICATION OF OCPs", {
    x: 0.4, y: 0.1, w: 12, h: 0.75,
    fontSize: 24, bold: true, color: C.white,
    align: "left",
  });
  addTag(sl, "SLIDE 02", 10.5, 0.28, C.accent);

  // ── Card: Combined (COCPs) ─────────────────────────────
  sl.addShape(pres.ShapeType.roundRect, {
    x: 0.3, y: 1.15, w: 5.9, h: 2.55,
    fill: { type: "solid", color: C.white },
    line: { color: C.purple, pt: 1.5 },
    rectRadius: 0.15,
    shadow: { type: "outer", blur: 8, offset: 3, angle: 45, color: "BBAADD", opacity: 0.25 },
  });
  sl.addShape(pres.ShapeType.rect, {
    x: 0.3, y: 1.15, w: 0.22, h: 2.55,
    fill: { type: "solid", color: C.purple },
    line: { type: "none" },
  });
  sl.addText("1. Combined Oral Contraceptive Pills (COCPs)", {
    x: 0.62, y: 1.2, w: 5.4, h: 0.4,
    fontSize: 12, bold: true, color: C.deepPurple,
  });
  sl.addText([
    { text: "β€’ Contain: ", options: { bold: true, color: C.midText } },
    { text: "Estrogen (ethinyl estradiol) + Progestin\n", options: { color: C.darkText } },
    { text: "β€’ Monophasic: ", options: { bold: true, color: C.midText } },
    { text: "Constant hormone levels throughout cycle\n", options: { color: C.darkText } },
    { text: "β€’ Biphasic: ", options: { bold: true, color: C.midText } },
    { text: "2 different dose levels per cycle\n", options: { color: C.darkText } },
    { text: "β€’ Triphasic: ", options: { bold: true, color: C.midText } },
    { text: "3 varying dose levels per cycle\n", options: { color: C.darkText } },
    { text: "β€’ Extended/Continuous: ", options: { bold: true, color: C.midText } },
    { text: "Progestin withdrawal every 3 months", options: { color: C.darkText } },
  ], {
    x: 0.62, y: 1.62, w: 5.45, h: 2.0,
    fontSize: 11, lineSpacingMultiple: 1.3,
  });

  // ── Card: Progestin-Only ─────────────────────────────
  sl.addShape(pres.ShapeType.roundRect, {
    x: 6.6, y: 1.15, w: 5.9, h: 2.55,
    fill: { type: "solid", color: C.white },
    line: { color: C.accent, pt: 1.5 },
    rectRadius: 0.15,
    shadow: { type: "outer", blur: 8, offset: 3, angle: 45, color: "BBAADD", opacity: 0.25 },
  });
  sl.addShape(pres.ShapeType.rect, {
    x: 6.6, y: 1.15, w: 0.22, h: 2.55,
    fill: { type: "solid", color: C.accent },
    line: { type: "none" },
  });
  sl.addText("2. Progestin-Only Pills (Mini-pills)", {
    x: 6.92, y: 1.2, w: 5.4, h: 0.4,
    fontSize: 12, bold: true, color: C.deepPurple,
  });
  sl.addText([
    { text: "β€’ Contain: ", options: { bold: true, color: C.midText } },
    { text: "Progestin only (no estrogen)\n", options: { color: C.darkText } },
    { text: "β€’ Examples: ", options: { bold: true, color: C.midText } },
    { text: "Norethindrone 350 ΞΌg daily\n", options: { color: C.darkText } },
    { text: "β€’ Taken daily without interruption\n", options: { color: C.darkText } },
    { text: "β€’ Indication: ", options: { bold: true, color: C.midText } },
    { text: "Breastfeeding women, estrogen CI\n", options: { color: C.darkText } },
    { text: "β€’ Efficacy: ~99% (theoretical)", options: { color: C.darkText } },
  ], {
    x: 6.92, y: 1.62, w: 5.45, h: 2.0,
    fontSize: 11, lineSpacingMultiple: 1.3,
  });

  // ── Estrogen content note ─────────────────────────────
  sl.addShape(pres.ShapeType.roundRect, {
    x: 0.3, y: 3.85, w: 12.2, h: 1.5,
    fill: { type: "solid", color: "EDE8FC" },
    line: { color: C.purple, pt: 1 },
    rectRadius: 0.12,
  });
  sl.addText("KEY COMPONENTS", {
    x: 0.5, y: 3.92, w: 3, h: 0.3,
    fontSize: 9, bold: true, color: C.purple, charSpacing: 2,
  });
  sl.addText([
    { text: "Estrogen: ", options: { bold: true, color: C.accent } },
    { text: "Ethinyl estradiol (EE) β€” 20 to 50 ΞΌg per pill    ", options: { color: C.darkText } },
    { text: "Progestins: ", options: { bold: true, color: C.purple } },
    { text: "Norethindrone, Levonorgestrel, Desogestrel, Norgestimate, Drospirenone\n", options: { color: C.darkText } },
    { text: "Route: ", options: { bold: true, color: C.teal } },
    { text: "Oral (standard) | Transdermal patch | Intravaginal ring | Subdermal implant | Depot injection", options: { color: C.darkText } },
  ], {
    x: 0.5, y: 4.22, w: 12.0, h: 1.0,
    fontSize: 10.5, lineSpacingMultiple: 1.3,
  });
}

// ════════════════════════════════════════════════════
// SLIDE 3 β€” MECHANISM OF ACTION (MOA)
// ════════════════════════════════════════════════════
{
  let sl = pres.addSlide();
  addBgRect(sl, "1A1035", "1A1035");

  // Header
  sl.addShape(pres.ShapeType.rect, {
    x: 0, y: 0, w: 0.2, h: "100%",
    fill: { type: "solid", color: C.accent },
    line: { type: "none" },
  });
  sl.addText("MECHANISM OF ACTION", {
    x: 0.4, y: 0.15, w: 9, h: 0.55,
    fontSize: 26, bold: true, color: C.white,
    charSpacing: 1,
  });
  addTag(sl, "SLIDE 03", 11.3, 0.22, C.purple);
  sl.addText("How OCPs prevent pregnancy", {
    x: 0.4, y: 0.68, w: 8, h: 0.3,
    fontSize: 12, color: "9B8EC4",
  });

  // MOA Cards (4 mechanisms)
  const moas = [
    {
      num: "01",
      title: "Inhibition of Ovulation",
      color: C.purple,
      body: "Primary mechanism. Estrogen suppresses FSH β†’ no follicle development. Progestin suppresses LH surge β†’ prevents ovulation. Progestin reduces GnRH pulse frequency from hypothalamus.",
    },
    {
      num: "02",
      title: "Cervical Mucus Changes",
      color: C.accent,
      body: "Progestin thickens cervical mucus β†’ impairs sperm penetration and transport. Creates hostile environment for sperm migration into uterus.",
    },
    {
      num: "03",
      title: "Endometrial Changes",
      color: C.teal,
      body: "Progestin causes endometrial atrophy β†’ hostile to implantation. Glandular changes reduce receptivity for a fertilized ovum. Backup mechanism.",
    },
    {
      num: "04",
      title: "Tubal Motility",
      color: C.orange,
      body: "Progestin alters fallopian tube peristalsis and secretion. May impair transport of ovum and sperm, reducing chance of fertilization.",
    },
  ];

  const cols = [0.3, 6.7];
  const rows = [1.15, 3.2];
  moas.forEach((m, i) => {
    const x = cols[i % 2];
    const y = rows[Math.floor(i / 2)];
    sl.addShape(pres.ShapeType.roundRect, {
      x, y, w: 5.9, h: 1.85,
      fill: { type: "solid", color: "2A1F5A" },
      line: { color: m.color, pt: 1.5 },
      rectRadius: 0.15,
    });
    // Number badge
    sl.addShape(pres.ShapeType.ellipse, {
      x: x + 0.18, y: y + 0.12, w: 0.55, h: 0.55,
      fill: { type: "solid", color: m.color },
      line: { type: "none" },
    });
    sl.addText(m.num, {
      x: x + 0.18, y: y + 0.12, w: 0.55, h: 0.55,
      fontSize: 10, bold: true, color: C.white,
      align: "center", valign: "middle", margin: 0,
    });
    sl.addText(m.title, {
      x: x + 0.85, y: y + 0.13, w: 4.85, h: 0.4,
      fontSize: 12, bold: true, color: m.color,
    });
    sl.addText(m.body, {
      x: x + 0.22, y: y + 0.6, w: 5.45, h: 1.15,
      fontSize: 10.5, color: "D0C8F0",
      lineSpacingMultiple: 1.35,
    });
  });

  // Bottom note
  sl.addShape(pres.ShapeType.rect, {
    x: 0.3, y: 5.1, w: 12.2, h: 0.38,
    fill: { type: "solid", color: "2A1F5A" },
    line: { type: "none" },
  });
  sl.addText("β˜…  Inhibition of ovulation is the primary and most reliable mechanism of action. Backup mechanisms provide additional protection.", {
    x: 0.4, y: 5.12, w: 12.0, h: 0.34,
    fontSize: 10, color: C.accentLight, italic: true,
    align: "center",
  });
}

// ════════════════════════════════════════════════════
// SLIDE 4 β€” CONTRAINDICATIONS
// ════════════════════════════════════════════════════
{
  let sl = pres.addSlide();
  addBgRect(sl, C.lightGray, C.lightGray);

  // Header
  sl.addShape(pres.ShapeType.rect, {
    x: 0, y: 0, w: "100%", h: 1.0,
    fill: { type: "solid", color: C.red },
    line: { type: "none" },
  });
  sl.addShape(pres.ShapeType.rect, {
    x: 0, y: 0.88, w: "100%", h: 0.12,
    fill: { type: "solid", color: C.orange },
    line: { type: "none" },
  });
  sl.addText("CONTRAINDICATIONS", {
    x: 0.4, y: 0.1, w: 9, h: 0.75,
    fontSize: 26, bold: true, color: C.white,
  });
  addTag(sl, "SLIDE 04", 11.3, 0.28, C.orange);

  // Absolute CI label
  sl.addShape(pres.ShapeType.roundRect, {
    x: 0.3, y: 1.08, w: 3.0, h: 0.38,
    fill: { type: "solid", color: C.red },
    line: { type: "none" },
    rectRadius: 0.18,
  });
  sl.addText("ABSOLUTE (WHO 4)", {
    x: 0.3, y: 1.08, w: 3.0, h: 0.38,
    fontSize: 10, bold: true, color: C.white,
    align: "center", valign: "middle", margin: 0,
  });
  // Relative CI label
  sl.addShape(pres.ShapeType.roundRect, {
    x: 6.6, y: 1.08, w: 3.0, h: 0.38,
    fill: { type: "solid", color: C.orange },
    line: { type: "none" },
    rectRadius: 0.18,
  });
  sl.addText("RELATIVE (WHO 3)", {
    x: 6.6, y: 1.08, w: 3.0, h: 0.38,
    fontSize: 10, bold: true, color: C.white,
    align: "center", valign: "middle", margin: 0,
  });

  // Absolute CI box
  sl.addShape(pres.ShapeType.roundRect, {
    x: 0.3, y: 1.55, w: 5.9, h: 3.8,
    fill: { type: "solid", color: C.white },
    line: { color: C.red, pt: 2 },
    rectRadius: 0.15,
  });
  const absoluteCIs = [
    "Pregnancy (known or suspected)",
    "History of DVT / pulmonary embolism (VTE)",
    "Ischemic heart disease or stroke",
    "Breast cancer (current or recent)",
    "Liver disease (hepatic adenoma, cirrhosis)",
    "Uncontrolled hypertension (β‰₯ 160/100 mmHg)",
    "Migraine with aura",
    "Thrombophilia (Factor V Leiden, etc.)",
    "Smokers aged > 35 years",
    "Undiagnosed abnormal uterine bleeding",
  ];
  sl.addText(absoluteCIs.map((t, i) => ({
    text: `βœ•  ${t}` + (i < absoluteCIs.length - 1 ? "\n" : ""),
    options: { color: C.red, bold: i === 0 }
  })), {
    x: 0.5, y: 1.65, w: 5.55, h: 3.6,
    fontSize: 11, lineSpacingMultiple: 1.3, color: C.darkText,
  });

  // Relative CI box
  sl.addShape(pres.ShapeType.roundRect, {
    x: 6.6, y: 1.55, w: 5.9, h: 3.8,
    fill: { type: "solid", color: C.white },
    line: { color: C.orange, pt: 2 },
    rectRadius: 0.15,
  });
  const relativeCIs = [
    "Controlled hypertension",
    "Breastfeeding < 6 weeks postpartum",
    "Diabetes mellitus with vascular complications",
    "Gallbladder disease",
    "History of cholestasis with prior OCP use",
    "Severe hyperlipidemia",
    "Smoking < 35 years of age",
    "Postpartum < 21 days (non-breastfeeding)",
    "Use of enzyme-inducing drugs (rifampicin, etc.)",
  ];
  sl.addText(relativeCIs.map((t, i) => ({
    text: `⚠  ${t}` + (i < relativeCIs.length - 1 ? "\n" : ""),
    options: { color: C.orange }
  })), {
    x: 6.8, y: 1.65, w: 5.55, h: 3.6,
    fontSize: 11, lineSpacingMultiple: 1.3, color: C.darkText,
  });
}

// ════════════════════════════════════════════════════
// SLIDE 5 β€” ADVERSE EFFECTS
// ════════════════════════════════════════════════════
{
  let sl = pres.addSlide();
  addBgRect(sl, "0D1B2A", "0D1B2A");

  // Header
  sl.addShape(pres.ShapeType.rect, {
    x: 0, y: 0, w: 0.2, h: "100%",
    fill: { type: "solid", color: C.accentLight },
    line: { type: "none" },
  });
  sl.addText("ADVERSE EFFECTS OF OCPs", {
    x: 0.4, y: 0.15, w: 10, h: 0.55,
    fontSize: 26, bold: true, color: C.white, charSpacing: 1,
  });
  addTag(sl, "SLIDE 05", 11.3, 0.22, C.teal);
  sl.addText("Side effects and complications to monitor", {
    x: 0.4, y: 0.68, w: 8, h: 0.3,
    fontSize: 12, color: "7ECCC5",
  });

  // 6 adverse-effect cards
  const aeCards = [
    { title: "Thromboembolic", color: C.red, icon: "🩸",
      points: ["DVT, PE (↑ risk 3-4x)", "Arterial thrombosis (rare)", "Stroke (esp. with aura/migraine)", "Risk ↑ with factor V Leiden"] },
    { title: "Cardiovascular", color: C.orange, icon: "❀️",
      points: ["Hypertension (mild BP rise)", "MI risk (esp. in smokers > 35)", "Dysrhythmias (rare)", "Fluid retention, edema"] },
    { title: "Hormonal / Metabolic", color: C.purple, icon: "βš—οΈ",
      points: ["Nausea, breast tenderness", "Weight gain (fluid retention)", "Glucose intolerance", "Altered lipid profile"] },
    { title: "Hepatic", color: C.teal, icon: "πŸ«€",
      points: ["Cholestatic jaundice", "Benign hepatic adenoma", "Gallstone formation ↑", "Altered liver enzymes"] },
    { title: "CNS / Neurological", color: "7B61FF", icon: "🧠",
      points: ["Headache / migraine worsening", "Mood changes, depression", "Decreased libido", "Chloasma (melasma)"] },
    { title: "Reproductive / Other", color: C.accentLight, icon: "πŸ”¬",
      points: ["Breakthrough bleeding (spotting)", "Amenorrhea post-pill", "Decreased milk production", "Cervical ectropion"] },
  ];

  const cardW = 4.0;
  const cardH = 1.85;
  const positions = [
    { x: 0.3, y: 1.1 }, { x: 4.65, y: 1.1 }, { x: 9.0, y: 1.1 },
    { x: 0.3, y: 3.1 }, { x: 4.65, y: 3.1 }, { x: 9.0, y: 3.1 },
  ];
  aeCards.forEach((card, i) => {
    const { x, y } = positions[i];
    sl.addShape(pres.ShapeType.roundRect, {
      x, y, w: cardW, h: cardH,
      fill: { type: "solid", color: "1A2E40" },
      line: { color: card.color, pt: 1.5 },
      rectRadius: 0.15,
    });
    // Title stripe
    sl.addShape(pres.ShapeType.rect, {
      x, y, w: cardW, h: 0.38,
      fill: { type: "solid", color: card.color },
      line: { type: "none" },
    });
    sl.addText(`${card.title}`, {
      x: x + 0.12, y: y + 0.02, w: cardW - 0.15, h: 0.34,
      fontSize: 11, bold: true, color: C.white,
      align: "left", valign: "middle", margin: 0,
    });
    // Points
    sl.addText(card.points.map((p, pi) => ({
      text: `β€’ ${p}` + (pi < card.points.length - 1 ? "\n" : ""),
      options: { color: "D0ECF8" },
    })), {
      x: x + 0.15, y: y + 0.44, w: cardW - 0.2, h: cardH - 0.5,
      fontSize: 10, lineSpacingMultiple: 1.3,
    });
  });
}

// ════════════════════════════════════════════════════
// SLIDE 6 β€” BENEFITS & CLINICAL USES
// ════════════════════════════════════════════════════
{
  let sl = pres.addSlide();
  addBgRect(sl, C.lightGray, C.lightGray);

  // Header
  sl.addShape(pres.ShapeType.rect, {
    x: 0, y: 0, w: "100%", h: 1.0,
    fill: { type: "solid", color: C.teal },
    line: { type: "none" },
  });
  sl.addShape(pres.ShapeType.rect, {
    x: 0, y: 0.88, w: "100%", h: 0.12,
    fill: { type: "solid", color: C.purple },
    line: { type: "none" },
  });
  sl.addText("BENEFITS & NON-CONTRACEPTIVE USES", {
    x: 0.4, y: 0.1, w: 11, h: 0.75,
    fontSize: 23, bold: true, color: C.white,
  });
  addTag(sl, "SLIDE 06", 11.3, 0.28, C.purple);

  const benefits = [
    { title: "Dysmenorrhea Relief", body: "Reduces prostaglandin production β†’ less painful periods. One of the most common indications for OCP beyond contraception.", color: C.teal },
    { title: "Endometriosis", body: "Suppresses endometrial growth, reducing pelvic pain, dyspareunia, and lesion progression in endometriosis patients.", color: C.purple },
    { title: "PCOS Management", body: "Reduces androgen levels β†’ improves hirsutism, acne, and irregular periods in polycystic ovary syndrome.", color: C.accent },
    { title: "Reduced Cancer Risk", body: "Long-term use associated with reduced risk of ovarian and endometrial cancers (up to 50% reduction with prolonged use).", color: C.green },
    { title: "Acne & Hirsutism", body: "Anti-androgenic progestins (drospirenone, norgestimate) reduce sebum production and androgen-driven hair growth.", color: C.orange },
    { title: "Menstrual Regulation", body: "Predictable withdrawal bleeding; used to manage irregular cycles, heavy menstrual bleeding, and premenstrual syndrome.", color: "1565C0" },
  ];
  const bpos = [
    { x: 0.3, y: 1.1 }, { x: 4.55, y: 1.1 }, { x: 8.8, y: 1.1 },
    { x: 0.3, y: 3.1 }, { x: 4.55, y: 3.1 }, { x: 8.8, y: 3.1 },
  ];
  benefits.forEach((b, i) => {
    const { x, y } = bpos[i];
    sl.addShape(pres.ShapeType.roundRect, {
      x, y, w: 3.9, h: 1.85,
      fill: { type: "solid", color: C.white },
      line: { color: b.color, pt: 2 },
      rectRadius: 0.15,
      shadow: { type: "outer", blur: 6, offset: 2, angle: 45, color: "BBBBBB", opacity: 0.2 },
    });
    sl.addShape(pres.ShapeType.rect, {
      x, y, w: 3.9, h: 0.36,
      fill: { type: "solid", color: b.color },
      line: { type: "none" },
    });
    sl.addText(b.title, {
      x: x + 0.1, y: y + 0.02, w: 3.7, h: 0.32,
      fontSize: 11, bold: true, color: C.white,
      valign: "middle", margin: 0,
    });
    sl.addText(b.body, {
      x: x + 0.12, y: y + 0.44, w: 3.7, h: 1.3,
      fontSize: 10.5, color: C.darkText,
      lineSpacingMultiple: 1.3,
    });
  });
}

// ════════════════════════════════════════════════════
// SLIDE 7 β€” SUMMARY TABLE
// ════════════════════════════════════════════════════
{
  let sl = pres.addSlide();
  addBgRect(sl, C.deepPurple, C.deepPurple);

  sl.addText("QUICK REFERENCE SUMMARY", {
    x: 0.4, y: 0.12, w: 10, h: 0.55,
    fontSize: 24, bold: true, color: C.white, charSpacing: 2,
  });
  addTag(sl, "SLIDE 07", 11.3, 0.22, C.accent);

  const rows = [
    ["Category", "Combined OCP (COCP)", "Progestin-Only (Mini-pill)"],
    ["Components", "Estrogen + Progestin", "Progestin only"],
    ["Primary MOA", "Inhibits ovulation (FSH+LH suppression)", "Cervical mucus thickening"],
    ["Efficacy (perfect use)", "~99.7%", "~99.5%"],
    ["Key CI", "VTE, breast cancer, migraine+aura, pregnancy", "Active liver disease"],
    ["Breastfeeding", "NOT preferred (↓ milk)", "Preferred choice"],
    ["Main ADR", "Nausea, DVT, HTN, breakthrough bleeding", "Irregular spotting, amenorrhea"],
  ];

  const colWidths = [2.2, 5.0, 5.0];
  const rowH = 0.62;
  const tableX = 0.3;
  let tableY = 0.85;
  rows.forEach((row, ri) => {
    let cx = tableX;
    row.forEach((cell, ci) => {
      const isHeader = ri === 0;
      const isRowLabel = ci === 0 && ri > 0;
      sl.addShape(pres.ShapeType.rect, {
        x: cx, y: tableY, w: colWidths[ci], h: rowH,
        fill: { type: "solid", color: isHeader ? C.accent : isRowLabel ? "3D2480" : (ri % 2 === 0 ? "2A1F5A" : "231A4F") },
        line: { color: "5C3BC8", pt: 0.5 },
      });
      sl.addText(cell, {
        x: cx + 0.08, y: tableY + 0.04, w: colWidths[ci] - 0.12, h: rowH - 0.08,
        fontSize: isHeader ? 11 : 10.5,
        bold: isHeader || isRowLabel,
        color: isHeader ? C.white : (isRowLabel ? C.accentLight : "D0C8F0"),
        valign: "middle",
        lineSpacingMultiple: 1.2,
      });
      cx += colWidths[ci];
    });
    tableY += rowH;
  });
}

// ════════════════════════════════════════════════════
// SLIDE 8 β€” CLOSING SLIDE
// ════════════════════════════════════════════════════
{
  let sl = pres.addSlide();
  addBgRect(sl, C.deepPurple, C.deepPurple);

  sl.addShape(pres.ShapeType.ellipse, {
    x: -1, y: -1, w: 5, h: 5,
    fill: { type: "solid", color: C.purple },
    line: { type: "none" },
  });
  sl.addShape(pres.ShapeType.ellipse, {
    x: 9.5, y: 3.2, w: 4, h: 4,
    fill: { type: "solid", color: C.accent },
    line: { type: "none" },
  });
  sl.addShape(pres.ShapeType.rect, {
    x: 0, y: 0, w: "100%", h: "100%",
    fill: { type: "solid", color: C.deepPurple },
    line: { type: "none" },
    transparency: 30,
  });

  sl.addText("KEY TAKEAWAYS", {
    x: 1, y: 0.5, w: 11, h: 0.5,
    fontSize: 13, bold: true, color: C.accentLight,
    align: "center", charSpacing: 4,
  });

  const takeaways = [
    "OCPs are classified as Combined (estrogen + progestin) or Progestin-Only (mini-pills)",
    "Primary MOA: Inhibition of ovulation via FSH/LH suppression at hypothalamus-pituitary axis",
    "Absolute contraindications include VTE history, estrogen-sensitive cancers, pregnancy, migraine with aura",
    "Key adverse effects: thromboembolic events, hypertension, nausea, breakthrough bleeding",
    "Non-contraceptive benefits: dysmenorrhea, PCOS, endometriosis, acne, reduced ovarian/endometrial cancer risk",
  ];
  sl.addText(takeaways.map((t, i) => ({
    text: `${i + 1}.  ${t}` + (i < takeaways.length - 1 ? "\n" : ""),
    options: { color: i % 2 === 0 ? C.white : C.accentLight },
  })), {
    x: 0.8, y: 1.2, w: 11.5, h: 3.8,
    fontSize: 13, lineSpacingMultiple: 1.7,
    align: "left",
  });

  sl.addText("Reference: Goodman & Gilman's Pharmacological Basis of Therapeutics | Berek & Novak's Gynecology", {
    x: 0.5, y: 5.05, w: 12, h: 0.35,
    fontSize: 9, color: "6A5E9C", italic: true, align: "center",
  });
}

// ── Write file ───────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/workspace/ocp-ppt/OCPs_Classification_MOA_Contraindications.pptx" })
  .then(() => console.log("βœ… PPTX created successfully"))
  .catch(e => console.error("❌ Error:", e));
Running Command

cd /home/daytona/workspace/ocp-ppt && node ocp_presentation.js

Running Command

ls -lh /home/daytona/workspace/ocp-ppt/OCPs_Classification_MOA_Contraindications.pptx

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

OCPs Classification MOA Contraindications

Presentation Β· PPTX


The PPT contains 8 slides with a professional purple/pink theme:
SlideContent
1Title Slide - Oral Contraceptive Pills (OCPs)
2Classification - Combined OCPs (COCPs) vs. Progestin-Only (Mini-pills), with types (monophasic/biphasic/triphasic), components, and routes
3Mechanism of Action - 4 mechanisms: Inhibition of ovulation, cervical mucus changes, endometrial changes, tubal motility
4Contraindications - Absolute (WHO 4) vs. Relative (WHO 3) side-by-side comparison
5Adverse Effects - 6 categories: thromboembolic, cardiovascular, hormonal/metabolic, hepatic, CNS/neurological, reproductive
6Benefits & Non-Contraceptive Uses - Dysmenorrhea, PCOS, endometriosis, acne, cancer risk reduction
7Quick Reference Summary Table - COCP vs. Mini-pill comparison
8Key Takeaways - 5 concise clinical points
Content is based on Goodman & Gilman's Pharmacological Basis of Therapeutics and Berek & Novak's Gynecology.

Add last slide Thank you virat kohli photo holding Ipl trophy πŸ†

I'll search for a Virat Kohli IPL trophy photo and add a "Thank You" slide to the existing presentation.
Searching the Web

Virat Kohli IPL trophy photo 2024 RCB winner celebration

Found a good image URL. Let me download it and add the Thank You slide:
Running Command

cd /home/daytona/workspace/ocp-ppt && curl -L -o virat_ipl.jpg "https://cdn.gulte.com/wp-content/uploads/2025/06/virat-kohli-trophy-ipl-2025.jpg" --max-time 30 && ls -lh virat_ipl.jpg

Image downloaded. Now let me write and run the script to add the Thank You slide:
Writing File

~/ocp-ppt/add_thankyou_slide.js

const pptxgen = require("pptxgenjs");
const fs = require("fs");
const path = require("path");

// Read the existing pptx
const pptxPath = "/home/daytona/workspace/ocp-ppt/OCPs_Classification_MOA_Contraindications.pptx";

// We'll use pptxgenjs to open and append
// pptxgenjs doesn't support opening existing files directly, so we re-run the
// full generation + new slide approach via a separate script that appends.
// Instead, use the load() method supported in pptxgenjs v3+

const pres = new pptxgen();

// Load existing file
pres.load(pptxPath).then(() => {
  // ── Thank You Slide ──────────────────────────────────────────────
  const C = {
    deepPurple:  "2D1B69",
    purple:      "5C3BC8",
    accent:      "E91E8C",
    accentLight: "F48FB1",
    white:       "FFFFFF",
    gold:        "FFD700",
    darkText:    "1A1035",
  };

  let sl = pres.addSlide();

  // Background
  sl.addShape(pres.ShapeType.rect, {
    x: 0, y: 0, w: "100%", h: "100%",
    fill: { type: "solid", color: C.deepPurple },
    line: { type: "none" },
  });

  // Decorative circles
  sl.addShape(pres.ShapeType.ellipse, {
    x: -0.8, y: -0.8, w: 3.5, h: 3.5,
    fill: { type: "solid", color: C.purple },
    line: { type: "none" },
  });
  sl.addShape(pres.ShapeType.ellipse, {
    x: 10.2, y: 3.8, w: 3.5, h: 3.5,
    fill: { type: "solid", color: C.accent },
    line: { type: "none" },
  });
  // Gold accent strip at bottom
  sl.addShape(pres.ShapeType.rect, {
    x: 0, y: 5.25, w: "100%", h: 0.25,
    fill: { type: "solid", color: C.gold },
    line: { type: "none" },
  });

  // Virat Kohli image (left side)
  const imgData = fs.readFileSync("/home/daytona/workspace/ocp-ppt/virat_ipl.jpg").toString("base64");
  sl.addImage({
    data: "image/jpeg;base64," + imgData,
    x: 0.3, y: 0.55, w: 5.2, h: 4.6,
  });

  // Gold border frame around image
  sl.addShape(pres.ShapeType.rect, {
    x: 0.3, y: 0.55, w: 5.2, h: 4.6,
    fill: { type: "none" },
    line: { color: C.gold, pt: 3 },
  });

  // Trophy emoji / label
  sl.addText("πŸ†  IPL 2025 CHAMPION", {
    x: 0.3, y: 5.0, w: 5.2, h: 0.35,
    fontSize: 11, bold: true, color: C.gold,
    align: "center", valign: "middle",
  });

  // Right side: THANK YOU text
  sl.addText("THANK", {
    x: 6.0, y: 0.5, w: 7.0, h: 1.1,
    fontSize: 72, bold: true, color: C.white,
    align: "left",
  });
  sl.addText("YOU!", {
    x: 6.0, y: 1.45, w: 7.0, h: 1.1,
    fontSize: 72, bold: true, color: C.accent,
    align: "left",
  });

  // Divider line
  sl.addShape(pres.ShapeType.line, {
    x: 6.0, y: 2.65, w: 6.5, h: 0,
    line: { color: C.gold, pt: 2.5 },
  });

  // Quote
  sl.addText('"Champions keep playing until they get it right."', {
    x: 6.0, y: 2.85, w: 6.8, h: 0.7,
    fontSize: 13, italic: true, color: C.accentLight,
    align: "left",
    lineSpacingMultiple: 1.3,
  });
  sl.addText("β€” Virat Kohli  |  RCB Captain", {
    x: 6.0, y: 3.55, w: 6.8, h: 0.35,
    fontSize: 11, color: C.gold,
    align: "left",
  });

  // Bottom text
  sl.addText("Presented by: Pharmacology Team  β€’  Topic: Oral Contraceptive Pills (OCPs)", {
    x: 6.0, y: 4.25, w: 6.8, h: 0.4,
    fontSize: 10, color: "9B8EC4", italic: true,
    align: "left",
  });

  // Trophy icon row
  sl.addText("πŸ† 🌟 🏏 πŸ”΄", {
    x: 6.0, y: 4.75, w: 6.8, h: 0.45,
    fontSize: 22, align: "left",
  });

  // Save
  return pres.writeFile({ fileName: pptxPath });
}).then(() => {
  console.log("βœ… Thank You slide added successfully!");
}).catch(err => {
  console.error("❌ Error:", err);
});
Running Command

cd /home/daytona/workspace/ocp-ppt && node add_thankyou_slide.js 2>&1

pptxgenjs doesn't support load(). I'll add the Thank You slide directly into the original generation script and regenerate the full file:
Reading File
Editing File

~/ocp-ppt/ocp_presentation.js

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

cd /home/daytona/workspace/ocp-ppt && node ocp_presentation.js 2>&1

Running Command

ls -lh /home/daytona/workspace/ocp-ppt/OCPs_Classification_MOA_Contraindications.pptx

Done! The file size jumped from 183K to 289K confirming the image was embedded. Here's your updated file:

OCPs Classification MOA Contraindications

Presentation Β· PPTX


Slide 9 - Thank You includes:
  • πŸ“Έ Virat Kohli holding the IPL 2025 trophy with a gold border frame
  • Big bold "THANK YOU!" text (white + pink)
  • Gold caption: IPL 2025 Champion β€’ Virat Kohli | RCB
  • Quote: "Champions keep playing until they get it right."
  • πŸ† 🌟 🏏 πŸ”΄ trophy emoji row
  • Presentation credit label at the bottom

Remove quotes & below

Removing the quote, the "β€” Virat Kohli β€’ RCB Captain" line, the presentation label, and the emoji row from the Thank You slide.
Editing File

~/ocp-ppt/ocp_presentation.js

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/ocp-ppt/ocp_presentation.js'
Also remove the gold divider line since nothing follows THANK YOU! now:
Editing File

~/ocp-ppt/ocp_presentation.js

Error: String not found in file: '  // Gold divider
  sl.addShape(pres.ShapeType.line, {
    x: 6.1, y: 2.68, w: 6.4, h: 0,
    line: { color: "FFD700", pt: 2.5 },
  });

  // Quote
'
The quote block is already gone. Just regenerate now:
Running Command

cd /home/daytona/workspace/ocp-ppt && node ocp_presentation.js 2>&1

Done! Updated file is ready:

OCPs Classification MOA Contraindications

Presentation Β· PPTX

The Thank You slide now has just:
  • Virat Kohli IPL trophy photo (with gold border)
  • THANK YOU! text
  • Gold divider line
  • IPL 2025 Champion caption below the photo
All the quote, attribution, presentation label, and emoji row have been removed.
This is a shared conversation. Sign in to Orris to start your own chat.