I'm gonna make a presentation on Major depressive disord please make a PowerPoint based on this. Make a ppt

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

mkdir -p /tmp/workspace/mdd-ppt

Writing File

~/mdd-ppt/create_mdd_ppt.py

from pptx import Presentation
from pptx.util import Inches, Pt, Emu
from pptx.dml.color import RGBColor
from pptx.enum.text import PP_ALIGN, MSO_ANCHOR
from pptx.oxml.ns import qn
from lxml import etree
from io import BytesIO

# ── Color palette ─────────────────────────────────────────────────────────────
DARK_NAVY   = RGBColor(0x1A, 0x23, 0x44)   # deep navy bg
MID_BLUE    = RGBColor(0x2E, 0x4A, 0x8E)   # accent blue
ACCENT_TEAL = RGBColor(0x24, 0xA8, 0xA0)   # teal accent
WHITE       = RGBColor(0xFF, 0xFF, 0xFF)
LIGHT_GREY  = RGBColor(0xF0, 0xF4, 0xF8)
DARK_TEXT   = RGBColor(0x1A, 0x23, 0x44)
SOFT_WHITE  = RGBColor(0xE8, 0xEF, 0xF8)
GOLD        = RGBColor(0xF5, 0xC5, 0x18)

# ── Helper: solid fill ─────────────────────────────────────────────────────────
def solid_fill(shape, rgb: RGBColor):
    fill = shape.fill
    fill.solid()
    fill.fore_color.rgb = rgb

# ── Helper: add text box ────────────────────────────────────────────────────────
def add_text(slide, text, x, y, w, h, size, bold=False, color=WHITE,
             align=PP_ALIGN.LEFT, italic=False, wrap=True, font="Calibri"):
    tb = slide.shapes.add_textbox(Inches(x), Inches(y), Inches(w), Inches(h))
    tf = tb.text_frame
    tf.word_wrap = wrap
    tf.margin_left = 0
    tf.margin_right = 0
    tf.margin_top = 0
    tf.margin_bottom = 0
    p = tf.paragraphs[0]
    p.alignment = align
    run = p.add_run()
    run.text = text
    run.font.name = font
    run.font.size = Pt(size)
    run.font.bold = bold
    run.font.italic = italic
    run.font.color.rgb = color
    return tb

# ── Helper: add rectangle ──────────────────────────────────────────────────────
def add_rect(slide, x, y, w, h, rgb: RGBColor):
    shape = slide.shapes.add_shape(
        1,  # MSO_SHAPE_TYPE.RECTANGLE
        Inches(x), Inches(y), Inches(w), Inches(h)
    )
    solid_fill(shape, rgb)
    shape.line.fill.background()
    return shape

# ── Helper: multi-bullet block ─────────────────────────────────────────────────
def add_bullets(slide, items, x, y, w, h, size=14, color=WHITE, font="Calibri", bold_first=False):
    tb = slide.shapes.add_textbox(Inches(x), Inches(y), Inches(w), Inches(h))
    tf = tb.text_frame
    tf.word_wrap = True
    tf.margin_left = Pt(4)
    tf.margin_right = Pt(4)
    tf.margin_top = Pt(4)
    tf.margin_bottom = Pt(4)
    for i, item in enumerate(items):
        p = tf.add_paragraph() if i > 0 else tf.paragraphs[0]
        p.alignment = PP_ALIGN.LEFT
        run = p.add_run()
        run.text = item
        run.font.name = font
        run.font.size = Pt(size)
        run.font.color.rgb = color
        run.font.bold = (bold_first and i == 0)
        p.space_after = Pt(4)
    return tb


prs = Presentation()
prs.slide_width = Inches(13.333)
prs.slide_height = Inches(7.5)
blank = prs.slide_layouts[6]

# ══════════════════════════════════════════════════════════════════════════════
# SLIDE 1 – Title
# ══════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
solid_fill(s.background, DARK_NAVY)

# Big teal bar on left
add_rect(s, 0, 0, 0.6, 7.5, ACCENT_TEAL)

