Write a short note for 15 marks for MS ophthalmol theory exam from appropriate sources on Toxocariasis Amaurosis fugax Choloriquine retinoscopy Make in padf format

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

mkdir -p /tmp/workspace/ophthalmology-notes && ls /tmp/workspace/ophthalmology-notes/

Writing File

~/ophthalmology-notes/generate_notes.py

from reportlab.lib.pagesizes import A4
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm
from reportlab.lib import colors
from reportlab.platypus import (
    SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
    HRFlowable, KeepTogether
)
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.platypus import PageBreak

OUTPUT = "/tmp/workspace/ophthalmology-notes/MS_Ophthalmology_Short_Notes.pdf"

doc = SimpleDocTemplate(
    OUTPUT,
    pagesize=A4,
    rightMargin=2*cm,
    leftMargin=2*cm,
    topMargin=2*cm,
    bottomMargin=2*cm,
    title="MS Ophthalmology - Short Notes",
    author="Orris Medical Education",
)

styles = getSampleStyleSheet()

# Custom styles
title_style = ParagraphStyle(
    "MainTitle",
    parent=styles["Title"],
    fontSize=18,
    textColor=colors.HexColor("#1a3a5c"),
    spaceAfter=4,
    fontName="Helvetica-Bold",
    alignment=TA_CENTER,
)
subtitle_style = ParagraphStyle(
    "SubTitle",
    parent=styles["Normal"],
    fontSize=10,
    textColor=colors.HexColor("#4a6fa5"),
    spaceAfter=2,
    alignment=TA_CENTER,
)
marks_style = ParagraphStyle(
    "Marks",
    parent=styles["Normal"],
    fontSize=10,
    textColor=colors.HexColor("#c0392b"),
    spaceAfter=12,
    alignment=TA_CENTER,
    fontName="Helvetica-Bold",
)
topic_title_style = ParagraphStyle(
    "TopicTitle",
    parent=styles["Heading1"],
    fontSize=15,
    textColor=colors.white,
    fontName="Helvetica-Bold",
    spaceAfter=0,
    spaceBefore=0,
    leading=20,
)
h2_style = ParagraphStyle(
    "H2",
    parent=styles["Heading2"],
    fontSize=12,
    textColor=colors.HexColor("#1a3a5c"),
    fontName="Helvetica-Bold",
    spaceBefore=10,
    spaceAfter=3,
    borderPadding=(0, 0, 2, 0),
)
body_style = ParagraphStyle(
    "Body",
    parent=styles["Normal"],
    fontSize=10,
    leading=15,
    textColor=colors.HexColor("#2c3e50"),
    spaceAfter=4,
    fontName="Helvetica",
    alignment=TA_JUSTIFY,
)
bullet_style = ParagraphStyle(
    "Bullet",
    parent=styles["Normal"],
    fontSize=10,
    leading=14,
    textColor=colors.HexColor("#2c3e50"),
    leftIndent=15,
    spaceAfter=3,
    fontName="Helvetica",
    bulletIndent=5,
)
sub_bullet_style = ParagraphStyle(
    "SubBullet",
    parent=styles["Normal"],
    fontSize=9.5,
    leading=13,
    textColor=colors.HexColor("#34495e"),
    leftIndent=30,
    spaceAfter=2,
    fontName="Helvetica",
    bulletIndent=20,
)
source_style = ParagraphStyle(
    "Source",
    parent=styles["Normal"],
    fontSize=8.5,
    textColor=colors.HexColor("#7f8c8d"),
    spaceAfter=2,
    fontName="Helvetica-Oblique",
    alignment=TA_RIGHT,
)
footer_note_style = ParagraphStyle(
    "FooterNote",
    parent=styles["Normal"],
    fontSize=8,
    textColor=colors.HexColor("#95a5a6"),
    spaceAfter=0,
    alignment=TA_CENTER,
)

