Hii

Hey! How can I help you today?

What can you do

Here's a quick rundown of what I can do:

Research & Knowledge

  • Answer questions across any domain - science, history, math, law, technology, etc.
  • Search the web for current, up-to-date information
  • Find and summarize recent news and events

Medical & Clinical

  • Search a medical textbook library for clinical information on drugs, diagnoses, anatomy, physiology, procedures, and more
  • Search PubMed for peer-reviewed studies, clinical trials, and systematic reviews
  • Provide evidence-based answers with proper citations

Documents & Files

  • Word (.docx) - create, read, edit professional documents
  • PowerPoint (.pptx) - build or modify slide presentations
  • Excel (.xlsx) - create or analyze spreadsheets
  • PDF - read, extract text, merge, split, annotate

Images & Visuals

  • Generate original images, diagrams, posters, and flashcards from descriptions
  • Analyze and describe images or videos you upload
  • Fetch and display images from web sources

Code & Computation

  • Write, run, and debug code in Python, JavaScript, and more
  • Perform data analysis and generate charts
  • Execute shell commands in a sandbox environment

Writing & Content

  • Draft essays, reports, emails, summaries, and more
  • Edit and proofread existing content
  • Translate between languages

What would you like to work on?

Explain senile cataract according to standard mbbs textbook of ophthalmology

Reading File
Finding Sources
Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Reading File
Reading File
Loading Image
Loading Image
Finding Sources
Reading File
Reading File
I now have comprehensive content from Kanski's Clinical Ophthalmology. Let me compile a thorough, well-structured answer.

Senile (Age-Related) Cataract

Source: Kanski's Clinical Ophthalmology: A Systematic Approach, 10th Edition

Definition

Cataract is opacification of the crystalline lens. Senile (age-related) cataract is the term for lens opacity that occurs as a consequence of normal ageing. It is the commonest cause of reversible visual disability in the world. There is no medical treatment to prevent its development or progression.

Lens Anatomy (Relevant to Understanding Cataract)

Lens anatomy - cross-section of anterior segment and histological structure
Fig. 10.1 - (A) Cross-sectional anatomy of the anterior segment; (B) histological cross-section showing zones of the lens
  • Zonules hold the lens in position
  • Capsule - an acellular membrane enclosing the lens
  • Epithelial cells - cuboid cells beneath the anterior capsule; cells in the germinative zone divide continuously and differentiate into lens fibres
  • Lens substance - a central nucleus surrounded by cortical material

Effect on Vision

Cataracts develop slowly. Symptoms include:
SymptomMechanism
Reduced visual acuityProgressive opacification
Loss of contrast sensitivityLight scattering
Change in colour perceptionDifficulty perceiving blue colours
GlareLight scattering; worse at night (e.g. car headlights)
Monocular diplopiaEspecially with point light sources
Poor night visionReduced light transmission

Types of Age-Related Cataract

Fig. 10.2 - Age-related cataract types on slit lamp and retroillumination
Fig. 10.2 - (A) Posterior subcapsular; (B) Posterior subcapsular on retroillumination showing Wedl cells (arrow); (C) Nuclear sclerosis; (D) Nuclear sclerosis on retroillumination showing nucleus-cortex demarcation (arrow); (E) Cortical cataract; (F) Cortical spokes on retroillumination; (G) Christmas tree cataract; (H) Christmas tree on retroillumination

1. Posterior Subcapsular Cataract (PSC)

  • Lies just in front of the posterior capsule
  • Granular or plaque-like on oblique slit lamp
  • Appears black and vacuolated on retroillumination
  • Vacuoles are swollen migratory lens epithelial cells - called bladder cells or Wedl cells (similar to those in posterior capsular opacification)
  • Due to location at the nodal point of the eye, even a small PSC has a profound effect on vision
  • Patients are troubled by glare (e.g. from oncoming headlights)
  • Symptoms worsen with miosis (near tasks, bright sunlight)

2. Nuclear Sclerotic Cataract

  • An exaggeration of normal ageing change
  • Associated with myopia due to increased refractive index of nucleus - results in "second sight of the aged" (elderly patients can read without glasses again)
  • Characterized by a yellowish hue due to deposition of urochrome pigment
  • Best assessed with an oblique slit lamp beam
  • Retroillumination shows good red reflex but subtle nucleus-cortex demarcation
  • When advanced: nucleus appears brown (brunescent), and in rare cases black (nigra)

