Make ppt on peptic ulcer drugs

Reading File
Reading File
Reading File
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Reading File
Finding Sources
Searching Images

peptic ulcer pathophysiology acid secretion diagram

Reading File
Finding Sources
Searching Images

proton pump inhibitor mechanism of action gastric acid

Finding Sources
Searching Images

H. pylori eradication triple therapy antibiotics

Reading File
Searching Images

antacid sucralfate misoprostol cytoprotective peptic ulcer drug mechanism

Running Command

mkdir -p /home/daytona/workspace/peptic-ulcer-ppt && ls /home/daytona/workspace/peptic-ulcer-ppt/

Writing File

~/peptic-ulcer-ppt/create_ppt.js

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

const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Drugs for Peptic Ulcer Disease";
pres.author = "Medical Education";

// ─── Colour palette ──────────────────────────────────────────────────────────
const BG       = "0D1B2A";  // deep navy  (dominant)
const ACCENT   = "E85D04";  // vivid orange
const CARD_BG  = "1B2E42";  // slightly lighter navy card
const WHITE    = "FFFFFF";
const GOLD     = "FFB703";
const TEAL     = "2EC4B6";
const GREY_LT  = "C9D6E3";
const SUBTITLE_C = "8AAFC8";

// ─── Helper: slide background ─────────────────────────────────────────────────
function navyBg(slide) {
  slide.addShape(pres.ShapeType.rect, {
    x: 0, y: 0, w: "100%", h: "100%", fill: { color: BG }, line: { color: BG }
  });
}

// ─── Helper: accent bar (top strip) ───────────────────────────────────────────
function accentBar(slide) {
  slide.addShape(pres.ShapeType.rect, {
    x: 0, y: 0, w: "100%", h: 0.09, fill: { color: ACCENT }, line: { color: ACCENT }
  });
}

// ─── Helper: slide heading ─────────────────────────────────────────────────────
function slideTitle(slide, title) {
  slide.addText(title, {
    x: 0.45, y: 0.18, w: 9.1, h: 0.6,
    fontSize: 26, bold: true, color: WHITE, fontFace: "Calibri",
    charSpacing: 1, margin: 0
  });
  // orange underline
  slide.addShape(pres.ShapeType.rect, {
    x: 0.45, y: 0.82, w: 1.2, h: 0.045, fill: { color: ACCENT }, line: { color: ACCENT }
  });
}

// ─── Helper: card box ─────────────────────────────────────────────────────────
function card(slide, x, y, w, h, label, items, labelColor) {
  slide.addShape(pres.ShapeType.roundRect, {
    x, y, w, h,
    fill: { color: CARD_BG },
    line: { color: ACCENT, pt: 1.2 },
    rectRadius: 0.1
  });
  if (label) {
    slide.addText(label, {
      x: x + 0.15, y: y + 0.08, w: w - 0.3, h: 0.38,
      fontSize: 13, bold: true, color: labelColor || GOLD, fontFace: "Calibri",
      margin: 0
    });
  }
  if (items && items.length) {
    const bullets = items.map((t, i) => ({
      text: t,
      options: { bullet: true, breakLine: i < items.length - 1, color: GREY_LT, fontSize: 11.5, fontFace: "Calibri" }
    }));
    slide.addText(bullets, {
      x: x + 0.18, y: y + (label ? 0.48 : 0.12), w: w - 0.35,
      h: h - (label ? 0.55 : 0.2),
      margin: 0, valign: "top"
    });
  }
}

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

  // Large accent stripe left
  s.addShape(pres.ShapeType.rect, {
    x: 0, y: 0, w: 0.25, h: "100%", fill: { color: ACCENT }, line: { color: ACCENT }
  });

  // Pill shape behind main title
  s.addShape(pres.ShapeType.roundRect, {
    x: 0.55, y: 1.45, w: 8.8, h: 1.6,
    fill: { color: CARD_BG },
    line: { color: ACCENT, pt: 2 },
    rectRadius: 0.18
  });

  s.addText("DRUGS FOR", {
    x: 0.7, y: 1.22, w: 8.6, h: 0.55,
    fontSize: 18, bold: false, color: SUBTITLE_C, fontFace: "Calibri",
    charSpacing: 8, align: "center", margin: 0
  });
  s.addText("PEPTIC ULCER DISEASE", {
    x: 0.7, y: 1.55, w: 8.6, h: 1.0,
    fontSize: 40, bold: true, color: WHITE, fontFace: "Calibri",
    charSpacing: 2, align: "center", margin: 0
  });

  s.addText("Pharmacological Management · Mechanisms · Clinical Protocols", {
    x: 0.7, y: 3.22, w: 8.6, h: 0.45,
    fontSize: 14, color: SUBTITLE_C, fontFace: "Calibri",
    italic: true, align: "center", margin: 0
  });

  // Bottom tag line
  s.addText("Sources: Goodman & Gilman · Harrison's · Yamada's Gastroenterology · KD Tripathi", {
    x: 0.4, y: 4.9, w: 9.2, h: 0.42,
    fontSize: 9.5, color: SUBTITLE_C, fontFace: "Calibri", align: "right", italic: true, margin: 0
  });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 2 — OVERVIEW: WHY DRUGS ARE NEEDED (Pathophysiology)
