Tomorrow is my case presentation on schizophrenia. Write acc to this

Asking for Preferences
Reading File
Reading File
Finding Sources
Searching PubMed

schizophrenia diagnosis treatment guidelines

Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Searching Images

schizophrenia dopamine pathway neuroscience brain diagram

Running Command

ls /home/daytona/workspace/ 2>/dev/null || echo "workspace empty"

Running Command

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

Writing File

~/schizophrenia-ppt/create_presentation.js

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

// ── Download images ──────────────────────────────────────────────────────────
const imageUrls = [
  "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_c15d08e0dd752872fa031aa7a5deede911b2adc14d3b85f690cede444da2d393.jpg",
  "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_e6dc38038b4066d8e1650ce1e862ba4e5962ed6a568bf9decd7152d735822831.jpg",
];
const imgs = JSON.parse(
  execSync(
    `node /home/daytona/skills/shared/scripts/fetch_images.js ${imageUrls.map(u => `"${u}"`).join(" ")}`
  ).toString()
);
const dopaminePathwayImg = imgs[0].error ? null : imgs[0].base64;
const brainCompareImg    = imgs[1].error ? null : imgs[1].base64;

// ── Color Palette ─────────────────────────────────────────────────────────────
const C = {
  navy:       "0D1B2A",   // dominant dark background
  midnight:   "1A2744",   // secondary dark
  teal:       "1DB8A4",   // accent — vibrant teal
  tealLight:  "2ED8C0",   // lighter teal for highlights
  white:      "FFFFFF",
  offWhite:   "E8F0EE",
  lightGray:  "B0C4C1",
  amber:      "F0A500",   // warm accent for warnings/key points
  red:        "E05050",   // danger/important
  slate:      "4A6070",   // muted body text on light bg
};

const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.author  = "Case Presentation";
pres.title   = "Schizophrenia – Case Presentation";

// ── Helpers ───────────────────────────────────────────────────────────────────
function addSlide() { return pres.addSlide(); }

function sectionBg(slide) {
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.navy } });
}

function topBar(slide, color = C.teal) {
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.07, fill: { color: color } });
}

function accentLine(slide, y = 0.95, w = 1.2, color = C.teal) {
  slide.addShape(pres.ShapeType.rect, { x: 0.5, y, w, h: 0.04, fill: { color } });
}

function slideTitle(slide, text, y = 0.18) {
  slide.addText(text, {
    x: 0.5, y, w: 9, h: 0.55,
    fontSize: 26, bold: true, color: C.white, fontFace: "Calibri",
    margin: 0
  });
}

function subTitle(slide, text, y = 0.78) {
  slide.addText(text, {
    x: 0.5, y, w: 9, h: 0.3,
    fontSize: 11, color: C.teal, fontFace: "Calibri",
    bold: true, charSpacing: 2, margin: 0
  });
}

function bodyBullets(slide, items, x, y, w, h, opts = {}) {
  const textArr = items.map((it, i) => {
    if (typeof it === "string") {
      return { text: it, options: { bullet: true, breakLine: i < items.length - 1, fontSize: opts.fontSize || 14, color: opts.color || C.white, fontFace: "Calibri" } };
    }
    // { text, sub } → bold header + sub-bullets
    const rows = [];
    rows.push({ text: it.text, options: { bullet: true, breakLine: true, bold: true, fontSize: opts.fontSize || 14, color: opts.color || C.tealLight, fontFace: "Calibri" } });
    (it.subs || []).forEach((s, si) => {
      rows.push({ text: "    " + s, options: { bullet: false, breakLine: si < it.subs.length - 1 || i < items.length - 1, fontSize: (opts.fontSize || 14) - 1.5, color: opts.color || C.offWhite, fontFace: "Calibri" } });
    });
    return rows;
  }).flat();
  slide.addText(textArr, { x, y, w, h });
}

function card(slide, x, y, w, h, fillColor = C.midnight) {
  slide.addShape(pres.ShapeType.rect, { x, y, w, h, fill: { color: fillColor }, line: { color: C.teal, width: 0.5 }, shadow: { type: "outer", blur: 6, offset: 3, angle: 45, color: "000000", opacity: 0.35 } });
}

