Make a for Informed consent in radiation and medical oncology practice. Add images wherever needed

Asking for Preferences
Checking Date & Time
Reading File
Reading File
Reading File
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Reading File
Finding Sources
Searching Images

informed consent radiation oncology patient physician discussion

Searching Images

radiation therapy side effects skin toxicity

Searching Images

cancer patient doctor shared decision making treatment options

Finding Sources
Finding Sources
Reading File
Searching Images

radiation therapy linear accelerator LINAC treatment machine

Running Command

ls -la /home/daytona/workspace/ 2>/dev/null | head -20

Running Command

mkdir -p /home/daytona/workspace/informed-consent-oncology && ls /home/daytona/workspace/

Writing File

~/informed-consent-oncology/build.js

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

// Fetch images as base64
const imageUrls = [
  "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_0ae328d856921139cd5f46478283bf9c20ab5cdd8592f1453d89e22b25707a46.jpg", // Informed consent 5-stage flowchart
  "https://cdn.orris.care/cdss_images/GLGCA_1020481_1766750786940_c87dbfd0-0cec-4af1-a169-5c1cc47d020f_6cbe80c8-23de-411b-96a5-d36f8637d8c4.png", // Shared decision-making diagram
  "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_aefeb3dc6688dd398c80b0f90e8b9c6036046e12a28d2f853c35e6026a7dd3da.jpg", // LINAC machine
  "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_3e291dcb006427978ef5075751852655f267105969a4e7e167799527c4d992dc.jpg", // Radiation side effects H&N
  "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_d487db62d81acd6089a50059c5cbf976f984beb4466a52abb32ccaca4e9e7e0a.jpg", // Breast RT skin reactions
  "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_ff173dea13b44b5140de206287e334fbc0268ddbd57399ce2d7290b1566e7a80.jpg", // Patient on RT table
];

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

const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Informed Consent in Radiation and Medical Oncology";
pres.author = "Oncology Education";

// ─────────────────────────────────────────────
// THEME
// ─────────────────────────────────────────────
const DARK_BG    = "0D1B2A";   // deep navy
const MID_BG     = "1B2D45";   // medium navy
const ACCENT     = "E05C28";   // burnt orange
const ACCENT2    = "2E7DC5";   // sky blue
const WHITE      = "FFFFFF";
const LIGHT_GRAY = "D9E4EF";
const BODY_TEXT  = "D9E4EF";
const SUBTEXT    = "8CADC8";

// Helper: add a decorative top bar
function addTopBar(slide, accentColor = ACCENT) {
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: 0.08, fill: { color: accentColor }, line: { type: "none" } });
}

// Helper: add a decorative bottom bar
function addBottomBar(slide) {
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 5.55, w: "100%", h: 0.075, fill: { color: ACCENT2 }, line: { type: "none" } });
  slide.addText("Informed Consent in Radiation & Medical Oncology", {
    x: 0.15, y: 5.4, w: 8, h: 0.22,
    fontSize: 7.5, color: SUBTEXT, fontFace: "Calibri", italic: true
  });
  slide.addText("2026", { x: 9.4, y: 5.4, w: 0.6, h: 0.22, fontSize: 7.5, color: SUBTEXT, fontFace: "Calibri", align: "right" });
}

// ─────────────────────────────────────────────
// SLIDE 1 — TITLE
// ─────────────────────────────────────────────
{
  const slide = pres.addSlide();
  slide.background = { color: DARK_BG };
  addTopBar(slide, ACCENT);

  // Left color block
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0.08, w: 0.35, h: 5.47, fill: { color: ACCENT }, line: { type: "none" } });

  // Main title
  slide.addText("INFORMED CONSENT", {
    x: 0.55, y: 0.9, w: 9.2, h: 1.1,
    fontSize: 44, bold: true, color: WHITE, fontFace: "Calibri Light",
    charSpacing: 3
  });
  slide.addText("IN RADIATION & MEDICAL ONCOLOGY PRACTICE", {
    x: 0.55, y: 1.95, w: 9.2, h: 0.65,
    fontSize: 22, color: ACCENT, fontFace: "Calibri", bold: true, charSpacing: 1
  });

  // Divider line
  slide.addShape(pres.ShapeType.rect, { x: 0.55, y: 2.72, w: 8.8, h: 0.04, fill: { color: ACCENT2 }, line: { type: "none" } });

  // Subtitle
  slide.addText("Ethical Principles · Legal Framework · Clinical Application", {
    x: 0.55, y: 2.85, w: 9, h: 0.5,
    fontSize: 16, color: SUBTEXT, fontFace: "Calibri", italic: true
  });

  // Image: patient on RT table
  if (images[5] && !images[5].error) {
    slide.addImage({ data: images[5].base64, x: 0.55, y: 3.5, w: 4.2, h: 2.0, rounding: true });
  }
  // Image: LINAC
  if (images[2] && !images[2].error) {
    slide.addImage({ data: images[2].base64, x: 5.2, y: 3.5, w: 4.55, h: 2.0, rounding: true });
  }

  addBottomBar(slide);
}