// ═══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  navyBg(s);
  accentBar(s);
  slideTitle(s, "Pathophysiology — Why Pharmacotherapy?");

  // Imbalance diagram — two vertical panels
  const panels = [
    {
      x: 0.4, label: "AGGRESSIVE FACTORS",
      color: ACCENT,
      items: ["Excess HCl secretion", "Pepsin (mucosal proteolysis)", "H. pylori infection", "NSAIDs (COX-1 inhibition)", "Bile reflux", "Stress / smoking / alcohol"]
    },
    {
      x: 5.3, label: "DEFENSIVE FACTORS",
      color: TEAL,
      items: ["Mucus–bicarbonate layer", "Mucosal blood flow", "Prostaglandins (PGE₂)", "Tight epithelial junctions", "Cell renewal / restitution", "Alkaline tide / duodenal pH"]
    }
  ];
  panels.forEach(p => {
    s.addShape(pres.ShapeType.roundRect, {
      x: p.x, y: 1.0, w: 4.45, h: 3.85,
      fill: { color: CARD_BG },
      line: { color: p.color, pt: 2 },
      rectRadius: 0.12
    });
    s.addText(p.label, {
      x: p.x + 0.15, y: 1.06, w: 4.15, h: 0.45,
      fontSize: 13.5, bold: true, color: p.color, fontFace: "Calibri",
      charSpacing: 2, align: "center", margin: 0
    });
    const bullets = p.items.map((t, i) => ({
      text: t,
      options: { bullet: true, breakLine: i < p.items.length - 1, color: GREY_LT, fontSize: 12, fontFace: "Calibri" }
    }));
    s.addText(bullets, {
      x: p.x + 0.2, y: 1.55, w: 4.1, h: 3.1, margin: 0, valign: "top"
    });
  });

  // Middle arrow
  s.addShape(pres.ShapeType.rect, {
    x: 4.88, y: 2.65, w: 0.24, h: 0.06, fill: { color: ACCENT }, line: { color: ACCENT }
  });
  s.addText("vs", {
    x: 4.72, y: 2.38, w: 0.56, h: 0.56,
    fontSize: 18, bold: true, color: ACCENT, fontFace: "Calibri",
    align: "center", margin: 0
  });

  s.addText("Ulcer occurs when aggressive factors overcome defensive mechanisms", {
    x: 0.4, y: 4.9, w: 9.2, h: 0.35,
    fontSize: 10.5, color: SUBTITLE_C, fontFace: "Calibri", italic: true, align: "center", margin: 0
  });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 3 — CLASSIFICATION OF ANTI-ULCER DRUGS
// ═══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  navyBg(s);
  accentBar(s);
  slideTitle(s, "Classification of Anti-Ulcer Drugs");

  const classes = [
    { label: "1. Antacids", color: GOLD,
      items: ["Neutralise HCl already secreted", "Mg(OH)₂, Al(OH)₃, CaCO₃, NaHCO₃", "Fast relief; short duration"] },
    { label: "2. H₂ Receptor Antagonists", color: TEAL,
      items: ["Block histamine H₂-R on parietal cells", "Cimetidine, Ranitidine, Famotidine, Nizatidine", "↓ basal & nocturnal acid secretion"] },
    { label: "3. Proton Pump Inhibitors (PPIs)", color: ACCENT,
      items: ["Irreversibly block H⁺/K⁺-ATPase", "Omeprazole, Lansoprazole, Pantoprazole, Rabeprazole, Esomeprazole", "Most potent acid suppressants"] },
    { label: "4. Cytoprotective Agents", color: "#A8DADC",
      items: ["Sucralfate — forms protective coat", "Misoprostol (PGE₁ analogue) — ↑ mucus & HCO₃⁻", "Bismuth compounds"] },
    { label: "5. H. pylori Eradication", color: "#E9C46A",
      items: ["Triple therapy: PPI + Amoxicillin + Clarithromycin", "Bismuth quadruple therapy", "14-day course preferred"] },
    { label: "6. Potassium-Competitive Acid Blockers (P-CABs)", color: "#C77DFF",
      items: ["Vonoprazan, Revaprazan", "Rapid, potent, pH-independent", "Do not require acidic activation"] }
  ];

  const cols = [
    [classes[0], classes[1]],
    [classes[2], classes[3]],
    [classes[4], classes[5]]
  ];

  const colX = [0.35, 3.55, 6.75];
  const rowY = [0.98, 2.87];

  colX.forEach((cx, ci) => {
    rowY.forEach((cy, ri) => {
      const cls = cols[ci][ri];
      s.addShape(pres.ShapeType.roundRect, {
        x: cx, y: cy, w: 3.05, h: 1.72,
        fill: { color: CARD_BG },
        line: { color: cls.color, pt: 1.5 },
        rectRadius: 0.1
      });
      s.addText(cls.label, {
        x: cx + 0.12, y: cy + 0.07, w: 2.82, h: 0.36,
        fontSize: 11.5, bold: true, color: cls.color, fontFace: "Calibri", margin: 0
      });
      const bullets = cls.items.map((t, i) => ({
        text: t,
        options: { bullet: true, breakLine: i < cls.items.length - 1, color: GREY_LT, fontSize: 10, fontFace: "Calibri" }
      }));
      s.addText(bullets, {
        x: cx + 0.12, y: cy + 0.43, w: 2.85, h: 1.2, margin: 0, valign: "top"
      });
    });
  });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 4 — ANTACIDS
