SLE power presentation for postgraduate internal medicine students

Asking for Preferences
Reading File
Reading File
Reading File
Finding Sources
Searching PubMed

"systemic lupus erythematosus"[MeSH Terms] AND "management"[MeSH Terms]

Searching Images

systemic lupus erythematosus malar rash butterfly rash

Finding Sources
Searching PubMed

"lupus erythematosus, systemic"[MeSH Terms] AND "therapeutics"[MeSH Terms]

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

mkdir -p /tmp/workspace/SLE-presentation && ls /tmp/workspace/

Where is the file?

Writing File

~/SLE-presentation/build_sle.py

"""
SLE PowerPoint Presentation Builder
For Postgraduate Internal Medicine Students
~30 slides, full overview
"""

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

# ── Colour palette ──────────────────────────────────────────────
DEEP_NAVY   = RGBColor(0x1A, 0x37, 0x5E)   # slide backgrounds / headers
MID_BLUE    = RGBColor(0x1E, 0x6D, 0xA8)   # accent bars
TEAL        = RGBColor(0x00, 0x87, 0x87)   # highlight / bullet icon
LIGHT_GRAY  = RGBColor(0xF2, 0xF4, 0xF8)   # content background
WHITE       = RGBColor(0xFF, 0xFF, 0xFF)
DARK_TEXT   = RGBColor(0x1A, 0x1A, 0x2E)
GOLD        = RGBColor(0xE8, 0xA8, 0x00)
RED_WARN    = RGBColor(0xC0, 0x39, 0x2B)
SOFT_RED    = RGBColor(0xFD, 0xED, 0xED)
SOFT_BLUE   = RGBColor(0xE8, 0xF4, 0xFD)
SOFT_GREEN  = RGBColor(0xE8, 0xF8, 0xF1)
SOFT_YELLOW = RGBColor(0xFE, 0xF9, 0xE7)

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

blank = prs.slide_layouts[6]  # fully blank


# ════════════════════════════════════════════════════════════════
# Helper utilities
# ════════════════════════════════════════════════════════════════

def add_rect(slide, x, y, w, h, color, transparency=0):
    from pptx.util import Emu
    shape = slide.shapes.add_shape(
        1,  # MSO_SHAPE_TYPE.RECTANGLE
        Inches(x), Inches(y), Inches(w), Inches(h)
    )
    shape.fill.solid()
    shape.fill.fore_color.rgb = color
    shape.line.fill.background()
    if transparency:
        shape.fill.fore_color.theme_color  # no-op, transparency not used further
    return shape


def add_text(slide, text, x, y, w, h,
             size=18, bold=False, color=DARK_TEXT,
             align=PP_ALIGN.LEFT, italic=False,
             font="Calibri", wrap=True):
    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


def add_multiline(slide, lines, x, y, w, h,
                  size=16, color=DARK_TEXT, font="Calibri",
                  line_spacing=1.15, bold_first=False):
    """Add multiple bullet lines to a single textbox."""
    from pptx.util import Pt
    from pptx.oxml.ns import qn
    import lxml.etree as etree

    tb = slide.shapes.add_textbox(Inches(x), Inches(y), Inches(w), Inches(h))
    tf = tb.text_frame
    tf.word_wrap = True
    tf.margin_left = Inches(0.05)
    tf.margin_right = 0
    tf.margin_top = 0
    tf.margin_bottom = 0

    for i, line in enumerate(lines):
        if i == 0:
            p = tf.paragraphs[0]
        else:
            p = tf.add_paragraph()
        run = p.add_run()
        if isinstance(line, tuple):
            run.text, extra_bold = line[0], line[1]
        else:
            run.text = line
            extra_bold = (i == 0 and bold_first)
        run.font.name = font
        run.font.size = Pt(size)
        run.font.bold = extra_bold
        run.font.color.rgb = color
        # line spacing
        from pptx.oxml.ns import qn
        pPr = p._pPr
        if pPr is None:
            pPr = p._p.get_or_add_pPr()
        lnSpc = etree.SubElement(pPr, qn('a:lnSpc'))
        spcPct = etree.SubElement(lnSpc, qn('a:spcPct'))
        spcPct.set('val', str(int(line_spacing * 100000)))
    return tb


def header_bar(slide, title, subtitle=None):
    """Dark navy top bar with title."""
    add_rect(slide, 0, 0, 13.333, 1.15, DEEP_NAVY)
    add_rect(slide, 0, 1.15, 13.333, 0.06, TEAL)
    add_text(slide, title, 0.4, 0.1, 11.5, 0.85,
             size=30, bold=True, color=WHITE, font="Calibri")
    if subtitle:
        add_text(slide, subtitle, 0.4, 0.82, 10, 0.4,
                 size=14, color=RGBColor(0xAA, 0xD4, 0xF5), italic=True)


def content_bg(slide):
    """Light gray background for content area."""
    add_rect(slide, 0, 1.21, 13.333, 6.29, LIGHT_GRAY)


def section_box(slide, title, x, y, w, h, bg_color=SOFT_BLUE,
                title_color=MID_BLUE, lines=None, font_size=14):
    """Colored box with title + bullet lines."""
    add_rect(slide, x, y, w, 0.4, title_color)
    add_rect(slide, x, y + 0.4, w, h - 0.4, bg_color)
    add_text(slide, title, x + 0.1, y + 0.02, w - 0.2, 0.38,
             size=15, bold=True, color=WHITE)
    if lines:
        add_multiline(slide, lines, x + 0.15, y + 0.44,
                      w - 0.25, h - 0.55, size=font_size)


# ════════════════════════════════════════════════════════════════
# SLIDE 1 — Title
# ════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
add_rect(slide, 0, 0, 13.333, 7.5, DEEP_NAVY)
add_rect(slide, 0, 3.3, 13.333, 0.08, TEAL)
add_rect(slide, 0, 3.38, 13.333, 0.08, GOLD)

add_text(slide, "SYSTEMIC LUPUS ERYTHEMATOSUS", 0.6, 1.0, 12.2, 1.4,
         size=42, bold=True, color=WHITE, align=PP_ALIGN.CENTER, font="Calibri")
add_text(slide, "A Comprehensive Review for Postgraduate Internal Medicine", 0.6, 2.4, 12.2, 0.7,
         size=20, color=RGBColor(0xAA, 0xD4, 0xF5), align=PP_ALIGN.CENTER, italic=True)
add_text(slide, "Epidemiology  ·  Pathogenesis  ·  Clinical Features  ·  Diagnosis  ·  Management  ·  Complications",
         0.6, 3.55, 12.2, 0.55, size=14, color=TEAL, align=PP_ALIGN.CENTER)

add_text(slide, "Department of Internal Medicine", 0.6, 5.6, 12.2, 0.4,
         size=14, color=RGBColor(0x88, 0xBB, 0xDD), align=PP_ALIGN.CENTER)
add_text(slide, "Sources: Harrison's 22e · Goldman-Cecil Medicine · Firestein & Kelley's Rheumatology · Comprehensive Clinical Nephrology 7e",
         0.6, 6.1, 12.2, 0.4, size=10, color=RGBColor(0x66, 0x88, 0xAA), align=PP_ALIGN.CENTER)


# ════════════════════════════════════════════════════════════════
# SLIDE 2 — Overview / Agenda
# ════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
header_bar(slide, "Lecture Overview")
content_bg(slide)

topics = [
    "1.  Definition & Epidemiology",
    "2.  Etiology & Risk Factors",
    "3.  Pathogenesis & Immunology",
    "4.  Clinical Features — Systemic Overview",
    "5.  Mucocutaneous Manifestations",
    "6.  Musculoskeletal & Haematological",
    "7.  Renal — Lupus Nephritis",
    "8.  Cardiopulmonary & Neuropsychiatric",
    "9.  Laboratory Investigations & Autoantibodies",
    "10. Classification Criteria (ACR/EULAR 2019 & SLICC)",
    "11. Disease Activity: SLEDAI",
    "12. Management Principles & Pharmacotherapy",
    "13. Lupus Nephritis Treatment",
    "14. Special Situations (Pregnancy, APS)",
    "15. Complications & Prognosis",
]

# Two columns
col1 = topics[:8]
col2 = topics[8:]

for i, t in enumerate(col1):
    add_text(slide, t, 0.5, 1.35 + i * 0.65, 6.2, 0.6,
             size=14.5, color=DARK_TEXT)

for i, t in enumerate(col2):
    add_text(slide, t, 6.9, 1.35 + i * 0.65, 6.1, 0.6,
             size=14.5, color=DARK_TEXT)

add_rect(slide, 6.7, 1.3, 0.04, 5.9, MID_BLUE)


# ════════════════════════════════════════════════════════════════
# SLIDE 3 — Definition & Epidemiology
# ════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
header_bar(slide, "Definition & Epidemiology")
content_bg(slide)

section_box(slide, "Definition", 0.3, 1.35, 6.2, 2.1, SOFT_BLUE, MID_BLUE, [
    "• Chronic, multisystem autoimmune disease",
    "• Characterised by autoantibody production & immune complex deposition",
    "• Leads to widespread tissue inflammation and organ damage",
    "• Marked by relapsing-remitting course",
], 14)

section_box(slide, "Epidemiology", 0.3, 3.6, 6.2, 3.6, SOFT_BLUE, MID_BLUE, [
    "• Prevalence: 20–150 per 100,000 (varies by ethnicity)",
    "• Incidence: 1–10 per 100,000 per year",
    "• Female : Male ratio  →  9 : 1 (reproductive age)",
    "• Peak onset: 15–45 years",
    "• 3–4× more prevalent in Black & Hispanic women",
    "• Higher severity & lupus nephritis rates in non-White populations",
    "• Childhood SLE (~15–20% of all cases) often more severe",
], 13)