// ─────────────────────────────────────────────
// SLIDE 2 — AGENDA
// ─────────────────────────────────────────────
{
  const slide = pres.addSlide();
  slide.background = { color: DARK_BG };
  addTopBar(slide);

  slide.addText("TABLE OF CONTENTS", {
    x: 0.5, y: 0.18, w: 9, h: 0.55,
    fontSize: 11, bold: true, color: ACCENT, fontFace: "Calibri", charSpacing: 4
  });
  slide.addText("Agenda", {
    x: 0.5, y: 0.62, w: 9, h: 0.7,
    fontSize: 34, bold: true, color: WHITE, fontFace: "Calibri Light"
  });
  slide.addShape(pres.ShapeType.rect, { x: 0.5, y: 1.35, w: 9, h: 0.04, fill: { color: ACCENT2 }, line: { type: "none" } });

  const topics = [
    ["01", "Historical Background & Legal Basis"],
    ["02", "Definition & Four Pillars of Informed Consent"],
    ["03", "Ethical Principles: Autonomy, Beneficence, Non-maleficence, Justice"],
    ["04", "The Consent Process in Oncology Practice"],
    ["05", "Shared Decision-Making Model"],
    ["06", "Specific Considerations in Radiation Oncology"],
    ["07", "Side Effects Disclosure in Radiotherapy"],
    ["08", "Special Situations: Incapacity, Surrogates, Emergencies"],
    ["09", "Documentation & Medicolegal Aspects"],
    ["10", "Barriers & Best Practices"],
  ];

  topics.forEach(([num, text], i) => {
    const col = i < 5 ? 0 : 1;
    const row = i % 5;
    const x = col === 0 ? 0.5 : 5.3;
    const y = 1.55 + row * 0.72;

    // Number circle
    slide.addShape(pres.ShapeType.ellipse, { x: x, y: y, w: 0.38, h: 0.38, fill: { color: ACCENT }, line: { type: "none" } });
    slide.addText(num, { x: x, y: y + 0.02, w: 0.38, h: 0.34, fontSize: 9.5, bold: true, color: WHITE, fontFace: "Calibri", align: "center" });
    slide.addText(text, { x: x + 0.46, y: y + 0.04, w: 4.5, h: 0.34, fontSize: 12, color: BODY_TEXT, fontFace: "Calibri" });
  });

  addBottomBar(slide);
}

// ─────────────────────────────────────────────
// SLIDE 3 — HISTORICAL BACKGROUND
// ─────────────────────────────────────────────
{
  const slide = pres.addSlide();
  slide.background = { color: DARK_BG };
  addTopBar(slide);

  slide.addText("Historical Background & Legal Basis", {
    x: 0.5, y: 0.12, w: 9, h: 0.55,
    fontSize: 26, bold: true, color: WHITE, fontFace: "Calibri Light"
  });
  slide.addShape(pres.ShapeType.rect, { x: 0.5, y: 0.68, w: 4, h: 0.04, fill: { color: ACCENT }, line: { type: "none" } });

  const timeline = [
    ["Plato (400 BC)", "Earliest philosophical basis for patient permission before intervention"],
    ["1767 — England", "First legal case: Judge ruled consent before procedures is the 'rule of the profession'"],
    ["1914 — USA", "Schloendorff v. Society of NY Hospital: 'Every human being of adult years has a right to determine what shall be done with his own body'"],
    ["1957 — USA", "Salgo v. Leland Stanford Jr. University: Term 'Informed Consent' coined; physicians legally obligated to disclose risks, benefits & alternatives"],
    ["1972 — Canterbury v. Spence", "Patient-centered standard: Disclosure should be what a reasonable patient would want to know"],
    ["2000s–Present", "Growing emphasis on shared decision-making, cultural competence, and digital consent tools"],
  ];

  timeline.forEach(([year, desc], i) => {
    const y = 0.85 + i * 0.73;
    slide.addShape(pres.ShapeType.rect, { x: 0.5, y: y, w: 1.8, h: 0.42, fill: { color: ACCENT2 }, line: { type: "none" }, rounding: true });
    slide.addText(year, { x: 0.5, y: y + 0.04, w: 1.8, h: 0.36, fontSize: 8.5, bold: true, color: WHITE, fontFace: "Calibri", align: "center" });
    slide.addText(desc, { x: 2.45, y: y + 0.04, w: 7.3, h: 0.4, fontSize: 10.5, color: BODY_TEXT, fontFace: "Calibri" });
  });

  addBottomBar(slide);
}