# Gold decorative bar
add_rect(s, 0.6, 2.8, 8.5, 0.08, GOLD)

add_text(s, "MAJOR DEPRESSIVE", 1.0, 1.5, 11, 1.4, 56, bold=True,
         color=WHITE, align=PP_ALIGN.LEFT)
add_text(s, "DISORDER", 1.0, 2.85, 11, 1.2, 56, bold=True,
         color=ACCENT_TEAL, align=PP_ALIGN.LEFT)
add_text(s, "A Comprehensive Clinical Overview", 1.0, 4.2, 10, 0.7, 20,
         color=SOFT_WHITE, align=PP_ALIGN.LEFT, italic=True)
add_text(s, "Epidemiology · Diagnosis · Pathophysiology · Treatment",
         1.0, 5.0, 11, 0.6, 14, color=RGBColor(0xA0,0xB8,0xD8),
         align=PP_ALIGN.LEFT)
add_text(s, "Sources: Kaplan & Sadock's Psychiatry · Goldman-Cecil Medicine",
         1.0, 6.6, 11, 0.5, 11, color=RGBColor(0x70,0x88,0xA8),
         align=PP_ALIGN.LEFT, italic=True)


# ══════════════════════════════════════════════════════════════════════════════
# SLIDE 2 – What Is MDD?
# ══════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
solid_fill(s.background, DARK_NAVY)
add_rect(s, 0, 0, 13.333, 1.3, MID_BLUE)
add_rect(s, 0, 0, 0.6, 7.5, ACCENT_TEAL)
add_text(s, "WHAT IS MAJOR DEPRESSIVE DISORDER?", 0.8, 0.2, 12, 0.9,
         26, bold=True, color=WHITE)

bullets_left = [
    "● Characterized by one or more episodes of major depressive syndrome",
    "● Significant depressive symptoms lasting ≥ 2 consecutive weeks",
    "● Distinct from dysthymia, cyclothymia, grief, and bipolar disorder",
    "● Affects emotions, cognition, and somatic/neurovegetative functioning",
    "● Patients may present WITHOUT depressed mood if anhedonia is present",
]
add_bullets(s, bullets_left, 0.9, 1.5, 6.0, 4.5, size=15, color=SOFT_WHITE)

# Right card
add_rect(s, 7.2, 1.4, 5.5, 4.8, MID_BLUE)
add_text(s, "Key Facts", 7.5, 1.55, 5.0, 0.5, 15, bold=True, color=GOLD)
facts = [
    "12-month prevalence: ~7% in the US",
    "1.5× more common in females",
    "Lifetime risk: 20–25% (women), 10% (men)",
    "Annual new episodes: ~3%",
    "#1 cause of disability in midlife",
    "Annual US economic cost: >$53 billion",
    "Genetic contribution: ~40% of risk",
]
add_bullets(s, facts, 7.5, 2.15, 5.0, 3.8, size=13, color=LIGHT_GREY)

add_text(s, "Goldman-Cecil Medicine, 26e", 0.8, 6.9, 12, 0.4, 10,
         color=RGBColor(0x60,0x78,0x98), italic=True)


# ══════════════════════════════════════════════════════════════════════════════
# SLIDE 3 – DSM-5 Diagnostic Criteria (SIG E CAPS)
# ══════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
solid_fill(s.background, DARK_NAVY)
add_rect(s, 0, 0, 13.333, 1.3, MID_BLUE)
add_rect(s, 0, 0, 0.6, 7.5, ACCENT_TEAL)
add_text(s, "DSM-5 DIAGNOSTIC CRITERIA", 0.8, 0.2, 12, 0.9,
         26, bold=True, color=WHITE)

# Minimum 5 symptoms label
add_rect(s, 0.8, 1.4, 5.8, 0.5, ACCENT_TEAL)
add_text(s, "≥ 5 symptoms for ≥ 2 weeks (must include ① or ②)",
         0.9, 1.45, 5.6, 0.4, 13, bold=True, color=WHITE)