3. Cortical Cataract

  • Involves anterior, posterior or equatorial cortex
  • Opacities begin as clefts and vacuoles between lens fibres due to cortical hydration
  • Progress to typical cuneiform (wedge-shaped) or radial spoke-like opacities
  • Often initially in the inferonasal quadrant
  • Glare is a common symptom (as with PSC)

4. Christmas Tree Cataract

  • Polychromatic, needle-like crystalline deposits in the lens
  • Creates a multicoloured sparkling appearance (like a Christmas tree)
  • Seen on direct illumination and retroillumination (panels G and H above)

Cataract Maturity (Stages)

StageDescription
ImmatureLens is partially opaque; red reflex still present
MatureLens is completely opaque; no red reflex
HypermatureShrunken, wrinkled anterior capsule due to leakage of water out of the lens
MorgagnianHypermature cataract in which liquefaction of cortex allows the nucleus to sink inferiorly

Associated Risk Factors / Cataract in Systemic Disease

Diabetes Mellitus

  • Hyperglycaemia raises aqueous glucose → enters lens → converted to sorbitol by aldose reductase → osmotic overhydration
  • Refractive fluctuations follow plasma glucose level (hyperglycaemia = myopia)
  • Classic snowflake cortical opacity - rare, seen in young diabetics; can mature within days or resolve spontaneously
  • Age-related cataract occurs earlier in diabetics; nuclear sclerosis common and rapidly progressive
  • ~1 in 5 cataract surgery patients have diabetes

Other systemic associations

  • Chronic steroid use (posterior subcapsular)
  • Myotonic dystrophy
  • Neurofibromatosis type 2
  • Down syndrome
  • Galactosaemia (in children)

Secondary (Complicated) Cataract

These develop as a result of primary ocular disease:
  • Chronic anterior uveitis - most common cause; both inflammation and steroid treatment are causative; earliest sign is polychromatic lustre at posterior pole
  • Acute angle closure glaucoma - produces small grey-white subcapsular opacities called glaukomflecken (focal infarcts of lens epithelium; pathognomonic)
  • High myopia - posterior subcapsular opacity + early nuclear sclerosis
  • Hereditary fundus dystrophies (retinitis pigmentosa, Leber congenital amaurosis, gyrate atrophy, Stickler syndrome) - usually posterior subcapsular opacity

Management

When to Operate

Surgery is indicated when:
  • The cataract significantly impairs the patient's quality of life or ability to carry out daily tasks
  • There is a secondary complication (e.g. phacomorphic or phacolytic glaucoma)

Surgical Options

1. Phacoemulsification (Standard procedure)

  • Standard method in high-income countries and most regional centres worldwide
  • Ultrasonic probe emulsifies and aspirates lens material through a small self-sealing incision (~2.4-2.8 mm)
  • Followed by insertion of a foldable intraocular lens (IOL)
  • Advantages: small incision, rapid recovery, low astigmatism

2. Manual Extracapsular Cataract Extraction (ECCE)

  • Larger incision; nucleus expressed intact
  • Used where phaco is unavailable or for very hard (brunescent) nuclei

3. Intracapsular Cataract Extraction (ICCE)

  • Entire lens including capsule removed
  • Largely obsolete; still used in some resource-limited settings

Intraocular Lens (IOL)

  • Implanted in the capsular bag after lens removal
  • Calculated using biometry (A-scan ultrasound or optical coherence-based measurement)
  • Types include monofocal, multifocal, toric (for astigmatism correction)

Preoperative Considerations

  • Record systemic medications - especially alpha-blockers (e.g. tamsulosin) which cause Intraoperative Floppy Iris Syndrome (IFIS)
  • Manage anticoagulants per local protocol
  • Check for allergy (iodine, latex, antibiotics)
  • Assess for MRSA carriage
  • Ophthalmic assessment: VA, pupil responses (cataract never causes RAPD - if present, suspect posterior pole pathology), corneal endothelial count, IOP, fundus