// ─────────────────────────────────────────────
// SLIDE 4 — FOUR PILLARS DEFINITION
// ─────────────────────────────────────────────
{
  const slide = pres.addSlide();
  slide.background = { color: DARK_BG };
  addTopBar(slide);

  slide.addText("Definition & The Four Pillars of Informed Consent", {
    x: 0.5, y: 0.12, w: 9, h: 0.55,
    fontSize: 24, bold: true, color: WHITE, fontFace: "Calibri Light"
  });
  slide.addShape(pres.ShapeType.rect, { x: 0.5, y: 0.68, w: 5, h: 0.04, fill: { color: ACCENT }, line: { type: "none" } });

  // Definition box
  slide.addShape(pres.ShapeType.rect, { x: 0.5, y: 0.82, w: 9, h: 0.78, fill: { color: MID_BG }, line: { color: ACCENT2, pt: 1 } });
  slide.addText(
    "Informed consent is a person's autonomous authorization permitting a physician or health professional to undertake diagnostic or therapeutic interventions. " +
    "It is not a one-time event (i.e., just a signature) — it is an evolving process throughout the entire course of diagnosis and treatment.",
    { x: 0.65, y: 0.87, w: 8.7, h: 0.7, fontSize: 11.5, color: BODY_TEXT, fontFace: "Calibri", italic: true }
  );

  const pillars = [
    { icon: "①", title: "Mental Capacity", body: "Patient must be able to understand, appreciate, and reason through information. Adults are presumed legally competent; cognitive disease, medications, or extreme illness may compromise this." },
    { icon: "②", title: "Disclosure", body: "Physician must disclose diagnosis, proposed treatment, material risks, benefits, and reasonable alternatives — including the option of no treatment." },
    { icon: "③", title: "Understanding", body: "Patient must comprehend the disclosed information and its implications for their values and life goals. Adjusted to education level; use of interpreters when needed." },
    { icon: "④", title: "Voluntariness", body: "Decision must be free from coercion, manipulation, or undue influence. The patient has the right to refuse any treatment." },
  ];

  pillars.forEach((p, i) => {
    const x = 0.5 + i * 2.38;
    const y = 1.75;
    slide.addShape(pres.ShapeType.rect, { x, y, w: 2.28, h: 3.5, fill: { color: MID_BG }, line: { color: i % 2 === 0 ? ACCENT : ACCENT2, pt: 1.5 } });
    slide.addText(p.icon, { x, y: y + 0.1, w: 2.28, h: 0.6, fontSize: 28, bold: true, color: i % 2 === 0 ? ACCENT : ACCENT2, fontFace: "Calibri", align: "center" });
    slide.addShape(pres.ShapeType.rect, { x: x + 0.1, y: y + 0.72, w: 2.08, h: 0.04, fill: { color: i % 2 === 0 ? ACCENT : ACCENT2 }, line: { type: "none" } });
    slide.addText(p.title, { x, y: y + 0.84, w: 2.28, h: 0.45, fontSize: 12.5, bold: true, color: WHITE, fontFace: "Calibri", align: "center" });
    slide.addText(p.body, { x: x + 0.12, y: y + 1.3, w: 2.06, h: 2.1, fontSize: 9.8, color: BODY_TEXT, fontFace: "Calibri" });
  });

  addBottomBar(slide);
}

// ─────────────────────────────────────────────
// SLIDE 5 — ETHICAL PRINCIPLES
// ─────────────────────────────────────────────
{
  const slide = pres.addSlide();
  slide.background = { color: DARK_BG };
  addTopBar(slide);

  slide.addText("Ethical Principles Underpinning Consent", {
    x: 0.5, y: 0.12, w: 9, h: 0.55,
    fontSize: 26, bold: true, color: WHITE, fontFace: "Calibri Light"
  });
  slide.addShape(pres.ShapeType.rect, { x: 0.5, y: 0.68, w: 4.5, h: 0.04, fill: { color: ACCENT }, line: { type: "none" } });

  const principles = [
    {
      name: "AUTONOMY",
      color: ACCENT,
      body: [
        "Respect the patient's right to self-determination",
        "The choice to receive or refuse care must align with patient values",
        "Freely chosen, without external coercion",
        "Patient can refuse radiation therapy even if medically optimal"
      ]
    },
    {
      name: "BENEFICENCE",
      color: ACCENT2,
      body: [
        "Physician obligation to act in the patient's best interest",
        "Offer treatments with proven benefit",
        "In inoperable cervical cancer: radiation > surgery (benefit vs. harm)",
        "Requires thorough knowledge of oncology evidence base"
      ]
    },
    {
      name: "NON-MALEFICENCE",
      color: "4CAF7D",
      body: [
        "'First, do no harm' — Primum non nocere",
        "Disclose toxicities and late effects of radiotherapy",
        "Avoid treatments whose harm outweighs benefit",
        "Justify each radiation field and dose prescribed"
      ]
    },
    {
      name: "JUSTICE",
      color: "B06AD4",
      body: [
        "Fair distribution of oncology resources",
        "Equal access regardless of socioeconomic status",
        "No discrimination in consent or treatment allocation",
        "Equitable enrollment in clinical trials"
      ]
    },
  ];

  principles.forEach((p, i) => {
    const x = 0.5 + i * 2.38;
    const y = 0.9;
    slide.addShape(pres.ShapeType.rect, { x, y, w: 2.28, h: 0.52, fill: { color: p.color }, line: { type: "none" } });
    slide.addText(p.name, { x, y: y + 0.06, w: 2.28, h: 0.42, fontSize: 12, bold: true, color: WHITE, fontFace: "Calibri", align: "center", charSpacing: 2 });
    slide.addShape(pres.ShapeType.rect, { x, y: y + 0.52, w: 2.28, h: 3.95, fill: { color: MID_BG }, line: { color: p.color, pt: 1 } });
    p.body.forEach((line, j) => {
      slide.addText([
        { text: "▸ ", options: { bold: true, color: p.color } },
        { text: line, options: { color: BODY_TEXT } }
      ], { x: x + 0.1, y: y + 0.62 + j * 0.84, w: 2.08, h: 0.78, fontSize: 10, fontFace: "Calibri" });
    });
  });

  addBottomBar(slide);
}

