A patient presents with suspicion of gastroparesis Point, what are the expected symptoms and appropriate work and management for this patient?

Reading File
Finding Sources
Searching PubMed

gastroparesis diagnosis management

Reading File
Reading File
Reading Article

PMID: 40976635

Reading File
Reading File
Finding Sources
Reading File
Reading File
Loading Image
Reading File
I now have comprehensive information from multiple authoritative sources plus the 2025 AGA guideline. Let me compile the full response.

Gastroparesis: Clinical Presentation, Workup, and Management

Definition

Gastroparesis is defined as delayed gastric emptying in the absence of mechanical obstruction, resulting from impaired neuromuscular function of the stomach. It is the second most common sensorimotor disorder of the GI tract, with a prevalence of ~24 per 100,000 persons and a female predominance.
  • Fischer's Mastery of Surgery, 8th ed., p. 2886

Etiology

CauseApproximate Incidence
Idiopathic gastroparesis (IGP)~40%
Diabetic (Type 1 >> Type 2)~35%
Postsurgical (vagotomy, fundoplication, etc.)~20%
Other (connective tissue disease, neurological, metabolic)~5%
  • Sleisenger & Fordtran's GI and Liver Disease, p. 864
Pathophysiology centers on dysfunction of the interstitial cells of Cajal (ICC), disruption of the vagal/cholinergic axis, and pylorospasm - all of which impair the normal antropyloric pump and coordinated gastric contractility.

Expected Symptoms

Cardinal symptoms:

  • Nausea (most common, often persistent)
  • Vomiting - classically occurs 3-4 hours after meals and contains undigested food (vomiting of food eaten the day before is virtually pathognomonic of severe gastroparesis)
  • Early satiety
  • Postprandial bloating / abdominal fullness
  • Abdominal pain

Additional symptoms:

  • Weight loss (can be substantial in severe cases)
  • Heartburn / GERD-like symptoms
  • In diabetics: erratic blood glucose control, unexpected postprandial hypoglycemia (from mismatch between insulin action and delayed nutrient absorption), and recurrent DKA episodes

Physical examination findings:

  • Succussion splash (retained gastric contents on auscultation while shaking the abdomen)
  • Signs of peripheral neuropathy (in diabetic gastroparesis)
  • Signs of malnutrition: cachexia, muscle wasting (in severe disease)
  • Yamada's Textbook of Gastroenterology, 7th ed., p. 2317
  • Fischer's Mastery of Surgery, 8th ed., p. 2887

Workup / Diagnostic Evaluation

Step 1 - Rule out mechanical obstruction

Upper endoscopy (EGD) is the first step. It excludes:
  • Peptic ulcer disease / pyloric stenosis
  • Gastric or duodenal neoplasm
  • Peptic strictures
  • Bezoars (which can form secondary to impaired gastric motility)
Note: Patients with suspected gastroparesis have an increased aspiration risk - plan endoscopy accordingly.

Step 2 - Laboratory studies

  • CBC, comprehensive metabolic panel
  • HbA1c (assess glycemic control / identify diabetic etiology)
  • TSH (hypothyroidism can cause gastroparesis)
  • Nutritional markers: prealbumin, transferrin
  • Electrolytes (hypokalemia, hypocalcemia can impair motility)
  • Exclude metabolic causes: uremia, DKA, hypocalcemia

Step 3 - Exclude offending medications

Review and stop drugs that delay gastric emptying:
  • Opioids
  • GLP-1 receptor agonists (e.g., semaglutide, liraglutide) - these delay gastric emptying significantly
  • Alpha-2 adrenergic agonists, calcium channel blockers, anticholinergics

Step 4 - Confirm delayed gastric emptying (Gold Standard)

4-hour Gastric Emptying Scintigraphy (GES) is the gold standard:
  • Uses a technetium-99m labeled low-fat, 240 kcal solid egg meal
  • Scans performed at 0, 1, 2, and 4 hours
  • Diagnostic threshold: >10% gastric retention at 4 hours
  • The 2025 AGA Clinical Practice Guideline (PMID 40976635) specifically recommends AGAINST 2-hour testing and recommends FOR 4-hour testing
SeverityGastric Retention at 4 Hours
Mild10-15%
Moderate15-35%
Severe>35%
Alternative tests (when scintigraphy is unavailable or contraindicated):
  • Wireless motility capsule (SmartPill)
  • C-13 octanoic acid breath test
  • Antroduodenal manometry (for motility assessment)
  • Electrogastrography (EGG)
Gastroparesis treatment strategy by disease severity
Treatment strategy for gastroparesis stratified by scintigraphic severity. Source: Yamada's Textbook of Gastroenterology, 7th ed.

Management

General measures (all patients):

  1. Discontinue offending medications (opioids, GLP-1 agonists, anticholinergics)
  2. Optimize glycemic control in diabetic patients (hyperglycemia >220 mg/dL itself worsens gastric motility and blunts prokinetic drug response)

Dietary modification:

  • Small, frequent meals (4-6 per day)
  • Low fat, low fiber diet
  • Blenderized/small particle foods as needed in mild-moderate disease; routinely in severe disease
  • Liquid nutritional supplements for moderate-severe disease

Nutritional support:

  • Mild: rarely needed
  • Moderate: caloric liquids, occasionally percutaneous jejunostomy (PEJ) tube
  • Severe: may require PEJ tube or parenteral nutrition (TPN)

Pharmacological Treatment:

Prokinetics (first-line per 2025 AGA guideline):
  • Metoclopramide (dopamine D2 antagonist): 5-10 mg PO before meals and at bedtime; the 2025 AGA guideline conditionally recommends its use. Risk of tardive dyskinesia limits long-term use (FDA black box warning; limit to 12 weeks typically); nasal spray formulation available for severe disease
  • Erythromycin (motilin agonist): 125 mg PO bid; useful short-term, particularly during hospitalizations; tachyphylaxis develops with prolonged use
