Generate me flash cards of all the eye diseases
What format would you like the flashcards in? · How detailed should each flashcard be? · Who are the flashcards for?
mkdir -p /home/daytona/workspace/eye-flashcards && echo "done"
?
Generate me flash cards of all the eye diseases
~/eye-flashcards/generate_flashcards.py
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import mm
from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, HRFlowable, PageBreak
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.pdfgen import canvas
OUTPUT = "/home/daytona/workspace/eye-flashcards/Eye_Disease_Flashcards.pdf"
# ─────────────────────────────────────────────
# FLASHCARD DATA (source: Kanski's Clinical Ophthalmology 10th ed.)
# ─────────────────────────────────────────────
CARDS = [
# ══════════ SECTION: CONJUNCTIVAL DISEASES ══════════
{
"section": "Conjunctival Diseases",
"title": "Viral Conjunctivitis",
"category": "Infection / Conjunctiva",
"etiology": "Adenovirus (90% of cases; serovars 3,4,7 → PCF; 8,19,37 → EKC). Also HSV, enterovirus, coxsackievirus, molluscum contagiosum.",
"pathophysiology": "Adenovirus survives on dry surfaces for weeks; shed before symptoms appear. Highly contagious via contact with respiratory/ocular secretions or fomites.",
"symptoms": "Unilateral then bilateral watering, redness, irritation/itching, mild photophobia. Sore throat in PCF. Subconjunctival haemorrhage in acute haemorrhagic conjunctivitis.",
"signs": "Follicular conjunctivitis; preauricular lymphadenopathy. EKC: subepithelial corneal infiltrates in 80%. Pseudomembranes in severe cases.",
"investigations": "Usually clinical. PCR/viral culture if atypical or immunocompromised.",
"management": "Supportive: cold compresses, lubricants. Topical antihistamines for itch. Topical povidone-iodine 0.6% or topical antivirals for EKC. Strict hygiene/isolation.",
"complications": "Subepithelial infiltrates (EKC) → reduced VA; symblepharon; dry-eye syndrome.",
"pearls": "Do NOT prescribe topical steroids routinely — can prolong viral shedding. EKC is a notifiable disease in many countries.",
},
{
"section": "Conjunctival Diseases",
"title": "Bacterial Conjunctivitis",
"category": "Infection / Conjunctiva",
"etiology": "Staphylococcus aureus (most common in adults), Streptococcus pneumoniae, Haemophilus influenzae (children). Neisseria gonorrhoeae → hyperacute form. Chlamydia trachomatis → inclusion conjunctivitis & trachoma.",
"pathophysiology": "Direct inoculation or spread from skin/nasopharynx flora. Gonococcal — penetrates intact epithelium causing corneal perforation if untreated.",
"symptoms": "Mucopurulent discharge, redness, lid crusting on waking. Gonococcal: profuse purulent discharge, lid oedema, chemosis within 12-24 h of birth (ophthalmia neonatorum) or sexual contact.",
"signs": "Papillary conjunctivitis, mucopurulent discharge. Gonococcal: chemosis, membrane formation, preauricular LN. Trachoma: follicles on upper tarsal conjunctiva, superior pannus, Herbert's pits.",
"investigations": "Gram stain + culture & sensitivity. Giemsa/PCR for chlamydia.",
"management": "Topical broad-spectrum ABx (chloramphenicol, fusidic acid). Gonococcal: systemic ceftriaxone. Chlamydia: oral azithromycin/doxycycline. Trachoma (WHO SAFE strategy).",
"complications": "Corneal ulcer/perforation (gonococcal); conjunctival scarring → trichiasis, entropion, blindness (trachoma).",
"pearls": "Trachoma is the world's leading cause of preventable blindness. Chlamydial inclusion conjunctivitis mimics viral — always test for STI.",
},
{
"section": "Conjunctival Diseases",
"title": "Allergic Conjunctivitis (Seasonal / Perennial)",
"category": "Allergy / Conjunctiva",
"etiology": "Type I IgE-mediated hypersensitivity. Seasonal (SAC): pollens. Perennial (PAC): dust mites, animal dander.",
"pathophysiology": "Mast-cell degranulation → histamine, prostaglandins, leukotrienes → vasodilation, increased permeability, itching.",
"symptoms": "Bilateral itching (hallmark), watering, redness. SAC seasonal; PAC year-round, milder.",
"signs": "Papillary conjunctivitis (small papillae), chemosis, eyelid oedema. No follicles.",
"investigations": "Usually clinical. Skin-prick testing or serum specific IgE to confirm allergen.",
"management": "Avoidance. Topical antihistamines/mast-cell stabilisers (olopatadine, ketotifen). Cold compresses. Short-course topical steroids for severe flares. Oral antihistamines. Allergen immunotherapy.",
"complications": "Chronic low-grade irritation; keratoconus association with vigorous eye rubbing in VKC.",
"pearls": "Vernal keratoconjunctivitis (VKC) is a severe form predominantly in young males in hot climates — cobblestone papillae on upper tarsal plate; shield ulcer of cornea is a vision-threatening complication.",
},
{
"section": "Conjunctival Diseases",
"title": "Vernal Keratoconjunctivitis (VKC)",
"category": "Allergy / Conjunctiva",
"etiology": "Severe allergic inflammation; IgE + cell-mediated (Th2). Males 3:1; onset before age 10 in hot climates.",
"pathophysiology": "Persistent mast-cell and eosinophil activation → giant papillae formation, eosinophilic mediator damage to corneal epithelium → shield ulcer.",
"symptoms": "Intense bilateral itching, photophobia, mucous discharge, blepharospasm. Seasonal worsening in spring/summer.",
"signs": "Cobblestone giant papillae (upper tarsal plate — tarsal VKC) or gelatinous limbal infiltrates with Horner-Trantas dots (limbal VKC). Shield ulcer (sterile corneal ulcer, usually upper cornea).",
"investigations": "Clinical. Conjunctival scraping: eosinophils. Corneal topography if keratoconus suspected.",
"management": "Topical mast-cell stabilisers + antihistamines (olopatadine). Topical steroids for flares (short pulse). Topical cyclosporine 0.05-1% as steroid-sparing. Shield ulcer: debridement ± amniotic membrane graft.",
"complications": "Shield ulcer, corneal scarring, keratoconus (eye rubbing), steroid-induced glaucoma/cataract.",
"pearls": "Avoid chronic steroids — use cyclosporine/tacrolimus for maintenance. VKC usually remits after puberty.",
},
{
"section": "Conjunctival Diseases",
"title": "Ocular Cicatricial Pemphigoid (OCP)",
"category": "Autoimmune / Conjunctiva",
"etiology": "Autoimmune blistering disorder; IgG/IgA auto-antibodies against basement membrane zone (BMZ) components (BP180, β4 integrin).",
"pathophysiology": "Complement-mediated and T-cell-mediated attack on conjunctival BMZ → subepithelial fibrosis and scarring.",
"symptoms": "Chronic bilateral dry eye, irritation, progressive visual loss. May have oral, pharyngeal, and skin blistering.",
"signs": "Subconjunctival fibrosis with progressive fornix foreshortening, symblepharon, ankyloblepharon, trichiasis, corneal vascularisation and opacification.",
"investigations": "Conjunctival biopsy: direct immunofluorescence (IgG/IgA linear BMZ staining). Indirect IF on saline-split skin.",
"management": "Systemic immunosuppression (dapsone first-line, methotrexate, azathioprine, mycophenolate, cyclophosphamide for severe). Rituximab for refractory. Ocular surface lubricants, scleral lenses, mucous membrane grafts, keratoprosthesis.",
"complications": "Corneal blindness from desiccation/vascularisation. Surgical trauma can trigger disease flare.",
"pearls": "Stage by Foster classification (I–IV). Any surgery (cataract, ptosis) can reactivate disease — systemic immunosuppression must be optimised first.",
},
# ══════════ SECTION: CORNEAL DISEASES ══════════
{
"section": "Corneal Diseases",
"title": "Herpes Simplex Keratitis (HSK)",
"category": "Infection / Cornea",
"etiology": "Herpes simplex virus type 1 (HSV-1) reactivation from trigeminal ganglion. Primary infection usually subclinical in childhood.",
"pathophysiology": "Viral replication in epithelium → dendritic ulcer. Immune-mediated stromal disease: disciform keratitis (endotheliitis), necrotising stromal keratitis.",
"symptoms": "Unilateral reduced vision, photophobia, lacrimation, pain (reduced in recurrent stromal disease due to corneal anaesthesia).",
"signs": "Epithelial: dendritic ulcer with terminal bulbs (rose bengal/fluorescein staining). Stromal disciform: central disc oedema, Descemet folds, KPs, mild AC reaction, intact epithelium. Necrotising: dense white stromal infiltrate.",
"investigations": "Clinical. PCR from corneal scrape for definitive diagnosis. Corneal sensation testing (reduced in HSK).",
"management": "Epithelial: topical aciclovir 3% 5×/day or oral aciclovir/valaciclovir × 10 days. Stromal disciform: topical steroid + antiviral cover. Necrotising: systemic antivirals ± careful steroids. Long-term prophylaxis: oral aciclovir 400 mg BD reduces recurrences by 50%.",
"complications": "Corneal scarring, lipid keratopathy, corneal anaesthesia, secondary glaucoma, amblyopia (children).",
"pearls": "NEVER give topical steroids for epithelial disease — worsens it dramatically. Long-term oral aciclovir prophylaxis is evidence-based (HEDS trial).",
},
{
"section": "Corneal Diseases",
"title": "Acanthamoeba Keratitis",
"category": "Infection / Cornea",
"etiology": "Acanthamoeba spp. (free-living amoeba). Strong association with soft contact lens wear and tap water/swimming exposure.",
"pathophysiology": "Trophozoites invade corneal epithelium and stroma; cysts highly resistant to treatment. Perineural infiltration causes severe pain.",
"symptoms": "Severe pain disproportionate to clinical signs, photophobia, reduced vision. History of contact lens use.",
"signs": "Early: pseudodendrites, radial perineuritis (pathognomonic). Late: ring infiltrate, corneal ulceration, anterior chamber reaction.",
"investigations": "Confocal microscopy (cysts/trophozoites in vivo). Corneal scrape for microscopy, culture (non-nutrient agar with E. coli overlay), PCR.",
"management": "PHMB (polyhexamethylene biguanide) 0.02% + propamidine (Brolene) 0.1%, hourly initially tapering over months. No steroids until well controlled. Duration 6-12 months.",
"complications": "Corneal scarring, persistent epithelial defect, scleritis, corneal perforation, penetrating keratoplasty needed.",
"pearls": "Misdiagnosis as HSK is common — always consider Acanthamoeba in contact lens wearers with severe pain. Cysts are hardy; treatment courses are prolonged.",
},
{
"section": "Corneal Diseases",
"title": "Keratoconus",
"category": "Ectasia / Cornea",
"etiology": "Bilateral progressive non-inflammatory corneal ectasia. Onset puberty. Associated with atopy, eye rubbing, Down syndrome, connective tissue disorders.",
"pathophysiology": "Degeneration of corneal stromal collagen and Bowman layer → central/paracentral thinning and protrusion. Enzymatic imbalance (↑ proteases, ↓ inhibitors).",
"symptoms": "Progressive myopia and irregular astigmatism, monocular diplopia, ghosting of images, glare.",
"signs": "Inferior or central stromal thinning/protrusion. Fleischer ring (iron deposits at cone base). Vogt's striae (fine vertical stress lines). Munson's sign (V-shape of lower lid on downgaze). Scissor reflex on retinoscopy.",
"investigations": "Corneal topography/tomography (Pentacam): inferior steepening, thin pachymetry, posterior elevation. Belin-Ambrósio deviation index.",
"management": "Spectacles → RGP contact lenses → scleral lenses. Corneal cross-linking (CXL, riboflavin + UV-A) to halt progression. Intrastromal rings (Intacs) for irregular astigmatism. Penetrating or deep anterior lamellar keratoplasty (DALK) for advanced disease.",
"complications": "Acute hydrops (Descemet rupture → sudden corneal oedema), corneal scarring, visual disability.",
"pearls": "CXL is indicated when progression is documented — stops progression in ~95%. DALK preferred over PK (preserves endothelium, lower rejection risk).",
},
{
"section": "Corneal Diseases",
"title": "Fuchs Endothelial Corneal Dystrophy",
"category": "Dystrophy / Cornea",
"etiology": "Primary degeneration of corneal endothelium. Autosomal dominant; mutation in SLC4A11, TCF4 (trinucleotide repeat). F > M; onset 5th–6th decade.",
"pathophysiology": "Endothelial cells produce excess abnormal Descemet membrane (guttata). Progressive endothelial cell loss → decompensation → corneal oedema.",
"symptoms": "Early: hazy vision on waking (improves during day as epithelial oedema evaporates). Late: persistent blurring, pain from bullous keratopathy.",
"signs": "Guttata (central excrescences on Descemet, 'beaten bronze' appearance on specular microscopy). Corneal stromal and epithelial oedema. Bullae → scarring.",
"investigations": "Specular microscopy: reduced endothelial cell density, enlarged cells, guttata. Pachymetry: increased corneal thickness. Slit lamp: Descemet guttata.",
"management": "Hypertonic saline drops (5%) for oedema. Blowing hair dryer at arm's length to reduce epithelial oedema. Definitive: Descemet membrane endothelial keratoplasty (DMEK) or DSAEK.",
"complications": "Bullous keratopathy (painful ruptured bullae), corneal scarring, secondary infection.",
"pearls": "DMEK is now gold standard — rapid visual recovery, minimal rejection risk. Avoid intraocular surgery (cataract) until keratoplasty planned if endothelial count is critically low.",
},
# ══════════ SECTION: GLAUCOMA ══════════
{
"section": "Glaucoma",
"title": "Primary Open-Angle Glaucoma (POAG)",
"category": "Glaucoma",
"etiology": "Chronic, progressive optic neuropathy. IOP elevation (>21 mmHg) due to increased aqueous outflow resistance at trabecular meshwork. Genetic: MYOC, OPTN, TBK1, NTF4. Risk factors: age, family history, Black ethnicity, myopia, thin CCT.",
"pathophysiology": "Elevated IOP → retinal ganglion cell (RGC) axon compression at lamina cribrosa → ischaemia → progressive RGC apoptosis → RNFL thinning → visual field loss.",
"symptoms": "Asymptomatic until advanced (peripheral visual field loss detected late). Central vision preserved until end stage.",
"signs": "IOP >21 mmHg (may be normal in NTG). Cup:disc ratio >0.6, asymmetry >0.2, notching of neuroretinal rim (ISNT rule violated), splinter haemorrhages, RNFL defects.",
"investigations": "Tonometry (Goldmann applanation). Gonioscopy: open angle. Pachymetry (thin CCT = higher true IOP & glaucoma risk). Visual field (Humphrey 24-2): nasal step, arcuate scotoma, altitudinal defect. OCT: RNFL and ganglion cell complex thinning.",
"management": "IOP reduction ≥20-30%. Prostaglandin analogues (latanoprost, bimatoprost) — first line. Beta-blockers (timolol). CAIs (dorzolamide). Alpha-2 agonists (brimonidine). SLT (selective laser trabeculoplasty). Trabeculectomy or MIGS if medical/laser fails.",
"complications": "Irreversible visual field loss, legal blindness. Medication side effects (bronchospasm with beta-blockers).",
"pearls": "Target IOP should be set individually — 20-25% reduction from baseline typically. SLT is first-line alternative to drops (LiGHT trial). Normal-tension glaucoma (NTG): IOP always ≤21 mmHg yet glaucomatous damage — ischaemia plays key role.",
},
{
"section": "Glaucoma",
"title": "Primary Angle-Closure Glaucoma (PACG)",
"category": "Glaucoma",
"etiology": "Aqueous outflow obstruction by iridotrabecular contact. Risk factors: hypermetropia, shallow anterior chamber, thick/anteriorly positioned lens, Asian ethnicity, female sex, older age.",
"pathophysiology": "Pupil block → aqueous builds up behind iris → iris bowing → angle closure → IOP spike. May be acute, subacute/intermittent or chronic.",
"symptoms": "Acute attack: severe unilateral eye pain, headache, nausea/vomiting, blurred vision with coloured halos around lights. Chronic: often asymptomatic.",
"signs": "Acute: red eye, corneal oedema (steamy), mid-dilated fixed oval pupil, shallow AC, IOP 40-80 mmHg, ciliary congestion. Glaukomflecken (anterior lens capsule opacity — marker of past acute attack).",
"investigations": "Gonioscopy: appositional or synechial angle closure. Pachymetry, UBM/AS-OCT: plateau iris, lens position.",
"management": "Acute: IV acetazolamide 500 mg + topical pilocarpine 4% + topical beta-blocker/alpha-agonist + IOP-lowering drops. Definitive: Nd:YAG laser peripheral iridotomy (LPI) both eyes. If LPI fails: lens extraction, trabeculectomy.",
"complications": "Optic atrophy from IOP spike, PAS (peripheral anterior synechiae), cataract (Glaukomflecken), corneal decompensation.",
"pearls": "LPI is prophylactic in the fellow eye — risk of acute attack in fellow eye is ~50% within 5 years if untreated. Plateau iris: LPI opens angle but persistent closure — laser iridoplasty or lens extraction needed.",
},
{
"section": "Glaucoma",
"title": "Pseudoexfoliation Glaucoma (PXF)",
"category": "Glaucoma",
"etiology": "Deposition of fibrillar extracellular material on anterior segment structures. Most common identifiable cause of open-angle glaucoma worldwide. LOXL1 gene mutations. Nordic, Mediterranean, Indian populations most affected.",
"pathophysiology": "PXF material clogs trabecular meshwork → reduced aqueous outflow → elevated IOP. PXF also causes weak zonules → phacodonesis, lens subluxation; poor pupil dilation.",
"symptoms": "Often asymptomatic. Glaucomatous visual field loss if IOP uncontrolled.",
"signs": "Dandruff-like white material on: anterior lens capsule (classic double-ring pattern), pupil margin, iris, corneal endothelium. Iris transillumination defects (peripupillary). Pigment dusting on trabecular meshwork (Sampaolesi line on gonioscopy).",
"investigations": "Slit lamp, gonioscopy, IOP (often higher and more fluctuating than POAG), disc/RNFL assessment.",
"management": "Same medical treatment as POAG. SLT particularly effective. Trabeculectomy when indicated. Cataract surgery: EXTRA caution — weak zonules risk of capsular tear/zonular dialysis.",
"complications": "Higher IOP, faster progression, worse prognosis than POAG. Zonular weakness → lens subluxation, vitreous loss during cataract surgery.",
"pearls": "PXF glaucoma progresses faster and to higher IOP than POAG — more aggressive treatment warranted. Always warn cataract surgeon of PXF status.",
},
{
"section": "Glaucoma",
"title": "Normal-Tension Glaucoma (NTG)",
"category": "Glaucoma",
"etiology": "Glaucomatous optic neuropathy with IOP consistently ≤21 mmHg. Association with vasospasm, nocturnal hypotension, Raynaud's, migraines, sleep apnoea. OPA1 gene mutations. More common in Japanese populations.",
"pathophysiology": "Optic nerve head susceptibility to normal IOP levels, vascular dysregulation (ischaemia), autoimmune mechanisms. CSF pressure may be low (translaminar pressure gradient elevated).",
"symptoms": "Asymptomatic peripheral visual field loss; often noticed incidentally. May have history of vascular disease.",
"signs": "Glaucomatous disc changes (notching, cupping) despite IOP ≤21 mmHg. More frequent disc haemorrhages and more localised RNFL defects compared to POAG. Inferior > superior damage pattern.",
"investigations": "Goldmann tonometry (24-hour phasing), pachymetry (if CCT thin, true IOP may be higher). 24-hour BP monitoring (nocturnal dipping). MRI brain to exclude intracranial pathology (chiasmal lesion mimicking NTG).",
"management": "IOP reduction 30% from baseline (CNTGS: reduced progression with treatment). Prostaglandin analogues. Nocturnal hypotension management. Neuroprotection (brimonidine may have independent neuroprotective effect — low-grade evidence).",
"complications": "Progressive visual field loss; central visual loss in advanced disease.",
"pearls": "Always exclude secondary causes of disc damage at normal IOP (anterior ischaemic optic neuropathy, compressive lesion). CNTGS showed 30% IOP reduction halves progression rate.",
},
# ══════════ SECTION: RETINAL DISEASES ══════════
{
"section": "Retinal Diseases",
"title": "Diabetic Retinopathy (DR)",
"category": "Retina / Systemic",
"etiology": "Microvascular complication of diabetes mellitus (type 1 and 2). Risk factors: duration of DM, poor glycaemic control (HbA1c), hypertension, dyslipidaemia, pregnancy, nephropathy.",
"pathophysiology": "Hyperglycaemia → pericyte loss → microaneurysm formation → BRB breakdown → haemorrhages, exudates. Ischaemia → VEGF upregulation → neovascularisation (PDR). VEGF → macular oedema.",
"symptoms": "Usually asymptomatic until advanced. Blurred vision (DME or VH). Floaters (VH). Sudden severe visual loss (VH, TRD, or NVG).",
"signs": "BDR: microaneurysms, dot/blot haemorrhages, hard exudates. PPDR: cotton-wool spots, venous beading, IRMA. PDR: NVD/NVE, vitreous/preretinal haemorrhage. DME: macular thickening ± hard exudate rings.",
"investigations": "Fundus photography (screening). OCT (DME quantification, CMT). FFA (ischaemia, NVE). HbA1c, BP, lipids, renal function.",
"management": "Systemic: glycaemic control (HbA1c <7%), BP <130/80, statins. Laser: PRP for high-risk PDR; focal/grid for DME (less used now). Anti-VEGF (ranibizumab, aflibercept, bevacizumab, faricimab) — standard for DME and active PDR. Vitrectomy for VH, TRD, epiretinal membrane.",
"complications": "DME → central visual loss. PDR → VH, TRD, NVG, blindness. Advanced diabetic eye disease.",
"pearls": "ETDRS classification guides management. Anti-VEGF injections are now first-line for centre-involving DME. Panretinal photocoagulation (PRP) remains standard for high-risk PDR.",
},
{
"section": "Retinal Diseases",
"title": "Age-Related Macular Degeneration (AMD)",
"category": "Retina / Degeneration",
"etiology": "Leading cause of blindness in >50 yr in developed world. Risk: age, smoking, family history, CFH/ARMS2/HTRA1 gene variants, diet, UV exposure.",
"pathophysiology": "Accumulation of drusen (lipid/protein deposits between RPE and Bruch's membrane) → geographic atrophy (dry AMD) or choroidal neovascularisation through Bruch's membrane (wet/neovascular AMD) → RPE and photoreceptor damage.",
"symptoms": "Dry AMD: gradual central visual loss, metamorphopsia. Wet AMD: sudden onset metamorphopsia/scotoma, rapid central visual loss.",
"signs": "Dry: drusen (hard/soft), RPE changes, geographic atrophy (sharply demarcated areas of RPE loss). Wet: subretinal/sub-RPE fluid, haemorrhage, lipid exudates, PED, CNV membrane.",
"investigations": "OCT (fluid, drusen, atrophy). FFA/ICGA (CNV type). Fundus autofluorescence (geographic atrophy extent). Amsler grid (metamorphopsia).",
"management": "Dry AMD: AREDS2 supplements (zinc, copper, vitamins C/E, lutein, zeaxanthin) reduce progression by 25% in intermediate/advanced AMD. Wet AMD: intravitreal anti-VEGF (ranibizumab, aflibercept, bevacizumab, brolucizumab, faricimab) — PRN or treat-and-extend. Photodynamic therapy (PDT) rarely used. Low-vision aids.",
"complications": "Subfoveal scar (disciform scar), geographic atrophy, legal blindness.",
"pearls": "AREDS2 formula supplements are NOT for early AMD. Treat wet AMD promptly — each injection delay risks irreversible photoreceptor loss. Anti-VEGF can be combined with complement inhibitors (pegcetacoplan/avacincaptad pegol) for GA.",
},
{
"section": "Retinal Diseases",
"title": "Retinal Vein Occlusion (RVO)",
"category": "Retina / Vascular",
"etiology": "Central RVO (CRVO) or branch RVO (BRVO). Risk factors: hypertension, hyperlipidaemia, DM, hyperviscosity, glaucoma (for CRVO), thrombophilia (younger patients).",
"pathophysiology": "Thrombosis at arteriovenous crossing (BRVO) or at lamina cribrosa (CRVO) → venous outflow obstruction → increased venous pressure → haemorrhages, oedema, ischaemia → VEGF → macular oedema, neovascularisation.",
"symptoms": "BRVO: sector of blurred/distorted vision. CRVO: sudden painless blurred/loss of vision (may be profound in ischaemic CRVO).",
"signs": "CRVO: flame haemorrhages in all 4 quadrants, dilated tortuous veins, disc oedema, cotton-wool spots. BRVO: haemorrhages limited to involved sector. OCT: macular oedema.",
"investigations": "OCT (macular oedema). FFA (ischaemia — non-perfusion >10 disc areas in CRVO = ischaemic type, high NVG risk). BP, lipids, glucose, FBC, ESR, thrombophilia screen (<50 yr).",
"management": "Anti-VEGF intravitreal injections (ranibizumab, aflibercept, bevacizumab) — first-line for macular oedema. Intravitreal steroids (dexamethasone implant/triamcinolone) alternative. Laser photocoagulation for NV. Risk factor management.",
"complications": "Neovascular glaucoma (NVG) — ischaemic CRVO. Vitreous haemorrhage, persistent macular oedema, permanent visual loss.",
"pearls": "Ischaemic CRVO: risk of NVG is ~33% at 3 months (rule of 90s: 90% of NVG develops within 90 days). Monthly gonioscopy for 3 months to detect early anterior segment neovascularisation.",
},
{
"section": "Retinal Diseases",
"title": "Retinal Artery Occlusion (RAO)",
"category": "Retina / Vascular",
"etiology": "CRAO: embolism (carotid atherosclerosis, cardiac), thrombosis, vasculitis (GCA). BRAO: embolism. GCA must always be excluded in >50 yr.",
"pathophysiology": "Occlusion of central or branch retinal artery → ischaemia of inner retinal layers → irreversible damage within 90-100 min if total occlusion.",
"symptoms": "CRAO: sudden, painless, profound monocular visual loss (count fingers or worse). BRAO: sudden sector field defect. Amaurosis fugax = TIA equivalent (transient RAO).",
"signs": "CRAO: diffuse retinal oedema/whitening, cherry-red spot at fovea (choroidal supply preserved via short posterior ciliaries), attenuated arteries, cattle-trucking. BRAO: sectoral retinal whitening.",
"investigations": "FFA: delayed/absent arterial filling. OCT: inner retinal thickening (acute), then thinning. URGENT: BP, ECG, carotid Doppler, echo, CBC, ESR/CRP (GCA), lipids, glucose, thrombophilia if young.",
"management": "No proven treatment restores vision in established CRAO. Emergency (within 4 h): ocular massage, anterior chamber paracentesis, IOP-lowering drops (acetazolamide). Hyperbaric oxygen, intra-arterial thrombolysis (selected centres). STROKE PROTOCOL: same-day TIA/stroke assessment — 10-15% risk of stroke within 90 days.",
"complications": "Permanent severe visual loss. Ocular neovascularisation (NVI/NVA) in 15-20% (CRAO). High risk of stroke, MI, cardiovascular death.",
"pearls": "CRAO = ocular stroke — treat as stroke emergency. ESR/CRP and temporal artery biopsy to exclude GCA — if suspected, give high-dose IV steroids immediately.",
},
{
"section": "Retinal Diseases",
"title": "Rhegmatogenous Retinal Detachment (RRD)",
"category": "Retina / Surgery",
"etiology": "Break (tear/hole) in retina → liquid vitreous passes through → separates neurosensory retina from RPE. Risk factors: myopia, lattice degeneration, previous intraocular surgery (pseudophakic RD), trauma, family history.",
"pathophysiology": "PVD → dynamic vitreoretinal traction → horseshoe tear → SRF accumulation → photoreceptor separation from choroidal blood supply → ischaemia.",
"symptoms": "Photopsia (flashes), floaters (new or increased), visual field shadow/curtain spreading towards centre. Vision loss when macula detaches.",
"signs": "Elevated, corrugated retina. Folds/cysts in longstanding RD. Tobacco-dust (Shafer's sign — pigment in AC/vitreous). Localise break(s): superior tears spread quickly; inferior tears slowly.",
"investigations": "Indirect ophthalmoscopy with scleral depression. B-scan USS (if media opacity). OCT: subretinal fluid.",
"management": "MACULA-ON: surgical urgency within 24 hours. MACULA-OFF: within 1 week. Options: pneumatic retinopexy, scleral buckle, pars plana vitrectomy (PPV) ± encirclement ± gas/oil tamponade. Prophylactic laser/cryotherapy for high-risk breaks.",
"complications": "PVR (proliferative vitreoretinopathy) — most common cause of failure. Macular detachment → irreversible photoreceptor damage.",
"pearls": "Macula-on RRD is an ophthalmic emergency — surgery within 24 h preserves central vision. Silicone oil tamponade for complex/PVR cases. PPV has largely replaced scleral buckling in pseudophakic eyes.",
},
{
"section": "Retinal Diseases",
"title": "Central Serous Chorioretinopathy (CSC)",
"category": "Retina / Choroid",
"etiology": "Serous detachment of neurosensory retina due to choroidal hyperpermeability. Males 20-50 yr, type A personality, stress, exogenous corticosteroids (all routes), pregnancy.",
"pathophysiology": "Choroidal vascular hyperpermeability → RPE pump overwhelmed → subretinal fluid. Pachychoroid phenotype (thick choroid, dilated outer choroidal vessels — Haller layer, attenuation of Sattler/choriocapillaris).",
"symptoms": "Unilateral (usually) metamorphopsia, micropsia, central scotoma, reduced contrast sensitivity. Mildly reduced VA (typically 6/9-6/12).",
"signs": "Smooth dome-shaped neurosensory detachment (often at macula). Small RPE detachment at leakage point. Dilated choroid on EDI-OCT.",
"investigations": "OCT (SRF, PED, choroidal thickness). FFA: 'smokestack' (ascending column of dye) or 'inkblot' pattern at leakage point. ICGA: choroidal hyperpermeability, dilated choroidal vessels.",
"management": "Acute/mild: observe 3-4 months (80-90% resolve spontaneously). Persistent/chronic (>4 months): half-dose verteporfin PDT (gold standard) targeting hyperpermeable choroid on ICGA. Laser to extrafoveal leakage point. Oral mineralocorticoid antagonists (eplerenone/spironolactone) as adjunct.",
"complications": "Chronic CSC → RPE atrophy, photoreceptor damage, permanent visual loss, CNV development.",
"pearls": "Chronic CSC (>4 months) should be treated — half-dose PDT has best evidence. ALWAYS stop corticosteroids. Eplerenone/spironolactone can be used when PDT not available.",
},
{
"section": "Retinal Diseases",
"title": "Retinitis Pigmentosa (RP)",
"category": "Retina / Hereditary",
"etiology": "Inherited progressive rod-cone dystrophy. Mutations in >100 genes (RHO, RPGR, USH2A, PRPF31). AD > AR > XL. XL has worst prognosis. Part of syndromes: Usher (+ deafness), Bardet-Biedl, Refsum.",
"pathophysiology": "Primary rod photoreceptor degeneration → secondary cone loss. Abnormal RPE phagocytosis or phototransduction defect → bone-spicule pigment deposition.",
"symptoms": "Night blindness (nyctalopia) — earliest symptom, often in childhood. Progressive ring/tunnel visual field constriction. Central vision preserved until late.",
"signs": "Bone-spicule pigmentation (perivascular, mid-periphery). Attenuated retinal vessels. Waxy pallor of optic disc. Posterior subcapsular cataract. CMO (cystoid macular oedema).",
"investigations": "ERG: reduced/absent rod responses (diagnostic). Visual fields: ring scotoma. OCT: thinned outer nuclear layer, loss of IS/OS line. Genetic testing.",
"management": "No cure. Vitamin A palmitate 15,000 IU/day (small benefit — slow progression, avoid beta-carotene and vitamin E). Carbonic anhydrase inhibitors (oral acetazolamide or topical dorzolamide) for CMO. Low-vision aids. Genetic counselling. Retinal implants (Argus II) for profoundly blind.",
"complications": "Legal blindness (tunnel vision), CMO, PSC cataract, glaucoma, myopia.",
"pearls": "Usher syndrome = RP + sensorineural deafness — most common cause of combined deafness-blindness. Gene therapy trials ongoing (RPGR, RPE65). Voretigene neparvovec (Luxturna) approved for RPE65-mutation RP.",
},
# ══════════ SECTION: LENS DISEASES ══════════
{
"section": "Lens Diseases",
"title": "Cataract",
"category": "Lens",
"etiology": "Any opacity of the crystalline lens. Age-related (most common); congenital; secondary (DM, steroids, uveitis, trauma, irradiation, Wilson's, myotonic dystrophy); metabolic; toxic.",
"pathophysiology": "Age-related: oxidative stress and UV damage → lens protein aggregation → reduced transparency. Nuclear (progressive brown opacity), cortical (spoke-like), posterior subcapsular (PSC — rapid visual loss, glare-dominant).",
"symptoms": "Painless progressive blurred vision. Glare (especially PSC). Monocular diplopia. Colour desaturation (nuclear). Myopic shift ('second sight' — nuclear cataract increases power).",
"signs": "Lens opacity on slit lamp. Red reflex reduced/absent on ophthalmoscopy. LOCS III grading (nuclear opalescence, nuclear colour, cortical, PSC).",
"investigations": "VA, contrast sensitivity. Biometry (IOL power calculation — partial coherence interferometry, e.g. IOLMaster). Specular microscopy (endothelial count). Macular function tests if co-pathology suspected.",
"management": "Surgical: phacoemulsification + IOL implantation (standard). MSICS or ECCE in developing world. Monofocal, toric (astigmatism), multifocal, extended-depth-of-focus IOLs. Femtosecond laser-assisted cataract surgery (FLACS).",
"complications": "PCO (posterior capsule opacification) — treated with Nd:YAG laser. Endophthalmitis (0.05-0.3%). Cystoid macular oedema (Irvine-Gass). Corneal decompensation (Fuchs). Retained lens fragments.",
"pearls": "PSC cataract = steroid-induced/metabolic until proven otherwise. Nd:YAG laser capsulotomy for PCO must be done only when IOL is stable. Congenital unilateral dense cataract requires surgery within 6-10 weeks (amblyopia prevention).",
},
# ══════════ SECTION: UVEAL DISEASES ══════════
{
"section": "Uveal Diseases",
"title": "Anterior Uveitis (Iritis / Iridocyclitis)",
"category": "Uveitis / Uvea",
"etiology": "Most common form of uveitis. HLA-B27-associated (ankylosing spondylitis, Reiter, psoriatic arthritis, IBD) — acute, recurrent, unilateral. Sarcoidosis, JIA, Fuchs heterochromic cyclitis, herpetic (HSV, VZV, CMV), syphilis, TB.",
"pathophysiology": "Immune-mediated inflammation of iris and ciliary body → breakdown of blood-aqueous barrier → cells and flare in AC → fibrin, PAS, cataract, elevated IOP.",
"symptoms": "Acute: unilateral pain, photophobia, redness (circumcorneal/ciliary flush), reduced VA. Chronic (JIA, sarcoid): insidious, minimal symptoms, white eye.",
"signs": "Ciliary flush. Keratic precipitates (KPs): fine/stellate in viral; large 'mutton-fat' KPs in granulomatous uveitis. Cells and flare (graded 0-4+). Hypopyon. PAS (posterior synechiae). Iris nodules (Koeppe, Busacca — granulomatous).",
"investigations": "HLA-B27. CXR (sarcoid, TB). ACE, serum lysozyme (sarcoid). VDRL/FTA-ABS (syphilis). Mantoux/IGRA (TB). ANA (JIA). PCR of AC tap if viral suspected.",
"management": "Acute: intensive topical steroids (prednisolone 1% hourly); cycloplegics (cyclopentolate 1% or atropine 1% — prevent PAS, relieve ciliary spasm). Periocular/systemic steroids for severe/bilateral. Treat underlying cause. Methotrexate/biologics for JIA uveitis.",
"complications": "PAS → angle closure → secondary glaucoma. PSC cataract. Cystoid macular oedema. Band keratopathy (JIA). Hypotony (ciliary body shutdown).",
"pearls": "JIA-associated uveitis is typically chronic, asymptomatic, bilateral — screen regularly with slit lamp. Fuchs heterochromic cyclitis: unilateral, no pain, heterochromia, stellate KPs, NO synechiae — cataract inevitable.",
},
{
"section": "Uveal Diseases",
"title": "Posterior Uveitis",
"category": "Uveitis / Uvea",
"etiology": "Toxoplasma gondii (most common worldwide), CMV (immunocompromised), TB, syphilis, sarcoidosis, Behcet's disease, birdshot chorioretinopathy, VKH syndrome, sympathetic ophthalmia.",
"pathophysiology": "Inflammatory/infectious infiltration of choroid and/or retina → tissue destruction → visual loss. Toxoplasma: intracellular parasite reactivates from retinal cyst → necrotising retinochoroiditis.",
"symptoms": "Floaters, blurred vision, visual field defects. Systemic features depending on aetiology (oral ulcers in Behcet, meningism in VKH, sensorineural deafness in VKH).",
"signs": "Toxoplasma: white-yellow focal necrotising retinal lesion adjacent to old pigmented scar ('satellite lesion'). Vitritis ('headlights in fog'). VKH: exudative retinal detachments, disc oedema, creamy fundus lesions. Birdshot: multiple cream-coloured choroidal lesions nasal to disc.",
"investigations": "Toxoplasma IgG/IgM. VDRL, FTA-ABS. ACE, CXR. Mantoux/IGRA. HLA-A29 (birdshot). ERG (birdshot). FFA, ICGA. PCR of vitreous/AC tap. HIV testing.",
"management": "Toxoplasma: pyrimethamine + sulfadiazine + folinic acid (or TMP-SMX) + oral steroids (after 24-48 h). CMV in immunocompromised: IV ganciclovir/valganciclovir. TB: anti-TB therapy. Sarcoid/VKH/birdshot: systemic immunosuppression (steroids + steroid-sparing).",
"complications": "Macular scarring, CMO, epiretinal membrane, retinal detachment, optic atrophy, blindness.",
"pearls": "VKH (Vogt-Koyanagi-Harada): autoimmune against melanocytes — eyes, ear, skin, meninges — treat aggressively with high-dose IV steroids to prevent chronic recurrent phase.",
},
{
"section": "Uveal Diseases",
"title": "Choroidal Melanoma",
"category": "Tumour / Uvea",
"etiology": "Most common primary intraocular malignancy in adults. Arises from uveal melanocytes. BAP1 mutation (metastatic risk marker), GNA11/GNAQ mutations.",
"pathophysiology": "Proliferation of atypical melanocytes in choroid → mushroom shape (breaks Bruch's membrane). Haematogenous metastasis predominantly to liver.",
"symptoms": "Often asymptomatic — detected on routine examination. Visual field defect, floaters, visual loss if fovea involved or exudative RD develops.",
"signs": "Amelanotic or pigmented choroidal mass. Mushroom/collar-stud shape. Orange lipofuscin pigment on surface (pathognomonic of CMM). Sentinel blood vessels. Associated exudative RD.",
"investigations": "B-scan USS: high internal reflectivity on A-scan, acoustically hollow, choroidal excavation. MRI (T1 hyperintense). FFA/ICGA. Biopsy (FNAB) for gene expression profiling (Class 1 vs 2 — metastatic risk). Systemic staging: LFTs, chest/abdomen CT/MRI.",
"management": "Small: observation or thermotherapy. Medium/Large: Rutherford plaque brachytherapy (125I) — eye-conserving. Proton beam radiotherapy. Enucleation for large tumours with poor visual prognosis. Trans-pupillary thermotherapy (TTT) adjuvant. Metastatic: no proven survival benefit from early enucleation; liver-directed therapies.",
"complications": "Radiation retinopathy/optic neuropathy (after brachytherapy), recurrence, liver metastases (survival ~7 months if disseminated), enucleation.",
"pearls": "COMS trial: 125I plaque vs enucleation — equivalent survival. GEP Class 2 tumours have ~70% metastatic rate at 5 yr. BAP1-mutant tumours have high metastatic risk.",
},
# ══════════ SECTION: EYELID DISEASES ══════════
{
"section": "Eyelid Diseases",
"title": "Chalazion and Hordeolum (Stye)",
"category": "Eyelid",
"etiology": "Chalazion: chronic lipogranulomatous inflammation of meibomian gland (blocked meibomian gland orifice). Hordeolum externum (stye): acute Staphylococcal infection of gland of Zeis or Moll. Internal hordeolum: acute meibomian gland infection.",
"pathophysiology": "Chalazion: retained meibum → lipogranuloma (epithelioid histiocytes, giant cells). External stye: folliculitis of eyelash follicle.",
"symptoms": "Chalazion: painless firm nodule in lid. Stye: painful, red, tender eyelid swelling.",
"signs": "Chalazion: firm non-tender lid nodule, pointing to conjunctival surface (meibomian). Stye: pointing at lash margin (external) or conjunctival surface (internal), may discharge pus.",
"investigations": "Clinical. Histopathology if recurrent/atypical (exclude sebaceous carcinoma).",
"management": "Chalazion: warm compresses + lid massage initially. Intralesional steroid injection (triamcinolone 0.1-0.2 mL). Incision and curettage (I&C) if persists. Stye: warm compresses, topical antibiotics, drainage if fluctuant.",
"complications": "Recurrent chalazia → think sebaceous gland carcinoma. Orbital cellulitis (rare). Corneal astigmatism from large chalazion.",
"pearls": "Multiple/recurrent chalazia in elderly: biopsy to exclude sebaceous gland carcinoma — can masquerade as chalazion ('masquerade syndrome'). Lid hygiene and treatment of rosacea/blepharitis reduces recurrence.",
},
{
"section": "Eyelid Diseases",
"title": "Blepharitis",
"category": "Eyelid",
"etiology": "Chronic eyelid margin inflammation. Anterior: Staphylococcal (lash base collarettes) or seborrhoeic (scaly deposits). Posterior/meibomian gland dysfunction (MGD): altered meibum composition, often rosacea-associated.",
"pathophysiology": "Staph blepharitis: exotoxins, lid margin colonisation → collarettes around lashes → chronic low-grade inflammation. MGD: meibum thickening → plugging → evaporative dry eye → secondary bacterial overgrowth.",
"symptoms": "Burning, itching, foreign-body sensation, crusting on waking, redness. Worse in morning.",
"signs": "Anterior: collarettes (Staph), scales (seborrhoeic), lash loss/misdirection, lid margin erythema. Posterior: plugged meibomian gland orifices, thickened meibum (toothpaste-like), irregular lid margin, telangiectasia, tear film instability.",
"investigations": "Clinical. Meibography (imaging meibomian glands). Tear osmolarity. LipiScan/LipiView for MGD.",
"management": "Lid hygiene: warm compresses + lid scrubs (dilute baby shampoo or commercial wipes) twice daily. Topical chloramphenicol or azithromycin for Staph. Systemic tetracyclines (doxycycline 100 mg BD × 6-12 weeks) for MGD/rosacea — anti-inflammatory + antimicrobial effect on meibum. LipiFlow thermal pulsation. Lubricants.",
"complications": "Corneal staphylococcal marginal keratitis, corneal pannus, dry eye disease.",
"pearls": "MGD is the most common cause of dry eye. Tetracyclines must be given for minimum 3 months for effect on meibomian glands. Avoid in pregnancy/children under 12.",
},
# ══════════ SECTION: OPTIC NERVE DISEASES ══════════
{
"section": "Optic Nerve Diseases",
"title": "Optic Neuritis",
"category": "Optic Nerve / Neuro-ophthalmology",
"etiology": "Inflammation of optic nerve. Typical: demyelinating (multiple sclerosis — 50% have MS at 15 yr). Atypical: NMOSD (AQP4-IgG, MOG-IgG) — bilateral, severe, poor recovery. Also sarcoid, SLE, Lyme, viral.",
"pathophysiology": "Demyelination of optic nerve → conduction block → visual loss. Axonal loss in severe cases → permanent defect. Uhthoff's phenomenon: worsening with heat/exercise.",
"symptoms": "Unilateral visual loss (subacute over hours-days). Periorbital pain worsening with eye movement (90%). Dyschromatopsia (red desaturation). Uhthoff's phenomenon.",
"signs": "RAPD. Visual acuity 6/6 to NLP. Optic disc: normal (retrobulbar — 2/3) or swollen (papillitis — 1/3). Cecocentral or central scotoma on perimetry. Recovery begins at 2-3 weeks.",
"investigations": "MRI brain + orbits with gadolinium (periventricular lesions — MS risk). VEPs (delayed P100 latency). AQP4-IgG, MOG-IgG (NMOSD). CSF: oligoclonal bands (MS).",
"management": "Typical ON: IV methylprednisolone 1g/day × 3 days speeds recovery but does not improve final VA (ONTT). NMOSD/MOG-ON: high-dose steroids urgently (poor spontaneous recovery) + plasma exchange if steroid-resistant. Long-term immunosuppression for NMOSD.",
"complications": "Permanent visual field defects. MS development (CIS → clinically definite MS). NMOSD: severe bilateral visual loss, spinal cord attack.",
"pearls": "ONTT: IV steroids hasten recovery by 2 weeks; no final VA benefit. AQP4-IgG+ NMOSD has much worse prognosis than typical ON — must treat aggressively. MOG-IgG-associated optic neuritis tends to recur but has better recovery than NMOSD.",
},
{
"section": "Optic Nerve Diseases",
"title": "Non-Arteritic Anterior Ischaemic Optic Neuropathy (NA-AION)",
"category": "Optic Nerve / Vascular",
"etiology": "Ischaemia of anterior optic nerve (short posterior ciliary arteries). Small crowded disc ('disc at risk', small C:D ratio). Risk factors: hypertension, DM, hyperlipidaemia, sleep apnoea, phosphodiesterase inhibitor use, nocturnal hypotension.",
"pathophysiology": "Compartment syndrome at optic nerve head — swollen axons in structurally crowded disc → secondary ischaemia of surrounding axons → sectoral or diffuse RNFL infarction.",
"symptoms": "Painless monocular visual loss or visual field defect on waking (nocturnal hypotension). Altitudinal field defect most common.",
"signs": "Sectoral or diffuse optic disc oedema (may be pallid/hyperaemic). Splinter haemorrhages at disc margin. RAPD. Altitudinal visual field defect (inferior > superior).",
"investigations": "ESR, CRP (to exclude GCA). BP monitoring. Sleep study (OSA). Carotid/cardiac workup. MRI to exclude intracranial cause.",
"management": "No proven treatment. Manage vascular risk factors. Avoid nocturnal hypotension (may need adjustment of antihypertensives to avoid bedtime dosing). Avoid PDE5 inhibitors. Prophylactic aspirin (controversial).",
"complications": "Permanent altitudinal field defect. Fellow eye affected in ~15-20% at 5 years. Optic atrophy.",
"pearls": "Never confuse with GCA (arteritic AION) — GCA: ESR >50, CRP elevated, jaw claudication, scalp tenderness, age >70, profound VA loss — treat immediately with high-dose IV steroids and temporal artery biopsy. NA-AION: ESR/CRP normal, younger, less severe VA loss.",
},
{
"section": "Optic Nerve Diseases",
"title": "Giant Cell Arteritis (GCA) / Arteritic AION",
"category": "Optic Nerve / Systemic Vasculitis",
"etiology": "Granulomatous vasculitis of medium/large vessels. Age >50 (almost always >70). HLA-DR4 association. Affects posterior ciliary arteries, ophthalmic artery.",
"pathophysiology": "Granulomatous inflammation → vessel wall thickening → luminal occlusion → ischaemia of optic nerve, choroid, retina, extraocular muscles, brain.",
"symptoms": "New headache (temporal), jaw claudication (pathognomonic), scalp tenderness, temporal artery tenderness, polymyalgia rheumatica (shoulder/hip girdle pain), fever, weight loss, amaurosis fugax preceding permanent VA loss.",
"signs": "A-AION: pallid disc oedema, profound VA loss (often LP or NLP). Choroidal ischaemia ('white fundus'). Tender, nodular, non-pulsatile temporal artery. RAPD. Possibly CRAO, CRVO, cranial nerve palsy.",
"investigations": "ESR (>50 mm/hr, often >100), CRP (more sensitive), platelets (elevated). Temporal artery biopsy (gold standard — skip lesions mean 4-5 cm sample, bilateral if one side negative). PET-CT for large vessel involvement.",
"management": "EMERGENCY: HIGH-DOSE STEROIDS IMMEDIATELY — do NOT wait for biopsy. IV methylprednisolone 1g/day × 3 days if VA involved, then oral prednisolone 1 mg/kg/day. Biopsy within 1-2 weeks. Aspirin. Tocilizumab (anti-IL-6) as steroid-sparing (GiACTA trial — approved). Osteoporosis prophylaxis.",
"complications": "Fellow eye involvement (within 24-48 h if untreated — ~20%). Stroke, aortic aneurysm/dissection. Long-term steroid side effects.",
"pearls": "Visual loss from GCA is preventable with prompt treatment — do NOT delay steroids for biopsy. Tocilizumab (tocilizumab) allows faster steroid taper and reduces relapse — now standard of care alongside steroids.",
},
# ══════════ SECTION: STRABISMUS & NEURO-OPHTHALMOLOGY ══════════
{
"section": "Neuro-Ophthalmology",
"title": "Third Nerve (CN III) Palsy",
"category": "Neuro-Ophthalmology",
"etiology": "Posterior communicating artery aneurysm (surgical — pupil involved), DM (microvascular — pupil spared), GCA, trauma, cavernous sinus disease, uncal herniation (surgical emergency).",
"pathophysiology": "CN III innervates SR, MR, IR, IO, levator, pupillary constrictor. Surgical (compressive) palsy: extrinsic compression damages outer parasympathetic fibres → fixed dilated pupil. Medical (microvascular): ischaemia of central axons → pupil often spared.",
"symptoms": "Ptosis, diplopia, 'down and out' eye position.",
"signs": "Complete CN III: severe ptosis, exotropia, hypotropia, fixed dilated pupil (surgical). Medical: same motility palsy but pupil normal or minimally involved. Check for aberrant regeneration (lid elevates on adduction/downgaze = old compressive lesion).",
"investigations": "URGENT MRI/MRA if pupil involved or patient <50 yr. CTA/catheter angiography if high suspicion of aneurysm despite normal MRA. HbA1c, BP, lipids if microvascular suspected.",
"management": "PComm aneurysm: neurosurgical/endovascular treatment. Microvascular: conservative — resolves in 3 months typically. Treat underlying risk factors. Prism/surgery for residual diplopia.",
"complications": "Aneurysm rupture (SAH). Amblyopia if child. Aberrant regeneration (misdirected axon sprouting).",
"pearls": "'Pupil-involving CN III palsy = PComm aneurysm until proven otherwise' — this is an emergency. Microvascular palsy must have complete spontaneous recovery within 3 months — if not, re-image.",
},
{
"section": "Neuro-Ophthalmology",
"title": "Idiopathic Intracranial Hypertension (IIH) / Papilloedema",
"category": "Neuro-Ophthalmology",
"etiology": "Elevated intracranial pressure without space-occupying lesion or hydrocephalus. Predominantly obese women of childbearing age. Associations: tetracyclines, vitamin A toxicity, steroid withdrawal, isotretinoin.",
"pathophysiology": "Raised CSF pressure transmitted to optic nerve sheath → axonal stasis → bilateral optic disc oedema (papilloedema) → progressive RNFL loss → irreversible visual field loss if untreated.",
"symptoms": "Headache (daily, worse lying down), pulsatile tinnitus, transient visual obscurations (seconds, on bending), diplopia (CN VI palsy), visual field loss (inferior nasal — arcuate), reduced VA (late).",
"signs": "Bilateral papilloedema (Frisen grade 1-5). Enlarged blind spot. Visual field: arcuate/nasal step. CN VI palsy (false localising). No neurological deficit.",
"investigations": "MRI brain ± MRV (exclude SOL, venous sinus thrombosis — empty sella, flattened posterior globes, tortuous ON sheaths in IIH). LP: opening pressure >25 cmCSF (>28 obese). Normal CSF constituents.",
"management": "Weight loss (most important — 5-10% body weight). Acetazolamide (first-line — reduces CSF production). Topiramate (weight loss effect). CSF diversion: optic nerve sheath fenestration (ONSF) for progressive visual loss, VP/LP shunt for headache-predominant. Transverse sinus stenting.",
"complications": "Irreversible visual loss (nasal arcuate → constriction), legal blindness if untreated/delayed treatment.",
"pearls": "IIH-WT trial: acetazolamide + low-sodium diet improved visual fields. ONSF is procedure of choice when vision at risk. BMI reduction is the only disease-modifying intervention.",
},
]
# ─────────────────────────────────────────────
# COLOUR PALETTE per section
# ─────────────────────────────────────────────
SECTION_COLOURS = {
"Conjunctival Diseases": ("#1565C0", "#E3F2FD"), # blue
"Corneal Diseases": ("#2E7D32", "#E8F5E9"), # green
"Glaucoma": ("#6A1B9A", "#F3E5F5"), # purple
"Retinal Diseases": ("#BF360C", "#FBE9E7"), # deep orange
"Lens Diseases": ("#00695C", "#E0F2F1"), # teal
"Uveal Diseases": ("#E65100", "#FFF3E0"), # orange
"Eyelid Diseases": ("#4A148C", "#EDE7F6"), # deep purple
"Optic Nerve Diseases": ("#880E4F", "#FCE4EC"), # pink
"Neuro-Ophthalmology": ("#004D40", "#E0F2F1"), # dark teal
}
FIELD_LABELS = [
("etiology", "Aetiology"),
("pathophysiology", "Pathophysiology"),
("symptoms", "Symptoms"),
("signs", "Signs"),
("investigations", "Investigations"),
("management", "Management"),
("complications", "Complications"),
("pearls", "Key Pearls"),
]
def build_pdf():
doc = SimpleDocTemplate(
OUTPUT,
pagesize=A4,
leftMargin=15*mm, rightMargin=15*mm,
topMargin=15*mm, bottomMargin=15*mm,
)
styles = getSampleStyleSheet()
title_style = ParagraphStyle(
"CardTitle",
fontName="Helvetica-Bold",
fontSize=17,
textColor=colors.white,
alignment=TA_LEFT,
spaceAfter=2,
)
subtitle_style = ParagraphStyle(
"CardSubtitle",
fontName="Helvetica",
fontSize=9,
textColor=colors.white,
alignment=TA_LEFT,
)
section_badge_style = ParagraphStyle(
"SectionBadge",
fontName="Helvetica-Bold",
fontSize=8,
textColor=colors.white,
alignment=TA_LEFT,
)
field_label_style = ParagraphStyle(
"FieldLabel",
fontName="Helvetica-Bold",
fontSize=8.5,
textColor=colors.HexColor("#37474F"),
spaceBefore=5,
spaceAfter=1,
)
field_text_style = ParagraphStyle(
"FieldText",
fontName="Helvetica",
fontSize=8.5,
textColor=colors.HexColor("#212121"),
leading=13,
alignment=TA_JUSTIFY,
)
cover_title_style = ParagraphStyle(
"CoverTitle",
fontName="Helvetica-Bold",
fontSize=28,
textColor=colors.HexColor("#0D47A1"),
alignment=TA_CENTER,
spaceAfter=6,
)
cover_sub_style = ParagraphStyle(
"CoverSub",
fontName="Helvetica",
fontSize=13,
textColor=colors.HexColor("#37474F"),
alignment=TA_CENTER,
)
toc_heading_style = ParagraphStyle(
"TOCHeading",
fontName="Helvetica-Bold",
fontSize=11,
textColor=colors.HexColor("#0D47A1"),
spaceBefore=10,
spaceAfter=2,
)
toc_item_style = ParagraphStyle(
"TOCItem",
fontName="Helvetica",
fontSize=9.5,
textColor=colors.HexColor("#212121"),
leftIndent=12,
spaceAfter=1,
)
story = []
# ── COVER PAGE ──────────────────────────────────
story.append(Spacer(1, 60*mm))
story.append(Paragraph("Eye Disease Flashcards", cover_title_style))
story.append(Paragraph("Ophthalmology Resident Reference", cover_sub_style))
story.append(Spacer(1, 6*mm))
story.append(HRFlowable(width="60%", thickness=2, color=colors.HexColor("#0D47A1"), hAlign="CENTER"))
story.append(Spacer(1, 6*mm))
story.append(Paragraph(f"{len(CARDS)} Flashcards • 9 Clinical Categories", cover_sub_style))
story.append(Spacer(1, 4*mm))
story.append(Paragraph("Source: Kanski's Clinical Ophthalmology, 10th Edition", ParagraphStyle("src", fontName="Helvetica", fontSize=9, textColor=colors.grey, alignment=TA_CENTER)))
story.append(PageBreak())
# ── TABLE OF CONTENTS ───────────────────────────
story.append(Paragraph("Table of Contents", cover_title_style))
story.append(Spacer(1, 4*mm))
current_section = None
card_num = 1
for card in CARDS:
if card["section"] != current_section:
current_section = card["section"]
colour = SECTION_COLOURS.get(current_section, ("#333333","#FFFFFF"))[0]
story.append(Paragraph(f"▸ {current_section}", ParagraphStyle("TOCSecHead", fontName="Helvetica-Bold", fontSize=10.5, textColor=colors.HexColor(colour), spaceBefore=8, spaceAfter=2)))
story.append(Paragraph(f" {card_num}. {card['title']} <font color='#9E9E9E'>— {card['category']}</font>", toc_item_style))
card_num += 1
story.append(PageBreak())
# ── FLASHCARDS ──────────────────────────────────
for idx, card in enumerate(CARDS, 1):
sec = card["section"]
header_colour, bg_colour = SECTION_COLOURS.get(sec, ("#333333","#F5F5F5"))
header_hex = colors.HexColor(header_colour)
bg_hex = colors.HexColor(bg_colour)
# Header row
header_content = [
Paragraph(f"{idx:02d}. {card['title']}", title_style),
Paragraph(card["category"], subtitle_style),
Paragraph(card["section"], section_badge_style),
]
header_table = Table(
[[Paragraph(f"<font size='18'><b>{idx:02d}. {card['title']}</b></font><br/>"
f"<font size='9'>{card['category']} • {card['section']}</font>", title_style)]],
colWidths=[180*mm],
)
header_table.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), header_hex),
("LEFTPADDING", (0,0), (-1,-1), 10),
("RIGHTPADDING", (0,0), (-1,-1), 10),
("TOPPADDING", (0,0), (-1,-1), 10),
("BOTTOMPADDING",(0,0), (-1,-1), 10),
("ROUNDEDCORNERS", [6,6,0,0]),
]))
story.append(header_table)
# Body rows
body_rows = []
for key, label in FIELD_LABELS:
text = card.get(key, "")
if text:
body_rows.append([
Paragraph(label.upper(), field_label_style),
Paragraph(text, field_text_style),
])
body_table = Table(
body_rows,
colWidths=[38*mm, 142*mm],
)
body_table.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), bg_hex),
("VALIGN", (0,0), (-1,-1), "TOP"),
("LEFTPADDING", (0,0), (0,-1), 8),
("RIGHTPADDING", (0,0), (0,-1), 4),
("LEFTPADDING", (1,0), (1,-1), 4),
("RIGHTPADDING", (1,0), (1,-1), 8),
("TOPPADDING", (0,0), (-1,-1), 4),
("BOTTOMPADDING",(0,0), (-1,-1), 4),
("LINEBELOW", (0,0), (-1,-2), 0.3, colors.HexColor("#CFD8DC")),
("ROUNDEDCORNERS", [0,0,6,6]),
]))
story.append(body_table)
story.append(Spacer(1, 10*mm))
# New page every 2 cards approximately — done automatically by Reportlab flow
doc.build(story)
print(f"PDF written to {OUTPUT}")
build_pdf()
cd /home/daytona/workspace/eye-flashcards && python generate_flashcards.py 2>&1
ls -lh /home/daytona/workspace/eye-flashcards/Eye_Disease_Flashcards.pdf
Eye Disease Flashcards
PDF Document · PDF
| Section | Cards |
|---|---|
| 🔵 Conjunctival Diseases | Viral Conjunctivitis, Bacterial Conjunctivitis, Allergic Conjunctivitis, VKC, Ocular Cicatricial Pemphigoid |
| 🟢 Corneal Diseases | Herpes Simplex Keratitis, Acanthamoeba Keratitis, Keratoconus, Fuchs Endothelial Dystrophy |
| 🟣 Glaucoma | POAG, PACG, Pseudoexfoliation Glaucoma, Normal-Tension Glaucoma |
| 🔴 Retinal Diseases | Diabetic Retinopathy, AMD, RVO, RAO, Rhegmatogenous RD, CSC, Retinitis Pigmentosa |
| 🩵 Lens | Cataract |
| 🟠 Uveal | Anterior Uveitis, Posterior Uveitis, Choroidal Melanoma |
| 🫐 Eyelid | Chalazion/Hordeolum, Blepharitis |
| 🩷 Optic Nerve | Optic Neuritis, NA-AION, GCA/Arteritic AION |
| 🌿 Neuro-Ophthalmology | CN III Palsy, IIH/Papilloedema |
Signs in keratoconus




| Sign | Method of Detection | Stage |
|---|---|---|
| Oil droplet reflex | Direct ophthalmoscopy (0.5 m) | Early-moderate |
| Scissor reflex | Retinoscopy | Early |
| Vogt's striae | Slit lamp (posterior stroma) | Moderate |
| Fleischer ring | Slit lamp (cobalt blue filter) | Moderate |
| Corneal thinning/protrusion | Slit lamp direct beam | Moderate |
| Munson's sign | External (downgaze) | Advanced |
| Rizzuti's sign | Penlight from temporal side | Advanced |
| Inferior steepening | Corneal topography | Early-moderate |
| Acute hydrops | Slit lamp | Any (acute event) |