// ─────────────────────────────────────────────
// SLIDE 6 — CONSENT PROCESS
// ─────────────────────────────────────────────
{
  const slide = pres.addSlide();
  slide.background = { color: DARK_BG };
  addTopBar(slide);

  slide.addText("The Consent Process in Oncology Practice", {
    x: 0.5, y: 0.12, w: 9, h: 0.55,
    fontSize: 26, bold: true, color: WHITE, fontFace: "Calibri Light"
  });
  slide.addShape(pres.ShapeType.rect, { x: 0.5, y: 0.68, w: 4.5, h: 0.04, fill: { color: ACCENT }, line: { type: "none" } });

  // Informed consent flowchart image
  if (images[0] && !images[0].error) {
    slide.addImage({ data: images[0].base64, x: 0.5, y: 0.85, w: 4.5, h: 3.2 });
  }

  // Steps on right side
  const steps = [
    ["Step 1", "Initial consultation: Explain diagnosis, prognosis, and proposed radiation/chemotherapy plan"],
    ["Step 2", "Disclose material risks: acute & late toxicities, risk of secondary malignancy, infertility"],
    ["Step 3", "Present alternatives: surgery, systemic therapy, watchful waiting, palliative care"],
    ["Step 4", "Assess comprehension — check understanding, invite questions, use plain language"],
    ["Step 5", "Confirm voluntariness — no coercion. Document the process, not just the signature"],
    ["Ongoing", "Update consent if treatment plan changes or new material information emerges"],
  ];

  steps.forEach(([label, text], i) => {
    const y = 0.85 + i * 0.72;
    slide.addShape(pres.ShapeType.rect, { x: 5.25, y, w: 0.9, h: 0.42, fill: { color: i === 5 ? ACCENT2 : ACCENT }, line: { type: "none" } });
    slide.addText(label, { x: 5.25, y: y + 0.04, w: 0.9, h: 0.36, fontSize: 9, bold: true, color: WHITE, fontFace: "Calibri", align: "center" });
    slide.addText(text, { x: 6.22, y: y + 0.04, w: 3.55, h: 0.44, fontSize: 9.8, color: BODY_TEXT, fontFace: "Calibri" });
  });

  addBottomBar(slide);
}

// ─────────────────────────────────────────────
// SLIDE 7 — SHARED DECISION-MAKING
// ─────────────────────────────────────────────
{
  const slide = pres.addSlide();
  slide.background = { color: DARK_BG };
  addTopBar(slide);

  slide.addText("Shared Decision-Making Model", {
    x: 0.5, y: 0.12, w: 9, h: 0.55,
    fontSize: 26, bold: true, color: WHITE, fontFace: "Calibri Light"
  });
  slide.addShape(pres.ShapeType.rect, { x: 0.5, y: 0.68, w: 3.5, h: 0.04, fill: { color: ACCENT }, line: { type: "none" } });

  // SDM diagram image
  if (images[1] && !images[1].error) {
    slide.addImage({ data: images[1].base64, x: 0.5, y: 0.85, w: 4.5, h: 3.5 });
  }

  const sdmPoints = [
    { head: "Clinician's Role", body: "Provide best available evidence for treatment options (radiotherapy, chemotherapy, surgery) including risks and benefits of each" },
    { head: "Patient's Role", body: "Bring individual values, preferences, fears, and life priorities to the discussion — these are non-negotiable inputs" },
    { head: "The Collaborative Decision", body: "A joint, documented decision that integrates clinical evidence with the patient's value system" },
    { head: "Decision Aids", body: "Booklets, videos, or digital tools that help patients understand radiation therapy choices and improve informed decision-making" },
    { head: "Ask-Tell-Ask", body: "Ask what patient already knows → Tell clinical information → Ask patient to teach it back (teach-back method)" },
  ];

  sdmPoints.forEach((pt, i) => {
    const y = 0.85 + i * 0.86;
    slide.addShape(pres.ShapeType.rect, { x: 5.2, y, w: 4.55, h: 0.78, fill: { color: MID_BG }, line: { color: i % 2 === 0 ? ACCENT : ACCENT2, pt: 1 } });
    slide.addText(pt.head, { x: 5.35, y: y + 0.05, w: 4.2, h: 0.28, fontSize: 11, bold: true, color: i % 2 === 0 ? ACCENT : ACCENT2, fontFace: "Calibri" });
    slide.addText(pt.body, { x: 5.35, y: y + 0.34, w: 4.2, h: 0.4, fontSize: 9.8, color: BODY_TEXT, fontFace: "Calibri" });
  });

  addBottomBar(slide);
}

// ─────────────────────────────────────────────
// SLIDE 8 — RADIATION ONCOLOGY SPECIFIC
// ─────────────────────────────────────────────
{
  const slide = pres.addSlide();
  slide.background = { color: DARK_BG };
  addTopBar(slide);

  slide.addText("Specific Considerations in Radiation Oncology", {
    x: 0.5, y: 0.12, w: 9, h: 0.55,
    fontSize: 24, bold: true, color: WHITE, fontFace: "Calibri Light"
  });
  slide.addShape(pres.ShapeType.rect, { x: 0.5, y: 0.68, w: 4.8, h: 0.04, fill: { color: ACCENT }, line: { type: "none" } });

  // LINAC image
  if (images[2] && !images[2].error) {
    slide.addImage({ data: images[2].base64, x: 0.5, y: 0.82, w: 3.8, h: 2.5 });
  }

  const rtConsiderations = [
    "Explain the radiobiological rationale: fractionation, dose, and why multiple sessions are required",
    "Describe the specific treatment technique: EBRT, IMRT, SBRT/SABR, SRS, brachytherapy, proton therapy",
    "Clarify treatment duration and number of fractions (e.g., 5-week course vs. SBRT 5 fractions)",
    "Discuss immobilization devices, tattoos, simulation CT — patient should understand the full workflow",
    "Address fertility preservation options before pelvic/gonadal irradiation",
    "In head & neck RT: Discuss anticipated mucositis, xerostomia, dysphagia, PEG tube placement",
    "Risk of secondary malignancy — especially relevant for younger patients and pediatric cases",
    "Pregnancy: Contraindication during RT; contraception counseling mandatory",
  ];

  // Right column bullets
  rtConsiderations.slice(0, 4).forEach((text, i) => {
    const y = 0.85 + i * 0.62;
    slide.addText([
      { text: "◆ ", options: { bold: true, color: ACCENT } },
      { text, options: { color: BODY_TEXT } }
    ], { x: 4.55, y, w: 5.2, h: 0.55, fontSize: 10.5, fontFace: "Calibri" });
  });

  rtConsiderations.slice(4).forEach((text, i) => {
    const y = 3.45 + i * 0.48;
    slide.addText([
      { text: "◆ ", options: { bold: true, color: ACCENT2 } },
      { text, options: { color: BODY_TEXT } }
    ], { x: 0.5, y, w: 9.2, h: 0.44, fontSize: 10, fontFace: "Calibri" });
  });

  addBottomBar(slide);
}

