attachment
attachment

Makes notes on these points of these diseases seperately of each disesases in attractive way

Reading File
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
I now have enough comprehensive data from the textbooks to write detailed, attractive notes for all 5 diseases. Let me now compose the full structured notes.

πŸ“š Topic 47 - Immunological & Metabolic Disorders

AyUG-RN | II BAMS, NCISM | Topic 47


πŸ”΄ DISEASE 1: RHEUMATIC FEVER


πŸ”¬ Pathophysiology

  • Systemic inflammatory process triggered by Group A Ξ²-hemolytic Streptococcal (GAS) pharyngitis
  • Occurs 2-4 weeks after streptococcal sore throat
  • GAS impetigo does NOT cause rheumatic fever - only pharyngitis does
  • Most common age: 4-9 years (children and adolescents)
  • Mechanism: molecular mimicry - antibodies against streptococcal antigens cross-react with cardiac tissue

🩺 Clinical Features

⭐ JONES CRITERIA (Revised) - Diagnosis requires: 2 Major OR 1 Major + 2 Minor + evidence of preceding GAS infection

MAJOR ManifestationsMINOR Manifestations
πŸ«€ Carditis (most serious)🌑️ Fever
🦡 Polyarthritis (migratory, large joints)🦴 Arthralgia
🧠 Chorea (Sydenham's)πŸ”΄ Elevated ESR / CRP
🟣 Erythema marginatum (rash)πŸ“ˆ Prolonged PR interval on ECG
βšͺ Subcutaneous nodules

Rash Description

  • Erythema marginatum: open/closed ring lesions, sharp outer edges, pale centers
  • Spreads centrifugally from trunk to extremities, comes and goes

Arthritis Features

  • Migratory polyarthritis - moves from joint to joint
  • Preceded by arthralgias out of proportion to swelling
  • Travels: lower extremities β†’ upper extremities
  • Resolves spontaneously

Cardiac Involvement

  • Mitral valve most commonly affected
  • Rheumatic heart disease develops 10-20 years after original attack
  • Carditis = most severe sequela

πŸ” Clinical Examination

FindingSignificance
Murmur (mitral/aortic)Carditis
Joint swelling, warmth, tenderness (migratory)Polyarthritis
Involuntary movements (face, limbs)Sydenham's Chorea
Ring-shaped skin rash on trunkErythema marginatum
Firm, non-tender nodules over bony prominencesSubcutaneous nodules

πŸ§ͺ Investigations

TestFinding
ASO titer (most useful)Elevated (throat culture often -ve by this time)
Throat cultureMay be +ve for GAS
Rapid Strep Antigen TestPositive
ESR, CRPElevated (acute phase reactants)
CBCLeukocytosis
ECGProlonged PR interval
ECHOValvular abnormalities (carditis)
⚠️ Diagnosis = Jones Criteria + evidence of preceding GAS infection (positive culture OR elevated/rising antibody titer)

πŸ’Š Management

  • Penicillin - to eradicate GAS (prevents progression)
  • NSAIDs / Aspirin - for arthritis and fever
  • Corticosteroids - for severe carditis
  • Long-term prophylaxis with penicillin to prevent recurrence


🟠 DISEASE 2: RHEUMATOID ARTHRITIS (RA)


πŸ”¬ Pathophysiology

  • Chronic inflammatory systemic disease - autoimmune
  • Cellular + autoimmune mechanisms β†’ destruction of synovium (pannus formation)
  • Genetic predisposition: HLA-DR4 (most strongly associated)
  • RF (Rheumatoid Factor) = autoantibody against IgG Fc fragment
  • Anti-CCP (cyclic citrullinated peptide) antibody - more specific

🩺 Clinical Features

Articular Features

  • Symmetric synovitis = HALLMARK of RA
  • Morning stiffness > 1 hour (improves with activity)
  • Small joints first: MCP, PIP, wrists (DIP spared)
  • Insidious onset in 70% of patients
  • Progressive joint destruction β†’ erosions (within 2 years in RF+ disease)

Classic Hand Deformities

DeformityDescription
Ulnar deviationFingers deviate towards ulnar side
Boutonniere deformityPIP flexion + DIP hyperextension
Swan-neck deformityPIP hyperextension + DIP flexion
Z-deformity of thumb

Extra-Articular Features

  • 🫁 Pulmonary: Pleuritis, interstitial lung disease, nodules
  • ❀️ Cardiac: Pericarditis
  • πŸ‘οΈ Eyes: Keratoconjunctivitis sicca (Sjogren's), scleritis
  • 🩸 Blood: Anemia of chronic disease, Felty syndrome (RA + splenomegaly + neutropenia)
  • πŸ”΅ Skin: Rheumatoid nodules (over bony prominences), vasculitis
  • 🧠 Neurological: Peripheral neuropathy, carpal tunnel

πŸ” Clinical Examination (ACR 1987 Criteria - need β‰₯4 criteria, present β‰₯6 weeks)

  1. Morning stiffness β‰₯ 1 hour
  2. Arthritis in β‰₯ 3 joint areas
  3. Arthritis of hand joints (wrist, MCP, or PIP)
  4. Symmetric arthritis
  5. Rheumatoid nodules
  6. Positive serum RF
  7. Radiographic changes (erosions, periarticular osteopenia)

πŸ§ͺ Investigations

TestFinding
RF (Rheumatoid Factor)+ve in 80% (not specific)
Anti-CCP antibodyMost specific (>95%)
ESR, CRPElevated
CBCNormocytic normochromic anemia, thrombocytosis
X-rayPeriarticular osteopenia β†’ erosions β†’ joint space narrowing
Synovial fluid>2000 WBC/mmΒ³ (inflammatory)
ANAMay be +ve (low titer)

πŸ’Š Management

  • NSAIDs - pain relief (first-line symptom control)
  • DMARDs (start ASAP): Methotrexate (first-line), Sulfasalazine, Hydroxychloroquine
  • Biologics: Anti-TNF agents (Etanercept, Infliximab) for refractory disease
  • Corticosteroids - bridging therapy


🟑 DISEASE 3: SYSTEMIC LUPUS ERYTHEMATOSUS (SLE)


πŸ”¬ Pathophysiology

  • Chronic, remitting and relapsing, multisystem autoimmune disease
  • Classic immune complex-mediated disease
  • Predominantly affects women: Female:Male ratio = 10:1
  • Incidence: 1 in 700 women (20-60 years); 1 in 250 Black women
  • Autoantibodies (esp. anti-dsDNA) form immune complexes β†’ deposit in vessels β†’ inflammation

🩺 Clinical Features (Mnemonic: DOPAMINE RASH)

SystemFeature
πŸ¦‹ SkinMalar (butterfly) rash - spares nasolabial folds; discoid rash; photosensitivity
🦴 MSKArthritis/arthralgia (non-erosive), Jaccoud's arthropathy
🫘 RenalLupus nephritis (commonest cause of death in young SLE patients)
🧠 NeuroSeizures, psychosis, headache, CNS vasculitis
❀️ CardiacPericarditis, Libman-Sacks endocarditis
🫁 PulmonaryPleuritis, pneumonitis
🩸 HematologyHemolytic anemia, thrombocytopenia, leukopenia
πŸ’Š OthersOral ulcers, alopecia, Raynaud's phenomenon

SLICC / ACR-EULAR Criteria (11 criteria - need β‰₯4 OR biopsy-proven nephritis + ANA/anti-dsDNA)

  1. Malar rash
  2. Discoid rash
  3. Photosensitivity
  4. Oral ulcers
  5. Arthritis (non-erosive, β‰₯2 joints)
  6. Serositis (pleuritis/pericarditis)
  7. Renal disorder (proteinuria >500mg/day or cellular casts)
  8. Neurological disorder (seizures/psychosis)
  9. Hematological disorder (hemolytic anemia, leukopenia, thrombocytopenia)
  10. Immunological disorder (anti-dsDNA, anti-Sm, antiphospholipid antibodies)
  11. ANA positive

πŸ” Clinical Examination

FindingSignificance
Butterfly rash across cheeks/noseMalar rash (pathognomonic)
Oral ulcers (painless)SLE criterion
Hair loss, frontal alopeciaActive disease
BP measurementRenal involvement
Pericardial rubSerositis
LymphadenopathySystemic inflammation

πŸ§ͺ Investigations

TestFinding
ANA (Antinuclear antibody)+ve in 95-99% - screening test
Anti-dsDNAMost specific for SLE; correlates with disease activity
Anti-SmHighly specific (but low sensitivity)
Complement (C3, C4)Decreased (consumed by immune complexes)
CBCHemolytic anemia, leukopenia, thrombocytopenia
UrinalysisHematuria, proteinuria, cellular casts
Renal biopsyDefinitive for lupus nephritis classification
ESRElevated; CRP often normal (unlike other inflammatory diseases)
Antiphospholipid antibodiesLupus anticoagulant, anti-cardiolipin

πŸ’Š Management

  • Hydroxychloroquine - for all SLE patients (reduces flares)
  • NSAIDs - for arthritis, serositis
  • Corticosteroids - for flares
  • Immunosuppressants: Mycophenolate, Cyclophosphamide (renal/CNS)
  • Belimumab (anti-BAFF biologic) - FDA approved for SLE
  • Sun protection, regular monitoring


πŸ”΅ DISEASE 4: ANKYLOSING SPONDYLITIS (AS)


πŸ”¬ Pathophysiology

  • Chronic inflammatory disorder predominantly affecting sacroiliac joints and spine (axial skeleton)
  • Inflammation at annulus fibrosis-vertebral bone margin β†’ fibrocartilage β†’ ossification β†’ bamboo spine (fusion)
  • Also: enthesitis (inflammation at ligament/tendon attachments)
  • HLA-B27 strongly associated (present in ~90% of patients)
  • Male:Female ratio = 5:1
  • Typical age: 20-30s

🩺 Clinical Features

Classic Presentation

  • Insidious onset of low back pain / buttock pain
  • Pain felt in sacroiliac area β†’ lumbar area
  • Pain becomes persistent and bilateral
  • Morning stiffness - relieved by activity/hot shower (opposite to OA - worse with rest, better with movement!)
  • Night pain β†’ fatigue, malaise
  • Consider AS: back stiffness + relieved by exercise + male < 40 years

Extra-Articular Features

SystemFeature
πŸ‘οΈ EyesAcute uveitis (iritis) - most common extra-articular feature
❀️ CardiovascularAortitis, aortic regurgitation
🫁 PulmonaryLimited chest expansion (costovertebral), apical fibrosis
🦴 MSKHip/shoulder involvement, peripheral arthritis
🧠 NeurologicalCauda equina syndrome, atlantoaxial subluxation

πŸ” Clinical Examination

Sacroiliac Tests

TestMethod
FABER test (Patrick's)Flexion, ABduction, External Rotation β†’ SI pain
Gaenslen's testSI joint stress test
Direct palpation of SI jointsTenderness

Spinal Mobility Tests

TestFinding in AS
Schober's test<5 cm increase in lumbar flexion (normal >5 cm)
Chest expansionReduced (<5 cm; normal 5-7 cm)
Occiput-to-wall distanceIncreased (cervical kyphosis)
Flexion, extension, rotationAll reduced

πŸ§ͺ Investigations

TestFinding
HLA-B27+ve in ~90% (not diagnostic alone)
ESR, CRPElevated
X-ray pelvisSacroiliitis (bilateral) - earliest sign; erosions, sclerosis β†’ fusion
X-ray spineBamboo spine (late), squaring of vertebrae, syndesmophytes
MRI sacroiliac jointsMost sensitive for early sacroiliitis (before X-ray changes)
CT scanIf X-ray inconclusive
RF, ANANegative (seronegative spondyloarthropathy)

πŸ’Š Management

  • NSAIDs - mainstay, 70-80% report substantial relief
  • Physiotherapy - back extensor strengthening; maintain erect posture
  • Anti-TNF biologics (Etanercept, Adalimumab) - for NSAID-refractory
  • IL-17 inhibitors (Secukinumab) - newer option
  • Sulfasalazine for peripheral joint disease
  • Sleep on firm mattress, spine erect


🟒 DISEASE 5: GOUT


πŸ”¬ Pathophysiology

  • Disorder of purine metabolism β†’ Hyperuricemia β†’ Monosodium Urate (MSU) crystal deposition
  • 90% of cases = reduced excretion of uric acid; 10% = overproduction
  • Crystals deposit in joints β†’ acute inflammatory response (neutrophil activation)
  • Uric acid > 8 mg/dL in men, >7 mg/dL in women = hyperuricemia
  • Takes 20+ years of hyperuricemia before first gout episode

🩺 Clinical Features

4 Clinical Stages

StageFeatures
1. Asymptomatic HyperuricemiaHigh uric acid, no symptoms
2. Acute Gouty ArthritisSudden, severe monoarthritis (especially at night), redness, swelling, exquisite tenderness
3. Intercritical GoutSymptom-free periods between attacks
4. Chronic Tophaceous GoutTophi (urate deposits), chronic polyarthritis, joint damage

Classic Joint Involvement

  • 1st MTP joint (great toe) = PODAGRA - affected in 50% of first attacks, eventually 75-90%
  • Also: heel, ankle, knee, midtarsal joints, olecranon bursa
  • First MTP most affected because: more microtrauma + relatively cooler temperature

Tophi

  • Urate crystal deposits in joints, soft tissue, cartilage, bone
  • Can mimic rheumatoid nodules (especially in elderly women)

In Women & Elderly

  • Often polyarticular (can mimic RA)
  • Low-grade fever, leukocytosis possible

πŸ” Clinical Examination

FindingSignificance
Swollen, red, hot, exquisitely tender 1st MTP jointPodagra (pathognomonic of gout)
Tophi over ear helix, Achilles tendon, olecranonChronic tophaceous gout
Assess all joints for involvementPolyarticular vs monoarticular
Blood pressure, BMIMetabolic syndrome association

πŸ§ͺ Investigations

TestFinding
Synovial fluid analysis⭐ GOLD STANDARD - needle-shaped, negatively birefringent urate crystals under polarized light
Serum uric acidUsually >8 mg/dL (can be normal during acute attack!)
ESR, CRP, WBCElevated (acute attack)
X-rayPunched-out erosions with sclerotic margins ("rat bite" erosions), soft tissue tophi
Renal function testsUrate nephropathy, calculi
24-hour urine uric acidDifferentiates over-producers from under-excretors
Joint cultureTo exclude septic arthritis
⚠️ Definitive diagnosis = negatively birefringent urate crystals on synovial fluid analysis

πŸ’Š Management

Acute Attack

  • NSAIDs (Indomethacin) - first-line
  • Colchicine - highly effective if given early
  • Corticosteroids - if NSAIDs/colchicine contraindicated

Long-term / Prevention

  • Allopurinol (xanthine oxidase inhibitor) - reduces uric acid production
  • Febuxostat - alternative to allopurinol
  • Probenecid - uricosuric agent (increases excretion)
  • Dietary: avoid purines (red meat, organ meats, shellfish), alcohol (especially beer), fructose
  • Hydration (prevents urate stones)


βš–οΈ DIFFERENTIAL DIAGNOSIS OF ARTHRITIS

FeatureRheumatic FeverRASLEASGout
SexM=F (children)F>M (3:1)F>>M (10:1)M>>F (5:1)M>F
Age4-9 years20-50 years20-40 years20-30 years40-60 years
JointsLarge, migratorySmall, symmetric, handsNon-erosive polyarthritisSacroiliac, spine1st MTP, monoarticular
OnsetAcute, after URTIInsidiousVariableInsidiousAcute nocturnal
Morning stiffness->1 hourVariableYes (relieved by movement)Not typical
Key antibodyASO titerRF, Anti-CCPANA, Anti-dsDNAHLA-B27None
X-rayNormalErosions, osteopeniaUsually normalSacroiliitis, bamboo spinePunched-out erosions
Crystal in fluidNoneNoneNoneNoneUrate (neg. biref.)
Key associationGAS pharyngitisHLA-DR4UV light, estrogenHLA-B27Hyperuricemia
Hallmark signJones criteriaSymmetric synovitis + morning stiffnessButterfly rashBamboo spinePodagra

πŸ“– Sources: Textbook of Family Medicine 9e; Cellular and Molecular Immunology; Medical Microbiology 9e; Murray & Nadel's Respiratory Medicine; Henry's Clinical Diagnosis and Management by Laboratory Methods

Create a PowerPoint presentation with these disease cards for easy study

Reading File
Reading File
Running Command

mkdir -p /tmp/workspace/immunology-pptx && ls /tmp/workspace/

Writing File

~/immunology-pptx/create_pptx.py

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

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

# ── Colour palette ──────────────────────────────────────────────────────────
DARK_BG      = RGBColor(0x0D, 0x1B, 0x2A)   # near-black navy
WHITE        = RGBColor(0xFF, 0xFF, 0xFF)
LIGHT_GREY   = RGBColor(0xF0, 0xF4, 0xF8)
MID_GREY     = RGBColor(0xB0, 0xBE, 0xCC)

# Disease accent colours
COLORS = {
    "RF":  (RGBColor(0xE8, 0x3A, 0x3A), RGBColor(0xFF, 0xEC, 0xEC)),  # red
    "RA":  (RGBColor(0xE8, 0x7D, 0x1E), RGBColor(0xFF, 0xF3, 0xE0)),  # orange
    "SLE": (RGBColor(0xF5, 0xC5, 0x18), RGBColor(0xFF, 0xFB, 0xE6)),  # yellow
    "AS":  (RGBColor(0x22, 0x96, 0xF3), RGBColor(0xE3, 0xF2, 0xFD)),  # blue
    "GT":  (RGBColor(0x27, 0xAE, 0x60), RGBColor(0xE8, 0xF5, 0xE9)),  # green
    "DD":  (RGBColor(0x8E, 0x24, 0xAA), RGBColor(0xF3, 0xE5, 0xF5)),  # purple
}

def fill_slide_bg(slide, color: RGBColor):
    bg = slide.background
    fill = bg.fill
    fill.solid()
    fill.fore_color.rgb = color

def add_rect(slide, x, y, w, h, fill_color, line_color=None, line_width=None, radius=None):
    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 = fill_color
    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, bold=False, color=WHITE,
             align=PP_ALIGN.LEFT, italic=False, wrap=True, valign=MSO_ANCHOR.TOP):
    tb = slide.shapes.add_textbox(Inches(x), Inches(y), Inches(w), Inches(h))
    tf = tb.text_frame
    tf.word_wrap = wrap
    tf.vertical_anchor = valign
    tf.margin_left = Inches(0.05)
    tf.margin_right = Inches(0.05)
    tf.margin_top = Inches(0.03)
    tf.margin_bottom = Inches(0.03)
    p = tf.paragraphs[0]
    p.alignment = align
    run = p.add_run()
    run.text = text
    run.font.size = Pt(font_size)
    run.font.bold = bold
    run.font.italic = italic
    run.font.color.rgb = color
    run.font.name = "Calibri"
    return tf

def add_multiline(slide, lines, x, y, w, h, font_size, color, bold_first=False,
                  align=PP_ALIGN.LEFT, line_space=1.15):
    """lines = list of (text, bold, italic) tuples or plain strings"""
    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 = Inches(0.05)
    tf.margin_top = Inches(0.03)
    tf.margin_bottom = Inches(0.03)
    first = True
    for item in lines:
        if isinstance(item, str):
            txt, bld, itl = item, False, False
        else:
            txt, bld, itl = item[0], item[1] if len(item)>1 else False, item[2] if len(item)>2 else False
        if first:
            p = tf.paragraphs[0]
            first = False
        else:
            p = tf.add_paragraph()
        p.alignment = align
        from pptx.util import Pt as _Pt
        p.space_after = _Pt(2)
        run = p.add_run()
        run.text = txt
        run.font.size = Pt(font_size)
        run.font.bold = bld or (bold_first and txt == lines[0])
        run.font.italic = itl
        run.font.color.rgb = color
        run.font.name = "Calibri"
    return tf

# ════════════════════════════════════════════════════════════════════════════
# SLIDE 1 β€” TITLE SLIDE
# ════════════════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank_layout)
fill_slide_bg(slide, DARK_BG)

# Decorative top stripe
add_rect(slide, 0, 0, 13.333, 0.12, RGBColor(0xE8, 0x3A, 0x3A))
# Bottom stripe
add_rect(slide, 0, 7.38, 13.333, 0.12, RGBColor(0x22, 0x96, 0xF3))

# Five coloured disease pills
pill_colors = [RGBColor(0xE8,0x3A,0x3A), RGBColor(0xE8,0x7D,0x1E),
               RGBColor(0xF5,0xC5,0x18), RGBColor(0x22,0x96,0xF3), RGBColor(0x27,0xAE,0x60)]
pill_labels = ["Rheumatic\nFever", "Rheumatoid\nArthritis", "SLE", "Ankylosing\nSpondylitis", "Gout"]
for i,(c,l) in enumerate(zip(pill_colors, pill_labels)):
    px = 0.6 + i*2.55
    add_rect(slide, px, 5.6, 2.2, 1.2, c)
    add_text(slide, l, px, 5.6, 2.2, 1.2, 11, bold=True, color=WHITE,
             align=PP_ALIGN.CENTER, valign=MSO_ANCHOR.MIDDLE)

add_text(slide, "Topic 47", 0.5, 1.2, 12.3, 0.6, 18, color=MID_GREY, align=PP_ALIGN.CENTER)
add_text(slide, "Immunological & Metabolic Disorders", 0.5, 1.8, 12.3, 1.1, 40,
         bold=True, color=WHITE, align=PP_ALIGN.CENTER)
add_text(slide, "Clinical Features  β€’  Examination  β€’  Investigations  β€’  Differential Diagnosis",
         0.5, 3.0, 12.3, 0.6, 16, color=MID_GREY, align=PP_ALIGN.CENTER)
add_text(slide, "AyUG-RN  |  II BAMS  |  NCISM", 0.5, 3.7, 12.3, 0.5, 13,
         color=RGBColor(0x80,0x9A,0xB0), align=PP_ALIGN.CENTER)


# ════════════════════════════════════════════════════════════════════════════
# HELPER: build a disease overview card slide (2-column layout)
# ════════════════════════════════════════════════════════════════════════════
def disease_overview(title, emoji, subtitle, key_points, accent, bg_light, pathophys_lines):
    slide = prs.slides.add_slide(blank_layout)
    fill_slide_bg(slide, DARK_BG)
    # Left accent bar
    add_rect(slide, 0, 0, 0.18, 7.5, accent)
    # Header band
    add_rect(slide, 0.18, 0, 13.153, 1.3, RGBColor(0x12, 0x24, 0x38))
    # Emoji + title
    add_text(slide, emoji + "  " + title, 0.35, 0.1, 9.0, 0.8, 30, bold=True,
             color=WHITE, align=PP_ALIGN.LEFT, valign=MSO_ANCHOR.MIDDLE)
    add_text(slide, subtitle, 0.35, 0.85, 9.0, 0.4, 13, color=MID_GREY)
    # Slide number tag
    add_rect(slide, 11.8, 0.05, 1.35, 0.45, accent)
    add_text(slide, "OVERVIEW", 11.8, 0.05, 1.35, 0.45, 9, bold=True,
             color=WHITE, align=PP_ALIGN.CENTER, valign=MSO_ANCHOR.MIDDLE)

    # ── LEFT PANEL: Key Points ──
    add_rect(slide, 0.25, 1.45, 6.2, 0.38, accent)
    add_text(slide, "⭐  KEY POINTS", 0.3, 1.45, 6.0, 0.38, 11, bold=True,
             color=WHITE, valign=MSO_ANCHOR.MIDDLE)
    add_rect(slide, 0.25, 1.83, 6.2, 4.9, bg_light)
    add_multiline(slide, key_points, 0.35, 1.9, 6.0, 4.7, 11.5,
                  RGBColor(0x1A,0x1A,0x2E))

    # ── RIGHT PANEL: Pathophysiology ──
    add_rect(slide, 6.8, 1.45, 6.3, 0.38, RGBColor(0x1E, 0x35, 0x52))
    add_text(slide, "πŸ”¬  PATHOPHYSIOLOGY", 6.85, 1.45, 6.1, 0.38, 11, bold=True,
             color=accent, valign=MSO_ANCHOR.MIDDLE)
    add_rect(slide, 6.8, 1.83, 6.3, 4.9, RGBColor(0x14, 0x2A, 0x40))
    add_multiline(slide, pathophys_lines, 6.9, 1.9, 6.1, 4.7, 11.5,
                  RGBColor(0xCC, 0xDD, 0xEE))

    # Footer
    add_rect(slide, 0.18, 7.25, 13.153, 0.25, RGBColor(0x0A, 0x14, 0x22))
    add_text(slide, "Topic 47 β€” Immunological & Metabolic Disorders  |  AyUG-RN II BAMS NCISM",
             0.3, 7.25, 12.0, 0.25, 8, color=RGBColor(0x55,0x66,0x77))


def disease_clinical(title, emoji, accent, bg_light, features_lines, exam_lines):
    slide = prs.slides.add_slide(blank_layout)
    fill_slide_bg(slide, DARK_BG)
    add_rect(slide, 0, 0, 0.18, 7.5, accent)
    add_rect(slide, 0.18, 0, 13.153, 1.3, RGBColor(0x12, 0x24, 0x38))
    add_text(slide, emoji + "  " + title + " β€” Clinical Features & Examination",
             0.35, 0.1, 10.5, 0.8, 22, bold=True, color=WHITE, valign=MSO_ANCHOR.MIDDLE)
    add_rect(slide, 11.8, 0.05, 1.35, 0.45, accent)
    add_text(slide, "CLINICAL", 11.8, 0.05, 1.35, 0.45, 9, bold=True,
             color=WHITE, align=PP_ALIGN.CENTER, valign=MSO_ANCHOR.MIDDLE)

    add_rect(slide, 0.25, 1.45, 6.2, 0.38, accent)
    add_text(slide, "🩺  CLINICAL FEATURES", 0.3, 1.45, 6.0, 0.38, 11, bold=True,
             color=WHITE, valign=MSO_ANCHOR.MIDDLE)
    add_rect(slide, 0.25, 1.83, 6.2, 5.42, bg_light)
    add_multiline(slide, features_lines, 0.35, 1.9, 6.0, 5.3, 11,
                  RGBColor(0x1A,0x1A,0x2E))

    add_rect(slide, 6.8, 1.45, 6.3, 0.38, RGBColor(0x1E, 0x35, 0x52))
    add_text(slide, "πŸ”  CLINICAL EXAMINATION", 6.85, 1.45, 6.1, 0.38, 11, bold=True,
             color=accent, valign=MSO_ANCHOR.MIDDLE)
    add_rect(slide, 6.8, 1.83, 6.3, 5.42, RGBColor(0x14, 0x2A, 0x40))
    add_multiline(slide, exam_lines, 6.9, 1.9, 6.1, 5.3, 11,
                  RGBColor(0xCC, 0xDD, 0xEE))

    add_rect(slide, 0.18, 7.25, 13.153, 0.25, RGBColor(0x0A, 0x14, 0x22))
    add_text(slide, "Topic 47 β€” Immunological & Metabolic Disorders  |  AyUG-RN II BAMS NCISM",
             0.3, 7.25, 12.0, 0.25, 8, color=RGBColor(0x55,0x66,0x77))


def disease_investigations(title, emoji, accent, bg_light, invest_lines, mgmt_lines):
    slide = prs.slides.add_slide(blank_layout)
    fill_slide_bg(slide, DARK_BG)
    add_rect(slide, 0, 0, 0.18, 7.5, accent)
    add_rect(slide, 0.18, 0, 13.153, 1.3, RGBColor(0x12, 0x24, 0x38))
    add_text(slide, emoji + "  " + title + " β€” Investigations & Management",
             0.35, 0.1, 10.5, 0.8, 22, bold=True, color=WHITE, valign=MSO_ANCHOR.MIDDLE)
    add_rect(slide, 11.2, 0.05, 1.95, 0.45, accent)
    add_text(slide, "INVESTIGATIONS", 11.2, 0.05, 1.95, 0.45, 9, bold=True,
             color=WHITE, align=PP_ALIGN.CENTER, valign=MSO_ANCHOR.MIDDLE)

    add_rect(slide, 0.25, 1.45, 6.2, 0.38, accent)
    add_text(slide, "πŸ§ͺ  INVESTIGATIONS", 0.3, 1.45, 6.0, 0.38, 11, bold=True,
             color=WHITE, valign=MSO_ANCHOR.MIDDLE)
    add_rect(slide, 0.25, 1.83, 6.2, 5.42, bg_light)
    add_multiline(slide, invest_lines, 0.35, 1.9, 6.0, 5.3, 11,
                  RGBColor(0x1A,0x1A,0x2E))

    add_rect(slide, 6.8, 1.45, 6.3, 0.38, RGBColor(0x1E, 0x35, 0x52))
    add_text(slide, "πŸ’Š  MANAGEMENT", 6.85, 1.45, 6.1, 0.38, 11, bold=True,
             color=accent, valign=MSO_ANCHOR.MIDDLE)
    add_rect(slide, 6.8, 1.83, 6.3, 5.42, RGBColor(0x14, 0x2A, 0x40))
    add_multiline(slide, mgmt_lines, 6.9, 1.9, 6.1, 5.3, 11,
                  RGBColor(0xCC, 0xDD, 0xEE))

    add_rect(slide, 0.18, 7.25, 13.153, 0.25, RGBColor(0x0A, 0x14, 0x22))
    add_text(slide, "Topic 47 β€” Immunological & Metabolic Disorders  |  AyUG-RN II BAMS NCISM",
             0.3, 7.25, 12.0, 0.25, 8, color=RGBColor(0x55,0x66,0x77))


# ════════════════════════════════════════════════════════════════════════════
# DISEASE 1 β€” RHEUMATIC FEVER
# ════════════════════════════════════════════════════════════════════════════
accent_rf, bg_rf = COLORS["RF"]

disease_overview(
    "Rheumatic Fever", "πŸ”΄",
    "Post-streptococcal systemic inflammatory disease",
    [
        ("β€’ Occurs 2–4 weeks after Group A Ξ²-hemolytic Strep pharyngitis", True, False),
        ("β€’ Age: 4–9 years most commonly", False, False),
        ("β€’ GAS impetigo does NOT cause RF β€” only pharyngitis does", False, False),
        ("β€’ Mechanism: molecular mimicry (antibodies vs cardiac tissue)", False, False),
        ("β€’ Carditis = most serious sequela (mitral valve)", False, False),
        ("β€’ Rheumatic heart disease: 10–20 years after initial attack", False, False),
        ("", False, False),
        ("JONES CRITERIA (need 2 Major OR 1 Major + 2 Minor):", True, False),
        ("MAJOR: Carditis | Polyarthritis | Chorea | Erythema marginatum | Subcutaneous nodules", False, False),
        ("MINOR: Fever | Arthralgia | Elevated ESR/CRP | Prolonged PR interval", False, False),
        ("", False, False),
        ("PLUS: Evidence of preceding GAS infection:", True, False),
        ("  β–Έ +ve throat culture / rapid strep antigen test", False, False),
        ("  β–Έ Elevated or rising ASO titer", False, False),
    ],
    accent_rf, bg_rf,
    [
        ("Trigger: GAS pharyngitis β†’ antibody production", False, False),
        ("Molecular mimicry: strep M-protein ↔ cardiac antigens", False, False),
        ("Immune-mediated inflammation of heart, joints, brain, skin", False, False),
        ("", False, False),
        ("Arthritis:", True, False),
        ("  Migratory polyarthritis β€” large joints", False, False),
        ("  Lower extremities β†’ upper extremities", False, False),
        ("  Resolves spontaneously", False, False),
        ("", False, False),
        ("Carditis:", True, False),
        ("  Valvulitis β†’ mitral valve most affected", False, False),
        ("  Endocarditis, myocarditis, pericarditis", False, False),
        ("", False, False),
        ("Erythema Marginatum:", True, False),
        ("  Ring lesions, pale center, spreads centrifugally trunk β†’ limbs", False, False),
        ("", False, False),
        ("Sydenham Chorea:", True, False),
        ("  Involuntary movements, emotional lability", False, False),
        ("  CNS involvement β€” appears late", False, False),
    ]
)

disease_clinical(
    "Rheumatic Fever", "πŸ”΄", accent_rf, bg_rf,
    [
        ("ARTICULAR:", True, False),
        ("  β€’ Migratory polyarthritis (large joints)", False, False),
        ("  β€’ Hot, swollen, tender joints", False, False),
        ("  β€’ Arthralgias precede swelling", False, False),
        ("  β€’ Self-resolving", False, False),
        ("", False, False),
        ("CARDIAC:", True, False),
        ("  β€’ Carditis in 50–60% of first attacks", False, False),
        ("  β€’ Mitral valve most involved", False, False),
        ("  β€’ Chest pain, dyspnoea, palpitations", False, False),
        ("", False, False),
        ("SKIN:", True, False),
        ("  β€’ Erythema marginatum (trunk, arms β€” not face)", False, False),
        ("  β€’ Subcutaneous nodules (firm, painless, over bony prominences)", False, False),
        ("", False, False),
        ("CNS:", True, False),
        ("  β€’ Sydenham Chorea: involuntary jerky movements", False, False),
        ("  β€’ Emotional lability, slurred speech", False, False),
        ("", False, False),
        ("CONSTITUTIONAL:", True, False),
        ("  β€’ Fever, malaise, pallor", False, False),
    ],
    [
        ("HISTORY:", True, False),
        ("  β–Έ Recent sore throat 2–4 weeks ago?", False, False),
        ("  β–Έ Migratory joint pain pattern?", False, False),
        ("  β–Έ Involuntary movements, chest symptoms?", False, False),
        ("", False, False),
        ("JOINT EXAM:", True, False),
        ("  β–Έ Warmth, swelling, tenderness", False, False),
        ("  β–Έ Migratory pattern (large joints)", False, False),
        ("", False, False),
        ("CARDIAC EXAM:", True, False),
        ("  β–Έ Auscultation: Mitral regurgitation murmur", False, False),
        ("  β–Έ Pericardial friction rub", False, False),
        ("  β–Έ Tachycardia disproportionate to fever", False, False),
        ("", False, False),
        ("NEUROLOGICAL:", True, False),
        ("  β–Έ Observe for choreiform movements", False, False),
        ("  β–Έ Milkmaid's grip", False, False),
        ("", False, False),
        ("SKIN:", True, False),
        ("  β–Έ Inspect trunk/proximal limbs for rash", False, False),
        ("  β–Έ Palpate bony prominences for nodules", False, False),
    ]
)

disease_investigations(
    "Rheumatic Fever", "πŸ”΄", accent_rf, bg_rf,
    [
        ("⭐ ASO Titer β€” MOST USEFUL (throat culture often -ve)", True, False),
        ("  Normal: <200 Todd units; Elevated = recent GAS infection", False, False),
        ("", False, False),
        ("β–Έ Throat culture / Rapid Strep Antigen Test", False, False),
        ("β–Έ ESR / CRP β€” elevated (acute phase reactants)", False, False),
        ("β–Έ CBC β€” leukocytosis", False, False),
        ("β–Έ ECG β€” prolonged PR interval (1st degree AV block)", False, False),
        ("β–Έ ECHO β€” valvular abnormalities, pericardial effusion", False, False),
        ("β–Έ Blood culture β€” to exclude septicaemia", False, False),
        ("", False, False),
        ("DIAGNOSIS SUMMARY:", True, False),
        ("  2 Major + evidence of preceding GAS = High probability RF", False, False),
        ("  1 Major + 2 Minor + evidence = High probability RF", False, False),
    ],
    [
        ("ACUTE PHASE:", True, False),
        ("  β–Έ Bed rest during active carditis", False, False),
        ("  β–Έ Penicillin V or Benzathine Penicillin G β€” eradicates GAS", False, False),
        ("  β–Έ NSAIDs / Aspirin β€” for arthritis and fever", False, False),
        ("  β–Έ Corticosteroids β€” severe carditis only", False, False),
        ("", False, False),
        ("LONG-TERM PROPHYLAXIS:", True, False),
        ("  β–Έ Benzathine Penicillin G IM every 3–4 weeks", False, False),
        ("  β–Έ Duration depends on carditis severity:", False, False),
        ("    - No carditis: 5 years or until age 21", False, False),
        ("    - With carditis: 10 years or until age 21", False, False),
        ("    - Persistent valvular disease: lifelong", False, False),
        ("", False, False),
        ("PREVENTION:", True, False),
        ("  β–Έ Early antibiotic treatment of GAS pharyngitis", False, False),
        ("  β–Έ Reduces RF development dramatically", False, False),
    ]
)

# ════════════════════════════════════════════════════════════════════════════
# DISEASE 2 β€” RHEUMATOID ARTHRITIS
# ════════════════════════════════════════════════════════════════════════════
accent_ra, bg_ra = COLORS["RA"]

disease_overview(
    "Rheumatoid Arthritis", "🟠",
    "Chronic autoimmune synovial inflammatory disease",
    [
        ("β€’ Women > Men (3:1 ratio)", True, False),
        ("β€’ Peak incidence: 20–50 years; prevalence 1–2% adults", False, False),
        ("β€’ 70% have insidious onset", False, False),
        ("β€’ Symmetric synovitis + Morning stiffness >1 hr = HALLMARK", True, False),
        ("β€’ HLA-DR4 genetic association", False, False),
        ("β€’ RF+ polyarticular RA: >70% joint damage within 2 years", False, False),
        ("", False, False),
        ("ACR 1987 CRITERIA (need β‰₯4, symptoms β‰₯6 weeks):", True, False),
        ("  1. Morning stiffness β‰₯1 hour", False, False),
        ("  2. Arthritis in β‰₯3 joint areas", False, False),
        ("  3. Arthritis of hand joints (wrist/MCP/PIP)", False, False),
        ("  4. Symmetric arthritis", False, False),
        ("  5. Rheumatoid nodules", False, False),
        ("  6. Serum RF positive", False, False),
        ("  7. Radiographic changes (erosions / periarticular osteopenia)", False, False),
    ],
    accent_ra, bg_ra,
    [
        ("Autoimmune β†’ synovial inflammation β†’ pannus formation", False, False),
        ("Pannus = aggressive granulation tissue that destroys cartilage & bone", False, False),
        ("", False, False),
        ("Cytokines involved:", True, False),
        ("  TNF-Ξ±, IL-1, IL-6 (key therapeutic targets)", False, False),
        ("", False, False),
        ("RF (Rheumatoid Factor):", True, False),
        ("  Autoantibody against IgG Fc fragment", False, False),
        ("  +ve in 80% RA (also +ve in other conditions)", False, False),
        ("", False, False),
        ("Anti-CCP Antibody:", True, False),
        ("  Most specific marker for RA (>95% specificity)", False, False),
        ("  Present even before clinical disease", False, False),
        ("", False, False),
        ("Genetics:", True, False),
        ("  HLA-DR4 (shared epitope hypothesis)", False, False),
        ("  Higher concordance in monozygotic twins", False, False),
        ("", False, False),
        ("Progression:", True, False),
        ("  Synovitis β†’ Pannus β†’ Erosions β†’ Deformity β†’ Disability", False, False),
    ]
)

disease_clinical(
    "Rheumatoid Arthritis", "🟠", accent_ra, bg_ra,
    [
        ("ARTICULAR (Symmetric small joints first):", True, False),
        ("  β€’ MCP, PIP, Wrists most affected (DIP spared)", False, False),
        ("  β€’ Morning stiffness >1 hour", False, False),
        ("  β€’ Soft boggy swelling (synovitis)", False, False),
        ("", False, False),
        ("HAND DEFORMITIES (late):", True, False),
        ("  β€’ Ulnar deviation of fingers", False, False),
        ("  β€’ Swan-neck: PIP hyperext + DIP flexion", False, False),
        ("  β€’ Boutonniere: PIP flexion + DIP hyperext", False, False),
        ("  β€’ Z-deformity of thumb", False, False),
        ("", False, False),
        ("EXTRA-ARTICULAR:", True, False),
        ("  β€’ Pulmonary: pleuritis, ILD, nodules", False, False),
        ("  β€’ Cardiac: pericarditis", False, False),
        ("  β€’ Eyes: Sjogren's (dry eyes/mouth), scleritis", False, False),
        ("  β€’ Blood: anaemia of chronic disease", False, False),
        ("  β€’ Felty syndrome: RA + splenomegaly + neutropenia", False, False),
        ("  β€’ Skin: rheumatoid nodules (bony prominences)", False, False),
        ("  β€’ Neuro: peripheral neuropathy, carpal tunnel", False, False),
    ],
    [
        ("JOINT EXAMINATION:", True, False),
        ("  β–Έ Inspect: swelling, deformity, wasting", False, False),
        ("  β–Έ Palpate: warmth, synovial thickening, tenderness", False, False),
        ("  β–Έ Move: ROM, crepitus", False, False),
        ("  β–Έ Grip strength reduced", False, False),
        ("", False, False),
        ("KEY SIGNS:", True, False),
        ("  β–Έ Symmetric small joint involvement", False, False),
        ("  β–Έ MCP squeeze tenderness", False, False),
        ("  β–Έ Piano key sign (distal radioulnar instability)", False, False),
        ("  β–Έ Ulnar deviation at MCPs", False, False),
        ("", False, False),
        ("SYSTEMIC EXAM:", True, False),
        ("  β–Έ Rheumatoid nodules: firm, non-tender (elbows, sacrum)", False, False),
        ("  β–Έ Anaemia: pallor", False, False),
        ("  β–Έ Lymphadenopathy", False, False),
        ("  β–Έ Splenomegaly (Felty's)", False, False),
        ("", False, False),
        ("FUNCTIONAL:", True, False),
        ("  β–Έ HAQ (Health Assessment Questionnaire)", False, False),
        ("  β–Έ DAS28 disease activity score", False, False),
    ]
)

disease_investigations(
    "Rheumatoid Arthritis", "🟠", accent_ra, bg_ra,
    [
        ("SEROLOGY:", True, False),
        ("  β–Έ RF β€” +ve 80% (not specific)", False, False),
        ("  β–Έ Anti-CCP β€” most specific (>95%)", False, False),
        ("  β–Έ ANA β€” may be +ve (low titre)", False, False),
        ("", False, False),
        ("INFLAMMATORY MARKERS:", True, False),
        ("  β–Έ ESR, CRP β€” elevated", False, False),
        ("  β–Έ CBC: normocytic normochromic anaemia, thrombocytosis", False, False),
        ("", False, False),
        ("IMAGING:", True, False),
        ("  β–Έ X-ray hands/feet:", False, False),
        ("     Early: periarticular osteopenia, soft tissue swelling", False, False),
        ("     Late: erosions, joint space narrowing, subluxation", False, False),
        ("  β–Έ MRI: detects early synovitis and erosions", False, False),
        ("  β–Έ USS: synovitis, power Doppler", False, False),
        ("", False, False),
        ("SYNOVIAL FLUID:", True, False),
        ("  β–Έ >2000 WBC/mmΒ³ (inflammatory pattern)", False, False),
        ("  β–Έ No crystals (differentiates from gout/pseudogout)", False, False),
    ],
    [
        ("STEP 1 β€” SYMPTOM CONTROL:", True, False),
        ("  β–Έ NSAIDs β€” pain relief (SOR: C)", False, False),
        ("  β–Έ Low-dose corticosteroids (bridging)", False, False),
        ("", False, False),
        ("STEP 2 β€” DMARDs (start ASAP):", True, False),
        ("  β–Έ Methotrexate β€” FIRST-LINE (most used globally)", False, False),
        ("     Folic acid 1mg/day alongside MTX", False, False),
        ("     Monitor LFTs, CBC every 4–6 weeks", False, False),
        ("  β–Έ Sulfasalazine β€” 2–3g/day", False, False),
        ("  β–Έ Hydroxychloroquine β€” mild disease", False, False),
        ("  β–Έ Combination DMARDs for severe disease", False, False),
        ("", False, False),
        ("STEP 3 β€” BIOLOGICS:", True, False),
        ("  β–Έ Anti-TNF: Etanercept, Infliximab, Adalimumab", False, False),
        ("  β–Έ Anti-IL-6: Tocilizumab", False, False),
        ("  β–Έ B-cell: Rituximab", False, False),
        ("", False, False),
        ("MONITORING:", True, False),
        ("  β–Έ DAS28, X-ray progression, LFTs, CBC", False, False),
    ]
)

# ════════════════════════════════════════════════════════════════════════════
# DISEASE 3 β€” SLE
# ════════════════════════════════════════════════════════════════════════════
accent_sle, bg_sle = COLORS["SLE"]

disease_overview(
    "Systemic Lupus Erythematosus (SLE)", "🟑",
    "Chronic multisystem autoimmune β€” classic immune complex disease",
    [
        ("β€’ Female:Male = 10:1  |  Incidence: 1 in 700 women (20–60 yrs)", True, False),
        ("β€’ Black women: 1 in 250 (higher incidence + severity)", False, False),
        ("β€’ Chronic remitting and relapsing course", False, False),
        ("β€’ Classic immune-complex mediated disease", False, False),
        ("", False, False),
        ("SLICC CRITERIA (need β‰₯4 or biopsy-proven nephritis + ANA/anti-dsDNA):", True, False),
        ("  1. Malar (butterfly) rash", False, False),
        ("  2. Discoid rash", False, False),
        ("  3. Photosensitivity", False, False),
        ("  4. Oral ulcers (painless)", False, False),
        ("  5. Non-scarring alopecia", False, False),
        ("  6. Arthritis (non-erosive, β‰₯2 joints)", False, False),
        ("  7. Serositis (pleuritis/pericarditis)", False, False),
        ("  8. Renal: proteinuria >500mg/day or RBC casts", False, False),
        ("  9. Neurological: seizures, psychosis", False, False),
        ("  10. Haematological: haemolytic anaemia / leukopenia / thrombocytopenia", False, False),
        ("  11. Immunological: anti-dsDNA, anti-Sm, antiphospholipid antibodies", False, False),
        ("  12. ANA positive", False, False),
    ],
    accent_sle, bg_sle,
    [
        ("Genetic + Environmental β†’ breakdown of self-tolerance", False, False),
        ("HLA-DR2/DR3 association (OR 2–3 each)", False, False),
        ("", False, False),
        ("Trigger: UV light β†’ apoptosis of skin cells β†’ nuclear antigens released", False, False),
        ("IFN-Ξ± signature: plasmacytoid DCs produce excess IFN-Ξ±", False, False),
        ("TLR9, TLR7 activation by self-DNA/RNA β†’ B-cell activation", False, False),
        ("", False, False),
        ("Autoantibodies:", True, False),
        ("  Anti-dsDNA β€” most specific; correlates with activity", False, False),
        ("  Anti-Sm β€” highly specific (low sensitivity)", False, False),
        ("  ANA β€” 95–99% sensitivity (screening)", False, False),
        ("  Antiphospholipid β€” thrombosis risk", False, False),
        ("", False, False),
        ("Immune complex deposition:", True, False),
        ("  Deposits in kidneys, skin, joints, vessels", False, False),
        ("  β†’ Complement activation β†’ inflammation", False, False),
        ("  β†’ Glomerulonephritis (Class I–V)", False, False),
        ("", False, False),
        ("Complement C3, C4 consumed β†’ levels fall during active disease", False, False),
    ]
)

disease_clinical(
    "SLE", "🟑", accent_sle, bg_sle,
    [
        ("SKIN (most visible):", True, False),
        ("  β€’ Malar (butterfly) rash β€” over cheeks/nose, spares nasolabial folds", False, False),
        ("  β€’ Discoid rash β€” scarring, follicular plugging", False, False),
        ("  β€’ Photosensitivity", False, False),
        ("  β€’ Oral/nasal ulcers (painless)", False, False),
        ("  β€’ Alopecia (frontal hairline)", False, False),
        ("  β€’ Raynaud's phenomenon", False, False),
        ("", False, False),
        ("MSK:", True, False),
        ("  β€’ Arthritis/arthralgia (non-erosive) β€” most common symptom", False, False),
        ("  β€’ Jaccoud's arthropathy (reducible deformities)", False, False),
        ("", False, False),
        ("RENAL:", True, False),
        ("  β€’ Lupus nephritis β€” leading cause of mortality", False, False),
        ("  β€’ Haematuria, proteinuria, oedema, hypertension", False, False),
        ("", False, False),
        ("NEURO:", True, False),
        ("  β€’ Seizures, psychosis, headache, CNS vasculitis", False, False),
        ("", False, False),
        ("CARDIAC/PULMONARY:", True, False),
        ("  β€’ Pericarditis, Libman-Sacks endocarditis", False, False),
        ("  β€’ Pleuritis, pneumonitis", False, False),
        ("HAEMATOLOGICAL:", True, False),
        ("  β€’ Haemolytic anaemia, leukopenia, thrombocytopenia", False, False),
    ],
    [
        ("GENERAL:", True, False),
        ("  β–Έ BP (renal involvement?)", False, False),
        ("  β–Έ Lymphadenopathy", False, False),
        ("  β–Έ Weight, temperature", False, False),
        ("", False, False),
        ("FACE/SKIN:", True, False),
        ("  β–Έ Butterfly rash: over malar areas (not nasolabial folds)", False, False),
        ("  β–Έ Discoid lesions, photosensitive rash", False, False),
        ("  β–Έ Oral ulcers: inspect buccal mucosa", False, False),
        ("  β–Έ Scalp: alopecia pattern", False, False),
        ("", False, False),
        ("MSK:", True, False),
        ("  β–Έ Tender swollen joints (non-erosive)", False, False),
        ("  β–Έ Jaccoud's deformity (reducible)", False, False),
        ("", False, False),
        ("CARDIOVASCULAR:", True, False),
        ("  β–Έ Pericardial rub", False, False),
        ("  β–Έ Murmur (Libman-Sacks)", False, False),
        ("", False, False),
        ("RESPIRATORY:", True, False),
        ("  β–Έ Pleural rub, reduced breath sounds", False, False),
        ("", False, False),
        ("ABDOMINAL:", True, False),
        ("  β–Έ Hepatosplenomegaly", False, False),
        ("  β–Έ Renal angle tenderness", False, False),
        ("", False, False),
        ("NEURO:", True, False),
        ("  β–Έ Cognitive testing, cranial nerves", False, False),
    ]
)

disease_investigations(
    "SLE", "🟑", accent_sle, bg_sle,
    [
        ("SEROLOGY (key):", True, False),
        ("  β–Έ ANA β€” 95–99% sensitivity (screening test)", False, False),
        ("  β–Έ Anti-dsDNA β€” MOST SPECIFIC; correlates with activity", False, False),
        ("  β–Έ Anti-Sm β€” highly specific (low sensitivity)", False, False),
        ("  β–Έ Antiphospholipid Ab (lupus anticoag, anti-cardiolipin)", False, False),
        ("  β–Έ Anti-Ro/La β€” neonatal lupus, Sjogren's overlap", False, False),
        ("", False, False),
        ("COMPLEMENT:", True, False),
        ("  β–Έ C3, C4 β€” LOW during active disease (consumed)", False, False),
        ("", False, False),
        ("HAEMATOLOGY:", True, False),
        ("  β–Έ CBC: haemolytic anaemia, leukopenia, thrombocytopenia", False, False),
        ("  β–Έ Direct Coombs test β€” +ve in haemolytic anaemia", False, False),
        ("", False, False),
        ("RENAL:", True, False),
        ("  β–Έ Urine: protein, RBC casts, haematuria", False, False),
        ("  β–Έ 24-hr urine protein / spot protein:creatinine", False, False),
        ("  β–Έ Renal biopsy β€” definitive for nephritis class (I–V)", False, False),
        ("", False, False),
        ("OTHER:", True, False),
        ("  β–Έ ESR elevated; CRP often NORMAL (unlike other inflammatory diseases)", False, False),
        ("  β–Έ ECHO, CXR, brain MRI as indicated", False, False),
    ],
    [
        ("FOR ALL SLE PATIENTS:", True, False),
        ("  β–Έ Hydroxychloroquine (Plaquenil) β€” reduces flares, improves survival", False, False),
        ("  β–Έ Sun protection (SPF 50+)", False, False),
        ("", False, False),
        ("MILD DISEASE:", True, False),
        ("  β–Έ NSAIDs β€” arthritis, serositis", False, False),
        ("  β–Έ Low-dose corticosteroids", False, False),
        ("", False, False),
        ("MODERATE–SEVERE:", True, False),
        ("  β–Έ High-dose corticosteroids (prednisolone)", False, False),
        ("  β–Έ Mycophenolate mofetil (nephritis)", False, False),
        ("  β–Έ Cyclophosphamide (severe renal/CNS)", False, False),
        ("  β–Έ Azathioprine (maintenance)", False, False),
        ("", False, False),
        ("BIOLOGIC:", True, False),
        ("  β–Έ Belimumab (anti-BAFF) β€” FDA approved for SLE", False, False),
        ("  β–Έ Anifrolumab (anti-IFN-Ξ± receptor) β€” newer", False, False),
        ("", False, False),
        ("MONITORING:", True, False),
        ("  β–Έ Anti-dsDNA titres, C3/C4, renal function, BP", False, False),
        ("  β–Έ Flare: ↑anti-dsDNA + ↓C3/C4", False, False),
    ]
)

# ════════════════════════════════════════════════════════════════════════════
# DISEASE 4 β€” ANKYLOSING SPONDYLITIS
# ════════════════════════════════════════════════════════════════════════════
accent_as, bg_as = COLORS["AS"]

disease_overview(
    "Ankylosing Spondylitis", "πŸ”΅",
    "Chronic inflammatory axial spondyloarthropathy",
    [
        ("β€’ Male:Female = 5:1  |  Age: 20s–30s", True, False),
        ("β€’ HLA-B27 positive in ~90% of patients", False, False),
        ("β€’ Primarily affects sacroiliac joints and spine", False, False),
        ("β€’ Seronegative spondyloarthropathy (RF, ANA negative)", False, False),
        ("", False, False),
        ("CLASSIC CLUE: Back pain in a man <40 years:", True, False),
        ("  β–Έ Relieved by exercise, NOT rest", False, False),
        ("  β–Έ Morning stiffness improving with activity/hot shower", False, False),
        ("  β–Έ Insidious onset over months", False, False),
        ("", False, False),
        ("PROGRESSION:", True, False),
        ("  Sacroiliitis β†’ Lumbar involvement β†’ Thoracic β†’ Cervical", False, False),
        ("  Ossification β†’ Bamboo spine (late, irreversible)", False, False),
        ("", False, False),
        ("SECONDARY AS (associated conditions):", True, False),
        ("  β–Έ Inflammatory bowel disease (Crohn's/UC)", False, False),
        ("  β–Έ Psoriasis", False, False),
        ("  β–Έ Reactive arthritis (Reiter syndrome)", False, False),
    ],
    accent_as, bg_as,
    [
        ("Inflammation at entheses (ligament/tendon insertion sites)", False, False),
        ("Annulus fibrosis–vertebral bone junction affected first", False, False),
        ("", False, False),
        ("Sequence:", True, False),
        ("  Enthesitis β†’ Fibrocartilage β†’ Ossification β†’ Syndesmophytes β†’ Fusion", False, False),
        ("  'Bamboo spine' = complete vertebral fusion (late finding)", False, False),
        ("", False, False),
        ("HLA-B27:", True, False),
        ("  Strong association but NOT diagnostic alone", False, False),
        ("  +ve in 90% AS vs 6–8% general population", False, False),
        ("  Mechanism unclear (arthritogenic peptide hypothesis)", False, False),
        ("", False, False),
        ("Sacroiliac Joints:", True, False),
        ("  Earliest involvement: bilateral sacroiliitis", False, False),
        ("  Progression: erosions β†’ sclerosis β†’ fusion", False, False),
        ("", False, False),
        ("Extra-articular involvement:", True, False),
        ("  Costovertebral joints β†’ restricted chest expansion", False, False),
        ("  Hip/shoulder joints (proximal large joints)", False, False),
        ("  Peripheral joints less commonly", False, False),
    ]
)

disease_clinical(
    "Ankylosing Spondylitis", "πŸ”΅", accent_as, bg_as,
    [
        ("AXIAL FEATURES:", True, False),
        ("  β€’ Insidious low back / buttock / sacroiliac pain", False, False),
        ("  β€’ Pain worse at rest, better with activity", False, False),
        ("  β€’ Morning stiffness (relieved by hot shower/exercise)", False, False),
        ("  β€’ Night pain β†’ fatigue, malaise", False, False),
        ("  β€’ Progressive stiffness and reduced spinal mobility", False, False),
        ("", False, False),
        ("PERIPHERAL:", True, False),
        ("  β€’ Hip and shoulder involvement common", False, False),
        ("  β€’ Peripheral arthritis (asymmetric, lower limb)", False, False),
        ("", False, False),
        ("EXTRA-ARTICULAR:", True, False),
        ("  β€’ Acute anterior uveitis (iritis) β€” MOST COMMON extra-articular feature", False, False),
        ("     Red, painful eye with photophobia", False, False),
        ("  β€’ Aortitis β†’ aortic regurgitation", False, False),
        ("  β€’ Restricted chest expansion β†’ breathlessness", False, False),
        ("  β€’ Apical lung fibrosis (late)", False, False),
        ("  β€’ Cauda equina syndrome (late neurological complication)", False, False),
        ("", False, False),
        ("LATE SIGNS:", True, False),
        ("  β€’ 'Question mark posture': hyperkyphosis + forward stoop", False, False),
        ("  β€’ Chest: restricted expansion", False, False),
        ("  β€’ Fixed cervical kyphosis", False, False),
    ],
    [
        ("SACROILIAC TESTS:", True, False),
        ("  β–Έ FABER (Patrick's) test β€” SI joint pain", False, False),
        ("  β–Έ Gaenslen's test β€” SI stress", False, False),
        ("  β–Έ Direct SI joint palpation β€” bilateral tenderness", False, False),
        ("", False, False),
        ("SPINAL MOBILITY:", True, False),
        ("  β–Έ Schober's test:", False, False),
        ("     Mark 5cm below + 10cm above L5", False, False),
        ("     Normal: increase >5cm on forward flexion", False, False),
        ("     AS: <5cm = reduced lumbar flexion", False, False),
        ("  β–Έ Chest expansion:", False, False),
        ("     Normal: 5–7cm at nipple line", False, False),
        ("     AS: <5cm (costovertebral involvement)", False, False),
        ("  β–Έ Occiput-to-wall distance (cervical involvement)", False, False),
        ("  β–Έ Lateral lumbar flexion", False, False),
        ("", False, False),
        ("POSTURE:", True, False),
        ("  β–Έ Stooped posture, loss of lumbar lordosis", False, False),
        ("  β–Έ Increased thoracic kyphosis", False, False),
        ("", False, False),
        ("EYES:", True, False),
        ("  β–Έ Inspect for acute red eye (uveitis)", False, False),
    ]
)

disease_investigations(
    "Ankylosing Spondylitis", "πŸ”΅", accent_as, bg_as,
    [
        ("SEROLOGY:", True, False),
        ("  β–Έ HLA-B27 β€” +ve in ~90% (not diagnostic alone)", False, False),
        ("  β–Έ ESR / CRP β€” elevated in active disease", False, False),
        ("  β–Έ RF β€” NEGATIVE (seronegative)", False, False),
        ("  β–Έ ANA β€” NEGATIVE", False, False),
        ("", False, False),
        ("IMAGING:", True, False),
        ("  β–Έ X-ray pelvis (first investigation):", False, False),
        ("     Bilateral sacroiliitis β€” EARLIEST X-ray finding", False, False),
        ("     Erosions, subchondral sclerosis β†’ fusion", False, False),
        ("  β–Έ X-ray spine:", False, False),
        ("     Squaring of vertebrae (shiny corners)", False, False),
        ("     Syndesmophytes β†’ Bamboo spine (late)", False, False),
        ("  β–Έ MRI sacroiliac joints:", False, False),
        ("     MOST SENSITIVE for early sacroiliitis", False, False),
        ("     Bone marrow oedema (before X-ray changes)", False, False),
        ("  β–Έ CT: if X-ray inconclusive", False, False),
        ("", False, False),
        ("OTHER:", True, False),
        ("  β–Έ CBC: mild normocytic anaemia", False, False),
        ("  β–Έ Pulmonary function tests (chest restriction)", False, False),
        ("  β–Έ ECG / ECHO (aortic root, conduction)", False, False),
    ],
    [
        ("FIRST-LINE:", True, False),
        ("  β–Έ NSAIDs β€” mainstay of therapy", False, False),
        ("     70–80% report substantial relief", False, False),
        ("     Continuous NSAID use may slow radiographic progression", False, False),
        ("  β–Έ Physiotherapy:", False, False),
        ("     Back extensor strengthening", False, False),
        ("     Maintain erect posture", False, False),
        ("     Swimming, deep breathing exercises", False, False),
        ("", False, False),
        ("PERIPHERAL JOINT DISEASE:", True, False),
        ("  β–Έ Sulfasalazine", False, False),
        ("", False, False),
        ("REFRACTORY DISEASE:", True, False),
        ("  β–Έ Anti-TNF biologics:", False, False),
        ("     Etanercept, Adalimumab, Infliximab, Golimumab", False, False),
        ("  β–Έ IL-17 inhibitors:", False, False),
        ("     Secukinumab, Ixekizumab", False, False),
        ("", False, False),
        ("LIFESTYLE:", True, False),
        ("  β–Έ Sleep on firm mattress, spine erect", False, False),
        ("  β–Έ Avoid heavy lifting, trauma to neck", False, False),
        ("  β–Έ Regular spinal mobility exercises", False, False),
        ("  β–Έ Stop smoking (reduces lung complications)", False, False),
    ]
)

# ════════════════════════════════════════════════════════════════════════════
# DISEASE 5 β€” GOUT
# ════════════════════════════════════════════════════════════════════════════
accent_gt, bg_gt = COLORS["GT"]

disease_overview(
    "Gout", "🟒",
    "Purine metabolism disorder β†’ urate crystal deposition",
    [
        ("β€’ Men 40–60 years most commonly affected", True, False),
        ("β€’ Postmenopausal women also affected (less common)", False, False),
        ("β€’ Hyperuricemia: >8 mg/dL men; >7 mg/dL women", True, False),
        ("β€’ Only 5–10% of hyperuricaemics develop gout", False, False),
        ("β€’ Takes ~20 years of hyperuricemia before first attack", False, False),
        ("", False, False),
        ("4 CLINICAL STAGES:", True, False),
        ("  1. Asymptomatic Hyperuricemia β€” high uric acid, no symptoms", False, False),
        ("  2. Acute Gouty Arthritis β€” sudden severe monoarthritis", False, False),
        ("  3. Intercritical Gout β€” symptom-free intervals between attacks", False, False),
        ("  4. Chronic Tophaceous Gout β€” tophi, chronic polyarthritis", False, False),
        ("", False, False),
        ("PODAGRA = 1st MTP joint involvement (50% of first attacks)", True, False),
        ("", False, False),
        ("COMPLICATIONS:", True, False),
        ("  β–Έ Urate nephropathy (renal damage)", False, False),
        ("  β–Έ Tophi (urate deposits in soft tissue/bone)", False, False),
        ("  β–Έ Uric acid urinary calculi", False, False),
    ],
    accent_gt, bg_gt,
    [
        ("Uric acid = end product of purine metabolism", False, False),
        ("Sources: diet (purines) + endogenous purine synthesis", False, False),
        ("", False, False),
        ("Causes of Hyperuricemia:", True, False),
        ("  PRIMARY (90%): Reduced uric acid excretion", False, False),
        ("  PRIMARY (10%): Increased uric acid production", False, False),
        ("  SECONDARY: Diseases (haem. malignancy, psoriasis, CKD)", False, False),
        ("  DRUG-INDUCED: Thiazides, aspirin (low dose), cyclosporin", False, False),
        ("", False, False),
        ("Crystal Formation:", True, False),
        ("  Supersaturation β†’ Monosodium Urate (MSU) crystals form", False, False),
        ("  Deposits in cooler joints (1st MTP, heels)", False, False),
        ("  Crystals activate NLRP3 inflammasome β†’ IL-1Ξ² β†’ acute inflammation", False, False),
        ("", False, False),
        ("Why 1st MTP Joint?:", True, False),
        ("  β–Έ More microtrauma", False, False),
        ("  β–Έ Relatively cooler temperature", False, False),
        ("  β–Έ More dependent position", False, False),
        ("", False, False),
        ("Tophi:", True, False),
        ("  Chronic MSU deposits in soft tissue, cartilage, bone", False, False),
        ("  Sites: ear helix, olecranon, Achilles, MTP joints", False, False),
    ]
)

disease_clinical(
    "Gout", "🟒", accent_gt, bg_gt,
    [
        ("ACUTE ATTACK:", True, False),
        ("  β€’ Sudden onset β€” often nocturnal", False, False),
        ("  β€’ Exquisitely painful, red, hot, swollen joint", False, False),
        ("  β€’ 1st MTP joint (great toe) β€” PODAGRA in 50%", False, False),
        ("  β€’ Also: ankle, knee, heel, midtarsal, olecranon bursa", False, False),
        ("  β€’ Resolves in days to weeks (even untreated)", False, False),
        ("  β€’ Low-grade fever, leukocytosis may be present", False, False),
        ("", False, False),
        ("INTERCRITICAL PERIOD:", True, False),
        ("  β€’ Completely asymptomatic between attacks", False, False),
        ("  β€’ Attacks become more frequent and polyarticular over time", False, False),
        ("", False, False),
        ("CHRONIC TOPHACEOUS GOUT:", True, False),
        ("  β€’ Tophi: firm, irregular deposits", False, False),
        ("     Ear helix, olecranon bursa, Achilles tendon", False, False),
        ("     Fingers, toes (may mimic RA nodules)", False, False),
        ("  β€’ Chronic joint pain and deformity", False, False),
        ("", False, False),
        ("IN ELDERLY WOMEN:", True, False),
        ("  β€’ Often polyarticular (mimics RA)", False, False),
        ("  β€’ Tophi mistaken for rheumatoid nodules", False, False),
        ("  β€’ Associated with diuretic use", False, False),
    ],
    [
        ("JOINT EXAMINATION:", True, False),
        ("  β–Έ Acutely: exquisitely tender, cannot bear touch or weight", False, False),
        ("  β–Έ Swelling, erythema, warmth of 1st MTP joint", False, False),
        ("  β–Έ Skin: shiny, tense, may desquamate after attack", False, False),
        ("", False, False),
        ("TOPHI EXAMINATION:", True, False),
        ("  β–Έ Ear helix β€” firm, white/yellow deposits", False, False),
        ("  β–Έ Olecranon bursa", False, False),
        ("  β–Έ Achilles tendon", False, False),
        ("  β–Έ Finger/toe joints", False, False),
        ("", False, False),
        ("SYSTEMIC:", True, False),
        ("  β–Έ BP β€” hypertension common comorbidity", False, False),
        ("  β–Έ BMI / waist circumference (metabolic syndrome)", False, False),
        ("  β–Έ Signs of CKD (oedema, pallor)", False, False),
        ("", False, False),
        ("RENAL:", True, False),
        ("  β–Έ Renal angle tenderness (uric acid stones)", False, False),
        ("", False, False),
        ("FUNCTIONAL:", True, False),
        ("  β–Έ Weight-bearing, gait assessment", False, False),
        ("  β–Έ Impact on daily activities", False, False),
    ]
)

disease_investigations(
    "Gout", "🟒", accent_gt, bg_gt,
    [
        ("⭐ GOLD STANDARD:", True, False),
        ("  Synovial fluid analysis:", False, False),
        ("  β–Έ Needle-shaped, NEGATIVELY BIREFRINGENT urate crystals", False, False),
        ("  β–Έ Under polarised light microscopy", False, False),
        ("  β–Έ Culture -ve (rules out septic arthritis)", False, False),
        ("", False, False),
        ("BLOOD:", True, False),
        ("  β–Έ Serum uric acid β€” usually >8 mg/dL", False, False),
        ("     NOTE: can be NORMAL during acute attack!", False, False),
        ("  β–Έ ESR, CRP, WBC β€” elevated during acute attack", False, False),
        ("  β–Έ Renal function (urate nephropathy)", False, False),
        ("  β–Έ Fasting glucose, lipids (metabolic syndrome)", False, False),
        ("", False, False),
        ("URINE:", True, False),
        ("  β–Έ 24-hr urine uric acid β€” differentiates over-producers vs under-excretors", False, False),
        ("  β–Έ Urine microscopy (uric acid crystals in renal calculi)", False, False),
        ("", False, False),
        ("IMAGING:", True, False),
        ("  β–Έ X-ray: punched-out erosions with sclerotic margins ('rat bite')", False, False),
        ("     Soft tissue tophi calcification (late)", False, False),
        ("  β–Έ Ultrasound: double contour sign (urate on cartilage)", False, False),
        ("  β–Έ DECT (dual-energy CT): urate deposits (if doubt)", False, False),
    ],
    [
        ("ACUTE ATTACK:", True, False),
        ("  β–Έ NSAIDs (Indomethacin 50mg TDS) β€” first-line", False, False),
        ("  β–Έ Colchicine β€” very effective if given EARLY", False, False),
        ("     0.5–1mg initially, then 0.5mg every 2–3 hrs (max 6mg/attack)", False, False),
        ("  β–Έ Corticosteroids β€” if NSAIDs/colchicine contraindicated", False, False),
        ("     (Prednisolone 30–35mg/day, 5-day course)", False, False),
        ("  β–Έ Joint aspiration β€” diagnostic + therapeutic", False, False),
        ("", False, False),
        ("URATE-LOWERING THERAPY (after acute attack settles):", True, False),
        ("  β–Έ Allopurinol β€” xanthine oxidase inhibitor (reduces production)", False, False),
        ("     Target: uric acid <6 mg/dL (5 mg/dL in tophaceous gout)", False, False),
        ("  β–Έ Febuxostat β€” alternative to allopurinol", False, False),
        ("  β–Έ Probenecid β€” uricosuric (increases renal excretion)", False, False),
        ("", False, False),
        ("DIETARY ADVICE:", True, False),
        ("  β–Έ Avoid: red meat, organ meats, shellfish, alcohol (esp. beer)", False, False),
        ("  β–Έ Avoid: fructose-rich drinks", False, False),
        ("  β–Έ Encourage: hydration (β‰₯2L/day), low-fat dairy", False, False),
        ("  β–Έ Weight loss (reduces uric acid)", False, False),
    ]
)

# ════════════════════════════════════════════════════════════════════════════
# SLIDE: DIFFERENTIAL DIAGNOSIS TABLE
# ════════════════════════════════════════════════════════════════════════════
accent_dd, bg_dd = COLORS["DD"]

slide = prs.slides.add_slide(blank_layout)
fill_slide_bg(slide, DARK_BG)
add_rect(slide, 0, 0, 0.18, 7.5, accent_dd)
add_rect(slide, 0.18, 0, 13.153, 1.1, RGBColor(0x12, 0x24, 0x38))
add_text(slide, "βš–οΈ  Differential Diagnosis of Arthritis",
         0.35, 0.1, 10.5, 0.8, 28, bold=True, color=WHITE, valign=MSO_ANCHOR.MIDDLE)
add_rect(slide, 11.0, 0.12, 2.15, 0.42, accent_dd)
add_text(slide, "DIFF. DIAGNOSIS", 11.0, 0.12, 2.15, 0.42, 9, bold=True,
         color=WHITE, align=PP_ALIGN.CENTER, valign=MSO_ANCHOR.MIDDLE)

# Table data
headers = ["Feature", "Rheumatic Fever", "Rheumatoid Arthritis", "SLE", "Ankylosing Spondylitis", "Gout"]
rows = [
    ["Sex",          "M=F (children)",    "F>M (3:1)",        "F>>M (10:1)",     "M>>F (5:1)",         "M>F"],
    ["Age",          "4–9 years",         "20–50 years",       "20–40 years",     "20–30 years",        "40–60 years"],
    ["Joints",       "Large, migratory",  "Small, symmetric",  "Non-erosive poly","Sacroiliac, spine",  "1st MTP, mono"],
    ["Onset",        "Acute, post-URTI",  "Insidious",         "Variable",        "Insidious",          "Acute nocturnal"],
    ["Morn. stiff.", "β€”",                 ">1 hour",           "Variable",        "Yes (↑ with rest)",  "Not typical"],
    ["Key Ab/test",  "ASO titer",         "RF, Anti-CCP",      "ANA, anti-dsDNA", "HLA-B27",            "Urate crystals"],
    ["X-ray",        "Normal",            "Erosions, osteopenia","Usually normal","Sacroiliitis, bamboo","Punched-out erosions"],
    ["Hallmark",     "Jones criteria",    "Symmetric synovitis","Butterfly rash", "Bamboo spine",       "Podagra"],
]

col_colors = [RGBColor(0xE8,0x3A,0x3A), RGBColor(0xE8,0x7D,0x1E),
              RGBColor(0xF5,0xC5,0x18), RGBColor(0x22,0x96,0xF3), RGBColor(0x27,0xAE,0x60)]

col_widths = [1.6, 1.9, 1.9, 1.7, 2.2, 1.7]
x_starts   = [0.22]
for w in col_widths[:-1]:
    x_starts.append(x_starts[-1] + w)

# Header row
for ci, (hdr, cw, cx) in enumerate(zip(headers, col_widths, x_starts)):
    hdr_col = RGBColor(0x1E,0x35,0x52) if ci == 0 else col_colors[ci-1]
    add_rect(slide, cx, 1.15, cw - 0.03, 0.45, hdr_col)
    add_text(slide, hdr, cx+0.04, 1.15, cw-0.1, 0.45, 9.5, bold=True,
             color=WHITE, align=PP_ALIGN.CENTER, valign=MSO_ANCHOR.MIDDLE)

# Data rows
row_h = 0.58
for ri, row in enumerate(rows):
    y = 1.6 + ri * row_h
    row_bg = RGBColor(0x14,0x2A,0x40) if ri % 2 == 0 else RGBColor(0x0D,0x1B,0x2A)
    for ci, (cell, cw, cx) in enumerate(zip(row, col_widths, x_starts)):
        add_rect(slide, cx, y, cw-0.03, row_h-0.03, row_bg)
        txt_color = MID_GREY if ci == 0 else WHITE
        bld = ci == 0
        add_text(slide, cell, cx+0.04, y+0.02, cw-0.1, row_h-0.06, 9,
                 bold=bld, color=txt_color, align=PP_ALIGN.CENTER, valign=MSO_ANCHOR.MIDDLE)

add_rect(slide, 0.18, 7.25, 13.153, 0.25, RGBColor(0x0A, 0x14, 0x22))
add_text(slide, "Topic 47 β€” Immunological & Metabolic Disorders  |  AyUG-RN II BAMS NCISM",
         0.3, 7.25, 12.0, 0.25, 8, color=RGBColor(0x55,0x66,0x77))


# ════════════════════════════════════════════════════════════════════════════
# FINAL SUMMARY / QUICK REVISION CARD
# ════════════════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank_layout)
fill_slide_bg(slide, DARK_BG)
add_rect(slide, 0, 0, 13.333, 0.12, RGBColor(0xE8,0x3A,0x3A))
add_rect(slide, 0, 7.38, 13.333, 0.12, RGBColor(0x27,0xAE,0x60))
add_rect(slide, 0.2, 0.2, 12.933, 1.0, RGBColor(0x12,0x24,0x38))
add_text(slide, "🧠  Quick Revision β€” High-Yield Points", 0.3, 0.22, 12.0, 0.85,
         26, bold=True, color=WHITE, valign=MSO_ANCHOR.MIDDLE)

quick_data = [
    ("πŸ”΄ RF",  accent_rf,  ["Jones criteria: 2 Major or 1M+2m + GAS evidence",
                              "ASO titer = most useful lab test",
                              "Migratory polyarthritis + Carditis (mitral valve)",
                              "Prophylaxis: Benzathine Penicillin"]),
    ("🟠 RA",  accent_ra,  ["Symmetric synovitis + morning stiffness >1hr",
                              "RF + Anti-CCP antibodies",
                              "MCP/PIP involved (DIP spared)",
                              "First-line DMARD: Methotrexate"]),
    ("🟑 SLE", accent_sle, ["ANA (screen) + Anti-dsDNA (most specific)",
                              "Butterfly rash, oral ulcers, photosensitivity",
                              "C3/C4 LOW in active disease",
                              "All patients: Hydroxychloroquine"]),
    ("πŸ”΅ AS",  accent_as,  ["HLA-B27 +ve in ~90%",
                              "Back pain relieved by exercise, not rest",
                              "Schober's test, chest expansion",
                              "MRI = earliest; X-ray = bamboo spine"]),
    ("🟒 GT",  accent_gt,  ["Negatively birefringent crystals = gold standard",
                              "Podagra = 1st MTP joint",
                              "Uric acid can be NORMAL in acute attack",
                              "Acute: NSAIDs/Colchicine | Chronic: Allopurinol"]),
]

card_w = 2.4
for i, (label, col, pts) in enumerate(quick_data):
    cx = 0.25 + i * (card_w + 0.1)
    add_rect(slide, cx, 1.35, card_w, 0.45, col)
    add_text(slide, label, cx, 1.35, card_w, 0.45, 12, bold=True,
             color=WHITE, align=PP_ALIGN.CENTER, valign=MSO_ANCHOR.MIDDLE)
    add_rect(slide, cx, 1.8, card_w, 5.35, RGBColor(0x14,0x28,0x3E))
    lines = [(p, False, False) for p in pts]
    add_multiline(slide, lines, cx+0.1, 1.88, card_w-0.15, 5.2, 10.5,
                  RGBColor(0xCC,0xDD,0xEE))

add_rect(slide, 0.18, 7.25, 13.153, 0.25, RGBColor(0x0A,0x14,0x22))
add_text(slide, "Topic 47 β€” Immunological & Metabolic Disorders  |  AyUG-RN II BAMS NCISM",
         0.3, 7.25, 12.0, 0.25, 8, color=RGBColor(0x55,0x66,0x77))


# ════════════════════════════════════════════════════════════════════════════
# SAVE
# ════════════════════════════════════════════════════════════════════════════
out_path = "/tmp/workspace/immunology-pptx/Topic47_Immunological_Metabolic_Disorders.pptx"
buf = BytesIO()
prs.save(buf)
with open(out_path, "wb") as f:
    f.write(buf.getvalue())

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

cd /tmp/workspace/immunology-pptx && python create_pptx.py

Running Command

ls -lh /tmp/workspace/immunology-pptx/Topic47_Immunological_Metabolic_Disorders.pptx

Your presentation is ready! Here's the download link:

Topic47 Immunological Metabolic Disorders

Presentation Β· PPTX


πŸ“Š What's Inside (18 Slides)

The deck uses a dark navy theme with colour-coded disease cards:
Slide(s)Content
Slide 1Title slide with 5 disease pills
Slides 2–4πŸ”΄ Rheumatic Fever β€” Overview, Clinical, Investigations
Slides 5–7🟠 Rheumatoid Arthritis β€” Overview, Clinical, Investigations
Slides 8–10🟑 SLE β€” Overview, Clinical, Investigations
Slides 11–13πŸ”΅ Ankylosing Spondylitis β€” Overview, Clinical, Investigations
Slides 14–16🟒 Gout β€” Overview, Clinical, Investigations
Slide 17βš–οΈ Full Differential Diagnosis comparison table
Slide 18🧠 Quick Revision card β€” high-yield points for all 5 diseases

Design Features

  • Two-panel layout on every disease slide: left panel (light) for articular/clinical content, right panel (dark) for exam findings or management
  • Colour-coded accent bars per disease for instant identification
  • Bold headers separate each section within slides
  • High-yield points starred (⭐) throughout
  • Works in PowerPoint, LibreOffice, and Google Slides

Yes

The presentation is already created and ready for you to download! Here's the link again:

Topic47 Immunological Metabolic Disorders

Presentation Β· PPTX

Just click to download it. It contains 18 slides covering all 5 diseases β€” Rheumatic Fever, Rheumatoid Arthritis, SLE, Ankylosing Spondylitis, and Gout β€” with clinical features, examination, investigations, management, and a differential diagnosis table. Good luck with your studies! πŸ“š
This is a shared conversation. Sign in to Orris to start your own chat.