Create ppt on major depressive disorder with according to dsm 5 TR and synopsis

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

mkdir -p /tmp/workspace/mdd-ppt && ls /tmp/workspace/

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.util import Inches, Pt
from io import BytesIO

prs = Presentation()
prs.slide_width = Inches(13.333)
prs.slide_height = Inches(7.5)

# ── COLOUR PALETTE ─────────────────────────────────────────────────────────
DARK_BLUE   = RGBColor(0x1A, 0x3A, 0x5C)   # deep navy
MID_BLUE    = RGBColor(0x25, 0x5E, 0x9C)   # medium blue
ACCENT_BLUE = RGBColor(0x3A, 0x86, 0xC8)   # bright accent
LIGHT_BLUE  = RGBColor(0xD8, 0xEA, 0xF7)   # pale bg panels
WHITE       = RGBColor(0xFF, 0xFF, 0xFF)
LIGHT_GRAY  = RGBColor(0xF4, 0xF6, 0xF9)
DARK_TEXT   = RGBColor(0x1C, 0x1C, 0x2E)
GOLD        = RGBColor(0xF5, 0xA6, 0x23)
RED_ALERT   = RGBColor(0xC0, 0x39, 0x2B)
GREEN       = RGBColor(0x27, 0xAE, 0x60)
ORANGE      = RGBColor(0xE6, 0x7E, 0x22)

blank_layout = prs.slide_layouts[6]

# ── HELPERS ─────────────────────────────────────────────────────────────────
def add_rect(slide, x, y, w, h, fill_color=None, line_color=None, line_width=None):
    shape = slide.shapes.add_shape(1, Inches(x), Inches(y), Inches(w), Inches(h))
    if fill_color:
        shape.fill.solid()
        shape.fill.fore_color.rgb = fill_color
    else:
        shape.fill.background()
    if line_color:
        shape.line.color.rgb = line_color
        if line_width:
            shape.line.width = Pt(line_width)
    else:
        shape.line.fill.background()
    return shape

def add_text(slide, text, x, y, w, h, font_size=18, bold=False, color=DARK_TEXT,
             align=PP_ALIGN.LEFT, italic=False, v_anchor=MSO_ANCHOR.TOP, font_name="Calibri"):
    tb = slide.shapes.add_textbox(Inches(x), Inches(y), Inches(w), Inches(h))
    tf = tb.text_frame
    tf.word_wrap = True
    tf.vertical_anchor = v_anchor
    tf.margin_left = Pt(4)
    tf.margin_right = Pt(4)
    tf.margin_top = Pt(2)
    tf.margin_bottom = Pt(2)
    p = tf.paragraphs[0]
    p.alignment = align
    run = p.add_run()
    run.text = text
    run.font.name = font_name
    run.font.size = Pt(font_size)
    run.font.bold = bold
    run.font.italic = italic
    run.font.color.rgb = color
    return tf