Note from 2025 AGA guideline (PMID 40976635): Conditional recommendations were issued against domperidone, prucalopride, aprepitant, nortriptyline, buspirone, and cannabidiol as first-line therapies.
Antiemetics (symptom control):
  • Ondansetron 4-8 mg TID (PO, sublingual, or IV) - most commonly used
  • Promethazine 12.5-25 mg q4-6h PO/PR/IM
  • Prochlorperazine 5-10 mg PO/IM
  • Aprepitant 40-80 mg (NK1 antagonist) - for severe, refractory nausea
  • Mirtazapine 15-30 mg daily - for severe disease with poor appetite
Symptom modulators (severe/refractory):
  • Nortriptyline 10-25 mg - neuromodulator; evidence for pain and anorexia, though RCT showed no overall benefit in idiopathic gastroparesis
  • Acupuncture - may be considered in moderate disease

Procedural / Surgical Options (refractory disease):

Per the 2025 AGA guideline, these are reserved for patients with symptoms refractory to medical therapies:
InterventionNotes
Gastric Per-Oral Endoscopic Pyloromyotomy (G-POEM)Endoscopic division of pyloric muscle; shown to improve symptoms and gastric emptying; AGA conditionally recommends against routine initial use
Gastric Electrical Stimulation (GES / Enterra device)FDA-approved for refractory nausea/vomiting; may help symptom control even without improving gastric emptying; AGA recommends against routine initial use
Botulinum toxin injection into pylorusBenefit shown in open-label studies; controlled trials show no benefit vs. saline; predictors of response: idiopathic etiology, female, age <50, higher dose (200 units)
Surgical pyloroplasty / pyloromyotomy2025 AGA identified knowledge gaps; no formal recommendation
Gastrostomy tube for decompressionG-tube in severe refractory disease
  • Yamada's Textbook of Gastroenterology, 7th ed., pp. 670-671
  • Fischer's Mastery of Surgery, 8th ed., pp. 2886-2889
  • Sleisenger & Fordtran's GI and Liver Disease, pp. 863-866

Key 2025 AGA Guideline Takeaways (PMID: 40976635)

Published in Gastroenterology (October 2025), the American Gastroenterological Association issued 12 recommendations:
  1. Use 4-hour GES, not 2-hour, for diagnosis
  2. Metoclopramide and erythromycin are the recommended first-line pharmacologic agents
  3. Against routine use of: domperidone, prucalopride, aprepitant, nortriptyline, buspirone, cannabidiol as first-line
  4. G-POEM and GES should be reserved for patients failing medical therapy
  5. Considerable unmet needs remain in gastroparesis treatment

Summary Algorithm

Suspected gastroparesis
        ↓
Rule out obstruction → Upper endoscopy (EGD)
        ↓
Lab workup → CBC, CMP, HbA1c, TSH, nutritional markers
        ↓
Stop offending meds → opioids, GLP-1 agonists
        ↓
Optimize glycemic control (if diabetic)
        ↓
4-hour Gastric Emptying Scintigraphy
        ↓
Confirmed delayed emptying (>10% at 4h)
        ↓
MILD (10-15%)          MODERATE (15-35%)        SEVERE (>35%)
Diet + metoclopramide  + Antiemetics + nutrition  + Domperidone/erythromycin
prn                    support (liquids/PEJ)      + Symptom modulators
                                                  + Consider G-POEM/GES

Can you generate an image for this?

Generating Image

A clean medical clinical reference infographic titled "Gastroparesis: Clinical Overview" with four organized sections arranged in a grid layout. Section 1 labeled "Symptoms" lists: nausea (most common), vomiting of undigested food 3-4h post-meal, early satiety, postprandial bloating, abdominal pain, weight loss, succussion splash on exam. Section 2 labeled "Causes" lists with percentages: Idiopathic 40%, Diabetic 35%, Postsurgical 20%, Other 5%, with a note about ICC depletion and pylorospasm as mechanisms. Section 3 labeled "Workup" shows a step-by-step flow: Step 1 Upper endoscopy to rule out obstruction, Step 2 Labs (CBC, CMP, HbA1c, TSH, nutritional markers), Step 3 Stop offending meds (opioids, GLP-1 agonists), Step 4 4-hour Gastric Emptying Scintigraphy - gold standard, with severity thresholds: Mild 10-15%, Moderate 15-35%, Severe over 35% retention at 4 hours. Section 4 labeled "Management" shows three columns by severity - Mild: diet modification plus metoclopramide PRN; Moderate: add antiemetics plus nutritional support; Severe: erythromycin, ondansetron, jejunostomy tube, consider G-POEM or gastric electrical stimulation. A footer note reads "2025 AGA Guideline: 4-hour scintigraphy required; metoclopramide and erythromycin are first-line pharmacotherapy." Professional medical illustration style with a muted blue and white color scheme, clear typography, and subtle anatomical stomach icon in the header.

Gastroparesis Clinical Overview Infographic
Here's the clinical summary infographic covering all four key areas:
  • Symptoms - cardinal features including the pathognomonic vomiting of undigested food
  • Causes - etiology breakdown by prevalence with pathophysiology note
  • Workup - stepwise diagnostic approach with the 4-hour scintigraphy thresholds
  • Management - severity-stratified treatment ladder from dietary changes through procedural interventions
The footer highlights the core 2025 AGA guideline update on 4-hour testing and first-line pharmacotherapy.

Now, use this image as well and create a PowerPoint presentation for me of this topic. Try to make 10 slides.

Reading File
Reading File
Reading File
Running Command

node /home/daytona/skills/shared/scripts/fetch_images.js "https://cdn.orris.care/image-gen/e01a8dbd560a47b49f8f43366126688f.png" 2>/dev/null | head -c 200

Running Command