Key Points to Remember (High-Yield for Exams)

  1. Most common cause of reversible blindness worldwide
  2. No medical treatment prevents cataract
  3. PSC - worst visual impact per unit of opacity (at nodal point); worst with miosis
  4. Nuclear sclerosis - causes myopia ("second sight"), yellow/brown hue, urochrome deposition
  5. Cortical - spoke-like opacities, starts inferonasally
  6. Morgagnian cataract - liquefied cortex with sunken nucleus (hypermature stage)
  7. Glaukomflecken - pathognomonic of previous acute angle closure
  8. "Second sight of the aged" - nuclear myopia allowing reading without glasses
  9. Phacoemulsification is the gold standard surgery
  10. Tamsulosin (alpha-blocker) - causes IFIS during phaco surgery

Kanski's Clinical Ophthalmology: A Systematic Approach, 10th Edition - Chapter 10: The Lens

Create pdf of thi

Reading File
Running Command

ls -la /home/daytona/workspace/ 2>/dev/null || mkdir -p /home/daytona/workspace && ls -la /home/daytona/workspace/

Running Command

mkdir -p /home/daytona/workspace/senile-cataract

Writing File

~/senile-cataract/generate_pdf.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 Image as RLImage
import urllib.request
import io
import os

OUTPUT = "/home/daytona/workspace/senile-cataract/Senile_Cataract.pdf"

# ── Download images ──────────────────────────────────────────────────────────
IMG_ANATOMY = "https://cdn.orris.care/cdss_images/a2674d6ec496b5de9e01cd831d3b38fad72b4369b523c13cca36a6fd099d9385.png"
IMG_TYPES   = "https://cdn.orris.care/cdss_images/29451237b3f1b4220de6fc97dc359b8089c1b6b5647538ce70183e87ed5d4d85.png"

def download_image(url, filename):
    path = f"/home/daytona/workspace/senile-cataract/{filename}"
    if not os.path.exists(path):
        urllib.request.urlretrieve(url, path)
    return path

anatomy_img = download_image(IMG_ANATOMY, "anatomy.png")
types_img   = download_image(IMG_TYPES,   "types.png")

# ── Document setup ────────────────────────────────────────────────────────────
doc = SimpleDocTemplate(
    OUTPUT,
    pagesize=A4,
    leftMargin=2*cm, rightMargin=2*cm,
    topMargin=2.2*cm, bottomMargin=2.2*cm,
    title="Senile Cataract",
    author="Orris Medical AI"
)

W, H = A4
TW = W - 4*cm  # text width

# ── Styles ────────────────────────────────────────────────────────────────────
BASE = getSampleStyleSheet()

TITLE = ParagraphStyle("TITLE", parent=BASE["Title"],
    fontSize=22, textColor=colors.HexColor("#1a3a5c"),
    spaceAfter=4, leading=26, alignment=TA_CENTER)

SUBTITLE = ParagraphStyle("SUBTITLE", parent=BASE["Normal"],
    fontSize=11, textColor=colors.HexColor("#4a6fa5"),
    spaceAfter=14, alignment=TA_CENTER, italic=True)

H1 = ParagraphStyle("H1", parent=BASE["Heading1"],
    fontSize=13, textColor=colors.white,
    backColor=colors.HexColor("#1a3a5c"),
    spaceBefore=14, spaceAfter=6,
    leftIndent=-0.5*cm, rightIndent=-0.5*cm,
    borderPad=5, leading=18)

H2 = ParagraphStyle("H2", parent=BASE["Heading2"],
    fontSize=11, textColor=colors.HexColor("#1a3a5c"),
    spaceBefore=10, spaceAfter=4, leading=16,
    borderPad=2)

H3 = ParagraphStyle("H3", parent=BASE["Heading3"],
    fontSize=10.5, textColor=colors.HexColor("#2e6da4"),
    spaceBefore=8, spaceAfter=3, leading=14, bold=True)

BODY = ParagraphStyle("BODY", parent=BASE["Normal"],
    fontSize=9.5, leading=14, spaceAfter=4, alignment=TA_JUSTIFY,
    textColor=colors.HexColor("#222222"))

BULLET = ParagraphStyle("BULLET", parent=BASE["Normal"],
    fontSize=9.5, leading=13, leftIndent=14, spaceAfter=2,
    bulletIndent=4, textColor=colors.HexColor("#222222"))

CAPTION = ParagraphStyle("CAPTION", parent=BASE["Normal"],
    fontSize=8.5, textColor=colors.HexColor("#555555"),
    alignment=TA_CENTER, spaceAfter=8, italic=True)