section_box(slide, "Key Facts", 6.7, 1.35, 6.3, 5.85, SOFT_YELLOW,
            RGBColor(0xB7, 0x77, 0x00), [
    "• Bimodal mortality: early = active disease/infections;",
    "  late = CVD & organ damage",
    "• 10-year survival >90% in developed countries",
    "• Leading cause of premature CVD in young women",
    "• Racial disparities: Black women diagnosed younger,",
    "  higher rates of renal & CNS disease",
    "• Genetic predisposition (HLA-DR2, HLA-DR3, complement",
    "  deficiencies C1q, C4A null allele)",
], 13)


# ════════════════════════════════════════════════════════════════
# SLIDE 4 — Etiology & Risk Factors
# ════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
header_bar(slide, "Etiology & Risk Factors")
content_bg(slide)

section_box(slide, "Genetic Factors", 0.3, 1.35, 4.1, 3.0, SOFT_BLUE, MID_BLUE, [
    "• Concordance ~25–50% in monozygotic twins",
    "• HLA-DR2 & HLA-DR3 associations",
    "• C1q, C2, C4A deficiencies → impaired clearance",
    "  of apoptotic debris",
    "• IRF5, STAT4, BLK, PTPN22 polymorphisms",
    "• Type I interferon pathway genes",
], 13)

section_box(slide, "Environmental Triggers", 4.6, 1.35, 4.1, 3.0, SOFT_BLUE, MID_BLUE, [
    "• UV light (photosensitivity, flares)",
    "• Epstein-Barr virus (EBV) — molecular mimicry",
    "• Silica dust exposure",
    "• Smoking (increases risk & severity)",
    "• Medications → drug-induced lupus",
    "  (hydralazine, procainamide, isoniazid, minocycline)",
], 13)

section_box(slide, "Hormonal Factors", 8.9, 1.35, 4.1, 3.0, SOFT_BLUE, MID_BLUE, [
    "• Oestrogen promotes autoimmunity",
    "• Prolactin levels correlate with disease activity",
    "• OCP use → modest risk increase",
    "• Post-menopausal HRT → caution",
    "• Pregnancy: flares common, especially",
    "  in 2nd trimester and postpartum",
], 13)

section_box(slide, "Drug-Induced Lupus — Key Culprits", 0.3, 4.5, 12.7, 2.7,
            SOFT_RED, RED_WARN, [
    "High Risk: Hydralazine, Procainamide, Isoniazid, Minocycline, Methyldopa",
    "Moderate Risk: Chlorpromazine, Quinidine, Diltiazem, Statins",
    "Biologics: Anti-TNF agents (infliximab, etanercept) — can induce anti-dsDNA & anti-histone Abs",
    "Drug-induced SLE: typically anti-histone Abs +ve, anti-dsDNA -ve, renal/CNS rare, reverses on stopping drug",
], 13)


# ════════════════════════════════════════════════════════════════
# SLIDE 5 — Pathogenesis
# ════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
header_bar(slide, "Pathogenesis of SLE")
content_bg(slide)

add_text(slide, "Central Concept: Failure to Maintain Self-Tolerance → Autoantibody Production → Immune Complex Deposition → Tissue Inflammation",
         0.4, 1.28, 12.5, 0.5, size=15, bold=True, color=MID_BLUE)

steps = [
    ("1. Defective Clearance of Apoptotic Cells",
     "Complement deficiency (C1q, C4A) and DNase I defects impair removal of apoptotic debris → nuclear antigens (dsDNA, histones, RNA) become available as autoantigens"),
    ("2. Loss of B & T Cell Tolerance",
     "Autoreactive B cells escape deletion → produce anti-dsDNA, anti-Sm, anti-Ro/La antibodies. TH1/TH17 cells provide costimulatory help to B cells"),
    ("3. Type I Interferon Signature",
     "Plasmacytoid dendritic cells (pDCs) activated by nucleic acid immune complexes → massive IFN-α production → hallmark 'interferon signature' → amplifies autoimmune response"),
    ("4. Immune Complex Deposition",
     "IgG autoantibodies + nuclear antigens form immune complexes → deposit in kidney, skin, joints, choroid plexus → activate complement → C3a, C5a → inflammation & tissue damage"),
    ("5. Complement Activation & Inflammation",
     "Classical pathway activated → membrane attack complex → cell lysis. Complement consumption → low C3, C4, CH50 (marker of activity). Neutrophil NETosis releases more autoantigens — perpetuating cycle"),
]

for i, (title, body) in enumerate(steps):
    y = 1.85 + i * 1.05
    add_rect(slide, 0.3, y, 0.5, 0.85, MID_BLUE)
    add_text(slide, str(i+1), 0.3, y, 0.5, 0.85, size=20, bold=True,
             color=WHITE, align=PP_ALIGN.CENTER)
    add_rect(slide, 0.85, y, 12.1, 0.85, WHITE)
    add_text(slide, title, 0.95, y + 0.02, 4.0, 0.4, size=13, bold=True, color=MID_BLUE)
    add_text(slide, body, 0.95, y + 0.38, 12.0, 0.45, size=12, color=DARK_TEXT, wrap=True)


# ════════════════════════════════════════════════════════════════
# SLIDE 6 — Autoantibodies
# ════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
header_bar(slide, "Autoantibodies in SLE")
content_bg(slide)

add_text(slide, "Autoantibodies are the hallmark of SLE — different antibodies correlate with specific clinical features",
         0.4, 1.28, 12.5, 0.4, size=14, italic=True, color=MID_BLUE)

ab_data = [
    ("ANA (anti-nuclear Ab)", "95–99%", "Screening test; highly sensitive but NOT specific"),
    ("Anti-dsDNA", "70%", "Highly specific; correlates with disease activity & nephritis; useful for monitoring"),
    ("Anti-Sm", "25–30%", "Highly specific for SLE; does NOT correlate with activity"),
    ("Anti-Ro/SSA", "30–40%", "SCLE, neonatal lupus (congenital heart block), Sjögren overlap"),
    ("Anti-La/SSB", "10–20%", "Associated with anti-Ro; neonatal lupus; lower nephritis risk"),
    ("Anti-histone", "50–70%", "Drug-induced lupus; also seen in SLE"),
    ("Anti-phospholipid (aCL, anti-β2GPI, LA)", "20–30%", "Antiphospholipid syndrome: thrombosis, recurrent miscarriage"),
    ("Anti-ribosomal P", "10–20%", "Neuropsychiatric lupus (psychosis, depression)"),
    ("Anti-C1q", "~40%", "Correlates with lupus nephritis activity"),
    ("Low C3, C4, CH50", "—", "Complement consumption = active disease / nephritis"),
]

headers = ["Antibody", "Prevalence", "Clinical Significance"]
col_widths = [3.4, 1.5, 7.6]
col_x = [0.3, 3.75, 5.3]
row_h = 0.43

# Header row
for j, (hdr, w, x) in enumerate(zip(headers, col_widths, col_x)):
    add_rect(slide, x, 1.75, w, 0.4, MID_BLUE)
    add_text(slide, hdr, x + 0.05, 1.77, w - 0.1, 0.36,
             size=13, bold=True, color=WHITE)

for i, (ab, prev, sig) in enumerate(ab_data):
    y = 2.2 + i * row_h
    bg = SOFT_BLUE if i % 2 == 0 else WHITE
    for j, (val, w, x) in enumerate(zip([ab, prev, sig], col_widths, col_x)):
        add_rect(slide, x, y, w, row_h - 0.03, bg)
        add_text(slide, val, x + 0.06, y + 0.02, w - 0.1, row_h - 0.06,
                 size=12, color=DARK_TEXT,
                 bold=(j == 0))


# ════════════════════════════════════════════════════════════════
# SLIDE 7 — Clinical Features Overview
# ════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
header_bar(slide, "Clinical Features — Multisystem Involvement")
content_bg(slide)

systems = [
    ("Mucocutaneous\n90%",       SOFT_BLUE,   MID_BLUE,   0.3,  1.35, 3.0, 2.6,
     ["Malar (butterfly) rash", "Discoid lupus", "Photosensitivity", "Oral ulcers", "SCLE", "Alopecia"]),
    ("Musculoskeletal\n90%",     SOFT_GREEN,  TEAL,       3.5,  1.35, 3.0, 2.6,
     ["Non-erosive arthritis", "Arthralgia/myalgia", "Avascular necrosis", "Jaccoud's arthropathy", "Tendon rupture"]),
    ("Renal\n50–60%",            SOFT_RED,    RED_WARN,   6.7,  1.35, 3.0, 2.6,
     ["Lupus nephritis I–VI", "Proteinuria", "Haematuria", "Hypertension", "Nephrotic syndrome", "ESRD"]),
    ("Haematological\n50–80%",   SOFT_YELLOW, GOLD,       9.9,  1.35, 3.1, 2.6,
     ["Anaemia (haemolytic/chronic)", "Leukopenia/lymphopenia", "Thrombocytopenia", "APS / thrombosis"]),
    ("Cardiopulmonary\n25–60%",  SOFT_BLUE,   MID_BLUE,   0.3,  4.15, 3.0, 3.1,
     ["Pericarditis (most common)", "Myocarditis / Libman-Sacks", "Pleuritis / pleural effusion", "Pneumonitis", "Pulmonary HTN", "Shrinking lung syndrome"]),
    ("Neuropsychiatric\n20–40%", SOFT_GREEN,  TEAL,       3.5,  4.15, 3.0, 3.1,
     ["Headache (most common)", "Cognitive impairment", "Seizures", "Psychosis", "Transverse myelitis", "Peripheral neuropathy", "Cerebrovascular disease"]),
    ("Gastrointestinal\n30–40%", SOFT_YELLOW, GOLD,       6.7,  4.15, 3.0, 3.1,
     ["Nausea / abdominal pain", "Serositis / ascites", "Lupus peritonitis", "Mesenteric vasculitis", "Hepatosplenomegaly"]),
    ("Constitutional\n>90%",     SOFT_RED,    RED_WARN,   9.9,  4.15, 3.1, 3.1,
     ["Fatigue (most common sx)", "Fever (exclude infection!)", "Weight loss", "Lymphadenopathy", "Raynaud's phenomenon"]),
]