core = [
    "①  Depressed mood most of the day, nearly every day",
    "②  Markedly diminished interest or pleasure (anhedonia)",
    "③  Change in weight or appetite",
    "④  Change in sleep (insomnia or hypersomnia)",
    "⑤  Psychomotor agitation or retardation",
    "⑥  Fatigue or loss of energy",
    "⑦  Feelings of worthlessness or excessive guilt",
    "⑧  Diminished concentration or indecisiveness",
    "⑨  Recurrent thoughts of death / suicidal ideation",
]
add_bullets(s, core, 0.9, 2.0, 5.8, 4.8, size=13, color=SOFT_WHITE)

# SIG E CAPS box
add_rect(s, 7.2, 1.4, 5.5, 5.6, MID_BLUE)
add_text(s, "Mnemonic: SIG E CAPS", 7.45, 1.5, 5.1, 0.5, 15,
         bold=True, color=GOLD)
add_text(s, '(Prescribe "Energy Capsules" + depressed mood)',
         7.45, 2.0, 5.1, 0.45, 11, color=RGBColor(0xB0,0xC8,0xE8), italic=True)
caps = [
    "S  –  Sleep change",
    "I   –  Interests decreased (anhedonia)",
    "G  –  Guilt / worthlessness",
    "E  –  Energy decreased",
    "C  –  Concentration decreased",
    "A  –  Appetite / weight change",
    "P  –  Psychomotor changes",
    "S  –  Suicidal ideation",
]
add_bullets(s, caps, 7.45, 2.5, 5.1, 4.0, size=14, color=SOFT_WHITE)

add_text(s, "Goldman-Cecil Medicine, 26e · DSM-5-TR", 0.8, 6.9, 12, 0.4, 10,
         color=RGBColor(0x60,0x78,0x98), italic=True)


# ══════════════════════════════════════════════════════════════════════════════
# SLIDE 4 – Symptom Clusters
# ══════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
solid_fill(s.background, DARK_NAVY)
add_rect(s, 0, 0, 13.333, 1.3, MID_BLUE)
add_rect(s, 0, 0, 0.6, 7.5, ACCENT_TEAL)
add_text(s, "SYMPTOM CLUSTERS", 0.8, 0.2, 12, 0.9, 26, bold=True, color=WHITE)

# 3 columns
cols = [
    ("Emotional", RGBColor(0x3A,0x7D,0xD4), [
        "Depressed mood / sadness",
        "Tearfulness",
        "Irritability",
        "Anxiety",
        "Anhedonia",
        "Emotional blunting",
    ]),
    ("Ideational / Cognitive", RGBColor(0x5A,0x4A,0xA8), [
        "Worthlessness / low self-esteem",
        "Guilt",
        "Hopelessness / nihilism",
        "Helplessness",
        "Poor concentration",
        "Thoughts of death / suicide",
    ]),
    ("Somatic / Neurovegetative", RGBColor(0x1C,0x8C,0x80), [
        "Appetite & weight changes",
        "Sleep disturbance",
        "Anergia / fatigue",
        "Decreased libido",
        "Psychomotor changes",
        "Diurnal variation (worse AM)",
    ]),
]
for i, (title, col, items) in enumerate(cols):
    x = 0.9 + i * 4.1
    add_rect(s, x, 1.4, 3.9, 0.55, col)
    add_text(s, title, x+0.1, 1.47, 3.7, 0.45, 14, bold=True, color=WHITE)
    add_rect(s, x, 1.95, 3.9, 4.5, RGBColor(0x22,0x2F,0x55))
    add_bullets(s, ["  • " + it for it in items], x+0.1, 2.05, 3.7, 4.2,
                size=13, color=SOFT_WHITE)

add_text(s, "Goldman-Cecil Medicine, 26e", 0.8, 6.9, 12, 0.4, 10,
         color=RGBColor(0x60,0x78,0x98), italic=True)