function labelBox(slide, text, x, y, w, h, fillColor = C.teal, textColor = C.navy) {
  slide.addShape(pres.ShapeType.rect, { x, y, w, h, fill: { color: fillColor } });
  slide.addText(text, { x, y, w, h, fontSize: 11, bold: true, color: textColor, align: "center", valign: "middle", fontFace: "Calibri", margin: 0 });
}

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 1 — TITLE
// ─────────────────────────────────────────────────────────────────────────────
{
  const s = addSlide();
  sectionBg(s);
  // Decorative circles
  s.addShape(pres.ShapeType.ellipse, { x: 7.5, y: -0.8, w: 4.5, h: 4.5, fill: { color: C.midnight }, line: { color: C.midnight } });
  s.addShape(pres.ShapeType.ellipse, { x: 8.2, y: 0.5, w: 2.8, h: 2.8, fill: { color: C.teal }, line: { color: C.teal } });
  s.addShape(pres.ShapeType.rect, { x: 0, y: 5.1, w: 10, h: 0.525, fill: { color: C.midnight } });
  s.addShape(pres.ShapeType.rect, { x: 0, y: 5.05, w: 10, h: 0.07, fill: { color: C.teal } });

  s.addText("SCHIZOPHRENIA", {
    x: 0.5, y: 1.0, w: 7.5, h: 1.0,
    fontSize: 48, bold: true, color: C.white, fontFace: "Calibri",
    charSpacing: 4, margin: 0
  });
  s.addShape(pres.ShapeType.rect, { x: 0.5, y: 2.1, w: 3.5, h: 0.06, fill: { color: C.teal } });
  s.addText("Case Presentation", {
    x: 0.5, y: 2.25, w: 7, h: 0.55,
    fontSize: 22, color: C.tealLight, fontFace: "Calibri", italic: true, margin: 0
  });
  s.addText("Psychiatry | DSM-5-TR Criteria | Evidence-Based Management", {
    x: 0.5, y: 2.95, w: 7.5, h: 0.35,
    fontSize: 12, color: C.lightGray, fontFace: "Calibri", charSpacing: 1, margin: 0
  });
  s.addText("Sources: Harrison's 22e · Goldman-Cecil Medicine · Adams & Victor · Goodman & Gilman", {
    x: 0.3, y: 5.12, w: 9.4, h: 0.35,
    fontSize: 9, color: C.lightGray, fontFace: "Calibri", align: "center", margin: 0
  });
}

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 2 — OVERVIEW / AGENDA
// ─────────────────────────────────────────────────────────────────────────────
{
  const s = addSlide();
  sectionBg(s);
  topBar(s);
  slideTitle(s, "Presentation Outline");
  accentLine(s);

  const sections = [
    ["01", "Definition & Epidemiology"],
    ["02", "Historical Background"],
    ["03", "Etiology & Pathophysiology"],
    ["04", "Clinical Features"],
    ["05", "DSM-5-TR Diagnostic Criteria"],
    ["06", "Differential Diagnosis"],
    ["07", "Investigations"],
    ["08", "Treatment — Pharmacological"],
    ["09", "Treatment — Psychosocial"],
    ["10", "Prognosis & Complications"],
  ];

  sections.forEach(([num, label], i) => {
    const col = i < 5 ? 0 : 1;
    const row = i % 5;
    const x = 0.5 + col * 4.8;
    const y = 1.1 + row * 0.88;
    card(s, x, y, 4.5, 0.72, C.midnight);
    s.addShape(pres.ShapeType.rect, { x, y, w: 0.55, h: 0.72, fill: { color: C.teal } });
    s.addText(num, { x, y, w: 0.55, h: 0.72, fontSize: 13, bold: true, color: C.navy, align: "center", valign: "middle", fontFace: "Calibri", margin: 0 });
    s.addText(label, { x: x + 0.65, y, w: 3.8, h: 0.72, fontSize: 13, color: C.white, valign: "middle", fontFace: "Calibri", margin: 0 });
  });
}

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 3 — DEFINITION & EPIDEMIOLOGY
// ─────────────────────────────────────────────────────────────────────────────
{
  const s = addSlide();
  sectionBg(s);
  topBar(s);
  slideTitle(s, "Definition & Epidemiology");
  accentLine(s);
  subTitle(s, "WHAT IS SCHIZOPHRENIA?", 0.95);

  s.addText(
    "A heterogeneous psychotic syndrome characterized by perturbations of language, perception, thinking, social activity, affect, and volition — with no pathognomonic features.",
    { x: 0.5, y: 1.32, w: 9, h: 0.65, fontSize: 13, color: C.offWhite, fontFace: "Calibri", italic: true }
  );

  // Stats cards
  const stats = [
    ["~1%", "Lifetime prevalence worldwide"],
    ["50%", "Concordance in MZ twins"],
    ["40%", "Risk if both parents affected"],
    ["~15", "New cases per 100,000/year"],
    ["10%", "Lifetime suicide risk"],
    ["½", "Of all psych hospital beds"],
  ];
  stats.forEach(([val, label], i) => {
    const col = i % 3;
    const row = Math.floor(i / 3);
    const x = 0.5 + col * 3.1;
    const y = 2.05 + row * 1.55;
    card(s, x, y, 2.85, 1.35, C.midnight);
    s.addText(val, { x, y: y + 0.1, w: 2.85, h: 0.65, fontSize: 28, bold: true, color: C.teal, align: "center", fontFace: "Calibri", margin: 0 });
    s.addText(label, { x, y: y + 0.75, w: 2.85, h: 0.5, fontSize: 11, color: C.lightGray, align: "center", fontFace: "Calibri", margin: 4 });
  });

  s.addText("Peak onset: late adolescence to young adulthood · Slightly more common in males · Earlier onset in males", {
    x: 0.5, y: 5.22, w: 9, h: 0.28, fontSize: 9.5, color: C.lightGray, fontFace: "Calibri", align: "center", italic: true, margin: 0
  });
}

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 4 — HISTORICAL BACKGROUND
// ─────────────────────────────────────────────────────────────────────────────
{
  const s = addSlide();
  sectionBg(s);
  topBar(s);
  slideTitle(s, "Historical Background");
  accentLine(s);

  const timeline = [
    { year: "1890s", person: "Emil Kraepelin", text: 'Separated "dementia praecox" from bipolar psychosis. Emphasized onset in adolescence, chronic deteriorating course.' },
    { year: "1911",  person: "Eugen Bleuler",   text: 'Coined "Schizophrenia." Described the four A\'s: loose Associations, flat Affect, Ambivalence, Autism.' },
    { year: "1952",  person: "Henri Laborit",   text: "Chlorpromazine discovered. Revolutionized treatment — first effective pharmacotherapy." },
    { year: "1980+", person: "DSM Era",         text: "Operational criteria introduced. Dopamine hypothesis formalized. Atypical antipsychotics developed (clozapine 1989)." },
  ];

  timeline.forEach(({ year, person, text }, i) => {
    const y = 1.05 + i * 1.1;
    s.addShape(pres.ShapeType.ellipse, { x: 0.3, y: y + 0.15, w: 0.6, h: 0.6, fill: { color: C.teal } });
    s.addText(year.slice(0, 4), { x: 0.3, y: y + 0.15, w: 0.6, h: 0.6, fontSize: 9, bold: true, color: C.navy, align: "center", valign: "middle", fontFace: "Calibri", margin: 0 });
    s.addShape(pres.ShapeType.rect, { x: 0.6, y: y + 0.43, w: 0.5, h: 0.03, fill: { color: C.teal } });
    s.addText(person, { x: 1.2, y, w: 2.2, h: 0.38, fontSize: 12, bold: true, color: C.tealLight, fontFace: "Calibri", margin: 0 });
    s.addText(text,   { x: 1.2, y: y + 0.38, w: 8.3, h: 0.58, fontSize: 12, color: C.offWhite, fontFace: "Calibri", margin: 0 });
  });
}

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 5 — ETIOLOGY
// ─────────────────────────────────────────────────────────────────────────────
{
  const s = addSlide();
  sectionBg(s);
  topBar(s);
  slideTitle(s, "Etiology & Risk Factors");
  accentLine(s);

  // Left column — Genetic
  card(s, 0.4, 1.05, 4.4, 4.3, C.midnight);
  labelBox(s, "GENETIC FACTORS", 0.4, 1.05, 4.4, 0.38);
  s.addText([
    { text: "Genetic heritability ~50%", options: { bullet: true, breakLine: true, bold: true, color: C.tealLight, fontSize: 12.5, fontFace: "Calibri" } },
    { text: "~6.6% risk in first-degree relatives", options: { bullet: true, breakLine: true, color: C.offWhite, fontSize: 12, fontFace: "Calibri" } },
    { text: "40% risk if both parents affected", options: { bullet: true, breakLine: true, color: C.offWhite, fontSize: 12, fontFace: "Calibri" } },
    { text: "MZ twin concordance: 50% vs DZ: 10%", options: { bullet: true, breakLine: true, color: C.offWhite, fontSize: 12, fontFace: "Calibri" } },
    { text: "GWAS: hundreds of small-effect risk loci + CNVs", options: { bullet: true, breakLine: true, color: C.offWhite, fontSize: 12, fontFace: "Calibri" } },
    { text: "Pathways: immunity, inflammation, cell signaling, synaptic plasticity", options: { bullet: true, breakLine: false, color: C.offWhite, fontSize: 12, fontFace: "Calibri" } },
  ], { x: 0.55, y: 1.5, w: 4.1, h: 3.7 });

  // Right column — Environmental
  card(s, 5.2, 1.05, 4.4, 4.3, C.midnight);
  labelBox(s, "ENVIRONMENTAL & DEVELOPMENTAL", 5.2, 1.05, 4.4, 0.38, C.amber, C.navy);
  s.addText([
    { text: "Neurodevelopmental", options: { bullet: true, breakLine: true, bold: true, color: C.amber, fontSize: 12.5, fontFace: "Calibri" } },
    { text: "Prenatal infection / maternal malnutrition", options: { bullet: true, breakLine: true, color: C.offWhite, fontSize: 12, fontFace: "Calibri" } },
    { text: "Obstetric complications, winter birth", options: { bullet: true, breakLine: true, color: C.offWhite, fontSize: 12, fontFace: "Calibri" } },
    { text: "Increasing paternal age", options: { bullet: true, breakLine: true, color: C.offWhite, fontSize: 12, fontFace: "Calibri" } },
    { text: "Psychosocial", options: { bullet: true, breakLine: true, bold: true, color: C.amber, fontSize: 12.5, fontFace: "Calibri" } },
    { text: "Urban upbringing, social isolation", options: { bullet: true, breakLine: true, color: C.offWhite, fontSize: 12, fontFace: "Calibri" } },
    { text: "Substance use (especially cannabis)", options: { bullet: true, breakLine: true, color: C.offWhite, fontSize: 12, fontFace: "Calibri" } },
    { text: "Psychosocial stressors precipitate relapses", options: { bullet: true, breakLine: false, color: C.offWhite, fontSize: 12, fontFace: "Calibri" } },
  ], { x: 5.35, y: 1.5, w: 4.1, h: 3.7 });
}

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 6 — PATHOPHYSIOLOGY (with dopamine pathway image)
// ─────────────────────────────────────────────────────────────────────────────
{
  const s = addSlide();
  sectionBg(s);
  topBar(s);
  slideTitle(s, "Pathophysiology");
  accentLine(s);

  // Left: text
  card(s, 0.4, 1.05, 5.0, 4.35, C.midnight);
  s.addText([
    { text: "Dopamine Hypothesis", options: { bullet: false, breakLine: true, bold: true, fontSize: 14, color: C.tealLight, fontFace: "Calibri" } },
    { text: "Mesolimbic pathway HYPERACTIVITY → Positive symptoms (hallucinations, delusions)", options: { bullet: true, breakLine: true, fontSize: 12, color: C.offWhite, fontFace: "Calibri" } },
    { text: "Mesocortical pathway HYPOACTIVITY → Negative & cognitive symptoms", options: { bullet: true, breakLine: true, fontSize: 12, color: C.offWhite, fontFace: "Calibri" } },
    { text: "All antipsychotics act on D2 receptors in ventral striatum", options: { bullet: true, breakLine: true, fontSize: 12, color: C.offWhite, fontFace: "Calibri" } },
    { text: "Glutamate Hypothesis", options: { bullet: false, breakLine: true, bold: true, fontSize: 14, color: C.amber, fontFace: "Calibri" } },
    { text: "NMDA receptor hypofunction on GABAergic interneurons → cortical disinhibition", options: { bullet: true, breakLine: true, fontSize: 12, color: C.offWhite, fontFace: "Calibri" } },
    { text: "Explains negative & cognitive symptoms unresponsive to typical APDs", options: { bullet: true, breakLine: true, fontSize: 12, color: C.offWhite, fontFace: "Calibri" } },
    { text: "Neurodevelopmental Model", options: { bullet: false, breakLine: true, bold: true, fontSize: 14, color: C.tealLight, fontFace: "Calibri" } },
    { text: "Subtle cortical cytoarchitectural disruption (non-gliotic) — lesion present at birth or acquired early in life", options: { bullet: true, breakLine: false, fontSize: 12, color: C.offWhite, fontFace: "Calibri" } },
  ], { x: 0.55, y: 1.12, w: 4.65, h: 4.22 });

  // Right: image
  if (dopaminePathwayImg) {
    s.addImage({ data: dopaminePathwayImg, x: 5.6, y: 1.05, w: 4.05, h: 4.35 });
    s.addText("Dopaminergic pathways — mesocortical & mesolimbic", {
      x: 5.6, y: 5.42, w: 4.05, h: 0.2,
      fontSize: 8, color: C.lightGray, align: "center", fontFace: "Calibri", italic: true, margin: 0
    });
  } else {
    card(s, 5.6, 1.05, 4.05, 4.35, C.midnight);
    s.addText("Dopamine Pathway Diagram\n(Mesocortical / Mesolimbic)", {
      x: 5.6, y: 2.5, w: 4.05, h: 1.5, fontSize: 13, color: C.lightGray, align: "center", fontFace: "Calibri"
    });
  }
}

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 7 — CLINICAL FEATURES
// ─────────────────────────────────────────────────────────────────────────────
{
  const s = addSlide();
  sectionBg(s);
  topBar(s);
  slideTitle(s, "Clinical Features");
  accentLine(s);
  subTitle(s, "POSITIVE · NEGATIVE · DISORGANIZED · COGNITIVE", 0.95);

  // Positive symptoms
  card(s, 0.35, 1.12, 4.55, 2.15, C.midnight);
  labelBox(s, "POSITIVE SYMPTOMS", 0.35, 1.12, 4.55, 0.36, C.teal, C.navy);
  s.addText([
    { text: "Hallucinations (typically auditory — voices commenting, commanding)", options: { bullet: true, breakLine: true, fontSize: 11.5, color: C.offWhite, fontFace: "Calibri" } },
    { text: "Delusions (persecutory, grandiose, referential, thought insertion/withdrawal)", options: { bullet: true, breakLine: true, fontSize: 11.5, color: C.offWhite, fontFace: "Calibri" } },
    { text: "Disorganized thinking / speech (loosening of associations, tangentiality, word salad)", options: { bullet: true, breakLine: false, fontSize: 11.5, color: C.offWhite, fontFace: "Calibri" } },
  ], { x: 0.5, y: 1.52, w: 4.2, h: 1.65 });

  // Negative symptoms
  card(s, 5.1, 1.12, 4.55, 2.15, C.midnight);
  labelBox(s, "NEGATIVE SYMPTOMS", 5.1, 1.12, 4.55, 0.36, C.amber, C.navy);
  s.addText([
    { text: "Flat affect / blunted emotional expression", options: { bullet: true, breakLine: true, fontSize: 11.5, color: C.offWhite, fontFace: "Calibri" } },
    { text: "Avolition (lack of motivation), Abulia, Anhedonia", options: { bullet: true, breakLine: true, fontSize: 11.5, color: C.offWhite, fontFace: "Calibri" } },
    { text: "Alogia (poverty of speech)", options: { bullet: true, breakLine: true, fontSize: 11.5, color: C.offWhite, fontFace: "Calibri" } },
    { text: "Social withdrawal, diminished social engagement", options: { bullet: true, breakLine: false, fontSize: 11.5, color: C.offWhite, fontFace: "Calibri" } },
  ], { x: 5.25, y: 1.52, w: 4.2, h: 1.65 });

  // Disorganized / Motor
  card(s, 0.35, 3.38, 4.55, 1.95, C.midnight);
  labelBox(s, "DISORGANIZED / MOTOR", 0.35, 3.38, 4.55, 0.36, C.tealLight, C.navy);
  s.addText([
    { text: "Grossly disorganized behavior / catatonia", options: { bullet: true, breakLine: true, fontSize: 11.5, color: C.offWhite, fontFace: "Calibri" } },
    { text: "Inappropriate affect (giggling, incongruent responses)", options: { bullet: true, breakLine: true, fontSize: 11.5, color: C.offWhite, fontFace: "Calibri" } },
    { text: "Motor rigidity, tremor, dyskinesias (~25% untreated)", options: { bullet: true, breakLine: false, fontSize: 11.5, color: C.offWhite, fontFace: "Calibri" } },
  ], { x: 0.5, y: 3.78, w: 4.2, h: 1.45 });

  // Cognitive
  card(s, 5.1, 3.38, 4.55, 1.95, C.midnight);
  labelBox(s, "COGNITIVE SYMPTOMS", 5.1, 3.38, 4.55, 0.36, "9B59B6", C.white);
  s.addText([
    { text: "Impaired working memory & executive function", options: { bullet: true, breakLine: true, fontSize: 11.5, color: C.offWhite, fontFace: "Calibri" } },
    { text: "Inability to abstract / separate relevant from irrelevant", options: { bullet: true, breakLine: true, fontSize: 11.5, color: C.offWhite, fontFace: "Calibri" } },
    { text: "Poor sustained attention and verbal fluency", options: { bullet: true, breakLine: false, fontSize: 11.5, color: C.offWhite, fontFace: "Calibri" } },
  ], { x: 5.25, y: 3.78, w: 4.2, h: 1.45 });
}

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 8 — DSM-5-TR DIAGNOSTIC CRITERIA
// ─────────────────────────────────────────────────────────────────────────────
{
  const s = addSlide();
  sectionBg(s);
  topBar(s);
  slideTitle(s, "DSM-5-TR Diagnostic Criteria");
  accentLine(s);
  subTitle(s, "ALL CRITERIA MUST BE MET", 0.95);

  // Criterion A
  card(s, 0.4, 1.1, 5.8, 2.55, C.midnight);
  labelBox(s, "CRITERION A — ≥2 of the following for ≥1 month", 0.4, 1.1, 5.8, 0.38, C.teal, C.navy);
  const critA = [
    ["1. Delusions", "(at least one of items 1–3 required)"],
    ["2. Hallucinations", ""],
    ["3. Disorganized speech", ""],
    ["4. Grossly disorganized or catatonic behavior", ""],
    ["5. Negative symptoms", "(diminished emotion, avolition)"],
  ];
  critA.forEach(([main, note], i) => {
    const y = 1.54 + i * 0.42;
    s.addShape(pres.ShapeType.ellipse, { x: 0.5, y: y + 0.08, w: 0.22, h: 0.22, fill: { color: C.teal } });
    s.addText(main, { x: 0.8, y, w: 3.6, h: 0.38, fontSize: 12, bold: true, color: C.white, fontFace: "Calibri", valign: "middle", margin: 0 });
    if (note) s.addText(note, { x: 4.42, y, w: 1.65, h: 0.38, fontSize: 10, color: C.lightGray, fontFace: "Calibri", italic: true, valign: "middle", margin: 0 });
  });

  // Criteria B/C/D/E
  const otherCriteria = [
    ["B", "Social/Occupational Dysfunction", "Marked decline in work, interpersonal relations, or self-care since onset"],
    ["C", "Duration", "Continuous signs ≥6 months (including ≥1 month of Criterion A symptoms; may include prodromal/residual periods)"],
    ["D", "Rule out Schizoaffective / Mood disorder", "No major mood episodes concurrently, or mood episodes brief relative to active/residual phases"],
    ["E", "Rule out substance/medical condition", "Not attributable to physiological effects of substance or another medical condition"],
  ];
  otherCriteria.forEach(([letter, title, desc], i) => {
    const y = 1.1 + i * 1.12;
    card(s, 6.4, y, 3.25, 1.0, C.midnight);
    s.addShape(pres.ShapeType.rect, { x: 6.4, y, w: 0.38, h: 1.0, fill: { color: C.amber } });
    s.addText(letter, { x: 6.4, y, w: 0.38, h: 1.0, fontSize: 16, bold: true, color: C.navy, align: "center", valign: "middle", fontFace: "Calibri", margin: 0 });
    s.addText(title, { x: 6.85, y: y + 0.04, w: 2.7, h: 0.36, fontSize: 11, bold: true, color: C.tealLight, fontFace: "Calibri", margin: 0 });
    s.addText(desc, { x: 6.85, y: y + 0.4, w: 2.7, h: 0.55, fontSize: 10, color: C.offWhite, fontFace: "Calibri", margin: 0 });
  });

  s.addText("Brief Psychotic Disorder: <1 mo  |  Schizophreniform: 1–6 mo  |  Schizophrenia: >6 mo", {
    x: 0.4, y: 5.2, w: 9.2, h: 0.28, fontSize: 9.5, color: C.amber, align: "center", fontFace: "Calibri", bold: true, margin: 0
  });
}

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 9 — DIFFERENTIAL DIAGNOSIS
// ─────────────────────────────────────────────────────────────────────────────
{
  const s = addSlide();
  sectionBg(s);
  topBar(s);
  slideTitle(s, "Differential Diagnosis");
  accentLine(s);
  subTitle(s, "EXCLUSION IS ESSENTIAL — DIAGNOSIS OF EXCLUSION", 0.95);

  const ddx = [
    { cat: "Psychiatric", color: C.teal, items: ["Schizoaffective disorder (schizophrenia + independent mood episodes)", "Brief psychotic disorder (<1 month)", "Schizophreniform disorder (1–6 months)", "Bipolar disorder with psychotic features", "Major depressive disorder with psychosis", "Delusional disorder (delusions only, no other symptoms)"] },
    { cat: "Medical & Neurological", color: C.amber, items: ["Autoimmune encephalitis (anti-NMDA receptor) — must rule out in first episode", "CNS tumors, epilepsy (temporal lobe)", "Delirium, dementia (Wilson's, Huntington's)", "Endocrine: thyroid, Cushing's, SLE cerebritis", "Vitamin B12 / folate deficiency"] },
    { cat: "Substance-Induced", color: C.red, items: ["Stimulants (amphetamines, cocaine) — mimic positive symptoms", "Cannabis (especially high-THC) — precipitates/worsens psychosis", "Phencyclidine (PCP) — mimics both positive and negative symptoms", "Prescription drugs: dopaminergics, steroids, anticholinergics"] },
  ];

  ddx.forEach(({ cat, color, items }, ci) => {
    const x = 0.35 + ci * 3.22;
    card(s, x, 1.1, 3.0, 4.25, C.midnight);
    labelBox(s, cat.toUpperCase(), x, 1.1, 3.0, 0.36, color, ci === 0 ? C.navy : C.white);
    const textArr = items.map((it, ii) => ({
      text: it, options: { bullet: true, breakLine: ii < items.length - 1, fontSize: 11, color: C.offWhite, fontFace: "Calibri" }
    }));
    s.addText(textArr, { x: x + 0.15, y: 1.5, w: 2.7, h: 3.75 });
  });

  s.addText("Key: Rule out organic / substance cause before labeling schizophrenia — especially in FIRST episode psychosis!", {
    x: 0.4, y: 5.27, w: 9.2, h: 0.25, fontSize: 9.5, color: C.amber, bold: true, align: "center", fontFace: "Calibri", margin: 0
  });
}

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 10 — INVESTIGATIONS
// ─────────────────────────────────────────────────────────────────────────────
{
  const s = addSlide();
  sectionBg(s);
  topBar(s);
  slideTitle(s, "Investigations");
  accentLine(s);
  subTitle(s, "TO EXCLUDE ORGANIC CAUSES — NO DIAGNOSTIC TEST FOR SCHIZOPHRENIA", 0.95);

  const invx = [
    { title: "Blood Tests", color: C.teal, items: ["CBC, metabolic panel (CMP)", "TFTs (thyroid function)", "B12, folate, serum copper", "Serum ceruloplasmin (Wilson's)", "HIV, VDRL/RPR (syphilis)", "ANA, anti-dsDNA (SLE)", "Drug screen (toxicology)"] },
    { title: "CSF & Serology", color: C.amber, items: ["LP if encephalitis suspected", "Anti-NMDAR antibodies", "Anti-VGKC, anti-AMPA (autoimmune)", "CSF cell count, glucose, protein"] },
    { title: "Neuroimaging", color: "9B59B6", items: ["MRI brain (preferred over CT)", "Rule out structural lesions, tumors", "Findings in schizophrenia:", "  • Ventricular enlargement", "  • Reduced cortical gray matter (esp. prefrontal)", "  • No pathognomonic MRI finding"] },
    { title: "EEG", color: C.tealLight, items: ["Rule out temporal lobe epilepsy", "Non-specific abnormalities in ~20% of schizophrenia patients"] },
  ];

  invx.forEach(({ title, color, items }, i) => {
    const col = i % 2;
    const row = Math.floor(i / 2);
    const x = 0.35 + col * 4.85;
    const y = 1.1 + row * 2.2;
    card(s, x, y, 4.6, 2.05, C.midnight);
    labelBox(s, title.toUpperCase(), x, y, 4.6, 0.34, color, i === 0 || i === 2 ? C.navy : C.white);
    const textArr = items.map((it, ii) => ({
      text: it, options: { bullet: !it.startsWith("  "), breakLine: ii < items.length - 1, fontSize: 11.5, color: it.startsWith("  ") ? C.lightGray : C.offWhite, fontFace: "Calibri" }
    }));
    s.addText(textArr, { x: x + 0.15, y: y + 0.4, w: 4.3, h: 1.6 });
  });

  s.addText("Schizophrenia is a clinical diagnosis — investigations serve to EXCLUDE organic causes.", {
    x: 0.4, y: 5.27, w: 9.2, h: 0.25, fontSize: 9.5, color: C.amber, bold: true, align: "center", fontFace: "Calibri", margin: 0
  });
}

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 11 — PHARMACOLOGICAL TREATMENT
// ─────────────────────────────────────────────────────────────────────────────
{
  const s = addSlide();
  sectionBg(s);
  topBar(s);
  slideTitle(s, "Pharmacological Treatment");
  accentLine(s);
  subTitle(s, "ANTIPSYCHOTICS — CORNERSTONE OF ACUTE & MAINTENANCE THERAPY", 0.95);

  // First-gen table
  card(s, 0.35, 1.08, 9.3, 1.85, C.midnight);
  labelBox(s, "FIRST-GENERATION (TYPICAL) ANTIPSYCHOTICS — D2 Antagonists", 0.35, 1.08, 9.3, 0.34, C.slate, C.white);
  const fgaHeaders = ["Drug", "Dose (mg/day)", "Potency", "Key Side Effects"];
  const fgaData = [
    ["Chlorpromazine", "100–1000", "Low", "Anticholinergic, sedation, orthostasis, photosensitivity"],
    ["Haloperidol", "1–40", "High", "High EPS, tardive dyskinesia, little sedation"],
    ["Trifluoperazine", "2–50", "High", "EPS common, less anticholinergic"],
    ["Perphenazine", "4–64", "Mid", "Less EPS than high-potency; comparable to SGAs (CATIE)"],
  ];
  const colWidths = [1.8, 1.6, 1.2, 4.5];
  fgaHeaders.forEach((h, ci) => {
    const x = 0.4 + colWidths.slice(0, ci).reduce((a,b) => a+b, 0);
    s.addText(h, { x, y: 1.44, w: colWidths[ci], h: 0.28, fontSize: 10, bold: true, color: C.teal, fontFace: "Calibri", margin: 2 });
  });
  fgaData.forEach((row, ri) => {
    const y = 1.74 + ri * 0.3;
    const bg = ri % 2 === 0 ? "1F2F3F" : C.midnight;
    s.addShape(pres.ShapeType.rect, { x: 0.35, y, w: 9.3, h: 0.3, fill: { color: bg } });
    row.forEach((cell, ci) => {
      const x = 0.4 + colWidths.slice(0, ci).reduce((a,b) => a+b, 0);
      s.addText(cell, { x, y, w: colWidths[ci], h: 0.3, fontSize: 10, color: C.offWhite, fontFace: "Calibri", valign: "middle", margin: 2 });
    });
  });

  // Second-gen table
  card(s, 0.35, 3.05, 9.3, 2.35, C.midnight);
  labelBox(s, "SECOND-GENERATION (ATYPICAL) ANTIPSYCHOTICS — Lower EPS, Metabolic Risk", 0.35, 3.05, 9.3, 0.34, C.teal, C.navy);
  const sgaHeaders = ["Drug", "Dose (mg/day)", "Key Features / Side Effects"];
  const sgaData = [
    ["Clozapine", "150–600", "Most efficacious for treatment-resistant schizophrenia; agranulocytosis risk — mandatory WBC monitoring; weight gain"],
    ["Olanzapine", "10–20", "Broad efficacy (+ and − symptoms); significant weight gain, metabolic syndrome, hyperglycemia"],
    ["Risperidone", "4–16", "D2 + 5HT2A; dose-dependent EPS; hyperprolactinemia; LAI formulation available"],
    ["Quetiapine", "400–800", "Less EPS; strong antihistamine sedation; metabolic effects; used for negative/cognitive symptoms"],
    ["Aripiprazole", "10–30", "D2 partial agonist; weight-neutral; akathisia; adjunct for depression"],
    ["Cariprazine", "1.5–6", "D3/D2 partial agonist; may be superior for negative symptoms over risperidone (2026 network meta-analysis)"],
  ];
  const sgaColWidths = [1.8, 1.6, 5.7];
  sgaHeaders.forEach((h, ci) => {
    const x = 0.4 + sgaColWidths.slice(0, ci).reduce((a,b) => a+b, 0);
    s.addText(h, { x, y: 3.41, w: sgaColWidths[ci], h: 0.26, fontSize: 10, bold: true, color: C.teal, fontFace: "Calibri", margin: 2 });
  });
  sgaData.forEach((row, ri) => {
    const y = 3.69 + ri * 0.33;
    const bg = ri % 2 === 0 ? "1F2F3F" : C.midnight;
    s.addShape(pres.ShapeType.rect, { x: 0.35, y, w: 9.3, h: 0.33, fill: { color: bg } });
    row.forEach((cell, ci) => {
      const x = 0.4 + sgaColWidths.slice(0, ci).reduce((a,b) => a+b, 0);
      s.addText(cell, { x, y, w: sgaColWidths[ci], h: 0.33, fontSize: 9.5, color: C.offWhite, fontFace: "Calibri", valign: "middle", margin: 2 });
    });
  });
}

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 12 — ANTIPSYCHOTIC SIDE EFFECTS
// ─────────────────────────────────────────────────────────────────────────────
{
  const s = addSlide();
  sectionBg(s);
  topBar(s);
  slideTitle(s, "Antipsychotic Side Effects");
  accentLine(s);

  const sideEffects = [
    { title: "Extrapyramidal (EPS)", color: C.red, items: ["Acute dystonia (oculogyric crisis, torticollis) — treat with anticholinergics", "Parkinsonism (bradykinesia, rigidity, tremor)", "Akathisia (motor restlessness) — most distressing to patients", "Tardive dyskinesia (TD) — late-onset, potentially irreversible choreoathetoid movements"] },
    { title: "Metabolic", color: C.amber, items: ["Weight gain — especially clozapine, olanzapine", "Dyslipidemia, hyperglycemia, metabolic syndrome", "Monitor: fasting glucose, lipids, BMI regularly"] },
    { title: "Hormonal / Autonomic", color: "9B59B6", items: ["Hyperprolactinemia (galactorrhea, amenorrhea) — risperidone, typicals", "Orthostatic hypotension (alpha-1 blockade)", "Anticholinergic: dry mouth, urinary retention, constipation, blurred vision"] },
    { title: "Serious / Rare", color: C.tealLight, items: ["Agranulocytosis — clozapine (0.5–1.6%); CBC monitoring weekly (1st 6 mo)", "Neuroleptic Malignant Syndrome (NMS): fever, rigidity, altered consciousness, autonomic instability — medical emergency", "QTc prolongation — thioridazine (withdrawn), ziprasidone, haloperidol"] },
  ];

  sideEffects.forEach(({ title, color, items }, i) => {
    const col = i % 2;
    const row = Math.floor(i / 2);
    const x = 0.35 + col * 4.85;
    const y = 1.05 + row * 2.25;
    card(s, x, y, 4.6, 2.1, C.midnight);
    labelBox(s, title.toUpperCase(), x, y, 4.6, 0.33, color, i === 1 || i === 2 ? C.navy : C.white);
    const textArr = items.map((it, ii) => ({
      text: it, options: { bullet: true, breakLine: ii < items.length - 1, fontSize: 11, color: C.offWhite, fontFace: "Calibri" }
    }));
    s.addText(textArr, { x: x + 0.15, y: y + 0.38, w: 4.3, h: 1.65 });
  });
}

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 13 — PSYCHOSOCIAL TREATMENT
// ─────────────────────────────────────────────────────────────────────────────
{
  const s = addSlide();
  sectionBg(s);
  topBar(s);
  slideTitle(s, "Psychosocial Treatment");
  accentLine(s);
  subTitle(s, "PHARMACOTHERAPY ALONE IS INSUFFICIENT", 0.95);

  const interventions = [
    { icon: "🧠", title: "Cognitive Behavioral Therapy (CBT)", text: "Addresses dysfunctional thoughts about delusions and hallucinations. Improves insight and coping strategies." },
    { icon: "👨‍👩‍👧", title: "Family Psychoeducation", text: "Educates families on illness course, reduces expressed emotion (EE). Critical for reducing relapse rates." },
    { icon: "🏥", title: "Assertive Community Treatment (ACT)", text: "Multidisciplinary case-management teams. Active outreach in the community. Reduces hospitalization." },
    { icon: "🎯", title: "Social Skills Training", text: "Structured behavioral techniques to improve interpersonal competence, communication, and daily living skills." },
    { icon: "💼", title: "Vocational Rehabilitation", text: "Supported employment programs. Improves occupational functioning and quality of life." },
    { icon: "🌱", title: "Early Intervention Programs", text: "First-episode psychosis clinics. Early identification of at-risk individuals. May alter long-term illness trajectory." },
  ];

  interventions.forEach(({ icon, title, text }, i) => {
    const col = i % 3;
    const row = Math.floor(i / 3);
    const x = 0.35 + col * 3.2;
    const y = 1.08 + row * 2.2;
    card(s, x, y, 3.0, 2.0, C.midnight);
    s.addText(icon, { x, y: y + 0.15, w: 3.0, h: 0.55, fontSize: 22, align: "center", fontFace: "Segoe UI Emoji", margin: 0 });
    s.addText(title, { x: x + 0.1, y: y + 0.72, w: 2.8, h: 0.42, fontSize: 11.5, bold: true, color: C.teal, align: "center", fontFace: "Calibri", margin: 0 });
    s.addText(text, { x: x + 0.1, y: y + 1.14, w: 2.8, h: 0.76, fontSize: 10.5, color: C.offWhite, align: "center", fontFace: "Calibri", margin: 0 });
  });
}

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 14 — PROGNOSIS & COMPLICATIONS (with brain comparison image)
// ─────────────────────────────────────────────────────────────────────────────
{
  const s = addSlide();
  sectionBg(s);
  topBar(s);
  slideTitle(s, "Prognosis & Complications");
  accentLine(s);

  // Left: prognosis text
  card(s, 0.35, 1.05, 5.1, 4.35, C.midnight);
  s.addText([
    { text: "Course of Illness", options: { bullet: false, breakLine: true, bold: true, fontSize: 14, color: C.tealLight, fontFace: "Calibri" } },
    { text: "Progressive deterioration early, then partial stabilization", options: { bullet: true, breakLine: true, fontSize: 12, color: C.offWhite, fontFace: "Calibri" } },
    { text: "Negative symptoms dominate in 1/3 of patients — poor prognosis", options: { bullet: true, breakLine: true, fontSize: 12, color: C.offWhite, fontFace: "Calibri" } },
    { text: "As patients age, positive symptoms tend to attenuate", options: { bullet: true, breakLine: true, fontSize: 12, color: C.offWhite, fontFace: "Calibri" } },
    { text: "Permanent remission: rare but occurs", options: { bullet: true, breakLine: true, fontSize: 12, color: C.offWhite, fontFace: "Calibri" } },
    { text: "Poor Prognostic Factors", options: { bullet: false, breakLine: true, bold: true, fontSize: 14, color: C.amber, fontFace: "Calibri" } },
    { text: "Insidious onset, prominent negative symptoms, low premorbid function, male sex, early onset, poor treatment compliance", options: { bullet: true, breakLine: true, fontSize: 12, color: C.offWhite, fontFace: "Calibri" } },
    { text: "Complications", options: { bullet: false, breakLine: true, bold: true, fontSize: 14, color: C.red, fontFace: "Calibri" } },
    { text: "Suicide: ~10% lifetime risk (most common cause of premature death)", options: { bullet: true, breakLine: true, fontSize: 12, color: C.offWhite, fontFace: "Calibri" } },
    { text: "Substance abuse comorbidity: ~50%", options: { bullet: true, breakLine: true, fontSize: 12, color: C.offWhite, fontFace: "Calibri" } },
    { text: "Metabolic syndrome from antipsychotic treatment", options: { bullet: true, breakLine: false, fontSize: 12, color: C.offWhite, fontFace: "Calibri" } },
  ], { x: 0.5, y: 1.12, w: 4.7, h: 4.22 });

  // Right: brain comparison image
  if (brainCompareImg) {
    s.addImage({ data: brainCompareImg, x: 5.6, y: 1.05, w: 4.05, h: 4.35 });
    s.addText("Healthy vs Schizophrenia dopaminergic pathway comparison", {
      x: 5.6, y: 5.42, w: 4.05, h: 0.2,
      fontSize: 8, color: C.lightGray, align: "center", fontFace: "Calibri", italic: true, margin: 0
    });
  } else {
    card(s, 5.6, 1.05, 4.05, 4.35, C.midnight);
    s.addText("Healthy vs Schizophrenia\nBrain Pathway Diagram", {
      x: 5.6, y: 2.5, w: 4.05, h: 1.5, fontSize: 13, color: C.lightGray, align: "center", fontFace: "Calibri"
    });
  }
}

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 15 — SUMMARY / KEY TAKEAWAYS
// ─────────────────────────────────────────────────────────────────────────────
{
  const s = addSlide();
  sectionBg(s);
  topBar(s, C.amber);

  s.addShape(pres.ShapeType.rect, { x: 0, y: 5.1, w: 10, h: 0.525, fill: { color: C.midnight } });
  s.addShape(pres.ShapeType.rect, { x: 0, y: 5.05, w: 10, h: 0.07, fill: { color: C.amber } });

  slideTitle(s, "Key Takeaways", 0.2);
  s.addShape(pres.ShapeType.rect, { x: 0.5, y: 0.82, w: 2.0, h: 0.04, fill: { color: C.amber } });

  const takeaways = [
    ["🔑", "Diagnosis", "Clinical diagnosis (DSM-5-TR) requiring ≥2 symptoms ≥1 month + 6-month total duration — always EXCLUDE organic causes first"],
    ["🧬", "Pathophysiology", "Dopamine imbalance: mesolimbic hyperactivity (positive symptoms) + mesocortical hypofunction (negative/cognitive symptoms)"],
    ["💊", "Treatment", "Atypical (SGAs) are first-line; Clozapine for treatment-resistant; Long-acting injectables reduce relapse; Psychosocial therapy is essential"],
    ["⚠️", "Side Effects", "EPS/TD (typicals), Metabolic syndrome (SGAs), Agranulocytosis (clozapine) — monitor proactively"],
    ["📈", "Prognosis", "Chronic relapsing course; ~10% suicide risk; early intervention and family involvement improve outcomes"],
    ["🔬", "Recent Evidence", "2026 network meta-analysis confirms SGAs + muscarinic agents; Cariprazine shows promise for negative symptoms (Lancet 2026)"],
  ];

  takeaways.forEach(([icon, label, text], i) => {
    const col = i % 2;
    const row = Math.floor(i / 3);
    const x = 0.35 + col * 4.85;
    const y = 0.95 + row * 1.42;
    // slightly shift last row
    const adjY = i >= 4 ? y + (i - 4) * 0.0 : y;
    card(s, x, adjY < 5 ? adjY : adjY, 4.6, 1.28, C.midnight);
    s.addText(icon, { x, y: adjY + 0.12, w: 0.65, h: 1.04, fontSize: 22, align: "center", valign: "middle", fontFace: "Segoe UI Emoji", margin: 0 });
    s.addText(label, { x: x + 0.7, y: adjY + 0.1, w: 3.8, h: 0.36, fontSize: 12, bold: true, color: C.amber, fontFace: "Calibri", margin: 0 });
    s.addText(text, { x: x + 0.7, y: adjY + 0.46, w: 3.8, h: 0.75, fontSize: 11, color: C.offWhite, fontFace: "Calibri", margin: 0 });
  });

  s.addText("Harrison's Principles of Internal Medicine 22e · Goldman-Cecil Medicine · Adams & Victor's Neurology 12e · Goodman & Gilman's Pharmacology 14e", {
    x: 0.3, y: 5.12, w: 9.4, h: 0.35,
    fontSize: 8.5, color: C.lightGray, fontFace: "Calibri", align: "center", margin: 0
  });
}

// ─────────────────────────────────────────────────────────────────────────────
// WRITE FILE
// ─────────────────────────────────────────────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/workspace/schizophrenia-ppt/Schizophrenia_Case_Presentation.pptx" })
  .then(() => console.log("SUCCESS: File written"))
  .catch(err => { console.error("ERROR:", err); process.exit(1); });
Your credits are exhausted. Your daily credits reset tomorrow, or you can purchase a top-up for more.
This is a shared conversation. Sign in to Orris to start your own chat.