mkdir -p /home/daytona/workspace/gastroparesis-pptx && ls /home/daytona/workspace/gastroparesis-pptx/

Writing File

~/gastroparesis-pptx/build.js

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

// ── Fetch infographic image ──────────────────────────────────────────────────
const imgResult = JSON.parse(
  execSync(
    `node /home/daytona/skills/shared/scripts/fetch_images.js "https://cdn.orris.care/image-gen/e01a8dbd560a47b49f8f43366126688f.png"`
  ).toString()
);
const infographicB64 = imgResult[0].base64;

// ── Palette ──────────────────────────────────────────────────────────────────
const C = {
  navy:    "0D2C54",   // dominant dark background
  teal:    "1A7FA8",   // section headers / accents
  sky:     "4DB8D8",   // lighter accent
  white:   "FFFFFF",
  offWhite:"F4F8FB",
  lightGray:"E0EBF2",
  darkText:"1C2B3A",
  gold:    "F0A500",   // highlight accent
  red:     "D64045",   // warning accent
};

const FONT = "Calibri";

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

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

// ── Helper: teal header bar ──────────────────────────────────────────────────
function headerBar(slide, title, subtitle) {
  slide.addShape(pres.ShapeType.rect, {
    x: 0, y: 0, w: "100%", h: 1.15,
    fill: { color: C.teal }, line: { color: C.teal },
  });
  slide.addText(title, {
    x: 0.35, y: 0.1, w: 9.3, h: 0.6,
    fontSize: 22, bold: true, color: C.white, fontFace: FONT,
    charSpacing: 1, margin: 0,
  });
  if (subtitle) {
    slide.addText(subtitle, {
      x: 0.35, y: 0.68, w: 9.3, h: 0.38,
      fontSize: 11, color: C.lightGray, fontFace: FONT, italic: true, margin: 0,
    });
  }
}

// ── Helper: slide number footer ──────────────────────────────────────────────
function footer(slide, num) {
  slide.addShape(pres.ShapeType.rect, {
    x: 0, y: 5.35, w: "100%", h: 0.275,
    fill: { color: C.navy }, line: { color: C.navy },
  });
  slide.addText(`Gastroparesis  |  Clinical Overview  |  ${num}/10`, {
    x: 0.3, y: 5.36, w: 9.4, h: 0.24,
    fontSize: 8, color: C.sky, fontFace: FONT, align: "left", margin: 0,
  });
}

// ── Helper: card box ─────────────────────────────────────────────────────────
function card(slide, x, y, w, h, fillColor) {
  slide.addShape(pres.ShapeType.rect, {
    x, y, w, h,
    fill: { color: fillColor || C.white },
    line: { color: C.lightGray, width: 0.5 },
    shadow: { type: "outer", color: "000000", blur: 5, offset: 2, angle: 135, opacity: 0.1 },
  });
}

// ── Helper: accent left bar ───────────────────────────────────────────────────
function accentBar(slide, x, y, h, color) {
  slide.addShape(pres.ShapeType.rect, {
    x, y, w: 0.07, h,
    fill: { color: color || C.teal }, line: { color: color || C.teal },
  });
}