// ═══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  navyBg(s);
  accentBar(s);
  slideTitle(s, "Antacids");

  const cols = [
    {
      x: 0.35, label: "MECHANISM", color: GOLD,
      items: [
        "Neutralise secreted HCl in stomach lumen",
        "Raise intragastric pH → inactivate pepsin (pH > 4)",
        "Do NOT reduce HCl secretion",
        "Provide rapid symptomatic relief"
      ]
    },
    {
      x: 3.48, label: "TYPES & EXAMPLES", color: TEAL,
      items: [
        "Systemic: Sodium bicarbonate (NaHCO₃)",
        "Non-systemic — Mg-based: Mg(OH)₂, MgO (laxative effect)",
        "Non-systemic — Al-based: Al(OH)₃ (constipating)",
        "CaCO₃ (Tums) — fast-acting, rebound risk",
        "Combinations: Maalox (Mg + Al), Gaviscon"
      ]
    },
    {
      x: 6.6, label: "CLINICAL NOTES", color: ACCENT,
      items: [
        "Dose: 100–140 mEq, 1h & 3h after meals + bedtime",
        "Adverse effects: diarrhoea (Mg), constipation (Al)",
        "Drug interactions: chelate fluoroquinolones, tetracyclines",
        "Avoid high-Na antacids in hypertension / cardiac failure",
        "Al antacids → phosphate binding (useful in renal failure)"
      ]
    }
  ];

  cols.forEach(c => {
    s.addShape(pres.ShapeType.roundRect, {
      x: c.x, y: 0.98, w: 3.0, h: 3.8,
      fill: { color: CARD_BG },
      line: { color: c.color, pt: 1.5 },
      rectRadius: 0.1
    });
    s.addText(c.label, {
      x: c.x + 0.12, y: 1.05, w: 2.78, h: 0.38,
      fontSize: 12.5, bold: true, color: c.color, fontFace: "Calibri",
      charSpacing: 1.5, margin: 0
    });
    const bullets = c.items.map((t, i) => ({
      text: t,
      options: { bullet: true, breakLine: i < c.items.length - 1, color: GREY_LT, fontSize: 11, fontFace: "Calibri" }
    }));
    s.addText(bullets, {
      x: c.x + 0.15, y: 1.5, w: 2.75, h: 3.1, margin: 0, valign: "top"
    });
  });

  s.addText("Antacids provide fast, short-term relief but are not sufficient for ulcer healing alone", {
    x: 0.35, y: 4.92, w: 9.3, h: 0.33,
    fontSize: 10, color: SUBTITLE_C, fontFace: "Calibri", italic: true, align: "center", margin: 0
  });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 5 — H₂ RECEPTOR ANTAGONISTS
// ═══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  navyBg(s);
  accentBar(s);
  slideTitle(s, "H₂ Receptor Antagonists (H₂RAs)");

  // Large mechanism card
  s.addShape(pres.ShapeType.roundRect, {
    x: 0.35, y: 0.98, w: 9.3, h: 0.85,
    fill: { color: CARD_BG }, line: { color: TEAL, pt: 1.5 }, rectRadius: 0.1
  });
  s.addText([
    { text: "Mechanism: ", options: { bold: true, color: TEAL } },
    { text: "Competitively block histamine H₂ receptors on parietal cells → ↓ cAMP → ↓ H⁺/K⁺-ATPase activation → ↓ acid secretion. Block only one of three pathways (histamine, gastrin, ACh) → tachyphylaxis possible. Ranitidine withdrawn 2020 (NDMA carcinogen risk).", options: { color: GREY_LT } }
  ], {
    x: 0.5, y: 1.03, w: 9.0, h: 0.72, fontSize: 11.5, fontFace: "Calibri", margin: 0, valign: "middle"
  });

  // Drug comparison table header
  const hdr = ["Drug", "Dose (PUD)", "Relative Potency", "Special Features"];
  const hdrW = [1.8, 2.2, 2.2, 3.0];
  const tableX = 0.35;
  const tableY = 1.97;

  hdrW.forEach((w, i) => {
    const xPos = tableX + hdrW.slice(0, i).reduce((a, b) => a + b, 0);
    s.addShape(pres.ShapeType.rect, {
      x: xPos, y: tableY, w: w, h: 0.38,
      fill: { color: TEAL }, line: { color: BG, pt: 1 }
    });
    s.addText(hdr[i], {
      x: xPos + 0.05, y: tableY + 0.03, w: w - 0.1, h: 0.33,
      fontSize: 11, bold: true, color: BG, fontFace: "Calibri", margin: 0, valign: "middle"
    });
  });

  const rows = [
    ["Cimetidine",   "400 mg bid",  "1×",   "First H₂RA; many CYP drug interactions; anti-androgenic"],
    ["Ranitidine",   "300 mg hs",   "5–10×", "Withdrawn 2020 (NDMA contamination)"],
    ["Famotidine",   "40 mg hs",    "30–40×","No CYP450 interactions; safest in renal disease (dose adjust)"],
    ["Nizatidine",   "300 mg hs",   "10×",   "Similar to ranitidine; minimal hepatic first-pass"]
  ];
  rows.forEach((row, ri) => {
    const rowBg = ri % 2 === 0 ? "1B2E42" : "223450";
    hdrW.forEach((w, ci) => {
      const xPos = tableX + hdrW.slice(0, ci).reduce((a, b) => a + b, 0);
      const yPos = tableY + 0.38 + ri * 0.42;
      s.addShape(pres.ShapeType.rect, {
        x: xPos, y: yPos, w: w, h: 0.42,
        fill: { color: rowBg }, line: { color: CARD_BG, pt: 0.5 }
      });
      s.addText(row[ci], {
        x: xPos + 0.07, y: yPos + 0.04, w: w - 0.12, h: 0.35,
        fontSize: 10.5, color: GREY_LT, fontFace: "Calibri", margin: 0, valign: "middle",
        bold: ci === 0
      });
    });
  });

  s.addText("H₂RAs are useful for mild-moderate PUD & nocturnal acid suppression; PPIs preferred for active ulcer healing", {
    x: 0.35, y: 4.92, w: 9.3, h: 0.33,
    fontSize: 10, color: SUBTITLE_C, fontFace: "Calibri", italic: true, align: "center", margin: 0
  });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 6 — PROTON PUMP INHIBITORS
