Can you make a note pdf for the topic inflammation [ pathophysiology] for mbbs student. Fmge usmle exams
mkdir -p /home/daytona/workspace/inflammation-notes && ls /home/daytona/workspac…
~/inflammation-notes/generate_notes.py
#!/usr/bin/env python3
"""
Inflammation Pathophysiology Notes - MBBS / FMGE / USMLE
Generated from Robbins & Kumar Basic Pathology
"""
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,
HRFlowable, PageBreak, KeepTogether
)
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.platypus import ListFlowable, ListItem
# ── Colour palette ──────────────────────────────────────────────────────────
DARK_BLUE = colors.HexColor("#1A3A5C")
MED_BLUE = colors.HexColor("#2E6DA4")
LIGHT_BLUE = colors.HexColor("#D6E9F8")
TEAL = colors.HexColor("#006D75")
TEAL_LIGHT = colors.HexColor("#CCF2F4")
AMBER = colors.HexColor("#B7621A")
AMBER_LIGHT = colors.HexColor("#FEF3CD")
RED_DARK = colors.HexColor("#8B1A1A")
RED_LIGHT = colors.HexColor("#FDECEA")
GREEN_DARK = colors.HexColor("#1A5C2E")
GREEN_LIGHT = colors.HexColor("#DCF5E4")
PURPLE = colors.HexColor("#5B2C6F")
PURPLE_LIGHT= colors.HexColor("#EDE0F5")
GREY_BG = colors.HexColor("#F4F6F8")
WHITE = colors.white
BLACK = colors.black
PAGE_W, PAGE_H = A4
# ── Document ────────────────────────────────────────────────────────────────
OUTPUT = "/home/daytona/workspace/inflammation-notes/Inflammation_Notes_MBBS.pdf"
doc = SimpleDocTemplate(
OUTPUT,
pagesize=A4,
leftMargin=1.8*cm, rightMargin=1.8*cm,
topMargin=1.8*cm, bottomMargin=1.8*cm,
title="Inflammation - Pathophysiology Notes",
author="Orris Medical Notes",
subject="MBBS / FMGE / USMLE"
)
# ── Styles ───────────────────────────────────────────────────────────────────
base = getSampleStyleSheet()
def S(name, parent="Normal", **kw):
s = ParagraphStyle(name, parent=base[parent], **kw)
return s
MAIN_TITLE = S("MainTitle", "Title",
fontSize=26, textColor=WHITE, alignment=TA_CENTER,
spaceAfter=4, fontName="Helvetica-Bold")
SUB_TITLE = S("SubTitle", "Normal",
fontSize=13, textColor=LIGHT_BLUE, alignment=TA_CENTER,
spaceAfter=2, fontName="Helvetica-Bold")
EXAM_TAG = S("ExamTag", "Normal",
fontSize=10, textColor=AMBER, alignment=TA_CENTER,
spaceAfter=4, fontName="Helvetica-Bold")
H1 = S("H1", "Heading1",
fontSize=14, textColor=WHITE, fontName="Helvetica-Bold",
spaceBefore=14, spaceAfter=6, leftIndent=0)
H2 = S("H2", "Heading2",
fontSize=12, textColor=DARK_BLUE, fontName="Helvetica-Bold",
spaceBefore=10, spaceAfter=4, leftIndent=0)
H3 = S("H3", "Heading3",
fontSize=10.5, textColor=TEAL, fontName="Helvetica-Bold",
spaceBefore=8, spaceAfter=3, leftIndent=0)
BODY = S("Body", "Normal",
fontSize=9.5, leading=14, textColor=BLACK,
spaceAfter=4, fontName="Helvetica", alignment=TA_JUSTIFY)
BULLET = S("Bullet", "Normal",
fontSize=9.5, leading=13, textColor=BLACK,
leftIndent=14, bulletIndent=4, spaceAfter=2, fontName="Helvetica")
BOLD_BULLET = S("BoldBullet", "Normal",
fontSize=9.5, leading=13, textColor=DARK_BLUE,
leftIndent=14, bulletIndent=4, spaceAfter=2,
fontName="Helvetica-Bold")
NOTE = S("Note", "Normal",
fontSize=9, leading=13, textColor=AMBER,
leftIndent=10, spaceAfter=2, fontName="Helvetica-Oblique")
MNEMONIC = S("Mnemonic", "Normal",
fontSize=10, leading=14, textColor=PURPLE,
leftIndent=10, spaceAfter=2, fontName="Helvetica-Bold")
KEY = S("Key", "Normal",
fontSize=9, leading=13, textColor=RED_DARK,
leftIndent=10, spaceAfter=2, fontName="Helvetica-Bold")
CAPTION = S("Caption", "Normal",
fontSize=8.5, leading=12, textColor=colors.HexColor("#555555"),
alignment=TA_CENTER, spaceAfter=4, fontName="Helvetica-Oblique")
SOURCE = S("Source", "Normal",
fontSize=7.5, textColor=colors.HexColor("#888888"),
alignment=TA_CENTER, spaceAfter=2, fontName="Helvetica-Oblique")
# ── Helpers ──────────────────────────────────────────────────────────────────
def section_header(text, bg=MED_BLUE):
"""Full-width coloured section header."""
data = [[Paragraph(text, H1)]]
t = Table(data, colWidths=[doc.width])
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), bg),
("BOTTOMPADDING", (0,0), (-1,-1), 6),
("TOPPADDING", (0,0), (-1,-1), 6),
("LEFTPADDING", (0,0), (-1,-1), 10),
("RIGHTPADDING", (0,0), (-1,-1), 10),
("ROUNDEDCORNERS", [4,4,4,4]),
]))
return t
def info_box(title, items, bg=LIGHT_BLUE, title_color=DARK_BLUE):
"""Coloured info box with bullet items."""
content = [Paragraph(f"<b>{title}</b>", S("ibt", parent="Normal",
fontSize=10, textColor=title_color, fontName="Helvetica-Bold",
spaceAfter=3))]
for item in items:
content.append(Paragraph(f"• {item}", S("ibi", parent="Normal",
fontSize=9.5, textColor=BLACK, leading=13,
fontName="Helvetica", leftIndent=8, spaceAfter=2)))
data = [[content]]
t = Table([[content]], colWidths=[doc.width])
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), bg),
("BOX", (0,0), (-1,-1), 0.8, title_color),
("TOPPADDING", (0,0), (-1,-1), 7),
("BOTTOMPADDING", (0,0), (-1,-1), 7),
("LEFTPADDING", (0,0), (-1,-1), 10),
("RIGHTPADDING", (0,0), (-1,-1), 10),
]))
return t
def mnemonic_box(mnemonic_text, explanation):
content = [
Paragraph(f"Mnemonic: {mnemonic_text}", MNEMONIC),
Paragraph(explanation, BODY)
]
data = [[content]]
t = Table(data, colWidths=[doc.width])
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), PURPLE_LIGHT),
("BOX", (0,0), (-1,-1), 1, PURPLE),
("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 exam_box(title, items, bg=AMBER_LIGHT, border=AMBER):
"""High-yield exam box."""
content = [Paragraph(f"⭐ {title}", S("ebt", parent="Normal",
fontSize=10, textColor=AMBER, fontName="Helvetica-Bold",
spaceAfter=3))]
for item in items:
content.append(Paragraph(f"• {item}", S("ebi", parent="Normal",
fontSize=9.5, textColor=BLACK, leading=13,
fontName="Helvetica", leftIndent=8, spaceAfter=2)))
data = [[content]]
t = Table(data, colWidths=[doc.width])
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), bg),
("BOX", (0,0), (-1,-1), 1.2, border),
("TOPPADDING", (0,0), (-1,-1), 7),
("BOTTOMPADDING", (0,0), (-1,-1), 7),
("LEFTPADDING", (0,0), (-1,-1), 10),
("RIGHTPADDING", (0,0), (-1,-1), 10),
]))
return t
def two_col_table(headers, rows, col_colors=None):
"""Two-column comparison table."""
col_w = doc.width / 2
header_row = [Paragraph(f"<b>{h}</b>", S("th", parent="Normal",
fontSize=9.5, textColor=WHITE, fontName="Helvetica-Bold",
alignment=TA_CENTER)) for h in headers]
data = [header_row]
for row in rows:
data.append([
Paragraph(str(row[0]), S("td0", parent="Normal", fontSize=9, leading=12,
textColor=BLACK, fontName="Helvetica", spaceAfter=2)),
Paragraph(str(row[1]), S("td1", parent="Normal", fontSize=9, leading=12,
textColor=BLACK, fontName="Helvetica", spaceAfter=2))
])
t = Table(data, colWidths=[col_w, col_w])
ts = [
("BACKGROUND", (0,0), (-1,0), DARK_BLUE),
("GRID", (0,0), (-1,-1), 0.5, colors.HexColor("#BBBBBB")),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 6),
("RIGHTPADDING", (0,0), (-1,-1), 6),
("VALIGN", (0,0), (-1,-1), "TOP"),
("ROWBACKGROUNDS", (0,1), (-1,-1), [WHITE, GREY_BG]),
]
t.setStyle(TableStyle(ts))
return t
def multi_col_table(headers, rows, bg_header=DARK_BLUE):
col_w = doc.width / len(headers)
header_row = [Paragraph(f"<b>{h}</b>", S(f"mth{i}", parent="Normal",
fontSize=9, textColor=WHITE, fontName="Helvetica-Bold",
alignment=TA_CENTER)) for i, h in enumerate(headers)]
data = [header_row]
for row in rows:
data.append([
Paragraph(str(cell), S(f"mtd{j}", parent="Normal", fontSize=8.5,
leading=12, textColor=BLACK, fontName="Helvetica",
spaceAfter=1)) for j, cell in enumerate(row)
])
t = Table(data, colWidths=[col_w]*len(headers))
ts = [
("BACKGROUND", (0,0), (-1,0), bg_header),
("GRID", (0,0), (-1,-1), 0.5, colors.HexColor("#BBBBBB")),
("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"),
("ROWBACKGROUNDS", (0,1), (-1,-1), [WHITE, GREY_BG]),
]
t.setStyle(TableStyle(ts))
return t
# ════════════════════════════════════════════════════════════════════════════
# CONTENT
# ════════════════════════════════════════════════════════════════════════════
story = []
# ── COVER ────────────────────────────────────────────────────────────────────
cover_data = [[
Paragraph("INFLAMMATION", MAIN_TITLE),
Paragraph("Pathophysiology Notes", SUB_TITLE),
Paragraph("MBBS | FMGE | USMLE Step 1", EXAM_TAG),
Spacer(1, 4),
Paragraph("Based on Robbins & Kumar Basic Pathology", SOURCE),
]]
cover_tbl = Table(cover_data, colWidths=[doc.width])
cover_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), DARK_BLUE),
("TOPPADDING", (0,0), (-1,-1), 22),
("BOTTOMPADDING", (0,0), (-1,-1), 22),
("LEFTPADDING", (0,0), (-1,-1), 14),
("RIGHTPADDING", (0,0), (-1,-1), 14),
("ROUNDEDCORNERS", [6,6,6,6]),
]))
story.append(cover_tbl)
story.append(Spacer(1, 10))
# Quick overview box
story.append(info_box("Topic Overview", [
"Definition, causes, and cardinal signs of inflammation",
"Acute inflammation: vascular & cellular events",
"Chemical mediators (complete table)",
"Morphological patterns of acute inflammation",
"Chronic inflammation, granulomas",
"Systemic effects (Acute Phase Response, fever)",
"Outcomes of inflammation",
"High-yield FMGE / USMLE exam points & mnemonics",
]))
story.append(Spacer(1, 8))
# ────────────────────────────────────────────────────────────────────────────
# 1. DEFINITION & CARDINAL SIGNS
# ────────────────────────────────────────────────────────────────────────────
story.append(section_header("1. DEFINITION & CARDINAL SIGNS"))
story.append(Spacer(1, 6))
story.append(Paragraph(
"Inflammation is a <b>protective response</b> of vascularized tissues to infections, "
"damaged cells, and other noxious stimuli. It aims to eliminate the initial cause of "
"cell injury, remove necrotic cells, and initiate tissue repair. Without inflammation, "
"infections would go unchecked and wounds would never heal.",
BODY))
story.append(Spacer(1, 6))
story.append(Paragraph("<b>Five Cardinal Signs (Celsus + Virchow)</b>", H2))
cardinal_data = [
["Sign", "Latin Term", "Mechanism"],
["Redness (Rubor)", "Rubor", "Vasodilation → increased blood flow"],
["Heat (Calor)", "Calor", "Increased blood flow; metabolic heat from leukocytes"],
["Swelling (Tumor)", "Tumor", "Increased vascular permeability → edema"],
["Pain (Dolor)", "Dolor", "Prostaglandins, bradykinin, neuropeptides"],
["Loss of Function (Functio Laesa)", "Functio Laesa", "Combined effects of pain and swelling"],
]
story.append(multi_col_table(
["Sign", "Latin Term", "Mechanism"],
[r[1:] for r in cardinal_data[1:]],
bg_header=TEAL
))
story.append(Spacer(1, 4))
story.append(mnemonic_box("RSHIP", "Redness, Swelling, Heat, Increased pain, Pain (Dolor) - Cardinal signs of inflammation"))
story.append(Spacer(1, 8))
# ────────────────────────────────────────────────────────────────────────────
# 2. ACUTE INFLAMMATION
# ────────────────────────────────────────────────────────────────────────────
story.append(section_header("2. ACUTE INFLAMMATION"))
story.append(Spacer(1, 6))
story.append(Paragraph(
"Acute inflammation has <b>three major components</b>: (1) dilation of small vessels; "
"(2) increased permeability of the microvasculature; and (3) emigration of leukocytes "
"from the microcirculation. These changes predominantly occur in <b>postcapillary venules</b>.",
BODY))
story.append(Spacer(1, 6))
# 2A Vascular Events
story.append(Paragraph("2A. Vascular Events", H2))
story.append(info_box("Sequence of Vascular Changes", [
"1. Transient vasoconstriction (seconds) - neurogenic reflex",
"2. Vasodilation (arterioles, capillaries, venules) → Redness & Heat",
"3. Increased vascular permeability → protein-rich exudate leaks → Swelling",
"4. Stasis of blood flow: RBCs pack → Rouleaux formation",
"5. Margination of leukocytes along vessel walls",
], bg=LIGHT_BLUE, title_color=MED_BLUE))
story.append(Spacer(1, 6))
story.append(Paragraph("<b>Exudate vs Transudate</b>", H3))
story.append(two_col_table(
["Exudate", "Transudate"],
[
["Protein-rich, cells present", "Protein-poor (mainly albumin)"],
["Specific gravity > 1.020", "Specific gravity < 1.012"],
["Turbid / cloudy", "Clear / straw-coloured"],
["Due to increased vascular permeability", "Due to osmotic/hydrostatic imbalance"],
["Implies active inflammation", "Not associated with inflammation"],
["e.g., pus, fibrinous effusion", "e.g., cardiac failure, nephrotic syndrome"],
]
))
story.append(Spacer(1, 4))
story.append(exam_box("FMGE/USMLE Key Point", [
"Exudate = inflammation (permeability ↑). Transudate = no inflammation (pressure imbalance).",
"Pus = purulent exudate rich in neutrophils + dead cell debris.",
"Principal mediator of vasodilation = Histamine.",
"Endothelial contraction (by histamine, bradykinin, leukotrienes) = main mechanism of increased permeability.",
]))
story.append(Spacer(1, 10))
# 2B Cellular Events
story.append(Paragraph("2B. Cellular Events (Leukocyte Recruitment)", H2))
story.append(Paragraph(
"The process of leukocyte recruitment from vessels to the site of injury involves "
"a coordinated sequence: margination → rolling → adhesion → transmigration → chemotaxis.",
BODY))
story.append(Spacer(1, 4))
story.append(Paragraph("<b>Steps of Leukocyte Recruitment</b>", H3))
leuko_steps = [
["Step", "Process", "Molecules Involved"],
["1", "Margination & Pavementing", "Stasis of blood → leukocytes pushed to periphery"],
["2", "Rolling", "Selectins (P-selectin, E-selectin on endothelium; L-selectin on leukocytes) + Sialyl-Lewis X"],
["3", "Adhesion (Firm)", "Integrins (LFA-1, Mac-1) on leukocytes bind ICAM-1 on endothelium. Upregulated by TNF, IL-1"],
["4", "Transmigration (Diapedesis)", "PECAM-1 (CD31) at junctions; leukocytes squeeze through interendothelial gaps"],
["5", "Chemotaxis", "Movement along chemical gradient: C5a, LTB4, IL-8, bacterial products (fMLP)"],
]
story.append(multi_col_table(
["Step", "Process", "Molecules Involved"],
[r[1:] for r in leuko_steps[1:]],
bg_header=MED_BLUE
))
story.append(Spacer(1, 6))
story.append(exam_box("High-Yield: Adhesion Molecules", [
"Rolling → Selectins (P, E, L-selectin)",
"Firm adhesion → Integrins (LFA-1/Mac-1) + ICAM-1",
"Diapedesis → PECAM-1 (CD31)",
"Chemotaxis agents: C5a > LTB4 > IL-8 > fMLP (bacterial peptides)",
"LAD (Leukocyte Adhesion Deficiency): absent CD18 (integrin subunit) → recurrent infections, no pus",
]))
story.append(Spacer(1, 6))
story.append(Paragraph("<b>Neutrophil Functions at Inflammation Site</b>", H3))
story.append(info_box("Leukocyte Actions", [
"Recognition: Pattern recognition receptors (PRRs) e.g. TLRs recognize PAMPs",
"Opsonization: IgG Fc receptors and complement receptors (C3b) enhance phagocytosis",
"Phagocytosis: Phagosome → phagolysosome → killing",
"Killing Mechanisms: (1) O2-dependent: NADPH oxidase → superoxide (O2•−) → H2O2 → HOCl (MPO); (2) O2-independent: lysozyme, defensins, lactoferrin, proteases",
"Neutrophil Extracellular Traps (NETs): web of chromatin + antimicrobial proteins that trap and kill microbes",
]))
story.append(Spacer(1, 4))
story.append(exam_box("FMGE Key: Killing Mechanisms", [
"CGD (Chronic Granulomatous Disease) = NADPH oxidase defect → can't make O2-dependent radicals → recurrent Staph & Aspergillus infections. NBT test negative.",
"Myeloperoxidase deficiency = impaired HOCl production. Usually mild (compensated).",
"Chediak-Higashi = defect in LYST gene → giant granules in neutrophils & all cells.",
]))
story.append(Spacer(1, 10))
story.append(PageBreak())
# ────────────────────────────────────────────────────────────────────────────
# 3. CHEMICAL MEDIATORS
# ────────────────────────────────────────────────────────────────────────────
story.append(section_header("3. CHEMICAL MEDIATORS OF INFLAMMATION"))
story.append(Spacer(1, 6))
story.append(Paragraph(
"Chemical mediators are the molecules responsible for the vascular and cellular reactions of "
"inflammation. They may be derived from plasma (complement, kinin, coagulation systems) or "
"produced locally by cells (histamine, prostaglandins, cytokines, etc.).",
BODY))
story.append(Spacer(1, 6))
# Summary table of mediators
story.append(Paragraph("<b>Master Table: Mediators and Their Actions</b>", H2))
med_data = [
["Mediator", "Source", "Key Action(s)", "Inhibitor/Note"],
["Histamine", "Mast cells, basophils, platelets", "Vasodilation, ↑ vascular permeability (early, rapid)", "Antihistamines; released by C3a, C5a, cold, trauma"],
["Serotonin (5-HT)", "Platelets, enterochromaffin cells", "Vasoconstriction at high dose; similar to histamine", "Released by platelet aggregation"],
["Prostaglandins (PGE2, PGI2)", "Phospholipids via COX pathway", "Vasodilation, fever, pain sensitization", "Aspirin / NSAIDs (COX inhibitors)"],
["Leukotriene B4 (LTB4)", "Leukocytes via LOX pathway", "Potent chemotaxis; leukocyte adhesion", "5-LOX inhibitors (zileuton)"],
["Leukotrienes C4, D4, E4", "Mast cells, eosinophils", "↑ vascular permeability; bronchoconstriction (SLOW-RS)", "Montelukast (receptor blocker)"],
["PAF (Platelet Activating Factor)", "Leukocytes, mast cells, endothelium", "↑ permeability, platelet aggregation, chemotaxis", "Lipid mediator"],
["C3a", "Complement (plasma)", "Mast cell degranulation → histamine release; opsonization", "Part of MAC pathway"],
["C5a", "Complement (plasma)", "Potent chemotaxis, ↑ permeability, mast cell activation", "Most important complement chemotaxin"],
["C3b", "Complement (plasma)", "Opsonization (coating of bacteria)", "Enhances phagocytosis"],
["IL-1 and TNF", "Macrophages", "Fever, acute phase response, endothelial activation, shock", "Anti-TNF: infliximab, etanercept"],
["IL-6", "Macrophages, fibroblasts", "Acute phase protein synthesis in liver", "Tocilizumab (anti-IL-6R)"],
["IL-8 (CXCL8)", "Macrophages, endothelium", "Potent neutrophil chemoattractant", "CXC chemokine"],
["Bradykinin", "Plasma (kinin system)", "Pain, vasodilation, ↑ permeability", "ACE degrades bradykinin; ACE inhibitor → ACE inhibitor cough"],
["Thrombin", "Plasma (coagulation)", "Fibrin formation, platelet activation, endothelial activation", "Links coagulation to inflammation"],
["Reactive Oxygen Species (ROS)", "Neutrophils, macrophages", "Microbial killing, tissue damage", "Antioxidants"],
["Nitric Oxide (NO)", "Macrophages (iNOS), endothelium (eNOS)", "Vasodilation, microbial killing, anti-platelet", "Steroid suppresses iNOS"],
["Neuropeptides (Substance P)", "Nerve fibres", "Pain transmission, ↑ vascular permeability", "Neurogenic inflammation"],
]
story.append(multi_col_table(
["Mediator", "Source", "Key Action(s)", "Inhibitor/Note"],
[r[1:] for r in med_data[1:]],
bg_header=DARK_BLUE
))
story.append(Spacer(1, 6))
story.append(Paragraph("<b>Summary: Mediator → Function</b>", H3))
story.append(multi_col_table(
["Reaction", "Principal Mediators"],
[
["Vasodilation", "Histamine, PGE2/PGI2, NO"],
["Increased vascular permeability", "Histamine, C3a, C5a, LTC4/D4/E4, PAF, bradykinin"],
["Chemotaxis / leukocyte recruitment", "C5a, LTB4, IL-8, fMLP, TNF, IL-1"],
["Fever", "IL-1, TNF, IL-6, PGE2"],
["Pain", "Prostaglandins, bradykinin, substance P"],
["Tissue damage", "ROS, lysosomal enzymes, NO"],
],
bg_header=TEAL
))
story.append(Spacer(1, 6))
story.append(mnemonic_box("SLOW-RS = Leukotrienes (C4, D4, E4)",
"SLOW Reacting Substance of Anaphylaxis = LTC4 + LTD4 + LTE4 → bronchoconstriction + ↑ permeability"))
story.append(Spacer(1, 4))
story.append(mnemonic_box("'Aspirin blocks COX; Zileuton blocks LOX'",
"COX pathway → Prostaglandins/Thromboxane (blocked by aspirin/NSAIDs). LOX pathway → Leukotrienes (blocked by zileuton/montelukast)."))
story.append(Spacer(1, 6))
story.append(Paragraph("<b>Arachidonic Acid Pathway (Key)</b>", H3))
aa_steps = [
["Phospholipids (cell membrane)"],
["↓ Phospholipase A2 (blocked by Corticosteroids via Lipocortin/Annexin-1)"],
["Arachidonic Acid"],
["COX pathway → PGG2 → PGH2 → PGE2 (fever, pain, vasodilation), PGI2 (vasodilate, anti-platelet), TXA2 (vasoconstrict, pro-platelet)"],
["LOX pathway → 5-HPETE → LTB4 (chemotaxis) + LTC4/D4/E4 (SLOW-RS, bronchoconstriction)"],
]
for step in aa_steps:
story.append(Paragraph(step[0], BULLET))
story.append(Spacer(1, 4))
story.append(exam_box("Drugs Acting on Arachidonic Acid Pathway", [
"Corticosteroids: block Phospholipase A2 → block ALL (PGs + LTs)",
"Aspirin/NSAIDs: block COX irreversibly (aspirin) or reversibly (other NSAIDs)",
"Zileuton: blocks 5-LOX → reduces LTs",
"Montelukast/Zafirlukast: block LT receptors (CysLT1)",
"Celecoxib: selective COX-2 inhibitor",
]))
story.append(PageBreak())
# ────────────────────────────────────────────────────────────────────────────
# 4. MORPHOLOGICAL PATTERNS
# ────────────────────────────────────────────────────────────────────────────
story.append(section_header("4. MORPHOLOGICAL PATTERNS OF ACUTE INFLAMMATION"))
story.append(Spacer(1, 6))
patterns = [
["Pattern", "Description", "Examples"],
["Serous", "Thin, watery, protein-rich exudate in body cavities. Sterile. Low cell count.", "Skin blisters (burns/viral), pleural effusion (early TB), pericardial effusion"],
["Fibrinous", "Large increase in permeability → fibrinogen leaks → fibrin deposition. Eosinophilic meshwork.", "Fibrinous pericarditis ('bread & butter' appearance), fibrinous pleuritis, lobar pneumonia"],
["Suppurative (Purulent)", "Large amounts of pus (neutrophils + dead cells + microbes). Liquefactive necrosis.", "Abscess (walled-off pus), empyema (pus in pleura), furuncle (boil)"],
["Ulcer", "Necrotic sloughing of tissue surface, creating a defect.", "Peptic ulcer, aphthous ulcer, chronic skin ulcers"],
["Pseudomembranous", "Inflammatory membrane on mucosal surface (fibrin + necrotic cells).", "Diphtheria (throat), C. difficile (colon), croup"],
["Hemorrhagic", "Severe vascular damage → RBCs in exudate.", "Anthrax, plague, severe viral infections"],
]
story.append(multi_col_table(
["Pattern", "Description", "Examples"],
[r[1:] for r in patterns[1:]],
bg_header=RED_DARK
))
story.append(Spacer(1, 6))
story.append(exam_box("FMGE/USMLE Points - Patterns", [
"Fibrinous pericarditis → 'bread and butter' heart on gross exam; 'velvet' texture",
"Abscess = collection of pus walled off by fibrosis → does NOT heal without drainage",
"Empyema = pus in a pre-existing body cavity (pleural/pericardial)",
"C. diff colitis → pseudomembranous colitis (plaques of fibrin + mucus on colonic mucosa)",
"Histamine = immediate reaction (<30 min); Leukotrienes = delayed (sustained)",
]))
story.append(Spacer(1, 10))
# ────────────────────────────────────────────────────────────────────────────
# 5. OUTCOMES OF ACUTE INFLAMMATION
# ────────────────────────────────────────────────────────────────────────────
story.append(section_header("5. OUTCOMES OF ACUTE INFLAMMATION"))
story.append(Spacer(1, 6))
outcomes = [
["Outcome", "Mechanism", "Example"],
["Resolution (Complete)", "Removal of cause + adequate tissue repair. No significant necrosis.", "Lobar pneumonia → complete resolution"],
["Healing by Scar (Fibrosis)", "Significant necrosis → granulation tissue → scar. Permanent structural change.", "Myocardial infarction → scar"],
["Abscess Formation", "Walled-off pus collection. Requires drainage.", "Liver abscess, brain abscess"],
["Chronic Inflammation", "Persisting stimulus → neutrophils replaced by macrophages, lymphocytes, plasma cells.", "TB, rheumatoid arthritis, H. pylori gastritis"],
["Progression to Sepsis", "Uncontrolled systemic spread of infection/mediators → SIRS → septic shock.", "Gram-negative bacteremia → endotoxin → shock"],
]
story.append(multi_col_table(
["Outcome", "Mechanism", "Example"],
[r[1:] for r in outcomes[1:]],
bg_header=MED_BLUE
))
story.append(Spacer(1, 8))
# ────────────────────────────────────────────────────────────────────────────
# 6. CHRONIC INFLAMMATION
# ────────────────────────────────────────────────────────────────────────────
story.append(section_header("6. CHRONIC INFLAMMATION"))
story.append(Spacer(1, 6))
story.append(Paragraph(
"Chronic inflammation is a response of <b>prolonged duration (weeks to months)</b> in which "
"inflammation, tissue injury, and attempts at repair coexist. Cell type = <b>Macrophages, "
"Lymphocytes, Plasma cells</b> (NOT neutrophils).",
BODY))
story.append(Spacer(1, 6))
story.append(Paragraph("<b>Causes of Chronic Inflammation</b>", H2))
story.append(info_box("3 Main Causes", [
"1. Persistent infections: organisms that resist phagocytosis (TB, leprosy, fungi, parasites)",
"2. Immune-mediated (Hypersensitivity): autoimmune (RA, MS, SLE); allergic (asthma)",
"3. Prolonged toxic agent exposure: silica → silicosis; cholesterol → atherosclerosis",
], bg=TEAL_LIGHT, title_color=TEAL))
story.append(Spacer(1, 6))
story.append(Paragraph("<b>Morphological Features of Chronic Inflammation</b>", H3))
story.append(info_box("Key Features", [
"Infiltration with mononuclear cells: macrophages, lymphocytes, plasma cells",
"Tissue destruction: induced by the persistent offender AND inflammatory cells themselves",
"Attempts at healing: angiogenesis and fibrosis",
"Macrophage is the DOMINANT cell (activated by IFN-gamma from T helper cells)",
"Plasma cells → produce antibodies",
"Eosinophils → allergic reactions, parasitic infections",
]))
story.append(Spacer(1, 6))
story.append(two_col_table(
["Acute Inflammation", "Chronic Inflammation"],
[
["Onset: rapid (minutes to days)", "Onset: slow (weeks to months)"],
["Duration: days to weeks", "Duration: months to years"],
["Main cell: Neutrophils", "Main cell: Macrophages, lymphocytes, plasma cells"],
["Edema prominent", "Fibrosis predominates"],
["Resolution is possible", "Often leads to scarring"],
["Exudate: protein-rich", "Granulation tissue & granulomas"],
["Examples: appendicitis (early), abscess", "Examples: TB, RA, Crohn's, silicosis"],
]
))
story.append(Spacer(1, 8))
# ────────────────────────────────────────────────────────────────────────────
# 7. GRANULOMATOUS INFLAMMATION
# ────────────────────────────────────────────────────────────────────────────
story.append(section_header("7. GRANULOMATOUS INFLAMMATION"))
story.append(Spacer(1, 6))
story.append(Paragraph(
"A <b>granuloma</b> is a focus of chronic inflammation composed of a collection of "
"<b>epithelioid macrophages</b>, often surrounded by lymphocytes and multinucleated "
"giant cells. Granulomas form when the offending agent cannot be eliminated by "
"macrophages alone.",
BODY))
story.append(Spacer(1, 6))
story.append(Paragraph("<b>Types of Granulomas</b>", H2))
story.append(two_col_table(
["Caseating Granuloma", "Non-Caseating Granuloma"],
[
["Central caseous necrosis (cheese-like)", "No central necrosis"],
["Strongly suggests TB (Mycobacterium tuberculosis)", "Many causes: sarcoidosis, Crohn's, leprosy (TT), foreign body, fungal (Histoplasma, Coccidioides)"],
["Langerhans giant cells (horseshoe/C-shaped nuclei)", "Langhans giant cells OR foreign body giant cells"],
["ZN stain for AFB", "ACE elevated in sarcoidosis"],
["Example: TB, leprosy (LL type less so)", "Example: Sarcoidosis, Berylliosis, Cat-scratch disease"],
]
))
story.append(Spacer(1, 6))
story.append(exam_box("Granuloma Causes - High Yield List", [
"Caseating: TB, Histoplasma, Coccidioides, Blastomyces (deep fungi)",
"Non-caseating: Sarcoidosis (#1 in exam), Crohn's disease, Berylliosis, Leprosy (TT), Cat-scratch disease (Bartonella), PAN, Wegener's",
"Foreign body giant cells = nuclei randomly distributed",
"Langhans giant cells = nuclei arranged in horseshoe/peripheral pattern",
"Key mediator forming granuloma: IFN-gamma (from Th1 lymphocytes) activates macrophages → epithelioid transformation",
]))
story.append(Spacer(1, 8))
story.append(PageBreak())
# ────────────────────────────────────────────────────────────────────────────
# 8. SYSTEMIC EFFECTS (ACUTE PHASE RESPONSE)
# ────────────────────────────────────────────────────────────────────────────
story.append(section_header("8. SYSTEMIC EFFECTS OF INFLAMMATION"))
story.append(Spacer(1, 6))
story.append(Paragraph(
"The systemic reaction to inflammation is called the <b>Acute Phase Response (APR)</b>, "
"mediated primarily by <b>IL-1, TNF, and IL-6</b> from macrophages.",
BODY))
story.append(Spacer(1, 6))
story.append(Paragraph("<b>Components of the Acute Phase Response</b>", H2))
story.append(multi_col_table(
["Feature", "Mediator", "Clinical Relevance"],
[
["Fever", "IL-1, TNF, IL-6 → PGE2 (via COX-2 in hypothalamus)", "Antipyretics block COX-2 (aspirin, paracetamol)"],
["Acute phase proteins ↑", "IL-6 → liver synthesis", "CRP, fibrinogen, SAA, ferritin, hepcidin ↑; albumin, transferrin ↓"],
["Leukocytosis", "CSFs (G-CSF, M-CSF) from macrophages", "Neutrophilia (bacterial); Lymphocytosis (viral); Eosinophilia (allergy/parasites)"],
["ESR ↑", "Fibrinogen ↑ → rouleaux formation", "Marker of inflammation"],
["Anemia of chronic disease", "Hepcidin ↑ (IL-6 induced) → sequesters iron", "Low serum iron, normal/high ferritin, low TIBC"],
["Hypotension / Shock (sepsis)", "TNF, IL-1 → vasodilation, DIC", "Septic shock - vasodilatory"],
["Thrombocytopenia", "Platelet consumption, DIC", "In severe sepsis"],
["Weight loss / Cachexia", "TNF (Cachectin), IL-1", "Seen in chronic inflammation/cancer"],
],
bg_header=TEAL
))
story.append(Spacer(1, 6))
story.append(Paragraph("<b>Fever Mechanism</b>", H3))
story.append(info_box("Fever Pathway", [
"Exogenous pyrogens (bacteria, LPS) → stimulate macrophages",
"Macrophages release endogenous pyrogens: IL-1, TNF, IL-6 (main ones), IFN-alpha/beta",
"These reach hypothalamic thermoregulatory centre",
"Activate COX-2 in hypothalamus → PGE2 synthesis",
"PGE2 → raises set point of thermostat",
"Body responds: vasoconstriction, shivering → raises body temperature",
"Aspirin/Paracetamol → inhibit PGE2 → antipyretic effect",
]))
story.append(Spacer(1, 4))
story.append(exam_box("Acute Phase Proteins - Know These!", [
"INCREASED: CRP (best marker), Fibrinogen, Serum Amyloid A (SAA), Ferritin, Haptoglobin, Alpha-1-antitrypsin, Complement",
"DECREASED (negative APPs): Albumin, Transferrin, Prealbumin (transthyretin)",
"CRP: made in liver, activates complement, opsonizes bacteria → very useful in clinical monitoring",
"ESR increases because fibrinogen makes RBCs clump (rouleaux) → settle faster",
]))
story.append(Spacer(1, 8))
# ────────────────────────────────────────────────────────────────────────────
# 9. COMPLEMENT SYSTEM
# ────────────────────────────────────────────────────────────────────────────
story.append(section_header("9. COMPLEMENT SYSTEM IN INFLAMMATION"))
story.append(Spacer(1, 6))
story.append(Paragraph(
"The complement system consists of >20 plasma proteins that are key inflammatory "
"mediators. All three pathways converge at C3 cleavage.",
BODY))
story.append(Spacer(1, 4))
story.append(multi_col_table(
["Pathway", "Activator", "Initiator"],
[
["Classical", "Antigen-Antibody complexes (IgG/IgM)", "C1q binds Fc region of antibody"],
["Lectin (MBL)", "Mannose residues on microbes", "MBL (Mannose-Binding Lectin)"],
["Alternative", "Microbial cell surfaces (LPS, fungal walls)", "Spontaneous C3 hydrolysis + Factor B, D, P"],
],
bg_header=PURPLE
))
story.append(Spacer(1, 4))
story.append(info_box("Key Complement Fragments & Functions", [
"C3a + C5a = Anaphylatoxins → mast cell degranulation → histamine release → vasodilation + ↑ permeability",
"C5a = Most potent: chemotaxis + anaphylatoxin + opsonin",
"C3b = Opsonin (coats bacteria for phagocytosis)",
"C5b-9 = MAC (Membrane Attack Complex) → pores in bacterial membrane → lysis",
"C1 esterase inhibitor deficiency → Hereditary Angioedema (bradykinin excess)",
"C3 deficiency → recurrent encapsulated bacterial infections (S. pneumoniae, H. influenzae, N. meningitidis)",
"C5-C9 deficiency → recurrent Neisseria infections",
]))
story.append(Spacer(1, 4))
story.append(mnemonic_box("C3 'a' = Anaphylaxis-like (local), C5 'a' = Anaphylaxis + Chemotaxis",
"Both C3a and C5a are anaphylatoxins, but C5a is also the most potent chemotaxin. C3b is the main opsonin."))
story.append(Spacer(1, 8))
# ────────────────────────────────────────────────────────────────────────────
# 10. IMPORTANT CLINICAL SYNDROMES
# ────────────────────────────────────────────────────────────────────────────
story.append(section_header("10. CLINICAL SYNDROMES & IMMUNODEFICIENCIES"))
story.append(Spacer(1, 6))
story.append(multi_col_table(
["Syndrome", "Defect", "Features", "Key Pathogen"],
[
["CGD (Chronic Granulomatous Disease)", "NADPH oxidase (gp91phox)", "Recurrent infections; catalase +ve organisms; NBT test negative; DHR test", "S. aureus, Aspergillus, Candida, Nocardia"],
["Leukocyte Adhesion Deficiency (LAD)", "CD18 (beta-2 integrin)", "Delayed cord separation; recurrent infections; no pus; leukocytosis", "S. aureus, Gram-negative rods"],
["Chediak-Higashi", "LYST gene (lysosomal trafficking)", "Giant granules in all cells; partial albinism; bleeding; neurological", "S. aureus; S. pyogenes"],
["Myeloperoxidase Deficiency", "MPO enzyme", "Usually mild; impaired killing; compensated by ↑ H2O2", "Candida (in diabetics)"],
["Job's Syndrome (Hyper-IgE)", "STAT3 mutation", "Cold abscesses (no redness/pain); eczema; skeletal anomalies; IgE >2000", "S. aureus"],
],
bg_header=RED_DARK
))
story.append(Spacer(1, 6))
# ────────────────────────────────────────────────────────────────────────────
# 11. FMGE / USMLE RAPID REVISION
# ────────────────────────────────────────────────────────────────────────────
story.append(section_header("11. RAPID REVISION — FMGE / USMLE ONE-LINERS", bg=DARK_BLUE))
story.append(Spacer(1, 6))
oneliners = [
"First cell in acute inflammation = Neutrophil (PMN)",
"First cell in chronic inflammation = Macrophage",
"Hallmark cell of chronic inflammation = Macrophage (activated by IFN-gamma)",
"Hall mark cell of granuloma = Epithelioid macrophage + Multinucleated giant cells",
"Most potent complement chemotaxin = C5a",
"Main opsonin (complement) = C3b",
"Most important mediator of vasodilation = Histamine (early); PGE2 (sustained)",
"Most important mediator of fever = IL-1, TNF (endogenous pyrogens) → PGE2",
"SLOW-RS = Leukotrienes C4, D4, E4 (cysteinyl leukotrienes)",
"Corticosteroids block = Phospholipase A2 (via Lipocortin/Annexin-1)",
"Aspirin irreversibly blocks = COX-1 and COX-2",
"'Bread and butter' heart = Fibrinous pericarditis",
"Pus = Purulent exudate (neutrophils + dead cells + microbes)",
"Best marker of inflammation = CRP (C-Reactive Protein)",
"Negative acute phase proteins = Albumin, Transferrin",
"NBT test (Nitroblue Tetrazolium) negative = CGD",
"Delayed cord separation + no pus + leukocytosis = LAD (Leukocyte Adhesion Deficiency)",
"Giant granules in all cells = Chediak-Higashi (LYST mutation)",
"Cold abscesses + IgE >2000 = Job's Syndrome (Hyper-IgE, STAT3 mutation)",
"Granuloma = T-cell (Th1) driven; IFN-gamma activates macrophages",
"Caseating granuloma = TB (most common), also deep fungal infections",
"Langhans giant cell = horseshoe nuclei (TB); Foreign body giant cell = random nuclei",
"Sarcoidosis = non-caseating granuloma + elevated ACE + Kveim test + Schaumann bodies",
"Silicosis, berylliosis = non-caseating granuloma from inorganic dust",
"Diapedesis mediated by = PECAM-1 (CD31)",
"Rolling mediated by = Selectins (P, E, L)",
"Firm adhesion = Integrins (LFA-1, Mac-1) + ICAM-1",
"Cachexia = TNF-alpha (old name Cachectin) + IL-1 + IL-6",
"Anemia of chronic disease = Hepcidin↑ (IL-6 induced) → iron sequestration",
"ESR elevated because = Fibrinogen↑ → rouleaux → faster settling",
]
for i, line in enumerate(oneliners):
bg_color = LIGHT_BLUE if i % 2 == 0 else WHITE
story.append(Paragraph(f"→ {line}", S(f"ol{i}", parent="Normal",
fontSize=9, leading=13, textColor=DARK_BLUE,
leftIndent=6, spaceAfter=2, fontName="Helvetica")))
story.append(Spacer(1, 8))
# ────────────────────────────────────────────────────────────────────────────
# 12. MNEMONICS SUMMARY
# ────────────────────────────────────────────────────────────────────────────
story.append(section_header("12. MNEMONICS CHEAT SHEET", bg=PURPLE))
story.append(Spacer(1, 6))
mnemonics = [
("RSHIP", "Cardinal signs: Redness, Swelling, Heat, Increased pain, Pain/Functio laesa"),
("SALT", "Steps of leukocyte migration: Selectins (roll), Adhesion (integrins), L-selectin shed, Transmigration"),
("SLOW-RS", "Leukotrienes C4+D4+E4 = Slow Reacting Substance of Anaphylaxis"),
("5C = Complement Effects", "C1 (classical start), C3b (opsonin), C3a/C5a (anaphylatoxins), C5a (chemotaxis), C5b-9 (MAC lysis)"),
("NBA → CGD", "NBT = Nitroblue Tetrazolium; test negative in CGD = No NADPH oxidase"),
("CAFE = Chronic inflammation cells", "Cells: C=plasma cells (secrete Ab), A=Activated macrophages, F=Fibroblasts, E=Eosinophils; also Lymphocytes"),
("IL-6 FAST", "Fever, Acute phase proteins, Stimulates T-cells = IL-6 functions"),
("'Bread & Butter' heart", "Fibrinous pericarditis - classic gross appearance"),
("'Cold Abscess' = Job's", "Hyper-IgE syndrome: abscesses without heat/redness (cold)"),
("LAD = No Pus", "Leukocyte Adhesion Deficiency: can't migrate to tissue → no neutrophils at site → no pus"),
]
for mn, exp in mnemonics:
story.append(mnemonic_box(mn, exp))
story.append(Spacer(1, 3))
story.append(Spacer(1, 8))
# ────────────────────────────────────────────────────────────────────────────
# FOOTER / SOURCE
# ────────────────────────────────────────────────────────────────────────────
story.append(HRFlowable(width="100%", thickness=1, color=MED_BLUE))
story.append(Spacer(1, 4))
story.append(Paragraph(
"Source: Robbins & Kumar Basic Pathology (Robbins Pathology) | "
"Designed for MBBS / FMGE / USMLE Step 1 Preparation | Orris Medical Notes",
SOURCE))
# ── BUILD ────────────────────────────────────────────────────────────────────
doc.build(story)
print(f"PDF generated: {OUTPUT}")
cd /home/daytona/workspace/inflammation-notes && python3 generate_notes.py 2>&1
ls -lh /home/daytona/workspace/inflammation-notes/
Inflammation Notes MBBS
PDF Document · PDF
| # | Section | Content |
|---|---|---|
| 1 | Definition & Cardinal Signs | All 5 signs with Latin terms + mechanism; RSHIP mnemonic |
| 2 | Acute Inflammation | Vascular events, Exudate vs Transudate table, Leukocyte recruitment steps (Selectins → Integrins → PECAM-1), Neutrophil killing mechanisms |
| 3 | Chemical Mediators | Master table of ALL mediators (histamine, leukotrienes, prostaglandins, complement, cytokines, bradykinin, NO, ROS); Arachidonic acid pathway; Drug targets (aspirin, steroids, montelukast, zileuton) |
| 4 | Morphological Patterns | Serous, Fibrinous, Suppurative, Ulcer, Pseudomembranous, Hemorrhagic - with examples |
| 5 | Outcomes of Inflammation | Resolution, fibrosis, abscess, chronic inflammation, sepsis |
| 6 | Chronic Inflammation | Causes, cells, comparison table (Acute vs Chronic) |
| 7 | Granulomatous Inflammation | Caseating vs Non-caseating, Langhans vs Foreign body giant cells, disease list |
| 8 | Systemic Effects / APR | Fever mechanism, acute phase proteins (CRP, fibrinogen, SAA), ESR, anemia of chronic disease |
| 9 | Complement System | Classical/Lectin/Alternative pathways; C3b, C3a, C5a, MAC |
| 10 | Clinical Syndromes | CGD, LAD, Chediak-Higashi, MPO deficiency, Job's Syndrome |
| 11 | FMGE/USMLE One-liners | 30+ rapid revision points |
| 12 | Mnemonics Cheat Sheet | RSHIP, SLOW-RS, SALT, NBA-CGD, CAFE, and more |