Make a PPT on bipolar disorder using Kaplan & Sadock's Comprehensive Textbook of Psychiatry

Reading File
Reading File
Reading File
Finding Sources
Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Reading File
Reading File
Finding Sources
Reading File
Finding Sources
Reading File
Reading File
Reading File
Running Command

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

Writing File

~/bipolar-ppt/build.js

const pptxgen = require("pptxgenjs");

const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Bipolar Disorder";
pres.author = "Kaplan & Sadock's Comprehensive Textbook of Psychiatry";

// ── COLOR PALETTE ──────────────────────────────────────────────────────────
// Deep navy dominates (60-70%), slate-blue as support, warm amber accent
const C = {
  darkBg:    "0D1B2A",  // deep navy
  midBg:     "1A2E44",  // slightly lighter navy
  cardBg:    "1E3A5F",  // slate-blue panel
  accent:    "E8A838",  // warm amber
  accent2:   "4CB8C4",  // teal highlight
  white:     "FFFFFF",
  offWhite:  "E8EDF2",
  lightGray: "B0BCC8",
  green:     "4CAF81",
  red:       "E05C5C",
};

function hdr(slide, text, sub) {
  // slim top bar
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.08, fill: { color: C.accent } });
  slide.addText(text, {
    x: 0.4, y: 0.12, w: 9.2, h: 0.55,
    fontSize: 22, bold: true, color: C.accent, fontFace: "Calibri",
    margin: 0,
  });
  if (sub) {
    slide.addShape(pres.ShapeType.rect, { x: 0.4, y: 0.72, w: 2.0, h: 0.04, fill: { color: C.accent2 } });
    slide.addText(sub, {
      x: 0.4, y: 0.78, w: 9.2, h: 0.32,
      fontSize: 11, color: C.lightGray, fontFace: "Calibri", italic: true, margin: 0,
    });
  }
}

function bullet(items) {
  return items.map((t, i) => ({
    text: t,
    options: { bullet: { code: "2022" }, color: C.offWhite, fontSize: 13, fontFace: "Calibri",
      paraSpaceBefore: i === 0 ? 0 : 4, breakLine: i < items.length - 1 },
  }));
}

function subBullet(items) {
  return items.map((t, i) => ({
    text: t,
    options: {
      bullet: { code: "2013", indent: 20 }, color: C.lightGray, fontSize: 11.5, fontFace: "Calibri",
      paraSpaceBefore: 2, breakLine: i < items.length - 1,
    },
  }));
}

function card(slide, x, y, w, h, title, lines, accentColor) {
  slide.addShape(pres.ShapeType.rect, { x, y, w, h, fill: { color: C.cardBg }, line: { color: accentColor || C.accent2, width: 1.5 } });
  slide.addText(title, { x: x + 0.12, y: y + 0.08, w: w - 0.24, h: 0.3, fontSize: 11, bold: true, color: accentColor || C.accent, fontFace: "Calibri", margin: 0 });
  slide.addShape(pres.ShapeType.line, { x: x + 0.12, y: y + 0.42, w: w - 0.24, h: 0, line: { color: accentColor || C.accent2, width: 0.5 } });
  const items = lines.map((l, i) => ({ text: l, options: { bullet: { code: "2022" }, color: C.offWhite, fontSize: 10.5, fontFace: "Calibri", paraSpaceBefore: i === 0 ? 0 : 3, breakLine: i < lines.length - 1 } }));
  slide.addText(items, { x: x + 0.12, y: y + 0.48, w: w - 0.2, h: h - 0.56 });
}

// ════════════════════════════════════════════════════════════════════
// SLIDE 1 — TITLE
// ════════════════════════════════════════════════════════════════════
{
  const sl = pres.addSlide();
  sl.background = { color: C.darkBg };

  // left accent stripe
  sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.18, h: 5.625, fill: { color: C.accent } });

  // big title
  sl.addText("BIPOLAR DISORDER", {
    x: 0.5, y: 1.3, w: 9, h: 1.2,
    fontSize: 44, bold: true, color: C.white, fontFace: "Calibri",
    charSpacing: 4, align: "left",
  });

  // subtitle line
  sl.addShape(pres.ShapeType.rect, { x: 0.5, y: 2.65, w: 5.5, h: 0.06, fill: { color: C.accent } });

  sl.addText("A Comprehensive Overview", {
    x: 0.5, y: 2.78, w: 7, h: 0.5,
    fontSize: 18, color: C.accent2, fontFace: "Calibri", italic: true,
  });

  sl.addText("Source: Kaplan & Sadock's Comprehensive Textbook of Psychiatry", {
    x: 0.5, y: 3.5, w: 9, h: 0.35,
    fontSize: 13, color: C.lightGray, fontFace: "Calibri",
  });

  sl.addText("DSM-5-TR | ICD-11", {
    x: 0.5, y: 4.0, w: 4, h: 0.3,
    fontSize: 11, color: C.accent, fontFace: "Calibri", bold: true,
  });

  // bottom bar
  sl.addShape(pres.ShapeType.rect, { x: 0, y: 5.3, w: 10, h: 0.325, fill: { color: C.midBg } });
  sl.addText("Psychiatry  |  Mood Disorders", {
    x: 0.4, y: 5.32, w: 9, h: 0.28,
    fontSize: 10, color: C.lightGray, fontFace: "Calibri", align: "right",
  });
}