// ─────────────────────────────────────────────
// SLIDE 9 — SIDE EFFECTS DISCLOSURE (with images)
// ─────────────────────────────────────────────
{
  const slide = pres.addSlide();
  slide.background = { color: DARK_BG };
  addTopBar(slide);

  slide.addText("Side Effects Disclosure in Radiotherapy", {
    x: 0.5, y: 0.12, w: 9, h: 0.55,
    fontSize: 26, bold: true, color: WHITE, fontFace: "Calibri Light"
  });
  slide.addShape(pres.ShapeType.rect, { x: 0.5, y: 0.68, w: 4, h: 0.04, fill: { color: ACCENT }, line: { type: "none" } });

  // Two toxicity images
  if (images[3] && !images[3].error) {
    slide.addImage({ data: images[3].base64, x: 0.5, y: 0.85, w: 3.8, h: 2.5 });
    slide.addText("H&N: RTOG Grade 1-2 acute radiation toxicity (erythema, mucositis)", {
      x: 0.5, y: 3.37, w: 3.8, h: 0.35, fontSize: 8, color: SUBTEXT, fontFace: "Calibri", italic: true, align: "center"
    });
  }
  if (images[4] && !images[4].error) {
    slide.addImage({ data: images[4].base64, x: 4.65, y: 0.85, w: 5.1, h: 2.5 });
    slide.addText("Breast RT: Acute (top) & late skin reactions (bottom) at follow-up 10 months–5.3 years", {
      x: 4.65, y: 3.37, w: 5.1, h: 0.35, fontSize: 8, color: SUBTEXT, fontFace: "Calibri", italic: true, align: "center"
    });
  }

  // Table of side effects
  const tableData = [
    [
      { text: "Category", options: { bold: true, color: WHITE, fill: ACCENT2 } },
      { text: "Acute (during/within 90 days)", options: { bold: true, color: WHITE, fill: ACCENT2 } },
      { text: "Late (>90 days post-RT)", options: { bold: true, color: WHITE, fill: ACCENT2 } },
    ],
    [
      { text: "Skin", options: {} },
      { text: "Erythema, desquamation, moist desquamation", options: {} },
      { text: "Fibrosis, telangiectasia, pigmentation changes", options: {} },
    ],
    [
      { text: "Head & Neck", options: {} },
      { text: "Mucositis, xerostomia, dysphagia, odynophagia", options: {} },
      { text: "Osteoradionecrosis, trismus, carotid stenosis", options: {} },
    ],
    [
      { text: "Thorax / Lung", options: {} },
      { text: "Radiation pneumonitis, esophagitis", options: {} },
      { text: "Pulmonary fibrosis, pericarditis", options: {} },
    ],
    [
      { text: "Pelvis / GI", options: {} },
      { text: "Diarrhea, proctitis, cystitis", options: {} },
      { text: "Bowel obstruction, fistula, bladder contracture", options: {} },
    ],
  ];

  slide.addTable(tableData, {
    x: 0.5, y: 3.8, w: 9.2, h: 1.6,
    fontSize: 8.8, fontFace: "Calibri",
    color: BODY_TEXT,
    fill: MID_BG,
    border: { type: "solid", pt: 0.5, color: ACCENT2 },
    rowH: 0.32,
  });

  addBottomBar(slide);
}