HIGHLIGHT = ParagraphStyle("HIGHLIGHT", parent=BASE["Normal"],
    fontSize=9.5, leading=13, leftIndent=12,
    backColor=colors.HexColor("#eaf2fb"),
    borderPad=6, spaceAfter=6,
    textColor=colors.HexColor("#1a3a5c"))

SOURCE = ParagraphStyle("SOURCE", parent=BASE["Normal"],
    fontSize=8, textColor=colors.HexColor("#888888"),
    alignment=TA_CENTER, spaceBefore=20, italic=True)

def h1(text):
    return Paragraph(f"  {text}", H1)

def h2(text):
    return Paragraph(text, H2)

def h3(text):
    return Paragraph(text, H3)

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

def bullet(text):
    return Paragraph(f"•  {text}", BULLET)

def highlight(text):
    return Paragraph(text, HIGHLIGHT)

def sp(n=6):
    return Spacer(1, n)

def hr():
    return HRFlowable(width="100%", thickness=0.5, color=colors.HexColor("#cccccc"), spaceAfter=4)

# ── Build content ─────────────────────────────────────────────────────────────
story = []

# Title block
story.append(sp(10))
story.append(Paragraph("Senile (Age-Related) Cataract", TITLE))
story.append(Paragraph("Based on Kanski's Clinical Ophthalmology: A Systematic Approach, 10th Edition", SUBTITLE))
story.append(HRFlowable(width="100%", thickness=2, color=colors.HexColor("#1a3a5c"), spaceAfter=14))

# ── DEFINITION ───────────────────────────────────────────────────────────────
story.append(h1("1. Definition"))
story.append(body(
    "<b>Cataract</b> is opacification of the crystalline lens. "
    "<b>Senile (age-related) cataract</b> refers to lens opacity that occurs as a consequence of normal ageing. "
    "It is the <b>commonest cause of reversible visual disability in the world.</b>"
))
story.append(highlight("⚠ There is NO medical treatment to prevent the development or progression of cataract. "
    "Phacoemulsification with IOL implantation is the definitive treatment."))
story.append(sp())

# ── ANATOMY ──────────────────────────────────────────────────────────────────
story.append(h1("2. Lens Anatomy"))
story.append(body(
    "The lens is a biconvex, transparent structure held in place by <b>zonules</b> arising from the ciliary body. "
    "Its primary function is to focus light on the retina."
))
bullet_items = [
    "<b>Capsule</b> – acellular membrane enclosing the lens",
    "<b>Epithelial cells</b> – cuboid cells beneath the anterior capsule; <b>germinative zone</b> cells divide continuously and differentiate into lens fibres",
    "<b>Cortex</b> – peripheral lens substance made of newer lens fibres",
    "<b>Nucleus</b> – central, denser older lens fibres",
]
for b in bullet_items:
    story.append(bullet(b))

story.append(sp(8))
img = RLImage(anatomy_img, width=TW*0.85, height=TW*0.85*0.42)
story.append(img)
story.append(Paragraph("Fig. 10.1 – (A) Cross-sectional anatomy of the anterior segment; (B) Histological cross-section of the lens showing zones", CAPTION))
story.append(sp())

# ── EFFECT ON VISION ─────────────────────────────────────────────────────────
story.append(h1("3. Effect on Vision"))
story.append(body(
    "Cataracts develop slowly and in early stages alter vision subtly. "
    "The effect depends on: (a) type of cataract, (b) extent of opacification, (c) position of opacification."
))

symptoms_data = [
    ["Symptom", "Mechanism"],
    ["Reduced visual acuity", "Progressive opacification; initially correctable with glasses"],
    ["Loss of contrast sensitivity", "Light scattering within the lens"],
    ["Change in colour perception", "Difficulty perceiving blue colours (urochrome pigment)"],
    ["Glare", "Light scattering; worse at night (e.g. oncoming car headlights)"],
    ["Monocular diplopia", "Especially with point light sources"],
    ["Poor night vision", "Reduced light transmission through opaque lens"],
]
t = Table(symptoms_data, colWidths=[TW*0.4, TW*0.6])
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),
    ("ROWBACKGROUNDS", (0,1), (-1,-1), [colors.HexColor("#f0f5fb"), colors.white]),
    ("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#bbbbbb")),
    ("LEFTPADDING", (0,0), (-1,-1), 6),
    ("RIGHTPADDING", (0,0), (-1,-1), 6),
    ("TOPPADDING", (0,0), (-1,-1), 4),
    ("BOTTOMPADDING", (0,0), (-1,-1), 4),
    ("VALIGN", (0,0), (-1,-1), "MIDDLE"),
]))
story.append(t)
story.append(sp())