def topic_header(title, topic_num, color_hex):
    """Create a colored header band for each topic."""
    header_table = Table(
        [[Paragraph(f"Topic {topic_num}: {title}", topic_title_style)]],
        colWidths=[17*cm],
    )
    header_table.setStyle(TableStyle([
        ("BACKGROUND", (0, 0), (-1, -1), colors.HexColor(color_hex)),
        ("TOPPADDING", (0, 0), (-1, -1), 8),
        ("BOTTOMPADDING", (0, 0), (-1, -1), 8),
        ("LEFTPADDING", (0, 0), (-1, -1), 12),
        ("RIGHTPADDING", (0, 0), (-1, -1), 12),
        ("ROUNDEDCORNERS", [5, 5, 5, 5]),
    ]))
    return header_table

def section_heading(text):
    return Paragraph(text, h2_style)

def body(text):
    return Paragraph(text, body_style)

def bullet(text):
    return Paragraph(f"\u2022  {text}", bullet_style)

def sub_bullet(text):
    return Paragraph(f"    \u25e6  {text}", sub_bullet_style)

def source(text):
    return Paragraph(f"Source: {text}", source_style)

story = []

# ─── COVER HEADER ───────────────────────────────────────────────────────────
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("MS Ophthalmology Theory Examination", title_style))
story.append(Paragraph("Short Answer Notes — 15 Marks Each", subtitle_style))
story.append(Paragraph("[15 Marks Each Topic]", marks_style))
story.append(HRFlowable(width="100%", thickness=2, color=colors.HexColor("#1a3a5c")))
story.append(Spacer(1, 0.5*cm))

# ═══════════════════════════════════════════════════════════════════════════
# TOPIC 1: TOXOCARIASIS
# ═══════════════════════════════════════════════════════════════════════════
story.append(topic_header("OCULAR TOXOCARIASIS", 1, "#1a3a5c"))
story.append(Spacer(1, 0.25*cm))

story.append(section_heading("1. Introduction / Aetiology"))
story.append(body(
    "Toxocariasis is caused by infestation with <b>Toxocara canis</b>, the common intestinal "
    "roundworm (ascarid) of dogs. The feline variant <i>Toxocara cati</i> may also be causative. "
    "Human infestation occurs by <b>ingestion of soil or food contaminated with ova</b> shed in "
    "canine faeces. Puppies are more commonly infected and are the primary source of spread. "
    "Young children are at particular risk from soil in parks and playgrounds. Once ingested, "
    "ova develop into larvae, which penetrate the intestinal wall and travel haematogenously to "
    "the liver, lungs, skin, brain, and eyes, eliciting an intense inflammatory reaction."
))
story.append(source("Kanski's Clinical Ophthalmology: A Systematic Approach, 10th ed."))

story.append(section_heading("2. Clinical Presentations"))
story.append(body(
    "<b>Three main systemic forms</b> are recognised, with ocular disease typically occurring "
    "independently of visceral disease:"
))
story.append(bullet("<b>Visceral larva migrans (VLM):</b> Systemic infection in children aged 2-7 years; "
                   "fever, abdominal pain, pneumonitis, lymphadenopathy, hepatomegaly, myocarditis. "
                   "Spontaneous recovery is usual."))
story.append(bullet("<b>Covert toxocariasis:</b> Mild systemic symptoms."))
story.append(bullet("<b>Ocular larva migrans (OLM):</b> Typically unilateral; occurs in older children "
                   "and adults, independently of VLM. Associated with a <i>lower</i> parasitic load. "
                   "Causes permanent visual impairment in ~two-thirds of cases."))

story.append(Spacer(1, 0.15*cm))
story.append(body("<b>Ocular presentations:</b>"))
story.append(bullet("<b>Chronic endophthalmitis:</b> Presents with leukocoria, strabismus, floaters, or "
                   "unilateral visual loss. Features include anterior uveitis, vitritis, chorioretinitis, "
                   "papillitis, and fundus granuloma. Dense grey-white peripheral exudate (resembles "
                   "snowbanking of pars planitis). Complications: tractional retinal detachment, "
                   "hypotony, phthisis bulbi."))
story.append(bullet("<b>Posterior pole / peripheral granuloma (without active inflammation):</b> "
                   "Classic in older child or adult. A 1-2 disc diameter round yellow-white granuloma "
                   "in the posterior fundus or periphery. Vitreoretinal traction may cause macular "
                   "distortion or retinal detachment."))
