~/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)}")