for (label, bg, hdr_c, x, y, w, h, items) in systems:
    add_rect(slide, x, y, w, 0.38, hdr_c)
    add_text(slide, label, x + 0.05, y + 0.01, w - 0.1, 0.36,
             size=12, bold=True, color=WHITE)
    add_rect(slide, x, y + 0.38, w, h - 0.38, bg)
    for k, item in enumerate(items):
        add_text(slide, f"• {item}", x + 0.1, y + 0.42 + k * 0.42,
                 w - 0.15, 0.4, size=11.5, color=DARK_TEXT)


# ════════════════════════════════════════════════════════════════
# SLIDE 8 — Mucocutaneous
# ════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
header_bar(slide, "Mucocutaneous Manifestations")
content_bg(slide)

section_box(slide, "Acute Cutaneous LE", 0.3, 1.35, 4.1, 2.9, SOFT_RED, RED_WARN, [
    "• Malar (butterfly) rash — erythema over nose & cheeks",
    "  sparing nasolabial folds",
    "• Sudden onset, may be evanescent",
    "• Correlates with systemic disease activity",
    "• DIF: IgG/C3 deposits at dermoepidermal junction",
    "• Widespread facial erythema or extensor eruption",
], 12.5)

section_box(slide, "Subacute Cutaneous LE (SCLE)", 4.6, 1.35, 4.1, 2.9, SOFT_BLUE, MID_BLUE, [
    "• Photosensitive, non-scarring, widespread",
    "• Papulosquamous (psoriasiform) OR annular polycyclic",
    "• Upper chest, shoulders, extensor arms",
    "• Anti-Ro/SSA antibodies in most patients",
    "• Often drug-induced (hydrochlorothiazide,",
    "  CCBs, PPIs, antifungals)",
], 12.5)

section_box(slide, "Chronic Cutaneous LE — Discoid LE", 8.9, 1.35, 4.1, 2.9, SOFT_GREEN, TEAL, [
    "• Scarring plaques — erythema, scaling, follicular",
    "  plugging, atrophic scarring & dyspigmentation",
    "• Face, scalp (scarring alopecia), ears",
    "• <5% develop systemic disease if isolated DLE",
    "• Anti-dsDNA usually negative",
    "• Treat: antimalarials, topical steroids",
], 12.5)

section_box(slide, "Other Cutaneous Features", 0.3, 4.4, 12.7, 2.85, SOFT_YELLOW, GOLD, [
    "Alopecia: Diffuse (non-scarring, lupus hair — fragile frontal hairs) OR scarring (discoid lesions on scalp)",
    "Oral/nasal ulcers: Usually painless; hard palate involvement is characteristic (vs aphthous ulcers of soft palate)",
    "Photosensitivity: UVB triggers cutaneous AND systemic flares — photoprotection mandatory",
    "Vasculitis: Palpable purpura, periungual erythema, splinter haemorrhages, digital infarcts",
    "Raynaud's phenomenon: 20–30%; may precede diagnosis by years",
], 13)


# ════════════════════════════════════════════════════════════════
# SLIDE 9 — Musculoskeletal & Haematological
# ════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
header_bar(slide, "Musculoskeletal & Haematological Manifestations")
content_bg(slide)

section_box(slide, "Musculoskeletal (90% of patients)", 0.3, 1.35, 6.2, 5.9, SOFT_BLUE, MID_BLUE, [
    "Arthritis / Arthralgia:",
    "• Most common manifestation of SLE",
    "• Symmetrical, migratory, non-erosive polyarthritis",
    "• Jaccoud's arthropathy — reducible ulnar deviation",
    "  (ligament laxity, not bony erosion)",
    "• Morning stiffness <1 hour (vs RA >1 hour)",
    "• X-ray: NO erosions (key differentiator from RA)",
    "",
    "Avascular Necrosis (AVN):",
    "• Femoral head most common",
    "• Risk factors: high-dose steroids, Raynaud's,",
    "  antiphospholipid antibodies",
    "• Screen with MRI if hip pain",
    "",
    "Myopathy / Myositis:",
    "• Proximal muscle weakness, raised CK",
    "• Overlap with inflammatory myopathy",
], 12.5)

section_box(slide, "Haematological (50–80%)", 6.7, 1.35, 6.3, 5.9, SOFT_RED, RED_WARN, [
    "Anaemia:",
    "• Anaemia of chronic disease (most common)",
    "• Autoimmune haemolytic anaemia (AIHA)",
    "  — Coombs +ve, elevated LDH, low haptoglobin",
    "",
    "Leukopenia / Lymphopenia:",
    "• Lymphopenia <1000/μL — correlates with activity",
    "• Leukopenia <4000/μL — part of SLICC/ACR criteria",
    "• Exclude drug effect (azathioprine, MMF)",
    "",
    "Thrombocytopenia:",
    "• Immune-mediated platelet destruction",
    "• May be first presentation (ITP-like)",
    "• Severe <20,000 → bleeding risk",
    "",
    "Antiphospholipid Antibodies:",
    "• 20–30% have APS",
    "• Arterial & venous thrombosis, recurrent pregnancy loss",
    "• Screen ALL SLE patients for aPL",
], 12.5)


# ════════════════════════════════════════════════════════════════
# SLIDE 10 — Renal (Lupus Nephritis)
# ════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
header_bar(slide, "Renal Involvement — Lupus Nephritis")
content_bg(slide)

add_text(slide, "Lupus nephritis (LN) occurs in 50–60% of SLE patients. It is the strongest predictor of poor prognosis. ISN/RPS classification based on renal biopsy.",
         0.4, 1.28, 12.5, 0.45, size=13.5, italic=True, color=MID_BLUE)

classes = [
    ("Class I", "Minimal mesangial LN", "Normal on light microscopy; mesangial deposits on IF/EM", SOFT_GREEN, TEAL),
    ("Class II", "Mesangial proliferative LN", "Mesangial hypercellularity; mesangial deposits only", SOFT_GREEN, TEAL),
    ("Class III", "Focal proliferative LN", "<50% glomeruli involved; subendothelial deposits; haematuria ± proteinuria", SOFT_YELLOW, GOLD),
    ("Class IV", "Diffuse proliferative LN", "≥50% glomeruli; wire-loop lesions; most severe; nephritic + nephrotic", SOFT_RED, RED_WARN),
    ("Class V", "Membranous LN", "Subepithelial deposits; nephrotic syndrome; may coexist with III/IV", SOFT_BLUE, MID_BLUE),
    ("Class VI", "Advanced sclerosing LN", "≥90% global sclerosis; represents end-stage disease", RGBColor(0xF0, 0xF0, 0xF0), DARK_TEXT),
]

col_w = [1.2, 2.8, 7.3]
col_x2 = [0.3, 1.55, 4.4]
row_h2 = 0.72

for j, hdr in enumerate(["Class", "Name", "Key Features"]):
    add_rect(slide, col_x2[j], 1.8, col_w[j], 0.38, MID_BLUE)
    add_text(slide, hdr, col_x2[j]+0.05, 1.82, col_w[j]-0.1, 0.34,
             size=13, bold=True, color=WHITE)

for i, (cls, name, feat, bg, hc) in enumerate(classes):
    y = 2.22 + i * row_h2
    for j, (val, w, x) in enumerate(zip([cls, name, feat], col_w, col_x2)):
        add_rect(slide, x, y, w, row_h2 - 0.04, bg)
        is_bold = (j == 0)
        add_text(slide, val, x+0.06, y+0.04, w-0.1, row_h2-0.1,
                 size=12.5, color=DARK_TEXT, bold=is_bold, wrap=True)

add_text(slide, "⚠  Class IV is the most severe and requires aggressive immunosuppression. Always perform renal biopsy before treating LN.",
         0.3, 6.62, 12.6, 0.5, size=13, bold=True, color=RED_WARN)


# ════════════════════════════════════════════════════════════════
# SLIDE 11 — Cardiopulmonary
# ════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
header_bar(slide, "Cardiopulmonary Manifestations")
content_bg(slide)

section_box(slide, "Cardiac (40–50%)", 0.3, 1.35, 6.2, 5.9, SOFT_BLUE, MID_BLUE, [
    "Pericarditis (most common cardiac manifestation):",
    "• Pericardial friction rub, chest pain, effusion",
    "• ECG: saddle-shaped ST elevation",
    "• Usually mild; rarely tamponade",
    "",
    "Myocarditis:",
    "• Tachycardia, CCF, arrhythmias",
    "• Echo: impaired LV function",
    "• Responds to steroids",
    "",
    "Libman-Sacks Endocarditis:",
    "• Sterile, verrucous vegetations on BOTH sides of mitral valve",
    "• Associated with APS",
    "• Risk of embolic events, valve regurgitation",
    "",
    "Accelerated Atherosclerosis:",
    "• Major cause of late mortality",
    "• 2–10× higher CAD risk vs age-matched controls",
    "• Chronic inflammation + steroids + dyslipidaemia",
], 12)