// ════════════════════════════════════════════════════════════════════
// SLIDE 2 — OUTLINE
// ════════════════════════════════════════════════════════════════════
{
  const sl = pres.addSlide();
  sl.background = { color: C.darkBg };
  hdr(sl, "PRESENTATION OUTLINE", "Kaplan & Sadock's Comprehensive Textbook of Psychiatry");

  const topics = [
    ["01", "Introduction & Definition"],
    ["02", "Epidemiology"],
    ["03", "Etiology & Pathophysiology"],
    ["04", "Clinical Features & Classification"],
    ["05", "Diagnosis (DSM-5-TR & ICD-11)"],
    ["06", "Treatment — Pharmacotherapy"],
    ["07", "Treatment — Psychotherapy"],
    ["08", "Special Populations & Comorbidity"],
    ["09", "Prognosis & Course of Illness"],
    ["10", "Key Takeaways"],
  ];

  topics.forEach(([num, label], i) => {
    const col = i < 5 ? 0 : 1;
    const row = i < 5 ? i : i - 5;
    const x = col === 0 ? 0.5 : 5.3;
    const y = 1.25 + row * 0.82;

    sl.addShape(pres.ShapeType.rect, { x, y, w: 4.5, h: 0.65, fill: { color: C.cardBg }, line: { color: C.accent2, width: 1 } });
    sl.addText(num, { x: x + 0.1, y: y + 0.08, w: 0.55, h: 0.5, fontSize: 22, bold: true, color: C.accent, fontFace: "Calibri", margin: 0, align: "center" });
    sl.addShape(pres.ShapeType.line, { x: x + 0.7, y: y + 0.12, w: 0, h: 0.4, line: { color: C.accent2, width: 1 } });
    sl.addText(label, { x: x + 0.85, y: y + 0.08, w: 3.55, h: 0.5, fontSize: 12.5, color: C.offWhite, fontFace: "Calibri", valign: "middle", margin: 0 });
  });
}

// ════════════════════════════════════════════════════════════════════
// SLIDE 3 — INTRODUCTION & DEFINITION
// ════════════════════════════════════════════════════════════════════
{
  const sl = pres.addSlide();
  sl.background = { color: C.darkBg };
  hdr(sl, "INTRODUCTION & DEFINITION", "Kaplan & Sadock — Chapter 13.3 Mood Disorders");

  sl.addText(bullet([
    "Bipolar disorder (BPD) is a chronic, recurrent mood disorder characterized by episodes of mania or hypomania alternating with depressive episodes.",
    "Classified as a distinct category in DSM-5-TR between schizophrenia spectrum and depressive disorders — reflecting its position as a bridge between these two diagnostic realms.",
    "The term 'manic-depressive insanity' was coined by Kraepelin (1896), who unified the concepts of circular insanity, periodic mania, and periodic depression.",
    "Modern classification separates unipolar depression from bipolar disorders based on the presence of manic or hypomanic episodes.",
    "Bipolar disorder is highly heritable (60–80%), with MZ twin concordance of 65–100% versus 10–30% in DZ twins.",
  ]), { x: 0.4, y: 1.15, w: 9.2, h: 4.2 });

  // bottom citation
  sl.addShape(pres.ShapeType.rect, { x: 0, y: 5.2, w: 10, h: 0.425, fill: { color: C.midBg } });
  sl.addText("Source: Kaplan & Sadock's Comprehensive Textbook of Psychiatry", {
    x: 0.4, y: 5.25, w: 9, h: 0.3, fontSize: 9, color: C.lightGray, fontFace: "Calibri", italic: true,
  });
}

// ════════════════════════════════════════════════════════════════════
// SLIDE 4 — EPIDEMIOLOGY
// ════════════════════════════════════════════════════════════════════
{
  const sl = pres.addSlide();
  sl.background = { color: C.darkBg };
  hdr(sl, "EPIDEMIOLOGY", "WHO World Mental Health Surveys & NESARC Data");

  card(sl, 0.35, 1.1, 4.5, 2.1, "PREVALENCE (Lifetime)", [
    "Bipolar I: ~1.0% (WMH surveys); up to 3.3% (NESARC)",
    "Bipolar II: ~1.1% (NESARC); 12-month rate ~0.8%",
    "Bipolar spectrum disorders: ~2.4% cross-national lifetime",
    "Subthreshold bipolar disorder: ~1.4% of population",
  ], C.accent);

  card(sl, 5.15, 1.1, 4.5, 2.1, "YOUTH & AGE OF ONSET", [
    "Youth (BPI/II lifetime): <1% to 2.9%",
    "Meta-analysis of pediatric BPD: mean prevalence 1.8%",
    "Typical onset: teenage years to early 30s",
    "First episode may be manic, depressive, or mixed",
    "Boys more commonly affected in childhood-onset cases",
  ], C.accent2);

  card(sl, 0.35, 3.35, 4.5, 1.95, "SEX & COURSE", [
    "Overall sex ratio ~1:1 for bipolar I",
    "Men: more manic episodes on average",
    "Women: more mixed and depressive episodes",
    "Symptomatic ~50% of weeks over long-term follow-up (NIMH study)",
  ], C.green);

  card(sl, 5.15, 3.35, 4.5, 1.95, "MISDIAGNOSIS & DELAY", [
    "~2/3 of patients are initially misdiagnosed",
    "Most common misdiagnosis: major depressive disorder",
    "Average delay to correct diagnosis: 8–10 years",
    "Screening instruments (MDQ) are helpful but not sufficient",
  ], C.red);

  sl.addShape(pres.ShapeType.rect, { x: 0, y: 5.2, w: 10, h: 0.425, fill: { color: C.midBg } });
  sl.addText("Source: Kaplan & Sadock's Comprehensive Textbook of Psychiatry, pp. 4985–4986", {
    x: 0.4, y: 5.25, w: 9, h: 0.3, fontSize: 9, color: C.lightGray, fontFace: "Calibri", italic: true,
  });
}