// ═══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  navyBg(s);
  accentBar(s);
  slideTitle(s, "Proton Pump Inhibitors (PPIs)");

  // Mechanism box
  s.addShape(pres.ShapeType.roundRect, {
    x: 0.35, y: 0.97, w: 9.3, h: 1.02,
    fill: { color: CARD_BG }, line: { color: ACCENT, pt: 1.8 }, rectRadius: 0.1
  });
  s.addText([
    { text: "Mechanism: ", options: { bold: true, color: ACCENT } },
    { text: "Substituted benzimidazole prodrugs. Absorbed as neutral species → concentrated in parietal cell secretory canaliculus (acidic, pH <2) → converted to active sulphenamide → covalently binds & irreversibly inhibits H⁺/K⁺-ATPase (final common pathway of ALL acid secretion). New pumps must be synthesised before secretion resumes (~18–24 h). ", options: { color: GREY_LT } },
    { text: "Most potent acid suppressants available.", options: { bold: true, color: GOLD } }
  ], {
    x: 0.5, y: 1.03, w: 9.05, h: 0.88, fontSize: 11, fontFace: "Calibri", margin: 0, valign: "middle"
  });

  // PPI drug cards (3 per row)
  const drugs = [
    { name: "Omeprazole",    dose: "20 mg/day",  note: "Prototype PPI; chiral precursor of esomeprazole; CYP2C19 metabolism" },
    { name: "Esomeprazole",  dose: "20–40 mg/day",note: "S-enantiomer; higher bioavailability; less CYP2C19 variability" },
    { name: "Lansoprazole",  dose: "30 mg/day",   note: "Faster onset; available as orally disintegrating tabs" },
    { name: "Pantoprazole",  dose: "40 mg/day",   note: "IV form available; fewest drug interactions; safest for long-term" },
    { name: "Rabeprazole",   dose: "20 mg/day",   note: "Non-enzymatic activation; faster effect; minimal CYP interactions" },
    { name: "Dexlansoprazole",dose:"30 mg/day",   note: "Dual delayed-release; maintains plasma levels longer" }
  ];

  const dColW = 3.0, dRowH = 1.12;
  const dStartX = [0.35, 3.5, 6.65];
  const dStartY = [2.1, 3.32];

  drugs.forEach((d, idx) => {
    const ci = idx % 3, ri = Math.floor(idx / 3);
    const x = dStartX[ci], y = dStartY[ri];
    s.addShape(pres.ShapeType.roundRect, {
      x, y, w: dColW, h: dRowH,
      fill: { color: CARD_BG }, line: { color: ACCENT, pt: 1 }, rectRadius: 0.08
    });
    s.addText(d.name, {
      x: x + 0.12, y: y + 0.06, w: 1.9, h: 0.34,
      fontSize: 12, bold: true, color: GOLD, fontFace: "Calibri", margin: 0
    });
    s.addText(d.dose, {
      x: x + 2.0, y: y + 0.06, w: 0.88, h: 0.34,
      fontSize: 10.5, color: ACCENT, fontFace: "Calibri", italic: true, margin: 0, align: "right"
    });
    s.addText(d.note, {
      x: x + 0.12, y: y + 0.43, w: 2.8, h: 0.62,
      fontSize: 9.5, color: GREY_LT, fontFace: "Calibri", margin: 0, valign: "top"
    });
  });

  s.addText("Administer 30 min before meals for optimal efficacy | Long-term use: risk of hypomagnesaemia, C. diff, bone fractures", {
    x: 0.35, y: 4.92, w: 9.3, h: 0.33,
    fontSize: 9.5, color: SUBTITLE_C, fontFace: "Calibri", italic: true, align: "center", margin: 0
  });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 7 — CYTOPROTECTIVE AGENTS
