Make individual 15 markers questions for the MS ophthalmology exam on following drugs Antifungal Antibacterial Antiviral Immunosuppressive Make in Pdf format
mkdir -p /tmp/workspace/ms-ophthalmology-exam && ls /tmp/workspace/
~/ms-ophthalmology-exam/generate_exam.py
from reportlab.lib.pagesizes import A4
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import inch, cm
from reportlab.lib import colors
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, HRFlowable,
Table, TableStyle, KeepTogether, PageBreak
)
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.platypus import ListFlowable, ListItem
import datetime
OUTPUT = "/tmp/workspace/ms-ophthalmology-exam/MS_Ophthalmology_Exam_Questions.pdf"
doc = SimpleDocTemplate(
OUTPUT,
pagesize=A4,
rightMargin=2*cm,
leftMargin=2*cm,
topMargin=2.2*cm,
bottomMargin=2*cm,
title="MS Ophthalmology Examination Questions",
author="Orris Medical AI"
)
styles = getSampleStyleSheet()
# ── Custom styles ──────────────────────────────────────────────────────────────
NAVY = colors.HexColor("#1a3a5c")
TEAL = colors.HexColor("#0e7490")
AMBER = colors.HexColor("#b45309")
LIGHT = colors.HexColor("#f0f7ff")
LGRAY = colors.HexColor("#f8f9fa")
RULE = colors.HexColor("#cbd5e1")
header_style = ParagraphStyle(
"HeaderStyle", parent=styles["Normal"],
fontName="Helvetica-Bold", fontSize=16, textColor=NAVY,
spaceAfter=4, alignment=TA_CENTER, leading=20
)
sub_header_style = ParagraphStyle(
"SubHeader", parent=styles["Normal"],
fontName="Helvetica", fontSize=10, textColor=colors.HexColor("#334155"),
spaceAfter=2, alignment=TA_CENTER
)
section_title_style = ParagraphStyle(
"SectionTitle", parent=styles["Normal"],
fontName="Helvetica-Bold", fontSize=13, textColor=colors.white,
spaceBefore=14, spaceAfter=6, leading=16
)
q_style = ParagraphStyle(
"Question", parent=styles["Normal"],
fontName="Helvetica-Bold", fontSize=11, textColor=NAVY,
spaceBefore=10, spaceAfter=4, leading=15
)
body_style = ParagraphStyle(
"Body", parent=styles["Normal"],
fontName="Helvetica", fontSize=10, textColor=colors.HexColor("#1e293b"),
spaceAfter=3, leading=14, alignment=TA_JUSTIFY
)
subhead_style = ParagraphStyle(
"SubHead", parent=styles["Normal"],
fontName="Helvetica-BoldOblique", fontSize=10, textColor=TEAL,
spaceBefore=5, spaceAfter=2, leading=13
)
note_style = ParagraphStyle(
"Note", parent=styles["Normal"],
fontName="Helvetica-Oblique", fontSize=9, textColor=colors.HexColor("#64748b"),
spaceAfter=2, leading=12
)
marks_style = ParagraphStyle(
"Marks", parent=styles["Normal"],
fontName="Helvetica-Bold", fontSize=9, textColor=AMBER,
spaceAfter=0, leading=11, alignment=TA_LEFT
)
toc_style = ParagraphStyle(
"TOC", parent=styles["Normal"],
fontName="Helvetica", fontSize=10, textColor=NAVY,
spaceAfter=3, leading=14
)
def section_banner(text, color=NAVY):
data = [[Paragraph(text, section_title_style)]]
t = Table(data, colWidths=[17*cm])
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), color),
("LEFTPADDING", (0,0), (-1,-1), 10),
("RIGHTPADDING", (0,0), (-1,-1), 10),
("TOPPADDING", (0,0), (-1,-1), 6),
("BOTTOMPADDING", (0,0), (-1,-1), 6),
("ROUNDEDCORNERS", [4, 4, 4, 4]),
]))
return t
def marks_box(text="[15 Marks]"):
data = [[Paragraph(text, marks_style)]]
t = Table(data, colWidths=[17*cm])
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), colors.HexColor("#fffbeb")),
("LEFTPADDING", (0,0), (-1,-1), 8),
("TOPPADDING", (0,0), (-1,-1), 3),
("BOTTOMPADDING", (0,0), (-1,-1), 3),
("BOX", (0,0), (-1,-1), 0.5, AMBER),
]))
return t
def answer_block(items):
"""items: list of (heading, [bullet, ...]) or (heading, text_str)"""
rows = []
for heading, content in items:
rows.append(Paragraph(heading, subhead_style))
if isinstance(content, list):
for item in content:
rows.append(Paragraph(f"\u2022 {item}", body_style))
else:
rows.append(Paragraph(content, body_style))
data = [[rows]]
flat = []
for h, c in items:
flat.append(Paragraph(h, subhead_style))
if isinstance(c, list):
for it in c:
flat.append(Paragraph(f"\u2022 {it}", body_style))
else:
flat.append(Paragraph(c, body_style))
container = Table([[flat]], colWidths=[17*cm])
container.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), LGRAY),
("LEFTPADDING", (0,0), (-1,-1), 10),
("RIGHTPADDING", (0,0), (-1,-1), 10),
("TOPPADDING", (0,0), (-1,-1), 6),
("BOTTOMPADDING", (0,0), (-1,-1), 6),
("BOX", (0,0), (-1,-1), 0.5, RULE),
]))
return container
# ── Content ────────────────────────────────────────────────────────────────────
story = []
# ── Cover ─────────────────────────────────────────────────────────────────────
story.append(Spacer(1, 1.5*cm))
story.append(Paragraph("MS OPHTHALMOLOGY EXAMINATION", header_style))
story.append(Paragraph("Long Answer Questions — Pharmacology of Ophthalmic Drugs", sub_header_style))
story.append(Spacer(1, 0.3*cm))
story.append(HRFlowable(width="100%", thickness=2, color=NAVY))
story.append(Spacer(1, 0.2*cm))
story.append(Paragraph(
f"Maximum Marks: 15 per question | Time: 20–25 minutes per question | {datetime.date.today().strftime('%B %Y')}",
sub_header_style
))
story.append(Spacer(1, 0.5*cm))
# Instructions box
instr_data = [[
Paragraph("<b>GENERAL INSTRUCTIONS</b>", ParagraphStyle("i1", parent=styles["Normal"], fontName="Helvetica-Bold", fontSize=10, textColor=NAVY)),
""
],[
Paragraph("1. Answer each question in a structured format with subheadings.", body_style),
Paragraph("2. Include classification, mechanism, pharmacokinetics, clinical uses, adverse effects, and contraindications wherever applicable.", body_style),
],[
Paragraph("3. Diagrams / flowcharts will earn extra credit.", body_style),
Paragraph("4. Mark allocation for each section is indicated in parentheses.", body_style),
]]
instr_t = Table(instr_data, colWidths=[8.5*cm, 8.5*cm])
instr_t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), LIGHT),
("SPAN", (0,0), (1,0)),
("BOX", (0,0), (-1,-1), 1, NAVY),
("LINEBELOW", (0,0), (1,0), 0.8, NAVY),
("LEFTPADDING", (0,0), (-1,-1), 10),
("RIGHTPADDING", (0,0), (-1,-1), 10),
("TOPPADDING", (0,0), (-1,-1), 6),
("BOTTOMPADDING", (0,0), (-1,-1), 6),
]))
story.append(instr_t)
story.append(Spacer(1, 0.5*cm))
# TOC
toc_entries = [
"Question 1 — Antifungal Drugs in Ophthalmology",
"Question 2 — Antibacterial Drugs in Ophthalmology",
"Question 3 — Antiviral Drugs in Ophthalmology",
"Question 4 — Immunosuppressive Drugs in Ophthalmology",
]
toc_rows = [[Paragraph("<b>QUESTION INDEX</b>", ParagraphStyle("ti", parent=styles["Normal"], fontName="Helvetica-Bold", fontSize=10, textColor=NAVY, leading=14))]]
for e in toc_entries:
toc_rows.append([Paragraph(f"\u00bb {e}", toc_style)])
toc_t = Table(toc_rows, colWidths=[17*cm])
toc_t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), LIGHT),
("BACKGROUND", (0,1), (-1,-1), colors.white),
("BOX", (0,0), (-1,-1), 0.8, RULE),
("LINEBELOW", (0,0), (-1,0), 0.8, RULE),
("LEFTPADDING", (0,0), (-1,-1), 10),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
]))
story.append(toc_t)
story.append(PageBreak())
# ══════════════════════════════════════════════════════════════════════════════
# QUESTION 1: ANTIFUNGAL DRUGS
# ══════════════════════════════════════════════════════════════════════════════
story.append(section_banner("QUESTION 1 — ANTIFUNGAL DRUGS IN OPHTHALMOLOGY", NAVY))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph(
"Q1. Discuss the antifungal drugs used in ophthalmology. Include their classification, mechanism of action, routes of administration, indications, adverse effects, and contraindications. Add a note on fungal endophthalmitis management.",
q_style
))
story.append(marks_box("[15 Marks]"))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("<b>MODEL ANSWER</b>", ParagraphStyle("ma", parent=styles["Normal"], fontName="Helvetica-Bold", fontSize=10, textColor=TEAL, spaceAfter=4)))
# Intro
story.append(Paragraph(
"Fungal ocular infections (keratomycosis, fungal endophthalmitis, orbital fungal infections) are an increasingly recognised entity, especially with rising immunocompromised populations. The incidence of ophthalmic fungal infections has risen proportionally. Natamycin 5% ophthalmic suspension is the ONLY commercially available topical antifungal; all other agents require extemporaneous compounding.",
body_style
))
story.append(Spacer(1, 0.2*cm))
story.append(answer_block([
("1. Classification & Key Agents (3 marks)", [
"POLYENES — Natamycin (5% susp.; topical), Amphotericin B (0.15–0.3% drops; compounded; subconjunctival, intravitreal, IV)",
"AZOLES (Imidazoles) — Ketoconazole (oral), Fluconazole (oral/IV/topical compounded), Itraconazole (oral), Voriconazole (oral/IV; 1% topical compounded; intravitreal 50–100 µg/0.1 mL)",
"ECHINOCANDINS — Caspofungin, Micafungin (IV; intravitreal compounded; emerging role in endophthalmitis)",
"PYRIMIDINE ANALOG — Flucytosine / 5-FC (oral; adjunct with Amphotericin B)",
]),
("2. Mechanism of Action (2 marks)", [
"Polyenes: Bind ergosterol in fungal cell membrane → form transmembrane channels → leakage of K⁺, Mg²⁺ → cell death",
"Azoles: Inhibit fungal CYP450 enzyme 14-α-demethylase → block ergosterol synthesis → accumulation of toxic methylated sterols → fungistatic (fungicidal at high doses for azoles)",
"Echinocandins: Inhibit β-(1,3)-D-glucan synthase → disruption of fungal cell wall → fungicidal",
"Flucytosine: Converted intracellularly to 5-FU → inhibits thymidylate synthase + RNA synthesis",
]),
("3. Routes of Administration in Ophthalmology (2 marks)", [
"Topical: Natamycin 5% susp. (q1–2h initially), compounded voriconazole 1%, compounded amphotericin B 0.15%",
"Subconjunctival: Amphotericin B 0.5–1.0 mg, voriconazole 50 µg — useful when corneal penetration is inadequate",
"Intracorneal / Intracameral: Voriconazole or amphotericin B via corneal stroma injection for deep keratitis",
"Intravitreal: Amphotericin B 5–10 µg/0.1 mL, voriconazole 100 µg/0.1 mL — for endophthalmitis",
"Systemic (oral/IV): Voriconazole, fluconazole, caspofungin for deep/disseminated infections",
]),
("4. Indications (2 marks)", [
"Fungal keratitis (keratomycosis): Natamycin first-line for filamentous fungi (Fusarium, Aspergillus); voriconazole/amphotericin B for resistant or Candida keratitis",
"Fungal endophthalmitis: Amphotericin B intravitreal ± systemic voriconazole; often requires pars plana vitrectomy",
"Candida endophthalmitis (haematogenous): Fluconazole oral/IV (first-line for susceptible strains); voriconazole or echinocandin if resistant",
"Post-operative/post-traumatic endophthalmitis",
"Scleritis / orbital fungal infections: systemic voriconazole or amphotericin B",
]),
("5. Adverse Effects (2 marks)", [
"Natamycin topical: Conjunctival hyperaemia, punctate keratopathy, allergic blepharoconjunctivitis; rare systemic toxicity",
"Amphotericin B topical: Significant ocular irritation, punctate epithelial erosions, discomfort",
"Amphotericin B systemic: Nephrotoxicity (dose-limiting), hypokalaemia, fever/chills (infusion reaction), anaemia, hepatotoxicity",
"Voriconazole systemic: Visual disturbances (photopsia, colour vision changes — in up to 30%), hepatotoxicity, photosensitivity, hallucinations, QT prolongation",
"Azoles (general): Inhibit CYP3A4 — multiple drug interactions; hepatotoxicity; teratogenic",
"Echinocandins: Generally well tolerated; histamine-like infusion reactions; mild hepatotoxicity",
]),
("6. Fungal Endophthalmitis — Management Summary (2 marks)", [
"Diagnosis: B-scan ultrasound, vitreous biopsy for KOH/culture and PCR",
"Step 1 — Intravitreal amphotericin B 5–10 µg OR voriconazole 100 µg ± repeat every 48–72 h",
"Step 2 — Systemic therapy: oral voriconazole 400 mg BD loading → 200 mg BD maintenance (first-line Aspergillus); fluconazole for Candida",
"Step 3 — Pars plana vitrectomy (PPV): if no improvement within 48–72 h, dense vitritis, or retinal involvement",
"Step 4 — Monitor renal function (amphotericin B), LFTs (azoles), and drug levels (voriconazole TDM)",
]),
("Examiner's Note", "Award 1 mark for a correctly drawn table/flowchart of antifungal agents vs. fungi (e.g., Fusarium/Aspergillus → natamycin/voriconazole; Candida → fluconazole/amphotericin B)."),
]))
story.append(PageBreak())
# ══════════════════════════════════════════════════════════════════════════════
# QUESTION 2: ANTIBACTERIAL DRUGS
# ══════════════════════════════════════════════════════════════════════════════
story.append(section_banner("QUESTION 2 — ANTIBACTERIAL DRUGS IN OPHTHALMOLOGY", colors.HexColor("#1e5c3a")))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph(
"Q2. Write a detailed account of antibacterial drugs used in ophthalmology. Discuss their classification, mechanisms, clinical indications, routes of administration, adverse effects, and contraindications. Add a note on the management of bacterial endophthalmitis.",
q_style
))
story.append(marks_box("[15 Marks]"))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("<b>MODEL ANSWER</b>", ParagraphStyle("ma2", parent=styles["Normal"], fontName="Helvetica-Bold", fontSize=10, textColor=colors.HexColor("#1e5c3a"), spaceAfter=4)))
story.append(Paragraph(
"Antimicrobial agents in ophthalmology are employed for prophylaxis and treatment of infections ranging from conjunctivitis to sight-threatening endophthalmitis. The choice of antibiotic depends on the presumed organism, severity, anatomical site, and local resistance patterns.",
body_style
))
story.append(Spacer(1, 0.2*cm))
story.append(answer_block([
("1. Classification (2 marks)", [
"A. FLUOROQUINOLONES (4th gen preferred): Moxifloxacin 0.5%, Gatifloxacin 0.3%, Ciprofloxacin 0.3%, Ofloxacin 0.3%, Levofloxacin 0.5%",
"B. AMINOGLYCOSIDES: Tobramycin 0.3%, Gentamicin 0.3%, Neomycin (combination products)",
"C. MACROLIDES: Azithromycin 1% ophthalmic solution (AzaSite)",
"D. TETRACYCLINES: Tetracycline 1% ointment, Doxycycline (oral — for rosacea/MGD/trachoma)",
"E. SULFONAMIDES: Sulfacetamide 10–30% drops/ointment",
"F. CHLORAMPHENICOL: 0.5% drops / 1% ointment (broad-spectrum, rarely used now due to aplastic anaemia risk)",
"G. PENICILLINS / CEPHALOSPORINS: Cefazolin, vancomycin (intravitreal); ampicillin (systemic)",
"H. POLYMYXIN B combinations: Polytrim (polymyxin B + trimethoprim), Neosporin",
"I. GLYCOPEPTIDES: Vancomycin 1 mg/0.1 mL intravitreal (endophthalmitis); teicoplanin",
"J. BACITRACIN: Topical ointment (Gram-positive coverage)",
]),
("2. Mechanism of Action (2 marks)", [
"Fluoroquinolones: Inhibit DNA gyrase (topoisomerase II) and topoisomerase IV → prevent DNA supercoiling and replication → bactericidal",
"Aminoglycosides: Bind 30S ribosomal subunit → misreading of mRNA → faulty protein synthesis → bactericidal",
"Macrolides (azithromycin): Bind 50S ribosomal subunit → inhibit translocation → bacteriostatic",
"Tetracyclines: Bind 30S subunit → block aminoacyl-tRNA binding → bacteriostatic",
"Vancomycin: Inhibit cell wall peptidoglycan synthesis by binding D-Ala-D-Ala terminus → bactericidal",
"Polymyxin B: Disrupt outer membrane of Gram-negative bacteria → bactericidal",
]),
("3. Routes of Administration (1 mark)", [
"Topical (drops/ointment): Conjunctivitis, keratitis, blepharitis prophylaxis",
"Subconjunctival: Cefazolin 100 mg, gentamicin 20 mg — penetrate cornea and anterior chamber",
"Intracameral: Cefuroxime 1 mg/0.1 mL (prophylaxis post-cataract surgery — ESCRS regimen)",
"Intravitreal: Vancomycin 1 mg/0.1 mL + ceftazidime 2.25 mg/0.1 mL — bacterial endophthalmitis",
"Systemic (oral/IV): Ciprofloxacin, doxycycline, cefazolin — for dacryocystitis, orbital cellulitis, systemic infections",
]),
("4. Clinical Indications (2 marks)", [
"Bacterial conjunctivitis: Fluoroquinolones or polymyxin-trimethoprim (mild-moderate); gram stain-guided for severe",
"Bacterial keratitis: Fortified antibiotics — cefazolin 5% + tobramycin 1.4% OR fluoroquinolone monotherapy (4th gen moxifloxacin) hourly initially",
"Trachoma: Azithromycin single oral dose 20 mg/kg (WHO SAFE strategy) or topical tetracycline 1% ointment",
"Blepharitis/Meibomian gland dysfunction: Oral doxycycline 50–100 mg OD; topical azithromycin",
"Dacryocystitis (acute): Amoxicillin-clavulanate oral / IV cefazolin",
"Orbital cellulitis: IV broad-spectrum (piperacillin-tazobactam / ceftriaxone + metronidazole)",
"Bacterial endophthalmitis: Intravitreal vancomycin + ceftazidime ± pars plana vitrectomy (EVS guidelines)",
"Prophylaxis (post-op): Topical fluoroquinolone; intracameral cefuroxime",
"Gonococcal conjunctivitis: IM ceftriaxone 1 g single dose + topical saline irrigation",
"Neonatal ophthalmia: Erythromycin ointment prophylaxis; IV ceftriaxone for gonococcal",
]),
("5. Bacterial Endophthalmitis — EVS-Based Protocol (2 marks)", [
"PRESUMED DIAGNOSIS: acute post-operative endophthalmitis (within 6 weeks of surgery)",
"IMMEDIATE: Vitreous tap (0.1 mL) for Gram stain, culture & PCR; aqueous tap (0.1 mL)",
"INTRAVITREAL ANTIBIOTICS: Vancomycin 1 mg/0.1 mL (Gram-positive) + Ceftazidime 2.25 mg/0.1 mL (Gram-negative)",
"Intravitreal dexamethasone 0.4 mg/0.1 mL — controversial; may reduce inflammation",
"EVS: PPV vs. tap-and-inject — PPV indicated for hand-motion vision or worse; no difference for better vision",
"Subconjunctival: Vancomycin 25 mg + ceftazidime 100 mg at time of intravitreal injection",
"Systemic antibiotics (oral ciprofloxacin 750 mg BD): NOT shown to improve outcomes in EVS — discretionary",
"Repeat intravitreal at 36–48 h if no clinical improvement",
]),
("6. Adverse Effects (2 marks)", [
"Fluoroquinolones: Mild ocular burning/stinging; crystalline keratopathy (ciprofloxacin, especially long-term); QT prolongation (systemic); articular toxicity in children (systemic)",
"Aminoglycosides: Epithelial toxicity with prolonged use (tobramycin/gentamicin); ototoxicity and nephrotoxicity (systemic gentamicin); neomycin — high rate of allergic contact dermatitis",
"Chloramphenicol: Topical — aplastic anaemia (very rare, idiosyncratic but black-box warning); optic neuropathy with systemic use",
"Tetracyclines: Photosensitivity (systemic); dental staining / embryotoxicity (avoid in pregnancy and children <8 years); pseudotumour cerebri",
"Vancomycin intravitreal: Haemorrhagic occlusive retinal vasculitis (HORV) — rare but devastating; especially after bilateral sequential same-day surgery",
"Subconjunctival aminoglycosides: Macular infarction if inadvertently administered intraocularly",
]),
("Contraindications / Cautions", [
"Vancomycin intravitreal: Avoid bilateral same-day intravitreal injections (risk of HORV)",
"Aminoglycosides: Avoid systemic in renal impairment (adjust dose); avoid intravitreal injection into posterior chamber",
"Chloramphenicol: Avoid in neonates (grey baby syndrome); avoid in hepatic/renal failure",
"Tetracyclines: Contraindicated in pregnancy, lactation, children <8 years",
"Fluoroquinolones: Caution with systemic steroids (tendon rupture risk); avoid in children (systemic)",
]),
]))
story.append(PageBreak())
# ══════════════════════════════════════════════════════════════════════════════
# QUESTION 3: ANTIVIRAL DRUGS
# ══════════════════════════════════════════════════════════════════════════════
story.append(section_banner("QUESTION 3 — ANTIVIRAL DRUGS IN OPHTHALMOLOGY", colors.HexColor("#5c1a1a")))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph(
"Q3. Describe the antiviral drugs used in ophthalmology. Discuss classification, mechanisms of action, pharmacokinetics, indications, adverse effects, and contraindications. Include the management of herpes simplex keratitis, herpes zoster ophthalmicus, and CMV retinitis.",
q_style
))
story.append(marks_box("[15 Marks]"))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("<b>MODEL ANSWER</b>", ParagraphStyle("ma3", parent=styles["Normal"], fontName="Helvetica-Bold", fontSize=10, textColor=colors.HexColor("#5c1a1a"), spaceAfter=4)))
story.append(Paragraph(
"Viral infections of the eye span from relatively benign adenoviral conjunctivitis to sight-threatening herpes simplex keratitis, herpes zoster ophthalmicus (HZO), and CMV retinitis. Antiviral drugs used in ophthalmology include topical nucleoside analogues, oral prodrugs, and systemic agents. Trifluridine is the only FDA-approved topical antiviral for ophthalmic use (for HSV keratoconjunctivitis), while ganciclovir 0.15% gel is a valuable topical alternative.",
body_style
))
story.append(Spacer(1, 0.2*cm))
story.append(answer_block([
("1. Classification (2 marks)", [
"A. TOPICAL AGENTS: Trifluridine 1% ophthalmic solution, Ganciclovir 0.15% ophthalmic gel",
"B. ORAL NUCLEOSIDE ANALOGUES: Acyclovir 200/400/800 mg, Valacyclovir 500/1000 mg (prodrug of acyclovir), Famciclovir 125/250/500 mg (prodrug of penciclovir)",
"C. ANTI-CMV AGENTS: Ganciclovir IV, Valganciclovir oral, Foscarnet IV/intravitreal, Cidofovir IV, Fomivirsen (intravitreal; antisense; withdrawn in many markets)",
"D. ANTI-ADENOVIRAL: Povidone-iodine 0.5–1% drops (off-label; antiseptic with antiviral properties); ganciclovir ophthalmic gel (off-label)",
"E. ANTI-VEGF + ANTIVIRAL COMBINATION: Used in CMV retinitis with macular oedema",
]),
("2. Mechanism of Action (2 marks)", [
"Acyclovir/Valacyclovir: Phosphorylated by viral thymidine kinase (TK) → acyclovir monophosphate → cellular kinases → acyclovir triphosphate → inhibits viral DNA polymerase and is incorporated into viral DNA as a chain terminator (lacks 3'-OH) → DNA synthesis halted",
"Famciclovir/Penciclovir: Similar to acyclovir; longer intracellular half-life of active triphosphate (7–20 h vs 1 h for acyclovir); active against HSV-1, HSV-2, VZV",
"Trifluridine: Fluorinated pyrimidine → converted to triphosphate → competitively inhibits thymidylate synthase + incorporated into viral DNA → defective DNA synthesis; also toxic to host cells → topical use only",
"Ganciclovir: Preferentially phosphorylated by CMV-encoded protein kinase UL97 + viral TK (HSV); triphosphate inhibits viral DNA polymerase; incorporated into viral DNA → premature chain termination",
"Foscarnet: Directly inhibits viral DNA polymerase (and reverse transcriptase) by binding pyrophosphate-binding site → does NOT require phosphorylation by viral TK → active against acyclovir-resistant HSV and ganciclovir-resistant CMV",
"Cidofovir: Nucleotide analogue; phosphorylated by cellular (not viral) kinases → active di-phosphate inhibits CMV DNA polymerase; very long intracellular half-life",
]),
("3. Pharmacokinetics (1 mark)", [
"Acyclovir oral: Low bioavailability (15–30%); valacyclovir has 54% bioavailability (rapidly hydrolysed to acyclovir); excreted renally — dose-adjust in renal impairment",
"Trifluridine: Rapid corneal absorption; negligible systemic absorption; short half-life → must be applied up to 9× daily initially",
"Ganciclovir gel: Controlled-release gel formulation; corneal therapeutic levels 5× daily dosing sufficient",
"Valganciclovir oral: ~60% bioavailability; rapidly converted to ganciclovir; renally excreted",
"Foscarnet: IV only; minimal oral absorption; 80% renally excreted unchanged; CSF penetration — useful for viral encephalitis",
"Cidofovir: Long intracellular half-life → weekly then fortnightly dosing; nephrotoxic",
]),
("4. Clinical Indications & Drug of Choice (3 marks)", [
"HERPES SIMPLEX KERATITIS — Epithelial (dendritic/geographic): Topical trifluridine 1% q2h (max 9×/day) ×14 days OR ganciclovir 0.15% gel 5×/day ×7 days. Oral acyclovir 400 mg 5×/day for 7–10 days (HEDS trial — equivalent to topical for epithelial; preferred in developing countries). Avoid topical steroids alone in epithelial keratitis",
"HSV STROMAL KERATITIS (non-necrotising): Topical prednisolone + topical antiviral cover (HEDS trial); oral acyclovir 400 mg BD as prophylaxis reduces recurrence by 41% over 1 year",
"HSV IRIDOCYCLITIS: Oral acyclovir 400–800 mg 5×/day; topical cycloplegic + steroid",
"HERPES ZOSTER OPHTHALMICUS (HZO): Oral acyclovir 800 mg 5×/day ×7–10 days (begin within 72 h of rash) OR valacyclovir 1 g TDS ×7 days OR famciclovir 500 mg TDS ×7 days. Oral preferred over topical for HZO (dermatomal distribution). Topical antibiotic for corneal involvement; cycloplegics for uveitis",
"CMV RETINITIS: Induction — IV ganciclovir 5 mg/kg BD ×14–21 days OR oral valganciclovir 900 mg BD ×21 days. Maintenance — valganciclovir 900 mg OD (with ART in HIV). Foscarnet 90 mg/kg BD as alternative (for ganciclovir-resistant CMV). Cidofovir 5 mg/kg IV weekly ×2 then fortnightly (with probenecid + IV saline hydration). Intravitreal ganciclovir implant (Vitrasert) — zero-order sustained release; supplemented with systemic for fellow eye protection",
"ACUTE RETINAL NECROSIS (ARN — VZV/HSV): IV acyclovir 10–15 mg/kg TDS ×7–14 days → oral valacyclovir 1 g TDS ×6 weeks; intravitreal foscarnet/ganciclovir; prophylactic laser barricade",
"PROGRESSIVE OUTER RETINAL NECROSIS (PORN — VZV in immunocompromised): Combined IV ganciclovir + IV foscarnet + intravitreal ganciclovir/foscarnet; poor prognosis",
"ADENOVIRAL KERATOCONJUNCTIVITIS: Supportive; povidone-iodine 0.5% drops (antiseptic); ganciclovir gel (off-label evidence)",
]),
("5. Adverse Effects (2 marks)", [
"Trifluridine: Punctate keratopathy, follicular conjunctivitis, hypersensitivity; corneal toxicity with prolonged use (>21 days); NOT for systemic use (too toxic)",
"Ganciclovir gel: Transient blurred vision, conjunctival hyperaemia, punctate keratopathy",
"Acyclovir oral: Generally well tolerated; nausea, headache; renal tubular crystallisation at high doses IV → adequate hydration required; reversible nephrotoxicity; CNS toxicity (confusion, tremor) with high IV doses",
"Valganciclovir/Ganciclovir: Myelosuppression — dose-dependent neutropaenia (CBC weekly initially); thrombocytopaenia; carcinogenic + teratogenic (black-box warning); carcinogenicity — contraindicated in pregnancy",
"Foscarnet: Nephrotoxicity (chelates divalent cations); electrolyte disturbances — hypocalcaemia, hypophosphataemia (seizures); genital ulceration; anaemia; visual disturbance; conjunctivitis",
"Cidofovir: Nephrotoxicity (dose-limiting — must co-administer probenecid + IV saline); uveitis (paradoxical ocular hypotony); retinal detachment risk; contraindicated with other nephrotoxic drugs",
]),
("6. Contraindications (1 mark)", [
"Trifluridine: Do not use >21 days (corneal toxicity); not for systemic use",
"Acyclovir/Valacyclovir: Renal impairment — dose adjust; caution with nephrotoxic drugs",
"Ganciclovir/Valganciclovir: Pregnancy (teratogenic, Category D); severe neutropaenia (ANC <500 cells/µL); avoid with other myelosuppressive agents without haematological monitoring",
"Foscarnet: Avoid with other nephrotoxic agents; correct electrolytes before therapy",
"Cidofovir: Contraindicated if Cr >1.5 mg/dL or CrCl <55 mL/min; contraindicated with probenecid allergy",
]),
("Examiner's Note", "Award 2 marks for a correctly structured comparison table of HSV antiviral agents (mechanism, route, dosing schedule, major toxicity). 1 extra mark for naming the HEDS trial findings correctly."),
]))
story.append(PageBreak())
# ══════════════════════════════════════════════════════════════════════════════
# QUESTION 4: IMMUNOSUPPRESSIVE DRUGS
# ══════════════════════════════════════════════════════════════════════════════
story.append(section_banner("QUESTION 4 — IMMUNOSUPPRESSIVE DRUGS IN OPHTHALMOLOGY", colors.HexColor("#4c1d6e")))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph(
"Q4. Discuss the immunosuppressive drugs used in ophthalmology. Classify them, explain mechanisms, clinical indications, monitoring parameters, adverse effects, and contraindications. Include a note on biologics and the approach to non-infectious uveitis.",
q_style
))
story.append(marks_box("[15 Marks]"))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("<b>MODEL ANSWER</b>", ParagraphStyle("ma4", parent=styles["Normal"], fontName="Helvetica-Bold", fontSize=10, textColor=colors.HexColor("#4c1d6e"), spaceAfter=4)))
story.append(Paragraph(
"Immunosuppressive agents in ophthalmology are primarily used to treat non-infectious inflammatory conditions — particularly uveitis, scleritis, mucous membrane pemphigoid, thyroid eye disease, and ocular surface inflammatory disorders. They serve as steroid-sparing agents to avoid the long-term sequelae of corticosteroids (cataract, glaucoma, infection). Adalimumab became the first non-corticosteroid agent FDA-approved for non-infectious uveitis in 2016.",
body_style
))
story.append(Spacer(1, 0.2*cm))
story.append(answer_block([
("1. Classification (2 marks)", [
"A. CORTICOSTEROIDS (first-line): Topical (prednisolone acetate 1%, dexamethasone 0.1%, loteprednol 0.5%), periocular (triamcinolone 40 mg/mL subtenon/periocular), intravitreal (triamcinolone, dexamethasone implant/Ozurdex, fluocinolone acetonide implant/Iluvien), systemic (prednisolone 1–2 mg/kg/day)",
"B. ANTIMETABOLITES: Methotrexate (MTX), Mycophenolate mofetil (MMF), Azathioprine",
"C. CALCINEURIN INHIBITORS: Cyclosporine (topical 0.05–2%, oral, intravitreal), Tacrolimus (topical 0.03%, oral)",
"D. ALKYLATING AGENTS: Cyclophosphamide, Chlorambucil (reserved for severe/refractory cases)",
"E. BIOLOGICS — TNF-α inhibitors: Adalimumab (Humira — FDA-approved for uveitis), Infliximab (IV; first-line for Behçet uveitis), Golimumab, Etanercept (NOT effective for uveitis)",
"F. BIOLOGICS — Anti-IL-6: Tocilizumab (for JIA uveitis refractory to MTX + adalimumab), Sarilumab",
"G. BIOLOGICS — Anti-CD20: Rituximab (for scleritis, mucous membrane pemphigoid, orbital lymphoma)",
"H. BIOLOGICS — Anti-IL-17: Secukinumab (for ankylosing spondylitis-associated uveitis)",
"I. mTOR INHIBITORS: Sirolimus (intravitreal / systemic; experimental for non-infectious uveitis)",
"J. TOPICAL IMMUNOMODULATORS: Cyclosporine 0.05% (Restasis) for dry eye disease; Lifitegrast 5% (Xiidra) — LFA-1 antagonist for dry eye",
]),
("2. Mechanisms of Action (2 marks)", [
"Corticosteroids: Bind glucocorticoid receptor → translocate to nucleus → inhibit NF-κB and AP-1 → ↓ transcription of pro-inflammatory cytokines (IL-1, IL-2, TNF-α, IFN-γ); stabilise lysosomal membranes; inhibit arachidonic acid cascade via lipocortin-1",
"Methotrexate: Inhibits dihydrofolate reductase (DHFR) → ↓ tetrahydrofolate → ↓ purine and thymidylate synthesis → antiproliferative; also anti-inflammatory via adenosine pathway",
"Mycophenolate mofetil: Inhibits inosine monophosphate dehydrogenase (IMPDH) → ↓ de novo guanosine synthesis → selective inhibition of T- and B-lymphocyte proliferation",
"Azathioprine: Prodrug → 6-mercaptopurine → incorporated as fraudulent nucleotide → inhibit purine synthesis → lymphocyte suppression; also inhibits TPMT-dependent pathway",
"Cyclosporine: Binds cyclophilin (immunophilin) → complex inhibits calcineurin → ↓ dephosphorylation of NFAT → ↓ transcription of IL-2 → inhibit T-helper cell activation",
"Tacrolimus: Binds FK506-binding protein (FKBP12) → complex inhibits calcineurin (same pathway as cyclosporine but 10–100× more potent)",
"Cyclophosphamide: Alkylating agent → cross-link DNA strands → prevent replication of B and T lymphocytes",
"Adalimumab/Infliximab: Anti-TNF-α monoclonal antibodies → neutralise soluble and membrane-bound TNF-α → ↓ downstream inflammatory cascade (NF-κB, prostaglandins, MMP)",
"Tocilizumab: Anti-IL-6 receptor antibody → block IL-6 signalling → ↓ acute phase response and Th17 activity",
"Rituximab: Anti-CD20 antibody → deplete B lymphocytes via ADCC, CDC, and apoptosis",
]),
("3. Clinical Indications in Ophthalmology (3 marks)", [
"NON-INFECTIOUS UVEITIS (anterior, intermediate, posterior, panuveitis): Corticosteroids (first-line); MTX or MMF (steroid-sparing, second-line); adalimumab (FDA-approved 2016 — first non-corticosteroid approval for uveitis); infliximab (Behçet disease — first-line biologic)",
"JUVENILE IDIOPATHIC ARTHRITIS (JIA) UVEITIS: MTX (first-line steroid-sparing); adalimumab if MTX fails; tocilizumab if anti-TNF fails",
"BEHÇET DISEASE: Infliximab (first-line biologic); alternatively adalimumab; azathioprine + prednisolone (classic regimen); cyclosporine (caution — ↑ neurological risk in Behçet)",
"SYMPATHETIC OPHTHALMIA: High-dose prednisolone → MTX or MMF as steroid-sparing",
"VOGT-KOYANAGI-HARADA (VKH): High-dose pulsed IV methylprednisolone → oral prednisolone taper; MTX or MMF for chronic/recurrent cases",
"SCLERITIS (non-infectious): NSAIDs (mild); prednisolone (moderate-severe); MTX, MMF, rituximab (refractory)",
"OCULAR MUCOUS MEMBRANE PEMPHIGOID: Dapsone, prednisolone; cyclophosphamide + prednisolone (IV pulse for progressive disease); rituximab (emerging)",
"THYROID EYE DISEASE (TED): IV methylprednisolone (EUGOGO recommended for moderate-severe); teprotumumab (anti-IGF-1R — FDA-approved 2020); orbital radiotherapy",
"DRY EYE DISEASE: Cyclosporine 0.05% (Restasis) — ↑ conjunctival goblet cell density; lifitegrast 5% (Xiidra) — blocks ICAM-1/LFA-1 interaction",
"POST-PENETRATING KERATOPLASTY REJECTION PROPHYLAXIS: Cyclosporine topical 1–2% or 0.05%; systemic MMF or cyclosporine in high-risk grafts",
"ORBITAL INFLAMMATORY DISEASE: Prednisolone first-line; rituximab for IgG4-related ophthalmic disease",
]),
("4. Monitoring Parameters (2 marks)", [
"Methotrexate: CBC, LFTs, creatinine before initiation; CBC + LFTs every 4–8 weeks; chest X-ray (baseline for pulmonary toxicity); urine pregnancy test; baseline PFTs if respiratory symptoms; folic acid 1 mg/day supplementation mandatory",
"Mycophenolate mofetil: CBC every 2–4 weeks for first 3 months, then every 3 months; LFTs; pregnancy test (teratogenic — Category D)",
"Azathioprine: TPMT enzyme activity (genetic screen) before starting — TPMT-deficient patients have toxic accumulation; CBC every 4 weeks; LFTs",
"Cyclosporine (systemic): Serum creatinine, urine protein, BP, LFTs, cyclosporine trough levels (100–200 ng/mL); ophthalmoscopy (posterior leukoencephalopathy risk)",
"Cyclophosphamide: CBC, urinalysis (haemorrhagic cystitis — mesna co-administration); LFTs; bladder monitoring; MESNA prophylaxis for haemorrhagic cystitis",
"Biologics (adalimumab, infliximab): TB screening (IGRA/Mantoux); Hepatitis B & C serology; CBC; ANA; screen for lymphoma risk; live vaccine contraindicated 4 weeks before initiation",
"Corticosteroids (systemic): IOP monitoring (steroid-response glaucoma), lens check (posterior subcapsular cataract), BP, blood glucose, bone density (DEXA scan), ACTH stimulation",
]),
("5. Adverse Effects (2 marks)", [
"Corticosteroids: Posterior subcapsular cataract, steroid-response glaucoma (IOP rise), susceptibility to infections (especially herpes reactivation), central serous chorioretinopathy, optic disc oedema (pseudotumour cerebri); systemic — Cushing's syndrome, adrenal suppression, osteoporosis, hyperglycaemia, hypertension, peptic ulceration",
"Methotrexate: Hepatotoxicity (hepatic fibrosis with cumulative dose >1.5 g), myelosuppression (mucositis, pancytopaenia), pulmonary toxicity (MTX pneumonitis), renal toxicity; teratogenic (Category X); MTX-induced photosensitivity",
"Mycophenolate mofetil: GI disturbance (diarrhoea, nausea), leucopaenia, infection susceptibility; teratogenic (Category D — pregnancy prevention programme mandatory in EU)",
"Azathioprine: Myelosuppression (especially in TPMT-deficient patients), hepatotoxicity, GI upset, increased risk of lymphoma (with long-term use), hypersensitivity syndrome",
"Cyclosporine: Nephrotoxicity (dose-dependent — rise in creatinine), hypertension, hirsutism, gingival hyperplasia, hepatotoxicity, neurotoxicity; topical: burning/stinging eye (Restasis)",
"Cyclophosphamide: Haemorrhagic cystitis (prevented by mesna + hydration), bladder cancer (long-term), myelosuppression, infertility, secondary malignancies",
"TNF-α inhibitors: Reactivation of latent TB and other opportunistic infections, demyelinating disease (use caution in MS), CHF exacerbation, paradoxical uveitis (with etanercept), injection-site reactions, increased lymphoma risk",
"Rituximab: Infusion reactions, progressive multifocal leukoencephalopathy (PML — JC virus), prolonged B-cell depletion, hepatitis B reactivation",
]),
("6. Contraindications (1 mark)", [
"MTX: Pregnancy (absolutely contraindicated — Category X), hepatic disease, significant renal impairment (CrCl <30), active infection, severe myelosuppression",
"MMF: Pregnancy (Category D), hypersensitivity to mycophenolic acid",
"Cyclosporine: Uncontrolled hypertension, renal impairment, malignancy (except non-melanoma skin cancer in transplant)",
"Cyclophosphamide: Active infection, severe myelosuppression; use with extreme caution in pregnancy",
"TNF-α inhibitors: Active TB or serious infection, NYHA class III/IV heart failure, history of demyelinating disease, hepatitis B (screen and prophylax first)",
"Corticosteroids (relative): Active peptic ulcer, uncontrolled DM, herpes simplex keratitis (topical steroids without antiviral cover worsen epithelial disease)",
]),
("Note on Biologics in Uveitis", "Adalimumab (Humira) is the first and only non-corticosteroid biologic FDA-approved for non-infectious intermediate, posterior, and panuveitis (2016). Infliximab is preferred for Behçet disease-associated uveitis. Etanercept is NOT effective for uveitis and may paradoxically worsen it. Tocilizumab (anti-IL-6R) is emerging as second-line biologic for JIA-associated uveitis. Secukinumab (anti-IL-17A) shows promise in HLA-B27-associated uveitis."),
]))
# ── Footer note ───────────────────────────────────────────────────────────────
story.append(Spacer(1, 0.6*cm))
story.append(HRFlowable(width="100%", thickness=1, color=RULE))
story.append(Spacer(1, 0.2*cm))
story.append(Paragraph(
"References: Goodman & Gilman's The Pharmacological Basis of Therapeutics (13th Ed.) — Chapter 74 (Ocular Pharmacology); "
"Wills Eye Manual (7th Ed.); Lippincott Illustrated Reviews: Pharmacology (7th Ed.) — Chapter 34; "
"Firestein & Kelley's Textbook of Rheumatology; Goldman-Cecil Medicine.",
note_style
))
story.append(Paragraph(
"Prepared for MS Ophthalmology Examination | Orris Medical AI | August 2026",
note_style
))
# ── Build PDF ─────────────────────────────────────────────────────────────────
doc.build(story)
print(f"PDF saved to: {OUTPUT}")
cd /tmp/workspace/ms-ophthalmology-exam && python generate_exam.py 2>&1
~/ms-ophthalmology-exam/generate_exam.py
Successfully replaced 1 instance(s) of the string in '/tmp/workspace/ms-ophthalmology-exam/generate_exam.py'
cd /tmp/workspace/ms-ophthalmology-exam && sed -i 's/story\.append(answer_block(/story.extend(answer_block(/g' generate_exam.py && python generate_exam.py 2>&1
ls -lh /tmp/workspace/ms-ophthalmology-exam/ && python -c "from pypdf import PdfReader; r = PdfReader('/tmp/workspace/ms-ophthalmology-exam/MS_Ophthalmology_Exam_Questions.pdf'); print(f'Pages: {len(r.pages)}')"
MS Ophthalmology Exam Questions
PDF Document · PDF