story.append(bullet("<b>Chorioretinal scar.</b>"))
story.append(bullet("<b>Diffuse unilateral subacute neuroretinitis (DUSN).</b>"))

story.append(section_heading("3. Investigations"))
story.append(bullet("<b>Full blood count:</b> Eosinophilia (more common in VLM than OLM)."))
story.append(bullet("<b>Immunoglobulins:</b> Raised IgE (hypergammaglobulinaemia)."))
story.append(bullet("<b>Serology (ELISA):</b> Antibodies to <i>T. canis</i> detectable in only ~50% of "
                   "ocular cases; seropositivity is also common in the general population (~14% in USA) "
                   "- therefore interpret with caution."))
story.append(bullet("<b>Ultrasonography:</b> Useful when vitreous haze limits fundal examination."))
story.append(bullet("<b>Aqueous/vitreous sampling:</b> Eosinophilia, antibody detection, PCR."))
story.append(bullet("<b>Biopsy:</b> Of a skin or other accessible granuloma for larvae, occasionally possible."))
story.append(bullet("<b>Important differential:</b> Retinoblastoma must be excluded, especially in children "
                   "presenting with leukocoria."))

story.append(section_heading("4. Management"))
story.append(bullet("<b>Prevention:</b> Good hygiene practices; regular deworming of household pets."))
story.append(bullet("<b>Corticosteroids:</b> Topical, periocular (sub-Tenon's), or systemic to reduce inflammation."))
story.append(bullet("<b>Anthelmintic agents:</b> Mebendazole or thiabendazole may be used; note that "
                   "worm death can precipitate further inflammation, so steroids must be co-prescribed."))
story.append(bullet("<b>Laser photocoagulation:</b> Directed at the larva when visible, to destroy it."))
story.append(bullet("<b>Vitrectomy:</b> For sight-threatening tractional complications (retinal detachment, "
                   "vitreoretinal traction)."))
story.append(source("Kanski's Clinical Ophthalmology, 10th ed., p. 482-484"))

story.append(Spacer(1, 0.4*cm))
story.append(HRFlowable(width="100%", thickness=1, color=colors.HexColor("#bdc3c7")))
story.append(Spacer(1, 0.4*cm))

# ═══════════════════════════════════════════════════════════════════════════
# TOPIC 2: AMAUROSIS FUGAX
# ═══════════════════════════════════════════════════════════════════════════
story.append(topic_header("AMAUROSIS FUGAX", 2, "#154360"))
story.append(Spacer(1, 0.25*cm))

story.append(section_heading("1. Definition"))
story.append(body(
    "<b>Amaurosis fugax</b> is defined as <b>transient, painless, monocular loss of vision</b>, "
    "classically described by the patient as a \"curtain coming down over the eye.\" Vision "
    "typically returns to normal within seconds to minutes (rarely up to 1-2 hours). "
    "It is considered by the <b>American Heart Association as a form of Transient Ischaemic "
    "Attack (TIA)</b> and carries a high risk of subsequent stroke; urgent investigation "
    "and management are therefore mandatory."
))
story.append(body(
    "The <i>Amaurosis Fugax Study Group</i> classifies causes into five categories: "
    "<b>embolic, haemodynamic, ocular, neurological, and idiopathic</b>. In clinical "
    "practice, the term most often refers to transient visual loss of <i>embolic origin</i>."
))
story.append(source("Kanski's Clinical Ophthalmology, 10th ed. | Wills Eye Manual, 8th ed."))

story.append(section_heading("2. Aetiology"))
story.append(bullet("<b>Embolism</b> (most common): From carotid artery atherosclerosis (cholesterol / "
                   "Hollenhorst plaques), cardiac valvular disease (mitral valve prolapse, rheumatic), "
                   "mural thrombus (post-MI), or arrhythmia (atrial fibrillation)."))
story.append(bullet("<b>Haemodynamic:</b> Arteriosclerotic disease causing hypoperfusion, often "
                   "precipitated by postural change or cardiac arrhythmia."))
story.append(bullet("<b>Hypercoagulable / hyperviscosity states:</b> Polycythaemia, thrombocytosis, "
                   "antiphospholipid syndrome."))