// ─────────────────────────────────────────────
// SLIDE 10 — SPECIAL SITUATIONS
// ─────────────────────────────────────────────
{
  const slide = pres.addSlide();
  slide.background = { color: DARK_BG };
  addTopBar(slide);

  slide.addText("Special Situations in Oncology Consent", {
    x: 0.5, y: 0.12, w: 9, h: 0.55,
    fontSize: 26, bold: true, color: WHITE, fontFace: "Calibri Light"
  });
  slide.addShape(pres.ShapeType.rect, { x: 0.5, y: 0.68, w: 4, h: 0.04, fill: { color: ACCENT }, line: { type: "none" } });

  const situations = [
    {
      title: "Diminished Capacity",
      color: ACCENT,
      points: [
        "Disease, medications, or neurological insult may impair decision-making",
        "Incompetence in one domain ≠ incompetence in all domains",
        "Cognitive capacity assessment tools (e.g., MacCAT-T) may be used",
        "Involves psychiatry/ethics consultation if uncertainty persists"
      ]
    },
    {
      title: "Surrogate Decision Makers",
      color: ACCENT2,
      points: [
        "Legal hierarchy varies by jurisdiction (state/country)",
        "Order: Court guardian > Durable Power of Attorney > Spouse > Adult children > Parents",
        "Surrogate must act as the patient would have acted (substituted judgment)",
        "Advance directives (living will, DNR) should be reviewed before RT planning"
      ]
    },
    {
      title: "Pediatric Patients",
      color: "4CAF7D",
      points: [
        "Parents are primary surrogates; child's assent should be sought",
        "Conflict of interest must be identified (religious, social, financial)",
        "Court intervention warranted if parents refuse life-saving radiation",
        "Adolescents may have evolving decision-making capacity"
      ]
    },
    {
      title: "Clinical Trials",
      color: "B06AD4",
      points: [
        "Trial consent is separate from treatment consent — must be distinct",
        "Patient cannot be coerced into trial participation",
        "Right to withdraw without affecting standard treatment",
        "Ethics committee (IRB/IEC) approval mandatory before enrollment"
      ]
    },
  ];

  situations.forEach((s, i) => {
    const col = i % 2;
    const row = Math.floor(i / 2);
    const x = col === 0 ? 0.5 : 5.2;
    const y = 0.85 + row * 2.35;
    slide.addShape(pres.ShapeType.rect, { x, y, w: 4.5, h: 2.25, fill: { color: MID_BG }, line: { color: s.color, pt: 1.5 } });
    slide.addShape(pres.ShapeType.rect, { x, y, w: 4.5, h: 0.42, fill: { color: s.color }, line: { type: "none" } });
    slide.addText(s.title, { x: x + 0.15, y: y + 0.06, w: 4.2, h: 0.32, fontSize: 13, bold: true, color: WHITE, fontFace: "Calibri" });
    s.points.forEach((pt, j) => {
      slide.addText([
        { text: "• ", options: { bold: true, color: s.color } },
        { text: pt, options: { color: BODY_TEXT } }
      ], { x: x + 0.1, y: y + 0.5 + j * 0.42, w: 4.3, h: 0.38, fontSize: 9.5, fontFace: "Calibri" });
    });
  });

  addBottomBar(slide);
}

// ─────────────────────────────────────────────
// SLIDE 11 — DOCUMENTATION & MEDICOLEGAL
// ─────────────────────────────────────────────
{
  const slide = pres.addSlide();
  slide.background = { color: DARK_BG };
  addTopBar(slide);

  slide.addText("Documentation & Medicolegal Aspects", {
    x: 0.5, y: 0.12, w: 9, h: 0.55,
    fontSize: 26, bold: true, color: WHITE, fontFace: "Calibri Light"
  });
  slide.addShape(pres.ShapeType.rect, { x: 0.5, y: 0.68, w: 4.5, h: 0.04, fill: { color: ACCENT }, line: { type: "none" } });

  // Left panel — Documentation requirements
  slide.addShape(pres.ShapeType.rect, { x: 0.5, y: 0.82, w: 4.5, h: 4.5, fill: { color: MID_BG }, line: { color: ACCENT, pt: 1 } });
  slide.addShape(pres.ShapeType.rect, { x: 0.5, y: 0.82, w: 4.5, h: 0.45, fill: { color: ACCENT }, line: { type: "none" } });
  slide.addText("What Must Be Documented", { x: 0.65, y: 0.88, w: 4.2, h: 0.36, fontSize: 13, bold: true, color: WHITE, fontFace: "Calibri" });
  const docItems = [
    "Date and time of consent discussion",
    "Clinician identity and specialty",
    "Diagnosis and clinical indication",
    "Treatment proposed: radiation modality, dose, target",
    "Risks discussed: both general and site-specific",
    "Alternatives presented (including no treatment)",
    "Patient's questions and responses",
    "Interpreter used (yes/no) and language",
    "Patient's decision: acceptance or refusal",
    "Signature of patient (or legal representative)",
    "Witness signature where required by institution",
  ];
  docItems.forEach((item, i) => {
    slide.addText([
      { text: "✓ ", options: { bold: true, color: ACCENT } },
      { text: item, options: { color: BODY_TEXT } }
    ], { x: 0.65, y: 1.34 + i * 0.36, w: 4.2, h: 0.34, fontSize: 10, fontFace: "Calibri" });
  });

  // Right panel — Medicolegal
  slide.addShape(pres.ShapeType.rect, { x: 5.2, y: 0.82, w: 4.55, h: 4.5, fill: { color: MID_BG }, line: { color: ACCENT2, pt: 1 } });
  slide.addShape(pres.ShapeType.rect, { x: 5.2, y: 0.82, w: 4.55, h: 0.45, fill: { color: ACCENT2 }, line: { type: "none" } });
  slide.addText("Medicolegal Principles", { x: 5.35, y: 0.88, w: 4.2, h: 0.36, fontSize: 13, bold: true, color: WHITE, fontFace: "Calibri" });
  const legalItems = [
    ["Standard of Disclosure", "Either 'reasonable physician' standard or 'reasonable patient' (materiality) standard — jurisdiction dependent"],
    ["Failure of Consent ≠ Negligence", "Plaintiff must prove that had they been properly informed, a reasonable patient would have refused treatment"],
    ["Battery vs. Negligence", "Performing a procedure without any consent = battery; inadequate consent = negligence"],
    ["Emergency Exception", "Implied consent in life-threatening emergencies when patient is unable to consent and delay would cause serious harm"],
    ["Revocation", "Patients may revoke consent at any time, even mid-treatment; document carefully"],
    ["Therapeutic Privilege", "Narrow exception: withholding information that would cause severe psychological harm — ethically controversial, rarely applicable"],
  ];
  legalItems.forEach(([head, body], i) => {
    const y = 1.35 + i * 0.68;
    slide.addText(head + ":", { x: 5.35, y, w: 4.2, h: 0.25, fontSize: 10, bold: true, color: ACCENT2, fontFace: "Calibri" });
    slide.addText(body, { x: 5.35, y: y + 0.24, w: 4.2, h: 0.38, fontSize: 9.5, color: BODY_TEXT, fontFace: "Calibri" });
  });

  addBottomBar(slide);
}