// ════════════════════════════════════════════════════════════════════
// SLIDE 5 — ETIOLOGY & PATHOPHYSIOLOGY
// ════════════════════════════════════════════════════════════════════
{
  const sl = pres.addSlide();
  sl.background = { color: C.darkBg };
  hdr(sl, "ETIOLOGY & PATHOPHYSIOLOGY", "Kaplan & Sadock — Chapter 3 (Genetics & Neurobiology)");

  // 3 column cards
  card(sl, 0.25, 1.1, 3.1, 4.2, "GENETIC FACTORS", [
    "Heritability: 60–80%",
    "MZ concordance: 65–100%",
    "DZ concordance: 10–30%",
    "More heritable than unipolar MDD (30–40%)",
    "Polygenic — multiple interacting genes",
    "Candidate chromosomes: 18, X, 11 (early studies; results mixed)",
    "GWAS: identified multiple loci with small individual effect sizes",
    "Shared genetic risk with schizophrenia & MDD",
  ], C.accent);

  card(sl, 3.45, 1.1, 3.1, 4.2, "NEUROBIOLOGICAL FACTORS", [
    "Monoamine dysregulation: dopamine, serotonin, norepinephrine",
    "Dopamine excess implicated in mania; deficit in depression",
    "HPA axis dysregulation and cortisol hypersecretion",
    "Circadian rhythm disruption — abnormal melatonin patterns",
    "Neuroimaging: reduced amygdala volume, prefrontal cortex changes",
    "Kindling hypothesis: early episodes sensitize the brain to subsequent episodes",
    "Glutamate/GABA imbalance — targets for new therapies",
  ], C.accent2);

  card(sl, 6.65, 1.1, 3.1, 4.2, "ENVIRONMENTAL FACTORS", [
    "Life events (especially early adverse events) — precipitate episodes",
    "Sleep deprivation: potent trigger for mania",
    "Substance use: cannabis, stimulants can trigger episodes",
    "Antidepressant-induced mania (iatrogenic switching)",
    "Psychosocial stress — episode precipitant in vulnerable individuals",
    "Seasonal patterns in some patients",
    "Postpartum period: high-risk phase for first episodes",
  ], C.green);

  sl.addShape(pres.ShapeType.rect, { x: 0, y: 5.2, w: 10, h: 0.425, fill: { color: C.midBg } });
  sl.addText("Source: Kaplan & Sadock's Comprehensive Textbook of Psychiatry", {
    x: 0.4, y: 5.25, w: 9, h: 0.3, fontSize: 9, color: C.lightGray, fontFace: "Calibri", italic: true,
  });
}

// ════════════════════════════════════════════════════════════════════
// SLIDE 6 — CLINICAL FEATURES: MANIA
// ════════════════════════════════════════════════════════════════════
{
  const sl = pres.addSlide();
  sl.background = { color: C.darkBg };
  hdr(sl, "CLINICAL FEATURES — MANIC EPISODE", "DSM-5-TR: Distinct period of elevated/expansive/irritable mood lasting ≥1 week");

  // DIG FAST mnemonic box
  sl.addShape(pres.ShapeType.rect, { x: 0.35, y: 1.1, w: 4.2, h: 4.2, fill: { color: C.cardBg }, line: { color: C.accent, width: 1.5 } });
  sl.addText("DIG FAST MNEMONIC", { x: 0.47, y: 1.18, w: 3.9, h: 0.35, fontSize: 11, bold: true, color: C.accent, fontFace: "Calibri", margin: 0 });
  sl.addShape(pres.ShapeType.line, { x: 0.47, y: 1.56, w: 3.95, h: 0, line: { color: C.accent, width: 0.5 } });

  const digfast = [
    ["D", "Distractibility"],
    ["I", "Irresponsibility / impulsivity"],
    ["G", "Grandiosity"],
    ["F", "Flight of ideas"],
    ["A", "Activity increase (goal-directed)"],
    ["S", "Sleep decreased (need reduced)"],
    ["T", "Talkativeness (pressured speech)"],
  ];
  digfast.forEach(([letter, label], i) => {
    const y = 1.65 + i * 0.5;
    sl.addShape(pres.ShapeType.rect, { x: 0.47, y, w: 0.38, h: 0.38, fill: { color: C.accent }, line: { color: C.accent, width: 0 } });
    sl.addText(letter, { x: 0.47, y, w: 0.38, h: 0.38, fontSize: 15, bold: true, color: C.darkBg, fontFace: "Calibri", align: "center", valign: "middle", margin: 0 });
    sl.addText(label, { x: 0.95, y: y + 0.04, w: 3.5, h: 0.32, fontSize: 12, color: C.offWhite, fontFace: "Calibri", valign: "middle", margin: 0 });
  });

  // Right panel
  sl.addShape(pres.ShapeType.rect, { x: 4.75, y: 1.1, w: 4.9, h: 2.0, fill: { color: C.cardBg }, line: { color: C.accent2, width: 1.5 } });
  sl.addText("SUBTYPES & SPECIFIERS", { x: 4.87, y: 1.18, w: 4.6, h: 0.3, fontSize: 11, bold: true, color: C.accent2, fontFace: "Calibri", margin: 0 });
  sl.addShape(pres.ShapeType.line, { x: 4.87, y: 1.5, w: 4.6, h: 0, line: { color: C.accent2, width: 0.5 } });
  sl.addText(bullet([
    "Mania (≥7 days or hospitalized) → Bipolar I",
    "Hypomania (≥4 days, not severe) → Bipolar II",
    "With psychotic features (mood-congruent or incongruent)",
    "With mixed features (simultaneous depressive symptoms)",
    "With rapid cycling (≥4 episodes/year)",
    "With peripartum onset",
  ]), { x: 4.87, y: 1.55, w: 4.6, h: 1.5 });

  sl.addShape(pres.ShapeType.rect, { x: 4.75, y: 3.25, w: 4.9, h: 2.05, fill: { color: C.cardBg }, line: { color: C.red, width: 1.5 } });
  sl.addText("CLINICAL PEARLS", { x: 4.87, y: 3.33, w: 4.6, h: 0.3, fontSize: 11, bold: true, color: C.red, fontFace: "Calibri", margin: 0 });
  sl.addShape(pres.ShapeType.line, { x: 4.87, y: 3.65, w: 4.6, h: 0, line: { color: C.red, width: 0.5 } });
  sl.addText(bullet([
    "Men average more manic; women more mixed/depressive episodes",
    "Childhood mania: typically dysphoric-explosive, rapid cycling",
    "Irritability may be more prominent than euphoria, especially in mixed states",
    "Psychosis in mania can mimic schizophrenia — course clarifies diagnosis",
  ]), { x: 4.87, y: 3.7, w: 4.6, h: 1.55 });

  sl.addShape(pres.ShapeType.rect, { x: 0, y: 5.2, w: 10, h: 0.425, fill: { color: C.midBg } });
  sl.addText("Source: Kaplan & Sadock's Comprehensive Textbook of Psychiatry", {
    x: 0.4, y: 5.25, w: 9, h: 0.3, fontSize: 9, color: C.lightGray, fontFace: "Calibri", italic: true,
  });
}

