Make exam ready pdf according to standard textbooks formulate long note and short notes respectively
ls /tmp/workspace/ 2>/dev/null || mkdir -p /tmp/workspace/exam-pdf
mkdir -p /tmp/workspace/exam-pdf && ls /tmp/workspace/exam-pdf
~/exam-pdf/generate_exam_notes.py
#!/usr/bin/env python3
"""
MD Examination January 2025 - General Medicine (Paper I)
Exam-Ready Notes - Long Notes & Short Notes
"""
from reportlab.lib.pagesizes import A4
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm, mm
from reportlab.lib.colors import HexColor, black, white, Color
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
HRFlowable, PageBreak, KeepTogether
)
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.platypus import BalancedColumns
# ─── Colour palette ──────────────────────────────────────────────────────────
DARK_BLUE = HexColor("#1a3c6e")
MID_BLUE = HexColor("#2563ab")
LIGHT_BLUE = HexColor("#dbeafe")
TEAL = HexColor("#0d6b6e")
TEAL_LIGHT = HexColor("#ccf2f4")
GOLD = HexColor("#b45309")
GOLD_LIGHT = HexColor("#fef3c7")
RED_DARK = HexColor("#991b1b")
RED_LIGHT = HexColor("#fee2e2")
GREEN_DARK = HexColor("#166534")
GREEN_LIGHT = HexColor("#dcfce7")
GREY_LIGHT = HexColor("#f1f5f9")
GREY_MID = HexColor("#cbd5e1")
GREY_DARK = HexColor("#374151")
W, H = A4 # 595.27 x 841.89 pts
# ─── Document setup ──────────────────────────────────────────────────────────
OUTPUT = "/tmp/workspace/exam-pdf/MD_General_Medicine_ExamNotes_2025.pdf"
doc = SimpleDocTemplate(
OUTPUT,
pagesize=A4,
leftMargin=1.8*cm, rightMargin=1.8*cm,
topMargin=2.2*cm, bottomMargin=2.2*cm,
title="MD General Medicine – Exam Notes January 2025",
author="Orris Medical AI",
)
styles = getSampleStyleSheet()
def make_style(name, parent="Normal", **kw):
s = ParagraphStyle(name, parent=styles[parent], **kw)
return s
# Custom styles
cover_title = make_style("CoverTitle", fontSize=28, textColor=white, alignment=TA_CENTER, leading=34, fontName="Helvetica-Bold")
cover_sub = make_style("CoverSub", fontSize=15, textColor=LIGHT_BLUE, alignment=TA_CENTER, leading=20)
cover_detail = make_style("CoverDetail", fontSize=11, textColor=GREY_LIGHT, alignment=TA_CENTER, leading=16)
h1 = make_style("H1", fontSize=16, textColor=white, fontName="Helvetica-Bold", alignment=TA_LEFT, leading=22, spaceAfter=4)
h2 = make_style("H2", fontSize=13, textColor=DARK_BLUE, fontName="Helvetica-Bold", spaceAfter=4, spaceBefore=8)
h3 = make_style("H3", fontSize=11, textColor=TEAL, fontName="Helvetica-Bold", spaceAfter=3, spaceBefore=6)
h4 = make_style("H4", fontSize=10, textColor=GOLD, fontName="Helvetica-Bold", spaceAfter=2, spaceBefore=4)
body = make_style("Body", fontSize=9.5, leading=14, alignment=TA_JUSTIFY, spaceAfter=4)
bullet = make_style("Bullet", fontSize=9.5, leading=13, leftIndent=14, bulletIndent=4, spaceAfter=2)
sub_bullet = make_style("SubBullet", fontSize=9, leading=12, leftIndent=26, bulletIndent=14, spaceAfter=2)
bold_key = make_style("BoldKey", fontSize=9.5, fontName="Helvetica-Bold", leading=13, leftIndent=14, spaceAfter=2)
note_style = make_style("NoteStyle", fontSize=9, textColor=RED_DARK, fontName="Helvetica-BoldOblique", spaceAfter=4)
table_header = make_style("TblHdr", fontSize=9, textColor=white, fontName="Helvetica-Bold", alignment=TA_CENTER)
table_cell = make_style("TblCell", fontSize=8.5, leading=11)
caption = make_style("Caption", fontSize=8, textColor=GREY_DARK, fontName="Helvetica-Oblique", alignment=TA_CENTER)
story = []
# ═══════════════════════════════════════════════════════════════════════════════
# COVER PAGE
# ═══════════════════════════════════════════════════════════════════════════════
def cover_page():
# Big coloured rectangle simulated with a table
cover_data = [[
Paragraph("MD EXAMINATION", cover_sub),
]]
cover_tbl = Table(cover_data, colWidths=[W - 3.6*cm])
cover_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), DARK_BLUE),
("TOPPADDING", (0,0), (-1,-1), 30),
("BOTTOMPADDING", (0,0), (-1,-1), 8),
("LEFTPADDING", (0,0), (-1,-1), 20),
("RIGHTPADDING", (0,0), (-1,-1), 20),
]))
story.append(cover_tbl)
banner_data = [[
Paragraph("GENERAL MEDICINE", make_style("BT2", fontSize=32, textColor=white,
fontName="Helvetica-Bold", alignment=TA_CENTER, leading=38)),
]]
banner = Table(banner_data, colWidths=[W - 3.6*cm])
banner.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), MID_BLUE),
("TOPPADDING", (0,0), (-1,-1), 12),
("BOTTOMPADDING", (0,0), (-1,-1), 12),
]))
story.append(banner)
paper_data = [[
Paragraph("Paper I | MDRSA-17", make_style("PD", fontSize=14, textColor=GOLD_LIGHT,
fontName="Helvetica-Bold", alignment=TA_CENTER)),
]]
paper_tbl = Table(paper_data, colWidths=[W - 3.6*cm])
paper_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), DARK_BLUE),
("TOPPADDING", (0,0), (-1,-1), 8),
("BOTTOMPADDING", (0,0), (-1,-1), 14),
]))
story.append(paper_tbl)
story.append(Spacer(1, 18))
# Exam info box
info_data = [
[Paragraph("<b>January 2025 Examination</b>", make_style("I1", fontSize=11, textColor=DARK_BLUE, fontName="Helvetica-Bold", alignment=TA_CENTER)),
Paragraph("<b>Time: 3 Hours</b>", make_style("I2", fontSize=11, textColor=DARK_BLUE, fontName="Helvetica-Bold", alignment=TA_CENTER)),
Paragraph("<b>Max. Marks: 100</b>", make_style("I3", fontSize=11, textColor=DARK_BLUE, fontName="Helvetica-Bold", alignment=TA_CENTER))],
]
info_tbl = Table(info_data, colWidths=[(W - 3.6*cm)/3]*3)
info_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), LIGHT_BLUE),
("BOX", (0,0), (-1,-1), 1, MID_BLUE),
("INNERGRID", (0,0), (-1,-1), 0.5, MID_BLUE),
("TOPPADDING", (0,0), (-1,-1), 10),
("BOTTOMPADDING", (0,0), (-1,-1), 10),
]))
story.append(info_tbl)
story.append(Spacer(1, 22))
story.append(Paragraph("EXAM-READY STUDY NOTES", make_style("ERTITLE", fontSize=20,
textColor=DARK_BLUE, fontName="Helvetica-Bold", alignment=TA_CENTER, spaceAfter=6)))
story.append(Paragraph("Compiled from Standard Medical Textbooks", make_style("ERSUB", fontSize=11,
textColor=GREY_DARK, alignment=TA_CENTER, fontName="Helvetica-Oblique")))
story.append(Spacer(1, 14))
story.append(HRFlowable(width="100%", thickness=2, color=GOLD, spaceAfter=14))
# Index box
qlist = [
["Q1 (26 marks)", "Theories of Ageing + Organ Changes + Prevention", "Long Note"],
["Q2 (26 marks)", "Cutaneous Manifestations of Systemic Disorders", "Long Note"],
["Q3A (8 marks)", "Lymphatic Drainage of Lungs", "Short Note"],
["Q3B (8 marks)", "Arterial Supply of Brain", "Short Note"],
["Q3C (8 marks)", "Stem Cell Therapy", "Short Note"],
["Q4A (8 marks)", "ECMO (Extracorporeal Membrane Oxygenation)", "Short Note"],
["Q4B (8 marks)", "Heat Stroke", "Short Note"],
["Q4C (8 marks)", "Targeted Therapy", "Short Note"],
]
tbl_data = [[
Paragraph("<b>Question</b>", table_header),
Paragraph("<b>Topic</b>", table_header),
Paragraph("<b>Type</b>", table_header)
]] + [[Paragraph(r[0], table_cell), Paragraph(r[1], table_cell), Paragraph(r[2], table_cell)] for r in qlist]
idx_tbl = Table(tbl_data, colWidths=[3*cm, 9.5*cm, 3*cm])
idx_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), DARK_BLUE),
("BACKGROUND", (0,1), (-1,1), LIGHT_BLUE),
("BACKGROUND", (0,2), (-1,2), GREY_LIGHT),
("BACKGROUND", (0,3), (-1,3), LIGHT_BLUE),
("BACKGROUND", (0,4), (-1,4), GREY_LIGHT),
("BACKGROUND", (0,5), (-1,5), LIGHT_BLUE),
("BACKGROUND", (0,6), (-1,6), GREY_LIGHT),
("BACKGROUND", (0,7), (-1,7), LIGHT_BLUE),
("BACKGROUND", (0,8), (-1,8), GREY_LIGHT),
("BOX", (0,0), (-1,-1), 1, MID_BLUE),
("INNERGRID", (0,0), (-1,-1), 0.5, GREY_MID),
("TOPPADDING", (0,0), (-1,-1), 7),
("BOTTOMPADDING", (0,0), (-1,-1), 7),
("LEFTPADDING", (0,0), (-1,-1), 8),
("RIGHTPADDING", (0,0), (-1,-1), 8),
]))
story.append(idx_tbl)
story.append(Spacer(1, 20))
story.append(HRFlowable(width="100%", thickness=1.5, color=MID_BLUE))
story.append(Spacer(1, 8))
story.append(Paragraph(
"Sources: Harrison's Principles of Internal Medicine 22E · Tintinalli's Emergency Medicine · "
"Dermatology 2-Volume Set 5e · Goldman-Cecil Medicine · Fischer's Mastery of Surgery · "
"Brenner and Rector's The Kidney · Thompson & Thompson Genetics",
make_style("Src", fontSize=8, textColor=GREY_DARK, alignment=TA_CENTER, fontName="Helvetica-Oblique")))
story.append(PageBreak())
cover_page()
# ─── Helper: section heading bar ─────────────────────────────────────────────
def section_bar(label, bg=DARK_BLUE, fg=white):
d = [[Paragraph(label, make_style("SH", fontSize=13, textColor=fg,
fontName="Helvetica-Bold", alignment=TA_LEFT))]]
t = Table(d, colWidths=[W - 3.6*cm])
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), bg),
("TOPPADDING", (0,0), (-1,-1), 7),
("BOTTOMPADDING", (0,0), (-1,-1), 7),
("LEFTPADDING", (0,0), (-1,-1), 10),
("RIGHTPADDING", (0,0), (-1,-1), 10),
("BOX", (0,0), (-1,-1), 0.8, GREY_MID),
]))
return t
def subsection_bar(label, bg=TEAL, fg=white):
d = [[Paragraph(label, make_style("SSH", fontSize=11, textColor=fg,
fontName="Helvetica-Bold"))]]
t = Table(d, colWidths=[W - 3.6*cm])
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), bg),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 10),
]))
return t
def info_box(text, bg=GOLD_LIGHT, border=GOLD):
d = [[Paragraph(text, make_style("IB", fontSize=9, leading=13))]]
t = Table(d, colWidths=[W - 3.6*cm])
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), bg),
("BOX", (0,0), (-1,-1), 1.2, border),
("TOPPADDING", (0,0), (-1,-1), 6),
("BOTTOMPADDING", (0,0), (-1,-1), 6),
("LEFTPADDING", (0,0), (-1,-1), 10),
("RIGHTPADDING", (0,0), (-1,-1), 10),
]))
return t
def alert_box(text, bg=RED_LIGHT, border=RED_DARK):
d = [[Paragraph("<b>⚠ IMPORTANT:</b> " + text, make_style("AB", fontSize=9, textColor=RED_DARK, leading=13))]]
t = Table(d, colWidths=[W - 3.6*cm])
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), bg),
("BOX", (0,0), (-1,-1), 1.2, border),
("TOPPADDING", (0,0), (-1,-1), 6),
("BOTTOMPADDING", (0,0), (-1,-1), 6),
("LEFTPADDING", (0,0), (-1,-1), 10),
("RIGHTPADDING", (0,0), (-1,-1), 10),
]))
return t
def green_box(text):
d = [[Paragraph(text, make_style("GB", fontSize=9, textColor=GREEN_DARK, leading=13))]]
t = Table(d, colWidths=[W - 3.6*cm])
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), GREEN_LIGHT),
("BOX", (0,0), (-1,-1), 1.2, GREEN_DARK),
("TOPPADDING", (0,0), (-1,-1), 6),
("BOTTOMPADDING", (0,0), (-1,-1), 6),
("LEFTPADDING", (0,0), (-1,-1), 10),
("RIGHTPADDING", (0,0), (-1,-1), 10),
]))
return t
def two_col_table(left_data, right_data, header_left="", header_right=""):
rows = []
if header_left:
rows.append([
Paragraph(f"<b>{header_left}</b>", make_style("TH2", fontSize=9, textColor=white, fontName="Helvetica-Bold", alignment=TA_CENTER)),
Paragraph(f"<b>{header_right}</b>", make_style("TH3", fontSize=9, textColor=white, fontName="Helvetica-Bold", alignment=TA_CENTER)),
])
max_r = max(len(left_data), len(right_data))
for i in range(max_r):
l = Paragraph(left_data[i] if i < len(left_data) else "", table_cell)
r = Paragraph(right_data[i] if i < len(right_data) else "", table_cell)
rows.append([l, r])
t = Table(rows, colWidths=[(W - 3.6*cm)/2]*2)
style = [
("BOX", (0,0), (-1,-1), 0.8, MID_BLUE),
("INNERGRID", (0,0), (-1,-1), 0.5, GREY_MID),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 7),
("RIGHTPADDING", (0,0), (-1,-1), 7),
("VALIGN", (0,0), (-1,-1), "TOP"),
]
if header_left:
style += [
("BACKGROUND", (0,0), (-1,0), DARK_BLUE),
("BACKGROUND", (0,1), (-1,-1), GREY_LIGHT),
]
else:
style.append(("BACKGROUND", (0,0), (-1,-1), GREY_LIGHT))
t.setStyle(TableStyle(style))
return t
def sp(n=6): return Spacer(1, n)
# ══════════════════════════════════════════════════════════════════════════════
# QUESTION 1 – THEORIES OF AGEING (LONG NOTE)
# ══════════════════════════════════════════════════════════════════════════════
story.append(section_bar("Q1 (26 Marks) — THEORIES OF AGEING, ORGAN SYSTEM CHANGES & INTERVENTIONS"))
story.append(sp(10))
story.append(info_box("<b>Definition:</b> Ageing (senescence) is the progressive, universal, irreversible decline in physiological function with time, increasing vulnerability to disease and death. It begins at ~30 years and is characterised by: reduced homeostatic reserve, altered composition, impaired organ function."))
story.append(sp(8))
# PART A: THEORIES
story.append(subsection_bar("A. THEORIES OF AGEING"))
story.append(sp(6))
story.append(Paragraph("<b>I. MOLECULAR / GENETIC THEORIES</b>", h3))
theories_data = [
["<b>Theory</b>", "<b>Key Concept</b>", "<b>Evidence / Notes</b>"],
["<b>Telomere Shortening</b>", "Each cell division shortens telomeres; critical shortening triggers senescence (Hayflick limit ~50 divisions)", "Telomerase absent in somatic cells; present in germ cells & cancer cells. Telomere length = biological clock"],
["<b>Somatic Mutation Theory</b>", "Accumulation of DNA mutations (from radiation, oxidants, replication errors) impair cell function", "Werner syndrome (premature ageing) – defective helicase; supports DNA repair role"],
["<b>Gene Regulation / Programmed Ageing</b>", "Ageing is genetically programmed; specific genes activate senescence (e.g. p16, p53, Rb pathway)", "C. elegans daf-2/daf-16 mutants live 2× longer; supports programmed model"],
["<b>Epigenetic Clock</b>", "DNA methylation patterns change predictably with age (Horvath clock). Methylation of CpG sites marks biological age.", "Epigenetic age > chronological age predicts mortality risk"],
]
t = Table([[Paragraph(c, make_style("TH4", fontSize=8.5, textColor=white if i==0 else black,
fontName="Helvetica-Bold" if i==0 else "Helvetica", leading=11))
for c in row] for i, row in enumerate(theories_data)],
colWidths=[3.8*cm, 6.5*cm, 5.2*cm])
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), DARK_BLUE),
("BACKGROUND", (0,1), (-1,-1), GREY_LIGHT),
("ROWBACKGROUNDS", (0,1), (-1,-1), [GREY_LIGHT, white]),
("BOX", (0,0), (-1,-1), 1, MID_BLUE),
("INNERGRID", (0,0), (-1,-1), 0.4, GREY_MID),
("VALIGN", (0,0), (-1,-1), "TOP"),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 5),
]))
story.append(t)
story.append(sp(8))
story.append(Paragraph("<b>II. CELLULAR THEORIES</b>", h3))
story.append(Paragraph("• <b>Free Radical Theory (Harman, 1956):</b> Reactive oxygen species (ROS) generated in mitochondria damage DNA, proteins, and lipids. Oxidative damage accumulates, causing cellular dysfunction. Supports antioxidant role in longevity.", bullet))
story.append(Paragraph("• <b>Mitochondrial Theory:</b> Mitochondrial DNA (mtDNA) lacks histones and is close to ROS sources; mutations accumulate, reducing ATP production and increasing ROS — a vicious cycle. Swollen, dysfunctional mitochondria are hallmarks of aged cells.", bullet))
story.append(Paragraph("• <b>Cellular Senescence Theory:</b> Senescent cells cease dividing but remain metabolically active, secreting inflammatory cytokines (SASP — Senescence-Associated Secretory Phenotype: IL-6, IL-8, MMPs). SASP creates chronic low-grade inflammation ('inflammageing').", bullet))
story.append(Paragraph("• <b>Protein Homeostasis (Proteostasis) Theory:</b> Decline in protein folding/clearance mechanisms (UPS, autophagy) → accumulation of misfolded proteins (amyloid, tau, alpha-synuclein) → neurodegeneration, cataracts, cardiomyopathy.", bullet))
story.append(sp(6))
story.append(Paragraph("<b>III. SYSTEMS / ORGAN-LEVEL THEORIES</b>", h3))
story.append(Paragraph("• <b>Neuroendocrine Theory:</b> Declining hypothalamo-pituitary axis; reduced GH/IGF-1 axis; falling DHEA, testosterone, oestrogen. The brain 'programs' ageing via hormonal decline (proposed by Dilman).", bullet))
story.append(Paragraph("• <b>Immunological Theory (Walford):</b> Immune senescence = decline in T-cell function + impaired B-cell response + increased autoimmune activity → increased susceptibility to infections and cancer.", bullet))
story.append(Paragraph("• <b>Wear-and-Tear Theory:</b> Simple concept — mechanical/biochemical damage accumulates over years exceeding repair capacity. Most relevant for cartilage, articular surfaces.", bullet))
story.append(Paragraph("• <b>Inflammation Theory ('Inflammageing'):</b> Chronic, sterile, low-grade inflammation driven by SASP, gut dysbiosis, and innate immune activation. Linked to atherosclerosis, T2DM, AD, frailty.", bullet))
story.append(sp(8))
# PART B: ORGAN CHANGES
story.append(subsection_bar("B. AGE-RELATED ORGAN SYSTEM CHANGES"))
story.append(sp(6))
organ_rows = [
["<b>System</b>", "<b>Structural Changes</b>", "<b>Functional Consequences</b>"],
["<b>Cardiovascular</b>",
"Arterial wall thiffening (elastin→collagen), LV wall thickening, reduced sinoatrial cells, valvular sclerosis",
"Increased systolic BP, reduced cardiac reserve, diastolic dysfunction, prolonged PR & QT intervals, orthostatic hypotension"],
["<b>Respiratory</b>",
"Reduced lung elasticity, increased chest wall stiffness, loss of alveolar surface area, weakened respiratory muscles",
"FVC ↓, FEV1 ↓ (~1%/yr after 25), FRC ↑, RV ↑, PaO2 ↓, impaired cough reflex, reduced mucociliary clearance"],
["<b>Renal</b>",
"Nephron loss (50% by age 80), glomerulosclerosis, tubular atrophy, reduced renal blood flow",
"GFR ↓ (~1 mL/min/yr after 30), reduced drug clearance, impaired Na/water conservation, decreased erythropoietin production"],
["<b>GI Tract</b>",
"Reduced gastric acid, slowed motility, decreased hepatic mass and blood flow, reduced splanchnic reserve",
"Malabsorption of B12, Ca2+, Fe2+; constipation; delayed drug metabolism; impaired first-pass effect"],
["<b>Nervous System</b>",
"Loss of neurons & synapses, reduced neurotransmitters (dopamine, ACh), impaired myelination, brain volume loss",
"Cognitive slowing, reduced memory, impaired balance/proprioception, sleep changes, increased dementia risk"],
["<b>Musculoskeletal</b>",
"Sarcopenia (loss of type II fast-twitch fibres), osteoporosis (↓ bone mineral density), cartilage thinning",
"Reduced strength, falls, fractures, kyphosis, reduced height"],
["<b>Endocrine</b>",
"Reduced GH, DHEA, testosterone, oestrogen; pancreatic beta-cell dysfunction; thyroid nodularity",
"Sarcopenia, reduced libido, impaired glucose tolerance, increased T2DM risk, body composition changes"],
["<b>Immune</b>",
"Thymic involution, reduced naive T-cell output, memory cell predominance, inflammageing",
"Impaired vaccine response, increased infection susceptibility, autoimmune tendencies, reduced cancer surveillance"],
["<b>Skin</b>",
"Loss of dermis thickness (20%), reduced melanocytes, sebaceous glands, elastin; wrinkles, lentigines",
"Impaired thermoregulation, impaired wound healing, increased skin cancer risk"],
["<b>Eyes/Ears</b>",
"Lens yellowing, reduced ciliary muscle function; cochlear hair cell loss, otosclerosis",
"Presbyopia, cataracts, macular degeneration; presbycusis (high-frequency hearing loss first)"],
]
org_tbl = Table([[Paragraph(c, make_style("OT", fontSize=8.2, textColor=white if i==0 else black,
fontName="Helvetica-Bold" if i==0 else "Helvetica", leading=11))
for c in row] for i, row in enumerate(organ_rows)],
colWidths=[3*cm, 5.5*cm, 7*cm])
org_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), DARK_BLUE),
("ROWBACKGROUNDS", (0,1), (-1,-1), [GREY_LIGHT, white]),
("BOX", (0,0), (-1,-1), 1, MID_BLUE),
("INNERGRID", (0,0), (-1,-1), 0.4, GREY_MID),
("VALIGN", (0,0), (-1,-1), "TOP"),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 5),
]))
story.append(org_tbl)
story.append(sp(8))
# PART C: INTERVENTIONS
story.append(subsection_bar("C. INTERVENTIONS TO PREVENT / SLOW AGEING"))
story.append(sp(6))
story.append(Paragraph("<b>1. Lifestyle Interventions</b>", h3))
story.append(Paragraph("• <b>Caloric Restriction (CR):</b> 20-30% reduction in caloric intake without malnutrition — activates SIRT1, AMPK; reduces IGF-1, mTOR; extends lifespan in rodents up to 40%. CALERIE trial showed benefits in humans.", bullet))
story.append(Paragraph("• <b>Exercise:</b> Aerobic exercise ↑ mitochondrial biogenesis (via PGC-1α), reduces telomere attrition, improves cardiovascular reserve, reduces sarcopenia (resistance training), improves cognitive function (BDNF↑).", bullet))
story.append(Paragraph("• <b>Diet:</b> Mediterranean diet and DASH diet associated with reduced cardiovascular mortality and cognitive decline. High antioxidant intake (vitamins C, E, polyphenols).", bullet))
story.append(Paragraph("• <b>Sleep:</b> 7-8 hours optimal; sleep deprivation accelerates telomere shortening, increases inflammatory markers, increases obesity and T2DM risk.", bullet))
story.append(Paragraph("• <b>Smoking cessation:</b> Smoking causes oxidative stress and accelerated telomere attrition; cessation reduces inflammageing.", bullet))
story.append(sp(5))
story.append(Paragraph("<b>2. Pharmacological / Nutraceutical Approaches</b>", h3))
pharm_rows = [
["<b>Agent</b>", "<b>Mechanism</b>", "<b>Status</b>"],
["Metformin", "AMPK activation, mTOR inhibition, reduced inflammageing; IGF-1 pathway modulation", "TAME trial ongoing; approved for T2DM; retrospective data shows reduced mortality"],
["Rapamycin (Sirolimus)", "mTOR (mechanistic target of rapamycin) inhibitor — key longevity pathway; extends lifespan in mice by 25%", "Human trials in progress; used in transplant; side effects limit use"],
["Senolytics (Dasatinib + Quercetin)", "Selectively eliminate senescent cells; reduce SASP; improve physical function", "Early human trials; promising data in pulmonary fibrosis, diabetic kidney disease"],
["NAD+ precursors (NMN, NR)", "Restore NAD+ levels which decline with age; activate sirtuins (SIRT1-7); improve mitochondrial function", "Phase 2/3 trials ongoing; supplements available"],
["Resveratrol", "SIRT1 activator; antioxidant; cardiovascular protection", "In vitro promising; human trials inconsistent"],
["Growth Hormone / IGF-1", "Reverse sarcopenia; improve body composition", "Limited benefit; increased cancer risk; not recommended routinely"],
["Hormone Replacement Therapy", "Oestrogen/testosterone replacement; reduce osteoporosis, vasomotor symptoms", "Individualised; risks vs benefits (DVT, breast cancer with HRT); testosterone in hypogonadal males"],
["Antioxidant vitamins", "Neutralise ROS; reduce oxidative damage", "Inconsistent trial results; supplementation not universally recommended"],
]
p_tbl = Table([[Paragraph(c, make_style("PT", fontSize=8, textColor=white if i==0 else black,
fontName="Helvetica-Bold" if i==0 else "Helvetica", leading=11))
for c in row] for i, row in enumerate(pharm_rows)],
colWidths=[3.5*cm, 7*cm, 5*cm])
p_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), TEAL),
("ROWBACKGROUNDS", (0,1), (-1,-1), [TEAL_LIGHT, white]),
("BOX", (0,0), (-1,-1), 1, TEAL),
("INNERGRID", (0,0), (-1,-1), 0.4, GREY_MID),
("VALIGN", (0,0), (-1,-1), "TOP"),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 5),
]))
story.append(p_tbl)
story.append(sp(8))
story.append(Paragraph("<b>3. Psychological & Social Interventions</b>", h3))
story.append(Paragraph("• Stress reduction (yoga, mindfulness, meditation) reduces cortisol and preserves telomere length.", bullet))
story.append(Paragraph("• Strong social networks — associated with reduced dementia risk, better immune function, longer life.", bullet))
story.append(Paragraph("• Cognitive engagement (education, reading, learning new skills) — cognitive reserve hypothesis; delays dementia onset.", bullet))
story.append(sp(6))
story.append(info_box("<b>Key Exam Points Q1:</b> The free radical/oxidative stress theory and telomere theory are the most cited. Caloric restriction (CR) is the most consistent intervention across species. mTOR pathway is a key druggable longevity target. 'Inflammageing' is a unifying concept linking multiple age-related diseases. Senolytics are an emerging treatment class."))
story.append(PageBreak())
# ══════════════════════════════════════════════════════════════════════════════
# QUESTION 2 – CUTANEOUS MANIFESTATIONS OF SYSTEMIC DISORDERS (LONG NOTE)
# ══════════════════════════════════════════════════════════════════════════════
story.append(section_bar("Q2 (26 Marks) — CUTANEOUS MANIFESTATIONS OF SYSTEMIC DISORDERS"))
story.append(sp(10))
story.append(info_box("<b>Introduction:</b> The skin is a window to internal disease. Dermatological signs often precede, accompany, or follow systemic illness. Recognition of cutaneous markers is critical for early diagnosis and management of life-threatening systemic conditions."))
story.append(sp(8))
# CVS
story.append(subsection_bar("A. CARDIOVASCULAR DISORDERS"))
story.append(sp(5))
cvs_data = [
["<b>Sign</b>", "<b>Disease</b>", "<b>Description</b>"],
["Xanthomas & Xanthelasma", "Hyperlipidaemia, FH", "Yellow-orange lipid deposits; tendon xanthomas in FH; xanthelasma peri-orbital (may be normal cholesterol)"],
["Osler's nodes", "Infective endocarditis", "Painful, tender, red/purple nodules on fingertips & toes — immune complex deposition"],
["Janeway lesions", "Infective endocarditis", "Non-tender haemorrhagic macules on palms/soles — septic emboli (Staph aureus)"],
["Splinter haemorrhages", "Infective endocarditis, vasculitis", "Linear red-brown haemorrhages under nails, parallel to nail axis"],
["Clubbing", "Cyanotic heart disease, IE", "Obliteration of nail fold angle; associated with right-to-left shunts"],
["Erythema marginatum", "Acute rheumatic fever", "Spreading, non-itchy rash with central clearing; trunk/proximal limbs; a major Jones criterion"],
["Livedo reticularis", "Antiphospholipid syndrome, vasculitis", "Mottled, net-like bluish discolouration of skin due to stasis/vasospasm"],
["Peripheral cyanosis", "Cardiac failure, Raynaud's", "Bluish discolouration of extremities; reduced perfusion"],
]
cvs_tbl = Table([[Paragraph(c, make_style("CVS", fontSize=8, textColor=white if i==0 else black,
fontName="Helvetica-Bold" if i==0 else "Helvetica", leading=11))
for c in row] for i, row in enumerate(cvs_data)],
colWidths=[3.8*cm, 4*cm, 7.7*cm])
cvs_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), DARK_BLUE),
("ROWBACKGROUNDS", (0,1), (-1,-1), [GREY_LIGHT, white]),
("BOX", (0,0), (-1,-1), 1, MID_BLUE),
("INNERGRID", (0,0), (-1,-1), 0.4, GREY_MID),
("VALIGN", (0,0), (-1,-1), "TOP"),
("TOPPADDING", (0,0), (-1,-1), 4),
("BOTTOMPADDING", (0,0), (-1,-1), 4),
("LEFTPADDING", (0,0), (-1,-1), 5),
]))
story.append(cvs_tbl)
story.append(sp(8))
# Endocrine
story.append(subsection_bar("B. ENDOCRINE DISORDERS"))
story.append(sp(5))
endo_data = [
["<b>Disorder</b>", "<b>Cutaneous Manifestations</b>"],
["<b>Diabetes Mellitus</b>",
"Acanthosis nigricans (insulin resistance); Necrobiosis lipoidica diabeticorum (shin plaques); Diabetic dermopathy (shin spots); bullosis diabeticorum; Eruptive xanthomas (hypertriglyceridaemia); Candidiasis; impaired wound healing; Dupuytren's contracture"],
["<b>Thyroid Disease (Hypo)</b>",
"Myxoedema: doughy, non-pitting oedema; dry, coarse hair; loss of outer 1/3 eyebrow (Queen Anne's sign); xeroderma; pretibial myxoedema in Grave's disease"],
["<b>Thyroid Disease (Hyper)</b>",
"Warm, moist skin; fine hair; onycholysis (Plummer's nails); diffuse pigmentation; acropachy (clubbing); pretibial myxoedema (Graves')"],
["<b>Cushing's Syndrome</b>",
"Facial plethora, moon face; striae (purplish-red, >1 cm, abdominal/axillary); skin thinning; easy bruising; acne; hirsutism; hyperpigmentation (if ACTH-dependent); buffalo hump"],
["<b>Addison's Disease</b>",
"Hyperpigmentation (MSH/ACTH cross-reactivity): buccal mucosa, palmar creases, pressure areas, scars. Vitiligo association in autoimmune Addison's"],
["<b>Acromegaly</b>",
"Seborrhoea, skin tags (acrochordons), acanthosis nigricans, coarse facial features, increased heel pad thickness, hyperpigmentation"],
["<b>Carcinoid Syndrome</b>",
"Episodic flushing (face/neck/chest), cyanosis, telangiectasias; skin becomes thickened and violaceous in chronic cases"],
]
endo_tbl = Table([[Paragraph(c, make_style("END", fontSize=8, textColor=white if i==0 else black,
fontName="Helvetica-Bold" if i==0 else "Helvetica", leading=11))
for c in row] for i, row in enumerate(endo_data)],
colWidths=[4.5*cm, 11*cm])
endo_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), TEAL),
("ROWBACKGROUNDS", (0,1), (-1,-1), [TEAL_LIGHT, white]),
("BOX", (0,0), (-1,-1), 1, TEAL),
("INNERGRID", (0,0), (-1,-1), 0.4, GREY_MID),
("VALIGN", (0,0), (-1,-1), "TOP"),
("TOPPADDING", (0,0), (-1,-1), 4),
("BOTTOMPADDING", (0,0), (-1,-1), 4),
("LEFTPADDING", (0,0), (-1,-1), 5),
]))
story.append(endo_tbl)
story.append(sp(8))
# GI
story.append(subsection_bar("C. GASTROINTESTINAL / HEPATIC DISORDERS"))
story.append(sp(5))
gi_items = [
"<b>Jaundice:</b> Scleral icterus (bilirubin >2.5 mg/dL), skin icterus, pruritus (bile salt deposition).",
"<b>Chronic Liver Disease / Cirrhosis:</b> Spider naevi (>5 is significant — upper half of body), palmar erythema, leukonychia (Terry's nails — white nails), caput medusae, gynaecomastia, Dupuytren's contracture, parotid enlargement (alcohol), bruising (coagulopathy), paper-money skin.",
"<b>Haemochromatosis:</b> Bronze/slate-grey hyperpigmentation (melanin + haemosiderin); skin may feel metallic.",
"<b>Wilson's Disease:</b> Kayser-Fleischer rings (copper deposition in Descemet's membrane — green/brown ring at corneal periphery); azure lunulae of nails.",
"<b>Primary Biliary Cholangitis:</b> Xanthomas, xanthelasma, hyperpigmentation, pruritus.",
"<b>Coeliac Disease:</b> Dermatitis herpetiformis — intensely pruritic, grouped vesicles/papules on extensor surfaces; IgA deposits at dermo-epidermal junction.",
"<b>Inflammatory Bowel Disease:</b> Erythema nodosum (tender red nodules on shins — Crohn's > UC); pyoderma gangrenosum (UC > Crohn's — deep ulcers with undermined violet borders); aphthous ulcers; epidermolysis bullosa acquisita.",
"<b>Peutz-Jeghers Syndrome:</b> Mucocutaneous perioral/buccal melanotic macules; hamartomatous polyps; ↑ GI malignancy risk.",
"<b>Pancreatic Carcinoma:</b> Migratory thrombophlebitis (Trousseau's sign); sudden-onset seborrhoeic keratoses (Leser-Trelat sign).",
]
for item in gi_items:
story.append(Paragraph("• " + item, bullet))
story.append(sp(8))
# Respiratory
story.append(subsection_bar("D. RESPIRATORY DISORDERS"))
story.append(sp(5))
resp_items = [
"<b>Sarcoidosis:</b> Erythema nodosum (early, acute); lupus pernio (chronic — violaceous indurated plaques on nose, cheeks, ears); scar sarcoidosis; maculopapular rash.",
"<b>Tuberculosis:</b> Lupus vulgaris (most common — apple-jelly nodules on diascopy); scrofuloderma; erythema induratum; erythema nodosum.",
"<b>Lung Cancer:</b> Acanthosis nigricans; dermatomyositis; clubbing (hypertrophic pulmonary osteoarthropathy — HPOA); Leser-Trelat sign; Superior vena cava syndrome (facial plethora).",
"<b>Cystic Fibrosis:</b> Clubbing; digital vasculitis; HPOA.",
]
for item in resp_items:
story.append(Paragraph("• " + item, bullet))
story.append(sp(8))
# Renal
story.append(subsection_bar("E. RENAL DISORDERS"))
story.append(sp(5))
renal_items = [
"<b>CKD / Uraemia:</b> Pruritus (uraemic pruritus — generalised, worse at night); sallow/yellow-brown skin (urochrome retention); 'half-and-half nails' (Lindsay's nails — proximal white, distal brown); calcinosis cutis; metastatic calcification; bullous dermatosis of haemodialysis.",
"<b>Nephrotic Syndrome:</b> Generalised pitting oedema (periorbital); xanthomas (hypercholesterolaemia); leukonychia.",
"<b>Vasculitis (ANCA-associated):</b> Palpable purpura; splinter haemorrhages; ulcers; digital ischaemia.",
"<b>Alport Syndrome:</b> No specific skin finding; associated with lenticonus.",
"<b>Post-Renal Transplant:</b> Kaposi's sarcoma (HHV-8 reactivation); HPV-related warts; squamous cell carcinoma.",
]
for item in renal_items:
story.append(Paragraph("• " + item, bullet))
story.append(sp(8))
# Haematological
story.append(subsection_bar("F. HAEMATOLOGICAL / SYSTEMIC COAGULOPATHIES"))
story.append(sp(5))
haem_items = [
"<b>Polycythaemia Vera:</b> Plethoric face, pruritus (especially after hot bath/water — aquagenic pruritus), ruddy cyanosis, excoriations.",
"<b>Leukaemias/Lymphomas:</b> Skin infiltration (leukaemia cutis — violaceous nodules); paraneoplastic pemphigus; herpes zoster reactivation; Sweet's syndrome (acute febrile neutrophilic dermatosis — red tender plaques associated with AML).",
"<b>DIC / Coagulopathies:</b> Widespread purpura, petechiae; purpura fulminans (skin necrosis from microvascular thrombi); ecchymoses.",
"<b>Amyloidosis:</b> Pinch purpura (periorbital haemorrhage on gentle pressure); waxy papules; macroglossia; 'raccoon eyes'.",
"<b>Multiple Myeloma:</b> Cutaneous plasmacytomas; POEMS syndrome — Polyneuropathy, Organomegaly, Endocrinopathy, M-protein, Skin changes (hyperpigmentation, thickening, haemangiomas).",
]
for item in haem_items:
story.append(Paragraph("• " + item, bullet))
story.append(sp(8))
# Connective Tissue
story.append(subsection_bar("G. CONNECTIVE TISSUE / RHEUMATIC DISORDERS"))
story.append(sp(5))
ct_data = [
["<b>Disease</b>", "<b>Key Skin Findings</b>"],
["SLE", "Malar (butterfly) rash (spares nasolabial folds); discoid lupus; photosensitivity; oral ulcers; Raynaud's phenomenon; alopecia; livedo reticularis; vasculitis; subacute cutaneous LE"],
["Systemic Sclerosis (SSc)", "Tight, waxy skin (sclerodactyly→scleroderma); Raynaud's phenomenon; calcinosis; telangiectasias; hyperpigmentation; mat telangiectasias; loss of facial wrinkles"],
["Dermatomyositis", "Heliotrope rash (purple periorbital); Gottron's papules (knuckles); V-sign; shawl sign; mechanic's hands; 'flagstone' skin; nailfold capillary changes"],
["Rheumatoid Arthritis", "Rheumatoid nodules (subcutaneous, pressure areas); vasculitis; pyoderma gangrenosum; palmar erythema; nail fold infarcts"],
["Psoriatic Arthritis", "Psoriatic plaques (silvery scales, extensor surfaces); nail pitting; onycholysis; dactylitis"],
["Behcet's Disease", "Recurrent oral aphthae (major criterion); genital ulcers; pseudofolliculitis; pathergy; erythema nodosum"],
["CREST Syndrome", "Calcinosis, Raynaud's, Esophageal dysmotility, Sclerodactyly, Telangiectasias — limited SSc"],
]
ct_tbl = Table([[Paragraph(c, make_style("CT", fontSize=8, textColor=white if i==0 else black,
fontName="Helvetica-Bold" if i==0 else "Helvetica", leading=11))
for c in row] for i, row in enumerate(ct_data)],
colWidths=[4*cm, 11.5*cm])
ct_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), GOLD),
("ROWBACKGROUNDS", (0,1), (-1,-1), [GOLD_LIGHT, white]),
("BOX", (0,0), (-1,-1), 1, GOLD),
("INNERGRID", (0,0), (-1,-1), 0.4, GREY_MID),
("VALIGN", (0,0), (-1,-1), "TOP"),
("TOPPADDING", (0,0), (-1,-1), 4),
("BOTTOMPADDING", (0,0), (-1,-1), 4),
("LEFTPADDING", (0,0), (-1,-1), 5),
]))
story.append(ct_tbl)
story.append(sp(6))
story.append(info_box("<b>Key Exam Points Q2:</b> Learn specific dermatological signs for each system. Mnemonic for IE: 'OJaS' — Osler's (painful) vs Janeway (painless). Remember: erythema nodosum = IBD/sarcoid/TB, pyoderma gangrenosum = IBD. DM skin: 'ANNDE' — Acanthosis Nigricans, Necrobiosis, Dermopathy, Eruptive xanthomas."))
story.append(PageBreak())
# ══════════════════════════════════════════════════════════════════════════════
# SHORT NOTES
# ══════════════════════════════════════════════════════════════════════════════
story.append(section_bar("Q3 SHORT NOTES (8 × 3 = 24 Marks)", bg=TEAL))
story.append(sp(8))
# Q3A – Lymphatic Drainage of Lungs
story.append(subsection_bar("Q3-A: LYMPHATIC DRAINAGE OF LUNGS"))
story.append(sp(6))
story.append(Paragraph("<b>Overview:</b> The lungs have a rich lymphatic network — the most extensive of any organ relative to weight. Lymphatics are absent from alveolar walls but present in interstitium, pleura, and bronchovascular bundles.", body))
story.append(sp(4))
story.append(Paragraph("<b>Two Lymphatic Plexuses:</b>", h4))
story.append(Paragraph("1. <b>Superficial (Subpleural) Plexus:</b> Beneath visceral pleura; drains pleura and peripheral lung parenchyma. Flows toward hilar lymph nodes.", bullet))
story.append(Paragraph("2. <b>Deep (Peribronchial/Perivascular) Plexus:</b> Accompanies bronchi and pulmonary vessels from alveolar ducts to hilum. Major drainage pathway for lung parenchyma.", bullet))
story.append(sp(4))
story.append(Paragraph("<b>Lymph Node Stations (IASLC Classification):</b>", h4))
lymph_data = [
["<b>Station</b>", "<b>Location</b>"],
["Intrapulmonary nodes (N1)", "Within lung parenchyma along secondary bronchi (Level 12-14)"],
["Lobar nodes (N1)", "At lobar bronchial origins (Level 11)"],
["Interlobar nodes (N1)", "In angles between lobar bronchi (Level 10-11)"],
["Hilar nodes (N1)", "Along main bronchi & pulmonary vessels at hilum (Level 10)"],
["Subcarinal nodes (N2)", "Below carina, between main bronchi (Level 7) — IMPORTANT"],
["Paratracheal nodes (N2)", "Right and left paratracheal chains (Levels 2R, 2L, 4R, 4L)"],
["Aortopulmonary window (N2)", "Left-sided — between aorta and pulmonary artery (Level 5, 6)"],
["Mediastinal (N2)", "Anterior mediastinal, posterior mediastinal nodes"],
["Scalene/Supraclavicular (N3)", "Contralateral mediastinal or scalene nodes"],
]
l_tbl = Table([[Paragraph(c, make_style("LT", fontSize=8.5, textColor=white if i==0 else black,
fontName="Helvetica-Bold" if i==0 else "Helvetica", leading=11))
for c in row] for i, row in enumerate(lymph_data)],
colWidths=[5*cm, 10.5*cm])
l_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), TEAL),
("ROWBACKGROUNDS", (0,1), (-1,-1), [TEAL_LIGHT, white]),
("BOX", (0,0), (-1,-1), 1, TEAL),
("INNERGRID", (0,0), (-1,-1), 0.4, GREY_MID),
("VALIGN", (0,0), (-1,-1), "TOP"),
("TOPPADDING", (0,0), (-1,-1), 4),
("BOTTOMPADDING", (0,0), (-1,-1), 4),
("LEFTPADDING", (0,0), (-1,-1), 5),
]))
story.append(l_tbl)
story.append(sp(5))
story.append(Paragraph("<b>Flow Pathway:</b>", h4))
story.append(Paragraph("Alveolar walls → Intrapulmonary nodes → Lobar nodes → Hilar nodes (N1) → Mediastinal nodes (N2) → Thoracic duct (left side) → Right lymphatic duct (right side) → Subclavian vein → Venous circulation.", bullet))
story.append(sp(4))
story.append(Paragraph("<b>Right vs Left Lung Drainage:</b>", h4))
story.append(Paragraph("• <b>Right lung:</b> Drains to right paratracheal chain → right lymphatic duct → right subclavian vein", bullet))
story.append(Paragraph("• <b>Left lung (upper lobe):</b> Drains to left paratracheal/aortopulmonary nodes → thoracic duct", bullet))
story.append(Paragraph("• <b>Left lung (lower lobe):</b> Often crosses midline to drain into right paratracheal nodes (clinically important — bilateral spread of left lower lobe cancer)", bullet))
story.append(sp(4))
story.append(Paragraph("<b>Clinical Significance:</b>", h4))
story.append(Paragraph("• Lung cancer staging (TNM): N1 = hilar nodes; N2 = ipsilateral mediastinal; N3 = contralateral/scalene — determines operability.", bullet))
story.append(Paragraph("• Sarcoidosis: Bilateral hilar lymphadenopathy (BHL) — classic chest X-ray finding.", bullet))
story.append(Paragraph("• Pulmonary oedema: Kerley B lines = interstitial oedema in lymphatics of interlobular septa.", bullet))
story.append(Paragraph("• Metastatic spread: Right scalene node involvement in right-sided lung cancer; Virchow's node (left supraclavicular) in bilateral disease.", bullet))
story.append(sp(8))
# Q3B – Arterial Supply of Brain
story.append(subsection_bar("Q3-B: ARTERIAL SUPPLY OF BRAIN"))
story.append(sp(6))
story.append(Paragraph("<b>Overview:</b> The brain receives blood from two pairs of arteries — the Internal Carotid Arteries (ICA) anteriorly and the Vertebral Arteries (VA) posteriorly, which unite at the Circle of Willis (circulus arteriosus cerebri).", body))
story.append(sp(4))
story.append(Paragraph("<b>Circle of Willis:</b>", h4))
story.append(Paragraph("Formed by (clockwise): ACA – AComA – ACA – ICA – PComA – PCA – Basilar (2 PCA) – PComA – ICA – ACA – AComA", bullet))
story.append(Paragraph("Components:", bold_key))
story.append(Paragraph("• <b>ACA</b> (Anterior Cerebral Artery) × 2 — from ICA", bullet))
story.append(Paragraph("• <b>AComA</b> (Anterior Communicating Artery) — connects two ACAs", bullet))
story.append(Paragraph("• <b>ICA</b> (Internal Carotid Artery) × 2 — lateral portions of circle", bullet))
story.append(Paragraph("• <b>PComA</b> (Posterior Communicating Artery) × 2 — connects ICA to PCA", bullet))
story.append(Paragraph("• <b>PCA</b> (Posterior Cerebral Artery) × 2 — from basilar artery", bullet))
story.append(sp(4))
story.append(Paragraph("<b>Arterial Territories:</b>", h4))
art_data = [
["<b>Artery</b>", "<b>Area Supplied</b>", "<b>Deficit if Occluded</b>"],
["Ant. Cerebral A. (ACA)", "Medial frontal, parietal lobes; anterior corpus callosum", "Contralateral leg weakness/sensory loss > arm; personality change (frontal lobe)"],
["Mid. Cerebral A. (MCA)", "Lateral frontal, parietal, temporal lobes — largest territory", "Contralateral arm/face weakness (leg spared); aphasia (dominant hemisphere); neglect (non-dominant)"],
["Post. Cerebral A. (PCA)", "Occipital lobe; posterior thalamus; midbrain; medial temporal", "Contralateral homonymous hemianopia; thalamic pain; memory loss"],
["Basilar Artery", "Pons, midbrain, cerebellum (AICA, PICA, SCA branches)", "Locked-in syndrome (ventral pontine); quadriplegia; coma"],
["PICA (Post Inf Cerebellar)", "Lateral medulla, inferior cerebellum", "Lateral medullary (Wallenberg) syndrome: ipsilateral facial sensory loss, contralateral body"],
["Lenticulostriate arteries", "Basal ganglia, internal capsule (perforating from MCA)", "Lacunar infarcts — pure motor/sensory stroke; dysarthria-clumsy hand syndrome"],
["Anterior Choroidal A.", "Posterior limb internal capsule, optic tract, LGB", "Hemiplegia, hemianopia, hemisensory loss"],
]
art_tbl = Table([[Paragraph(c, make_style("ART", fontSize=8, textColor=white if i==0 else black,
fontName="Helvetica-Bold" if i==0 else "Helvetica", leading=11))
for c in row] for i, row in enumerate(art_data)],
colWidths=[3.8*cm, 5.5*cm, 6.2*cm])
art_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), DARK_BLUE),
("ROWBACKGROUNDS", (0,1), (-1,-1), [GREY_LIGHT, white]),
("BOX", (0,0), (-1,-1), 1, MID_BLUE),
("INNERGRID", (0,0), (-1,-1), 0.4, GREY_MID),
("VALIGN", (0,0), (-1,-1), "TOP"),
("TOPPADDING", (0,0), (-1,-1), 4),
("BOTTOMPADDING", (0,0), (-1,-1), 4),
("LEFTPADDING", (0,0), (-1,-1), 5),
]))
story.append(art_tbl)
story.append(sp(5))
story.append(Paragraph("<b>Key Anatomical Points:</b>", h4))
story.append(Paragraph("• ICA enters skull through carotid canal → cavernous sinus → intracranially gives: ophthalmic artery, ACA, MCA, anterior choroidal, PComA.", bullet))
story.append(Paragraph("• Vertebral arteries enter through foramen magnum → unite at pontomedullary junction → Basilar artery → splits into 2 PCAs at midbrain.", bullet))
story.append(Paragraph("• Circle of Willis provides collateral flow — only functional when one vessel is occluded (anatomical variation in 50%+ of population).", bullet))
story.append(Paragraph("• <b>Berry (saccular) aneurysms</b> occur most commonly at bifurcations: AComA (most common), ICA-PComA junction, MCA bifurcation — rupture → subarachnoid haemorrhage.", bullet))
story.append(sp(8))
# Q3C – Stem Cell Therapy
story.append(subsection_bar("Q3-C: STEM CELL THERAPY"))
story.append(sp(6))
story.append(Paragraph("<b>Definition:</b> Stem cells are undifferentiated cells capable of self-renewal and differentiation into specialised cell types. Stem cell therapy involves administration of stem cells to repair damaged tissues or restore function.", body))
story.append(sp(4))
story.append(Paragraph("<b>Classification of Stem Cells:</b>", h4))
sc_data = [
["<b>Type</b>", "<b>Source</b>", "<b>Potency</b>", "<b>Key Features</b>"],
["Embryonic Stem Cells (ESC)", "Inner cell mass of blastocyst", "Pluripotent", "Greatest differentiation potential; ethical concerns; teratoma risk"],
["Induced Pluripotent Stem Cells (iPSC)", "Adult somatic cells reprogrammed by Yamanaka factors (Oct4, Sox2, Klf4, c-Myc)", "Pluripotent", "Avoids ethical issues; patient-specific; tumour risk from integration"],
["Haematopoietic Stem Cells (HSC)", "Bone marrow, peripheral blood, cord blood", "Multipotent", "Gold standard in clinical use — BMT for leukaemia, aplastic anaemia"],
["Mesenchymal Stem Cells (MSC)", "Bone marrow, adipose tissue, umbilical cord", "Multipotent", "Anti-inflammatory, immunomodulatory; used in GvHD, cartilage repair"],
["Neural Stem Cells", "CNS germinal zones (SVZ, dentate gyrus)", "Multipotent", "Potential for Parkinson's, ALS, spinal injury — largely experimental"],
["Organ-specific stem cells", "Organ progenitor cells (liver, gut, skin)", "Oligopotent/Unipotent", "Skin grafts (keratinocytes); corneal stem cell transplant — clinical use"],
]
sc_tbl = Table([[Paragraph(c, make_style("SC", fontSize=8, textColor=white if i==0 else black,
fontName="Helvetica-Bold" if i==0 else "Helvetica", leading=11))
for c in row] for i, row in enumerate(sc_data)],
colWidths=[3.5*cm, 3.5*cm, 2.5*cm, 6*cm])
sc_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), TEAL),
("ROWBACKGROUNDS", (0,1), (-1,-1), [TEAL_LIGHT, white]),
("BOX", (0,0), (-1,-1), 1, TEAL),
("INNERGRID", (0,0), (-1,-1), 0.4, GREY_MID),
("VALIGN", (0,0), (-1,-1), "TOP"),
("TOPPADDING", (0,0), (-1,-1), 4),
("BOTTOMPADDING", (0,0), (-1,-1), 4),
("LEFTPADDING", (0,0), (-1,-1), 5),
]))
story.append(sc_tbl)
story.append(sp(5))
story.append(Paragraph("<b>Clinical Applications:</b>", h4))
sc_apps = [
"<b>Haematological Malignancies:</b> Allogeneic HSC transplantation for AML, ALL, CML, myeloma, aplastic anaemia. Autologous transplant after high-dose chemo for lymphoma.",
"<b>Graft-versus-Tumour Effect:</b> Donor T-cells eliminate residual leukaemic cells — important therapeutic benefit of allogeneic BMT.",
"<b>Sickle Cell Disease/Thalassaemia:</b> Allogeneic BMT is curative; gene-modified autologous stem cells (e.g. Casgevy — CRISPR-based — FDA approved 2023).",
"<b>CAR-T Cell Therapy:</b> Genetically engineered T-cells targeting tumour antigens (e.g. CD19 for B-ALL, BCMA for myeloma) — transformative in haematological malignancies.",
"<b>Diabetes:</b> Pancreatic beta-cell regeneration from iPSC; encapsulated islet cell therapy in trials.",
"<b>Neurological:</b> Parkinson's disease — dopaminergic neuron transplants; ALS — Phase 2 trials with neural stem cells; Spinal cord injury.",
"<b>Cardiovascular:</b> Post-MI — intracoronary MSC infusion to improve EF; small benefit in clinical trials.",
"<b>Corneal:</b> Limbal stem cell transplantation for chemical burns — established treatment.",
"<b>Orthopaedic:</b> MSC injection for cartilage repair (OA); bone non-union.",
]
for app in sc_apps:
story.append(Paragraph("• " + app, bullet))
story.append(sp(5))
story.append(Paragraph("<b>Complications:</b>", h4))
story.append(Paragraph("• <b>Graft-versus-Host Disease (GvHD):</b> Acute (skin rash, diarrhoea, jaundice) and chronic (fibrosis, sicca syndrome) — major cause of transplant mortality.", bullet))
story.append(Paragraph("• <b>Graft failure/rejection, infections (immunosuppression), secondary malignancies, veno-occlusive disease (hepatic sinusoidal obstruction).</b>", bullet))
story.append(Paragraph("• <b>Teratoma formation</b> risk with ESC/iPSC.", bullet))
story.append(sp(8))
story.append(PageBreak())
# ══════════════════════════════════════════════════════════════════════════════
story.append(section_bar("Q4 SHORT NOTES (8 × 3 = 24 Marks)", bg=DARK_BLUE))
story.append(sp(8))
# Q4A – ECMO
story.append(subsection_bar("Q4-A: ECMO (EXTRACORPOREAL MEMBRANE OXYGENATION)"))
story.append(sp(6))
story.append(Paragraph("<b>Definition:</b> ECMO is a form of prolonged extracorporeal life support that provides sustained cardiorespiratory support by pumping blood outside the body through an artificial lung (membrane oxygenator) that adds O2 and removes CO2.", body))
story.append(sp(4))
story.append(Paragraph("<b>Types of ECMO:</b>", h4))
ecmo_data = [
["<b>Feature</b>", "<b>VV-ECMO (Veno-Venous)</b>", "<b>VA-ECMO (Veno-Arterial)</b>"],
["Indication", "Isolated severe respiratory failure (ARDS, pneumonia)", "Cardiorespiratory failure; cardiogenic shock; cardiac arrest"],
["Access", "Drainage: femoral vein\nReturn: internal jugular OR dual-lumen single cannula", "Drainage: femoral vein\nReturn: femoral artery (or central)"],
["Cardiac support", "No cardiac support (heart must function)", "Provides full cardiac AND respiratory support"],
["O2 delivery", "Improves oxygenation and CO2 removal", "Full circulatory support; offloads native heart"],
["Complications", "Circuit clots; haemolysis; SVC syndrome", "LV distension; limb ischaemia; Harlequin syndrome; stroke"],
["Monitoring", "Pre/post membrane O2 sats; sweep gas (CO2)", "Arterial line for blood pressure monitoring"],
]
e_tbl = Table([[Paragraph(c, make_style("ET", fontSize=8, textColor=white if i==0 else black,
fontName="Helvetica-Bold" if i==0 else "Helvetica", leading=11))
for c in row] for i, row in enumerate(ecmo_data)],
colWidths=[3.5*cm, 5.5*cm, 6.5*cm])
e_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), DARK_BLUE),
("ROWBACKGROUNDS", (0,1), (-1,-1), [GREY_LIGHT, white]),
("BOX", (0,0), (-1,-1), 1, MID_BLUE),
("INNERGRID", (0,0), (-1,-1), 0.4, GREY_MID),
("VALIGN", (0,0), (-1,-1), "TOP"),
("TOPPADDING", (0,0), (-1,-1), 4),
("BOTTOMPADDING", (0,0), (-1,-1), 4),
("LEFTPADDING", (0,0), (-1,-1), 5),
]))
story.append(e_tbl)
story.append(sp(5))
story.append(Paragraph("<b>Indications:</b>", h4))
story.append(Paragraph("• <b>VV-ECMO:</b> Severe ARDS (P/F ratio <80 despite optimised ventilation); respiratory failure in influenza H1N1; COVID-19 ARDS; bridge to lung transplant.", bullet))
story.append(Paragraph("• <b>VA-ECMO:</b> Cardiogenic shock (post-MI, post-cardiotomy); fulminant myocarditis; massive pulmonary embolism; refractory cardiac arrest (E-CPR); bridge to VAD or transplant.", bullet))
story.append(sp(4))
story.append(Paragraph("<b>Contraindications:</b>", h4))
story.append(Paragraph("• Conditions incompatible with meaningful recovery; severe aortic regurgitation (VA-ECMO); uncontrolled bleeding/intracranial haemorrhage; prolonged cardiac arrest without ROSC.", bullet))
story.append(sp(4))
story.append(Paragraph("<b>Complications:</b>", h4))
ecmo_comp = [
"<b>Haemorrhage:</b> Most common (anticoagulation required — heparin; target ACT 160-220s); intracranial haemorrhage is catastrophic.",
"<b>Thrombosis/Embolism:</b> Circuit clotting; cannula thrombus; stroke.",
"<b>Haemolysis:</b> From mechanical shear forces — monitor LDH, Hb, plasma Hb.",
"<b>Limb Ischaemia:</b> (VA-ECMO) — distal perfusion cannula required for femoral artery access.",
"<b>Infection:</b> ECMO-associated blood stream infections; biofilm on circuit.",
"<b>LV distension:</b> (VA-ECMO) — afterload increase → pulmonary oedema; manage with inotropes/IABP/Impella.",
"<b>Harlequin Syndrome:</b> Differential hypoxia in VA-ECMO — upper body hypoxia, lower body well-oxygenated (ECMO blood reaches aorta before coronaries/cerebral vessels).",
]
for comp in ecmo_comp:
story.append(Paragraph("• " + comp, bullet))
story.append(sp(5))
story.append(alert_box("ECMO is a bridge, NOT a destination. Weaning strategy must be planned from initiation. Key parameter for VV weaning: SaO2 maintained on reduced sweep gas; for VA: native pulse pressure returning."))
story.append(sp(8))
# Q4B – Heat Stroke
story.append(subsection_bar("Q4-B: HEAT STROKE"))
story.append(sp(6))
story.append(info_box("<b>Definition:</b> Heat stroke is an acute life-threatening hyperthermia (core temperature >40°C / 104°F) associated with central nervous system dysfunction (altered mental status), representing failure of thermoregulatory mechanisms. It has high mortality if not treated immediately."))
story.append(sp(5))
story.append(Paragraph("<b>Classification:</b>", h4))
hs_class = [
["<b>Feature</b>", "<b>Classic (Non-Exertional)</b>", "<b>Exertional</b>"],
["Population", "Elderly, infants; chronic illness", "Young healthy athletes, military recruits"],
["Setting", "Prolonged heat exposure (heat wave)", "Intense exercise in hot/humid environment"],
["Sweating", "Often absent (anhidrosis)", "Usually present (profuse sweating)"],
["Onset", "Gradual (days)", "Rapid (hours)"],
["Rhabdomyolysis", "Less common", "Very common"],
["Lactic acidosis", "Less common", "Common"],
]
hs_tbl = Table([[Paragraph(c, make_style("HST", fontSize=8.5, textColor=white if i==0 else black,
fontName="Helvetica-Bold" if i==0 else "Helvetica", leading=11))
for c in row] for i, row in enumerate(hs_class)],
colWidths=[3.5*cm, 5.5*cm, 6.5*cm])
hs_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), GOLD),
("ROWBACKGROUNDS", (0,1), (-1,-1), [GOLD_LIGHT, white]),
("BOX", (0,0), (-1,-1), 1, GOLD),
("INNERGRID", (0,0), (-1,-1), 0.4, GREY_MID),
("VALIGN", (0,0), (-1,-1), "TOP"),
("TOPPADDING", (0,0), (-1,-1), 4),
("BOTTOMPADDING", (0,0), (-1,-1), 4),
("LEFTPADDING", (0,0), (-1,-1), 5),
]))
story.append(hs_tbl)
story.append(sp(5))
story.append(Paragraph("<b>Pathophysiology:</b>", h4))
story.append(Paragraph("Heat production > heat dissipation → core temperature rises → thermoregulatory centre overwhelmed → direct cellular heat injury (protein denaturation, mitochondrial dysfunction) + cytokine storm + endothelial injury → MODS (multi-organ dysfunction syndrome).", body))
story.append(sp(4))
story.append(Paragraph("<b>Clinical Features:</b>", h4))
story.append(Paragraph("• <b>Cardinal signs:</b> Core temp >40°C + CNS dysfunction (confusion, agitation, ataxia, seizures, coma)", bullet))
story.append(Paragraph("• <b>CNS:</b> Cerebellum highly sensitive — early ataxia; delirium, hallucinations, decorticate/decerebrate posturing, hemiplegia, status epilepticus", bullet))
story.append(Paragraph("• <b>CVS:</b> Initial: tachycardia, high CO, low SVR (hyperdynamic). Late: cardiovascular collapse, shock", bullet))
story.append(Paragraph("• <b>Respiratory:</b> Tachypnoea, ARDS in severe cases; PaCO2 often <20 mmHg", bullet))
story.append(Paragraph("• <b>Renal:</b> AKI (prerenal + rhabdomyolysis); myoglobinuria (dark urine)", bullet))
story.append(Paragraph("• <b>Haematological:</b> DIC (common in severe heat stroke); thrombocytopenia, haemolysis", bullet))
story.append(Paragraph("• <b>Metabolic:</b> Lactic acidosis, hypoglycaemia (exertional), hyperkalaemia (rhabdo)", bullet))
story.append(sp(4))
story.append(Paragraph("<b>Diagnosis & Investigations:</b>", h4))
story.append(Paragraph("• No specific diagnostic test — clinical diagnosis based on history + temperature + CNS status", bullet))
story.append(Paragraph("• Labs: CBC, RFT, LFT, ABG, coagulation profile, CK, myoglobin, UA, blood glucose, electrolytes", bullet))
story.append(Paragraph("• CT head ± LP to exclude other causes of altered mental status", bullet))
story.append(sp(4))
story.append(Paragraph("<b>Treatment (IMMEDIATE — Time-critical):</b>", h4))
story.append(alert_box("Rapid cooling to <39°C within 30 minutes is the primary treatment goal. Delay increases mortality and neurological sequelae."))
story.append(sp(4))
hs_rx = [
"<b>Remove from heat exposure; ABC assessment.</b>",
"<b>Evaporative cooling</b> (preferred): Spraying cool water + fanning — most practical, effective for classic heat stroke.",
"<b>Cold-water immersion</b> (most effective): Immerse in ice water — fastest cooling rate (0.2°C/min); best for exertional heat stroke.",
"<b>Ice packs</b> to axillae, groin, neck (high blood flow areas).",
"<b>Cool IV fluids</b> (0.9% NaCl) — treat hypovolaemia; avoid cold infusions rapidly.",
"<b>Benzodiazepines</b> (lorazepam/diazepam) for seizures and to reduce shivering during cooling.",
"<b>Intubation</b> if GCS <8 or respiratory failure.",
"<b>Monitor</b>: core temperature continuously; target <39°C; avoid overshoot hypothermia.",
"<b>Treat complications</b>: DIC (FFP, platelets), AKI (IV fluids, consider RRT), rhabdomyolysis (fluids, alkalise urine), hypoglycaemia (dextrose).",
"<b>DO NOT use</b> antipyretics (paracetamol/aspirin) — ineffective; mechanism is non-PGE2 (not fever).",
]
for rx in hs_rx:
story.append(Paragraph("• " + rx, bullet))
story.append(sp(5))
story.append(green_box("<b>Prognosis:</b> Mortality 10-50% depending on delay in cooling, peak temperature, and organ involvement. Survivors may have permanent cerebellar dysfunction. Key prognostic factor = duration of hyperthermia."))
story.append(sp(8))
# Q4C – Targeted Therapy
story.append(subsection_bar("Q4-C: TARGETED THERAPY"))
story.append(sp(6))
story.append(Paragraph("<b>Definition:</b> Targeted therapy (molecular targeted therapy) refers to drugs designed to specifically interfere with molecular targets that are involved in tumour growth, progression, angiogenesis, and metastasis, in contrast to conventional chemotherapy which affects all dividing cells.", body))
story.append(sp(4))
story.append(Paragraph("<b>Principles:</b>", h4))
story.append(Paragraph("• Directed at specific mutations/proteins present in cancer cells (identified by molecular testing of diagnostic biopsy or liquid biopsy).", bullet))
story.append(Paragraph("• Based on concept of 'oncogene addiction' — cancer cells depend on specific molecular pathways for survival.", bullet))
story.append(Paragraph("• More selective than chemotherapy → reduced side effects on normal tissues.", bullet))
story.append(Paragraph("• Requires companion diagnostics (predictive biomarkers) to select appropriate patients.", bullet))
story.append(sp(4))
story.append(Paragraph("<b>Major Classes & Examples:</b>", h4))
tt_data = [
["<b>Class</b>", "<b>Target</b>", "<b>Examples</b>", "<b>Clinical Use</b>"],
["Tyrosine Kinase Inhibitors (TKI)\n- Small molecules", "BCR-ABL, EGFR, ALK,\nBRAF, VEGFR, c-Kit", "Imatinib (BCR-ABL)\nGefitinib/Erlotinib (EGFR)\nCrizotinib (ALK)\nVerumurafenib (BRAF)", "CML, GIST (imatinib)\nNSCLC with EGFR mutation\nNSCLC with ALK translocation\nMelanoma with BRAF V600E"],
["Monoclonal Antibodies (mAbs)\n- Large molecules (-mab)", "HER2, VEGF, EGFR,\nCD20, PD-1, PD-L1,\nCTLA-4", "Trastuzumab (HER2)\nBevacizumab (VEGF)\nRituximab (CD20)\nCetuximab (EGFR)", "HER2+ breast/gastric cancer\nColorectal, renal, glioblastoma\nB-cell lymphoma/CLL\nColorectal cancer (RAS WT)"],
["CDK4/6 Inhibitors", "Cell cycle: CDK4/6 kinases", "Palbociclib, Ribociclib,\nAbemaciclib", "HR+/HER2- metastatic breast cancer (with aromatase inhibitor)"],
["mTOR Inhibitors", "mTOR (PI3K/AKT/mTOR pathway)", "Everolimus, Temsirolimus", "Renal cell carcinoma, neuroendocrine tumours, HR+ breast cancer"],
["PARP Inhibitors", "PARP enzyme (DNA repair)\n— synthetic lethality in BRCA-mutant", "Olaparib, Niraparib,\nRucaparib", "BRCA1/2-mutant ovarian, breast, pancreatic, prostate cancer"],
["Hormone Receptor-directed", "ER, PR, AR", "Tamoxifen, Fulvestrant,\nAromatase inhibitors,\nLeuprolide, Enzalutamide", "ER+ breast cancer\nAndrogen-dependent prostate cancer"],
["Immune Checkpoint Inhibitors", "PD-1/PD-L1, CTLA-4", "Pembrolizumab (PD-1)\nNivolumab (PD-1)\nAtezolizumab (PD-L1)\nIpilimumab (CTLA-4)", "NSCLC, melanoma, RCC, bladder, MSI-H cancers, HNSCC"],
["ADC (Antibody-Drug Conjugate)", "Tumour antigen + cytotoxic payload", "Trastuzumab-emtansine (T-DM1)\nEnfortumab vedotin", "HER2+ breast cancer\nBladder cancer"],
["Proteasome Inhibitors", "26S Proteasome", "Bortezomib, Carfilzomib", "Multiple myeloma, mantle cell lymphoma"],
["BCL-2 Inhibitors", "BCL-2 (anti-apoptotic protein)", "Venetoclax", "CLL (with 17p deletion), AML (elderly)"],
]
tt_tbl = Table([[Paragraph(c, make_style("TT", fontSize=7.8, textColor=white if i==0 else black,
fontName="Helvetica-Bold" if i==0 else "Helvetica", leading=11))
for c in row] for i, row in enumerate(tt_data)],
colWidths=[3.5*cm, 3.5*cm, 4*cm, 4.5*cm])
tt_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), DARK_BLUE),
("ROWBACKGROUNDS", (0,1), (-1,-1), [GREY_LIGHT, white]),
("BOX", (0,0), (-1,-1), 1, MID_BLUE),
("INNERGRID", (0,0), (-1,-1), 0.4, GREY_MID),
("VALIGN", (0,0), (-1,-1), "TOP"),
("TOPPADDING", (0,0), (-1,-1), 4),
("BOTTOMPADDING", (0,0), (-1,-1), 4),
("LEFTPADDING", (0,0), (-1,-1), 5),
]))
story.append(tt_tbl)
story.append(sp(5))
story.append(Paragraph("<b>Resistance Mechanisms:</b>", h4))
story.append(Paragraph("• <b>Primary resistance:</b> Absence of target; alternative survival pathways active at baseline.", bullet))
story.append(Paragraph("• <b>Secondary (acquired) resistance:</b> Target mutation (e.g. EGFR T790M → osimertinib); pathway bypass (e.g. MET amplification in EGFR TKI resistance); downstream pathway activation; EMT.", bullet))
story.append(Paragraph("• <b>Strategies:</b> Sequential TKIs (1st/2nd/3rd generation), combination targeted therapy, liquid biopsy-guided switching.", bullet))
story.append(sp(4))
story.append(Paragraph("<b>Side Effects (Class-specific):</b>", h4))
story.append(Paragraph("• <b>EGFR TKIs:</b> Acneiform rash, diarrhoea, interstitial lung disease, hepatotoxicity.", bullet))
story.append(Paragraph("• <b>Anti-VEGF:</b> Hypertension, proteinuria, impaired wound healing, GI perforation, thromboembolism.", bullet))
story.append(Paragraph("• <b>Immune checkpoint inhibitors:</b> Immune-related adverse events (irAEs) — colitis, pneumonitis, hepatitis, thyroiditis, hypophysitis — treated with steroids.", bullet))
story.append(Paragraph("• <b>PARP inhibitors:</b> Myelosuppression, fatigue, nausea, MDS risk.", bullet))
story.append(Paragraph("• <b>Trastuzumab (HER2):</b> Cardiotoxicity (cardiomyopathy, LVEF decline) — monitor EF; avoid with anthracyclines.", bullet))
story.append(sp(5))
story.append(info_box("<b>Key Exam Points Q4C:</b> Companion diagnostics mandatory before prescribing. Imatinib (Gleevec) — prototype targeted therapy (BCR-ABL in CML — paradigm shift). PD-1/PD-L1 checkpoint inhibitors represent immunotherapy but fall under targeted therapy principles. 'Liquid biopsy' (plasma ctDNA) guides targeted therapy decisions non-invasively."))
story.append(sp(10))
story.append(HRFlowable(width="100%", thickness=2, color=DARK_BLUE, spaceAfter=8))
story.append(Paragraph("END OF EXAM-READY NOTES | MD General Medicine Paper I | January 2025",
make_style("END", fontSize=9, textColor=GREY_DARK, alignment=TA_CENTER,
fontName="Helvetica-Oblique")))
story.append(Paragraph("Sources: Harrison's 22E · Tintinalli's Emergency Medicine · Dermatology 2-Volume Set 5e · Goldman-Cecil Medicine · Fischer's Mastery of Surgery · Brenner & Rector's The Kidney · Thompson & Thompson Genetics",
make_style("SRC2", fontSize=7.5, textColor=GREY_DARK, alignment=TA_CENTER,
fontName="Helvetica-Oblique")))
# ─── Build ────────────────────────────────────────────────────────────────────
def on_page(canvas, doc):
canvas.saveState()
# Header line
canvas.setStrokeColor(MID_BLUE)
canvas.setLineWidth(0.5)
canvas.line(doc.leftMargin, H - 1.5*cm, W - doc.rightMargin, H - 1.5*cm)
canvas.setFont("Helvetica", 7)
canvas.setFillColor(GREY_DARK)
canvas.drawString(doc.leftMargin, H - 1.2*cm, "MD General Medicine Paper I — January 2025 | Exam-Ready Notes")
canvas.drawRightString(W - doc.rightMargin, H - 1.2*cm, "MDRSA-17")
# Footer
canvas.setStrokeColor(MID_BLUE)
canvas.line(doc.leftMargin, 1.5*cm, W - doc.rightMargin, 1.5*cm)
canvas.drawString(doc.leftMargin, 1.1*cm, "Compiled by Orris Medical AI | Standard Textbook References")
canvas.drawCentredString(W/2, 1.1*cm, f"Page {doc.page}")
canvas.restoreState()
doc.build(story, onFirstPage=on_page, onLaterPages=on_page)
print(f"PDF generated: {OUTPUT}")
cd /tmp/workspace/exam-pdf && python3 generate_exam_notes.py 2>&1
ls -lh /tmp/workspace/exam-pdf/MD_General_Medicine_ExamNotes_2025.pdf
MD General Medicine ExamNotes 2025
PDF Document · PDF