# ══════════════════════════════════════════════════════════════════════════════
# SLIDE 5 – Pathophysiology
# ══════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
solid_fill(s.background, DARK_NAVY)
add_rect(s, 0, 0, 13.333, 1.3, MID_BLUE)
add_rect(s, 0, 0, 0.6, 7.5, ACCENT_TEAL)
add_text(s, "PATHOPHYSIOLOGY", 0.8, 0.2, 12, 0.9, 26, bold=True, color=WHITE)

# Two panels
panels = [
    ("Neurobiological Mechanisms", RGBColor(0x1C,0x44,0x80), [
        "• Noradrenergic & serotonergic dysregulation underlie antidepressant efficacy",
        "• HPA axis hyperactivity – nonsuppressed dexamethasone suppression test",
        "• Reduced hippocampal volume (chronic elevated cortisol)",
        "• Altered cerebral metabolism – frontal-striatal circuits & anterior cingulate cortex",
        "• Neuroinflammatory markers elevated in some subtypes",
    ]),
    ("Psychosocial & Genetic Factors", RGBColor(0x1C,0x5C,0x70), [
        "• Genetic heritability ~40%; polygenic, multiple loci involved",
        "• Dysfunctional cognitive schemas: negative views of self, world, future",
        "• Cognitive distortions are both risk markers and episode manifestations",
        "• Exit life events (death, separation, loss) are powerful precipitants",
        "• Poor quality/quantity of social relationships amplifies risk",
    ]),
]
for i, (title, col, items) in enumerate(panels):
    y = 1.45 + i * 2.75
    add_rect(s, 0.8, y, 12.0, 0.5, col)
    add_text(s, title, 0.95, y+0.07, 11.5, 0.4, 15, bold=True, color=WHITE)
    add_rect(s, 0.8, y+0.5, 12.0, 2.0, RGBColor(0x1E,0x2C,0x50))
    add_bullets(s, items, 1.0, y+0.55, 11.6, 1.9, size=13, color=SOFT_WHITE)

add_text(s, "Goldman-Cecil Medicine, 26e · Kaplan & Sadock's Synopsis", 0.8, 6.9, 12, 0.4, 10,
         color=RGBColor(0x60,0x78,0x98), italic=True)


# ══════════════════════════════════════════════════════════════════════════════
# SLIDE 6 – Subtypes & Specifiers
# ══════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
solid_fill(s.background, DARK_NAVY)
add_rect(s, 0, 0, 13.333, 1.3, MID_BLUE)
add_rect(s, 0, 0, 0.6, 7.5, ACCENT_TEAL)
add_text(s, "SUBTYPES & SPECIFIERS", 0.8, 0.2, 12, 0.9, 26, bold=True, color=WHITE)

cards = [
    ("With Psychotic Features", RGBColor(0x6A,0x2C,0x90),
     "Mood-congruent (most common) or mood-incongruent delusions/hallucinations. Poor prognostic indicator."),
    ("With Melancholic Features", RGBColor(0x2A,0x5C,0xA8),
     "Severe anhedonia, early AM awakening, weight loss, profound guilt, nonreactive mood. 'Endogenous depression.'"),
    ("With Atypical Features", RGBColor(0x1C,0x7C,0x68),
     "Mood reactivity, hypersomnia, leaden paralysis, hyperphagia, rejection sensitivity."),
    ("Postpartum Onset", RGBColor(0xA8,0x3C,0x5C),
     "6–13% prevalence postpartum. Accounts for part of the female excess in depression rates."),
    ("Seasonal Pattern", RGBColor(0x3C,0x5C,0xA8),
     "Regular temporal relation between episodes and time of year (typically autumn/winter onset)."),
    ("With Anxious Distress", RGBColor(0x5A,0x4C,0x28),
     "Feeling keyed up, tense, or unusually restless; fear of losing control. Common comorbid pattern."),
]
for i, (title, col, desc) in enumerate(cards):
    row = i // 3
    col_i = i % 3
    x = 0.85 + col_i * 4.1
    y = 1.5 + row * 2.7
    add_rect(s, x, y, 3.9, 0.5, col)
    add_text(s, title, x+0.1, y+0.06, 3.7, 0.42, 13, bold=True, color=WHITE)
    add_rect(s, x, y+0.5, 3.9, 1.9, RGBColor(0x1E,0x2C,0x50))
    add_text(s, desc, x+0.15, y+0.6, 3.6, 1.7, 12, color=SOFT_WHITE, wrap=True)