// ─────────────────────────────────────────────
// SLIDE 12 — BARRIERS & BEST PRACTICES
// ─────────────────────────────────────────────
{
  const slide = pres.addSlide();
  slide.background = { color: DARK_BG };
  addTopBar(slide);

  slide.addText("Barriers & Best Practices", {
    x: 0.5, y: 0.12, w: 9, h: 0.55,
    fontSize: 28, bold: true, color: WHITE, fontFace: "Calibri Light"
  });
  slide.addShape(pres.ShapeType.rect, { x: 0.5, y: 0.68, w: 3, h: 0.04, fill: { color: ACCENT }, line: { type: "none" } });

  // Barriers
  slide.addShape(pres.ShapeType.rect, { x: 0.5, y: 0.82, w: 4.5, h: 4.5, fill: { color: MID_BG }, line: { color: ACCENT, pt: 1 } });
  slide.addShape(pres.ShapeType.rect, { x: 0.5, y: 0.82, w: 4.5, h: 0.45, fill: { color: ACCENT }, line: { type: "none" } });
  slide.addText("⚠  Common Barriers", { x: 0.65, y: 0.87, w: 4.2, h: 0.36, fontSize: 14, bold: true, color: WHITE, fontFace: "Calibri" });
  const barriers = [
    "Physician's fear of frightening the patient with risk information",
    "Patient fear of hearing prognosis or side effect details",
    "Health literacy gaps — inability to process technical jargon",
    "Language and cultural barriers",
    "Time pressure in busy oncology clinics",
    "Cognitive impairment due to metastatic CNS disease",
    "Emotional distress at time of diagnosis",
    "Power imbalance — patient reluctance to question physician",
    "Incomplete disclosure by physician (inadequate training)",
  ];
  barriers.forEach((b, i) => {
    slide.addText([
      { text: "✗ ", options: { bold: true, color: ACCENT } },
      { text: b, options: { color: BODY_TEXT } }
    ], { x: 0.65, y: 1.34 + i * 0.41, w: 4.2, h: 0.38, fontSize: 10, fontFace: "Calibri" });
  });

  // Best Practices
  slide.addShape(pres.ShapeType.rect, { x: 5.2, y: 0.82, w: 4.55, h: 4.5, fill: { color: MID_BG }, line: { color: "4CAF7D", pt: 1 } });
  slide.addShape(pres.ShapeType.rect, { x: 5.2, y: 0.82, w: 4.55, h: 0.45, fill: { color: "4CAF7D" }, line: { type: "none" } });
  slide.addText("✔  Best Practices", { x: 5.35, y: 0.87, w: 4.2, h: 0.36, fontSize: 14, bold: true, color: WHITE, fontFace: "Calibri" });
  const bestPractices = [
    "Use plain language (6th-grade reading level) — avoid acronyms",
    "Employ the teach-back method to verify understanding",
    "Use professional interpreters, never family members (conflict of interest)",
    "Provide written materials + verbal discussion",
    "Allow adequate time — separate consent discussion from procedure day",
    "Document the process narratively, not just the signature",
    "Use standardized institutional consent templates for RT sites",
    "Offer multidisciplinary support: oncology nurse, social worker, chaplain",
    "Revisit consent if treatment intent changes (curative → palliative)",
  ];
  bestPractices.forEach((b, i) => {
    slide.addText([
      { text: "✔ ", options: { bold: true, color: "4CAF7D" } },
      { text: b, options: { color: BODY_TEXT } }
    ], { x: 5.35, y: 1.34 + i * 0.41, w: 4.2, h: 0.38, fontSize: 10, fontFace: "Calibri" });
  });

  addBottomBar(slide);
}