section_box(slide, "Pulmonary (25–50%)", 6.7, 1.35, 6.3, 5.9, SOFT_GREEN, TEAL, [
    "Pleuritis / Pleural Effusion (most common):",
    "• Exudative; bilateral or unilateral",
    "• Sharp pleuritic chest pain",
    "",
    "Acute Lupus Pneumonitis:",
    "• Fever, cough, haemoptysis, dyspnoea",
    "• Must exclude infection (BAL, cultures)",
    "• High-dose steroids",
    "",
    "Diffuse Alveolar Haemorrhage (DAH):",
    "• Life-threatening; haemoptysis ± drop in Hb",
    "• Anti-dsDNA ↑, complement ↓",
    "• Requires pulse methylprednisolone ± cyclophosphamide",
    "",
    "Shrinking Lung Syndrome:",
    "• Reduced lung volumes without parenchymal disease",
    "• Diaphragmatic myopathy / pleurophrenic dysfunction",
    "",
    "Pulmonary Arterial Hypertension:",
    "• Occurs in ~10%; associated with APS, Raynaud's",
], 12)


# ════════════════════════════════════════════════════════════════
# SLIDE 12 — Neuropsychiatric SLE
# ════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
header_bar(slide, "Neuropsychiatric SLE (NPSLE)")
content_bg(slide)

add_text(slide, "ACR defines 19 NPSLE syndromes — affects 20–40% of patients. Pathogenesis: autoantibodies, vasculopathy, emboli from Libman-Sacks, complement activation.",
         0.4, 1.28, 12.5, 0.45, size=13.5, italic=True, color=MID_BLUE)

section_box(slide, "CNS Manifestations", 0.3, 1.82, 6.2, 5.4, SOFT_BLUE, MID_BLUE, [
    "• Headache — most common; migraine-type",
    "• Cognitive dysfunction / brain fog — very common",
    "• Seizures — focal or generalised (anti-ribosomal P, aPL)",
    "• Acute confusional state / delirium",
    "• Cerebrovascular disease — stroke (often APS-mediated)",
    "• Transverse myelitis — longitudinally extensive",
    "• Aseptic meningitis",
    "• Chorea — associated with aPL antibodies",
    "• Lupus psychosis — anti-ribosomal P antibodies",
    "• Mood disorders: depression, anxiety (very common)",
    "• Demyelinating syndrome (MS-like)",
], 13)

section_box(slide, "Peripheral Nervous System", 6.7, 1.82, 6.3, 2.5, SOFT_GREEN, TEAL, [
    "• Peripheral polyneuropathy (sensorimotor)",
    "• Mononeuritis multiplex",
    "• Cranial neuropathies (II, V, VII most common)",
    "• Autonomic neuropathy",
    "• Guillain-Barré syndrome (rare)",
], 13)

section_box(slide, "Workup for NPSLE", 6.7, 4.47, 6.3, 2.75, SOFT_YELLOW, GOLD, [
    "• MRI brain (white matter hyperintensities, infarcts)",
    "• EEG (seizure workup)",
    "• CSF: mild pleocytosis, elevated protein",
    "• Neuropsychological testing",
    "• Screen for APS (aCL, anti-β2GPI, LA)",
    "• Exclude infection, metabolic causes",
    "• Anti-ribosomal P for psychosis",
], 13)


# ════════════════════════════════════════════════════════════════
# SLIDE 13 — Lab Investigations
# ════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
header_bar(slide, "Laboratory Investigations")
content_bg(slide)

section_box(slide, "Routine Bloods", 0.3, 1.35, 4.0, 5.9, SOFT_BLUE, MID_BLUE, [
    "FBC:",
    "• Anaemia (AIHA or ACD)",
    "• Leukopenia, lymphopenia",
    "• Thrombocytopenia",
    "",
    "Biochemistry:",
    "• Urea, Creatinine, eGFR",
    "• LFTs (hepatitis, AST/ALT elevation)",
    "• Urinalysis + microscopy",
    "• 24-hr urine protein OR PCR",
    "• LDH (haemolysis), haptoglobin",
    "",
    "Inflammatory:",
    "• CRP: usually LOW (unless serositis/infection)",
    "• ESR: often elevated",
    "• Note: elevated CRP in SLE → think infection!",
], 12.5)

section_box(slide, "Serological Tests", 4.5, 1.35, 4.5, 5.9, SOFT_GREEN, TEAL, [
    "Screening:",
    "• ANA (titre ≥1:80 by IIF) — >95% sensitive",
    "• If ANA +ve → reflex to specific antibodies",
    "",
    "Specific Antibodies:",
    "• Anti-dsDNA — specific, activity marker",
    "• Anti-Sm — specific, not for monitoring",
    "• Anti-Ro/SSA, Anti-La/SSB",
    "• Anti-histone (drug-induced)",
    "• Anti-ribosomal P (NPSLE)",
    "• Anti-C1q (nephritis activity)",
    "",
    "Antiphospholipid Panel:",
    "• Lupus anticoagulant (LA)",
    "• Anticardiolipin IgG/IgM",
    "• Anti-β2-glycoprotein I IgG/IgM",
    "",
    "Complement:",
    "• C3, C4, CH50 — low = active disease",
], 12.5)

section_box(slide, "Monitoring Parameters", 9.2, 1.35, 3.8, 5.9, SOFT_YELLOW, GOLD, [
    "For Disease Activity:",
    "• Anti-dsDNA titres",
    "• Complement C3, C4",
    "• Urinalysis (proteinuria, RBC casts)",
    "",
    "Organ-Specific:",
    "• Renal: eGFR, PCR, biopsy",
    "• Cardiac: Echo, ECG",
    "• Pulmonary: PFTs, HRCT",
    "• Ocular: hydroxychloroquine toxicity",
    "  screening (Humphrey visual field)",
    "",
    "Drug Monitoring:",
    "• Azathioprine: FBC, LFTs",
    "  TPMT genotype before starting",
    "• MMF: FBC, LFTs",
    "• Cyclophosphamide: FBC, UA",
    "• Belimumab: infection screen",
], 12.5)


# ════════════════════════════════════════════════════════════════
# SLIDE 14 — Classification Criteria (2019 ACR/EULAR)
# ════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
header_bar(slide, "2019 ACR/EULAR Classification Criteria for SLE")
content_bg(slide)

add_text(slide, "Entry criterion: ANA ≥1:80 (HEp-2 cells) at least once. Then score ≥10 points to classify as SLE.",
         0.4, 1.28, 12.5, 0.42, size=14.5, bold=True, color=RED_WARN)

criteria_data = [
    ("Constitutional", "Fever", "2"),
    ("Haematological", "Leukopenia (<4000/μL)", "3"),
    ("Haematological", "Thrombocytopenia (<100,000/μL)", "4"),
    ("Haematological", "Autoimmune haemolysis", "4"),
    ("Neuropsychiatric", "Delirium", "2"),
    ("Neuropsychiatric", "Psychosis", "3"),
    ("Neuropsychiatric", "Seizure", "5"),
    ("Mucocutaneous", "Non-scarring alopecia", "2"),
    ("Mucocutaneous", "Oral ulcers", "2"),
    ("Mucocutaneous", "SCLE or discoid rash", "4"),
    ("Mucocutaneous", "Acute cutaneous lupus (malar rash)", "6"),
    ("Serosal", "Pleural or pericardial effusion", "5"),
    ("Serosal", "Acute pericarditis", "6"),
    ("Musculoskeletal", "Joint involvement (≥2 joints)", "6"),
    ("Renal", "Proteinuria >500 mg/24h", "4"),
    ("Renal", "Biopsy: class II or V LN", "8"),
    ("Renal", "Biopsy: class III or IV LN", "10"),
    ("Immunological", "Anti-dsDNA OR Anti-Sm positive", "6"),
    ("Immunological", "Antiphospholipid antibodies", "2"),
    ("Immunological", "Complement low (C3 OR C4 low)", "3 / 4"),
    ("Immunological", "Direct Coombs test (no haemolysis)", "1"),
]

col_headers = ["Domain", "Criterion", "Points"]
cwl = [2.8, 6.5, 1.5]
cxl = [0.3, 3.15, 9.7]

for j, (hdr, w, x) in enumerate(zip(col_headers, cwl, cxl)):
    add_rect(slide, x, 1.78, w, 0.35, MID_BLUE)
    add_text(slide, hdr, x+0.06, 1.8, w-0.1, 0.31, size=13, bold=True, color=WHITE)

rh3 = 0.245
for i, (dom, crit, pts) in enumerate(criteria_data):
    y3 = 2.16 + i * rh3
    bg = SOFT_BLUE if i % 2 == 0 else WHITE
    for j, (val, w, x) in enumerate(zip([dom, crit, pts], cwl, cxl)):
        add_rect(slide, x, y3, w, rh3-0.02, bg)
        add_text(slide, val, x+0.06, y3+0.01, w-0.1, rh3-0.04,
                 size=11, color=DARK_TEXT, bold=(j == 2))

add_text(slide, "Sensitivity 96.1% | Specificity 93.4%  (Aringer et al., A&R 2019)",
         0.3, 7.22, 12.6, 0.25, size=11, italic=True, color=MID_BLUE)


# ════════════════════════════════════════════════════════════════
# SLIDE 15 — SLICC Criteria
# ════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
header_bar(slide, "SLICC 2012 Classification Criteria")
content_bg(slide)

add_text(slide, "Satisfy ≥4 criteria (at least 1 clinical + 1 immunological)  OR  biopsy-proven LN + ANA or anti-dsDNA positive",
         0.4, 1.28, 12.5, 0.42, size=14, bold=True, color=RED_WARN)