# ── TYPES ─────────────────────────────────────────────────────────────────────
story.append(h1("4. Types of Age-Related Cataract"))

story.append(sp(8))
img2 = RLImage(types_img, width=TW*0.9, height=TW*0.9*1.18)
story.append(img2)
story.append(Paragraph(
    "Fig. 10.2 – Age-related cataract: (A) Posterior subcapsular; (B) PSC on retroillumination with Wedl cells (arrow); "
    "(C) Nuclear sclerosis; (D) Nuclear sclerosis on retroillumination – nucleus-cortex demarcation (arrow); "
    "(E) Cortical cataract; (F) Cortical spokes on retroillumination; (G) Christmas tree; (H) Christmas tree on retroillumination",
    CAPTION))
story.append(sp())

# Type 1
story.append(h3("4.1 Posterior Subcapsular Cataract (PSC)"))
for b in [
    "Located just in front of the <b>posterior capsule</b>",
    "Granular or plaque-like on oblique slit lamp; <b>black and vacuolated on retroillumination</b>",
    "Vacuoles = swollen migratory lens epithelial cells (<b>Bladder cells / Wedl cells</b>)",
    "Located at the <b>nodal point</b> of the eye → even small opacity causes profound visual loss",
    "Characteristic symptom: <b>glare</b> from oncoming headlights",
    "Symptoms worsen with <b>miosis</b> (near tasks, bright sunlight)",
]:
    story.append(bullet(b))

story.append(sp(4))

# Type 2
story.append(h3("4.2 Nuclear Sclerotic Cataract"))
for b in [
    "Exaggeration of normal ageing change",
    "Causes <b>myopia</b> due to increased refractive index of nucleus",
    '<b>"Second sight of the aged"</b> – elderly patients can read without glasses again',
    "<b>Yellowish hue</b> due to deposition of <b>urochrome pigment</b>",
    "Best assessed with <b>oblique slit lamp beam</b>",
    "When advanced: nucleus appears <b>brown (brunescent)</b>; rarely <b>black (nigra)</b>",
]:
    story.append(bullet(b))

story.append(sp(4))

# Type 3
story.append(h3("4.3 Cortical Cataract"))
for b in [
    "Involves anterior, posterior or equatorial cortex",
    "Begins as <b>clefts and vacuoles</b> between lens fibres due to cortical hydration",
    "Progresses to <b>cuneiform (wedge-shaped) or radial spoke-like opacities</b>",
    "Often initially in the <b>inferonasal quadrant</b>",
    "<b>Glare</b> is a common symptom",
]:
    story.append(bullet(b))

story.append(sp(4))

# Type 4
story.append(h3("4.4 Christmas Tree Cataract"))
for b in [
    "Polychromatic, needle-like crystalline deposits",
    "Multicoloured sparkling appearance (like a Christmas tree)",
    "Seen on direct illumination and retroillumination",
]:
    story.append(bullet(b))

story.append(sp())

# ── MATURITY ──────────────────────────────────────────────────────────────────
story.append(h1("5. Cataract Maturity (Stages)"))

maturity_data = [
    ["Stage", "Description"],
    ["Immature", "Lens partially opaque; red reflex still present"],
    ["Mature", "Lens completely opaque; red reflex absent"],
    ["Hypermature", "Shrunken, wrinkled anterior capsule due to water leakage out of the lens"],
    ["Morgagnian", "Hypermature cataract with liquefied cortex; nucleus sinks inferiorly"],
]
t2 = Table(maturity_data, colWidths=[TW*0.25, TW*0.75])
t2.setStyle(TableStyle([
    ("BACKGROUND", (0,0), (-1,0), colors.HexColor("#2e6da4")),
    ("TEXTCOLOR", (0,0), (-1,0), colors.white),
    ("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"),
    ("FONTSIZE", (0,0), (-1,-1), 9),
    ("ROWBACKGROUNDS", (0,1), (-1,-1), [colors.HexColor("#f0f5fb"), colors.white]),
    ("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#bbbbbb")),
    ("LEFTPADDING", (0,0), (-1,-1), 6),
    ("RIGHTPADDING", (0,0), (-1,-1), 6),
    ("TOPPADDING", (0,0), (-1,-1), 4),
    ("BOTTOMPADDING", (0,0), (-1,-1), 4),
    ("VALIGN", (0,0), (-1,-1), "MIDDLE"),
]))
story.append(t2)
story.append(sp())