story.append(bullet("<b>Giant Cell Arteritis (GCA):</b> Particularly in patients >50 years; "
                   "transient visual loss may be a harbinger of permanent ischaemic optic neuropathy."))
story.append(bullet("<b>Vasospasm:</b> Especially in younger patients."))
story.append(bullet("<b>Ocular causes:</b> Impending CRVO, elevated IOP (intermittent angle-closure), "
                   "optic disc drusen."))
story.append(bullet("<b>Rare:</b> Intraorbital mass compressing the optic nerve in certain gaze positions "
                   "(gaze-evoked transient visual loss)."))

story.append(section_heading("3. Clinical Features"))
story.append(bullet("Monocular visual loss lasting seconds to minutes (embolic); recovery generally "
                   "in the same pattern as the loss, though usually more gradual."))
story.append(bullet("Frequency varies from several times a day to once every few months."))
story.append(bullet("May be accompanied by ipsilateral cerebral TIA (contralateral arm/leg weakness, "
                   "dysphasia - indicating middle cerebral artery territory ischaemia)."))
story.append(bullet("Fundal exam: May be normal; an embolus (Hollenhorst plaque) may be visible at "
                   "an arteriolar bifurcation; signs of ocular ischaemic syndrome may be present."))
story.append(body("<i>Important:</i> Patients may be unaware whether visual loss is monocular or a "
                 "homonymous hemianopia - covering each eye separately during the episode, or "
                 "a careful history clarifying laterality, is essential."))

story.append(section_heading("4. Differential Diagnosis"))
data = [
    ["Condition", "Key Distinguishing Features"],
    ["Migraine with aura", "Visual disturbance 10-50 min; positive phenomena (scintillating scotoma); bilateral"],
    ["GCA", "Age >50, elevated ESR/CRP/platelets, scalp tenderness, jaw claudication"],
    ["Papilloedema", "Bilateral; seconds duration; postural or Valsalva-triggered; disc swelling present"],
    ["Vertebrobasilar insufficiency", "Bilateral blurred vision; associated vertigo, dysarthria, hemisensory loss"],
    ["Impending CRVO", "Dilated tortuous veins on fundoscopy"],
    ["Ocular ischaemic syndrome", "Unilateral; disc and retinal signs of chronic hypoperfusion"],
]
t = Table(data, colWidths=[5.5*cm, 11.5*cm])
t.setStyle(TableStyle([
    ("BACKGROUND", (0, 0), (-1, 0), colors.HexColor("#1a3a5c")),
    ("TEXTCOLOR", (0, 0), (-1, 0), colors.white),
    ("FONTNAME", (0, 0), (-1, 0), "Helvetica-Bold"),
    ("FONTSIZE", (0, 0), (-1, -1), 9),
    ("GRID", (0, 0), (-1, -1), 0.5, colors.HexColor("#bdc3c7")),
    ("ROWBACKGROUNDS", (0, 1), (-1, -1), [colors.white, colors.HexColor("#eaf2fb")]),
    ("TOPPADDING", (0, 0), (-1, -1), 5),
    ("BOTTOMPADDING", (0, 0), (-1, -1), 5),
    ("LEFTPADDING", (0, 0), (-1, -1), 6),
    ("VALIGN", (0, 0), (-1, -1), "TOP"),
]))
story.append(t)

story.append(section_heading("5. Investigations (Workup)"))
story.append(bullet("<b>MRI brain with DWI:</b> To detect silent infarcts; current AHA guidelines recommend "
                   "urgent MRI and neurology referral."))
story.append(bullet("<b>Carotid duplex Doppler US:</b> First-line non-invasive study for carotid stenosis. "
                   "Consider orbital colour Doppler US for retrolaminar CRA stenosis."))
story.append(bullet("<b>ESR, CRP, platelet count:</b> Urgently if GCA is suspected."))
story.append(bullet("<b>Cardiac evaluation:</b> ECG, echocardiogram (to detect valvular disease, thrombus, PFO)."))
story.append(bullet("<b>Blood tests:</b> CBC (polycythaemia), fasting glucose, HbA1c, lipid profile."))
story.append(bullet("<b>Ophthalmic exam:</b> Dilated fundoscopy, confrontation fields, IOP, slit lamp."))