section_box(slide, "Clinical Criteria (11 items)", 0.3, 1.82, 6.2, 5.4, SOFT_BLUE, MID_BLUE, [
    "1. Acute cutaneous lupus (includes malar rash)",
    "2. Chronic cutaneous lupus (discoid, verrucous, etc.)",
    "3. Oral or nasal ulcers (painless)",
    "4. Non-scarring alopecia",
    "5. Synovitis ≥2 joints OR joint tenderness + morning stiffness",
    "6. Serositis (pleuritis or pericarditis)",
    "7. Renal (proteinuria ≥500 mg/day OR RBC casts)",
    "8. Neurological (seizures, psychosis, mononeuritis multiplex,",
    "   myelitis, neuropathy, acute confusional state)",
    "9. Haemolytic anaemia",
    "10. Leukopenia <4000/μL OR Lymphopenia <1000/μL",
    "11. Thrombocytopenia <100,000/μL",
], 13)

section_box(slide, "Immunological Criteria (6 items)", 6.7, 1.82, 6.3, 5.4, SOFT_GREEN, TEAL, [
    "1. ANA — above reference range",
    "2. Anti-dsDNA — above reference range",
    "3. Anti-Sm — positive",
    "4. Antiphospholipid antibody:",
    "   Lupus anticoagulant, false +ve RPR,",
    "   Anti-cardiolipin IgG/IgM, anti-β2GPI IgG/IgM",
    "5. Low complement (C3 OR C4 OR CH50)",
    "6. Direct Coombs test (without haemolytic anaemia)",
    "",
    "Sensitivity 97% | Specificity 84%",
    "",
    "Note: SLICC is better for early/incomplete SLE;",
    "ACR/EULAR 2019 has higher specificity",
], 13)


# ════════════════════════════════════════════════════════════════
# SLIDE 16 — SLEDAI Disease Activity
# ════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
header_bar(slide, "Measuring Disease Activity — SLEDAI")
content_bg(slide)

add_text(slide, "SLEDAI (SLE Disease Activity Index) — 24-item validated tool. Maximum score 105 (rarely >20 clinically). Scores >4 indicate active disease.",
         0.4, 1.28, 12.5, 0.42, size=13.5, italic=True, color=MID_BLUE)

sledai_items = [
    ("8 pts each", "Seizure, Psychosis, Organic Brain Syndrome, Visual disturbance, Cranial nerve disorder, Lupus headache, CVA, Vasculitis"),
    ("4 pts each", "Arthritis, Myositis, Urinary casts, Haematuria, Proteinuria, Pyuria"),
    ("2 pts each", "New rash, Alopecia, Mucosal ulcers, Pleurisy, Pericarditis, Low complement, Increased anti-dsDNA"),
    ("1 pt each",  "Fever, Thrombocytopenia, Leukopenia"),
]

y_start = 1.82
for pts, items in sledai_items:
    add_rect(slide, 0.3, y_start, 2.2, 0.95, MID_BLUE)
    add_text(slide, pts, 0.35, y_start + 0.22, 2.1, 0.5,
             size=16, bold=True, color=WHITE, align=PP_ALIGN.CENTER)
    add_rect(slide, 2.55, y_start, 10.45, 0.95, SOFT_BLUE)
    add_text(slide, items, 2.65, y_start + 0.08, 10.25, 0.82,
             size=13, color=DARK_TEXT, wrap=True)
    y_start += 1.05

section_box(slide, "SLEDAI Score Interpretation", 0.3, 6.1, 12.7, 1.18,
            SOFT_YELLOW, GOLD, [
    "0 = No activity  |  1–5 = Mild  |  6–10 = Moderate  |  11–19 = High  |  ≥20 = Very high",
    "Clinical remission defined as SLEDAI-2K = 0 on stable/no therapy (DORIS definition)",
    "Low disease activity target: SLEDAI-2K ≤4 on hydroxychloroquine ± prednisolone ≤7.5 mg/day",
], 13)


# ════════════════════════════════════════════════════════════════
# SLIDE 17 — Management Principles
# ════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
header_bar(slide, "Management Principles")
content_bg(slide)

add_text(slide, "Goals: Achieve remission or low disease activity | Prevent organ damage | Minimise treatment toxicity | Improve quality of life",
         0.4, 1.28, 12.5, 0.42, size=14, bold=True, color=MID_BLUE)

section_box(slide, "General Measures (All Patients)", 0.3, 1.82, 12.7, 1.5, SOFT_BLUE, MID_BLUE, [
    "• Sunscreen (SPF ≥50) + photoprotection — mandatory for ALL patients",
    "• Smoking cessation | Exercise | Vitamin D + Calcium supplementation (with steroids)",
    "• Vaccinations: Influenza (yearly), Pneumococcal, COVID-19, HBV — avoid live vaccines if immunosuppressed",
    "• CVD risk reduction: BP control, statins, aspirin (if APS), weight management",
], 13)

section_box(slide, "Hydroxychloroquine (HCQ) — Cornerstone", 0.3, 3.45, 12.7, 1.85,
            SOFT_GREEN, TEAL, [
    "• Indicated in ALL SLE patients without contraindication (Level 1A evidence)",
    "• Dose: 5 mg/kg/day (≤400 mg/day) — reduce dose if eGFR <30",
    "• Benefits: Reduces flares, organ damage, thrombosis, infections, CVD; improves survival",
    "• Monitoring: Annual ophthalmology from year 5 (Humphrey visual field + SD-OCT)",
    "• Key drug interactions: QT-prolonging drugs",
    "• Should be continued in pregnancy (reduces congenital heart block risk in anti-Ro +ve mothers)",
], 13)

section_box(slide, "Glucocorticoids", 0.3, 5.42, 6.1, 1.85, SOFT_RED, RED_WARN, [
    "• Short-term: control acute flares",
    "• Prednisolone: lowest effective dose",
    "• Pulse IV methylprednisolone for severe disease",
    "  (1g/day × 3 days)",
    "• Target: ≤7.5 mg/day (steroid sparing strategy)",
    "• Toxicity: osteoporosis, AVN, DM, infection,",
    "  cataracts — minimise exposure",
], 13)

section_box(slide, "NSAIDs & Analgesics", 6.55, 5.42, 6.45, 1.85, SOFT_YELLOW, GOLD, [
    "• For arthralgia, serositis, fever",
    "• Use with caution: renal impairment, CV risk",
    "• Avoid in lupus nephritis",
    "• Paracetamol: safe first-line analgesic",
    "• Topical NSAIDs / weak opioids for refractory pain",
    "• Belimumab reduces steroid requirement",
], 13)


# ════════════════════════════════════════════════════════════════
# SLIDE 18 — Immunosuppressants
# ════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
header_bar(slide, "Immunosuppressive Therapy")
content_bg(slide)

drugs = [
    ("Azathioprine\n(AZA)", "2–3 mg/kg/day", "Maintenance LN; non-renal SLE; pregnancy-safe", "Check TPMT genotype first; FBC + LFTs monthly; avoid allopurinol (xanthine oxidase)", SOFT_BLUE, MID_BLUE),
    ("Mycophenolate\nMofetil (MMF)", "2–3 g/day", "Induction + maintenance LN (Class III/IV/V); non-inferior to CYC; better tolerated", "Teratogenic — avoid pregnancy; FBC + LFTs; GI side effects", SOFT_GREEN, TEAL),
    ("Cyclophosphamide\n(CYC)", "IV 0.5–1g/m² monthly × 6 or low-dose Euro-Lupus regimen", "Severe LN (Class III/IV), CNS lupus, DAH, severe vasculitis", "Haemorrhagic cystitis (mesna prophylaxis), gonadotoxicity, infections, malignancy; bladder irrigation", SOFT_RED, RED_WARN),
    ("Methotrexate\n(MTX)", "7.5–25 mg/week", "Skin and joint disease; corticosteroid sparing", "Hepatotoxicity, pneumonitis, folate supplementation required; teratogenic", SOFT_YELLOW, GOLD),
    ("Calcineurin\nInhibitors", "Tacrolimus / Ciclosporin", "Membranous LN (Class V), multitarget therapy (MMF + tacrolimus)", "Nephrotoxicity, HTN, DM (tacrolimus), drug monitoring essential", SOFT_BLUE, MID_BLUE),
    ("Belimumab\n(Biologic)", "10 mg/kg IV monthly or 200 mg SC weekly", "Moderate-severe non-renal SLE despite HCQ + steroids; also approved for active LN", "Infections, depression/suicidality, hypersensitivity reactions; avoid in active CNS lupus", SOFT_GREEN, TEAL),
]

rh4 = 0.915
for i, (drug, dose, indication, toxicity, bg, hc) in enumerate(drugs):
    y = 1.35 + i * rh4
    add_rect(slide, 0.3, y, 2.0, rh4-0.04, hc)
    add_text(slide, drug, 0.35, y+0.08, 1.9, rh4-0.16, size=12.5, bold=True, color=WHITE, wrap=True)
    add_rect(slide, 2.35, y, 2.0, rh4-0.04, bg)
    add_text(slide, dose, 2.4, y+0.05, 1.9, rh4-0.12, size=11.5, color=DARK_TEXT, wrap=True)
    add_rect(slide, 4.4, y, 4.2, rh4-0.04, bg)
    add_text(slide, indication, 4.45, y+0.05, 4.1, rh4-0.12, size=11.5, color=DARK_TEXT, wrap=True)
    add_rect(slide, 8.65, y, 4.35, rh4-0.04, SOFT_RED if i in [2] else bg)
    add_text(slide, toxicity, 8.7, y+0.05, 4.25, rh4-0.12, size=11, color=DARK_TEXT, wrap=True)

# Headers
for hdr, x, w in [("Drug", 0.3, 2.0), ("Dose", 2.35, 2.0), ("Indication", 4.4, 4.2), ("Key Toxicities", 8.65, 4.35)]:
    add_rect(slide, x, 1.2, w, 0.38, DEEP_NAVY)
    add_text(slide, hdr, x+0.06, 1.22, w-0.1, 0.34, size=13, bold=True, color=WHITE)