add_text(s, "Kaplan & Sadock's Synopsis of Psychiatry", 0.8, 6.9, 12, 0.4, 10,
         color=RGBColor(0x60,0x78,0x98), italic=True)


# ══════════════════════════════════════════════════════════════════════════════
# SLIDE 7 – MDD Across the Lifespan
# ══════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
solid_fill(s.background, DARK_NAVY)
add_rect(s, 0, 0, 13.333, 1.3, MID_BLUE)
add_rect(s, 0, 0, 0.6, 7.5, ACCENT_TEAL)
add_text(s, "MDD ACROSS THE LIFESPAN", 0.8, 0.2, 12, 0.9, 26, bold=True, color=WHITE)

life_data = [
    ("Children", RGBColor(0x2A,0x8C,0x60), [
        "Somatic complaints & psychomotor agitation predominate",
        "Anhedonia frequent; mood-congruent hallucinations possible",
        "May present as irritability/anger rather than sadness",
        "Learning impairment: concentration, motivation, fatigue",
        "Often onset is insidious after years of anxiety symptoms",
    ]),
    ("Adolescents", RGBColor(0x3A,0x5A,0xA8), [
        "Negativistic or antisocial behavior",
        "Alcohol & substance use as complications",
        "Withdrawal from social activities and peers",
        "School difficulties and neglect of personal appearance",
        "Sensitivity to rejection in romantic relationships",
    ]),
    ("Adults", RGBColor(0x5A,0x2A,0x88), [
        "Classic presentation with full DSM-5 criteria",
        "Sleep and appetite problems more prominent than in youth",
        "First episode before age 40 in ~50% of patients",
        "Untreated episode: 6–13 months; treated: ~3 months",
        "Recurrence rate: 50–75% within 5 years",
    ]),
]
for i, (grp, col, items) in enumerate(life_data):
    x = 0.85 + i * 4.15
    add_rect(s, x, 1.45, 3.95, 0.55, col)
    add_text(s, grp, x+0.15, 1.52, 3.7, 0.45, 15, bold=True, color=WHITE)
    add_rect(s, x, 2.0, 3.95, 4.3, RGBColor(0x1E,0x2C,0x50))
    add_bullets(s, ["• " + it for it in items], x+0.15, 2.1, 3.7, 4.1,
                size=12.5, color=SOFT_WHITE)

add_text(s, "Kaplan & Sadock's Synopsis of Psychiatry", 0.8, 6.9, 12, 0.4, 10,
         color=RGBColor(0x60,0x78,0x98), italic=True)


# ══════════════════════════════════════════════════════════════════════════════
# SLIDE 8 – Diagnosis & Screening
# ══════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
solid_fill(s.background, DARK_NAVY)
add_rect(s, 0, 0, 13.333, 1.3, MID_BLUE)
add_rect(s, 0, 0, 0.6, 7.5, ACCENT_TEAL)
add_text(s, "DIAGNOSIS & DIFFERENTIAL", 0.8, 0.2, 12, 0.9, 26, bold=True, color=WHITE)

# Left: Diagnosis approach
add_rect(s, 0.8, 1.45, 5.8, 0.5, ACCENT_TEAL)
add_text(s, "Clinical Diagnosis", 0.95, 1.52, 5.5, 0.4, 14, bold=True, color=WHITE)
diag = [
    "• History + mental status examination",
    "• PHQ-2 screening: 'Little interest?' and 'Feeling down?'",
    "  Score ≥ 3 → 75% probability of depressive disorder",
    "• PHQ-9 for severity grading (mild/moderate/severe)",
    "• Rule out medical causes: hypothyroidism, anemia, medications",
    "• Screen for manic episodes to exclude bipolar disorder",
    "• Exclude delirium, dementia, schizoaffective disorder",
]
add_rect(s, 0.8, 1.95, 5.8, 4.6, RGBColor(0x1E,0x2C,0x50))
add_bullets(s, diag, 0.95, 2.05, 5.5, 4.3, size=13, color=SOFT_WHITE)