// ════════════════════════════════════════════════════════════════════
// SLIDE 7 — CLASSIFICATION
// ════════════════════════════════════════════════════════════════════
{
  const sl = pres.addSlide();
  sl.background = { color: C.darkBg };
  hdr(sl, "CLASSIFICATION OF BIPOLAR DISORDERS", "DSM-5-TR Categories");

  const types = [
    { title: "Bipolar I Disorder", color: C.accent, lines: [
      "At least ONE manic episode (may or may not have depressive episodes)",
      "Mania: ≥7 days, marked functional impairment, may require hospitalization",
      "Psychotic features may be present during mania",
      "First episode may be manic, depressive, or mixed",
    ]},
    { title: "Bipolar II Disorder", color: C.accent2, lines: [
      "At least ONE hypomanic + ONE major depressive episode",
      "NO full manic or mixed episodes",
      "Hypomania ≥4 days, no marked impairment or hospitalization",
      "Depression predominates — average 37x more days depressed than hypomanic",
    ]},
    { title: "Cyclothymic Disorder", color: C.green, lines: [
      "≥2 years of hypomanic AND depressive symptoms (not meeting full criteria)",
      "Symptoms present ≥50% of the time; no symptom-free period >2 months",
      "Considered a temperament-based, chronic low-grade form of bipolar",
      "Significant risk factor for Bipolar I/II development",
    ]},
    { title: "Other Specified & Unspecified", color: C.red, lines: [
      "Substance/medication-induced bipolar disorder",
      "Bipolar disorder due to another medical condition",
      "Short-duration hypomanic episodes (<4 days) with MDE",
      "Hypomanic episodes without prior MDE (unspecified)",
    ]},
  ];

  types.forEach((t, i) => {
    const col = i % 2;
    const row = Math.floor(i / 2);
    const x = col === 0 ? 0.3 : 5.2;
    const y = 1.15 + row * 2.15;
    card(sl, x, y, 4.55, 1.98, t.title, t.lines, t.color);
  });

  sl.addShape(pres.ShapeType.rect, { x: 0, y: 5.2, w: 10, h: 0.425, fill: { color: C.midBg } });
  sl.addText("Source: Kaplan & Sadock's Comprehensive Textbook of Psychiatry — DSM-5-TR Criteria (pp. 5057–5067)", {
    x: 0.4, y: 5.25, w: 9, h: 0.3, fontSize: 9, color: C.lightGray, fontFace: "Calibri", italic: true,
  });
}

// ════════════════════════════════════════════════════════════════════
// SLIDE 8 — DIAGNOSIS
// ════════════════════════════════════════════════════════════════════
{
  const sl = pres.addSlide();
  sl.background = { color: C.darkBg };
  hdr(sl, "DIAGNOSIS", "DSM-5-TR vs ICD-11 Approach");

  // Two column comparison
  sl.addShape(pres.ShapeType.rect, { x: 0.3, y: 1.1, w: 4.5, h: 4.2, fill: { color: C.cardBg }, line: { color: C.accent, width: 1.5 } });
  sl.addText("DSM-5-TR", { x: 0.42, y: 1.18, w: 4.2, h: 0.35, fontSize: 13, bold: true, color: C.accent, fontFace: "Calibri", margin: 0 });
  sl.addShape(pres.ShapeType.line, { x: 0.42, y: 1.56, w: 4.25, h: 0, line: { color: C.accent, width: 0.5 } });
  sl.addText(bullet([
    "Bipolar I: ≥1 manic episode (duration ≥7 days or hospitalized)",
    "Bipolar II: ≥1 hypomanic + ≥1 MDE; no mania",
    "Cyclothymia: ≥2 years of fluctuating hypo/depressive symptoms",
    "Mixed features specifier: ≥3 symptoms of opposite polarity during episode",
    "Rapid cycling: ≥4 mood episodes per year",
    "Anxious distress specifier added in DSM-5",
    "Peripartum onset specifier",
    "Severity: mild / moderate / severe",
    "Mood-congruent vs. mood-incongruent psychotic features distinguished",
  ]), { x: 0.42, y: 1.62, w: 4.3, h: 3.6 });

  sl.addShape(pres.ShapeType.rect, { x: 5.2, y: 1.1, w: 4.5, h: 4.2, fill: { color: C.cardBg }, line: { color: C.accent2, width: 1.5 } });
  sl.addText("ICD-11", { x: 5.32, y: 1.18, w: 4.2, h: 0.35, fontSize: 13, bold: true, color: C.accent2, fontFace: "Calibri", margin: 0 });
  sl.addShape(pres.ShapeType.line, { x: 5.32, y: 1.56, w: 4.25, h: 0, line: { color: C.accent2, width: 0.5 } });
  sl.addText(bullet([
    "Bipolar Type I: equivalent to DSM-5 Bipolar I",
    "Bipolar Type II: equivalent to DSM-5 Bipolar II",
    "Cyclothymic disorder: similar criteria to DSM-5",
    "ICD-11 does not always require a prior MDE for Bipolar II",
    "Mixed episodes classified separately (elevated + depressed simultaneously)",
    "Bipolar disorder due to another medical condition or substance use specified",
    "Severity rating system integrated into ICD-11 coding",
    "Better harmonized with DSM-5 than prior ICD-10 was",
  ]), { x: 5.32, y: 1.62, w: 4.3, h: 3.6 });

  sl.addShape(pres.ShapeType.rect, { x: 0, y: 5.2, w: 10, h: 0.425, fill: { color: C.midBg } });
  sl.addText("Source: Kaplan & Sadock's Comprehensive Textbook of Psychiatry — Table 13.3–5 & 13.3–6", {
    x: 0.4, y: 5.25, w: 9, h: 0.3, fontSize: 9, color: C.lightGray, fontFace: "Calibri", italic: true,
  });
}