# ════════════════════════════════════════════════════════════════
# SLIDE 19 — Biologics & Novel Therapies
# ════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
header_bar(slide, "Biologic & Emerging Therapies")
content_bg(slide)

section_box(slide, "Approved Biologics", 0.3, 1.35, 6.2, 4.4, SOFT_BLUE, MID_BLUE, [
    "Belimumab (anti-BLyS/BAFF):",
    "• FDA/EMA approved for SLE (2011) & LN (2020)",
    "• Reduces B cell survival & autoantibody production",
    "• Reduces flares by ~50%, allows steroid tapering",
    "• IV: 10 mg/kg monthly; SC: 200 mg weekly",
    "",
    "Anifrolumab (anti-IFN receptor):",
    "• Blocks type I interferon receptor",
    "• FDA approved 2021 for moderate-severe SLE",
    "• Targets the interferon signature",
    "• Reduces skin and joint disease effectively",
    "",
    "Voclosporin:",
    "• Calcineurin inhibitor — approved for LN (2021)",
    "• Used in triple therapy (MMF + low-dose steroid)",
], 12.5)

section_box(slide, "Emerging / Pipeline Therapies", 6.7, 1.35, 6.3, 4.4, SOFT_GREEN, TEAL, [
    "CAR-T Cell Therapy (2024–2026 data):",
    "• Anti-CD19 CAR-T for refractory SLE",
    "• Early trials show deep remission",
    "• Systematic review 2025: 47 patients, high response rate",
    "• Potential for drug-free remission",
    "",
    "Obinutuzumab (anti-CD20):",
    "• More potent than rituximab",
    "• Trials in LN showing benefit",
    "",
    "Dapirolizumab pegol (anti-CD40L):",
    "• Inhibits CD40-CD40L costimulation",
    "• Phase III trials ongoing",
    "",
    "Ustekinumab (anti-IL12/IL23):",
    "• Showed benefit in phase II SLE trial",
], 12.5)

section_box(slide, "Treatment Algorithm Summary", 0.3, 5.9, 12.7, 1.38, SOFT_YELLOW, GOLD, [
    "Mild SLE: HCQ ± NSAIDs ± low-dose prednisolone",
    "Moderate SLE: HCQ + MTX or AZA + steroids; consider belimumab if refractory",
    "Severe/Organ-threatening: HCQ + pulse steroids + CYC or MMF + biologic (belimumab/anifrolumab)",
    "Refractory: Rituximab, CAR-T (experimental), clinical trials",
], 13)


# ════════════════════════════════════════════════════════════════
# SLIDE 20 — Lupus Nephritis Treatment
# ════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
header_bar(slide, "Treatment of Lupus Nephritis")
content_bg(slide)

add_text(slide, "All LN patients: HCQ + ACE inhibitor/ARB (BP <130/80) + statins. Renal biopsy guides treatment class.",
         0.4, 1.28, 12.5, 0.42, size=13.5, bold=True, color=MID_BLUE)

section_box(slide, "Class I & II — Minimal / Mesangial", 0.3, 1.82, 4.0, 2.15, SOFT_GREEN, TEAL, [
    "• No immunosuppression required for I & II",
    "• Class I: supportive care",
    "• Class II with significant proteinuria:",
    "  low-dose prednisone ± HCQ",
    "• Monitor 3–6 monthly",
], 12.5)

section_box(slide, "Class III & IV — Focal/Diffuse Proliferative\n(Most Aggressive Treatment)", 4.5, 1.82, 5.0, 2.15, SOFT_RED, RED_WARN, [
    "INDUCTION (6 months):",
    "• MMF 2–3 g/day + pulse steroids, OR",
    "• Low-dose CYC (Euro-Lupus) + steroids",
    "• Add voclosporin for higher response",
    "MAINTENANCE:",
    "• MMF 1–2 g/day OR AZA 2 mg/kg/day",
], 12.5)

section_box(slide, "Class V — Membranous LN", 9.7, 1.82, 3.3, 2.15, SOFT_BLUE, MID_BLUE, [
    "• If isolated: ACE-I/ARB + HCQ",
    "• If nephrotic: MMF ± steroids",
    "  OR tacrolimus ± MMF (multitarget)",
    "• If with III/IV: treat as III/IV",
], 12.5)

section_box(slide, "Induction Options — Evidence Summary", 0.3, 4.1, 12.7, 1.65, SOFT_YELLOW, GOLD, [
    "Euro-Lupus CYC: 500 mg IV × 6 fortnightly doses (less gonadotoxicity vs NIH protocol; non-inferior in European cohorts)",
    "NIH CYC: 0.5–1 g/m² monthly × 6 doses (preferred in severe LN, AA & Hispanic patients with higher risk)",
    "MMF: 2–3 g/day — equal efficacy to CYC for induction; preferred in women of childbearing potential",
    "Voclosporin (Lupkynis) + MMF + low-dose steroids: AURORA trial — superior complete renal response vs standard",
    "Belimumab + standard therapy (BLISS-LN 2020): reduced renal events in Class III/IV and V LN",
], 12.5)

add_text(slide, "TREAT-TO-TARGET in LN: Complete renal response defined as proteinuria <0.5 g/day + stable eGFR within 12 months",
         0.3, 5.9, 12.6, 0.5, size=13, bold=True, color=RED_WARN)


# ════════════════════════════════════════════════════════════════
# SLIDE 21 — Pregnancy & SLE
# ════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
header_bar(slide, "SLE & Pregnancy")
content_bg(slide)

section_box(slide, "Pre-Pregnancy Counselling", 0.3, 1.35, 4.0, 5.9, SOFT_BLUE, MID_BLUE, [
    "• Ideally plan pregnancy during",
    "  sustained remission ≥6 months",
    "• Avoid active LN at conception",
    "• Switch teratogenic drugs:",
    "  MMF → AZA",
    "  MTX → AZA or HCQ",
    "  CYC → contraindicated",
    "• Continue HCQ throughout",
    "• Check aPL, anti-Ro/La antibodies",
    "• Baseline renal function, BP",
    "• Low-dose aspirin from week 12",
    "  to reduce pre-eclampsia risk",
], 13)

section_box(slide, "Maternal Risks", 4.5, 1.35, 4.2, 5.9, SOFT_RED, RED_WARN, [
    "Disease Flares:",
    "• Occur in 25–65% of pregnancies",
    "• Often in 2nd trimester + postpartum",
    "",
    "Obstetric Complications:",
    "• Pre-eclampsia (3–5× higher risk)",
    "• Preterm birth",
    "• IUGR / FGR",
    "• Recurrent pregnancy loss (APS)",
    "• Maternal mortality increased",
    "",
    "APS in Pregnancy:",
    "• Triple-positive aPL = highest risk",
    "• LMWH + low-dose aspirin standard",
    "• Catastrophic APS: plasma exchange",
    "  + anticoagulation + steroids",
], 13)

section_box(slide, "Fetal/Neonatal Risks", 8.9, 1.35, 4.1, 5.9, SOFT_YELLOW, GOLD, [
    "Neonatal Lupus:",
    "• Anti-Ro/SSA antibodies cross placenta",
    "• Transient skin rash, cytopenias, LFTs",
    "• Congenital complete heart block (1–2%):",
    "  - Irreversible; 3rd degree AV block",
    "  - Surveillance echo 16–26 weeks",
    "  - If PR prolonged: dexamethasone",
    "  - Most need pacemaker at birth",
    "",
    "• HCQ reduces recurrence risk of",
    "  heart block in subsequent pregnancies",
    "",
    "Safe Drugs in Pregnancy:",
    "• HCQ ✓, AZA ✓, Prednisolone ✓",
    "• NSAIDs: avoid 3rd trimester",
    "• ACE-I/ARBs: STOP in pregnancy",
], 13)


# ════════════════════════════════════════════════════════════════
# SLIDE 22 — Antiphospholipid Syndrome
# ════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
header_bar(slide, "Antiphospholipid Syndrome (APS) in SLE")
content_bg(slide)

section_box(slide, "Definition & Criteria", 0.3, 1.35, 6.2, 3.3, SOFT_BLUE, MID_BLUE, [
    "Clinical Criteria:",
    "• ≥1 episode of arterial, venous, or",
    "  small vessel thrombosis, OR",
    "• ≥1 unexplained fetal death ≥10 weeks,",
    "  OR ≥3 unexplained embryo losses <10 wks,",
    "  OR premature birth due to eclampsia/IUGR",
    "",
    "Lab Criteria (positive on 2 occasions ≥12 wks apart):",
    "• Lupus anticoagulant (LA) — strongest risk",
    "• Anticardiolipin IgG/IgM ≥40 GPL/MPL",
    "• Anti-β2-glycoprotein I IgG/IgM ≥99th percentile",
    "Triple positive (all 3) = highest thrombotic risk",
], 13)

section_box(slide, "Clinical Features", 0.3, 4.78, 6.2, 2.48, SOFT_RED, RED_WARN, [
    "Thrombotic: DVT, PE, stroke, TIA, MI, hepatic vein thrombosis",
    "Obstetric: recurrent miscarriage, stillbirth, IUGR, pre-eclampsia",
    "Other: livedo reticularis, thrombocytopenia, valvular disease",
    "  (Libman-Sacks), adrenal insufficiency (adrenal haemorrhage)",
    "Catastrophic APS (CAPS): ≥3 organs in <1 week — mortality >50%",
], 12.5)