story.append(section_heading("6. Management"))
story.append(body("<b>A. Carotid disease:</b>"))
story.append(sub_bullet("Aspirin 81-325 mg/day (antiplatelet therapy)."))
story.append(sub_bullet("Carotid endarterectomy (CEA) or endovascular stenting in high-grade (>70%) "
                        "surgically accessible carotid stenosis (refer to vascular surgery)."))
story.append(sub_bullet("Control of modifiable risk factors: hypertension, diabetes, dyslipidaemia."))
story.append(sub_bullet("Lifestyle modification: smoking cessation, diet, exercise."))
story.append(body("<b>B. Cardiac disease:</b>"))
story.append(sub_bullet("Aspirin 325 mg/day for non-embolic cardiac disease."))
story.append(sub_bullet("Anticoagulation (heparin, then warfarin/NOAC) if intracardiac thrombus or AF."))
story.append(body("<b>C. GCA:</b> Urgent high-dose systemic corticosteroids (IV methylprednisolone "
                 "if vision threatened, then oral prednisolone), temporal artery biopsy."))
story.append(source("Wills Eye Manual, 8th ed., pp. 733-735 | Kanski's Clinical Ophthalmology, 10th ed."))

story.append(Spacer(1, 0.4*cm))
story.append(HRFlowable(width="100%", thickness=1, color=colors.HexColor("#bdc3c7")))
story.append(Spacer(1, 0.4*cm))

# ═══════════════════════════════════════════════════════════════════════════
# TOPIC 3: CHLOROQUINE / HYDROXYCHLOROQUINE RETINOPATHY
# ═══════════════════════════════════════════════════════════════════════════
story.append(topic_header("CHLOROQUINE / HYDROXYCHLOROQUINE RETINOPATHY", 3, "#0e4d6e"))
story.append(Spacer(1, 0.25*cm))

story.append(section_heading("1. Introduction"))
story.append(body(
    "Chloroquine (CQ) and hydroxychloroquine (HCQ) are 4-aminoquinoline antimalarials. "
    "CQ was historically used for malaria prophylaxis/treatment; HCQ is widely used for "
    "<b>long-term inflammatory disorders</b> (rheumatoid arthritis, SLE, other connective tissue "
    "diseases). Both drugs are concentrated in <b>melanin-containing structures</b> of the eye "
    "(retinal pigment epithelium [RPE] and choroid) and can cause <b>irreversible retinal toxicity</b>. "
    "Retinal adverse effects may be more common than previously believed; progression can occur "
    "even after discontinuation."
))
story.append(source("Kanski's Clinical Ophthalmology, 10th ed., pp. 914-916"))

story.append(section_heading("2. Risk Factors for Toxicity"))
story.append(bullet("<b>Dose:</b> HCQ: risk rises sharply when dose exceeds <b>5 mg/kg real body weight/day</b>. "
                   "CQ: cumulative dose >300 g."))
story.append(bullet("<b>Duration:</b> HCQ risk ~7.5% after >5 years; 20-50% after >20 years. "
                   "Cumulative HCQ dose >1000 g (standard 400 mg/day for ~7 years)."))
story.append(bullet("<b>Renal impairment:</b> Reduces drug clearance, raising plasma levels."))
story.append(bullet("<b>Tamoxifen co-use:</b> Markedly increases retinal toxicity risk."))
story.append(bullet("<b>Pre-existing maculopathy.</b>"))
story.append(bullet("<b>Obesity:</b> Drug is not stored in fat; dosing by total body weight overestimates "
                   "safe dose."))
story.append(body(
    "<b>Note:</b> Chloroquine is more toxic than hydroxychloroquine at equivalent doses. "
    "HCQ is much safer when the recommended dosing is strictly followed."
))

story.append(section_heading("3. Pathogenesis"))
story.append(body(
    "The drugs bind to melanin in the RPE and cause progressive <b>photoreceptor and RPE damage</b>, "
    "predominantly in the parafoveal region. The central fovea is initially spared, giving rise to "
    "the characteristic 'bull's eye' pattern on examination. The mechanism involves disruption of "
    "lysosomal function within RPE cells, impairing photoreceptor outer-segment renewal."
))