// ════════════════════════════════════════════════════════════════════
// SLIDE 9 — PHARMACOTHERAPY: ACUTE MANIA
// ════════════════════════════════════════════════════════════════════
{
  const sl = pres.addSlide();
  sl.background = { color: C.darkBg };
  hdr(sl, "PHARMACOTHERAPY — ACUTE MANIA", "First-, Second- and Third-Line Options");

  card(sl, 0.3, 1.1, 3.0, 4.2, "FIRST-LINE", [
    "Lithium (level 0.8–1.2 mEq/L)",
    "Valproate (serum level 85–125 μg/mL)",
    "Atypical antipsychotics (monotherapy):",
    " - Olanzapine, Risperidone, Quetiapine",
    " - Aripiprazole, Ziprasidone, Cariprazine",
    " - Paliperidone, Asenapine",
    "Lithium or Valproate + atypical antipsychotic (combination)",
  ], C.green);

  card(sl, 3.5, 1.1, 3.0, 4.2, "SECOND-LINE", [
    "Carbamazepine / Oxcarbazepine",
    "Haloperidol (FGA — effective but EPS risk)",
    "Lithium + Valproate combination",
    "Lithium or Valproate + haloperidol",
    "ECT — for refractory, severe, or catatonic mania",
    "Cariprazine (D2/D3 partial agonist, FDA-approved)",
  ], C.accent);

  card(sl, 6.7, 1.1, 3.0, 4.2, "IMPORTANT NOTES", [
    "Avoid antidepressants as monotherapy — risk of switching to mania",
    "Lamotrigine NOT effective for acute mania",
    "Gabapentin, Topiramate — no evidence in acute mania",
    "Benzodiazepines: useful adjuncts for agitation/insomnia",
    "Haloperidol: more effective in 'highly active' mania; higher EPS/depression risk",
    "Brexpiprazole not recommended (failed RCTs for mania)",
  ], C.red);

  sl.addShape(pres.ShapeType.rect, { x: 0, y: 5.2, w: 10, h: 0.425, fill: { color: C.midBg } });
  sl.addText("Source: Kaplan & Sadock's Comprehensive Textbook of Psychiatry, pp. 5165–5175", {
    x: 0.4, y: 5.25, w: 9, h: 0.3, fontSize: 9, color: C.lightGray, fontFace: "Calibri", italic: true,
  });
}

// ════════════════════════════════════════════════════════════════════
// SLIDE 10 — PHARMACOTHERAPY: BIPOLAR DEPRESSION & MAINTENANCE
// ════════════════════════════════════════════════════════════════════
{
  const sl = pres.addSlide();
  sl.background = { color: C.darkBg };
  hdr(sl, "PHARMACOTHERAPY — DEPRESSION & MAINTENANCE", "Bipolar Depression | Prophylaxis");

  card(sl, 0.3, 1.1, 4.5, 2.1, "BIPOLAR DEPRESSION — TREATMENT", [
    "Quetiapine (monotherapy) — FDA-approved for bipolar depression",
    "Lithium — modest antidepressant effects; prevents recurrence",
    "Lamotrigine — effective for bipolar depression maintenance; limited acute data",
    "Lurasidone — effective; FDA-approved for bipolar I depression",
    "Olanzapine-fluoxetine combination (OFC) — proven efficacy",
    "Avoid antidepressant monotherapy — risk of manic switch",
  ], C.accent2);

  card(sl, 5.2, 1.1, 4.5, 2.1, "MAINTENANCE / PROPHYLAXIS", [
    "Lithium — 'gold standard' for maintenance; reduces suicidality",
    "Valproate — widely used despite limited formal maintenance indication",
    "Lamotrigine — effective prophylaxis especially for depressive recurrences",
    "Atypical antipsychotics (quetiapine, aripiprazole, olanzapine)",
    "Combination of two mood stabilizers in refractory cases",
    "Valproate + lithium: BALANCE trial showed combination superior to valproate alone",
  ], C.green);

  // Additional treatment notes
  card(sl, 0.3, 3.35, 9.4, 1.95, "RAPID CYCLING & TREATMENT-RESISTANT BIPOLAR", [
    "Rapid cycling (≥4 episodes/year): more common in women; associated with hypothyroidism, antidepressant exposure",
    "Valproate monotherapy often insufficient — combination with lithium or atypical antipsychotic typically required",
    "Clozapine: evidence for refractory rapid-cycling and mixed states; requires white blood cell monitoring",
    "ECT: effective for treatment-resistant bipolar depression and mania",
    "Ketamine/Esketamine: emerging evidence for bipolar depression (NMDA antagonism); typically used as adjunct",
  ], C.red);

  sl.addShape(pres.ShapeType.rect, { x: 0, y: 5.2, w: 10, h: 0.425, fill: { color: C.midBg } });
  sl.addText("Source: Kaplan & Sadock's Comprehensive Textbook of Psychiatry, pp. 5175–5200", {
    x: 0.4, y: 5.25, w: 9, h: 0.3, fontSize: 9, color: C.lightGray, fontFace: "Calibri", italic: true,
  });
}