// ────────────────────────────────────────────────────────────────────────────
const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Gastroparesis: Clinical Overview";
pres.author = "Clinical Education";

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 1 — Title
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  darkBg(s);

  // decorative teal band at top
  s.addShape(pres.ShapeType.rect, {
    x: 0, y: 0, w: "100%", h: 0.18,
    fill: { color: C.sky }, line: { color: C.sky },
  });
  // decorative gold band
  s.addShape(pres.ShapeType.rect, {
    x: 0, y: 0.18, w: "100%", h: 0.06,
    fill: { color: C.gold }, line: { color: C.gold },
  });

  // Main title
  s.addText("GASTROPARESIS", {
    x: 0.6, y: 0.8, w: 8.8, h: 1.3,
    fontSize: 52, bold: true, color: C.white, fontFace: FONT,
    charSpacing: 6, align: "center", margin: 0,
  });

  // Subtitle
  s.addText("Clinical Presentation  ·  Diagnosis  ·  Management", {
    x: 0.6, y: 2.1, w: 8.8, h: 0.55,
    fontSize: 17, color: C.sky, fontFace: FONT,
    charSpacing: 2, align: "center", margin: 0,
  });

  // Divider
  s.addShape(pres.ShapeType.rect, {
    x: 3.5, y: 2.72, w: 3.0, h: 0.04,
    fill: { color: C.gold }, line: { color: C.gold },
  });

  // Tag line
  s.addText("Delayed gastric emptying  |  Absence of mechanical obstruction", {
    x: 0.6, y: 2.88, w: 8.8, h: 0.45,
    fontSize: 12, color: C.lightGray, fontFace: FONT,
    italic: true, align: "center", margin: 0,
  });

  // Source note
  s.addText("Sources: Fischer's Mastery of Surgery 8e · Yamada's Gastroenterology 7e · 2025 AGA Guideline", {
    x: 0.6, y: 4.9, w: 8.8, h: 0.3,
    fontSize: 8, color: "607080", fontFace: FONT, align: "center", margin: 0,
  });

  // bottom band
  s.addShape(pres.ShapeType.rect, {
    x: 0, y: 5.35, w: "100%", h: 0.275,
    fill: { color: C.teal }, line: { color: C.teal },
  });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 2 — Definition & Epidemiology
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  lightBg(s);
  headerBar(s, "Definition & Epidemiology", "Understanding the scope of gastroparesis");
  footer(s, 2);

  // Definition card
  card(s, 0.3, 1.3, 5.9, 1.5, C.white);
  accentBar(s, 0.3, 1.3, 1.5, C.teal);
  s.addText("Definition", {
    x: 0.55, y: 1.38, w: 5.6, h: 0.38,
    fontSize: 13, bold: true, color: C.teal, fontFace: FONT, margin: 0,
  });
  s.addText(
    "Delayed gastric emptying in the ABSENCE of mechanical obstruction, caused by impaired neuromuscular function of the stomach.",
    {
      x: 0.55, y: 1.76, w: 5.55, h: 0.95,
      fontSize: 11.5, color: C.darkText, fontFace: FONT, margin: 0,
    }
  );

  // Epi card
  card(s, 0.3, 2.95, 5.9, 2.1, C.white);
  accentBar(s, 0.3, 2.95, 2.1, C.gold);
  s.addText("Epidemiology", {
    x: 0.55, y: 3.03, w: 5.6, h: 0.38,
    fontSize: 13, bold: true, color: C.teal, fontFace: FONT, margin: 0,
  });
  const epiPoints = [
    "Prevalence: ~24 per 100,000 persons",
    "Female predominance (incidence ~4× higher in women)",
    "Second most common sensorimotor GI disorder",
    "Decreased 5-year survival vs. healthy cohort",
    "Diabetic incidence: 14% type 1, 9% type 2 over 10 years",
  ];
  s.addText(epiPoints.map((t, i) => ({ text: t, options: { bullet: true, breakLine: i < epiPoints.length - 1 } })), {
    x: 0.55, y: 3.42, w: 5.55, h: 1.55,
    fontSize: 11, color: C.darkText, fontFace: FONT, margin: 0,
  });

  // Stats column
  const stats = [
    { val: "24", unit: "per 100k", label: "Prevalence" },
    { val: "4×", unit: "higher", label: "Women vs Men" },
    { val: ">10 yrs", unit: "DM duration", label: "Typical onset" },
  ];
  let sy = 1.3;
  stats.forEach(st => {
    card(s, 6.5, sy, 3.15, 1.3, C.navy);
    s.addText(st.val, {
      x: 6.5, y: sy + 0.1, w: 3.15, h: 0.65,
      fontSize: 30, bold: true, color: C.sky, fontFace: FONT,
      align: "center", margin: 0,
    });
    s.addText(`${st.unit}\n${st.label}`, {
      x: 6.5, y: sy + 0.72, w: 3.15, h: 0.5,
      fontSize: 10, color: C.lightGray, fontFace: FONT,
      align: "center", margin: 0,
    });
    sy += 1.45;
  });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 3 — Etiology & Pathophysiology
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  lightBg(s);
  headerBar(s, "Etiology & Pathophysiology", "Causes and underlying mechanisms");
  footer(s, 3);

  // Pie-chart style etiology boxes (horizontal)
  const causes = [
    { label: "Idiopathic", pct: "40%", color: C.teal },
    { label: "Diabetic", pct: "35%", color: C.navy },
    { label: "Postsurgical", pct: "20%", color: C.gold },
    { label: "Other", pct: "5%", color: C.red },
  ];
  causes.forEach((c, i) => {
    const x = 0.3 + i * 2.4;
    s.addShape(pres.ShapeType.rect, {
      x, y: 1.3, w: 2.2, h: 1.3,
      fill: { color: c.color }, line: { color: c.color },
    });
    s.addText(c.pct, {
      x, y: 1.35, w: 2.2, h: 0.72,
      fontSize: 30, bold: true, color: C.white, fontFace: FONT,
      align: "center", margin: 0,
    });
    s.addText(c.label, {
      x, y: 2.05, w: 2.2, h: 0.5,
      fontSize: 11, color: C.white, fontFace: FONT,
      align: "center", margin: 0, bold: true,
    });
  });

  // Pathophysiology card
  card(s, 0.3, 2.78, 9.4, 2.27, C.white);
  accentBar(s, 0.3, 2.78, 2.27, C.teal);
  s.addText("Key Pathophysiologic Mechanisms", {
    x: 0.55, y: 2.86, w: 9.1, h: 0.4,
    fontSize: 13, bold: true, color: C.teal, fontFace: FONT, margin: 0,
  });
  const pathoPoints = [
    "Depletion of Interstitial Cells of Cajal (ICC) → loss of gastric pacemaker activity → dysrhythmias",
    "Vagal/cholinergic dysfunction → disrupted antropyloric coordination → relative pyloric obstruction",
    "Pylorospasm → impaired pyloric relaxation during antral contractions → delayed solid emptying",
    "Hyperglycemia (>220 mg/dL) independently delays emptying and blunts prokinetic drug response",
    "Postsurgical: vagotomy prevents proximal gastric relaxation and disrupts the antropyloric pump",
  ];
  s.addText(pathoPoints.map((t, i) => ({ text: t, options: { bullet: true, breakLine: i < pathoPoints.length - 1 } })), {
    x: 0.55, y: 3.28, w: 9.1, h: 1.7,
    fontSize: 10.5, color: C.darkText, fontFace: FONT, margin: 0,
  });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 4 — Clinical Symptoms
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  lightBg(s);
  headerBar(s, "Clinical Presentation", "Recognizing the symptom complex");
  footer(s, 4);

  // Cardinal symptoms
  card(s, 0.3, 1.3, 4.55, 3.75, C.white);
  accentBar(s, 0.3, 1.3, 3.75, C.teal);
  s.addText("Cardinal Symptoms", {
    x: 0.55, y: 1.38, w: 4.2, h: 0.38,
    fontSize: 13, bold: true, color: C.teal, fontFace: FONT, margin: 0,
  });
  const cardinal = [
    { sym: "Nausea", note: "Most common; often persistent, not relieved by vomiting" },
    { sym: "Vomiting", note: "Occurs 3–4 h post-meal; contains UNDIGESTED food" },
    { sym: "Early satiety", note: "Unable to finish normal-sized meals" },
    { sym: "Bloating", note: "Postprandial abdominal fullness and distension" },
    { sym: "Abdominal pain", note: "Epigastric, variable severity" },
    { sym: "Weight loss", note: "Can be substantial in moderate–severe disease" },
  ];
  let cy = 1.78;
  cardinal.forEach(item => {
    s.addText([
      { text: item.sym + " — ", options: { bold: true } },
      { text: item.note },
    ], {
      x: 0.55, y: cy, w: 4.2, h: 0.52,
      fontSize: 10.5, color: C.darkText, fontFace: FONT, margin: 0,
    });
    cy += 0.52;
  });

  // Pathognomonic callout
  s.addShape(pres.ShapeType.rect, {
    x: 0.3, y: 4.77, w: 4.55, h: 0.28,
    fill: { color: C.gold }, line: { color: C.gold },
  });
  s.addText("Pathognomonic: Vomiting of food eaten the DAY BEFORE", {
    x: 0.35, y: 4.78, w: 4.45, h: 0.25,
    fontSize: 9.5, bold: true, color: C.navy, fontFace: FONT, margin: 0, align: "center",
  });

  // Exam + special findings
  card(s, 5.15, 1.3, 4.5, 2.1, C.white);
  accentBar(s, 5.15, 1.3, 2.1, C.gold);
  s.addText("Physical Examination", {
    x: 5.4, y: 1.38, w: 4.15, h: 0.38,
    fontSize: 13, bold: true, color: C.teal, fontFace: FONT, margin: 0,
  });
  const examPoints = [
    "Succussion splash (retained gastric contents)",
    "Cachexia / muscle wasting in severe disease",
    "Signs of peripheral neuropathy (diabetic)",
    "Usually unremarkable in mild disease",
  ];
  s.addText(examPoints.map((t, i) => ({ text: t, options: { bullet: true, breakLine: i < examPoints.length - 1 } })), {
    x: 5.4, y: 1.78, w: 4.15, h: 1.55,
    fontSize: 11, color: C.darkText, fontFace: FONT, margin: 0,
  });

  // Diabetic-specific
  card(s, 5.15, 3.55, 4.5, 1.5, C.navy);
  s.addText("In Diabetic Gastroparesis", {
    x: 5.4, y: 3.63, w: 4.15, h: 0.38,
    fontSize: 12, bold: true, color: C.sky, fontFace: FONT, margin: 0,
  });
  const dmPoints = [
    "Erratic blood glucose / unexpected hypoglycemia",
    "Recurrent DKA episodes",
    "Heartburn / GERD-like symptoms",
    "Delayed oral hypoglycemic absorption",
  ];
  s.addText(dmPoints.map((t, i) => ({ text: t, options: { bullet: true, breakLine: i < dmPoints.length - 1 } })), {
    x: 5.4, y: 4.02, w: 4.15, h: 0.97,
    fontSize: 10, color: C.lightGray, fontFace: FONT, margin: 0,
  });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 5 — Diagnostic Workup
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  lightBg(s);
  headerBar(s, "Diagnostic Workup", "Step-by-step evaluation algorithm");
  footer(s, 5);

  const steps = [
    {
      num: "1",
      title: "Upper Endoscopy (EGD)",
      body: "First step — exclude mechanical obstruction: peptic stricture, pyloric stenosis, neoplasm, bezoar. Note: high aspiration risk in this population.",
      color: C.teal,
    },
    {
      num: "2",
      title: "Laboratory Studies",
      body: "CBC · CMP · HbA1c · TSH · Prealbumin/Transferrin · Electrolytes (K⁺, Ca²⁺). Exclude: DKA, uremia, hypocalcemia, hypothyroidism.",
      color: C.teal,
    },
    {
      num: "3",
      title: "Medication Review",
      body: "Discontinue motility-inhibiting drugs: opioids, GLP-1 agonists (semaglutide), anticholinergics, Ca²⁺ channel blockers.",
      color: C.gold,
    },
    {
      num: "4",
      title: "4-Hour Gastric Emptying Scintigraphy",
      body: "Gold standard. Tc-99m labeled 240 kcal low-fat egg meal. Scans at 0, 1, 2, 4 hours. Diagnostic: >10% retention at 4 h.\n2025 AGA: AGAINST 2-hour testing; FOR 4-hour testing.",
      color: C.red,
    },
  ];

  steps.forEach((step, i) => {
    const x = i < 2 ? 0.3 : 0.3;
    const col = i < 2 ? 0 : 1;
    const row = i % 2;
    const sx = col === 0 ? (i === 0 ? 0.3 : 5.15) : 0;
    // layout: 2 per row
    const lx = i % 2 === 0 ? 0.3 : 5.15;
    const ly = 1.3 + Math.floor(i / 2) * 2.1;
    card(s, lx, ly, 4.55, 1.9, C.white);
    // color accent top
    s.addShape(pres.ShapeType.rect, {
      x: lx, y: ly, w: 4.55, h: 0.08,
      fill: { color: step.color }, line: { color: step.color },
    });
    // number badge
    s.addShape(pres.ShapeType.rect, {
      x: lx + 0.15, y: ly + 0.15, w: 0.42, h: 0.42,
      fill: { color: step.color }, line: { color: step.color },
    });
    s.addText(step.num, {
      x: lx + 0.15, y: ly + 0.15, w: 0.42, h: 0.42,
      fontSize: 16, bold: true, color: C.white, fontFace: FONT,
      align: "center", valign: "middle", margin: 0,
    });
    s.addText(step.title, {
      x: lx + 0.68, y: ly + 0.18, w: 3.72, h: 0.38,
      fontSize: 12, bold: true, color: C.teal, fontFace: FONT, margin: 0,
    });
    s.addText(step.body, {
      x: lx + 0.2, y: ly + 0.62, w: 4.22, h: 1.2,
      fontSize: 9.5, color: C.darkText, fontFace: FONT, margin: 0,
    });
  });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 6 — Severity Classification
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  lightBg(s);
  headerBar(s, "Severity Classification", "Gastric emptying scintigraphy — 4-hour retention thresholds");
  footer(s, 6);

  const severities = [
    {
      label: "MILD",
      range: "10 – 15%",
      retention: "Retention at 4 h",
      color: "2EAA6A",
      points: [
        "Symptoms manageable",
        "Dietary modification sufficient",
        "Metoclopramide PRN",
        "Nutritional support rarely needed",
        "No procedural intervention",
      ],
    },
    {
      label: "MODERATE",
      range: "15 – 35%",
      retention: "Retention at 4 h",
      color: C.gold,
      points: [
        "More frequent symptoms",
        "Regular dietary modification",
        "Scheduled prokinetics + antiemetics",
        "Caloric liquid supplements",
        "PEJ tube occasionally needed",
      ],
    },
    {
      label: "SEVERE",
      range: "> 35%",
      retention: "Retention at 4 h",
      color: C.red,
      points: [
        "Debilitating symptoms",
        "Blenderized diet routinely",
        "Multiple pharmacologic agents",
        "PEJ tube / parenteral nutrition",
        "Consider G-POEM or GES",
      ],
    },
  ];

  severities.forEach((sev, i) => {
    const sx = 0.3 + i * 3.2;
    // top color header
    s.addShape(pres.ShapeType.rect, {
      x: sx, y: 1.28, w: 2.95, h: 0.82,
      fill: { color: sev.color }, line: { color: sev.color },
    });
    s.addText(sev.label, {
      x: sx, y: 1.3, w: 2.95, h: 0.42,
      fontSize: 18, bold: true, color: C.white, fontFace: FONT,
      align: "center", margin: 0, charSpacing: 3,
    });
    s.addText(sev.range, {
      x: sx, y: 1.7, w: 2.95, h: 0.34,
      fontSize: 13, bold: true, color: C.white, fontFace: FONT,
      align: "center", margin: 0,
    });
    card(s, sx, 2.1, 2.95, 2.8, C.white);
    s.addText(sev.retention, {
      x: sx + 0.1, y: 2.15, w: 2.75, h: 0.32,
      fontSize: 9, italic: true, color: "888888", fontFace: FONT,
      align: "center", margin: 0,
    });
    s.addText(sev.points.map((t, idx) => ({ text: t, options: { bullet: true, breakLine: idx < sev.points.length - 1 } })), {
      x: sx + 0.12, y: 2.52, w: 2.73, h: 2.3,
      fontSize: 10, color: C.darkText, fontFace: FONT, margin: 0,
    });
  });

  // footnote
  s.addText("Diagnostic threshold: Gastric retention >10% at 4 hours on standard scintigraphy (Tc-99m labeled 240 kcal low-fat egg meal)", {
    x: 0.3, y: 5.1, w: 9.4, h: 0.22,
    fontSize: 8.5, color: "888888", fontFace: FONT, italic: true, margin: 0,
  });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 7 — General & Dietary Management
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  lightBg(s);
  headerBar(s, "General & Dietary Management", "First-line measures for all patients");
  footer(s, 7);

  // General measures
  card(s, 0.3, 1.3, 9.4, 1.22, C.white);
  accentBar(s, 0.3, 1.3, 1.22, C.teal);
  s.addText("General Measures (ALL Patients)", {
    x: 0.55, y: 1.38, w: 9.0, h: 0.36,
    fontSize: 13, bold: true, color: C.teal, fontFace: FONT, margin: 0,
  });
  s.addText("Stop offending medications (opioids, GLP-1 agonists, anticholinergics)   |   Optimize glycemic control in diabetics   |   Treat underlying cause", {
    x: 0.55, y: 1.76, w: 9.0, h: 0.66,
    fontSize: 11, color: C.darkText, fontFace: FONT, margin: 0,
  });

  // Dietary table
  const dietRows = [
    ["Dietary Principle", "Mild", "Moderate", "Severe"],
    ["Meal frequency", "Small, frequent (4–6/day)", "Small, frequent (4–6/day)", "Small, frequent (4–6/day)"],
    ["Fat content", "Low fat", "Low fat", "Low fat"],
    ["Fiber", "Low fiber", "Low fiber", "Low fiber"],
    ["Texture", "Normal; blenderized PRN", "Blenderized (small particle)", "Blenderized routinely"],
    ["Liquids", "Normal", "Caloric liquid supplements", "Liquid diet as primary intake"],
    ["Enteral support", "Rarely needed", "PEJ tube (occasionally)", "PEJ tube / TPN if severe malnutrition"],
  ];
  const colW = [2.6, 2.2, 2.2, 2.2];
  const tableX = 0.3;
  const tableY = 2.65;
  const rowH = 0.38;
  dietRows.forEach((row, ri) => {
    let cx = tableX;
    row.forEach((cell, ci) => {
      const isHeader = ri === 0;
      s.addShape(pres.ShapeType.rect, {
        x: cx, y: tableY + ri * rowH, w: colW[ci], h: rowH,
        fill: { color: isHeader ? C.teal : (ri % 2 === 0 ? C.offWhite : C.white) },
        line: { color: C.lightGray, width: 0.5 },
      });
      s.addText(cell, {
        x: cx + 0.06, y: tableY + ri * rowH + 0.04, w: colW[ci] - 0.12, h: rowH - 0.08,
        fontSize: isHeader ? 10 : 9,
        bold: isHeader,
        color: isHeader ? C.white : C.darkText,
        fontFace: FONT, margin: 0, valign: "middle",
      });
      cx += colW[ci];
    });
  });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 8 — Pharmacological Treatment
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  lightBg(s);
  headerBar(s, "Pharmacological Treatment", "Prokinetics · Antiemetics · Neuromodulators");
  footer(s, 8);

  // AGA 2025 banner
  s.addShape(pres.ShapeType.rect, {
    x: 0.3, y: 1.3, w: 9.4, h: 0.42,
    fill: { color: C.navy }, line: { color: C.navy },
  });
  s.addText("2025 AGA Guideline  —  First-line: Metoclopramide OR Erythromycin  |  Against: Domperidone, Prucalopride, Aprepitant, Nortriptyline, Buspirone, Cannabidiol as first-line", {
    x: 0.38, y: 1.33, w: 9.25, h: 0.36,
    fontSize: 9.5, color: C.gold, fontFace: FONT, bold: true, margin: 0,
  });

  // Prokinetics
  card(s, 0.3, 1.85, 4.55, 1.78, C.white);
  accentBar(s, 0.3, 1.85, 1.78, C.teal);
  s.addText("Prokinetics", {
    x: 0.55, y: 1.93, w: 4.2, h: 0.36,
    fontSize: 13, bold: true, color: C.teal, fontFace: FONT, margin: 0,
  });
  const prokinetics = [
    "Metoclopramide 5–10 mg PO before meals (D2 antagonist) ✓ First-line — risk of tardive dyskinesia; limit to 12 wks",
    "Erythromycin 125 mg PO bid (motilin agonist) ✓ First-line — tachyphylaxis with prolonged use",
    "Domperidone 10–20 mg PO tid (⚠ 2025 AGA: against as first-line)",
    "Prucalopride 2 mg daily — 5HT4 agonist (⚠ 2025 AGA: against as first-line)",
  ];
  s.addText(prokinetics.map((t, i) => ({ text: t, options: { bullet: true, breakLine: i < prokinetics.length - 1 } })), {
    x: 0.55, y: 2.32, w: 4.2, h: 1.24,
    fontSize: 9.5, color: C.darkText, fontFace: FONT, margin: 0,
  });

  // Antiemetics
  card(s, 5.15, 1.85, 4.5, 1.78, C.white);
  accentBar(s, 5.15, 1.85, 1.78, C.gold);
  s.addText("Antiemetics", {
    x: 5.4, y: 1.93, w: 4.15, h: 0.36,
    fontSize: 13, bold: true, color: C.teal, fontFace: FONT, margin: 0,
  });
  const antiemetics = [
    "Ondansetron 4–8 mg TID PO/SL/IV (5-HT3 antagonist)",
    "Promethazine 12.5–25 mg q4–6h PO/PR/IM",
    "Prochlorperazine 5–10 mg PO/IM",
    "Aprepitant 40–80 mg (NK1 antagonist — severe/refractory)",
    "Mirtazapine 15–30 mg daily (severe, poor appetite)",
  ];
  s.addText(antiemetics.map((t, i) => ({ text: t, options: { bullet: true, breakLine: i < antiemetics.length - 1 } })), {
    x: 5.4, y: 2.32, w: 4.15, h: 1.24,
    fontSize: 9.5, color: C.darkText, fontFace: FONT, margin: 0,
  });

  // Neuromodulators
  card(s, 0.3, 3.77, 9.4, 1.23, C.white);
  accentBar(s, 0.3, 3.77, 1.23, C.red);
  s.addText("Symptom Modulators / Neuromodulators  (Severe / Refractory)", {
    x: 0.55, y: 3.85, w: 9.0, h: 0.36,
    fontSize: 12, bold: true, color: C.teal, fontFace: FONT, margin: 0,
  });
  s.addText(
    "Nortriptyline 10–25 mg (TCA — benefit for anorexia/weight; no overall benefit in idiopathic GP per RCT)   |   Buspirone (⚠ 2025 AGA: against first-line)   |   Acupuncture (moderate disease)",
    {
      x: 0.55, y: 4.23, w: 9.0, h: 0.7,
      fontSize: 10, color: C.darkText, fontFace: FONT, margin: 0,
    }
  );
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 9 — Procedural & Surgical Options
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  lightBg(s);
  headerBar(s, "Procedural & Surgical Options", "Reserved for medically refractory gastroparesis");
  footer(s, 9);

  // caveat banner
  s.addShape(pres.ShapeType.rect, {
    x: 0.3, y: 1.3, w: 9.4, h: 0.38,
    fill: { color: C.red }, line: { color: C.red },
  });
  s.addText("2025 AGA: G-POEM and Gastric Electrical Stimulation should be reserved for patients FAILING medical therapy — not for routine initial use", {
    x: 0.38, y: 1.32, w: 9.25, h: 0.34,
    fontSize: 9.5, color: C.white, fontFace: FONT, bold: true, margin: 0,
  });

  const procedures = [
    {
      name: "G-POEM",
      full: "Gastric Per-Oral Endoscopic Pyloromyotomy",
      body: "Endoscopic division of pyloric muscle via submucosal tunnel. Improves gastric emptying and symptoms. Predictors of response: idiopathic etiology, female sex, age <50.",
      color: C.teal,
    },
    {
      name: "GES",
      full: "Gastric Electrical Stimulation (Enterra™)",
      body: "FDA-approved for refractory nausea/vomiting. Implantable device delivers high-frequency, low-energy pulses. May improve symptoms without improving emptying (mechanism unclear).",
      color: C.navy,
    },
    {
      name: "Botox",
      full: "Pyloric Botulinum Toxin Injection",
      body: "Reduces pylorospasm. Open-label studies positive; two small RCTs showed NO benefit vs. saline. Best response: idiopathic GP, female, age <50, dose 200 units.",
      color: C.gold,
    },
    {
      name: "Surgery",
      full: "Pyloroplasty / Pyloromyotomy / Gastrostomy",
      body: "Surgical pyloroplasty/myotomy: limited RCT data; 2025 AGA identified knowledge gaps. G-tube: decompression in severe refractory disease. PEJ tube for nutritional support.",
      color: C.red,
    },
  ];

  procedures.forEach((proc, i) => {
    const px = i % 2 === 0 ? 0.3 : 5.15;
    const py = 1.85 + Math.floor(i / 2) * 1.78;
    card(s, px, py, 4.55, 1.62, C.white);
    s.addShape(pres.ShapeType.rect, {
      x: px, y: py, w: 0.85, h: 1.62,
      fill: { color: proc.color }, line: { color: proc.color },
    });
    s.addText(proc.name, {
      x: px + 0.02, y: py + 0.55, w: 0.81, h: 0.52,
      fontSize: 13, bold: true, color: C.white, fontFace: FONT,
      align: "center", margin: 0,
    });
    s.addText(proc.full, {
      x: px + 0.98, y: py + 0.08, w: 3.45, h: 0.38,
      fontSize: 10.5, bold: true, color: C.teal, fontFace: FONT, margin: 0,
    });
    s.addText(proc.body, {
      x: px + 0.98, y: py + 0.48, w: 3.45, h: 1.07,
      fontSize: 9.5, color: C.darkText, fontFace: FONT, margin: 0,
    });
  });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 10 — Summary Infographic & Key Takeaways
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  darkBg(s);

  // top band
  s.addShape(pres.ShapeType.rect, {
    x: 0, y: 0, w: "100%", h: 0.18,
    fill: { color: C.sky }, line: { color: C.sky },
  });
  s.addShape(pres.ShapeType.rect, {
    x: 0, y: 0.18, w: "100%", h: 0.06,
    fill: { color: C.gold }, line: { color: C.gold },
  });

  s.addText("Clinical Summary & Key Takeaways", {
    x: 0.4, y: 0.3, w: 9.2, h: 0.52,
    fontSize: 22, bold: true, color: C.white, fontFace: FONT,
    charSpacing: 1, margin: 0,
  });

  // infographic image (left)
  s.addImage({
    data: infographicB64,
    x: 0.25, y: 0.95, w: 5.3, h: 3.55,
  });

  // Key takeaways (right)
  const takeaways = [
    { icon: "▶", text: "4-hour scintigraphy is mandatory for diagnosis (2025 AGA)" },
    { icon: "▶", text: "Metoclopramide & erythromycin are the only first-line drugs" },
    { icon: "▶", text: "Vomiting undigested food >6 h post-meal is pathognomonic" },
    { icon: "▶", text: "Stop GLP-1 agonists and opioids before testing" },
    { icon: "▶", text: "Optimize glycemic control in ALL diabetic patients" },
    { icon: "▶", text: "G-POEM & GES: for refractory cases only, not routine" },
    { icon: "▶", text: "Multidisciplinary approach required for severe disease" },
  ];

  let ky = 1.02;
  takeaways.forEach(t => {
    s.addShape(pres.ShapeType.rect, {
      x: 5.75, y: ky, w: 3.95, h: 0.46,
      fill: { color: "15375F" }, line: { color: C.teal, width: 0.5 },
    });
    s.addText([
      { text: t.icon + "  ", options: { color: C.sky, bold: true } },
      { text: t.text, options: { color: C.white } },
    ], {
      x: 5.85, y: ky + 0.04, w: 3.78, h: 0.38,
      fontSize: 9.5, fontFace: FONT, margin: 0, valign: "middle",
    });
    ky += 0.52;
  });

  // bottom reference bar
  s.addShape(pres.ShapeType.rect, {
    x: 0, y: 5.25, w: "100%", h: 0.375,
    fill: { color: C.teal }, line: { color: C.teal },
  });
  s.addText("Fischer's Mastery of Surgery 8e  ·  Yamada's Textbook of Gastroenterology 7e  ·  Sleisenger & Fordtran's GI & Liver Disease  ·  2025 AGA Clinical Practice Guideline (PMID: 40976635)", {
    x: 0.3, y: 5.28, w: 9.4, h: 0.32,
    fontSize: 8, color: C.white, fontFace: FONT, align: "center", margin: 0,
  });
}