def add_bullet_text(slide, lines, x, y, w, h, font_size=15, bold_first=False,
                    color=DARK_TEXT, line_spacing=1.15, font_name="Calibri",
                    bullet_char="•", first_bold=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(2)
    tf.margin_bottom = Pt(2)
    for i, line in enumerate(lines):
        if i == 0:
            p = tf.paragraphs[0]
        else:
            p = tf.add_paragraph()
        from pptx.util import Pt as _Pt
        p.space_after = _Pt(3)
        run = p.add_run()
        if isinstance(line, tuple):
            prefix, rest = line
            run.text = f"{bullet_char} {prefix}"
            run.font.bold = True
            run.font.color.rgb = MID_BLUE
            run.font.name = font_name
            run.font.size = Pt(font_size)
            run2 = p.add_run()
            run2.text = rest
            run2.font.bold = False
            run2.font.color.rgb = color
            run2.font.name = font_name
            run2.font.size = Pt(font_size)
        else:
            run.text = f"{bullet_char} {line}"
            run.font.name = font_name
            run.font.size = Pt(font_size)
            run.font.color.rgb = color
            run.font.bold = (i == 0 and first_bold)
    return tf

def add_accent_bar(slide, x, y, w=0.08, h=0.55, color=GOLD):
    add_rect(slide, x, y, w, h, fill_color=color)

def slide_header(slide, title_text, subtitle_text=None):
    # top bar
    add_rect(slide, 0, 0, 13.333, 1.15, fill_color=DARK_BLUE)
    # accent line
    add_rect(slide, 0, 1.15, 13.333, 0.05, fill_color=GOLD)
    add_text(slide, title_text, 0.4, 0.1, 12.5, 0.75,
             font_size=28, bold=True, color=WHITE, align=PP_ALIGN.LEFT,
             v_anchor=MSO_ANCHOR.MIDDLE, font_name="Calibri")
    if subtitle_text:
        add_text(slide, subtitle_text, 0.4, 0.75, 12.5, 0.38,
                 font_size=14, bold=False, color=ACCENT_BLUE, align=PP_ALIGN.LEFT,
                 v_anchor=MSO_ANCHOR.TOP, font_name="Calibri")

# ════════════════════════════════════════════════════════════════════════════
# SLIDE 1 – TITLE
# ════════════════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank_layout)
add_rect(slide, 0, 0, 13.333, 7.5, fill_color=DARK_BLUE)
add_rect(slide, 0, 0, 13.333, 7.5, fill_color=RGBColor(0x1A, 0x3A, 0x5C))
# decorative diagonal accent
add_rect(slide, 0, 5.2, 13.333, 0.08, fill_color=GOLD)
add_rect(slide, 0, 6.8, 13.333, 0.08, fill_color=ACCENT_BLUE)

add_text(slide, "MAJOR DEPRESSIVE DISORDER", 1.0, 1.5, 11.3, 1.4,
         font_size=42, bold=True, color=WHITE, align=PP_ALIGN.CENTER,
         v_anchor=MSO_ANCHOR.MIDDLE, font_name="Calibri")
add_text(slide, "DSM-5-TR Criteria, Pathophysiology, Diagnosis & Management", 1.0, 2.9, 11.3, 0.7,
         font_size=20, bold=False, color=LIGHT_BLUE, align=PP_ALIGN.CENTER,
         v_anchor=MSO_ANCHOR.MIDDLE, font_name="Calibri")
add_rect(slide, 4.0, 3.8, 5.333, 0.06, fill_color=GOLD)
add_text(slide, "Based on Kaplan & Sadock's Synopsis of Psychiatry  |  DSM-5-TR  |  Harrison's Medicine",
         1.0, 4.1, 11.3, 0.5, font_size=13, bold=False, color=RGBColor(0xB0, 0xC8, 0xE8),
         align=PP_ALIGN.CENTER, font_name="Calibri")
add_text(slide, "Psychiatry  •  Mental Health  •  Clinical Reference",
         1.0, 6.2, 11.3, 0.5, font_size=12, bold=False, color=RGBColor(0x80, 0xA0, 0xC0),
         align=PP_ALIGN.CENTER, font_name="Calibri")

# ════════════════════════════════════════════════════════════════════════════
# SLIDE 2 – OVERVIEW / DEFINITION
# ════════════════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank_layout)
add_rect(slide, 0, 0, 13.333, 7.5, fill_color=LIGHT_GRAY)
slide_header(slide, "Overview & Definition", "What is Major Depressive Disorder?")

# Left panel
add_rect(slide, 0.35, 1.4, 6.0, 5.7, fill_color=WHITE)
add_rect(slide, 0.35, 1.4, 0.08, 5.7, fill_color=MID_BLUE)
add_text(slide, "Definition", 0.6, 1.5, 5.7, 0.45, font_size=16, bold=True, color=DARK_BLUE)
add_bullet_text(slide, [
    "A mood disorder characterised by one or more major depressive episodes",
    "Episode: ≥5 symptoms present during the SAME 2-week period",
    "At least one symptom must be depressed mood OR anhedonia",
    "Symptoms cause clinically significant distress or functional impairment",
    "NOT attributable to substances, another medical condition, or bereavement alone",
    "Classified under Depressive Disorders in DSM-5-TR (Chapter on Mood)",
], 0.55, 2.0, 5.8, 4.8, font_size=14, color=DARK_TEXT)

# Right panel
add_rect(slide, 6.85, 1.4, 6.1, 5.7, fill_color=WHITE)
add_rect(slide, 6.85, 1.4, 0.08, 5.7, fill_color=GOLD)
add_text(slide, "Key Facts", 7.1, 1.5, 5.7, 0.45, font_size=16, bold=True, color=DARK_BLUE)
add_bullet_text(slide, [
    ("Prevalence: ", "~15% lifetime; 6–8% of outpatients in primary care"),
    ("Sex ratio: ", "2:1 Female:Male"),
    ("Peak onset: ", "Late teens to mid-20s; can occur at any age"),
    ("Suicide risk: ", "~4–5% of depressed patients die by suicide"),
    ("Recurrence: ", "~50% have a second episode; 70–80% after two episodes"),
    ("Comorbidity: ", "Anxiety disorders, substance use, medical illness"),
    ("Economic burden: ", "Leading global cause of disability (WHO)"),
], 7.1, 2.0, 5.8, 4.8, font_size=14, color=DARK_TEXT)

# ════════════════════════════════════════════════════════════════════════════
# SLIDE 3 – DSM-5-TR DIAGNOSTIC CRITERIA
# ════════════════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank_layout)
add_rect(slide, 0, 0, 13.333, 7.5, fill_color=LIGHT_GRAY)
slide_header(slide, "DSM-5-TR Diagnostic Criteria", "Criterion A–E: Major Depressive Episode")

# Criterion A box
add_rect(slide, 0.35, 1.35, 12.65, 1.7, fill_color=RGBColor(0xE8, 0xF3, 0xFF))
add_rect(slide, 0.35, 1.35, 0.1, 1.7, fill_color=MID_BLUE)
add_text(slide, "CRITERION A — ≥5 of the following symptoms in the SAME 2-week period (at least one must be #1 or #2):",
         0.55, 1.4, 12.3, 0.42, font_size=13, bold=True, color=MID_BLUE)

# Symptoms in two columns
syms_left = [
    "1.  Depressed mood most of the day, nearly every day",
    "2.  Markedly diminished interest or pleasure (Anhedonia)",
    "3.  Significant weight loss/gain or appetite change (>5% in a month)",
    "4.  Insomnia or hypersomnia nearly every day",
    "5.  Psychomotor agitation or retardation (observable by others)",
]
syms_right = [
    "6.  Fatigue or loss of energy nearly every day",
    "7.  Feelings of worthlessness or excessive/inappropriate guilt",
    "8.  Diminished ability to think, concentrate or make decisions",
    "9.  Recurrent thoughts of death, suicidal ideation, or suicide attempt",
    "      (Note: In children, irritable mood may substitute for depressed mood)",
]

for i, s in enumerate(syms_left):
    add_rect(slide, 0.35, 2.95 + i*0.55, 5.9, 0.5,
             fill_color=WHITE if i % 2 == 0 else RGBColor(0xF0, 0xF6, 0xFF))
    add_text(slide, s, 0.55, 2.97 + i*0.55, 5.7, 0.46,
             font_size=12.5, color=DARK_TEXT)

for i, s in enumerate(syms_right):
    add_rect(slide, 6.55, 2.95 + i*0.55, 6.45, 0.5,
             fill_color=WHITE if i % 2 == 0 else RGBColor(0xF0, 0xF6, 0xFF))
    add_text(slide, s, 6.7, 2.97 + i*0.55, 6.2, 0.46,
             font_size=12.5, color=DARK_TEXT)

# Criteria B–E strip
add_rect(slide, 0.35, 5.72, 12.65, 1.5, fill_color=DARK_BLUE)
crit = [
    ("B", "Symptoms cause significant distress or social/occupational impairment"),
    ("C", "NOT due to substance use or another medical condition"),
    ("D", "NOT better explained by a psychotic disorder (e.g., schizoaffective)"),
    ("E", "No history of a manic or hypomanic episode (rules out Bipolar)"),
]
for i, (letter, text) in enumerate(crit):
    x = 0.55 + i * 3.15
    add_rect(slide, x, 5.85, 0.38, 0.38, fill_color=GOLD)
    add_text(slide, letter, x, 5.85, 0.38, 0.38, font_size=14, bold=True,
             color=DARK_BLUE, align=PP_ALIGN.CENTER, v_anchor=MSO_ANCHOR.MIDDLE)
    add_text(slide, text, x + 0.45, 5.85, 2.6, 0.5, font_size=11.5, color=WHITE)

# ════════════════════════════════════════════════════════════════════════════
# SLIDE 4 – SPECIFIERS
# ════════════════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank_layout)
add_rect(slide, 0, 0, 13.333, 7.5, fill_color=LIGHT_GRAY)
slide_header(slide, "DSM-5-TR Specifiers", "Characterising the Episode & Course")

specifiers = [
    ("With Anxious Distress", MID_BLUE,
     "≥2 of: tense/keyed up, restlessness, poor concentration due to worry,\nfear of losing control, fear of terrible thing happening"),
    ("With Mixed Features", RGBColor(0x6B, 0x4F, 0xBB),
     "Depressive episode + ≥3 manic/hypomanic symptoms (elevated mood,\ngrandiosity, talkativeness, flight of ideas, decreased sleep, risky behavior)"),
    ("With Melancholic Features", RGBColor(0x8B, 0x00, 0x00),
     "Severe anhedonia, early morning awakening, worse in AM, significant\nweight loss, excessive guilt — often 'endogenous depression'"),
    ("With Atypical Features", ORANGE,
     "Mood reactivity + ≥2 of: increased appetite/weight, hypersomnia,\nleaden paralysis, rejection sensitivity"),
    ("With Psychotic Features", DARK_BLUE,
     "Mood-congruent (guilt, nihilism, deserved punishment) or\nMood-incongruent psychotic symptoms; indicates severe disease"),
    ("With Catatonia", RGBColor(0x00, 0x6B, 0x6B),
     "Must be present during most of depressive episode;\nwaxy flexibility, stupor, mutism, negativism, posturing"),
    ("With Peripartum Onset", RGBColor(0xB5, 0x45, 0x8A),
     "Onset during pregnancy OR within 4 weeks of delivery;\npreviously 'postpartum depression'"),
    ("With Seasonal Pattern", GREEN,
     "Regular temporal relationship between onset and specific\nseason (usually winter); full remission in other seasons"),
]

cols = 4
rows = 2
box_w = 3.1
box_h = 2.2
start_x = 0.3
start_y = 1.3

for idx, (title, color, desc) in enumerate(specifiers):
    col = idx % cols
    row = idx // cols
    x = start_x + col * (box_w + 0.1)
    y = start_y + row * (box_h + 0.1)
    add_rect(slide, x, y, box_w, box_h, fill_color=WHITE)
    add_rect(slide, x, y, box_w, 0.42, fill_color=color)
    add_rect(slide, x, y, 0.07, box_h, fill_color=color)
    add_text(slide, title, x + 0.12, y + 0.04, box_w - 0.15, 0.38,
             font_size=13, bold=True, color=WHITE, v_anchor=MSO_ANCHOR.MIDDLE)
    add_text(slide, desc, x + 0.12, y + 0.47, box_w - 0.2, box_h - 0.55,
             font_size=11, color=DARK_TEXT, v_anchor=MSO_ANCHOR.TOP)

# Severity strip at bottom
add_rect(slide, 0.3, 5.75, 12.73, 1.45, fill_color=RGBColor(0xE8, 0xF3, 0xFF))
add_text(slide, "SEVERITY SPECIFIERS", 0.5, 5.82, 3.5, 0.35, font_size=13, bold=True, color=DARK_BLUE)
sev_data = [
    ("MILD", "Minimal symptoms (5); meets criteria barely; minor functional impact"),
    ("MODERATE", "Intermediate severity; notable functional difficulty"),
    ("SEVERE", "Many symptoms; marked distress; suicidal ideation; requires intensive treatment"),
]
for i, (lbl, txt) in enumerate(sev_data):
    x_pos = 0.5 + i * 4.2
    colors_sev = [GREEN, ORANGE, RED_ALERT]
    add_rect(slide, x_pos, 6.2, 1.1, 0.38, fill_color=colors_sev[i])
    add_text(slide, lbl, x_pos, 6.2, 1.1, 0.38, font_size=12, bold=True,
             color=WHITE, align=PP_ALIGN.CENTER, v_anchor=MSO_ANCHOR.MIDDLE)
    add_text(slide, txt, x_pos + 1.15, 6.22, 2.9, 0.36, font_size=11, color=DARK_TEXT)

# ════════════════════════════════════════════════════════════════════════════
# SLIDE 5 – EPIDEMIOLOGY & RISK FACTORS
# ════════════════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank_layout)
add_rect(slide, 0, 0, 13.333, 7.5, fill_color=LIGHT_GRAY)
slide_header(slide, "Epidemiology & Risk Factors", "Who Gets MDD and Why?")

# Stats boxes
stats = [
    ("~15%", "Lifetime prevalence\nin the general population"),
    ("2 : 1", "Female to Male\nratio"),
    ("20s–30s", "Peak onset\nage range"),
    ("4–5%", "Suicide completion\nin depressed patients"),
    ("50–60%", "Recurrence rate\nafter 1st episode"),
    (">80%", "Recurrence rate\nafter ≥2 episodes"),
]
for i, (num, lbl) in enumerate(stats):
    x = 0.35 + i * 2.12
    add_rect(slide, x, 1.38, 1.95, 1.55, fill_color=MID_BLUE if i % 2 == 0 else DARK_BLUE)
    add_text(slide, num, x + 0.05, 1.45, 1.85, 0.75,
             font_size=26, bold=True, color=GOLD, align=PP_ALIGN.CENTER, v_anchor=MSO_ANCHOR.MIDDLE)
    add_text(slide, lbl, x + 0.05, 2.2, 1.85, 0.65,
             font_size=11, color=WHITE, align=PP_ALIGN.CENTER, v_anchor=MSO_ANCHOR.TOP)

# Risk factors in panels
add_rect(slide, 0.35, 3.1, 3.9, 4.1, fill_color=WHITE)
add_rect(slide, 0.35, 3.1, 0.08, 4.1, fill_color=MID_BLUE)
add_text(slide, "Biological Risk Factors", 0.55, 3.15, 3.6, 0.42, font_size=14, bold=True, color=MID_BLUE)
add_bullet_text(slide, [
    "Family history of mood disorder",
    "BDNF & serotonin system dysregulation",
    "HPA axis hyperactivity (cortisol excess)",
    "Reduced hippocampal volume (stress-related)",
    "Monoamine deficiency (5-HT, NE, DA)",
    "Genetic heritability ~40%",
    "Medical illness (thyroid, neurological)",
    "Substance use disorder",
], 0.55, 3.6, 3.6, 3.5, font_size=12.5, color=DARK_TEXT)

add_rect(slide, 4.55, 3.1, 3.9, 4.1, fill_color=WHITE)
add_rect(slide, 4.55, 3.1, 0.08, 4.1, fill_color=GOLD)
add_text(slide, "Psychosocial Risk Factors", 4.75, 3.15, 3.6, 0.42, font_size=14, bold=True, color=ORANGE)
add_bullet_text(slide, [
    "Adverse childhood experiences (ACEs)",
    "Stressful life events (loss, trauma)",
    "Chronic stress and burnout",
    "Low socioeconomic status",
    "Social isolation / lack of support",
    "Negative cognitive style / rumination",
    "Personality: neuroticism, introversion",
    "Comorbid anxiety disorders",
], 4.75, 3.6, 3.6, 3.5, font_size=12.5, color=DARK_TEXT)

add_rect(slide, 8.75, 3.1, 4.25, 4.1, fill_color=WHITE)
add_rect(slide, 8.75, 3.1, 0.08, 4.1, fill_color=RED_ALERT)
add_text(slide, "Protective Factors", 8.95, 3.15, 3.9, 0.42, font_size=14, bold=True, color=RED_ALERT)
add_bullet_text(slide, [
    "Strong social support network",
    "Physical activity / exercise",
    "Effective coping strategies",
    "Higher educational attainment",
    "Positive sense of self-efficacy",
    "Early detection and treatment",
    "Mindfulness & stress management",
    "Adequate sleep hygiene",
], 8.95, 3.6, 3.9, 3.5, font_size=12.5, color=DARK_TEXT)

# ════════════════════════════════════════════════════════════════════════════
# SLIDE 6 – PATHOPHYSIOLOGY
# ════════════════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank_layout)
add_rect(slide, 0, 0, 13.333, 7.5, fill_color=LIGHT_GRAY)
slide_header(slide, "Pathophysiology", "Neurobiological & Psychological Mechanisms")

theories = [
    ("Monoamine Hypothesis", MID_BLUE,
     "Deficiency of serotonin (5-HT), norepinephrine (NE), and dopamine (DA) in synaptic clefts.\n"
     "Basis for SSRI, SNRI, TCA, MAOI pharmacotherapy.\n"
     "TCA/SSRI upregulate BDNF & CREB over 10–20 days — explaining delayed antidepressant effect."),
    ("Neurotrophic / BDNF Hypothesis", GOLD,
     "Chronic stress → ↓ BDNF in hippocampus (CA3 region) → neuronal atrophy.\n"
     "Antidepressants upregulate BDNF and TrkB receptors over weeks.\n"
     "MRI evidence: reduced hippocampal volume in depression & PTSD."),
    ("HPA Axis Dysregulation", ORANGE,
     "Psychological/physical stress → CRH → ACTH → ↑ cortisol (hypercortisolemia).\n"
     "Sustained cortisol elevation → hippocampal neuronal loss.\n"
     "Dexamethasone suppression test (DST): non-suppression in ~50% of melancholic MDD."),
    ("Neuroinflammation", RGBColor(0x6B, 0x4F, 0xBB),
     "↑ Pro-inflammatory cytokines (IL-1, IL-6, TNF-α) in depressed patients.\n"
     "Cytokines cross blood-brain barrier → alter monoamine metabolism.\n"
     "Activated microglia → tryptophan shunted away from serotonin synthesis."),
    ("Default Mode Network (DMN)", RGBColor(0x00, 0x6B, 0x6B),
     "Hyperactivity of DMN (prefrontal, posterior cingulate, precuneus) → rumination.\n"
     "Reduced activity of dorsal PFC → impaired emotion regulation.\n"
     "Amygdala hyperreactivity to negative stimuli; blunted reward circuitry (nucleus accumbens)."),
    ("Cognitive / Psychological Model", RGBColor(0x8B, 0x45, 0x13),
     "Beck's Cognitive Triad: Negative view of self, world, and future.\n"
     "Learned helplessness theory (Seligman).\n"
     "Negative automatic thoughts and dysfunctional core beliefs perpetuate depression."),
]

box_w = 4.05
box_h = 2.0
start_x = 0.3
start_y = 1.35

for idx, (title, color, desc) in enumerate(theories):
    col = idx % 3
    row = idx // 3
    x = start_x + col * (box_w + 0.2)
    y = start_y + row * (box_h + 0.15)
    add_rect(slide, x, y, box_w, box_h, fill_color=WHITE)
    add_rect(slide, x, y, box_w, 0.4, fill_color=color)
    add_rect(slide, x, y, 0.07, box_h, fill_color=color)
    add_text(slide, title, x + 0.12, y + 0.04, box_w - 0.15, 0.35,
             font_size=13, bold=True, color=WHITE, v_anchor=MSO_ANCHOR.MIDDLE)
    add_text(slide, desc, x + 0.12, y + 0.45, box_w - 0.2, box_h - 0.53,
             font_size=11, color=DARK_TEXT, v_anchor=MSO_ANCHOR.TOP)

# ════════════════════════════════════════════════════════════════════════════
# SLIDE 7 – CLINICAL FEATURES
# ════════════════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank_layout)
add_rect(slide, 0, 0, 13.333, 7.5, fill_color=LIGHT_GRAY)
slide_header(slide, "Clinical Features", "Presenting Symptoms Across Domains")

domains = [
    ("😔 Mood / Affect", MID_BLUE, [
        "Persistent depressed or empty mood",
        "Dysphoria, hopelessness, tearfulness",
        "Irritability (especially children/adolescents)",
        "Anxiety — very common comorbid feature",
        "Qualitatively different from normal sadness",
    ]),
    ("🧠 Cognitive", DARK_BLUE, [
        "Poor concentration, indecisiveness",
        "Slowed thinking, memory problems",
        "Negative automatic thoughts",
        "Feelings of worthlessness and guilt",
        "Recurrent thoughts of death / suicidal ideation",
    ]),
    ("💤 Vegetative / Neurovegetative", ORANGE, [
        "Insomnia (especially early morning awakening)",
        "Hypersomnia in atypical depression",
        "Loss of appetite → weight loss (or gain in atypical)",
        "Fatigue, loss of energy, anergia",
        "Decreased libido",
    ]),
    ("🏃 Psychomotor", RGBColor(0x6B, 0x4F, 0xBB), [
        "Psychomotor retardation (slowed speech, movement)",
        "Psychomotor agitation (restlessness, hand-wringing)",
        "Both are observable by others (DSM-5 criterion)",
    ]),
    ("🌍 Social / Functional", RED_ALERT, [
        "Social withdrawal and isolation",
        "Academic/occupational impairment",
        "Neglect of personal hygiene and self-care",
        "Relationship difficulties",
    ]),
    ("🔮 Psychotic Features (Severe)", RGBColor(0x8B, 0x00, 0x00), [
        "Mood-congruent delusions: guilt, nihilism, poverty",
        "Mood-incongruent: persecutory (worse prognosis)",
        "Auditory hallucinations: derogatory, suicidal content",
        "More common in adolescents & elderly",
    ]),
]

box_w = 4.05
box_h = 2.4
start_x = 0.3
start_y = 1.3

for idx, (title, color, items) in enumerate(domains):
    col = idx % 3
    row = idx // 3
    x = start_x + col * (box_w + 0.2)
    y = start_y + row * (box_h + 0.1)
    add_rect(slide, x, y, box_w, box_h, fill_color=WHITE)
    add_rect(slide, x, y, box_w, 0.42, fill_color=color)
    add_text(slide, title, x + 0.1, y + 0.05, box_w - 0.15, 0.35,
             font_size=13, bold=True, color=WHITE, v_anchor=MSO_ANCHOR.MIDDLE)
    add_bullet_text(slide, items, x + 0.1, y + 0.47, box_w - 0.15, box_h - 0.55,
                    font_size=11.5, color=DARK_TEXT)

# ════════════════════════════════════════════════════════════════════════════
# SLIDE 8 – DIAGNOSIS & DIFFERENTIAL DIAGNOSIS
# ════════════════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank_layout)
add_rect(slide, 0, 0, 13.333, 7.5, fill_color=LIGHT_GRAY)
slide_header(slide, "Diagnosis & Differential Diagnosis", "Clinical Assessment & Exclusion Criteria")

# Left: Assessment approach
add_rect(slide, 0.3, 1.35, 5.8, 5.9, fill_color=WHITE)
add_rect(slide, 0.3, 1.35, 0.09, 5.9, fill_color=MID_BLUE)
add_text(slide, "Clinical Assessment", 0.55, 1.42, 5.4, 0.42, font_size=16, bold=True, color=DARK_BLUE)
add_bullet_text(slide, [
    ("History: ", "Onset, duration, severity, prior episodes, family history"),
    ("MSE: ", "Assess mood, affect, thought content, cognition, risk"),
    ("PHQ-9: ", "Validated 9-item self-report screen (score ≥10 = moderate)"),
    ("HAM-D: ", "Hamilton Depression Rating Scale — 17/21-item clinician tool"),
    ("MADRS: ", "Montgomery-Åsberg Depression Rating Scale"),
    ("Suicide: ", "Directly ask — plans, intent, means, protective factors"),
    ("Rule out: ", "Medical causes (thyroid, anemia, neurological), substances"),
    ("Labs: ", "TFT, FBC, CMP, B12/folate, substance screen"),
    ("Imaging: ", "Consider MRI if atypical features or focal neurology"),
], 0.55, 1.9, 5.5, 5.1, font_size=12.5, color=DARK_TEXT)

# Right: Differential Diagnosis
add_rect(slide, 6.5, 1.35, 6.5, 5.9, fill_color=WHITE)
add_rect(slide, 6.5, 1.35, 0.09, 5.9, fill_color=RED_ALERT)
add_text(slide, "Differential Diagnosis — Must Exclude", 6.72, 1.42, 6.1, 0.42,
         font_size=16, bold=True, color=DARK_BLUE)

diffs = [
    ("Bipolar I / II Disorder", RED_ALERT,
     "If ANY history of mania/hypomania → Bipolar, not MDD. CRITICAL — antidepressants alone can trigger mania."),
    ("Persistent Depressive Disorder (Dysthymia)", ORANGE,
     "Chronic low-grade depression ≥2 years; fewer symptoms than MDD. Can co-occur ('double depression')."),
    ("Grief / Bereavement", MID_BLUE,
     "Normal grief: self-limited, identity intact. MDD: pervasive worthlessness, suicidal ideation, prolonged >2 months."),
    ("Medical Causes", RGBColor(0x00, 0x7B, 0x55),
     "Hypothyroidism, Addison's, Cushing's, CNS tumors, Parkinson's, stroke, vitamin deficiencies."),
    ("Substance-Induced Mood Disorder", RGBColor(0x6B, 0x4F, 0xBB),
     "Alcohol (depressant), stimulant withdrawal, corticosteroids, beta-blockers. Temporal association critical."),
    ("ADHD / Anxiety Disorders", DARK_BLUE,
     "Concentration & sleep issues overlap. Anxiety is frequently comorbid (assess both)."),
    ("Adjustment Disorder with Depressed Mood", RGBColor(0x8B, 0x45, 0x13),
     "Identifiable stressor; doesn't meet full MDD criteria; resolves within 6 months of stressor ending."),
]
for i, (title, color, desc) in enumerate(diffs):
    add_rect(slide, 6.65, 1.88 + i * 0.72, 6.1, 0.68, fill_color=LIGHT_GRAY if i % 2 == 0 else WHITE)
    add_rect(slide, 6.65, 1.88 + i * 0.72, 0.07, 0.68, fill_color=color)
    add_text(slide, title, 6.8, 1.9 + i * 0.72, 2.4, 0.28, font_size=11.5, bold=True, color=color)
    add_text(slide, desc, 6.8, 2.18 + i * 0.72, 6.1, 0.38, font_size=10.5, color=DARK_TEXT)

# ════════════════════════════════════════════════════════════════════════════
# SLIDE 9 – TREATMENT: PHARMACOTHERAPY
# ════════════════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank_layout)
add_rect(slide, 0, 0, 13.333, 7.5, fill_color=LIGHT_GRAY)
slide_header(slide, "Pharmacotherapy", "Antidepressant Drug Classes & Selection")

drug_classes = [
    ("SSRIs (First Line)", GREEN, [
        "Fluoxetine, Sertraline, Escitalopram,",
        "Paroxetine, Citalopram, Fluvoxamine",
        "MOA: Block 5-HT reuptake transporter",
        "Best tolerability; safe in overdose",
        "Onset: 2–4 weeks (full effect 6–8 wks)",
        "SE: GI, sexual dysfunction, insomnia, SIADH",
    ]),
    ("SNRIs (First Line)", MID_BLUE, [
        "Venlafaxine, Duloxetine, Desvenlafaxine",
        "MOA: Block 5-HT + NE reuptake",
        "Good for pain comorbidity (duloxetine)",
        "Venlafaxine: BP monitoring needed",
        "Useful in anxious depression",
        "SE: Nausea, sweating, ↑ BP (venlafaxine)",
    ]),
    ("TCAs (Second Line)", ORANGE, [
        "Amitriptyline, Imipramine, Nortriptyline",
        "MOA: Block 5-HT + NE reuptake + multiple receptors",
        "Effective, but lethal in overdose (QTc ↑)",
        "SE: Anticholinergic, sedation, ortho-hypotension",
        "Monitor ECG; low therapeutic index",
        "Used for chronic pain, neuropathy, enuresis",
    ]),
    ("MAOIs", RGBColor(0x8B, 0x00, 0x00), [
        "Phenelzine, Tranylcypromine (irreversible)",
        "Moclobemide (reversible — RIMA)",
        "MOA: Inhibit MAO-A/B → ↑ 5-HT, NE, DA",
        "Effective for atypical depression",
        "TYRAMINE DIET ESSENTIAL (cheese reaction)",
        "Serotonin syndrome risk with SSRIs",
    ]),
    ("Atypicals / Others", RGBColor(0x6B, 0x4F, 0xBB), [
        "Bupropion: DA+NE; no sexual SE; smoking cessation",
        "Mirtazapine: α2 antagonist; sedating; ↑ appetite",
        "Trazodone: 5-HT2 antagonist; sedative; priapism risk",
        "Vortioxetine: Multimodal 5-HT; cognitive benefits",
        "Agomelatine: MT1/MT2 agonist; circadian regulation",
    ]),
    ("Augmentation Strategies", DARK_BLUE, [
        "Lithium augmentation (classic; monitor levels)",
        "Atypical antipsychotics: Quetiapine, Aripiprazole",
        "T3 thyroid hormone augmentation",
        "Esketamine (Spravato) nasal spray — FDA approved",
        "For treatment-resistant depression (TRD)",
        "ECT: Highly effective in TRD & psychotic MDD",
    ]),
]

box_w = 4.05
box_h = 2.45
start_x = 0.3
start_y = 1.35

for idx, (title, color, items) in enumerate(drug_classes):
    col = idx % 3
    row = idx // 3
    x = start_x + col * (box_w + 0.2)
    y = start_y + row * (box_h + 0.1)
    add_rect(slide, x, y, box_w, box_h, fill_color=WHITE)
    add_rect(slide, x, y, box_w, 0.42, fill_color=color)
    add_rect(slide, x, y, 0.07, box_h, fill_color=color)
    add_text(slide, title, x + 0.12, y + 0.04, box_w - 0.15, 0.36,
             font_size=13.5, bold=True, color=WHITE, v_anchor=MSO_ANCHOR.MIDDLE)
    add_bullet_text(slide, items, x + 0.12, y + 0.47, box_w - 0.18, box_h - 0.55,
                    font_size=11, color=DARK_TEXT)

# ════════════════════════════════════════════════════════════════════════════
# SLIDE 10 – PSYCHOTHERAPY & NON-PHARM TREATMENTS
# ════════════════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank_layout)
add_rect(slide, 0, 0, 13.333, 7.5, fill_color=LIGHT_GRAY)
slide_header(slide, "Psychotherapy & Non-Pharmacological Treatments",
             "Evidence-Based Psychological & Somatic Interventions")

therapies = [
    ("Cognitive Behavioural Therapy (CBT)", MID_BLUE,
     "Gold standard psychotherapy for MDD. 12–20 structured sessions.\n"
     "Targets negative automatic thoughts → cognitive restructuring.\n"
     "Behavioural activation to reverse anhedonia.\n"
     "Equally effective as medication for mild-moderate MDD."),
    ("Interpersonal Therapy (IPT)", GREEN,
     "Focuses on interpersonal role transitions, grief, disputes, deficits.\n"
     "12–16 sessions; particularly effective for grief-related depression.\n"
     "Validated in multiple RCTs; first-line for MDD."),
    ("Psychodynamic Psychotherapy", RGBColor(0x6B, 0x4F, 0xBB),
     "Explores unconscious conflicts, attachment, formative experiences.\n"
     "Short-term (16–24 sessions) or long-term.\n"
     "Useful for chronic depression with personality factors."),
    ("Mindfulness-Based CBT (MBCT)", ORANGE,
     "8-week structured program combining CBT + mindfulness meditation.\n"
     "NICE-recommended for prevention of MDD relapse (≥3 prior episodes).\n"
     "Reduces ruminative thinking and improves emotional regulation."),
    ("Electroconvulsive Therapy (ECT)", RGBColor(0x8B, 0x00, 0x00),
     "Most effective treatment for severe/treatment-resistant/psychotic MDD.\n"
     "Response rate: 70–90% in eligible patients.\n"
     "3x/week under GA; typical course 6–12 sessions.\n"
     "SE: Temporary anterograde amnesia; headache; confusion."),
    ("Newer & Emerging Therapies", DARK_BLUE,
     "Esketamine (Spravato) intranasal: Rapid-acting NMDA antagonist; FDA 2019 for TRD.\n"
     "rTMS: Non-invasive; targets left DLPFC; no GA required.\n"
     "Light Therapy: First-line for Seasonal MDD (10,000 lux, 30 min/day AM).\n"
     "Exercise: Equivalent to medication for mild-moderate depression (RCT data)."),
]

box_w = 4.05
box_h = 2.45
start_x = 0.3
start_y = 1.35

for idx, (title, color, desc) in enumerate(therapies):
    col = idx % 3
    row = idx // 3
    x = start_x + col * (box_w + 0.2)
    y = start_y + row * (box_h + 0.1)
    add_rect(slide, x, y, box_w, box_h, fill_color=WHITE)
    add_rect(slide, x, y, box_w, 0.42, fill_color=color)
    add_rect(slide, x, y, 0.07, box_h, fill_color=color)
    add_text(slide, title, x + 0.12, y + 0.04, box_w - 0.15, 0.36,
             font_size=13, bold=True, color=WHITE, v_anchor=MSO_ANCHOR.MIDDLE)
    add_text(slide, desc, x + 0.12, y + 0.47, box_w - 0.2, box_h - 0.55,
             font_size=11, color=DARK_TEXT, v_anchor=MSO_ANCHOR.TOP)

# ════════════════════════════════════════════════════════════════════════════
# SLIDE 11 – COURSE, PROGNOSIS & SUICIDE RISK
# ════════════════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank_layout)
add_rect(slide, 0, 0, 13.333, 7.5, fill_color=LIGHT_GRAY)
slide_header(slide, "Course, Prognosis & Suicide Risk Assessment",
             "Natural History, Outcomes & Safety Management")

# Left: Course & Prognosis
add_rect(slide, 0.3, 1.35, 5.8, 5.9, fill_color=WHITE)
add_rect(slide, 0.3, 1.35, 0.09, 5.9, fill_color=MID_BLUE)
add_text(slide, "Course & Prognosis", 0.55, 1.42, 5.4, 0.42, font_size=16, bold=True, color=DARK_BLUE)
add_bullet_text(slide, [
    ("Episode duration: ", "Untreated — 6–12 months; treated — 3–6 months"),
    ("Recurrence: ", "~50% after 1st episode; 70% after 2nd; >90% after 3rd"),
    ("Full recovery: ", "~40% achieve full remission; 60% have residual symptoms"),
    ("Chronic course: ", "~15–20% develop chronic depression (>2 years)"),
    ("Good prognosis: ", "Acute onset, older age, absence of psychosis, good social support, treated early"),
    ("Poor prognosis: ", "Early onset, psychotic features, comorbid anxiety/substance use, severe episodes, lack of treatment"),
    ("Maintenance tx: ", "Continue antidepressants ≥6–12 months after remission; lifelong if ≥3 episodes"),
    ("Phase of treatment:", "Acute (0–3 mo) → Continuation (3–12 mo) → Maintenance (>12 mo)"),
], 0.55, 1.92, 5.5, 5.0, font_size=12, color=DARK_TEXT)

# Right: Suicide Risk Assessment
add_rect(slide, 6.5, 1.35, 6.5, 5.9, fill_color=WHITE)
add_rect(slide, 6.5, 1.35, 0.09, 5.9, fill_color=RED_ALERT)
add_text(slide, "Suicide Risk Assessment (SAD PERSONS Scale)", 6.72, 1.42, 6.1, 0.42,
         font_size=14.5, bold=True, color=RED_ALERT)

sad_persons = [
    ("S", "Sex (male > female)"),
    ("A", "Age (elderly, adolescents)"),
    ("D", "Depression / Hopelessness"),
    ("P", "Previous attempt (strongest predictor)"),
    ("E", "Ethanol / substance use"),
    ("R", "Rational thinking loss (psychosis)"),
    ("S", "Social support lacking"),
    ("O", "Organised plan"),
    ("N", "No spouse / social isolation"),
    ("S", "Stated intent to die"),
]
for i, (letter, desc) in enumerate(sad_persons):
    bg = RED_ALERT if i % 2 == 0 else RGBColor(0xE8, 0x1A, 0x0C)
    add_rect(slide, 6.65, 1.88 + i * 0.52, 0.45, 0.5, fill_color=bg)
    add_text(slide, letter, 6.65, 1.88 + i * 0.52, 0.45, 0.5,
             font_size=13, bold=True, color=WHITE, align=PP_ALIGN.CENTER, v_anchor=MSO_ANCHOR.MIDDLE)
    add_rect(slide, 7.12, 1.88 + i * 0.52, 5.7, 0.5,
             fill_color=LIGHT_GRAY if i % 2 == 0 else WHITE)
    add_text(slide, desc, 7.18, 1.9 + i * 0.52, 5.55, 0.46,
             font_size=12.5, color=DARK_TEXT, v_anchor=MSO_ANCHOR.MIDDLE)

# Immediate action strip
add_rect(slide, 6.5, 7.06, 6.5, 0.35, fill_color=RED_ALERT)
add_text(slide, "Score ≥7 → Immediate psychiatric referral / hospitalisation",
         6.55, 7.08, 6.4, 0.3, font_size=11.5, bold=True, color=WHITE, align=PP_ALIGN.CENTER)

# ════════════════════════════════════════════════════════════════════════════
# SLIDE 12 – SPECIAL POPULATIONS
# ════════════════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank_layout)
add_rect(slide, 0, 0, 13.333, 7.5, fill_color=LIGHT_GRAY)
slide_header(slide, "Special Populations", "Children, Adolescents, Elderly & Peripartum")

populations = [
    ("Children & Adolescents", MID_BLUE, [
        "Irritability may substitute for depressed mood (DSM-5-TR)",
        "Somatic complaints: headache, abdominal pain",
        "School refusal, academic decline, social withdrawal",
        "Psychomotor agitation more prominent than retardation",
        "Mood-congruent hallucinations possible in severe cases",
        "Drug use often complicates adolescent depression",
        "SSRIs (fluoxetine FDA-approved <18); CBT equally important",
        "Black box warning: Monitor for suicidality in <25 yr on SSRIs",
    ]),
    ("Elderly", ORANGE, [
        "Often presents with cognitive symptoms ('pseudodementia')",
        "Somatic complaints & hypochondriacal features prominent",
        "Greater vascular/neurological comorbidity",
        "Bereavement, chronic illness, isolation as precipitants",
        "Risk of under-diagnosis — wrongly attributed to aging",
        "ECT especially effective and safe in elderly MDD",
        "Start SSRIs at lower dose; monitor for hyponatremia (SIADH)",
        "Avoid TCAs (falls, anticholinergic cognitive impairment)",
    ]),
    ("Peripartum / Postpartum", RGBColor(0xB5, 0x45, 0x8A), [
        "Peripartum onset: during pregnancy OR ≤4 weeks postpartum",
        "Baby blues (days 2–5): transient, resolves spontaneously",
        "Postpartum MDD: 10–15% of mothers; requires treatment",
        "Postpartum psychosis: Medical emergency — 1–2 in 1000",
        "Brexanolone (IV neuroactive steroid) — FDA 2019 for PPD",
        "Sertraline: preferred SSRI in breastfeeding",
        "Risk: prior MDD, bipolar, trauma, low social support",
        "Infanticide risk: assess mother-infant bonding carefully",
    ]),
    ("Treatment-Resistant Depression (TRD)", RED_ALERT, [
        "Definition: ≥2 adequate trials of antidepressants failed",
        "Reassess diagnosis, adherence, comorbidities",
        "Augmentation: Lithium, atypical APs, T3",
        "Esketamine (Spravato) nasal spray — FDA 2019",
        "ECT: 70–90% response in TRD",
        "rTMS, deep brain stimulation (investigational)",
        "STAR*D trial: Sequential therapy algorithm used clinically",
        "Psychotherapy should always accompany pharmacotherapy",
    ]),
]

box_w = 6.1
box_h = 2.7
start_x = 0.35
start_y = 1.35

for idx, (title, color, items) in enumerate(populations):
    col = idx % 2
    row = idx // 2
    x = start_x + col * (box_w + 0.5)
    y = start_y + row * (box_h + 0.15)
    add_rect(slide, x, y, box_w, box_h, fill_color=WHITE)
    add_rect(slide, x, y, box_w, 0.42, fill_color=color)
    add_rect(slide, x, y, 0.07, box_h, fill_color=color)
    add_text(slide, title, x + 0.12, y + 0.04, box_w - 0.15, 0.36,
             font_size=14, bold=True, color=WHITE, v_anchor=MSO_ANCHOR.MIDDLE)
    add_bullet_text(slide, items, x + 0.12, y + 0.47, box_w - 0.2, box_h - 0.55,
                    font_size=11.5, color=DARK_TEXT)

# ════════════════════════════════════════════════════════════════════════════
# SLIDE 13 – SUMMARY / KEY POINTS
# ════════════════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank_layout)
add_rect(slide, 0, 0, 13.333, 7.5, fill_color=DARK_BLUE)
add_rect(slide, 0, 1.15, 13.333, 0.05, fill_color=GOLD)
add_text(slide, "Key Takeaways", 0.5, 0.2, 12.3, 0.85,
         font_size=30, bold=True, color=WHITE, align=PP_ALIGN.CENTER, v_anchor=MSO_ANCHOR.MIDDLE)

key_points = [
    ("DSM-5-TR Diagnosis", MID_BLUE,
     "≥5 of 9 symptoms for ≥2 weeks; must include depressed mood OR anhedonia; significant functional impairment"),
    ("Always Rule Out Bipolar", RED_ALERT,
     "Any lifetime manic/hypomanic episode changes the diagnosis to Bipolar Disorder — crucial therapeutic implication"),
    ("Treat All Three Phases", GREEN,
     "Acute (0–3 mo) → Continuation (3–12 mo) → Maintenance (>12 mo if recurrent); prevent relapse"),
    ("First-Line = SSRI + CBT", GOLD,
     "Combination of pharmacotherapy (SSRI/SNRI) + psychotherapy (CBT/IPT) superior to either alone"),
    ("Assess Suicide Every Visit", ORANGE,
     "Directly ask about suicidal ideation, plan, intent, means. 4–5% of MDD patients die by suicide"),
    ("TRD Options Expanding", RGBColor(0x6B, 0x4F, 0xBB),
     "Esketamine, ECT, rTMS — proven options for treatment-resistant cases; augmentation before switching"),
]

cols = 2
for i, (title, color, desc) in enumerate(key_points):
    col = i % cols
    row = i // cols
    x = 0.4 + col * 6.5
    y = 1.35 + row * 1.95
    add_rect(slide, x, y, 6.1, 1.8, fill_color=RGBColor(0x22, 0x46, 0x68))
    add_rect(slide, x, y, 0.09, 1.8, fill_color=color)
    add_rect(slide, x, y, 6.1, 0.42, fill_color=RGBColor(0x1A, 0x3A, 0x5C))
    add_rect(slide, x + 0.09, y, 0.42, 0.42, fill_color=color)
    add_text(slide, title, x + 0.55, y + 0.04, 5.4, 0.36,
             font_size=14, bold=True, color=WHITE, v_anchor=MSO_ANCHOR.MIDDLE)
    add_text(slide, desc, x + 0.15, y + 0.47, 5.82, 1.22,
             font_size=12, color=RGBColor(0xD8, 0xE8, 0xF7), v_anchor=MSO_ANCHOR.TOP)

add_text(slide, "Sources: Kaplan & Sadock's Synopsis of Psychiatry  |  DSM-5-TR  |  Harrison's Principles of Internal Medicine  |  Kaplan & Sadock's Comprehensive Textbook of Psychiatry",
         0.4, 7.1, 12.5, 0.35, font_size=10, color=RGBColor(0x70, 0x90, 0xB0), align=PP_ALIGN.CENTER)

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

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

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

Your presentation is ready. Here's your download link:

Major Depressive Disorder DSM5TR

Presentation · PPTX


What's Inside - 13 Slides

SlideTitle
1Title Slide - MDD, DSM-5-TR & Synopsis
2Overview & Definition - Criteria basics + key epidemiological facts
3DSM-5-TR Diagnostic Criteria - Full Criterion A (all 9 symptoms) + B-E
4Specifiers - All 8 DSM-5-TR specifiers + severity table
5Epidemiology & Risk Factors - Stats, biological, psychosocial & protective factors
6Pathophysiology - 6 mechanisms (monoamine, BDNF, HPA, neuroinflammation, DMN, cognitive)
7Clinical Features - Domains: mood, cognitive, vegetative, psychomotor, social, psychotic
8Diagnosis & Differential Diagnosis - Assessment tools (PHQ-9, HAM-D) + 7 differentials
9Pharmacotherapy - SSRIs, SNRIs, TCAs, MAOIs, atypicals, augmentation strategies
10Psychotherapy & Non-Pharm - CBT, IPT, MBCT, ECT, TMS, esketamine, light therapy
11Course, Prognosis & Suicide Risk - SAD PERSONS scale + treatment phases
12Special Populations - Children/adolescents, elderly, peripartum, TRD
13Key Takeaways - 6 must-know clinical principles
Sources used: Kaplan & Sadock's Synopsis of Psychiatry, Kaplan & Sadock's Comprehensive Textbook of Psychiatry, Harrison's Principles of Internal Medicine (22nd ed.), and DSM-5-TR criteria.
This is a shared conversation. Sign in to Orris to start your own chat.