section_box(slide, "Management", 6.7, 1.35, 6.3, 5.9, SOFT_GREEN, TEAL, [
    "Primary Prevention (no thrombosis yet, aPL +ve):",
    "• HCQ + low-dose aspirin",
    "• Aggressive CVD risk factor management",
    "",
    "Secondary Prevention (after thrombosis):",
    "• Warfarin: INR 2–3 (venous) or 3–4 (arterial)",
    "• LMWH: preferred in pregnancy",
    "• Direct oral anticoagulants (DOACs):",
    "  Rivaroxaban inferior to warfarin in APS",
    "  — AVOID in triple-positive APS",
    "",
    "Obstetric APS:",
    "• LMWH + low-dose aspirin throughout pregnancy",
    "• Continue for 6 weeks postpartum",
    "",
    "CAPS:",
    "• Anticoagulation + steroids + plasma exchange",
    "• ± IVIG + rituximab in refractory cases",
    "• ICU management; mortality remains high",
], 13)


# ════════════════════════════════════════════════════════════════
# SLIDE 23 — Complications & Damage
# ════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
header_bar(slide, "Complications, Organ Damage & Prognosis")
content_bg(slide)

section_box(slide, "Causes of Death in SLE", 0.3, 1.35, 4.0, 5.9, SOFT_RED, RED_WARN, [
    "Early mortality (within 5 years):",
    "• Active SLE (nephritis, DAH, CNS)",
    "• Infections (opportunistic: PCP,",
    "  CMV, fungal — often treatment-related)",
    "• APS/thrombosis",
    "",
    "Late mortality (>5 years):",
    "• Cardiovascular disease (MI, stroke)",
    "• Infection (chronic immunosuppression)",
    "• Malignancy (lymphoma, cervical ca.)",
    "• Renal failure (ESRD from LN)",
    "",
    "Overall: 10-year survival >90%",
    "   in developed countries",
    "Worse prognosis: renal disease,",
    "   Black race, male, early onset,",
    "   APS, hypertension, high damage",
], 12.5)

section_box(slide, "SLICC/ACR Damage Index (SDI)", 4.5, 1.35, 4.0, 5.9, SOFT_YELLOW, GOLD, [
    "• Measures IRREVERSIBLE organ damage",
    "• Score ≥1 = damage present",
    "• Damage accrues with time & disease",
    "",
    "Domains assessed (selected):",
    "• Ocular: cataracts, retinal damage",
    "• Neuropsychiatric: cognitive impairment,",
    "  TIA/stroke, peripheral neuropathy",
    "• Renal: eGFR <50%, ESRD",
    "• Pulmonary: pulmonary HTN, fibrosis",
    "• Cardiovascular: MI, angina, cardiomyopathy",
    "• Peripheral vascular: claudication, gangrene",
    "• Gastrointestinal: splenic infarction",
    "• Musculoskeletal: AVN, osteoporotic fracture",
    "• Skin: scarring alopecia",
    "• Gonadal failure (cyclophosphamide)",
], 12.5)

section_box(slide, "Long-Term Management Goals", 8.7, 1.35, 4.3, 5.9, SOFT_BLUE, MID_BLUE, [
    "Targets:",
    "• SLEDAI ≤4 (low disease activity)",
    "• Prednisolone ≤7.5 mg/day",
    "• No new organ damage (SDI stable)",
    "• HRQoL optimisation",
    "",
    "Monitoring Schedule:",
    "• 3-monthly: bloods, urine, BP, SLEDAI",
    "• 6-monthly: complement, anti-dsDNA",
    "• Annual: ophthalmology (HCQ screen),",
    "  DEXA (fracture risk), lipid profile,",
    "  cervical smear, BP",
    "",
    "Patient education:",
    "• Sun protection",
    "• Medication adherence (HCQ!)",
    "• Contraception if on teratogens",
    "• Flare recognition & when to seek care",
], 12.5)


# ════════════════════════════════════════════════════════════════
# SLIDE 24 — Differential Diagnosis
# ════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
header_bar(slide, "Differential Diagnosis")
content_bg(slide)

diffs = [
    ("Rheumatoid Arthritis", "Erosive synovitis, RF/anti-CCP +ve, no dsDNA, no renal disease", SOFT_BLUE, MID_BLUE),
    ("Sjögren's Syndrome", "Sicca symptoms, anti-Ro/La +ve, overlap common; SCLE-like lesions", SOFT_GREEN, TEAL),
    ("Mixed Connective Tissue Disease", "Anti-U1RNP antibodies, features of SLE/SSc/myositis overlap, pulmonary HTN", SOFT_YELLOW, GOLD),
    ("Viral Infections", "EBV, parvovirus B19, CMV — cause ANA +ve, arthralgia, cytopenias; usually self-limiting", SOFT_RED, RED_WARN),
    ("Drug-Induced Lupus", "Anti-histone Abs, anti-dsDNA -ve, renal/CNS rare, resolves on stopping drug", SOFT_BLUE, MID_BLUE),
    ("Vasculitis", "ANCA-associated (GPA, MPA) — pulmonary-renal, p/c-ANCA; distinguish from LN/DAH in SLE", SOFT_GREEN, TEAL),
    ("Antiphospholipid Syndrome", "May occur without SLE; thrombosis + obstetric history + aPL antibodies", SOFT_YELLOW, GOLD),
    ("Adult Still's Disease", "Quotidian fever, salmon-coloured rash, arthritis, high ferritin; ANA -ve", SOFT_RED, RED_WARN),
    ("Sarcoidosis", "Multi-system, granulomatous; ANA may be +ve; CXR hilar adenopathy; ACE elevated", SOFT_BLUE, MID_BLUE),
    ("Thrombotic Microangiopathy", "TTP/HUS — thrombocytopenia + microangiopathic haemolysis; overlap with severe SLE/APS", SOFT_GREEN, TEAL),
]

col_w2 = [3.5, 9.0]
col_x3 = [0.3, 3.9]
rh5 = 0.508

add_rect(slide, 0.3, 1.82, 3.5, 0.36, MID_BLUE)
add_text(slide, "Diagnosis", 0.36, 1.84, 3.4, 0.30, size=13, bold=True, color=WHITE)
add_rect(slide, 3.9, 1.82, 9.0, 0.36, MID_BLUE)
add_text(slide, "Key Distinguishing Features", 3.96, 1.84, 8.9, 0.30, size=13, bold=True, color=WHITE)

for i, (diag, feat, bg, hc) in enumerate(diffs):
    y = 2.22 + i * rh5
    add_rect(slide, 0.3, y, 3.5, rh5-0.03, hc)
    add_text(slide, diag, 0.36, y+0.04, 3.4, rh5-0.1, size=12, bold=True, color=WHITE, wrap=True)
    add_rect(slide, 3.9, y, 9.0, rh5-0.03, bg)
    add_text(slide, feat, 3.96, y+0.04, 8.85, rh5-0.1, size=12, color=DARK_TEXT, wrap=True)


# ════════════════════════════════════════════════════════════════
# SLIDE 25 — Clinical Pearls & High-Yield Summary
# ════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
header_bar(slide, "High-Yield Clinical Pearls")
content_bg(slide)

pearls = [
    ("ANA", "ANA is SENSITIVE (>95%), NOT specific. Always follow up with anti-dsDNA, anti-Sm for specificity"),
    ("Anti-dsDNA", "Anti-dsDNA titres and complement (C3/C4) are the best markers for monitoring disease activity and nephritis flares"),
    ("CRP vs ESR", "In SLE: CRP is usually NORMAL despite elevated ESR. Raised CRP should prompt infection workup"),
    ("HCQ", "Hydroxychloroquine should be prescribed to ALL SLE patients — it reduces mortality, flares, thrombosis, and damage accrual"),
    ("Renal Biopsy", "Biopsy before treating LN — class determines treatment. Class IV needs aggressive therapy; Class V may need different approach"),
    ("Neonatal Lupus", "Anti-Ro/SSA antibodies → risk of congenital heart block; screen fetuses with echo at 16–26 weeks gestation"),
    ("APS", "Avoid rivaroxaban/apixaban (DOACs) in triple-positive APS — warfarin remains gold standard"),
    ("Infection mimicry", "Infection can mimic a flare (fever, cytopenias). Always exclude infection before escalating immunosuppression"),
    ("Drug-induced lupus", "Drug-induced lupus: anti-histone +ve, anti-dsDNA -ve, renal/CNS rare, reversible on drug withdrawal"),
    ("Libman-Sacks", "Libman-Sacks endocarditis: sterile vegetations on BOTH surfaces of mitral valve (vs infective endocarditis which is on one side)"),
]

for i, (key, pearl) in enumerate(pearls):
    y = 1.37 + i * 0.58
    add_rect(slide, 0.3, y, 2.0, 0.5, MID_BLUE)
    add_text(slide, key, 0.35, y+0.05, 1.9, 0.42, size=13, bold=True, color=WHITE, align=PP_ALIGN.CENTER)
    add_rect(slide, 2.45, y, 10.55, 0.5, SOFT_BLUE if i % 2 == 0 else WHITE)
    add_text(slide, pearl, 2.55, y+0.05, 10.35, 0.42, size=13, color=DARK_TEXT)


# ════════════════════════════════════════════════════════════════
# SLIDE 26 — Case Vignette
# ════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
header_bar(slide, "Clinical Case Vignette")
content_bg(slide)

add_rect(slide, 0.3, 1.35, 12.7, 2.2, SOFT_BLUE)
add_text(slide, "Case Presentation", 0.5, 1.38, 4, 0.4, size=15, bold=True, color=MID_BLUE)
case_text = ("A 28-year-old African-American woman presents with a 4-month history of joint pains (wrists, MCPs, PIPs), "
             "intermittent facial rash worsened by sun exposure, mouth ulcers, and fatigue. She reports 3 kg weight loss and "
             "3 episodes of pleuritic chest pain. Examination: malar erythema sparing nasolabial folds, mild bilateral "
             "wrist synovitis, no erosions. BP 148/92 mmHg. Urinalysis: 3+ proteinuria, RBC casts on microscopy.")
add_text(slide, case_text, 0.5, 1.8, 12.4, 1.65, size=13, color=DARK_TEXT, wrap=True)