// ════════════════════════════════════════════════════════════════════
// SLIDE 11 — PSYCHOTHERAPY
// ════════════════════════════════════════════════════════════════════
{
  const sl = pres.addSlide();
  sl.background = { color: C.darkBg };
  hdr(sl, "PSYCHOTHERAPY & PSYCHOSOCIAL INTERVENTIONS", "Adjunctive to Pharmacotherapy");

  sl.addText("No psychotherapy monotherapy has proven effective for acute mania or mixed states. All evidence-based approaches are adjunctive to mood stabilizers.", {
    x: 0.4, y: 1.0, w: 9.2, h: 0.45,
    fontSize: 11.5, color: C.accent, fontFace: "Calibri", italic: true,
  });

  const therapies = [
    { title: "Group Psychoeducation", color: C.accent, lines: [
      "Developed by Colom et al. (Barcelona)",
      "Groups of 30–50 patients and families",
      "Focus: risk factors, warning signs, coping strategies",
      "Proven effect on treatment adherence and relapse prevention",
      "Cost-effective; comparable efficacy to mood stabilizers for prophylaxis",
    ]},
    { title: "Cognitive-Behavioral Therapy (CBT)", color: C.accent2, lines: [
      "Adapted specifically for bipolar disorder",
      "Focus: identifying triggers, monitoring mood, sleep hygiene",
      "Reduces relapse rates as adjunct to pharmacotherapy",
      "Internet-based CBT (iCBT) has emerging evidence",
    ]},
    { title: "Interpersonal & Social Rhythm Therapy (IPSRT)", color: C.green, lines: [
      "Targets disrupted social rhythms and sleep-wake cycles",
      "Especially useful for preventing depressive recurrences",
      "Addresses grief for lost healthy self, role transitions",
    ]},
    { title: "Family-Focused Therapy (FFT)", color: C.red, lines: [
      "Involves caregivers and family members",
      "Psychoeducation + communication skills + problem-solving",
      "Strong evidence for reducing relapse in Bipolar I & II",
    ]},
  ];

  therapies.forEach((t, i) => {
    const col = i % 2;
    const row = Math.floor(i / 2);
    const x = col === 0 ? 0.3 : 5.2;
    const y = 1.55 + row * 1.95;
    card(sl, x, y, 4.55, 1.8, t.title, t.lines, t.color);
  });

  sl.addShape(pres.ShapeType.rect, { x: 0, y: 5.2, w: 10, h: 0.425, fill: { color: C.midBg } });
  sl.addText("Source: Kaplan & Sadock's Comprehensive Textbook of Psychiatry, pp. 5221–5224", {
    x: 0.4, y: 5.25, w: 9, h: 0.3, fontSize: 9, color: C.lightGray, fontFace: "Calibri", italic: true,
  });
}

// ════════════════════════════════════════════════════════════════════
// SLIDE 12 — SPECIAL POPULATIONS & COMORBIDITY
// ════════════════════════════════════════════════════════════════════
{
  const sl = pres.addSlide();
  sl.background = { color: C.darkBg };
  hdr(sl, "SPECIAL POPULATIONS & COMORBIDITY", "Treatment Considerations");

  card(sl, 0.3, 1.1, 4.5, 2.0, "BIPOLAR DISORDER IN CHILDREN & ADOLESCENTS", [
    "Not as rare as previously thought; boys more commonly reported",
    "Typical presentation: dysphoric-explosive and rapid-cycling",
    "Childhood-onset depression: significant risk for bipolar transformation",
    "Risperidone superior to both lithium and valproate in pediatric mania (RCT)",
    "Valproate monotherapy often insufficient; combination often required",
  ], C.accent);

  card(sl, 5.2, 1.1, 4.5, 2.0, "BIPOLAR DISORDER IN WOMEN", [
    "More depressive and mixed episodes compared to men",
    "Postpartum period: high-risk phase (onset or relapse)",
    "Peripartum specifier: onset during pregnancy or within 4 weeks postpartum",
    "Valproate: teratogenic (neural tube defects) — avoid in pregnancy",
    "Lamotrigine: preferred mood stabilizer in pregnancy",
  ], C.accent2);

  card(sl, 0.3, 3.25, 4.5, 2.05, "PSYCHIATRIC COMORBIDITIES", [
    "Highly prevalent: ADHD, anxiety disorders, substance use disorders",
    "Bipolar II with panic attacks: may represent a distinct subtype",
    "Borderline personality disorder: overlapping features; careful differentiation needed",
    "Cyclothymic traits underlie atypical depression, borderline personality",
    "Comorbidities worsen prognosis and complicate management",
  ], C.green);

  card(sl, 5.2, 3.25, 4.5, 2.05, "MEDICAL COMORBIDITIES", [
    "Metabolic syndrome: elevated rates — monitor weight, lipids, glucose",
    "Cardiovascular disease: higher incidence than general population",
    "Thyroid disease: especially hypothyroidism — can precipitate rapid cycling",
    "Baseline labs required before initiating lithium, valproate, carbamazepine",
    "Weight and waist circumference monitoring throughout treatment",
  ], C.red);

  sl.addShape(pres.ShapeType.rect, { x: 0, y: 5.2, w: 10, h: 0.425, fill: { color: C.midBg } });
  sl.addText("Source: Kaplan & Sadock's Comprehensive Textbook of Psychiatry", {
    x: 0.4, y: 5.25, w: 9, h: 0.3, fontSize: 9, color: C.lightGray, fontFace: "Calibri", italic: true,
  });
}