// ═══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  navyBg(s);
  accentBar(s);
  slideTitle(s, "Cytoprotective Agents");

  const agents = [
    {
      name: "Sucralfate", color: TEAL,
      mech: "Aluminium salt of sucrose octasulphate. Polymerises in acidic environment → forms viscous paste that adheres to ulcer crater base → physical barrier against acid, pepsin & bile. Also stimulates prostaglandin synthesis.",
      dose: "1 g QID (1h before meals & bedtime)",
      notes: ["Minimal systemic absorption", "Constipation (Al content)", "Chelates fluoroquinolones, digoxin — give 2h apart", "Avoid in renal failure (Al accumulation)", "Pregnancy category B — safe"]
    },
    {
      name: "Misoprostol (PGE₁ analogue)", color: "#E9C46A",
      mech: "Synthetic prostaglandin E₁ analogue. ↓ gastric acid secretion (via Gs inhibition in parietal cells). ↑ mucus secretion, ↑ bicarbonate secretion, ↑ mucosal blood flow → cytoprotection.",
      dose: "200 µg QID (with NSAID therapy)",
      notes: ["Drug of choice for NSAID-induced ulcer prophylaxis", "Adverse: diarrhoea, abdominal cramps (dose-dependent)", "CONTRAINDICATED in pregnancy (uterotonic → abortion)", "70–80% effective vs placebo for NSAID ulcer prevention"]
    },
    {
      name: "Bismuth Compounds", color: "#C77DFF",
      mech: "Bismuth subsalicylate / tripotassium dicitratobismuthate. Coats ulcer base. Anti-H. pylori activity (disrupts cell wall, inhibits urease, adhesion factors). ↑ mucus & PG synthesis.",
      dose: "525 mg QID (bismuth subsalicylate)",
      notes: ["Used in bismuth quadruple H. pylori therapy", "Stool / tongue blackening (warn patients)", "Avoid in renal impairment (bismuth toxicity)", "May cause encephalopathy with prolonged high-dose use"]
    }
  ];

  const colX = [0.3, 3.47, 6.64];
  agents.forEach((a, i) => {
    const x = colX[i];
    s.addShape(pres.ShapeType.roundRect, {
      x, y: 0.98, w: 3.02, h: 4.3,
      fill: { color: CARD_BG }, line: { color: a.color, pt: 1.8 }, rectRadius: 0.1
    });
    s.addText(a.name, {
      x: x + 0.12, y: 1.04, w: 2.8, h: 0.42,
      fontSize: 12, bold: true, color: a.color, fontFace: "Calibri", margin: 0
    });
    s.addText("Mechanism", {
      x: x + 0.12, y: 1.5, w: 2.8, h: 0.25,
      fontSize: 10, bold: true, color: GOLD, fontFace: "Calibri", margin: 0
    });
    s.addText(a.mech, {
      x: x + 0.12, y: 1.75, w: 2.82, h: 1.05,
      fontSize: 9.5, color: GREY_LT, fontFace: "Calibri", margin: 0, valign: "top"
    });
    s.addText(`Dose: ${a.dose}`, {
      x: x + 0.12, y: 2.82, w: 2.82, h: 0.3,
      fontSize: 9.5, bold: true, color: TEAL, fontFace: "Calibri", margin: 0
    });
    s.addText("Key Points", {
      x: x + 0.12, y: 3.14, w: 2.8, h: 0.25,
      fontSize: 10, bold: true, color: GOLD, fontFace: "Calibri", margin: 0
    });
    const bullets = a.notes.map((t, j) => ({
      text: t,
      options: { bullet: true, breakLine: j < a.notes.length - 1, color: GREY_LT, fontSize: 9, fontFace: "Calibri" }
    }));
    s.addText(bullets, {
      x: x + 0.12, y: 3.39, w: 2.85, h: 1.72, margin: 0, valign: "top"
    });
  });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 8 — H. PYLORI ERADICATION