story.append(section_heading("4. Clinical Stages / Fundal Appearance"))
story.append(bullet("<b>Premaculopathy (subclinical):</b> No visible fundal changes; functional and "
                   "structural changes detectable only on sensitive tests. Goal of screening is to "
                   "detect toxicity at this stage before irreversible damage."))
story.append(bullet("<b>Early maculopathy:</b> Subtle macular disturbance; mild VA reduction (6/9-6/12). "
                   "FAF shows oval areas of hyperautofluorescence. OCT reveals loss of cone outer-segment "
                   "tip-line and disruption of IS/OS junction at the parafovea - 'flying saucer' sign."))
story.append(bullet("<b>Established maculopathy - Bull's Eye lesion:</b> Moderate-severe VA reduction "
                   "(6/36-6/60). Classic <b>bull's eye</b> pattern: central foveolar island of pigment "
                   "surrounded by a depigmented ring of RPE atrophy, encircled by a hyperpigmented ring. "
                   "FA shows corresponding hyperfluorescence in a bull's eye distribution."))
story.append(bullet("<b>Advanced retinopathy:</b> Widespread RPE atrophy surrounding the fovea; "
                   "retinal arteriolar attenuation; peripheral pigment clumping (resembles RP). "
                   "Severe permanent visual impairment."))
story.append(body(
    "<b>Vortex keratopathy</b> (corneal whorl-like epithelial deposits) may also occur with both drugs."
))

story.append(section_heading("5. Screening / Investigations"))
story.append(body(
    "The objective of screening is to detect <b>premaculopathy</b> - reversible functional changes "
    "before irreversible structural damage occurs."
))
story.append(bullet("<b>Baseline assessment:</b> Before or soon after commencing therapy: VA, colour "
                   "vision, Amsler grid, fundoscopy, and SD-OCT of the macula. Establishes a "
                   "baseline and excludes pre-existing maculopathy."))
story.append(bullet("<b>Annual review:</b> In the absence of risk factors, routine annual review "
                   "(central visual fields [Humphrey 10-2], FAF, SD-OCT) should begin 5 years after "
                   "starting treatment."))
story.append(bullet("<b>Early annual review (from year 1):</b> Children; patients on chloroquine "
                   "(more toxic); supplementary risk factors (renal impairment, tamoxifen, "
                   "pre-existing maculopathy)."))
story.append(body("<b>Key investigations:</b>"))
story.append(sub_bullet("<b>SD-OCT (Spectral Domain OCT):</b> Most sensitive for early structural change; "
                        "shows parafoveal outer retinal thinning, loss of IS/OS junction, 'flying saucer' sign."))
story.append(sub_bullet("<b>Multifocal ERG (mfERG):</b> Functional test; demonstrates early parafoveal "
                        "dysfunction. Recommended when available."))
story.append(sub_bullet("<b>Humphrey 10-2 visual fields:</b> Central field defects detectable; less "
                        "sensitive than imaging modalities."))
story.append(sub_bullet("<b>Fundus Autofluorescence (FAF):</b> Useful for detecting early RPE dysfunction."))
story.append(sub_bullet("<b>Colour vision testing (Ishihara):</b> Low sensitivity; mild defects may be present."))
story.append(sub_bullet("<b>Fluorescein Angiography (FA):</b> Shows bull's eye hyperfluorescence in "
                        "established disease; largely superseded by OCT for early detection."))

story.append(section_heading("6. Management"))
story.append(bullet("<b>Prevention (primary):</b> Prescribe at the lowest effective dose; calculate dose "
                   "on real (not ideal or total) body weight; avoid dose >5 mg/kg/day for HCQ."))
story.append(bullet("<b>Discontinuation:</b> If toxicity is suspected, discuss cessation with the "
                   "patient's rheumatologist. <i>Note:</i> progression can continue after stopping "
                   "the drug due to drug stored in melanin."))
story.append(bullet("<b>No specific treatment</b> exists to reverse established retinal damage; "
                   "management is therefore primarily preventive."))
story.append(bullet("Regular monitoring enables early discontinuation before irreversible visual "
                   "impairment occurs."))
story.append(source("Kanski's Clinical Ophthalmology, 10th ed., pp. 914-916"))