// ── Write file ────────────────────────────────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/workspace/gastroparesis-pptx/Gastroparesis_Clinical_Overview.pptx" })
  .then(() => console.log("SUCCESS: file written"))
  .catch(e => { console.error("ERROR:", e); process.exit(1); });
Running Command

cd /home/daytona/workspace/gastroparesis-pptx && node build.js 2>&1

Running Command

node /home/daytona/skills/shared/scripts/fetch_images.js "https://cdn.orris.care/image-gen/e01a8dbd560a47b49f8f43366126688f.png" > /home/daytona/workspace/gastroparesis-pptx/infographic_b64.json 2>&1; echo "exit: $?"

Editing File

~/gastroparesis-pptx/build.js

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

~/gastroparesis-pptx/build.js

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

cd /home/daytona/workspace/gastroparesis-pptx && node build.js 2>&1

Running Command

ls -lh /home/daytona/workspace/gastroparesis-pptx/Gastroparesis_Clinical_Overview.pptx

Your presentation is ready (1.5 MB, 10 slides):

Gastroparesis Clinical Overview

Presentation · PPTX


Here's a breakdown of the 10 slides:
#SlideDesign
1TitleDark navy with teal/gold accent bands
2Definition & EpidemiologyStat cards (navy) + key points
3Etiology & PathophysiologyColor-coded cause blocks (40/35/20/5%) + mechanism bullets
4Clinical PresentationCardinal symptoms + exam findings + diabetic-specific callout box
5Diagnostic Workup4-step numbered card layout
6Severity ClassificationThree-column mild/moderate/severe table with color-coded headers
7General & Dietary ManagementFull dietary management table by severity
8Pharmacological Treatment2025 AGA banner + prokinetics / antiemetics / neuromodulators cards
9Procedural & Surgical OptionsG-POEM, GES, Botox, Surgery - each with color-coded panel
10Summary & Key TakeawaysYour infographic embedded + 7 key takeaway bullets on dark background
This is a shared conversation. Sign in to Orris to start your own chat.