// ═══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  navyBg(s);
  accentBar(s);
  slideTitle(s, "H. pylori Eradication Therapy");

  // Rationale box
  s.addShape(pres.ShapeType.roundRect, {
    x: 0.35, y: 0.97, w: 9.3, h: 0.72,
    fill: { color: CARD_BG }, line: { color: GOLD, pt: 1.5 }, rectRadius: 0.1
  });
  s.addText([
    { text: "Why eradicate? ", options: { bold: true, color: GOLD } },
    { text: "H. pylori causes 70–90% of duodenal ulcers and 60–70% of gastric ulcers. Eradication prevents recurrence (reduces relapse from ~80% to <5% at 1 year) and reduces gastric cancer risk.", options: { color: GREY_LT } }
  ], {
    x: 0.5, y: 1.02, w: 9.05, h: 0.6, fontSize: 11, fontFace: "Calibri", margin: 0, valign: "middle"
  });

  // Regimen cards
  const regimens = [
    {
      label: "Standard Triple Therapy (14 days)", color: ACCENT,
      drugs: [
        "PPI (omeprazole 20 mg or lansoprazole 30 mg)  — BID",
        "Amoxicillin 1 g — BID",
        "Clarithromycin 500 mg — BID",
        "Efficacy: 70–85% (resistance limits efficacy)"
      ]
    },
    {
      label: "Bismuth Quadruple Therapy (14 days)", color: TEAL,
      drugs: [
        "PPI — BID",
        "Bismuth subsalicylate 525 mg — QID",
        "Metronidazole 500 mg — QID",
        "Tetracycline 500 mg — QID",
        "Efficacy: >90%; preferred with clarithromycin resistance"
      ]
    },
    {
      label: "Concomitant Therapy (14 days)", color: "#C77DFF",
      drugs: [
        "PPI — BID",
        "Amoxicillin 1 g — BID",
        "Clarithromycin 500 mg — BID",
        "Metronidazole 500 mg — BID",
        "Use when resistance patterns unknown"
      ]
    },
    {
      label: "Levofloxacin Triple (Rescue)", color: "#E9C46A",
      drugs: [
        "PPI — BID",
        "Levofloxacin 500 mg — OD",
        "Amoxicillin 1 g — BID",
        "Used as 2nd-line after failed standard therapy"
      ]
    }
  ];

  const boxW = 4.52, boxH = 1.72;
  const positions = [
    [0.35, 1.83], [4.97, 1.83],
    [0.35, 3.64], [4.97, 3.64]
  ];

  regimens.forEach((r, i) => {
    const [x, y] = positions[i];
    s.addShape(pres.ShapeType.roundRect, {
      x, y, w: boxW, h: boxH,
      fill: { color: CARD_BG }, line: { color: r.color, pt: 1.5 }, rectRadius: 0.1
    });
    s.addText(r.label, {
      x: x + 0.12, y: y + 0.07, w: boxW - 0.25, h: 0.35,
      fontSize: 11.5, bold: true, color: r.color, fontFace: "Calibri", margin: 0
    });
    const bullets = r.drugs.map((t, j) => ({
      text: t,
      options: { bullet: true, breakLine: j < r.drugs.length - 1, color: GREY_LT, fontSize: 10, fontFace: "Calibri" }
    }));
    s.addText(bullets, {
      x: x + 0.15, y: y + 0.44, w: boxW - 0.3, h: boxH - 0.5, margin: 0, valign: "top"
    });
  });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 9 — PCABs & NEWER AGENTS
// ═══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  navyBg(s);
  accentBar(s);
  slideTitle(s, "Potassium-Competitive Acid Blockers (P-CABs)");

  s.addShape(pres.ShapeType.roundRect, {
    x: 0.35, y: 0.98, w: 9.3, h: 1.08,
    fill: { color: CARD_BG }, line: { color: "#C77DFF", pt: 1.8 }, rectRadius: 0.1
  });
  s.addText([
    { text: "Mechanism: ", options: { bold: true, color: "#C77DFF" } },
    { text: "Reversibly block H⁺/K⁺-ATPase at the potassium-binding site (competitive with K⁺). Unlike PPIs, they do NOT require acidic conditions for activation → faster onset, longer duration of action, more consistent acid suppression at night. No prodrug conversion step required.", options: { color: GREY_LT } }
  ], {
    x: 0.5, y: 1.03, w: 9.05, h: 0.95, fontSize: 11, fontFace: "Calibri", margin: 0, valign: "middle"
  });

  const cols = [
    {
      x: 0.35, label: "ADVANTAGES OVER PPIs", color: TEAL,
      items: [
        "Faster onset (hours vs days for PPIs)",
        "More consistent nocturnal acid control",
        "No CYP2C19 polymorphism effect",
        "Less risk of early-morning acid surge",
        "Active at neutral pH — no food timing needed"
      ]
    },
    {
      x: 3.5, label: "APPROVED AGENTS", color: GOLD,
      items: [
        "Vonoprazan (Japan/USA — FDA 2022): 10–20 mg/day",
        "Revaprazan (Korea) — for gastric ulcer & GERD",
        "Tegoprazan — South Korea (2019)",
        "Fexuprazan — in clinical trials",
        "Keverprazan — investigational"
      ]
    },
    {
      x: 6.65, label: "CLINICAL USE", color: ACCENT,
      items: [
        "H. pylori eradication (vonoprazan triple: >90% eradication)",
        "GERD and erosive oesophagitis",
        "Peptic ulcer disease",
        "NSAID-induced ulcer prevention",
        "Potentially superior to PPIs in Asian populations (CYP2C19 rapid metabolisers)"
      ]
    }
  ];

  cols.forEach(c => {
    s.addShape(pres.ShapeType.roundRect, {
      x: c.x, y: 2.18, w: 3.0, h: 2.92,
      fill: { color: CARD_BG }, line: { color: c.color, pt: 1.5 }, rectRadius: 0.1
    });
    s.addText(c.label, {
      x: c.x + 0.12, y: 2.25, w: 2.78, h: 0.38,
      fontSize: 11.5, bold: true, color: c.color, fontFace: "Calibri", charSpacing: 1, margin: 0
    });
    const bullets = c.items.map((t, i) => ({
      text: t,
      options: { bullet: true, breakLine: i < c.items.length - 1, color: GREY_LT, fontSize: 10.5, fontFace: "Calibri" }
    }));
    s.addText(bullets, {
      x: c.x + 0.15, y: 2.68, w: 2.8, h: 2.35, margin: 0, valign: "top"
    });
  });

  s.addText("Vonoprazan received FDA approval in 2022 for H. pylori eradication — a significant advance over classical PPIs", {
    x: 0.35, y: 5.15, w: 9.3, h: 0.3,
    fontSize: 9.5, color: SUBTITLE_C, fontFace: "Calibri", italic: true, align: "center", margin: 0
  });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 10 — NSAID-INDUCED ULCER MANAGEMENT