# Right: Differential
add_rect(s, 7.1, 1.45, 5.7, 0.5, MID_BLUE)
add_text(s, "Differential Diagnosis", 7.25, 1.52, 5.4, 0.4, 14, bold=True, color=WHITE)
diffs = [
    "Bipolar Disorder – history of manic/hypomanic episodes",
    "Schizoaffective Disorder – psychosis outside mood episode",
    "Dysthymia (PDD) – chronic low-grade depression ≥ 2 yrs",
    "Adjustment Disorder – stressor-linked, milder symptoms",
    "Grief/Bereavement – time-limited, normal response",
    "Medical: hypothyroidism, Parkinson's, stroke, medications",
    "Substance-induced mood disorder",
]
add_rect(s, 7.1, 1.95, 5.7, 4.6, RGBColor(0x1E,0x2C,0x50))
add_bullets(s, ["• " + d for d in diffs], 7.25, 2.05, 5.4, 4.3, size=13, color=SOFT_WHITE)

add_text(s, "Goldman-Cecil Medicine, 26e", 0.8, 6.9, 12, 0.4, 10,
         color=RGBColor(0x60,0x78,0x98), italic=True)


# ══════════════════════════════════════════════════════════════════════════════
# SLIDE 9 – Treatment Overview
# ══════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
solid_fill(s.background, DARK_NAVY)
add_rect(s, 0, 0, 13.333, 1.3, MID_BLUE)
add_rect(s, 0, 0, 0.6, 7.5, ACCENT_TEAL)
add_text(s, "TREATMENT OVERVIEW", 0.8, 0.2, 12, 0.9, 26, bold=True, color=WHITE)

# 3 phase band
phases = [
    ("ACUTE", RGBColor(0x1C,0x6C,0xA8), "Resolve the depressive episode\n(weeks to months)"),
    ("CONTINUATION", RGBColor(0x1A,0x88,0x80), "Prevent relapse\n(6–12 months after remission)"),
    ("MAINTENANCE", RGBColor(0x6A,0x3A,0x9A), "Prevent recurrence\n(indefinite; ≥ 2–3 prior episodes)"),
]
for i, (ph, col, desc) in enumerate(phases):
    x = 0.85 + i * 4.05
    add_rect(s, x, 1.45, 3.8, 0.6, col)
    add_text(s, ph, x+0.1, 1.5, 3.6, 0.55, 16, bold=True, color=WHITE, align=PP_ALIGN.CENTER)
    add_rect(s, x, 2.05, 3.8, 0.9, RGBColor(0x20,0x30,0x58))
    add_text(s, desc, x+0.1, 2.1, 3.6, 0.8, 12, color=LIGHT_GREY, wrap=True)

# Pharmacotherapy
add_rect(s, 0.8, 3.1, 5.8, 0.5, RGBColor(0x24,0x5C,0x90))
add_text(s, "Pharmacotherapy", 0.95, 3.17, 5.5, 0.4, 14, bold=True, color=WHITE)
meds = [
    "• SSRIs (fluoxetine, sertraline, escitalopram) – first-line",
    "• SNRIs (venlafaxine, duloxetine) – especially with pain",
    "• Bupropion – activating; useful when fatigue is prominent",
    "• TCAs – effective but less tolerated; second-line",
    "• MAOIs – refractory cases; dietary restrictions required",
    "• Atypical adjuncts: aripiprazole, quetiapine, mirtazapine",
]
add_rect(s, 0.8, 3.6, 5.8, 3.0, RGBColor(0x1A,0x28,0x48))
add_bullets(s, meds, 0.95, 3.7, 5.5, 2.7, size=12.5, color=SOFT_WHITE)