section_box(slide, "Q1: What is the most likely diagnosis and how do you confirm it?",
            0.3, 3.68, 12.7, 1.15, SOFT_YELLOW, GOLD, [
    "SLE — satisfies clinical criteria: malar rash, oral ulcers, pleuritis, arthritis, renal disease (proteinuria + RBC casts)",
    "Confirm: ANA (entry criterion), then anti-dsDNA, anti-Sm, complement C3/C4, CBC, urinalysis, PCR",
    "→ Meets both SLICC and ACR/EULAR 2019 criteria",
], 13)

section_box(slide, "Q2: What is the immediate management priority?",
            0.3, 4.96, 12.7, 1.15, SOFT_RED, RED_WARN, [
    "Renal involvement is the most urgent concern — she has hypertension + heavy proteinuria + RBC casts (nephritic picture)",
    "Renal biopsy is mandatory to classify LN → guide immunosuppression",
    "Start: HCQ + ACE inhibitor/ARB (BP control) + prednisolone; plan induction with MMF or CYC based on biopsy",
], 13)

section_box(slide, "Q3: Key monitoring after starting MMF?",
            0.3, 6.24, 12.7, 1.06, SOFT_GREEN, TEAL, [
    "FBC (cytopenias), LFTs (hepatotoxicity), renal function, urinalysis PCR (response target: proteinuria <0.5 g/day at 12 months)",
    "Anti-dsDNA + C3/C4 every 3–6 months to assess immunological response | Contraception essential (teratogenic)",
], 13)


# ════════════════════════════════════════════════════════════════
# SLIDE 27 — Summary Table
# ════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
header_bar(slide, "Summary — Key Points")
content_bg(slide)

summary_points = [
    ("Epidemiology", "9:1 F:M; peak 15–45 years; Black/Hispanic women disproportionately affected"),
    ("Pathogenesis", "Defective apoptotic clearance → autoantigen exposure → loss of tolerance → autoantibodies → immune complex deposition → complement activation → tissue damage"),
    ("Hallmark Abs", "ANA: sensitive (95%); Anti-dsDNA: specific + activity marker; Anti-Sm: specific but static; aPL: thrombosis risk"),
    ("Diagnosis", "2019 ACR/EULAR: ANA entry + ≥10 points | SLICC: ≥4 criteria (1 clinical + 1 immunological)"),
    ("Clinical", "Malar rash, oral ulcers, photosensitivity, non-erosive arthritis, serositis, cytopenias, nephritis, NPSLE"),
    ("LN", "50–60% of SLE; biopsy essential; Class IV = most severe; MMF = standard of care for induction + maintenance"),
    ("HCQ", "Universal — ALL patients; reduces flares, damage, CVD, infections, mortality; safe in pregnancy"),
    ("Immunosuppression", "AZA (maintenance), MMF (LN), CYC (severe LN/CNS), Belimumab (moderate-severe), Anifrolumab (skin/joints)"),
    ("Pregnancy", "Plan in remission; continue HCQ; AZA safe; anti-Ro → congenital heart block screening; aPL → LMWH + aspirin"),
    ("Monitoring", "SLEDAI + complement + anti-dsDNA + urine PCR every 3 months; HCQ eye check from year 5"),
    ("Prognosis", "10-yr survival >90%; early death from active disease/infection; late death from CVD/malignancy"),
]

rh6 = 0.5
add_rect(slide, 0.3, 1.35, 2.8, 0.36, MID_BLUE)
add_text(slide, "Domain", 0.36, 1.37, 2.7, 0.30, size=13, bold=True, color=WHITE)
add_rect(slide, 3.15, 1.35, 9.85, 0.36, MID_BLUE)
add_text(slide, "Key Message", 3.21, 1.37, 9.75, 0.30, size=13, bold=True, color=WHITE)

for i, (dom, msg) in enumerate(summary_points):
    y = 1.74 + i * rh6
    bg = SOFT_BLUE if i % 2 == 0 else WHITE
    add_rect(slide, 0.3, y, 2.8, rh6-0.03, bg)
    add_text(slide, dom, 0.36, y+0.04, 2.7, rh6-0.1, size=12.5, bold=True, color=MID_BLUE)
    add_rect(slide, 3.15, y, 9.85, rh6-0.03, bg)
    add_text(slide, msg, 3.21, y+0.04, 9.75, rh6-0.1, size=12, color=DARK_TEXT, wrap=True)


# ════════════════════════════════════════════════════════════════
# SLIDE 28 — References
# ════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
header_bar(slide, "References & Further Reading")
content_bg(slide)

refs = [
    "1. Kasper DL et al. Harrison's Principles of Internal Medicine, 22nd ed. McGraw-Hill, 2025.",
    "2. Goldman L, Schafer AI. Goldman-Cecil Medicine, International Edition, 2 Vol Set. Elsevier, 2024.",
    "3. Firestein GS et al. Firestein & Kelley's Textbook of Rheumatology, 2-Volume Set. Elsevier, 2022.",
    "4. Feehally J et al. Comprehensive Clinical Nephrology, 7th ed. Elsevier, 2022.",
    "5. Aringer M et al. 2019 European League Against Rheumatism/American College of Rheumatology Classification "
       "Criteria for Systemic Lupus Erythematosus. Arthritis Rheumatol 2019;71(9):1400–12.",
    "6. Petri M et al. Derivation and validation of the SLICC classification criteria for SLE. "
       "Arthritis Rheum 2012;64(8):2677–86.",
    "7. Rovin BH et al. KDIGO 2024 Clinical Practice Guideline for Glomerular Diseases. Kidney Int 2024.",
    "8. Touma Z, Urowitz MB. SLEDAI-2K — the benchmark SLE disease activity index. Lupus 2019.",
    "9. Figueroa-Parra G et al. Impact of glucocorticoid dose on LN outcomes. Arthritis Rheumatol 2024;Sep.",
    "   [PMID: 38766897]",
    "10. Nordmann-Gomes A et al. CAR T-cell therapy in SLE: a systematic review. Semin Arthritis Rheum 2025.",
    "    [PMID: 40749440]",
    "11. Fanouriakis A et al. EULAR recommendations for the management of SLE 2023 update. Ann Rheum Dis 2024.",
]

add_multiline(slide, refs, 0.4, 1.4, 12.5, 5.9, size=13, color=DARK_TEXT, line_spacing=1.35)


# ════════════════════════════════════════════════════════════════
# SLIDE 29 — Q&A / Thank You
# ════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
add_rect(slide, 0, 0, 13.333, 7.5, DEEP_NAVY)
add_rect(slide, 0, 3.2, 13.333, 0.09, TEAL)
add_rect(slide, 0, 3.29, 13.333, 0.09, GOLD)

add_text(slide, "Questions & Discussion", 0.6, 1.4, 12.2, 1.5,
         size=46, bold=True, color=WHITE, align=PP_ALIGN.CENTER)
add_text(slide, "Systemic Lupus Erythematosus", 0.6, 3.55, 12.2, 0.7,
         size=22, color=TEAL, align=PP_ALIGN.CENTER, italic=True)
add_text(slide,
         "\"The disease that mimics everything, teaches everything, and challenges us to see the whole patient.\"",
         1.0, 4.6, 11.3, 1.0, size=15, italic=True,
         color=RGBColor(0xAA, 0xD4, 0xF5), align=PP_ALIGN.CENTER)
add_text(slide, "Slide deck based on: Harrison's 22e · Goldman-Cecil · Firestein & Kelley's Rheumatology · EULAR 2024 Guidelines",
         0.6, 6.9, 12.2, 0.4, size=10,
         color=RGBColor(0x55, 0x77, 0x99), align=PP_ALIGN.CENTER)


# ════════════════════════════════════════════════════════════════
# Save
# ════════════════════════════════════════════════════════════════
out = "/tmp/workspace/SLE-presentation/SLE_PG_Internal_Medicine.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/SLE-presentation && python build_sle.py 2>&1

The file is ready. Here it is:

SLE PG Internal Medicine

Presentation · PPTX


What's inside — 29 slides:
#Slide
1Title slide
2Lecture overview / agenda
3Definition & Epidemiology
4Etiology, Risk Factors & Drug-Induced Lupus
5Pathogenesis (5-step mechanism)
6Autoantibodies — full table with prevalence & clinical significance
7Clinical Features — 8-system overview grid
8Mucocutaneous Manifestations (Acute / SCLE / Discoid)
9Musculoskeletal & Haematological (Jaccoud's, AVN, AIHA, APS)
10Renal — ISN/RPS Class I–VI table with key features
11Cardiopulmonary (pericarditis, Libman-Sacks, DAH, shrinking lung)
12Neuropsychiatric SLE — 19 syndromes, workup
13Laboratory Investigations & Monitoring
142019 ACR/EULAR Classification Criteria (scored table)
15SLICC 2012 Criteria
16SLEDAI — disease activity index with interpretation
17Management Principles (HCQ cornerstone, steroids, NSAIDs)
18Immunosuppressants — drug/dose/indication/toxicity table
19Biologics & Emerging Therapies (belimumab, anifrolumab, CAR-T 2025 data)
20Lupus Nephritis Treatment (induction/maintenance, AURORA, BLISS-LN)
21SLE & Pregnancy (neonatal lupus, congenital heart block)
22Antiphospholipid Syndrome
23Complications, SDI, Long-Term Goals
24Differential Diagnosis (10 conditions)
25High-Yield Clinical Pearls (10 exam-ready points)
26Clinical Case Vignette with answers
27Summary Key Points table
28References (Harrison's 22e, Goldman-Cecil, EULAR 2024, PubMed PMIDs)
29Q&A / Thank You
This is a shared conversation. Sign in to Orris to start your own chat.