// ════════════════════════════════════════════════════════════════════
// SLIDE 13 — PROGNOSIS & COURSE
// ════════════════════════════════════════════════════════════════════
{
  const sl = pres.addSlide();
  sl.background = { color: C.darkBg };
  hdr(sl, "PROGNOSIS & COURSE OF ILLNESS", "NIMH Collaborative Depression Study & Long-term Follow-up Data");

  // Timeline graphic using shapes
  sl.addText("Typical Course of Bipolar I Disorder", {
    x: 0.4, y: 1.05, w: 9.2, h: 0.35, fontSize: 12, bold: true, color: C.accent, fontFace: "Calibri", margin: 0,
  });
  sl.addShape(pres.ShapeType.line, { x: 0.4, y: 1.5, w: 9.2, h: 0, line: { color: C.lightGray, width: 1.5 } });

  const phases = [
    { label: "Prodrome", color: C.lightGray, x: 0.4 },
    { label: "First Episode\n(Mania/Dep)", color: C.accent, x: 2.35 },
    { label: "Interepisodic\nPeriod", color: C.accent2, x: 4.3 },
    { label: "Recurrences", color: C.red, x: 6.25 },
    { label: "Long-term\nOutcome", color: C.green, x: 8.2 },
  ];
  phases.forEach(p => {
    sl.addShape(pres.ShapeType.ellipse, { x: p.x, y: 1.3, w: 0.4, h: 0.4, fill: { color: p.color }, line: { color: p.color, width: 0 } });
    sl.addText(p.label, { x: p.x - 0.45, y: 1.75, w: 1.3, h: 0.6, fontSize: 9.5, color: p.color, fontFace: "Calibri", align: "center", margin: 0 });
  });

  card(sl, 0.3, 2.5, 4.5, 2.75, "PROGNOSTIC INDICATORS", [
    "Symptomatic ~50% of weeks over 12-year follow-up (NIMH study)",
    "Ratio of 3:1 — more time depressed than manic (Bipolar I)",
    "Bipolar II: 37x more days depressed than hypomanic on average",
    "Average 8–10 year delay to correct diagnosis",
    "Early intervention after first manic episode can reverse cognitive deficits",
    "Good prognostic factors: good premorbid functioning, early treatment, strong social support",
    "Poor prognostic factors: rapid cycling, psychotic features, substance comorbidity, poor adherence",
  ], C.accent2);

  card(sl, 5.2, 2.5, 4.5, 2.75, "SUICIDE & MORTALITY", [
    "25–50% of bipolar patients attempt suicide during illness",
    "Suicide rate 20–30x higher than general population",
    "Risk highest during mixed episodes and bipolar depression",
    "Lithium: strongest evidence for antisuicidal effects",
    "Life expectancy reduced by ~10–20 years (cardiovascular, metabolic causes)",
    "ECT: effective and potentially life-saving in acutely suicidal patients",
    "Regular suicide risk assessment is essential throughout care",
  ], C.red);

  sl.addShape(pres.ShapeType.rect, { x: 0, y: 5.2, w: 10, h: 0.425, fill: { color: C.midBg } });
  sl.addText("Source: Kaplan & Sadock's Comprehensive Textbook of Psychiatry — pp. 5057–5070", {
    x: 0.4, y: 5.25, w: 9, h: 0.3, fontSize: 9, color: C.lightGray, fontFace: "Calibri", italic: true,
  });
}

// ════════════════════════════════════════════════════════════════════
// SLIDE 14 — KEY TAKEAWAYS
// ════════════════════════════════════════════════════════════════════
{
  const sl = pres.addSlide();
  sl.background = { color: C.darkBg };
  hdr(sl, "KEY TAKEAWAYS", "Clinical Summary");

  const takeaways = [
    { num: "01", text: "Bipolar disorder is highly heritable (60–80%) and affects ~1–3% of the population; Bipolar I and II combined with spectrum disorders affect up to 2.4% worldwide.", color: C.accent },
    { num: "02", text: "Two-thirds of patients are initially misdiagnosed as having MDD — always screen for prior hypomanic/manic episodes in depressed patients.", color: C.red },
    { num: "03", text: "Lithium remains the gold standard for maintenance and has the strongest evidence for antisuicidal effects; valproate and atypical antipsychotics are key alternatives.", color: C.accent2 },
    { num: "04", text: "Avoid antidepressant monotherapy in bipolar disorder — risk of inducing mania, mixed states, or rapid cycling.", color: C.red },
    { num: "05", text: "Psychosocial interventions (psychoeducation, CBT, IPSRT, FFT) are effective adjuncts to pharmacotherapy and reduce relapse rates comparably to mood stabilizers.", color: C.green },
    { num: "06", text: "Regular monitoring for metabolic, cardiovascular, and thyroid comorbidities is essential; early intervention after the first manic episode can improve long-term cognitive outcomes.", color: C.accent },
  ];

  takeaways.forEach((t, i) => {
    const y = 1.1 + i * 0.72;
    sl.addShape(pres.ShapeType.rect, { x: 0.3, y, w: 9.4, h: 0.65, fill: { color: C.cardBg }, line: { color: t.color, width: 1.5 } });
    sl.addShape(pres.ShapeType.rect, { x: 0.3, y, w: 0.5, h: 0.65, fill: { color: t.color }, line: { color: t.color, width: 0 } });
    sl.addText(t.num, { x: 0.3, y, w: 0.5, h: 0.65, fontSize: 14, bold: true, color: C.darkBg, fontFace: "Calibri", align: "center", valign: "middle", margin: 0 });
    sl.addText(t.text, { x: 0.9, y: y + 0.06, w: 8.7, h: 0.55, fontSize: 11.5, color: C.offWhite, fontFace: "Calibri", valign: "middle", margin: 0 });
  });

  sl.addShape(pres.ShapeType.rect, { x: 0, y: 5.2, w: 10, h: 0.425, fill: { color: C.midBg } });
  sl.addText("Source: Kaplan & Sadock's Comprehensive Textbook of Psychiatry", {
    x: 0.4, y: 5.25, w: 9, h: 0.3, fontSize: 9, color: C.lightGray, fontFace: "Calibri", italic: true,
  });
}