# Psychotherapy
add_rect(s, 7.1, 3.1, 5.7, 0.5, RGBColor(0x1C,0x70,0x68))
add_text(s, "Psychotherapy", 7.25, 3.17, 5.4, 0.4, 14, bold=True, color=WHITE)
psych = [
    "• Cognitive Behavioral Therapy (CBT) – first-line evidence",
    "• Interpersonal Therapy (IPT) – particularly postpartum",
    "• Behavioral Activation – graded activity scheduling",
    "• Psychodynamic Therapy – for personality-linked depression",
    "• Combination (meds + therapy) superior for moderate-severe",
    "• Family therapy as adjunct for support and education",
]
add_rect(s, 7.1, 3.6, 5.7, 3.0, RGBColor(0x1A,0x28,0x48))
add_bullets(s, psych, 7.25, 3.7, 5.4, 2.7, size=12.5, color=SOFT_WHITE)

add_text(s, "Goldman-Cecil Medicine, 26e · Kaplan & Sadock's Synopsis", 0.8, 6.95, 12, 0.4, 10,
         color=RGBColor(0x60,0x78,0x98), italic=True)


# ══════════════════════════════════════════════════════════════════════════════
# SLIDE 10 – Prognosis & Course
# ══════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
solid_fill(s.background, DARK_NAVY)
add_rect(s, 0, 0, 13.333, 1.3, MID_BLUE)
add_rect(s, 0, 0, 0.6, 7.5, ACCENT_TEAL)
add_text(s, "PROGNOSIS & COURSE", 0.8, 0.2, 12, 0.9, 26, bold=True, color=WHITE)

# Timeline visual
add_rect(s, 0.8, 1.5, 11.8, 0.08, GOLD)
for xpos, label in [(0.8,"Episode"), (3.0,"Remission"), (6.0,"Recurrence\n~25% @ 6m"), (9.5,"Long-term\nMaintenance")]:
    add_rect(s, xpos, 1.35, 0.15, 0.38, GOLD)
    add_text(s, label, xpos-0.3, 1.0, 1.5, 0.45, 10.5, color=ACCENT_TEAL, align=PP_ALIGN.CENTER)

# Prognosis stats
add_rect(s, 0.8, 2.1, 5.8, 4.4, RGBColor(0x1E,0x2C,0x50))
add_rect(s, 0.8, 2.1, 5.8, 0.5, RGBColor(0x2A,0x60,0x9A))
add_text(s, "Key Prognostic Statistics", 0.95, 2.17, 5.5, 0.4, 14, bold=True, color=WHITE)
stats = [
    "• ~50% recover within 1 year after first hospitalization",
    "• 25% relapse within 6 months of discharge",
    "• 30–50% relapse within the following 2 years",
    "• 50–75% relapse within 5 years",
    "• Mean: 5–6 episodes over 20 years",
    "• Untreated episode: 6–13 months",
    "• Treated episode: ~3 months",
    "• Early childhood onset → more severe, chronic course",
]
add_bullets(s, stats, 0.95, 2.7, 5.5, 3.6, size=13, color=SOFT_WHITE)

# Predictors
add_rect(s, 7.1, 2.1, 5.7, 4.4, RGBColor(0x1E,0x2C,0x50))
add_rect(s, 7.1, 2.1, 5.7, 0.5, RGBColor(0x6A,0x2C,0x80))
add_text(s, "Prognostic Factors", 7.25, 2.17, 5.4, 0.4, 14, bold=True, color=WHITE)
prog_good = [
    "Good Prognosis:",
    "  ✓ Mild episode, short duration",
    "  ✓ Absence of psychotic features",
    "  ✓ Good premorbid functioning",
    "  ✓ Strong social support",
    "",
    "Poor Prognosis:",
    "  ✗ Psychotic features",
    "  ✗ Early onset, multiple recurrences",
    "  ✗ Comorbid substance use / anxiety",
    "  ✗ Residual dysthymia between episodes",
]
add_bullets(s, prog_good, 7.25, 2.7, 5.4, 3.6, size=12.5, color=SOFT_WHITE, bold_first=True)