# ─── FOOTER ─────────────────────────────────────────────────────────────────
story.append(Spacer(1, 0.8*cm))
story.append(HRFlowable(width="100%", thickness=1.5, color=colors.HexColor("#1a3a5c")))
story.append(Spacer(1, 0.2*cm))
story.append(Paragraph(
    "Prepared for MS Ophthalmology Theory Examination  |  "
    "Sources: Kanski's Clinical Ophthalmology (10th ed.), Wills Eye Manual (8th ed.)  |  "
    "August 2026",
    footer_note_style,
))

# Build PDF
doc.build(story)
print(f"PDF generated: {OUTPUT}")
Running Command

python /tmp/workspace/ophthalmology-notes/generate_notes.py

Editing File

~/ophthalmology-notes/generate_notes.py

Successfully replaced 1 instance(s) of the string in '/tmp/workspace/ophthalmology-notes/generate_notes.py'
Running Command

python /tmp/workspace/ophthalmology-notes/generate_notes.py

Running Command

ls -lh /tmp/workspace/ophthalmology-notes/MS_Ophthalmology_Short_Notes.pdf

Your PDF is ready for download:

MS Ophthalmology Short Notes

PDF Document · PDF


Here is a summary of what each note covers, compiled from Kanski's Clinical Ophthalmology (10th ed.) and the Wills Eye Manual (8th ed.):

Topic 1 - Ocular Toxocariasis (15 marks)

  • Aetiology: Toxocara canis (dog roundworm); ingestion of ova-contaminated soil; larvae spread haematogenously to the eye
  • Clinical forms: Visceral larva migrans (VLM, age 2-7 yrs); Covert toxocariasis; Ocular larva migrans (OLM) - typically unilateral in older children/adults
  • Ocular presentations: Chronic endophthalmitis (leukocoria, vitritis, tractional RD - risk of phthisis bulbi); Posterior/peripheral granuloma (1-2 DD yellow-white lesion); Chorioretinal scar; DUSN
  • Investigations: CBC (eosinophilia), serology (ELISA - positive in only ~50% of OLM), IgE raised, B-scan US, aqueous/vitreous sampling; must exclude retinoblastoma
  • Treatment: Corticosteroids (topical/periocular/systemic); Anthelmintics (mebendazole/thiabendazole - with steroids to counter inflammation from worm death); Laser to larva; Vitrectomy for tractional complications

Topic 2 - Amaurosis Fugax (15 marks)

  • Definition: Transient painless monocular visual loss ("curtain coming down"); considered a TIA by AHA; high stroke risk
  • Causes: Embolism (Hollenhorst plaques from carotid), haemodynamic hypoperfusion, GCA, hypercoagulable states, vasospasm
  • Differential: Migraine with aura, GCA, papilloedema, vertebrobasilar insufficiency, impending CRVO
  • Workup: Urgent MRI DWI + carotid duplex Doppler US; ESR/CRP (if GCA suspected); cardiac echo; CBC, glucose, lipids
  • Management: Antiplatelet therapy (aspirin); CEA for high-grade carotid stenosis; anticoagulation for cardiac emboli/AF; urgent steroids for GCA; risk factor control

Topic 3 - Chloroquine/Hydroxychloroquine Retinopathy (15 marks)

  • Mechanism: Drug concentrates in RPE melanin; lysosomal dysfunction causes parafoveal photoreceptor/RPE damage
  • Risk factors: Dose >5 mg/kg/day (HCQ); cumulative CQ dose >300 g / HCQ >1000 g; renal impairment; tamoxifen co-use; >5 years use
  • Fundal stages: Premaculopathy (OCT changes only) → Bull's eye maculopathy (RPE ring atrophy around intact fovea) → Advanced diffuse RPE atrophy + arteriolar attenuation + peripheral pigmentation
  • Investigations: Baseline SD-OCT + visual fields; annual review with Humphrey 10-2 fields, FAF, SD-OCT (from year 5; earlier if risk factors); mfERG when available
  • Management: Prevent with correct dosing; discontinue if toxicity detected (with rheumatologist); no treatment reverses established damage
This is a shared conversation. Sign in to Orris to start your own chat.