// ════════════════════════════════════════════════════════════════════
// SLIDE 15 — THANK YOU
// ════════════════════════════════════════════════════════════════════
{
  const sl = pres.addSlide();
  sl.background = { color: C.darkBg };

  sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.18, h: 5.625, fill: { color: C.accent } });

  sl.addText("THANK YOU", {
    x: 0.5, y: 1.5, w: 9, h: 1.1,
    fontSize: 48, bold: true, color: C.white, fontFace: "Calibri", charSpacing: 5,
  });

  sl.addShape(pres.ShapeType.rect, { x: 0.5, y: 2.75, w: 5.5, h: 0.06, fill: { color: C.accent } });

  sl.addText("Bipolar Disorder — A Comprehensive Overview", {
    x: 0.5, y: 2.88, w: 9, h: 0.45,
    fontSize: 16, color: C.accent2, fontFace: "Calibri", italic: true,
  });

  sl.addText([
    { text: "Primary Source: ", options: { bold: true, color: C.accent, fontSize: 12 } },
    { text: "Kaplan & Sadock's Comprehensive Textbook of Psychiatry", options: { color: C.offWhite, fontSize: 12 } },
  ], { x: 0.5, y: 3.5, w: 9, h: 0.4, fontFace: "Calibri" });

  sl.addText([
    { text: "Classification: ", options: { bold: true, color: C.accent, fontSize: 12 } },
    { text: "DSM-5-TR  |  ICD-11", options: { color: C.offWhite, fontSize: 12 } },
  ], { x: 0.5, y: 3.95, w: 9, h: 0.4, fontFace: "Calibri" });

  sl.addShape(pres.ShapeType.rect, { x: 0, y: 5.2, w: 10, h: 0.425, fill: { color: C.midBg } });
  sl.addText("Psychiatry  |  Mood Disorders", {
    x: 0.4, y: 5.25, w: 9, h: 0.3, fontSize: 10, color: C.lightGray, fontFace: "Calibri", align: "right",
  });
}

// ── WRITE FILE ──────────────────────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/workspace/bipolar-ppt/Bipolar_Disorder_Kaplan_Sadock.pptx" })
  .then(() => console.log("PPT saved successfully!"))
  .catch(e => { console.error(e); process.exit(1); });
Running Command

cd /home/daytona/workspace/bipolar-ppt && node build.js 2>&1

Running Command

ls -lh /home/daytona/workspace/bipolar-ppt/

Running Command

python /home/daytona/skills/pptx/scripts/thumbnail.py /home/daytona/workspace/bipolar-ppt/Bipolar_Disorder_Kaplan_Sadock.pptx 2>&1 | head -20

Reading File
Reading File
Running Command

find /home/daytona/workspace/bipolar-ppt/ -name "*.jpg" 2>/dev/null; find /tmp -name "thumbnails*" 2>/dev/null | head -5

Your presentation is ready:

Bipolar Disorder Kaplan Sadock

Presentation · PPTX


What's Inside — 15 Slides

#Slide
1Title Slide — Bipolar Disorder: A Comprehensive Overview
2Presentation Outline — 10 topics previewed
3Introduction & Definition — History from Kraepelin to DSM-5-TR, heritability overview
4Epidemiology — WHO WMH data, NESARC figures, sex ratios, misdiagnosis rates
5Etiology & Pathophysiology — 3-column layout: genetics, neurobiology, environmental triggers
6Clinical Features: Mania — DIG FAST mnemonic, subtypes, clinical pearls
7Classification — Bipolar I, II, Cyclothymia, Other Specified (DSM-5-TR)
8Diagnosis — Side-by-side DSM-5-TR vs ICD-11 comparison
9Pharmacotherapy: Acute Mania — First-line, second-line, drugs to avoid
10Pharmacotherapy: Depression & Maintenance — Quetiapine, Lithium, Lamotrigine, Lurasidone; rapid cycling management
11Psychotherapy — Psychoeducation, CBT, IPSRT, FFT as adjuncts
12Special Populations & Comorbidity — Pediatric, women, psychiatric & medical comorbidities
13Prognosis & Course — NIMH data, suicide risk, mortality
14Key Takeaways — 6 clinical summary points
15Thank You — Source attribution
Design: Deep navy background with amber/teal accent colors, card-based layout, consistent source citations from Kaplan & Sadock throughout.
This is a shared conversation. Sign in to Orris to start your own chat.