// ═══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  navyBg(s);
  accentBar(s);
  slideTitle(s, "NSAID-Induced Ulcer: Prevention & Management");

  // Pathophysiology bar
  s.addShape(pres.ShapeType.roundRect, {
    x: 0.35, y: 0.98, w: 9.3, h: 0.72,
    fill: { color: CARD_BG }, line: { color: ACCENT, pt: 1.5 }, rectRadius: 0.1
  });
  s.addText([
    { text: "Pathophysiology: ", options: { bold: true, color: ACCENT } },
    { text: "NSAIDs inhibit COX-1 → ↓ PGE₂ & PGI₂ → ↓ mucus, ↓ HCO₃⁻, ↓ mucosal blood flow → epithelial vulnerability. Direct topical injury (acidic NSAID molecules) also contributes.", options: { color: GREY_LT } }
  ], {
    x: 0.5, y: 1.03, w: 9.05, h: 0.6, fontSize: 11, fontFace: "Calibri", margin: 0, valign: "middle"
  });

  const cols = [
    {
      x: 0.35, label: "ACTIVE NSAID ULCER", color: ACCENT,
      items: [
        "If NSAID can be stopped: H₂RA or PPI (4–8 weeks)",
        "If NSAID must continue: PPI (first choice)",
        "H. pylori test-and-treat if positive",
        "Sucralfate as adjunct in selected cases",
        "COX-2 selective inhibitor if switching NSAID"
      ]
    },
    {
      x: 3.5, label: "ULCER PROPHYLAXIS", color: GOLD,
      items: [
        "Misoprostol 200 µg QID — clinically proven",
        "PPI co-prescription — most practical",
        "COX-2 inhibitor (celecoxib) instead of non-selective NSAID",
        "Risk factors requiring prophylaxis:",
        "  · Age >60, prior ulcer, anticoagulant use",
        "  · High-dose or dual NSAID therapy"
      ]
    },
    {
      x: 6.65, label: "DRUG TABLE (NSAID)", color: TEAL,
      items: [
        "Omeprazole 20 mg/day — standard PPI prophylaxis",
        "Pantoprazole 40 mg/day — IV option for hospitalised",
        "Misoprostol 200 µg QID — ↓ mucosal injury",
        "Famotidine 20 mg bid — H₂RA (less effective than PPI)",
        "Celecoxib — COX-2 selective (GI sparing)"
      ]
    }
  ];

  cols.forEach(c => {
    s.addShape(pres.ShapeType.roundRect, {
      x: c.x, y: 1.83, w: 3.0, h: 3.35,
      fill: { color: CARD_BG }, line: { color: c.color, pt: 1.5 }, rectRadius: 0.1
    });
    s.addText(c.label, {
      x: c.x + 0.12, y: 1.9, w: 2.78, h: 0.38,
      fontSize: 11.5, bold: true, color: c.color, fontFace: "Calibri", charSpacing: 1, margin: 0
    });
    const bullets = c.items.map((t, i) => ({
      text: t,
      options: { bullet: true, breakLine: i < c.items.length - 1, color: GREY_LT, fontSize: 10.5, fontFace: "Calibri" }
    }));
    s.addText(bullets, {
      x: c.x + 0.15, y: 2.33, w: 2.8, h: 2.75, margin: 0, valign: "top"
    });
  });

  s.addText("Harrison's Table 324-3 recommendation: PPI for active NSAID ulcer with continued NSAID; Misoprostol or PPI for prophylaxis", {
    x: 0.35, y: 5.23, w: 9.3, h: 0.3,
    fontSize: 9.5, color: SUBTITLE_C, fontFace: "Calibri", italic: true, align: "center", margin: 0
  });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 11 — DRUG DOSES QUICK REFERENCE TABLE
