Send me as Pdf of All Important classifications with photographs of MS UNIVERSITY LEVEL General surgery from Bailey, Sabiston schwartz, Fischers etc.. important one's which are exam oriented
mkdir -p /home/daytona/workspace/surgery-classifications && ls /home/daytona/workspace/surgery-classifications/
~/surgery-classifications/generate_pdf.py
#!/usr/bin/env python3
"""
MS University General Surgery - Important Classifications PDF Generator
Sources: Bailey & Love 28e, Sabiston, Schwartz 11e, Fischer's Mastery of Surgery 8e
"""
import urllib.request
import os
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm, mm
from reportlab.platypus import (SimpleDocTemplate, Paragraph, Spacer, Table,
TableStyle, PageBreak, HRFlowable, Image,
KeepTogether)
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.pdfgen import canvas
from reportlab.platypus.flowables import Flowable
import io
# ─── Image download helper ────────────────────────────────────────────────────
IMG_DIR = "/home/daytona/workspace/surgery-classifications/images"
os.makedirs(IMG_DIR, exist_ok=True)
def download_image(url, filename):
"""Download image and return local path, or None on failure."""
local_path = os.path.join(IMG_DIR, filename)
if os.path.exists(local_path):
return local_path
try:
headers = {'User-Agent': 'Mozilla/5.0'}
req = urllib.request.Request(url, headers=headers)
with urllib.request.urlopen(req, timeout=10) as response:
with open(local_path, 'wb') as f:
f.write(response.read())
return local_path
except Exception as e:
print(f" [WARN] Could not download {url}: {e}")
return None
# ─── Textbook CDN images (from library DB) ───────────────────────────────────
IMAGES = {
"burn_zones": "https://cdn.orris.care/cdss_images/65340413e54495443e538931270fd2ab4ae830874c0b5b6cbf4c691f942a048b.png",
}
# Pre-download images
print("Downloading images...")
local_images = {}
for key, url in IMAGES.items():
path = download_image(url, f"{key}.png")
if path:
local_images[key] = path
print(f" OK: {key}")
else:
print(f" SKIP: {key}")
# ─── Document setup ──────────────────────────────────────────────────────────
OUTPUT = "/home/daytona/workspace/surgery-classifications/MS_Surgery_Classifications.pdf"
doc = SimpleDocTemplate(
OUTPUT,
pagesize=A4,
leftMargin=1.8*cm,
rightMargin=1.8*cm,
topMargin=2.0*cm,
bottomMargin=2.0*cm,
title="MS University General Surgery - Important Classifications",
author="Bailey & Love | Sabiston | Schwartz | Fischer"
)
W, H = A4
styles = getSampleStyleSheet()
# ─── Custom Styles ────────────────────────────────────────────────────────────
DARK_BLUE = colors.HexColor("#003366")
MED_BLUE = colors.HexColor("#005B9A")
LIGHT_BLUE = colors.HexColor("#D6E8F5")
ACCENT_GOLD = colors.HexColor("#C8860A")
LIGHT_GOLD = colors.HexColor("#FFF3CD")
GREEN = colors.HexColor("#1A6B3C")
LIGHT_GREEN = colors.HexColor("#D4EDDA")
RED = colors.HexColor("#8B0000")
LIGHT_RED = colors.HexColor("#FFE0E0")
LIGHT_GRAY = colors.HexColor("#F5F5F5")
MID_GRAY = colors.HexColor("#CCCCCC")
s_cover_title = ParagraphStyle("cover_title", parent=styles["Title"],
fontSize=26, textColor=colors.white, alignment=TA_CENTER,
spaceAfter=10, fontName="Helvetica-Bold")
s_cover_sub = ParagraphStyle("cover_sub", parent=styles["Normal"],
fontSize=13, textColor=colors.HexColor("#CCE5FF"), alignment=TA_CENTER,
spaceAfter=6, fontName="Helvetica")
s_chapter = ParagraphStyle("chapter", parent=styles["Heading1"],
fontSize=16, textColor=colors.white, fontName="Helvetica-Bold",
alignment=TA_LEFT, spaceAfter=4, spaceBefore=2)
s_section = ParagraphStyle("section", parent=styles["Heading2"],
fontSize=12, textColor=DARK_BLUE, fontName="Helvetica-Bold",
spaceBefore=10, spaceAfter=4)
s_subsection = ParagraphStyle("subsection", parent=styles["Heading3"],
fontSize=10.5, textColor=MED_BLUE, fontName="Helvetica-Bold",
spaceBefore=6, spaceAfter=3)
s_body = ParagraphStyle("body", parent=styles["Normal"],
fontSize=9.5, leading=14, textColor=colors.HexColor("#222222"),
spaceAfter=4, fontName="Helvetica")
s_body_justify = ParagraphStyle("body_j", parent=s_body,
alignment=TA_JUSTIFY)
s_bullet = ParagraphStyle("bullet", parent=s_body,
bulletIndent=10, leftIndent=20, spaceAfter=2,
bulletText="•")
s_source = ParagraphStyle("source", parent=styles["Normal"],
fontSize=8, textColor=colors.HexColor("#555555"), fontName="Helvetica-Oblique",
alignment=TA_RIGHT, spaceBefore=2)
s_note = ParagraphStyle("note", parent=styles["Normal"],
fontSize=8.5, textColor=RED, fontName="Helvetica-BoldOblique",
spaceBefore=2, spaceAfter=2)
s_table_hdr = ParagraphStyle("tbl_hdr", parent=styles["Normal"],
fontSize=9, fontName="Helvetica-Bold", textColor=colors.white,
alignment=TA_CENTER)
s_table_cell = ParagraphStyle("tbl_cell", parent=styles["Normal"],
fontSize=8.5, fontName="Helvetica", textColor=colors.HexColor("#111111"),
alignment=TA_LEFT, leading=12)
s_mnemo = ParagraphStyle("mnemo", parent=styles["Normal"],
fontSize=10, fontName="Helvetica-Bold", textColor=ACCENT_GOLD,
spaceBefore=3, spaceAfter=3)
# ─── Helper functions ─────────────────────────────────────────────────────────
def chapter_block(title, subtitle=""):
"""Returns a colored chapter header block."""
data = [[Paragraph(title, s_chapter)]]
if subtitle:
data.append([Paragraph(subtitle, ParagraphStyle("cs", parent=styles["Normal"],
fontSize=9.5, textColor=colors.HexColor("#CCE5FF"), fontName="Helvetica-Oblique"))])
tbl = Table(data, colWidths=[W - 3.6*cm])
tbl.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,-1), DARK_BLUE),
('TOPPADDING', (0,0), (-1,-1), 8),
('BOTTOMPADDING',(0,0),(-1,-1), 8),
('LEFTPADDING', (0,0), (-1,-1), 10),
('RIGHTPADDING',(0,0), (-1,-1), 10),
('ROWBACKGROUNDS',(0,0),(-1,-1),[DARK_BLUE]),
]))
return tbl
def two_col_table(left_data, right_data, title_left="", title_right="",
hdr_color=MED_BLUE, row_color1=LIGHT_BLUE, row_color2=colors.white):
"""Side-by-side classification table."""
col_w = (W - 3.6*cm) / 2 - 3
rows = []
if title_left or title_right:
rows.append([Paragraph(title_left, s_table_hdr), Paragraph(title_right, s_table_hdr)])
max_rows = max(len(left_data), len(right_data))
for i in range(max_rows):
l = left_data[i] if i < len(left_data) else ""
r = right_data[i] if i < len(right_data) else ""
rows.append([Paragraph(str(l), s_table_cell), Paragraph(str(r), s_table_cell)])
tbl = Table(rows, colWidths=[col_w, col_w], repeatRows=1 if (title_left or title_right) else 0)
style_cmds = [
('GRID', (0,0),(-1,-1), 0.5, MID_GRAY),
('TOPPADDING',(0,0),(-1,-1), 4),
('BOTTOMPADDING',(0,0),(-1,-1), 4),
('LEFTPADDING',(0,0),(-1,-1), 5),
('RIGHTPADDING',(0,0),(-1,-1), 5),
('VALIGN', (0,0),(-1,-1), 'TOP'),
]
if title_left or title_right:
style_cmds += [
('BACKGROUND', (0,0),(-1,0), hdr_color),
('TEXTCOLOR', (0,0),(-1,0), colors.white),
]
for i in range(1, len(rows)):
bg = row_color1 if i % 2 == 1 else row_color2
style_cmds.append(('BACKGROUND', (0,i),(-1,i), bg))
else:
for i in range(len(rows)):
bg = row_color1 if i % 2 == 0 else row_color2
style_cmds.append(('BACKGROUND', (0,i),(-1,i), bg))
tbl.setStyle(TableStyle(style_cmds))
return tbl
def classification_table(headers, rows, col_widths=None, hdr_color=MED_BLUE):
"""Generic classification table with headers."""
full_w = W - 3.6*cm
if col_widths is None:
n = len(headers)
col_widths = [full_w / n] * n
table_data = [[Paragraph(h, s_table_hdr) for h in headers]]
for row in rows:
table_data.append([Paragraph(str(cell), s_table_cell) for cell in row])
tbl = Table(table_data, colWidths=col_widths, repeatRows=1)
style_cmds = [
('BACKGROUND', (0,0),(-1,0), hdr_color),
('GRID', (0,0),(-1,-1), 0.5, MID_GRAY),
('TOPPADDING',(0,0),(-1,-1), 4),
('BOTTOMPADDING',(0,0),(-1,-1), 4),
('LEFTPADDING',(0,0),(-1,-1), 5),
('RIGHTPADDING',(0,0),(-1,-1), 5),
('VALIGN', (0,0),(-1,-1), 'TOP'),
]
for i in range(1, len(table_data)):
bg = LIGHT_BLUE if i % 2 == 1 else colors.white
style_cmds.append(('BACKGROUND', (0,i),(-1,i), bg))
tbl.setStyle(TableStyle(style_cmds))
return tbl
def note_box(text, color=LIGHT_GOLD, border_color=ACCENT_GOLD):
data = [[Paragraph(text, ParagraphStyle("nb", parent=s_body,
fontSize=8.5, fontName="Helvetica-BoldOblique", textColor=colors.HexColor("#5A3E00")))]]
tbl = Table(data, colWidths=[W - 3.6*cm])
tbl.setStyle(TableStyle([
('BACKGROUND',(0,0),(-1,-1), color),
('BOX',(0,0),(-1,-1), 1.2, border_color),
('TOPPADDING',(0,0),(-1,-1), 5),
('BOTTOMPADDING',(0,0),(-1,-1), 5),
('LEFTPADDING',(0,0),(-1,-1), 8),
('RIGHTPADDING',(0,0),(-1,-1), 8),
]))
return tbl
def source_tag(text):
return Paragraph(f"<i>Source: {text}</i>", s_source)
def bullet_list(items, style=None):
st = style or s_body
out = []
for item in items:
out.append(Paragraph(f"• {item}", ParagraphStyle("bl", parent=st,
leftIndent=18, spaceAfter=2)))
return out
# ─── Build story ─────────────────────────────────────────────────────────────
story = []
# ═══════════════════════════════════════════════════════════════
# COVER PAGE
# ═══════════════════════════════════════════════════════════════
cover_bg = Table([[""]], colWidths=[W - 3.6*cm], rowHeights=[3.5*cm])
cover_bg.setStyle(TableStyle([
('BACKGROUND',(0,0),(-1,-1), DARK_BLUE),
]))
story.append(Spacer(1, 0.5*cm))
story.append(cover_bg)
cover_data = [[
Paragraph("MS UNIVERSITY GENERAL SURGERY", s_cover_title),
],[
Paragraph("Important Classifications for Examinations", s_cover_sub),
],[
Paragraph("Bailey & Love 28e | Sabiston | Schwartz 11e | Fischer's Mastery 8e", s_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), 10),
('BOTTOMPADDING',(0,0),(-1,-1), 12),
('LEFTPADDING',(0,0),(-1,-1), 12),
('RIGHTPADDING',(0,0),(-1,-1), 12),
]))
story.append(cover_tbl)
story.append(Spacer(1, 0.6*cm))
story.append(note_box("⚠ Exam-Oriented | University Level | Based on Standard Surgical Textbooks",
color=LIGHT_GOLD, border_color=ACCENT_GOLD))
story.append(Spacer(1, 0.3*cm))
# TOC
toc_items = [
"1. Wound Classification (Bailey / Sabiston)",
"2. Burns Classification (Schwartz / Bailey)",
"3. Hernia Classification (Bailey / Schwartz)",
"4. Thyroid / Goitre Classification (Bailey / Sabiston)",
"5. Breast Lumps & Cancer (Bailey / Sabiston)",
"6. Peritonitis Classification (Bailey)",
"7. Intestinal Obstruction (Bailey / Schwartz)",
"8. Haemorrhage & Shock (Bailey / Sabiston)",
"9. Jaundice Classification (Bailey / Schwartz)",
"10. Trauma Scoring - ISS, RTS, TRISS (Bailey / Schwartz)",
"11. Fracture Classification (Bailey)",
"12. Colorectal Cancer - Duke's / TNM (Sabiston / Schwartz)",
"13. Pancreatitis - Ranson / Atlanta / Balthazar (Bailey / Schwartz)",
"14. Gastric Ulcer - Johnson's Classification (Sabiston / Schwartz)",
"15. Appendicitis - Alvarado / MANTRELS Score (Bailey)",
"16. Portal Hypertension - Child-Pugh / MELD (Bailey / Sabiston)",
"17. Varicose Veins - CEAP Classification (Bailey)",
"18. DVT & PE - Wells Score (Bailey / Sabiston)",
"19. Anastomotic Leak - ISGLS Grade (Fischer)",
"20. Renal / Urological (Sabiston)",
]
story.append(Paragraph("TABLE OF CONTENTS", s_section))
story.append(HRFlowable(width=W-3.6*cm, thickness=1.5, color=MED_BLUE))
for item in toc_items:
story.append(Paragraph(f" {item}", s_body))
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════
# 1. WOUND CLASSIFICATION
# ═══════════════════════════════════════════════════════════════
story.append(chapter_block("1. WOUND CLASSIFICATION",
"CDC / NHSN Surgical Wound Classification | Bailey & Love 28e, Sabiston"))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("CDC Wound Classification (Surgical Site Infection Risk)", s_section))
story.append(classification_table(
["Class", "Category", "Description", "SSI Risk"],
[
["Class I", "Clean", "Elective, no GI/GU/respiratory tract entry, no inflammation, no break in technique", "1–3%"],
["Class II", "Clean-Contaminated", "GI/GU/respiratory tract entered under controlled conditions, minor break in technique", "5–8%"],
["Class III", "Contaminated", "Open traumatic wounds <4h, gross GI spillage, major break in technique, acute non-purulent inflammation", "15–20%"],
["Class IV", "Dirty-Infected", "Perforated viscera, pus encountered, traumatic wounds >4h, fecal contamination", "25–40%"],
],
col_widths=[1.5*cm, 3.5*cm, 9.5*cm, 2*cm]
))
story.append(source_tag("Bailey & Love 28e, Ch.3; Sabiston Ch.5"))
story.append(Spacer(1, 0.3*cm))
story.append(note_box("MNEMONIC: 'C Clean, CC Clean-Contaminated, C Contaminated, D Dirty' — SSI risk doubles each step!"))
story.append(Paragraph("Wound Healing Types", s_section))
story.append(classification_table(
["Type", "Definition", "Clinical Example"],
[
["Primary (1°) Intention", "Wound edges apposed at time of surgery; minimal scarring", "Clean surgical incision, simple lacerations"],
["Secondary (2°) Intention", "Wound left open; heals by granulation, contraction, re-epithelialization", "Infected wounds, pressure ulcers, pilonidal abscess"],
["Tertiary (3°) / Delayed Primary", "Wound initially left open then closed after 4–5 days when clean", "Contaminated traumatic wounds"],
],
col_widths=[4*cm, 7*cm, 5*cm]
))
story.append(source_tag("Bailey & Love 28e p.54 – Summary Box 3.2"))
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════
# 2. BURNS CLASSIFICATION
# ═══════════════════════════════════════════════════════════════
story.append(chapter_block("2. BURNS CLASSIFICATION",
"Depth, TBSA, Jackson's Zones | Schwartz 11e, Bailey & Love 28e"))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("2A. Burns Depth Classification (Dupuytren / Modified)", s_section))
story.append(classification_table(
["Degree", "Layer Involved", "Appearance", "Sensation", "Healing", "Treatment"],
[
["1st Degree\n(Superficial)", "Epidermis only", "Red, dry, no blisters", "Painful", "7–10 days; no scar", "Analgesics, cool water"],
["2nd Degree Superficial\nPartial Thickness", "Epidermis + superficial dermis", "Blisters, red, moist, weeping", "Very painful", "10–14 days; minimal scar", "Non-adherent dressings"],
["2nd Degree Deep\nPartial Thickness", "Epidermis + deep dermis (hair follicles spared)", "Pale/mottled, blisters, less wet", "Reduced (pressure only)", "21–35 days; significant scar", "Often requires grafting"],
["3rd Degree\n(Full Thickness)", "Epidermis + entire dermis", "Leathery, white/brown/black, waxy", "Painless (nerve destruction)", "No spontaneous healing", "Excision + skin graft"],
["4th Degree", "Deep to dermis → fat, muscle, bone", "Charred, black, eschar", "Painless", "No healing", "Amputation / flap"],
],
col_widths=[2.8*cm, 3*cm, 3*cm, 2.5*cm, 2.8*cm, 2.4*cm]
))
story.append(source_tag("Schwartz 11e – Burn Depth; Bailey & Love 28e Ch.27"))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("2B. Jackson's Three Zones of Burns", s_section))
story.append(classification_table(
["Zone", "Description", "Fate"],
[
["Zone of Coagulation (Central)", "Most severe; protein coagulation, irreversible necrosis", "Requires excision and grafting"],
["Zone of Stasis (Middle)", "Vascular stasis, reversible ischemia; can convert to necrosis", "Salvageable with resuscitation; target of burn care"],
["Zone of Hyperemia (Peripheral)", "Vasodilatation, inflammation; viable tissue", "Heals spontaneously within 7–10 days"],
],
col_widths=[4.5*cm, 7*cm, 5*cm]
))
story.append(source_tag("Schwartz 11e p.251; Jackson DM, 1953"))
story.append(Spacer(1, 0.3*cm))
story.append(note_box("KEY: Zone of Stasis is most clinically important — adequate resuscitation PREVENTS conversion to full-thickness!"))
story.append(Paragraph("2C. TBSA Estimation", s_section))
story.append(classification_table(
["Method", "Body Area", "TBSA %"],
[
["Rule of Nines (Adults)", "Head & Neck / Each Upper Limb / Chest (Anterior) / Abdomen (Anterior) / Each Thigh / Each Leg / Genitalia", "9% / 9% / 9% / 9% / 9% / 9% / 1%"],
["Lund & Browder", "More accurate; accounts for age variation in head (child head = 19% at birth)", "Preferred in children"],
["Palmar Method", "Patient's palm (including fingers) = 1% TBSA", "For scattered burns"],
],
col_widths=[4*cm, 9*cm, 3.5*cm]
))
story.append(source_tag("Bailey & Love 28e; Schwartz 11e p.253"))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("2D. Fluid Resuscitation Formulas", s_section))
story.append(classification_table(
["Formula", "Solution", "Volume", "Time"],
[
["Parkland (Most Common)", "Lactated Ringer's", "4 mL × kg × %TBSA", "Half in first 8h from injury; remainder over next 16h"],
["Modified Brooke", "Lactated Ringer's", "2 mL × kg × %TBSA", "Same as Parkland"],
["Muir & Barclay (UK)", "Colloid (plasma)", "0.5 × weight × %TBSA (per period)", "6 periods: 4+4+4+6+6+12h"],
["Colloid", "5% Albumin / FFP", "Added after 8–24h", "Maintains oncotic pressure"],
],
col_widths=[4*cm, 3.5*cm, 4*cm, 5*cm]
))
story.append(source_tag("Schwartz 11e; Bailey & Love 28e"))
story.append(note_box("MNEMONIC (Parkland): '4 mL kg %TBSA' — give HALF in FIRST 8h (from TIME OF BURN, not arrival!)"))
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════
# 3. HERNIA CLASSIFICATION
# ═══════════════════════════════════════════════════════════════
story.append(chapter_block("3. HERNIA CLASSIFICATION",
"Types, Nyhus, EHS, Gilbert | Bailey & Love 28e, Schwartz 11e"))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("3A. General Classification", s_section))
story.append(classification_table(
["Category", "Types", "Definition"],
[
["By Reducibility", "Reducible / Irreducible (Incarcerated) / Strangulated",
"Reducible: returns to cavity; Incarcerated: cannot be reduced; Strangulated: blood supply cut off → emergency"],
["By Contents", "Richter's / Maydl's (W hernia) / Littré's",
"Richter's: part of bowel wall only (no lumen obstruction); Maydl's: two loops in sac; Littré's: Meckel's diverticulum"],
["By Site", "Inguinal (direct/indirect) / Femoral / Umbilical / Incisional / Epigastric / Spigelian / Obturator",
"Inguinal most common (75%); Femoral more common in women; Incisional after surgery"],
["By Anatomy", "External / Internal",
"External: protrudes through abdominal wall; Internal: through internal opening (e.g. paraduodenal, foramen of Winslow)"],
],
col_widths=[3.5*cm, 6*cm, 7*cm]
))
story.append(source_tag("Bailey & Love 28e Ch.55; Schwartz 11e"))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("3B. Nyhus Classification (Inguinal Hernia)", s_section))
story.append(classification_table(
["Type", "Description", "Deep Ring", "Floor"],
[
["Type I", "Indirect; small / normal deep ring", "Normal", "Normal"],
["Type II", "Indirect; enlarged deep ring but intact floor", "Enlarged", "Intact"],
["Type IIIa", "Direct hernia", "Normal", "Deficient"],
["Type IIIb", "Indirect, large; pantaloon; scrotal", "Enlarged", "Deficient"],
["Type IIIc", "Femoral hernia", "Normal", "Femoral"],
["Type IV", "Recurrent hernia (a=direct, b=indirect, c=femoral, d=combo)", "Variable", "Deficient"],
],
col_widths=[2.5*cm, 8*cm, 3cm, 3cm]
))
story.append(source_tag("Nyhus LM – Bailey & Love 28e"))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("3C. Gilbert Classification (Inguinal Hernia) — EHS adopted", s_section))
story.append(classification_table(
["Type", "Description"],
[
["Type 1", "Indirect, snug internal ring; sac can be reduced"],
["Type 2", "Indirect, moderately enlarged internal ring (<4cm)"],
["Type 3", "Indirect, large internal ring (>4cm); displaced epigastric vessels"],
["Type 4", "Direct, entire floor defect"],
["Type 5", "Direct, diverticular defect of floor (small)"],
["Type 6", "Pantaloon (combined direct + indirect)"],
["Type 7", "Femoral hernia"],
],
col_widths=[2.5*cm, 14*cm]
))
story.append(source_tag("Gilbert AI – Schwartz 11e"))
story.append(note_box("KEY FACT: Indirect hernia (through deep inguinal ring) = most common overall and in children. Direct hernia = through Hesselbach's triangle = acquired, medial to epigastric vessels."))
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════
# 4. THYROID / GOITRE CLASSIFICATION
# ═══════════════════════════════════════════════════════════════
story.append(chapter_block("4. THYROID & GOITRE CLASSIFICATION",
"WHO, FNAC, Bethesda | Bailey & Love 28e, Sabiston, Schwartz 11e"))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("4A. WHO Classification of Goitre", s_section))
story.append(classification_table(
["Grade", "Clinical Description"],
[
["Grade 0", "No goitre palpable or visible"],
["Grade 1", "Goitre palpable but not visible with neck in normal position; moves with swallowing"],
["Grade 2", "Goitre palpable AND clearly visible with neck in normal position"],
],
col_widths=[2.5*cm, 14*cm]
))
story.append(source_tag("WHO/ICCIDD/UNICEF – Bailey & Love 28e Ch.49"))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("4B. Bethesda System for Thyroid FNAC (2023)", s_section))
story.append(classification_table(
["Category", "Diagnosis", "Malignancy Risk", "Management"],
[
["I", "Non-diagnostic / Unsatisfactory", "5–10%", "Repeat FNAC with ultrasound guidance"],
["II", "Benign", "0–3%", "Clinical follow-up"],
["III", "Atypia of Undetermined Significance (AUS/FLUS)", "6–18%", "Repeat FNAC / Molecular testing / Lobectomy"],
["IV", "Follicular Neoplasm / Suspicious for FN", "10–40%", "Diagnostic lobectomy"],
["V", "Suspicious for Malignancy", "45–60%", "Near-total thyroidectomy / Lobectomy"],
["VI", "Malignant", "94–96%", "Near-total thyroidectomy"],
],
col_widths=[1.5*cm, 4.5*cm, 2.5*cm, 8*cm]
))
story.append(source_tag("Bethesda System 3rd Ed. 2023 – Sabiston; Bailey & Love 28e"))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("4C. TNM Staging of Thyroid Cancer (AJCC 8th Ed.)", s_section))
story.append(classification_table(
["Histology", "Stage", "Criteria", "5-yr Survival"],
[
["Papillary / Follicular\n(<55 years)", "Stage I", "Any T, any N, M0", ">99%"],
["Papillary / Follicular\n(<55 years)", "Stage II", "Any T, any N, M1", "~98%"],
["Papillary / Follicular\n(≥55 years)", "Stage I", "T1-2, N0, M0", ">99%"],
["Papillary / Follicular\n(≥55 years)", "Stage II", "T1-2 N1 / T3a-b any N, M0", "~95%"],
["Papillary / Follicular\n(≥55 years)", "Stage III", "T4a, any N, M0", "~75%"],
["Papillary / Follicular\n(≥55 years)", "Stage IVA", "T4b, any N, M0", "~50%"],
["Papillary / Follicular\n(≥55 years)", "Stage IVB", "Any T, any N, M1", "~25%"],
["Medullary", "Stage I", "T1, N0, M0", ">90%"],
["Anaplastic", "All Stages IV", "T4 by definition at any N, M", "<5% at 5 yrs"],
],
col_widths=[3.5*cm, 2*cm, 7*cm, 4*cm]
))
story.append(source_tag("AJCC 8th Ed. – Schwartz 11e; Sabiston"))
story.append(note_box("MNEMONIC: 'Age <55 = only 2 stages for PTC/FTC' — KEY exam differentiator!"))
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════
# 5. BREAST CANCER CLASSIFICATION
# ═══════════════════════════════════════════════════════════════
story.append(chapter_block("5. BREAST CANCER CLASSIFICATION",
"TNM, Molecular Subtypes, Nottingham Grade | Bailey & Love, Sabiston, Schwartz"))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("5A. Molecular Subtypes of Breast Cancer", s_section))
story.append(classification_table(
["Subtype", "ER", "PR", "HER2", "Ki-67", "Prognosis", "Treatment"],
[
["Luminal A", "+", "+", "−", "Low (<20%)", "Best", "Hormone therapy alone"],
["Luminal B (HER2−)", "+", "+/−", "−", "High (≥20%)", "Intermediate", "Hormone + Chemo"],
["Luminal B (HER2+)", "+", "+/−", "+", "Any", "Intermediate", "Hormone + HER2 targeted + Chemo"],
["HER2-enriched", "−", "−", "+", "High", "Moderate", "HER2 targeted + Chemo"],
["Triple Negative (TNBC)", "−", "−", "−", "High", "Worst", "Chemotherapy ± immunotherapy"],
],
col_widths=[3*cm, 1.2*cm, 1.2*cm, 1.5*cm, 2.5*cm, 2.5*cm, 5.6*cm]
))
story.append(source_tag("St Gallen 2021; Sabiston; Schwartz 11e"))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("5B. Nottingham Histological Grade (Elston-Ellis Modified Bloom-Richardson)", s_section))
story.append(classification_table(
["Feature", "Score 1", "Score 2", "Score 3"],
[
["Tubule Formation", ">75% of tumour", "10–75%", "<10%"],
["Nuclear Pleomorphism", "Small, regular", "Moderate variation", "Marked variation"],
["Mitotic Count", "Varies by field size (low)", "Intermediate", "High"],
["TOTAL SCORE", "3–5 → Grade I (Well differentiated)", "6–7 → Grade II (Moderate)", "8–9 → Grade III (Poorly diff.)"],
],
col_widths=[5*cm, 4.5*cm, 4.5*cm, 2.5*cm]
))
story.append(source_tag("Elston CW, Ellis IO 1991 – Bailey & Love 28e"))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("5C. Breast Cancer TNM (AJCC 8th Ed.) – Key Stages", s_section))
story.append(classification_table(
["Stage", "T", "N", "M", "5-yr Survival"],
[
["Stage 0", "Tis", "N0", "M0", "~99% (DCIS)"],
["Stage I", "T1 (≤2cm)", "N0", "M0", "~99%"],
["Stage IIA", "T0/1 N1 OR T2 N0", "N0/1", "M0", "~93%"],
["Stage IIB", "T2 N1 OR T3 N0", "N1/0", "M0", "~75%"],
["Stage IIIA", "T0–3 N2 OR T3 N1–2", "N1–2", "M0", "~46%"],
["Stage IIIB", "T4, any N", "N0–2", "M0", "~46%"],
["Stage IIIC", "Any T, N3", "N3", "M0", "~46%"],
["Stage IV", "Any T", "Any N", "M1", "~27%"],
],
col_widths=[2.5*cm, 4.5*cm, 2cm, 1.5*cm, 3.5*cm]
))
story.append(source_tag("AJCC 8th Ed. – Schwartz 11e; Sabiston"))
story.append(note_box("KEY: T1 = ≤2cm | T2 = 2–5cm | T3 = >5cm | T4 = skin/chest wall. N1 = mobile axillary LN; N2 = fixed axillary; N3 = infra/supraclavicular or internal mammary"))
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════
# 6. PANCREATITIS CLASSIFICATIONS
# ═══════════════════════════════════════════════════════════════
story.append(chapter_block("6. PANCREATITIS CLASSIFICATIONS",
"Ranson, Atlanta 2012, Balthazar CT Index | Bailey & Love, Schwartz 11e"))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("6A. Ranson's Criteria", s_section))
story.append(two_col_table(
left_data=[
"AT ADMISSION:",
"1. Age >55 years",
"2. WBC >16,000/mm³",
"3. Blood glucose >200 mg/dL",
"4. Serum LDH >350 IU/L",
"5. AST >250 U/L",
"",
"GALLSTONE PANCREATITIS:",
"Age >70 | WBC >18,000",
"Glucose >220 | LDH >400 | AST >250",
],
right_data=[
"WITHIN 48 HOURS:",
"1. Haematocrit fall >10%",
"2. BUN rise >5 mg/dL",
"3. Serum Ca²⁺ <8 mg/dL",
"4. Arterial PO₂ <60 mmHg",
"5. Base deficit >4 mEq/L",
"6. Fluid sequestration >6L",
"",
"SCORE → MORTALITY:",
"0–2: <5% | 3–4: 15–20% | 5–6: 40% | 7–8: ~100%",
],
title_left="Non-Gallstone Pancreatitis",
title_right="48-hour Signs",
hdr_color=MED_BLUE
))
story.append(source_tag("Ranson JH 1974 – Bailey & Love 28e Ch.64; Schwartz 11e"))
story.append(Spacer(1, 0.3*cm))
story.append(note_box("MNEMONIC – GALAW (admission): Glucose, Age, LDH, AST, WBC | CHOBF (48h): Ca, Haematocrit, O₂, BUN/Base deficit, Fluid"))
story.append(Paragraph("6B. Revised Atlanta Classification 2012 (Acute Pancreatitis Severity)", s_section))
story.append(classification_table(
["Severity", "Definition", "Local Complications", "Organ Failure"],
[
["Mild", "No organ failure, no local/systemic complications", "None", "None"],
["Moderately Severe", "Transient organ failure (<48h) AND/OR local complications", "Peripancreatic fluid collection, necrosis", "Transient (<48h)"],
["Severe", "Persistent organ failure (>48h)", "Infected necrosis, pseudocyst", "Single/Multi-organ (>48h)"],
],
col_widths=[3*cm, 6*cm, 4.5*cm, 3*cm]
))
story.append(source_tag("Banks PA – Revised Atlanta Classification 2012; Bailey & Love 28e"))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("6C. Balthazar CT Severity Index (CTSI)", s_section))
story.append(classification_table(
["CT Grade", "Findings", "Score", "Necrosis", "Score"],
[
["A", "Normal pancreas", "0", "None", "0"],
["B", "Focal/diffuse enlargement", "1", "<30%", "2"],
["C", "Peripancreatic inflammation", "2", "30–50%", "4"],
["D", "Single extrapancreatic fluid collection", "3", ">50%", "6"],
["E", "Two or more extrapancreatic collections / gas", "4", "", ""],
],
col_widths=[2*cm, 6.5*cm, 1.5*cm, 3*cm, 1.5*cm]
))
story.append(Paragraph("CTSI = CT Grade Score + Necrosis Score (max 10). Score 7–10 → 17x higher complication rate, 8x higher mortality", s_body))
story.append(source_tag("Balthazar EJ – Schwartz 11e; Bailey & Love 28e"))
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════
# 7. INTESTINAL OBSTRUCTION & PERITONITIS
# ═══════════════════════════════════════════════════════════════
story.append(chapter_block("7. INTESTINAL OBSTRUCTION & PERITONITIS",
"Classification & Scoring | Bailey & Love, Schwartz 11e"))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("7A. Intestinal Obstruction Classification", s_section))
story.append(classification_table(
["Category", "Types", "Key Features"],
[
["By Mechanism", "Mechanical / Adynamic (Paralytic ileus) / Vascular",
"Mechanical: intraluminal, intramural, extramural; Adynamic: no mechanical obstruction; Vascular: ischaemic"],
["By Level", "Small bowel (SBO) / Large bowel (LBO)",
"SBO: central colicky pain, early vomiting, central distension; LBO: peripheral distension, late vomiting"],
["By Degree", "Simple (partial/complete) / Strangulated / Closed-loop",
"Strangulated = compromised vasculature (emergency); Closed-loop = both ends obstructed"],
["Aetiological (Adults)", "Adhesions (most common post-op) / Hernia / Malignancy / Volvulus / Intussusception / Gallstone ileus",
"Adhesions >50% of SBO; Hernia 2nd; LBO → colorectal cancer most common"],
],
col_widths=[3.5*cm, 5.5*cm, 7.5*cm]
))
story.append(source_tag("Bailey & Love 28e Ch.67; Schwartz 11e"))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("7B. Peritonitis Classification", s_section))
story.append(classification_table(
["Type", "Definition", "Common Causes"],
[
["Primary (Spontaneous)", "No intraabdominal source of infection; haematogenous spread", "SBP (Spontaneous Bacterial Peritonitis) in cirrhosis; TB peritonitis"],
["Secondary", "Peritonitis secondary to intraabdominal pathology", "Perforated peptic ulcer, appendicitis, diverticulitis, bowel infarction"],
["Tertiary", "Persistent/recurrent peritonitis after treatment of secondary peritonitis", "Often polymicrobial; immunocompromised host; fungal infection"],
["Quaternary / CAPD-associated", "In peritoneal dialysis patients", "Usually Staph epidermidis or gram-positive organisms"],
],
col_widths=[3.5*cm, 5.5*cm, 7.5*cm]
))
story.append(source_tag("Bailey & Love 28e; Schwartz 11e"))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("7C. Volvulus Classification", s_section))
story.append(classification_table(
["Type", "Most Common Site", "Presentation", "Treatment"],
[
["Sigmoid Volvulus (60–75%)", "Sigmoid colon (long mesentery)", "Elderly, constipated; massive distension; 'coffee bean' / 'bent inner tube' on X-ray", "Endoscopic decompression (1st line); Hartmann's/resection if gangrenous"],
["Caecal Volvulus (25–40%)", "Caecum + terminal ileum", "Younger; RIF pain; mobile caecum; 'kidney bean' right upper quadrant", "Surgical: right hemicolectomy / cecopexy"],
["Gastric Volvulus (rare)", "Stomach", "Borchardt's triad: epigastric pain, retching, inability to pass NGT", "Emergency laparotomy"],
],
col_widths=[3.5*cm, 3*cm, 5.5*cm, 4.5*cm]
))
story.append(source_tag("Bailey & Love 28e Ch.68; Schwartz 11e"))
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════
# 8. COLORECTAL CANCER
# ═══════════════════════════════════════════════════════════════
story.append(chapter_block("8. COLORECTAL CANCER STAGING",
"Duke's, Astler-Coller, TNM | Sabiston, Schwartz 11e, Fischer 8e"))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("8A. Duke's Classification", s_section))
story.append(classification_table(
["Stage", "Description", "5-yr Survival"],
[
["Duke's A", "Confined to bowel wall (mucosa/submucosa); NOT through muscularis propria", "≥90%"],
["Duke's B", "Through bowel wall into perirectal fat; NO lymph node involvement", "60–80%"],
["Duke's C1", "Apical LN not involved; other LN positive", "30–60%"],
["Duke's C2", "Apical LN involved", "~25%"],
["Duke's D (Turnbull)", "Distant metastasis (liver, lung)", "<5%"],
],
col_widths=[2.5*cm, 9.5*cm, 4.5*cm]
))
story.append(source_tag("Dukes CE 1932 – Sabiston; Schwartz 11e"))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("8B. Astler-Coller (Modified Duke's) Classification", s_section))
story.append(classification_table(
["Stage", "Description"],
[
["A", "Limited to mucosa"],
["B1", "Into but NOT through muscularis propria; N0"],
["B2", "Through muscularis propria; N0"],
["C1", "Into but NOT through muscularis; N+ (LN positive)"],
["C2", "Through muscularis propria; N+ (LN positive)"],
["D", "Distant metastasis"],
],
col_widths=[2.5*cm, 14*cm]
))
story.append(source_tag("Astler VB, Coller FA 1954 – Sabiston"))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("8C. TNM Staging (AJCC 8th Ed.) – Colorectal", s_section))
story.append(classification_table(
["TNM Stage", "T", "N", "M", "Approx. 5-yr Survival"],
[
["Stage I", "T1-2", "N0", "M0", "~90%"],
["Stage IIA", "T3", "N0", "M0", "~80%"],
["Stage IIB", "T4a", "N0", "M0", "~72%"],
["Stage IIC", "T4b", "N0", "M0", "~65%"],
["Stage IIIA","T1-2", "N1/N1c", "M0", "~83%"],
["Stage IIIB","T3-4a","N1/N2a", "M0", "~64%"],
["Stage IIIC","T4a-b","N2", "M0", "~44%"],
["Stage IVA", "Any T","Any N", "M1a (one organ)", "~14%"],
["Stage IVB", "Any T","Any N", "M1b (multiple organs)", "~5%"],
["Stage IVC", "Any T","Any N", "M1c (peritoneum)", "~3%"],
],
col_widths=[2.5*cm, 2.5*cm, 3*cm, 4*cm, 4.5*cm]
))
story.append(source_tag("AJCC 8th Ed. – Schwartz 11e; Fischer's Mastery 8e"))
story.append(note_box("KEY: T4a = perforates visceral peritoneum; T4b = invades adjacent organ. N1 = 1–3 nodes; N2 = 4+ nodes"))
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════
# 9. HAEMORRHAGE & SHOCK
# ═══════════════════════════════════════════════════════════════
story.append(chapter_block("9. HAEMORRHAGE & SHOCK CLASSIFICATION",
"ATLS Classes, Types of Shock | Bailey & Love, Sabiston, Schwartz"))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("9A. ATLS Classification of Haemorrhage (4 Classes)", s_section))
story.append(classification_table(
["Parameter", "Class I", "Class II", "Class III", "Class IV"],
[
["Blood loss (mL)", "<750", "750–1500", "1500–2000", ">2000"],
["Blood loss (%BV)", "<15%", "15–30%", "30–40%", ">40%"],
["Heart rate", "<100", "100–120", "120–140", ">140"],
["BP (systolic)", "Normal", "Normal", "Decreased", "Decreased"],
["Pulse pressure", "Normal/↑", "Decreased", "Decreased", "Decreased"],
["RR", "14–20", "20–30", "30–40", ">35"],
["Urine output (mL/h)","≥30", "20–30", "5–15", "Negligible"],
["GCS/Mental status", "Alert", "Anxious", "Confused", "Lethargic/Coma"],
["Fluid replacement", "Crystalloid","Crystalloid","Crystalloid+Blood","Blood + surgery"],
],
col_widths=[4*cm, 3*cm, 3*cm, 3*cm, 3.5*cm]
))
story.append(source_tag("ATLS 10th Ed. – Bailey & Love 28e Ch.22; Sabiston"))
story.append(Spacer(1, 0.3*cm))
story.append(note_box("MNEMONIC: Classes → '750, 1500, 2000, >2000' mL loss | Class III = requires blood transfusion"))
story.append(Paragraph("9B. Types of Shock", s_section))
story.append(classification_table(
["Type", "Mechanism", "CO", "SVR", "PCWP", "Examples"],
[
["Hypovolaemic", "↓ Preload due to fluid/blood loss", "↓", "↑", "↓", "Haemorrhage, burns, GI losses"],
["Distributive (Septic)", "Vasodilation → ↓ SVR (warm shock early)", "↑", "↓", "↓/N", "Sepsis, anaphylaxis, neurogenic, SIRS"],
["Cardiogenic", "↓ Cardiac output from pump failure", "↓", "↑", "↑", "MI, cardiac tamponade, severe heart failure"],
["Obstructive", "Mechanical obstruction to flow", "↓", "↑", "↑/↓", "Tension pneumothorax, massive PE, cardiac tamponade"],
["Neurogenic", "Loss of sympathetic tone → bradycardia + hypotension", "↓/N", "↓↓", "↓", "Spinal cord injury above T6"],
],
col_widths=[2.5*cm, 4.5*cm, 1.5*cm, 1.5*cm, 1.5*cm, 5*cm]
))
story.append(source_tag("Sabiston; Bailey & Love 28e; Schwartz 11e"))
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════
# 10. JAUNDICE CLASSIFICATION
# ═══════════════════════════════════════════════════════════════
story.append(chapter_block("10. JAUNDICE CLASSIFICATION",
"Pre-hepatic, Hepatic, Post-hepatic | Bailey & Love, Schwartz 11e"))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("10A. Pathophysiological Classification", s_section))
story.append(classification_table(
["Type", "Mechanism", "Bilirubin", "Urine", "Stool", "Causes"],
[
["Pre-hepatic\n(Haemolytic)", "Excess RBC destruction; hepatocyte unable to conjugate all bilirubin", "↑ Unconjugated", "No bilirubin; urobilinogen ↑", "Dark (excess stercobilin)", "Haemolytic anaemia, G6PD, spherocytosis, malaria, sickle cell"],
["Hepatic\n(Hepatocellular)", "Damaged hepatocytes unable to conjugate and excrete bilirubin", "Both ↑", "Bilirubin +; urobilinogen variable", "Pale-normal", "Hepatitis, cirrhosis, drugs, alcohol, Wilson's disease"],
["Post-hepatic\n(Obstructive)", "Bile duct obstruction → conjugated bilirubin regurgitates into blood", "↑ Conjugated", "Dark (bilirubinuria); urobilinogen absent", "Pale/clay coloured (acholuric)", "Choledocholithiasis, carcinoma head pancreas, cholangiocarcinoma, stricture"],
],
col_widths=[2.5*cm, 3.5*cm, 2.5*cm, 2.5*cm, 2.5*cm, 4*cm]
))
story.append(source_tag("Bailey & Love 28e Ch.65; Schwartz 11e"))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("10B. Choledocholithiasis / Biliary Obstruction – Charcot's Triad & Reynolds Pentad", s_section))
data = [
[Paragraph("Charcot's Triad (Cholangitis)", s_table_hdr), Paragraph("Reynolds Pentad (Severe Suppurative Cholangitis)", s_table_hdr)],
[Paragraph("1. Right upper quadrant pain\n2. Fever with rigors\n3. Jaundice", s_table_cell),
Paragraph("Charcot's Triad PLUS:\n4. Altered mental status (confusion)\n5. Hypotension / Septic shock", s_table_cell)],
]
tbl = Table(data, colWidths=[(W-3.6*cm)/2]*2)
tbl.setStyle(TableStyle([
('BACKGROUND',(0,0),(-1,0), MED_BLUE),
('BACKGROUND',(0,1),(0,1), LIGHT_BLUE),
('BACKGROUND',(1,1),(1,1), LIGHT_RED),
('GRID',(0,0),(-1,-1), 0.5, MID_GRAY),
('TOPPADDING',(0,0),(-1,-1), 6),
('BOTTOMPADDING',(0,0),(-1,-1), 6),
('LEFTPADDING',(0,0),(-1,-1), 8),
('VALIGN',(0,0),(-1,-1), 'TOP'),
]))
story.append(tbl)
story.append(source_tag("Bailey & Love 28e; Schwartz 11e"))
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════
# 11. PORTAL HYPERTENSION - CHILD-PUGH / MELD
# ═══════════════════════════════════════════════════════════════
story.append(chapter_block("11. PORTAL HYPERTENSION & LIVER FUNCTION SCORES",
"Child-Pugh, MELD | Bailey & Love, Sabiston, Schwartz"))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("11A. Child-Pugh Score", s_section))
story.append(classification_table(
["Parameter", "1 Point", "2 Points", "3 Points"],
[
["Encephalopathy", "None", "Grade 1–2", "Grade 3–4"],
["Ascites", "Absent", "Mild (controlled)", "Moderate–Severe (refractory)"],
["Bilirubin (μmol/L)", "<34", "34–51", ">51"],
["Albumin (g/L)", ">35", "28–35", "<28"],
["PT (prolonged, sec) / INR", "<4 sec / <1.7", "4–6 sec / 1.7–2.3", ">6 sec / >2.3"],
],
col_widths=[5*cm, 3.5*cm, 4*cm, 4*cm]
))
story.append(Paragraph("Grade A = 5–6 pts (2yr survival 85%) | Grade B = 7–9 pts (57%) | Grade C = 10–15 pts (35%)",
ParagraphStyle("cg", parent=s_body, fontName="Helvetica-Bold", textColor=DARK_BLUE)))
story.append(source_tag("Child CG, Turcotte JG 1964 – Bailey & Love 28e; Sabiston"))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("11B. MELD Score (Model for End-Stage Liver Disease)", s_section))
story.append(Paragraph(
"MELD = 3.78 × ln[Bilirubin (mg/dL)] + 11.2 × ln[INR] + 9.57 × ln[Creatinine (mg/dL)] + 6.43",
ParagraphStyle("formula", parent=s_body, fontName="Helvetica-Bold", textColor=GREEN,
fontSize=10, spaceBefore=4, spaceAfter=4)))
story.append(classification_table(
["MELD Score", "90-day Mortality", "Indication"],
[
["<10", "<10%", "Medical management; monitor"],
["10–19","~10–27%","Reconsider elective surgery; optimize"],
["20–29","~27–76%","High-risk surgery; transplant evaluation"],
["30–39","~76%", "Extreme risk; transplant priority"],
[">40", ">80%", "Near-prohibitive surgical risk"],
],
col_widths=[3*cm, 3.5*cm, 10*cm]
))
story.append(source_tag("Kamath PS 2001 – Schwartz 11e; Sabiston"))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("11C. Oesophageal Varices – Grading (Paquet)", s_section))
story.append(classification_table(
["Grade", "Endoscopic Appearance"],
[
["Grade I", "Small, straight, bluish discolorations barely raised above mucosa; empty on pressure with biopsy forceps"],
["Grade II", "Enlarged, tortuous, occupying ≤1/3 of oesophageal lumen"],
["Grade III","Large, occupying ≤2/3 of lumen; no red signs"],
["Grade IV", "Very large, occupying >2/3 of lumen; red signs present (red wale marks, cherry red spots)"],
],
col_widths=[2.5*cm, 14*cm]
))
story.append(source_tag("Paquet KJ – Bailey & Love 28e; Sabiston"))
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════
# 12. PEPTIC ULCER DISEASE
# ═══════════════════════════════════════════════════════════════
story.append(chapter_block("12. PEPTIC ULCER DISEASE CLASSIFICATIONS",
"Johnson's Gastric Ulcer Types, Forrest GI Bleed | Sabiston, Schwartz 11e"))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("12A. Johnson's Classification of Gastric Ulcers", s_section))
story.append(classification_table(
["Type", "Location", "Acid Secretion", "Association", "Surgery"],
[
["Type I", "Lesser curvature, incisura angularis", "Normal/Low", "No duodenal pathology", "Distal gastrectomy (Billroth I)"],
["Type II", "Body of stomach + concurrent duodenal ulcer", "High", "Associated with DU", "Vagotomy + antrectomy"],
["Type III", "Prepyloric (within 3cm of pylorus)", "High", "Behaves like DU", "Vagotomy + antrectomy"],
["Type IV", "High on lesser curvature near GEJ", "Normal/Low", "Near cardia; difficult surgery", "Pauchet / Csendes procedure"],
["Type V", "Any location; NSAID-induced", "Normal", "NSAID use", "Medical + stop NSAIDs"],
],
col_widths=[1.5*cm, 4*cm, 2.5*cm, 3.5*cm, 5*cm]
))
story.append(source_tag("Johnson HD 1965 – Sabiston; Schwartz 11e Ch.48"))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("12B. Forrest Classification (Upper GI Bleeding)", s_section))
story.append(classification_table(
["Class", "Endoscopic Finding", "Rebleed Risk", "Management"],
[
["Ia", "Active spurting haemorrhage", "80–90%", "Emergency endoscopic + surgical/interventional"],
["Ib", "Active oozing haemorrhage", "40–50%", "Endoscopic therapy"],
["IIa", "Non-bleeding visible vessel", "40–50%", "Endoscopic therapy + PPI"],
["IIb", "Adherent clot", "20–30%", "Targeted clot irrigation + PPI"],
["IIc", "Flat pigmented spot", "5–10%", "PPI; can discharge"],
["III", "Clean base / no stigmata", "<5%", "Discharge on oral PPI"],
],
col_widths=[1.5*cm, 5*cm, 2.5*cm, 7.5*cm]
))
story.append(source_tag("Forrest JA 1974 – Bailey & Love 28e; Schwartz 11e"))
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════
# 13. TRAUMA SCORING
# ═══════════════════════════════════════════════════════════════
story.append(chapter_block("13. TRAUMA SCORING SYSTEMS",
"ISS, RTS, TRISS, GCS, APACHE | Bailey & Love, Sabiston"))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("13A. Abbreviated Injury Scale (AIS) & Injury Severity Score (ISS)", s_section))
story.append(classification_table(
["AIS Score", "Severity", "ISS Calculation"],
[
["1", "Minor", "ISS = sum of squares of 3 highest AIS scores from 3 DIFFERENT body regions"],
["2", "Moderate", "Body regions: Head & Neck / Face / Chest / Abdomen / Extremities / External"],
["3", "Serious", "ISS range 1–75; AIS 6 in any region → ISS = 75 (maximum, not survivable)"],
["4", "Severe", "ISS >15 = Major Trauma | ISS >25 = Critical Trauma"],
["5", "Critical", "ISS correlates with mortality; used for triage and audit"],
["6", "Maximal (Unsurviable)", ""],
],
col_widths=[1.5*cm, 3*cm, 12*cm]
))
story.append(source_tag("Baker SP 1974 – Bailey & Love 28e; Sabiston"))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("13B. Revised Trauma Score (RTS)", s_section))
story.append(classification_table(
["Value", "GCS Score", "Systolic BP", "Respiratory Rate"],
[
["4", "13–15", "≥90", "10–29"],
["3", "9–12", "76–89", "≥30"],
["2", "6–8", "50–75", "6–9"],
["1", "4–5", "1–49", "1–5"],
["0", "3", "0", "0"],
],
col_widths=[2*cm, 3.5*cm, 3.5*cm, 4*cm]
))
story.append(Paragraph("RTS = 0.9368×GCS + 0.7326×SBP + 0.2908×RR (coded). Max score = 7.84. Used in triage (T-RTS: unweighted sum ≥12 = GREEN/Minor)", s_body))
story.append(source_tag("Champion HR 1989 – Bailey & Love 28e"))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("13C. Glasgow Coma Scale (GCS)", s_section))
story.append(classification_table(
["Response", "Score", "Description"],
[
["Eye Opening (E)", "4", "Spontaneous"],
["", "3", "To speech/command"],
["", "2", "To pain"],
["", "1", "None"],
["Verbal (V)", "5", "Oriented"],
["", "4", "Confused"],
["", "3", "Inappropriate words"],
["", "2", "Incomprehensible sounds"],
["", "1", "None"],
["Motor (M)", "6", "Obeys commands"],
["", "5", "Localises pain"],
["", "4", "Withdraws from pain"],
["", "3", "Abnormal flexion (Decorticate)"],
["", "2", "Extension (Decerebrate)"],
["", "1", "None"],
["TOTAL", "3–15", "Mild TBI: 13–15 | Moderate: 9–12 | Severe: ≤8 (Coma)"],
],
col_widths=[4*cm, 2*cm, 10.5*cm]
))
story.append(source_tag("Teasdale G, Jennett B 1974 – Bailey & Love 28e; Sabiston"))
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════
# 14. VARICOSE VEINS & DVT
# ═══════════════════════════════════════════════════════════════
story.append(chapter_block("14. VARICOSE VEINS, DVT & PE",
"CEAP, Wells Score | Bailey & Love 28e, Sabiston"))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("14A. CEAP Classification (Chronic Venous Disease)", s_section))
story.append(classification_table(
["C (Clinical)", "Description"],
[
["C0", "No visible or palpable signs of venous disease"],
["C1", "Telangiectasias or reticular veins (<3mm)"],
["C2", "Varicose veins (≥3mm)"],
["C3", "Oedema (without skin changes)"],
["C4a", "Pigmentation or eczema"],
["C4b", "Lipodermatosclerosis or atrophie blanche"],
["C4c", "Corona phlebectatica (revised CEAP 2020)"],
["C5", "Healed venous ulcer"],
["C6", "Active venous ulcer"],
],
col_widths=[2*cm, 14.5*cm]
))
story.append(Paragraph("E: Aetiology (Ec=Congenital, Ep=Primary, Es=Secondary, En=No venous cause) | A: Anatomy (As=Superficial, Ap=Perforating, Ad=Deep, An=No venous location) | P: Pathophysiology (Pr=Reflux, Po=Obstruction, Pr,o=Both)", s_body))
story.append(source_tag("CEAP Classification – Bailey & Love 28e Ch.54; Sabiston"))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("14B. Wells Score for DVT", s_section))
story.append(classification_table(
["Clinical Feature", "Score"],
[
["Active cancer (treatment within 6 months or palliative)", "+1"],
["Paralysis, paresis, or recent plaster immobilisation of legs", "+1"],
["Recently bedridden >3 days or major surgery within 12 weeks", "+1"],
["Localised tenderness along the deep venous system", "+1"],
["Entire leg swelling", "+1"],
["Calf swelling ≥3cm asymmetry", "+1"],
["Pitting oedema (greater in symptomatic leg)", "+1"],
["Collateral superficial veins (non-varicose)", "+1"],
["Previously documented DVT", "+1"],
["Alternative diagnosis at least as likely as DVT", "−2"],
["RISK: ≤0 = Low; 1–2 = Moderate; ≥3 = High", ""],
],
col_widths=[13*cm, 3.5*cm]
))
story.append(source_tag("Wells PS – Bailey & Love 28e; Sabiston"))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("14C. Wells Score for PE", s_section))
story.append(classification_table(
["Clinical Feature", "Score"],
[
["Clinical signs of DVT (leg swelling, pain on palpation)", "+3"],
["Heart rate >100 bpm", "+1.5"],
["Immobilisation ≥3 days or surgery in last 4 weeks", "+1.5"],
["Previous DVT or PE", "+1.5"],
["Haemoptysis", "+1"],
["Active malignancy (treatment in last 6 months or palliative)", "+1"],
["PE as likely OR more likely than alternative diagnosis", "+3"],
["SCORE: ≤4 = PE Unlikely (D-dimer first) | >4 = PE Likely (CT-PA)", ""],
],
col_widths=[13*cm, 3.5*cm]
))
story.append(source_tag("Wells PS 2000 – Sabiston; Bailey & Love 28e"))
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════
# 15. APPENDICITIS SCORES
# ═══════════════════════════════════════════════════════════════
story.append(chapter_block("15. APPENDICITIS – ALVARADO / AIR SCORE",
"Bailey & Love 28e, Schwartz 11e"))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("15A. Alvarado Score (MANTRELS)", s_section))
story.append(classification_table(
["Feature", "Score"],
[
["M – Migration of pain to RIF", "1"],
["A – Anorexia", "1"],
["N – Nausea / Vomiting", "1"],
["T – Tenderness in RIF", "2"],
["R – Rebound tenderness (RIF)", "1"],
["E – Elevated temperature (>37.3°C)", "1"],
["L – Leucocytosis (WBC >10,000/mm³)", "2"],
["S – Shift of WBC to left (>75% neutrophils)", "1"],
["TOTAL = 10 | Score 1–4: Low (unlikely) | 5–6: Equivocal (imaging) | 7–8: High (likely) | 9–10: Very high (surgery)", ""],
],
col_widths=[11*cm, 3.5*cm]
))
story.append(source_tag("Alvarado A 1986 – Bailey & Love 28e Ch.66"))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("15B. AIR Score (Appendicitis Inflammatory Response)", s_section))
story.append(classification_table(
["Variable", "Finding", "Points"],
[
["Vomiting", "Yes", "1"],
["Pain in RIF", "Yes", "1"],
["Rebound / muscular guarding", "Light / Medium / Strong", "1 / 2 / 3"],
["Temp (°C)", "38.5–38.9 / ≥39.0", "1 / 2"],
["WBC (×10⁹/L)", "10–14.9 / ≥15", "1 / 2"],
["CRP (mg/L)", "10–49 / ≥50", "1 / 2"],
["TOTAL (max 12): 0–4 = Low risk | 5–8 = Indeterminate | 9–12 = High risk (operate)", "",""],
],
col_widths=[4.5*cm, 6*cm, 6*cm]
))
story.append(source_tag("Scott AJ 2015 – Bailey & Love 28e; Schwartz 11e"))
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════
# 16. FRACTURES & ORTHOPAEDIC
# ═══════════════════════════════════════════════════════════════
story.append(chapter_block("16. FRACTURE & PELVIC INJURY CLASSIFICATIONS",
"Gustilo-Anderson, Tile (Pelvic), Garden (NOF) | Bailey & Love 28e"))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("16A. Gustilo-Anderson Open Fracture Classification", s_section))
story.append(classification_table(
["Grade", "Wound", "Energy", "Contamination", "Bone Injury"],
[
["I", "<1cm", "Low", "Minimal", "Simple transverse/oblique, minimal comminution"],
["II", ">1cm", "Moderate", "Moderate", "Moderate comminution"],
["IIIA", ">10cm", "High", "Heavy", "Adequate soft tissue coverage despite extensive laceration"],
["IIIB", ">10cm", "High", "Heavy", "Extensive periosteal stripping, requires soft tissue coverage (flap)"],
["IIIC", "Any", "High", "Heavy", "Arterial injury requiring repair"],
],
col_widths=[1.5*cm, 2*cm, 2*cm, 2.5*cm, 8.5*cm]
))
story.append(source_tag("Gustilo RB 1976 – Bailey & Love 28e Ch.27"))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("16B. Garden Classification (Femoral Neck Fractures)", s_section))
story.append(classification_table(
["Stage", "Description", "Displacement", "AVN Risk"],
[
["Garden I", "Incomplete fracture (impacted, valgus)", "None/partial", "~10%"],
["Garden II", "Complete fracture; NO displacement", "None", "~20%"],
["Garden III", "Complete fracture; partial displacement (trabeculae misaligned)", "Partial", "~40%"],
["Garden IV", "Complete fracture; full displacement (no contact)", "Complete", "~60%"],
],
col_widths=[2.5*cm, 5*cm, 3*cm, 2.5*cm]
))
story.append(Paragraph("Garden I + II = Undisplaced (treat with cannulated screws) | Garden III + IV = Displaced (treat with hemiarthroplasty in elderly; THA in active patients)",
ParagraphStyle("gd", parent=s_body, fontName="Helvetica-Bold", textColor=DARK_BLUE)))
story.append(source_tag("Garden RS 1964 – Bailey & Love 28e"))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("16C. Tile Classification (Pelvic Ring Fractures)", s_section))
story.append(classification_table(
["Type", "Stability", "Mechanism", "Description"],
[
["Type A", "Stable", "Lateral compression", "Posterior sacroiliac ligaments intact; most common"],
["Type B", "Partially stable (rotationally unstable)", "AP compression or lateral compression", "'Open book' fracture; SIL partially disrupted; vertical stable"],
["Type C", "Completely unstable (rotation + vertical)", "Vertical shear / combined", "Posterior complex completely disrupted; vertical + rotational instability"],
],
col_widths=[1.8*cm, 3.5*cm, 4*cm, 7.2*cm]
))
story.append(source_tag("Tile M 1984 – Bailey & Love 28e Ch.29"))
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════
# 17. RENAL & BLADDER
# ═══════════════════════════════════════════════════════════════
story.append(chapter_block("17. RENAL & UROLOGICAL CLASSIFICATIONS",
"Renal Stones, AKI, Bladder Cancer | Sabiston, Fischer 8e"))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("17A. KDIGO Acute Kidney Injury (AKI) Staging", s_section))
story.append(classification_table(
["Stage", "Serum Creatinine Criteria", "Urine Output Criteria"],
[
["1", "×1.5–1.9 baseline OR rise ≥0.3 mg/dL within 48h", "<0.5 mL/kg/h for 6–12h"],
["2", "×2.0–2.9 baseline", "<0.5 mL/kg/h for ≥12h"],
["3", "×3.0 baseline OR ≥4.0 mg/dL OR RRT initiated", "<0.3 mL/kg/h for ≥24h OR anuria ≥12h"],
],
col_widths=[1.5*cm, 8*cm, 7*cm]
))
story.append(source_tag("KDIGO 2012 – Sabiston; Fischer 8e"))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("17B. Bladder Cancer – TNM Staging", s_section))
story.append(classification_table(
["Stage", "Description", "Treatment"],
[
["Ta", "Non-invasive papillary carcinoma", "TURBT ± intravesical BCG"],
["Tis", "Carcinoma in situ (flat)", "TURBT + intravesical BCG"],
["T1", "Invades lamina propria (non-muscle-invasive)", "TURBT + intravesical BCG"],
["T2a", "Superficial muscle invasion", "Radical cystectomy"],
["T2b", "Deep muscle invasion", "Radical cystectomy"],
["T3a", "Microscopic perivesical involvement", "Radical cystectomy + neoadjuvant chemo"],
["T3b", "Macroscopic perivesical involvement", "Radical cystectomy + neoadjuvant chemo"],
["T4a", "Invades prostate, uterus, vagina", "Cystectomy / palliative chemo"],
["T4b", "Invades pelvic wall, abdominal wall", "Palliative chemo"],
],
col_widths=[1.5*cm, 6.5*cm, 8.5*cm]
))
story.append(source_tag("AJCC – Sabiston; Fischer 8e"))
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════
# 18. MISCELLANEOUS IMPORTANT CLASSIFICATIONS
# ═══════════════════════════════════════════════════════════════
story.append(chapter_block("18. MISCELLANEOUS IMPORTANT CLASSIFICATIONS",
"ASA, Killip, Hinchey, POSSUM | Bailey & Love, Schwartz, Sabiston"))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("18A. ASA Physical Status Classification", s_section))
story.append(classification_table(
["ASA", "Description", "Examples", "Mortality Risk"],
[
["I", "Normal healthy patient", "No comorbidities; non-smoker", "<0.1%"],
["II", "Mild systemic disease", "Controlled DM, mild HTN, mild asthma, smoker", "0.2%"],
["III", "Severe systemic disease", "Poorly controlled DM, COPD, morbid obesity, active hepatitis", "1.8%"],
["IV", "Life-threatening systemic disease", "Recent MI (<3mo), CVA, severe valvular disease, sepsis", "7.8%"],
["V", "Moribund (not expected to survive without surgery)", "Ruptured AAA, massive trauma, intracranial bleed with herniation", "9.4%"],
["VI", "Brain-dead (organ donation)", "—", "—"],
["E (Emergency)", "Add 'E' for any emergency surgery", "E.g., ASAIIIE", "~Doubled"],
],
col_widths=[1.5*cm, 4.5*cm, 5.5*cm, 2.5*cm]
))
story.append(source_tag("ASA 2020 – Schwartz 11e; Bailey & Love 28e"))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("18B. Hinchey Classification (Perforated Diverticular Disease)", s_section))
story.append(classification_table(
["Stage", "Description", "Treatment"],
[
["I", "Small pericolic/mesenteric abscess", "IV antibiotics ± percutaneous drainage"],
["II", "Large pelvic/retroperitoneal abscess", "Percutaneous drainage + antibiotics"],
["III", "Generalised purulent peritonitis (no perforation)", "Hartmann's procedure OR laparoscopic lavage"],
["IV", "Generalised faecal peritonitis (free perforation)", "Hartmann's + end-colostomy (surgery mandatory)"],
],
col_widths=[1.5*cm, 6.5*cm, 8.5*cm]
))
story.append(source_tag("Hinchey EJ 1978 – Bailey & Love 28e Ch.69"))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("18C. Killip Classification (Cardiogenic Complications of MI)", s_section))
story.append(classification_table(
["Class", "Clinical Features", "30-day Mortality"],
[
["I", "No clinical signs of heart failure; clear lungs", "~6%"],
["II", "S3 gallop and/or basal crepitations, mild pulmonary congestion", "~17%"],
["III", "Acute pulmonary oedema; marked crepitations >50% lung fields", "~38%"],
["IV", "Cardiogenic shock (hypotension + evidence of vasoconstriction)", "~67%"],
],
col_widths=[1.5*cm, 7*cm, 3cm]
))
story.append(source_tag("Killip T, Kimball JT 1967 – Sabiston"))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("18D. Modified Rankin Scale (Neurological Outcome post-Stroke / post-Surgery)", s_section))
story.append(classification_table(
["Score", "Description"],
[
["0", "No symptoms"],
["1", "No significant disability; able to carry out usual activities"],
["2", "Slight disability; unable to carry out all previous activities but independent"],
["3", "Moderate disability; requires some help but able to walk without assistance"],
["4", "Moderately severe disability; unable to walk or attend to own body needs"],
["5", "Severe disability; bedridden, incontinent, requires constant nursing care"],
["6", "Dead"],
],
col_widths=[1.5*cm, 15*cm]
))
story.append(source_tag("Rankin J 1957 – Modified version 1988 – Sabiston; Bailey & Love"))
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════
# 19. ADDITIONAL KEY CLASSIFICATIONS
# ═══════════════════════════════════════════════════════════════
story.append(chapter_block("19. ADDITIONAL KEY CLASSIFICATIONS",
"Neck Lump (Skandalakis), Spleen, Bowel Ischaemia | Multiple Sources"))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("19A. Skandalakis Classification of Neck Lumps (by Position)", s_section))
story.append(classification_table(
["Triangle", "Common Differential Diagnosis"],
[
["Midline", "Thyroid / thyroglossal cyst / dermoid / Ludwig's angina / submental LN"],
["Anterior", "Submandibular gland / salivary stone / LN / carotid body tumour / branchial cyst"],
["Posterior", "LN (TB, lymphoma, metastasis) / lipoma / cystic hygroma"],
["Supraclavicular", "DANGER ZONE – always suspect malignancy (Virchow's node from abdominal Ca)"],
],
col_widths=[4*cm, 12.5*cm]
))
story.append(source_tag("Bailey & Love 28e Ch.45"))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("19B. Splenic Injury Scale (AAST)", s_section))
story.append(classification_table(
["Grade", "Description", "Management"],
[
["I", "Haematoma <10% surface; laceration <1cm depth; capsular tear", "Observation in stable patient"],
["II", "Haematoma 10–50%; laceration 1–3cm; no trabecular vessel injury", "NOM in stable patient"],
["III", "Haematoma >50% / expanding; laceration >3cm; trabecular vessel involved", "NOM with angiography; low threshold for surgery"],
["IV", "Laceration involving segmental/hilar vessels; devascularisation >25%", "Angioembolisation or surgery"],
["V", "Shattered spleen; hilar vascular injury devascularising spleen", "Emergency splenectomy"],
],
col_widths=[1.5*cm, 7*cm, 8*cm]
))
story.append(source_tag("AAST Organ Injury Scale – Schwartz 11e; Sabiston"))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("19C. Lahey's Criteria (Paediatric Intussusception – Contraindications to Pneumatic Reduction)", s_section))
story.append(Paragraph("Pneumatic/hydrostatic enema reduction CONTRAINDICATED when:", s_subsection))
for item in [
"Peritonitis (localised or generalised)",
"Signs of bowel perforation",
"Hypovolaemic shock unresponsive to resuscitation",
"Free peritoneal gas on plain X-ray",
"Recurrent intussusception (relative)",
]:
story.append(Paragraph(f"• {item}", ParagraphStyle("bt", parent=s_body, leftIndent=18)))
story.append(source_tag("Bailey & Love 28e"))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("19D. Ramsay Sedation Scale (ICU / Post-operative)", s_section))
story.append(classification_table(
["Score", "Description"],
[
["1", "Patient awake, anxious, agitated or restless"],
["2", "Patient awake, cooperative, oriented, tranquil"],
["3", "Patient drowsy, responds to commands only"],
["4", "Patient asleep; brisk response to light glabellar tap"],
["5", "Patient asleep; sluggish response to glabellar tap"],
["6", "No response"],
],
col_widths=[1.5*cm, 15*cm]
))
story.append(source_tag("Ramsay MA 1974 – Fischer's Mastery of Surgery 8e"))
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════
# 20. QUICK REFERENCE SUMMARY
# ═══════════════════════════════════════════════════════════════
story.append(chapter_block("20. QUICK REFERENCE – EXAM-ORIENTED SUMMARY",
"High-Yield Review Points"))
story.append(Spacer(1, 0.3*cm))
quick_data = [
["Topic", "Most Tested Fact"],
["Wound Class", "Class I (Clean) = <1–3% SSI; Class IV (Dirty) = 25–40%"],
["Burn Fluid", "Parkland: 4mL × kg × %TBSA; HALF in first 8h from time of burn"],
["Jackson Burns", "Zone of Stasis = most important; can be salvaged with resuscitation"],
["Ranson's", "GALAW at admission + CHOBF at 48h; ≥5 = high mortality"],
["Forrest IIa", "Visible vessel = 40–50% rebleed; requires endoscopic therapy"],
["Duke's B", "Through bowel wall; NO nodes; 60–80% 5yr survival"],
["Duke's C2", "Apical node +; ~25% 5yr survival"],
["Bethesda IV", "Follicular neoplasm – needs diagnostic lobectomy"],
["Child-Pugh C", "Score 10–15; 35% 2yr survival; not for elective major surgery"],
["MELD >20", "High risk surgery; evaluate for transplant"],
["ATLS Class III", "≥30% blood volume loss; NEEDS blood transfusion"],
["Wells DVT ≥3", "High probability; proceed to ultrasound/anticoagulation"],
["Wells PE >4", "PE likely; proceed to CT pulmonary angiography"],
["Hinchey IV", "Faecal peritonitis; mandatory laparotomy; Hartmann's procedure"],
["Garden III/IV", "Displaced NOF → hemiarthroplasty (elderly); THA (active)"],
["Alvarado ≥7", "High probability appendicitis; consider surgery or imaging"],
["Gustilo IIIC", "Arterial injury + open fracture; highest amputation risk"],
["CEAP C6", "Active venous ulcer; highest grade"],
["ASA ≥IV", "Life-threatening disease; highest peri-operative risk"],
["Killip IV", "Cardiogenic shock; 67% 30-day mortality"],
["Balthazar CTSI ≥7", "Pancreatitis: 17× higher complication rate"],
["Thyroid <55yrs", "AJCC 8: PTC/FTC only Stage I (M0) and Stage II (M1)"],
["Triple Negative BC", "ER− PR− HER2−; worst prognosis; chemo only"],
["Richter's Hernia", "Only antimesenteric wall in sac; NO obstruction; may strangulate without obstruction"],
["Nyhus IV", "Recurrent hernia; needs posterior repair (Shouldice/TEP/TAPP)"],
["SBP (Primary Peritonitis)", "PMN >250/mm³ in ascitic fluid; treat with cefotaxime/ceftriaxone"],
["Volvulus X-ray", "Sigmoid = 'Coffee bean'; Caecal = 'Kidney bean' (right upper quadrant)"],
["Forrest III", "Clean base; <5% rebleed; can discharge on oral PPI"],
["ISS >25", "Critical trauma; activates massive transfusion protocol"],
]
tbl = Table(quick_data, colWidths=[5.5*cm, 11*cm], repeatRows=1)
tbl.setStyle(TableStyle([
('BACKGROUND',(0,0),(-1,0), DARK_BLUE),
('TEXTCOLOR',(0,0),(-1,0), colors.white),
('FONTNAME',(0,0),(-1,0), 'Helvetica-Bold'),
('FONTSIZE',(0,0),(-1,0), 9),
('GRID',(0,0),(-1,-1), 0.5, MID_GRAY),
('FONTSIZE',(0,1),(-1,-1), 8.5),
('TOPPADDING',(0,0),(-1,-1), 4),
('BOTTOMPADDING',(0,0),(-1,-1), 4),
('LEFTPADDING',(0,0),(-1,-1), 5),
('VALIGN',(0,0),(-1,-1), 'TOP'),
] + [('BACKGROUND',(0,i),(-1,i), LIGHT_BLUE if i%2==1 else colors.white) for i in range(1, len(quick_data))]))
story.append(tbl)
story.append(Spacer(1, 0.5*cm))
# Footer
story.append(HRFlowable(width=W-3.6*cm, thickness=1, color=MED_BLUE))
story.append(Paragraph(
"Compiled from: Bailey & Love's Short Practice of Surgery 28e | Sabiston Textbook of Surgery | "
"Schwartz's Principles of Surgery 11e | Fischer's Mastery of Surgery 8e | "
"AJCC Cancer Staging Manual 8e | ATLS 10th Edition",
ParagraphStyle("footer", parent=s_body, fontSize=7.5, textColor=colors.HexColor("#666666"),
alignment=TA_CENTER)
))
# ─── Build PDF ──────────────────────────────────────────────────────────────
def on_page(canvas_obj, doc_obj):
canvas_obj.saveState()
canvas_obj.setFont("Helvetica", 7.5)
canvas_obj.setFillColor(colors.HexColor("#666666"))
canvas_obj.drawString(1.8*cm, 1.2*cm, "MS University General Surgery – Important Classifications")
canvas_obj.drawRightString(W - 1.8*cm, 1.2*cm, f"Page {doc_obj.page}")
canvas_obj.restoreState()
print("Building PDF...")
doc.build(story, onFirstPage=on_page, onLaterPages=on_page)
print(f"PDF generated: {OUTPUT}")
print(f"File size: {os.path.getsize(OUTPUT)/1024:.1f} KB")
cd /home/daytona/workspace/surgery-classifications && python3 generate_pdf.py 2>&1
~/surgery-classifications/generate_pdf.py
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/surgery-classifications/generate_pdf.py'
cd /home/daytona/workspace/surgery-classifications && python3 generate_pdf.py 2>&1
grep -n "[0-9]cm[,\]]" /home/daytona/workspace/surgery-classifications/generate_pdf.py | head -30
python3 -c " import re with open('/home/daytona/workspace/surgery-classifications/generate_pdf.py', 'r') as f: content = f.read() # Fix patterns like '2cm' not preceded by '*' -> '2*cm' fixed = re.sub(r'(\d)cm', r'\1*cm', content) with open('/home/daytona/workspace/surgery-classifications/generate_pdf.py', 'w') as f: f.write(fixed) print('Fixed all cm references') # verify no syntax errors import ast try: ast.parse(fixed) print('Syntax OK') except SyntaxError as e: print(f'Syntax error: {e}') "
cd /home/daytona/workspace/surgery-classifications && python3 generate_pdf.py 2>&1
~/surgery-classifications/generate_pdf.py
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/surgery-classifications/generate_pdf.py'
cd /home/daytona/workspace/surgery-classifications && python3 generate_pdf.py 2>&1
MS Surgery Classifications
PDF Document · PDF
| # | Topic | Source |
|---|---|---|
| 1 | Wound Classification - CDC 4 classes + Healing types | Bailey, Sabiston |
| 2 | Burns - Depth (1°–4°), Jackson's 3 Zones, Rule of Nines, Parkland/Brooke formulas | Schwartz, Bailey |
| 3 | Hernia - Nyhus, Gilbert/EHS, Direct vs Indirect | Bailey, Schwartz |
| 4 | Thyroid / Goitre - WHO grades, Bethesda FNAC 2023, AJCC TNM | Bailey, Sabiston |
| 5 | Breast Cancer - Molecular subtypes, Nottingham Grade, AJCC TNM | Schwartz, Sabiston |
| 6 | Pancreatitis - Ranson's (GALAW+CHOBF), Atlanta 2012, Balthazar CTSI | Bailey, Schwartz |
| 7 | Obstruction & Peritonitis - Types, Volvulus (Sigmoid vs Caecal) | Bailey, Schwartz |
| 8 | Colorectal Cancer - Duke's, Astler-Coller, AJCC TNM | Sabiston, Fischer |
| 9 | Haemorrhage & Shock - ATLS 4 Classes, Types of Shock table | Bailey, Sabiston |
| 10 | Jaundice - Pre/hepatic/post, Charcot's Triad, Reynolds Pentad | Bailey, Schwartz |
| 11 | Portal HTN - Child-Pugh, MELD, Oesophageal Varices grading | Bailey, Sabiston |
| 12 | Peptic Ulcer - Johnson's Gastric Ulcer Types I–V, Forrest GI Bleed | Sabiston, Schwartz |
| 13 | Trauma Scoring - ISS/AIS, RTS, GCS full scale | Bailey, Sabiston |
| 14 | Varicose Veins/DVT - CEAP, Wells DVT, Wells PE scores | Bailey, Sabiston |
| 15 | Appendicitis - Alvarado (MANTRELS), AIR Score | Bailey, Schwartz |
| 16 | Fractures - Gustilo-Anderson open, Garden NOF, Tile Pelvis | Bailey |
| 17 | Renal/Bladder - KDIGO AKI, Bladder Ca TNM | Sabiston, Fischer |
| 18 | Misc - ASA, Hinchey (Diverticulitis), Killip (MI), Modified Rankin | All sources |
| 19 | Additional - Neck lumps, AAST Spleen, Intussusception, Ramsay Sedation | Bailey, Fischer |
| 20 | Quick Reference Table - 30 most-tested exam points | Summary |
MASTER LIST OF IMPORTANT CLASSIFICATIONS, SCORES, STAGING & PROTOCOLS (MS General Surgery University + NEET SS) 1. GENERAL SURGERY • Wound Classification (CDC) • Types of Wound Healing • Surgical Site Infection (CDC) • Clavien–Dindo Classification • Southampton Wound Grading • ASA Physical Status Classification • Ramsay Sedation Score • WHO Surgical Safety Checklist • Damage Control Surgery • ERAS Protocol • SIRS Criteria • qSOFA Score • SOFA Score • APACHE II Score • Charlson Comorbidity Index • ECOG Performance Status • Karnofsky Performance Scale 2. BURNS • Burn Depth (1st–4th Degree) • Jackson's Zones of Burn • Rule of Nines • Lund & Browder Chart • Parkland Formula • Modified Brooke Formula • ABSI Score • Baux Score • Burn Centre Referral Criteria 3. TRAUMA • ATLS Primary Survey • Glasgow Coma Scale (GCS) • Injury Severity Score (ISS) • Revised Trauma Score (RTS) • TRISS • Mangled Extremity Severity Score (MESS) • AAST Organ Injury Scale - Liver - Spleen - Kidney • FAST/eFAST • Denver Criteria (BCVI) 4. HERNIA • Nyhus Classification • Gilbert Classification • EHS Classification • Ventral Hernia Working Group Classification • Amyand Hernia • Littre Hernia • Richter Hernia 5. BREAST • BI-RADS • Nottingham Prognostic Index (NPI) • Bloom–Richardson Grade • Elston–Ellis Modification • Nottingham Histological Grade • TNM – Breast Carcinoma 6. THYROID • Bethesda System • TIRADS • ATA Risk Stratification • ATA Recurrence Risk • TNM – Thyroid Carcinoma 7. ESOPHAGUS • Los Angeles Classification • Prague Classification • Zargar Classification • Siewert Classification • TNM – Esophageal Carcinoma 8. STOMACH • Johnson Classification • Forrest Classification • Modified Johnson Classification • TNM – Gastric Carcinoma 9. SMALL INTESTINE • Peritoneal Cancer Index (PCI) • Short Bowel Syndrome Classification 10. APPENDIX • Alvarado Score • AIR Score • Appendicitis Severity Grade 11. COLORECTAL • Dukes Classification • Astler–Coller Classification • Hinchey Classification • Goligher Classification • Parks Classification • Goodsall's Rule • TNM – Colorectal Carcinoma 12. HEPATOBILIARY • Child–Pugh Score • MELD Score • Tokyo Guidelines • Strasberg Classification • Bismuth–Corlette Classification • Mirizzi Classification • Nagakawa Classification • TNM – Hepatocellular Carcinoma • TNM – Gallbladder Carcinoma • TNM – Cholangiocarcinoma 13. PANCREAS • Revised Atlanta Classification • Ranson Criteria • BISAP Score • Modified CT Severity Index (CTSI) • Balthazar CT Severity Index • TNM – Pancreatic Carcinoma 14. SPLEEN • AAST Splenic Injury Scale 15. VASCULAR SURGERY • CEAP Classification • Venous Clinical Severity Score (VCSS) • Rutherford Classification • Fontaine Classification • WiFi Classification • Wells Score (DVT) • Wells Score (PE) • Villalta Score 16. UROLOGY • Bosniak Classification • RENAL Nephrometry Score • Fuhrman Grade • WHO/ISUP Grade • TNM – Renal Cell Carcinoma • TNM – Urinary Bladder Carcinoma • TNM – Penile Carcinoma • TNM – Testicular Tumour 17. PERITONITIS & SEPSIS • Mannheim Peritonitis Index • Boey Score • qSOFA • SOFA • APACHE II 18. SHOCK • ATLS Hemorrhagic Shock Classification • Modified Shock Index 19. ANASTOMOSIS • ISGLS Anastomotic Leak Classification • ISGPS Pancreatic Fistula Classification • Clavien–Dindo Classification 20. FRACTURES • Gustilo–Anderson Classification • AO Classification • Garden Classification • Neer Classification • Salter–Harris Classification 21. SOFT TISSUE TUMOURS • Enneking Classification • FNCLCC Grading • TNM – Soft Tissue Sarcoma 22. SKIN • Clark Levels • Breslow Thickness • TNM – Melanoma 23. ONCOLOGY • TNM Staging Principles • AJCC Stage Grouping • ECOG Performance Status • Karnofsky Performance Scale • RECIST Criteria 24. NUTRITION • MUST Score • NRS-2002 • Subjective Global Assessment (SGA) 25. ICU & PERIOPERATIVE CARE • ASA Physical Status Classification • Ramsay Sedation Score • Richmond Agitation Sedation Scale (RASS) • Modified Aldrete Score As single PDF
MASTER LIST OF IMPORTANT CLASSIFICATIONS, SCORES, STAGING & PROTOCOLS (MS General Surgery University + NEET SS) 1. GENERAL SURGERY • Wound Classification (CDC) • Types of Wound Healing • Surgical Site Infection (CDC) • Clavien–Dindo Classification • Southampton Wound Grading • ASA Physical Status Classification • Ramsay Sedation Score • WHO Surgical Safety Checklist • Damage Control Surgery • ERAS Protocol • SIRS Criteria • qSOFA Score • SOFA Score • APACHE II Score • Charlson Comorbidity Index • ECOG Performance Status • Karnofsky Performance Scale 2. BURNS • Burn Depth (1st–4th Degree) • Jackson's Zones of Burn • Rule of Nines • Lund & Browder Chart • Parkland Formula • Modified Brooke Formula • ABSI Score • Baux Score • Burn Centre Referral Criteria 3. TRAUMA • ATLS Primary Survey • Glasgow Coma Scale (GCS) • Injury Severity Score (ISS) • Revised Trauma Score (RTS) • TRISS • Mangled Extremity Severity Score (MESS) • AAST Organ Injury Scale - Liver - Spleen - Kidney • FAST/eFAST • Denver Criteria (BCVI) 4. HERNIA • Nyhus Classification • Gilbert Classification • EHS Classification • Ventral Hernia Working Group Classification • Amyand Hernia • Littre Hernia • Richter Hernia 5. BREAST • BI-RADS • Nottingham Prognostic Index (NPI) • Bloom–Richardson Grade • Elston–Ellis Modification • Nottingham Histological Grade • TNM – Breast Carcinoma 6. THYROID • Bethesda System • TIRADS • ATA Risk Stratification • ATA Recurrence Risk • TNM – Thyroid Carcinoma 7. ESOPHAGUS • Los Angeles Classification • Prague Classification • Zargar Classification • Siewert Classification • TNM – Esophageal Carcinoma 8. STOMACH • Johnson Classification • Forrest Classification • Modified Johnson Classification • TNM – Gastric Carcinoma 9. SMALL INTESTINE • Peritoneal Cancer Index (PCI) • Short Bowel Syndrome Classification 10. APPENDIX • Alvarado Score • AIR Score • Appendicitis Severity Grade 11. COLORECTAL • Dukes Classification • Astler–Coller Classification • Hinchey Classification • Goligher Classification • Parks Classification • Goodsall's Rule • TNM – Colorectal Carcinoma 12. HEPATOBILIARY • Child–Pugh Score • MELD Score • Tokyo Guidelines • Strasberg Classification • Bismuth–Corlette Classification • Mirizzi Classification • Nagakawa Classification • TNM – Hepatocellular Carcinoma • TNM – Gallbladder Carcinoma • TNM – Cholangiocarcinoma 13. PANCREAS • Revised Atlanta Classification • Ranson Criteria • BISAP Score • Modified CT Severity Index (CTSI) • Balthazar CT Severity Index • TNM – Pancreatic Carcinoma 14. SPLEEN • AAST Splenic Injury Scale 15. VASCULAR SURGERY • CEAP Classification • Venous Clinical Severity Score (VCSS) • Rutherford Classification • Fontaine Classification • WiFi Classification • Wells Score (DVT) • Wells Score (PE) • Villalta Score 16. UROLOGY • Bosniak Classification • RENAL Nephrometry Score • Fuhrman Grade • WHO/ISUP Grade • TNM – Renal Cell Carcinoma • TNM – Urinary Bladder Carcinoma • TNM – Penile Carcinoma • TNM – Testicular Tumour 17. PERITONITIS & SEPSIS • Mannheim Peritonitis Index • Boey Score • qSOFA • SOFA • APACHE II 18. SHOCK • ATLS Hemorrhagic Shock Classification • Modified Shock Index 19. ANASTOMOSIS • ISGLS Anastomotic Leak Classification • ISGPS Pancreatic Fistula Classification • Clavien–Dindo Classification 20. FRACTURES • Gustilo–Anderson Classification • AO Classification • Garden Classification • Neer Classification • Salter–Harris Classification 21. SOFT TISSUE TUMOURS • Enneking Classification • FNCLCC Grading • TNM – Soft Tissue Sarcoma 22. SKIN • Clark Levels • Breslow Thickness • TNM – Melanoma 23. ONCOLOGY • TNM Staging Principles • AJCC Stage Grouping • ECOG Performance Status • Karnofsky Performance Scale • RECIST Criteria 24. NUTRITION • MUST Score • NRS-2002 • Subjective Global Assessment (SGA) 25. ICU & PERIOPERATIVE CARE • ASA Physical Status Classification • Ramsay Sedation Score • Richmond Agitation Sedation Scale (RASS) • Modified Aldrete Score As single PDF to me
mkdir -p /home/daytona/workspace/master-surgery-pdf && echo "dir ready"
1. GENERAL SURGERY • Wound Classification (CDC) • Types of Wound Healing • Surgical Site Infection (CDC) • Clavien–Dindo Classification • WHO Surgical Safety Checklist • Damage Control Surgery • ERAS Protocol • SIRS Criteria • qSOFA Score • SOFA Score • APACHE II Score • Charlson Comorbidity Index • ECOG Performance Status • Karnofsky Performance Scale 2. BURNS • Burn Depth (1st–4th Degree) • Jackson's Zones of Burn • Rule of Nines • Lund & Browder Chart • Parkland Formula • Modified Brooke Formula • ABSI Score • Baux Score • Burn Centre Referral Criteria 3. TRAUMA • ATLS Primary Survey • Glasgow Coma Scale (GCS) • Injury Severity Score (ISS) • Revised Trauma Score (RTS) • TRISS • Mangled Extremity Severity Score (MESS) • AAST Organ Injury Scale - Liver - Spleen - Kidney • FAST/eFAST • Denver Criteria (BCVI) 4. HERNIA • Nyhus Classification • Gilbert Classification • EHS Classification • Ventral Hernia Working Group Classification • Amyand Hernia • Littre Hernia • Richter Hernia 5. BREAST • BI-RADS • Nottingham Prognostic Index (NPI) • Bloom–Richardson Grade • Elston–Ellis Modification • Nottingham Histological Grade • TNM – Breast Carcinoma 6. THYROID • Bethesda System • TIRADS • ATA Risk Stratification • ATA Recurrence Risk • TNM – Thyroid Carcinoma 7. ESOPHAGUS • Los Angeles Classification • Prague Classification • Zargar Classification • Siewert Classification • TNM – Esophageal Carcinoma 8. STOMACH • Johnson Classification • Forrest Classification • Modified Johnson Classification • TNM – Gastric Carcinoma 9. SMALL INTESTINE • Short Bowel Syndrome Classification 10. APPENDIX • Alvarado Score • AIR Score • Appendicitis Severity Grade 11. COLORECTAL • Dukes Classification • Astler–Coller Classification • Hinchey Classification • Goligher Classification • Parks Classification • Goodsall's Rule • TNM – Colorectal Carcinoma 12. HEPATOBILIARY • Child–Pugh Score • MELD Score • Tokyo Guidelines • Strasberg Classification • Bismuth–Corlette Classification • Mirizzi Classification • Nagakawa Classification • TNM – Hepatocellular Carcinoma • TNM – Gallbladder Carcinoma • TNM – Cholangiocarcinoma 13. PANCREAS • Revised Atlanta Classification • Ranson Criteria • BISAP Score • Modified CT Severity Index (CTSI) • Balthazar CT Severity Index • TNM – Pancreatic Carcinoma 14. SPLEEN • AAST Splenic Injury Scale 15. VASCULAR SURGERY • CEAP Classification • Rutherford Classification • Fontaine Classification • WiFi Classification • Wells Score (DVT) • Wells Score (PE) 16. UROLOGY • Bosniak Classification • WHO/ISUP Grade • TNM – Renal Cell Carcinoma • TNM – Urinary Bladder Carcinoma • TNM – Penile Carcinoma • TNM – Testicular Tumour 17. PERITONITIS & SEPSIS • qSOFA • SOFA • APACHE II 18. SHOCK • ATLS Hemorrhagic Shock Classification • Modified Shock Index 19. ANASTOMOSIS • ISGLS Anastomotic Leak Classification • Clavien–Dindo Classification 21. SOFT TISSUE TUMOURS • Enneking Classification • FNCLCC Grading • TNM – Soft Tissue Sarcoma 22. SKIN • Clark Levels • Breslow Thickness 23. ONCOLOGY • TNM Staging Principles • AJCC Stage Grouping • ECOG Performance Status • Karnofsky Performance Scale • RECIST Criteria 24. NUTRITION • MUST Score With sources as bailey, Sabiston, schwartz
mkdir -p /home/daytona/workspace/master-surgery-pdf && echo "OK"