// ─────────────────────────────────────────────
// SLIDE 13 — KEY TAKEAWAYS / SUMMARY
// ─────────────────────────────────────────────
{
  const slide = pres.addSlide();
  slide.background = { color: DARK_BG };
  addTopBar(slide);

  slide.addText("Key Takeaways", {
    x: 0.5, y: 0.12, w: 9, h: 0.55,
    fontSize: 30, bold: true, color: WHITE, fontFace: "Calibri Light"
  });
  slide.addShape(pres.ShapeType.rect, { x: 0.5, y: 0.68, w: 2.5, h: 0.04, fill: { color: ACCENT }, line: { type: "none" } });

  const takeaways = [
    { num: "1", text: "Informed consent is a continuous PROCESS — not a one-time signature event", color: ACCENT },
    { num: "2", text: "The four pillars — Capacity, Disclosure, Understanding, Voluntariness — must all be fulfilled", color: ACCENT2 },
    { num: "3", text: "Radiation oncology carries unique obligations: explain fractionation, treatment workflow, acute and late toxicities, and fertility impact", color: "4CAF7D" },
    { num: "4", text: "Shared decision-making integrates clinical evidence with individual patient values — both are mandatory inputs", color: "E8B84B" },
    { num: "5", text: "When capacity is absent, use the surrogate hierarchy while always acting in the patient's best interest (substituted judgment)", color: ACCENT },
    { num: "6", text: "Document the conversation narratively — record what was discussed, questions asked, and the patient's understanding", color: ACCENT2 },
    { num: "7", text: "Overcome barriers with plain language, teach-back, professional interpreters, and multidisciplinary support", color: "4CAF7D" },
  ];

  takeaways.forEach((t, i) => {
    const y = 0.85 + i * 0.65;
    slide.addShape(pres.ShapeType.rect, { x: 0.5, y, w: 9.2, h: 0.58, fill: { color: MID_BG }, line: { color: t.color, pt: 1 } });
    slide.addShape(pres.ShapeType.rect, { x: 0.5, y, w: 0.48, h: 0.58, fill: { color: t.color }, line: { type: "none" } });
    slide.addText(t.num, { x: 0.5, y: y + 0.1, w: 0.48, h: 0.38, fontSize: 16, bold: true, color: WHITE, fontFace: "Calibri", align: "center" });
    slide.addText(t.text, { x: 1.08, y: y + 0.1, w: 8.5, h: 0.4, fontSize: 11, color: BODY_TEXT, fontFace: "Calibri" });
  });

  addBottomBar(slide);
}

// ─────────────────────────────────────────────
// SLIDE 14 — CLOSING
// ─────────────────────────────────────────────
{
  const slide = pres.addSlide();
  slide.background = { color: DARK_BG };
  addTopBar(slide, ACCENT);
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0.08, w: 0.35, h: 5.47, fill: { color: ACCENT }, line: { type: "none" } });

  slide.addText("\"Every human being of adult years and sound mind", {
    x: 0.65, y: 1.0, w: 9, h: 0.65,
    fontSize: 22, italic: true, color: LIGHT_GRAY, fontFace: "Calibri Light"
  });
  slide.addText("has a right to determine what shall be done with his own body.\"", {
    x: 0.65, y: 1.65, w: 9, h: 0.65,
    fontSize: 22, italic: true, color: LIGHT_GRAY, fontFace: "Calibri Light"
  });
  slide.addText("— Justice Benjamin N. Cardozo, Schloendorff v. Society of NY Hospital, 1914", {
    x: 0.65, y: 2.42, w: 9, h: 0.4,
    fontSize: 12, color: SUBTEXT, fontFace: "Calibri", italic: true
  });

  slide.addShape(pres.ShapeType.rect, { x: 0.65, y: 3.0, w: 9, h: 0.04, fill: { color: ACCENT2 }, line: { type: "none" } });

  slide.addText("Informed consent is the cornerstone of the therapeutic relationship in oncology.\nRespect for patient autonomy is not optional — it is the ethical and legal foundation of care.", {
    x: 0.65, y: 3.15, w: 9, h: 0.85,
    fontSize: 14, color: BODY_TEXT, fontFace: "Calibri", align: "center"
  });

  slide.addText("Informed Consent in Radiation & Medical Oncology Practice", {
    x: 0.65, y: 4.2, w: 9, h: 0.4,
    fontSize: 14, bold: true, color: ACCENT, fontFace: "Calibri", align: "center"
  });
  slide.addText("April 2026", {
    x: 0.65, y: 4.62, w: 9, h: 0.32,
    fontSize: 12, color: SUBTEXT, fontFace: "Calibri", align: "center"
  });
}

// ─────────────────────────────────────────────
// WRITE FILE
// ─────────────────────────────────────────────
const outPath = "/home/daytona/workspace/informed-consent-oncology/Informed_Consent_Radiation_Medical_Oncology.pptx";
pres.writeFile({ fileName: outPath })
  .then(() => console.log("SUCCESS: " + outPath))
  .catch(err => { console.error("WRITE ERROR:", err); process.exit(1); });
Running Command

cd /home/daytona/workspace/informed-consent-oncology && node build.js 2>&1

Running Command

ls -lh /home/daytona/workspace/informed-consent-oncology/

Your presentation is ready:

Informed Consent Radiation Medical Oncology

Presentation · PPTX


14 slides on a dark navy + burnt orange design theme. Here's what's covered:
SlideContent
1Title slide — with LINAC & patient positioning images
2Table of Contents
3Historical & Legal Background — Plato → 1767 → Schloendorff (1914) → Salgo (1957) → Canterbury (1972) → present
4Definition & The Four Pillars — Capacity, Disclosure, Understanding, Voluntariness
5Ethical Principles — Autonomy, Beneficence, Non-maleficence, Justice with radiation oncology examples
6The Consent Process — 5-stage flowchart image + step-by-step process
7Shared Decision-Making — SDM diagram image + Ask-Tell-Ask, decision aids
8Radiation Oncology Specifics — LINAC image, fractionation, SBRT, fertility, secondary malignancy
9Side Effects Disclosure — Two clinical photos of radiation dermatitis + toxicity table (acute vs. late by site)
10Special Situations — Diminished capacity, surrogates, pediatric patients, clinical trials
11Documentation & Medicolegal Aspects — What to document + battery vs. negligence, emergency exception
12Barriers & Best Practices — Side-by-side comparison with teach-back, interpreter use
13Key Takeaways — 7 numbered summary points
14Closing — Cardozo quote from Schloendorff 1914
This is a shared conversation. Sign in to Orris to start your own chat.