# ── SYSTEMIC ASSOCIATIONS ─────────────────────────────────────────────────────
story.append(h1("6. Cataract in Systemic Disease"))

story.append(h3("6.1 Diabetes Mellitus"))
for b in [
    "Hyperglycaemia → high aqueous glucose → diffuses into lens",
    "Glucose metabolized to <b>sorbitol</b> (aldose reductase) → osmotic overhydration",
    "Refractive fluctuation with plasma glucose: hyperglycaemia = <b>myopia</b>",
    "Classic <b>snowflake cortical opacity</b> – rare; young diabetics; may mature within days",
    "Age-related cataract occurs <b>earlier</b> in diabetics; nuclear sclerosis rapid",
    "~1 in 5 cataract surgery patients have diabetes",
]:
    story.append(bullet(b))

story.append(sp(4))
story.append(h3("6.2 Other Systemic Associations"))
for b in [
    "Chronic steroid use → posterior subcapsular cataract",
    "Myotonic dystrophy",
    "Neurofibromatosis type 2",
    "Down syndrome",
    "Galactosaemia (in children)",
]:
    story.append(bullet(b))

story.append(sp())

# ── SECONDARY CATARACT ────────────────────────────────────────────────────────
story.append(h1("7. Secondary (Complicated) Cataract"))
story.append(body(
    "Develops as a result of primary ocular disease."
))

secondary_data = [
    ["Cause", "Features"],
    ["Chronic anterior uveitis", "Most common cause; both inflammation and steroid therapy causative; polychromatic lustre at posterior pole earliest sign"],
    ["Acute angle closure glaucoma", "Glaukomflecken – small grey-white subcapsular opacities (focal lens epithelial infarcts); pathognomonic"],
    ["High myopia", "Posterior subcapsular opacity + early nuclear sclerosis"],
    ["Hereditary fundus dystrophies\n(RP, Leber, gyrate atrophy, Stickler)", "Usually posterior subcapsular opacity"],
]
t3 = Table(secondary_data, colWidths=[TW*0.38, TW*0.62])
t3.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),
    ("ROWBACKGROUNDS", (0,1), (-1,-1), [colors.HexColor("#f0f5fb"), colors.white]),
    ("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#bbbbbb")),
    ("LEFTPADDING", (0,0), (-1,-1), 6),
    ("RIGHTPADDING", (0,0), (-1,-1), 6),
    ("TOPPADDING", (0,0), (-1,-1), 4),
    ("BOTTOMPADDING", (0,0), (-1,-1), 4),
    ("VALIGN", (0,0), (-1,-1), "TOP"),
]))
story.append(t3)
story.append(sp())

# ── MANAGEMENT ────────────────────────────────────────────────────────────────
story.append(h1("8. Management"))

story.append(h3("8.1 Indications for Surgery"))
for b in [
    "Cataract significantly impairs quality of life or daily activities",
    "Secondary complication (e.g. phacomorphic glaucoma, phacolytic glaucoma)",
]:
    story.append(bullet(b))

story.append(sp(4))
story.append(h3("8.2 Surgical Methods"))

surgical_data = [
    ["Method", "Details"],
    ["Phacoemulsification\n(GOLD STANDARD)", "Ultrasonic emulsification via small incision (~2.4–2.8 mm); foldable IOL implanted; rapid recovery, low astigmatism"],
    ["ECCE (Manual Extracapsular)", "Larger incision; nucleus expressed intact; used where phaco unavailable or for hard brunescent nuclei"],
    ["ICCE (Intracapsular)", "Entire lens including capsule removed; largely obsolete"],
]
t4 = Table(surgical_data, colWidths=[TW*0.32, TW*0.68])
t4.setStyle(TableStyle([
    ("BACKGROUND", (0,0), (-1,0), colors.HexColor("#2e6da4")),
    ("TEXTCOLOR", (0,0), (-1,0), colors.white),
    ("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"),
    ("FONTSIZE", (0,0), (-1,-1), 9),
    ("ROWBACKGROUNDS", (0,1), (-1,-1), [colors.HexColor("#f0f5fb"), colors.white]),
    ("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#bbbbbb")),
    ("LEFTPADDING", (0,0), (-1,-1), 6),
    ("RIGHTPADDING", (0,0), (-1,-1), 6),
    ("TOPPADDING", (0,0), (-1,-1), 4),
    ("BOTTOMPADDING", (0,0), (-1,-1), 4),
    ("VALIGN", (0,0), (-1,-1), "TOP"),
]))
story.append(t4)