add_text(s, "Kaplan & Sadock's Synopsis of Psychiatry", 0.8, 6.9, 12, 0.4, 10,
         color=RGBColor(0x60,0x78,0x98), italic=True)


# ══════════════════════════════════════════════════════════════════════════════
# SLIDE 11 – Summary / Key Takeaways
# ══════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
solid_fill(s.background, DARK_NAVY)
add_rect(s, 0, 0, 0.6, 7.5, ACCENT_TEAL)
add_rect(s, 0, 0, 13.333, 1.3, MID_BLUE)
add_text(s, "KEY TAKEAWAYS", 0.8, 0.2, 12, 0.9, 26, bold=True, color=WHITE)

takeaways = [
    ("01", "Diagnosis is CLINICAL", "≥5 DSM-5 criteria for ≥2 weeks; must include depressed mood or anhedonia. Use SIG E CAPS."),
    ("02", "Heterogeneous Condition", "Multiple subtypes (melancholic, psychotic, atypical) with distinct features and treatment implications."),
    ("03", "Multifactorial Biology", "Serotonergic/noradrenergic dysregulation, HPA hyperactivity, hippocampal loss, cognitive distortions."),
    ("04", "Highly Treatable", "SSRIs + CBT are first-line. Combination is superior for moderate-severe. Three treatment phases."),
    ("05", "Chronic & Recurrent", "50–75% relapse within 5 years. Maintenance treatment reduces frequency and severity."),
    ("06", "Global Burden", ">7% annual prevalence. #1 cause of midlife disability. Annual US cost exceeds $53 billion."),
]
for i, (num, heading, body) in enumerate(takeaways):
    row = i // 3
    ci = i % 3
    x = 0.85 + ci * 4.15
    y = 1.5 + row * 2.65
    add_rect(s, x, y, 3.9, 2.35, RGBColor(0x1E,0x2C,0x50))
    add_rect(s, x, y, 0.65, 2.35, ACCENT_TEAL)
    add_text(s, num, x+0.04, y+0.75, 0.58, 0.7, 22, bold=True, color=WHITE, align=PP_ALIGN.CENTER)
    add_text(s, heading, x+0.75, y+0.12, 3.05, 0.5, 13, bold=True, color=GOLD)
    add_text(s, body, x+0.75, y+0.65, 3.05, 1.5, 11.5, color=SOFT_WHITE, wrap=True)

add_text(s, "Sources: Kaplan & Sadock's Synopsis of Psychiatry · Goldman-Cecil Medicine, 26e · DSM-5-TR",
         0.8, 7.05, 12, 0.35, 10, color=RGBColor(0x60,0x78,0x98), italic=True)


# ── Save ───────────────────────────────────────────────────────────────────────
out = "/tmp/workspace/mdd-ppt/Major_Depressive_Disorder.pptx"
buf = BytesIO()
prs.save(buf)
with open(out, "wb") as f:
    f.write(buf.getvalue())

print(f"Saved: {out}")
print(f"Slides: {len(prs.slides)}")
Running Command

cd /tmp/workspace/mdd-ppt && python create_mdd_ppt.py

Your presentation is ready! Here is your download link:

Major Depressive Disorder

Presentation · PPTX


The deck contains 11 slides in a professional dark navy/teal color theme, built from content in Kaplan & Sadock's Synopsis of Psychiatry and Goldman-Cecil Medicine (26e):
#Slide Title
1Title slide
2What Is MDD? (definition + epidemiology key facts)
3DSM-5 Diagnostic Criteria + SIG E CAPS mnemonic
4Symptom Clusters (Emotional / Cognitive / Somatic)
5Pathophysiology (neurobiological + psychosocial/genetic)
6Subtypes & Specifiers (psychotic, melancholic, atypical, postpartum, seasonal)
7MDD Across the Lifespan (children, adolescents, adults)
8Diagnosis & Differential Diagnosis
9Treatment Overview (3 phases, pharmacotherapy, psychotherapy)
10Prognosis & Course (stats + good/poor prognostic factors)
11Key Takeaways (6-card summary)
This is a shared conversation. Sign in to Orris to start your own chat.