// ═══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  navyBg(s);
  accentBar(s);
  slideTitle(s, "Drug Doses — Quick Reference");

  const hdrCols = ["Drug", "Class", "Dose (PUD)", "Route", "Notes"];
  const colW = [2.0, 1.8, 1.85, 0.8, 3.55];
  const tX = 0.0;
  const tY = 0.92;

  // header
  let curX = tX;
  hdrCols.forEach((h, i) => {
    s.addShape(pres.ShapeType.rect, {
      x: curX, y: tY, w: colW[i], h: 0.38,
      fill: { color: ACCENT }, line: { color: BG, pt: 0.8 }
    });
    s.addText(h, {
      x: curX + 0.06, y: tY + 0.04, w: colW[i] - 0.1, h: 0.3,
      fontSize: 10.5, bold: true, color: WHITE, fontFace: "Calibri", margin: 0, valign: "middle"
    });
    curX += colW[i];
  });

  const rows = [
    ["Omeprazole",       "PPI",          "20 mg/day",         "PO",   "Take 30 min before breakfast"],
    ["Pantoprazole",     "PPI",          "40 mg/day",         "PO/IV","IV for bleeding ulcer"],
    ["Rabeprazole",      "PPI",          "20 mg/day",         "PO",   "Fastest non-enzymatic activation"],
    ["Esomeprazole",     "PPI",          "20–40 mg/day",      "PO",   "S-enantiomer; better bioavail."],
    ["Famotidine",       "H₂RA",         "40 mg HS",          "PO",   "Safest H₂RA (no CYP interactions)"],
    ["Cimetidine",       "H₂RA",         "400 mg BD",         "PO",   "Multiple CYP interactions"],
    ["Sucralfate",       "Cytoprotective","1 g QID",          "PO",   "1h before meals — empty stomach"],
    ["Misoprostol",      "Cytoprotective","200 µg QID",       "PO",   "Contraindicated in pregnancy"],
    ["Vonoprazan",       "P-CAB",        "20 mg/day",         "PO",   "FDA 2022 — H. pylori therapy"],
    ["Amoxicillin",      "Antibiotic",   "1 g BD",            "PO",   "Part of H. pylori triple therapy"],
    ["Clarithromycin",   "Antibiotic",   "500 mg BD",         "PO",   "With PPI + amoxicillin × 14 days"],
    ["Metronidazole",    "Antibiotic",   "500 mg QID",        "PO",   "Part of bismuth quadruple therapy"]
  ];

  rows.forEach((row, ri) => {
    const rowBg = ri % 2 === 0 ? "1B2E42" : "162637";
    let cx = tX;
    colW.forEach((w, ci) => {
      s.addShape(pres.ShapeType.rect, {
        x: cx, y: tY + 0.38 + ri * 0.36, w: w, h: 0.36,
        fill: { color: rowBg }, line: { color: CARD_BG, pt: 0.4 }
      });
      s.addText(row[ci], {
        x: cx + 0.06, y: tY + 0.38 + ri * 0.36 + 0.03, w: w - 0.1, h: 0.3,
        fontSize: 9.5, color: ci === 0 ? GOLD : GREY_LT, fontFace: "Calibri", margin: 0, valign: "middle",
        bold: ci === 0
      });
      cx += w;
    });
  });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 12 — SUMMARY & TAKE-HOME POINTS
// ═══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  navyBg(s);

  // Full left accent bar
  s.addShape(pres.ShapeType.rect, {
    x: 0, y: 0, w: 0.25, h: "100%", fill: { color: ACCENT }, line: { color: ACCENT }
  });

  s.addText("SUMMARY", {
    x: 0.55, y: 0.2, w: 9.2, h: 0.55,
    fontSize: 28, bold: true, color: WHITE, fontFace: "Calibri", charSpacing: 6, margin: 0
  });
  s.addShape(pres.ShapeType.rect, {
    x: 0.55, y: 0.8, w: 1.0, h: 0.05, fill: { color: ACCENT }, line: { color: ACCENT }
  });

  const points = [
    { icon: "▶", text: "PPIs are the gold standard for acid suppression — irreversible H⁺/K⁺-ATPase blockade, most effective class", color: ACCENT },
    { icon: "▶", text: "H₂ receptor antagonists (famotidine, cimetidine) are useful for mild disease; note ranitidine was withdrawn in 2020", color: TEAL },
    { icon: "▶", text: "Antacids provide fast symptomatic relief but do not heal ulcers; use as adjuncts", color: GOLD },
    { icon: "▶", text: "Sucralfate & Misoprostol are cytoprotective — misoprostol preferred for NSAID prophylaxis (contraindicated in pregnancy)", color: "#C77DFF" },
    { icon: "▶", text: "H. pylori eradication is curative — standard triple or bismuth quadruple therapy × 14 days reduces recurrence to <5%", color: GOLD },
    { icon: "▶", text: "P-CABs (vonoprazan) represent a new era — faster onset, pH-independent, superior nocturnal control, FDA-approved 2022", color: "#E9C46A" },
    { icon: "▶", text: "For NSAID ulcer: discontinue NSAID + PPI; if NSAID must continue, PPI or misoprostol co-prescription is mandatory", color: TEAL }
  ];

  points.forEach((p, i) => {
    s.addShape(pres.ShapeType.roundRect, {
      x: 0.45, y: 0.95 + i * 0.64, w: 9.2, h: 0.58,
      fill: { color: CARD_BG }, line: { color: p.color, pt: 1 }, rectRadius: 0.08
    });
    s.addText([
      { text: p.icon + "  ", options: { bold: true, color: p.color, fontSize: 13 } },
      { text: p.text, options: { color: GREY_LT, fontSize: 11, fontFace: "Calibri" } }
    ], {
      x: 0.6, y: 0.97 + i * 0.64, w: 8.9, h: 0.52,
      fontFace: "Calibri", margin: 0, valign: "middle"
    });
  });
}

// ─── Write file ───────────────────────────────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/workspace/peptic-ulcer-ppt/Peptic_Ulcer_Drugs.pptx" })
  .then(() => console.log("✅  Peptic_Ulcer_Drugs.pptx created successfully"))
  .catch(e => { console.error("❌  Error:", e); process.exit(1); });
Running Command

cd /home/daytona/workspace/peptic-ulcer-ppt && node create_ppt.js

Running Command

ls -lh /home/daytona/workspace/peptic-ulcer-ppt/Peptic_Ulcer_Drugs.pptx

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.