story.append(sp(4))
story.append(h3("8.3 Key Preoperative Considerations"))
for b in [
    "<b>Alpha-blockers</b> (e.g. tamsulosin) → <b>Intraoperative Floppy Iris Syndrome (IFIS)</b> – must be disclosed",
    "Manage <b>anticoagulants</b> per local protocol (check INR within 24 h in stable patients)",
    "Screen for allergy: iodine, latex, antibiotics, sticking plaster",
    "Check for MRSA carriage",
    "<b>Pupillary RAPD</b> – cataract never causes RAPD; if present, suggests posterior pole pathology",
    "Corneal endothelial cell count (specular microscopy) if cornea guttata suspected",
]:
    story.append(bullet(b))

story.append(sp())

# ── HIGH YIELD ────────────────────────────────────────────────────────────────
story.append(h1("9. High-Yield Exam Points"))

hyl = [
    ("Most common cause", "Reversible blindness worldwide"),
    ("No medical treatment", "Prevents or reverses cataract"),
    ("PSC", "Worst impact per opacity size (nodal point); worse with miosis"),
    ("Nuclear sclerosis", "Myopia + 'second sight'; yellow/brown hue; urochrome pigment"),
    ("Cortical", "Spoke-like opacities; starts inferonasally"),
    ("Morgagnian", "Liquefied cortex; nucleus sinks — hypermature stage"),
    ("Glaukomflecken", "Pathognomonic of previous acute angle closure"),
    ("Second sight of aged", "Nuclear myopia → can read without glasses"),
    ("Gold standard surgery", "Phacoemulsification + IOL"),
    ("Tamsulosin", "Alpha-blocker → causes IFIS during phaco"),
]
hyl_table = Table(hyl, colWidths=[TW*0.35, TW*0.65])
hyl_table.setStyle(TableStyle([
    ("FONTNAME", (0,0), (-1,-1), "Helvetica"),
    ("FONTNAME", (0,0), (0,-1), "Helvetica-Bold"),
    ("FONTSIZE", (0,0), (-1,-1), 9),
    ("ROWBACKGROUNDS", (0,0), (-1,-1), [colors.HexColor("#eaf2fb"), colors.HexColor("#f7fafd")]),
    ("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#bbbbbb")),
    ("LEFTPADDING", (0,0), (-1,-1), 8),
    ("RIGHTPADDING", (0,0), (-1,-1), 6),
    ("TOPPADDING", (0,0), (-1,-1), 5),
    ("BOTTOMPADDING", (0,0), (-1,-1), 5),
    ("VALIGN", (0,0), (-1,-1), "MIDDLE"),
    ("TEXTCOLOR", (0,0), (0,-1), colors.HexColor("#1a3a5c")),
]))
story.append(hyl_table)
story.append(sp(20))

story.append(hr())
story.append(Paragraph(
    "Source: Kanski's Clinical Ophthalmology: A Systematic Approach, 10th Edition – Chapter 10: The Lens  |  "
    "Generated by Orris Medical AI  |  For educational purposes only",
    SOURCE))

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

python /home/daytona/workspace/senile-cataract/generate_pdf.py

Running Command

ls -lh /home/daytona/workspace/senile-cataract/Senile_Cataract.pdf

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

Senile Cataract

PDF Document · PDF

What's included in the PDF (12 MB, A4 format):
  • Title page with source citation (Kanski's Clinical Ophthalmology, 10th Ed.)
  • Lens anatomy diagram (Fig. 10.1)
  • Full slit-lamp photo grid of all cataract types (Fig. 10.2)
  • Symptoms table
  • All 4 types of age-related cataract with bullet points
  • Cataract maturity stages table (Immature → Morgagnian)
  • Cataract in systemic disease (Diabetes + others)
  • Secondary cataract causes table
  • Management - surgical methods comparison table
  • Preoperative considerations
  • High-yield exam points summary table
This is a shared conversation. Sign in to Orris to start your own chat.