Swelling is possible due to what all medical reasons and how to diagnose what will it indicate

Reading File
Finding Sources
Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Loading Image
I now have all the information needed for a comprehensive answer. Here it is:

Swelling (Edema): Medical Causes, Diagnosis, and Clinical Significance

Swelling - clinically called edema - is the accumulation of excess fluid in the interstitial space. It results from disruption of the normal balance of forces that govern fluid movement between capillaries, interstitium, and lymphatics. Understanding the mechanism behind swelling directly points to the underlying diagnosis.

The Four Pathophysiologic Mechanisms

Peripheral edema mechanism diagram

1. Increased Capillary Hydrostatic Pressure

Fluid is pushed out of capillaries into the interstitium when venous/capillary back-pressure rises.
CauseKey Features
Heart failure (right or congestive)Bilateral, dependent, pitting; worsens by evening; associated with raised JVP, S3 gallop, dyspnea, orthopnea
Renal failure (acute or chronic)Generalized pitting edema; associated with hypertension, uremic symptoms, elevated creatinine
Hepatic cirrhosisAscites + peripheral edema; spider angiomas, jaundice, low BP, hypoalbuminemia
Deep vein thrombosis (DVT)Unilateral leg swelling, pain, erythema, warmth
Chronic venous insufficiencyBilateral lower leg edema; medial malleolus ulcers; affects women of reproductive age
PregnancyDue to uterine compression of inferior vena cava + hormonal effects
Superior vena cava (SVC) syndromeEdema confined to face, neck, and upper extremities; caused by central obstruction (lung cancer, thrombus)
Constrictive pericarditisElevated JVP + Kussmaul's sign + early diastolic extra heart sound
MedicationsCalcium channel blockers (amlodipine), steroids (glucocorticoids, estrogens, anabolic steroids), vasodilators, cyclosporine
Paralysis / immobilizationFailure of the muscle venous pump - unilateral edema on affected side
Mineralocorticoid excessSalt/water retention by kidneys
  • Frameworks for Internal Medicine, p. 307
  • Guyton and Hall Textbook of Medical Physiology, p. 320

2. Decreased Capillary Oncotic Pressure (Low Plasma Proteins)

When albumin falls, less fluid is held inside capillaries - it leaks out.
CauseKey Features
Nephrotic syndromePeriorbital puffiness (prominent in morning), generalized edema; proteinuria ≥3.5 g/day, hypoalbuminemia, hypercholesterolemia
Hepatic cirrhosis / liver failureReduced albumin synthesis; Terry's nails (white opacification) may be present
Protein-calorie malnutrition (Kwashiorkor)Muscle atrophy, hollow temples, rib protrusion, peripheral edema in children
Protein-losing enteropathyProtein lost via gut; can be due to IBD, lymphangiectasia, severe gastroenteritis
Burns / large woundsProtein lost through denuded skin
  • Harrison's Principles of Internal Medicine 22E, p. 325
  • Frameworks for Internal Medicine, p. 309

3. Increased Capillary Permeability

Capillary walls become "leaky" due to inflammation, immune activation, or toxins.
CauseKey Features
Local inflammation (trauma, cellulitis, burns, insect stings)Localized, nonpitting edema; associated with erythema, pain, warmth
Allergic reaction / AnaphylaxisAngioedema - nondependent, nonpitting; lips, tongue, periorbital, hands, genitalia; mediated by histamine
ACE inhibitor-induced angioedemaBradykinin-mediated; does NOT respond to antihistamines; can be life-threatening if laryngeal
PreeclampsiaHypertension + proteinuria + edema at ≥20 weeks gestation; endothelial dysfunction is the mechanism
Sepsis / severe infectionCytokine storm increases permeability systemically
Systemic capillary leak syndromeRare; recurrent episodes of hypotension, hemoconcentration, edema
Idiopathic edemaWomen; unexplained face/hand/leg swelling; diuretic misuse often complicates it
Vitamin C deficiency (Scurvy)Impairs collagen in vessel walls
Prolonged ischemia / reperfusion injuryTissue injury increases local capillary permeability
  • Frameworks for Internal Medicine, p. 312-313
  • Guyton and Hall, p. 320

4. Lymphatic Obstruction (Increased Interstitial Oncotic Pressure)

When lymphatics are blocked, protein-rich fluid accumulates in interstitium, raising interstitial oncotic pressure - creating a self-perpetuating edema.
CauseKey Features
Malignant lymphatic obstruction (lymphoma, metastatic cancer)Unilateral; ipsilateral to obstruction; skin becomes thickened/darkened over time (lymphostatic verrucosis)
Filariasis (Wuchereria bancrofti)Parasitic infection; worldwide - most common infectious cause of lymphedema
Post-surgical lymphedemaAxillary dissection after breast cancer surgery; arm swelling
Radiation treatmentLymphatic fibrosis after radiation
Primary (congenital) lymphedemaAbsent or abnormal lymphatic vessels; intractable
Hypothyroidism (Myxedema)Nonpitting bilateral lower extremity edema; glycosaminoglycan deposition; associated with dry hair, constipation, bradycardia, weight gain
Graves' disease (pretibial myxedema)Bilateral, asymmetric, nonpitting, nondependent edema over pretibial region
  • Harrison's Principles of Internal Medicine 22E, p. 325
  • Frameworks for Internal Medicine, p. 310-311

Distribution of Edema: A Diagnostic Clue

The location of swelling is one of the most important guides to the cause:
DistributionThink of
Bilateral lower extremity, dependent, worsens eveningHeart failure, venous insufficiency, bilateral DVT
Periorbital, facial, worst in morningNephrotic syndrome, renal disease, angioedema
Ascites + leg edemaCirrhosis, heart failure, nephrotic syndrome
Unilateral leg swellingDVT, lymphedema, cellulitis, popliteal cyst rupture
Face, neck, arms onlySVC syndrome
Pretibial only, nonpittingGraves' dermopathy
Generalized nonpittingMyxedema (hypothyroidism)
Localized + warm + redInfection, inflammation, allergy
  • Harrison's Principles of Internal Medicine 22E

Diagnostic Approach

History

  • Onset: Sudden (DVT, angioedema) vs. gradual (heart failure, nephrotic syndrome)
  • Bilaterality: Unilateral = local cause; bilateral = systemic
  • Pitting vs. nonpitting: Pitting = fluid (cardiac, renal, hepatic); nonpitting = protein/myxedema/lymphedema
  • Time of day: Evening = cardiac/venous; morning = renal/nephrotic
  • Associated symptoms: Dyspnea (cardiac), jaundice (hepatic), proteinuria/frothy urine (nephrotic), weight gain/hair loss (thyroid), recent DVT risk factors
  • Medications: CCBs, steroids, NSAIDs, ACE inhibitors

Physical Examination

  • Pitting test: Press firmly over the tibia for 5 seconds - an indentation (pit) that persists indicates pitting edema
  • JVP: Elevated = cardiac or pericardial cause
  • Liver size: Hepatomegaly = right heart failure or cirrhosis
  • Ascites: Cirrhosis, heart failure, nephrotic syndrome
  • Skin signs: Spider angiomas, jaundice, palmar erythema = liver; pretibial thickening = myxedema; erythema, warmth = inflammation

Key Investigations

InvestigationWhat it tells you
Serum albuminLow = nephrotic syndrome, cirrhosis, malnutrition
Urine protein (spot protein:creatinine or 24-hour)Proteinuria ≥3.5 g/day = nephrotic syndrome
BNP / NT-proBNPElevated = heart failure
Serum creatinine, BUNElevated = renal disease
Liver enzymes (ALT, AST, bilirubin, PT/INR)Abnormal = hepatic cause
TSH, Free T4Low TSH + high T4 = hyperthyroid; High TSH + low T4 = hypothyroid (myxedema)
ECG + EchocardiogramCardiac structure and function
Duplex ultrasound (venous)DVT, venous insufficiency
CBCAnemia can indicate chronic disease or heart failure
Serum electrolytesHyponatremia = severe heart failure; hyperkalemia = renal failure
Chest X-rayPulmonary edema, cardiomegaly, pleural effusion
ANA, complement, ANCAIf glomerulonephritis suspected (edema + hematuria + proteinuria)

Quick Summary: Edema Type vs. Diagnosis

Edema TypeMost Likely Cause
Bilateral pitting + raised JVP + dyspneaHeart failure
Bilateral pitting + periorbital + frothy urineNephrotic syndrome
Bilateral pitting + jaundice + ascites + spider angiomasCirrhosis
Unilateral + acute + painful + warmDVT or cellulitis
Nonpitting + bilateral + bradycardia + dry skinHypothyroidism
Unilateral + chronic + thickened skinLymphedema
Face/lips/throat swelling + urticariaAllergic angioedema
Face/arm swelling + no hives + on ACE inhibitorACE inhibitor angioedema
Lower leg edema + hypertension + proteinuria in pregnancyPreeclampsia

Sources:
  • Harrison's Principles of Internal Medicine 22E - Chapter 43: Edema
  • Guyton and Hall Textbook of Medical Physiology - Chapter on Extracellular Fluid Regulation
  • Frameworks for Internal Medicine - Peripheral Edema Framework (p. 307-313)

Create a diagnostic flowchart PDF for swelling workup

Reading File
Running Command

mkdir -p /home/daytona/workspace/swelling-flowchart && ls /home/daytona/workspac…

Writing File

~/swelling-flowchart/generate_flowchart.py

from reportlab.lib.pagesizes import A3, landscape
from reportlab.lib import colors
from reportlab.lib.units import mm
from reportlab.pdfgen import canvas
from reportlab.lib.utils import simpleSplit

OUTPUT = "/home/daytona/workspace/swelling-flowchart/Swelling_Diagnostic_Flowchart.pdf"

# ── palette ──────────────────────────────────────────────────────────────────
C_TITLE_BG   = colors.HexColor("#1A237E")   # deep navy
C_TITLE_FG   = colors.white
C_START_BG   = colors.HexColor("#283593")   # indigo
C_STEP_BG    = colors.HexColor("#1565C0")   # dark blue
C_STEP_FG    = colors.white
C_DIAMOND_BG = colors.HexColor("#FF6F00")   # amber – decision nodes
C_DIAMOND_FG = colors.white
C_LEAF_BG    = {
    "cardiac":    colors.HexColor("#C62828"),
    "renal":      colors.HexColor("#4527A0"),
    "hepatic":    colors.HexColor("#1B5E20"),
    "nephrotic":  colors.HexColor("#0D47A1"),
    "thyroid":    colors.HexColor("#006064"),
    "lymph":      colors.HexColor("#1A237E"),
    "dvt":        colors.HexColor("#B71C1C"),
    "venous":     colors.HexColor("#880E4F"),
    "allergy":    colors.HexColor("#E65100"),
    "local":      colors.HexColor("#4E342E"),
    "precl":      colors.HexColor("#558B2F"),
    "medic":      colors.HexColor("#37474F"),
}
C_ARROW      = colors.HexColor("#37474F")
C_LINE       = colors.HexColor("#B0BEC5")
C_BG         = colors.HexColor("#F0F4FF")
C_SECTION_LINE = colors.HexColor("#90A4AE")

# ── helpers ──────────────────────────────────────────────────────────────────
def draw_rounded_box(c, x, y, w, h, fill, text_lines, font="Helvetica-Bold",
                     fsize=7.5, text_color=colors.white, radius=4, border_color=None):
    c.setFillColor(fill)
    if border_color:
        c.setStrokeColor(border_color)
        c.setLineWidth(1)
    else:
        c.setStrokeColor(fill)
        c.setLineWidth(0.5)
    c.roundRect(x, y, w, h, radius, fill=1, stroke=1)
    c.setFillColor(text_color)
    c.setFont(font, fsize)
    total_h = len(text_lines) * (fsize + 1.5)
    start_y = y + h/2 + total_h/2 - fsize
    for i, line in enumerate(text_lines):
        lw = c.stringWidth(line, font, fsize)
        c.drawString(x + w/2 - lw/2, start_y - i*(fsize+1.5), line)

def draw_diamond(c, cx, cy, hw, hh, fill, lines, fsize=7):
    c.setFillColor(fill)
    c.setStrokeColor(colors.white)
    c.setLineWidth(0.8)
    path = c.beginPath()
    path.moveTo(cx,      cy + hh)
    path.lineTo(cx + hw, cy)
    path.lineTo(cx,      cy - hh)
    path.lineTo(cx - hw, cy)
    path.close()
    c.drawPath(path, fill=1, stroke=1)
    c.setFillColor(colors.white)
    c.setFont("Helvetica-Bold", fsize)
    total_h = len(lines) * (fsize + 1.5)
    sy = cy + total_h/2 - fsize
    for i, line in enumerate(lines):
        lw = c.stringWidth(line, "Helvetica-Bold", fsize)
        c.drawString(cx - lw/2, sy - i*(fsize+1.5), line)

def arrow(c, x1, y1, x2, y2, label="", color=C_ARROW):
    c.setStrokeColor(color)
    c.setLineWidth(1.2)
    c.line(x1, y1, x2, y2)
    # arrowhead
    import math
    ang = math.atan2(y2-y1, x2-x1)
    al = 5
    aw = 3
    c.setFillColor(color)
    p = c.beginPath()
    p.moveTo(x2, y2)
    p.lineTo(x2 - al*math.cos(ang) + aw*math.sin(ang),
             y2 - al*math.sin(ang) - aw*math.cos(ang))
    p.lineTo(x2 - al*math.cos(ang) - aw*math.sin(ang),
             y2 - al*math.sin(ang) + aw*math.cos(ang))
    p.close()
    c.drawPath(p, fill=1, stroke=0)
    if label:
        c.setFillColor(C_ARROW)
        c.setFont("Helvetica-Bold", 6.5)
        mx, my = (x1+x2)/2, (y1+y2)/2
        c.drawString(mx+2, my+2, label)

def horiz_line(c, x1, x2, y, color=C_SECTION_LINE):
    c.setStrokeColor(color)
    c.setLineWidth(0.5)
    c.setDash(3, 3)
    c.line(x1, y, x2, y)
    c.setDash()

# ── page setup ───────────────────────────────────────────────────────────────
W, H = landscape(A3)   # 420 × 297 mm
c = canvas.Canvas(OUTPUT, pagesize=(W, H))

# background
c.setFillColor(C_BG)
c.rect(0, 0, W, H, fill=1, stroke=0)

# thin border
c.setStrokeColor(C_TITLE_BG)
c.setLineWidth(2)
c.rect(4, 4, W-8, H-8, fill=0, stroke=1)

# ── TITLE BAR ────────────────────────────────────────────────────────────────
c.setFillColor(C_TITLE_BG)
c.rect(4, H-38, W-8, 34, fill=1, stroke=0)
c.setFillColor(colors.white)
c.setFont("Helvetica-Bold", 17)
title = "DIAGNOSTIC FLOWCHART: SWELLING / EDEMA WORKUP"
c.drawString(W/2 - c.stringWidth(title,"Helvetica-Bold",17)/2, H-23, title)
c.setFont("Helvetica", 8)
sub = "Based on Harrison's Principles of Internal Medicine 22E | Guyton & Hall | Frameworks for Internal Medicine"
c.setFillColor(colors.HexColor("#B3C0FF"))
c.drawString(W/2 - c.stringWidth(sub,"Helvetica",8)/2, H-33, sub)

# ── LEGEND ───────────────────────────────────────────────────────────────────
LX = W - 105
LY = H - 115
c.setFillColor(colors.white)
c.setStrokeColor(C_LINE)
c.setLineWidth(0.5)
c.roundRect(LX-4, LY-6, 104, 72, 4, fill=1, stroke=1)
c.setFont("Helvetica-Bold", 7.5)
c.setFillColor(C_TITLE_BG)
c.drawString(LX+18, LY+58, "LEGEND")
legend_items = [
    (C_STEP_BG,    "Assessment Step"),
    (C_DIAMOND_BG, "Decision / Question"),
    (colors.HexColor("#C62828"), "Cardiac Diagnosis"),
    (colors.HexColor("#4527A0"), "Renal Diagnosis"),
    (colors.HexColor("#1B5E20"), "Hepatic Diagnosis"),
    (colors.HexColor("#37474F"), "Other Diagnosis"),
]
for i,(col,label) in enumerate(legend_items):
    ry = LY + 46 - i*10
    c.setFillColor(col)
    c.roundRect(LX, ry-5, 12, 8, 2, fill=1, stroke=0)
    c.setFillColor(C_TITLE_BG)
    c.setFont("Helvetica", 6.8)
    c.drawString(LX+15, ry-3, label)

# ─────────────────────────────────────────────────────────────────────────────
# LAYOUT  (all coords in points; A3 landscape = 841.9 × 595.3 pt)
# Row Y positions (top → bottom)
Y0 = H - 60     # START node
Y1 = Y0 - 40    # Step 1 (clinical assessment)
Y2 = Y1 - 42    # Diamond: Bilateral or Unilateral?
Y3 = Y2 - 40    # Diamond: Pitting or Nonpitting?   (bilateral branch)
Y4 = Y3 - 42    # Step 2 investigations
Y5 = Y4 - 42    # Final diagnoses row
Y6 = Y5 - 36    # further diagnoses (second row)

# Centre x
CX = W/2

# ── START ────────────────────────────────────────────────────────────────────
sx, sy, sw, sh = CX-52, Y0-14, 104, 22
draw_rounded_box(c, sx, sy, sw, sh, C_START_BG,
                 ["PATIENT PRESENTS WITH SWELLING"], "Helvetica-Bold", 8.5,
                 radius=11)

# arrow down
arrow(c, CX, sy, CX, Y1+22)

# ── STEP 1: Clinical Assessment ──────────────────────────────────────────────
bw, bh = 180, 38
draw_rounded_box(c, CX-bw/2, Y1-bh+22, bw, bh, C_STEP_BG,
                 ["STEP 1: CLINICAL ASSESSMENT",
                  "History: onset · location · duration · medications",
                  "Exam: pitting test · JVP · abdomen · skin signs"],
                 "Helvetica-Bold", 7.2, radius=5,
                 border_color=colors.HexColor("#90CAF9"))

arrow(c, CX, Y1-bh+22, CX, Y2+18)

# ── DIAMOND 1: Bilateral vs Unilateral ───────────────────────────────────────
draw_diamond(c, CX, Y2, 70, 20, C_DIAMOND_BG,
             ["BILATERAL", "or UNILATERAL?"])

# ── LEFT BRANCH: UNILATERAL ──────────────────────────────────────────────────
UX = 130   # x-centre of unilateral column

# horizontal left
c.setStrokeColor(C_ARROW); c.setLineWidth(1.2)
c.line(CX-70, Y2, UX+60, Y2)
arrow(c, UX+60, Y2, UX+60, Y2-2)   # tiny downward nub already at leaf level
# label
c.setFillColor(C_ARROW); c.setFont("Helvetica-Bold", 6.5)
c.drawString(UX+20, Y2+3, "UNILATERAL")

# Unilateral box
UBX = UX - 68
draw_rounded_box(c, UBX, Y2-56, 136, 52, C_STEP_BG,
                 ["UNILATERAL SWELLING",
                  "─────────────────────",
                  "DVT → Doppler US (D-dimer)",
                  "Cellulitis → CBC, CRP, culture",
                  "Lymphedema → CT/MRI lymphatics",
                  "Hematoma → Hx trauma, US",
                  "Popliteal cyst → US knee"],
                 "Helvetica", 6.8, radius=5,
                 border_color=colors.HexColor("#EF9A9A"))

# ── RIGHT BRANCH: bilateral ──────────────────────────────────────────────────
RX = W - 115  # x right label area
c.setStrokeColor(C_ARROW); c.setLineWidth(1.2)
c.line(CX+70, Y2, RX-20, Y2)
c.setFillColor(C_ARROW); c.setFont("Helvetica-Bold", 6.5)
c.drawString(RX-50, Y2+3, "BILATERAL")
arrow(c, CX, Y2-20, CX, Y3+20)  # down centre for bilateral

# ── DIAMOND 2: Pitting vs Nonpitting ─────────────────────────────────────────
draw_diamond(c, CX, Y3, 62, 18, C_DIAMOND_BG,
             ["PITTING or", "NON-PITTING?"])

# ── NONPITTING  → right ──────────────────────────────────────────────────────
NPX = W - 82
c.setStrokeColor(C_ARROW); c.setLineWidth(1.2)
c.line(CX+62, Y3, NPX-50, Y3)
c.setFillColor(C_ARROW); c.setFont("Helvetica-Bold", 6.5)
c.drawString(NPX-85, Y3+3, "NON-PITTING")
draw_rounded_box(c, NPX-50, Y3-42, 128, 40, C_STEP_BG,
                 ["NON-PITTING EDEMA",
                  "──────────────────────",
                  "Hypothyroid → TSH, Free T4",
                  "Lymphedema (cancer/filariasis)",
                  "Graves' dermopathy → T3,T4,TSH",
                  "Lipedema → clinical Dx"],
                 "Helvetica", 6.8, radius=5,
                 border_color=colors.HexColor("#80CBC4"))

# ── PITTING → down ───────────────────────────────────────────────────────────
arrow(c, CX, Y3-18, CX, Y4+bh-2)
c.setFillColor(C_ARROW); c.setFont("Helvetica-Bold", 6.5)
c.drawString(CX+3, Y3-10, "PITTING")

# ── STEP 2: Labs / Investigations ────────────────────────────────────────────
draw_rounded_box(c, CX-bw/2, Y4-bh+bh-2, bw, 38, C_STEP_BG,
                 ["STEP 2: KEY INVESTIGATIONS",
                  "BNP · Serum albumin · Urine protein · LFTs",
                  "Creatinine · TSH · Echo · Chest X-ray"],
                 "Helvetica-Bold", 7.2, radius=5,
                 border_color=colors.HexColor("#90CAF9"))

arrow(c, CX, Y4-bh+bh-2, CX, Y4-bh+bh-2-6)

# ── DIAMOND 3: Which system? ──────────────────────────────────────────────────
D3Y = Y4 - bh - 8
draw_diamond(c, CX, D3Y, 80, 22, C_DIAMOND_BG,
             ["WHICH SYSTEM", "IS IMPLICATED?"])

# ── SIX FINAL DIAGNOSIS LEAVES ───────────────────────────────────────────────
LW, LH = 118, 56
spacing = (W - 48) / 6
leaf_y  = D3Y - 70

leaves = [
    ("cardiac",   42,   ["CARDIAC",  "─────────────",
                          "↑ BNP/NT-proBNP",
                          "↑ JVP + S3 gallop",
                          "Echo: ↓ EF",
                          "Rx: Diuretics,",
                          "ACEi/ARB, β-blocker"]),
    ("renal",     160,  ["RENAL FAILURE", "─────────────",
                          "↑ Creatinine/BUN",
                          "Hyperkalemia",
                          "Metabolic acidosis",
                          "Proteinuria (CKD)",
                          "Rx: Dialysis, diuretics"]),
    ("nephrotic", 279,  ["NEPHROTIC SYNDROME", "──────────────",
                          "Protein ≥3.5 g/day",
                          "↓ Albumin",
                          "Periorbital edema",
                          "Rx: Treat cause,",
                          "diuretics, protein diet"]),
    ("hepatic",   398,  ["HEPATIC CIRRHOSIS", "──────────────",
                          "↑ LFTs, ↓ albumin",
                          "Ascites + jaundice",
                          "Spider angiomas",
                          "Rx: Salt restrict,",
                          "spironolactone"]),
    ("allergy",   517,  ["ALLERGY / ANGIOEDEMA", "──────────────",
                          "Hives / urticaria",
                          "ACEi → bradykinin",
                          "Preeclampsia: BP+",
                          "Rx: Antihistamine,",
                          "epi if severe"]),
    ("medic",     636,  ["OTHER CAUSES", "──────────────",
                          "Medications (CCB,",
                          "steroids, NSAIDs)",
                          "Pregnancy",
                          "Malnutrition/kwashiorkor",
                          "Rx: Stop offender"]),
]

for key, lx, lines in leaves:
    draw_rounded_box(c, lx, leaf_y - LH, LW, LH,
                     C_LEAF_BG.get(key, colors.HexColor("#37474F")),
                     lines, "Helvetica", 6.5, radius=5,
                     border_color=colors.white)
    # arrow from diamond base to top of box
    bx = lx + LW/2
    # draw elbow: down from diamond, then over, then down to box
    mid_y = D3Y - 28
    c.setStrokeColor(C_ARROW); c.setLineWidth(0.9)
    c.line(CX, D3Y-22, CX, mid_y)
    c.line(CX, mid_y, bx, mid_y)
    arrow(c, bx, mid_y, bx, leaf_y)

# ── FOOTER ───────────────────────────────────────────────────────────────────
c.setFillColor(C_TITLE_BG)
c.rect(4, 4, W-8, 14, fill=1, stroke=0)
c.setFillColor(colors.HexColor("#B3C0FF"))
c.setFont("Helvetica", 6.5)
footer = ("Sources: Harrison's Internal Medicine 22E | Guyton & Hall Medical Physiology | "
          "Frameworks for Internal Medicine  |  For clinical use only — always apply clinical judgment")
c.drawString(W/2 - c.stringWidth(footer,"Helvetica",6.5)/2, 8, footer)

c.save()
print("PDF saved →", OUTPUT)
Running Command

cd /home/daytona/workspace/swelling-flowchart && python generate_flowchart.py 2>…

Running Command

ls -lh /home/daytona/workspace/swelling-flowchart/Swelling_Diagnostic_Flowchart.…

Your diagnostic flowchart PDF is ready:

Swelling Diagnostic Flowchart

PDF Document · PDF


What's inside the flowchart (A3 landscape, single page):
The chart walks through a structured clinical decision tree:
  1. Patient presents with swelling - the entry node
  2. Step 1 - Clinical Assessment - history (onset, location, medications) + physical exam (pitting test, JVP, skin signs)
  3. Decision: Bilateral or Unilateral?
    • Unilateral branch - covers DVT (Doppler US), cellulitis (CBC/CRP), lymphedema, hematoma, popliteal cyst
    • Bilateral path continues downward
  4. Decision: Pitting or Non-Pitting?
    • Non-pitting branch - hypothyroidism (TSH/T4), lymphedema (cancer/filariasis), Graves' dermopathy, lipedema
    • Pitting continues downward
  5. Step 2 - Key Investigations - BNP, albumin, urine protein, LFTs, creatinine, TSH, Echo, CXR
  6. Decision: Which System? - fans out into 6 color-coded diagnosis leaves:
    • 🔴 Cardiac - ↑BNP, ↑JVP, S3 gallop, Echo EF; Rx: diuretics, ACEi/ARB, β-blocker
    • 🟣 Renal Failure - ↑Creatinine, hyperkalemia, metabolic acidosis; Rx: dialysis/diuretics
    • 🔵 Nephrotic Syndrome - Protein ≥3.5 g/day, ↓albumin, periorbital edema
    • 🟢 Hepatic Cirrhosis - ↑LFTs, ascites, spider angiomas; Rx: spironolactone
    • 🟠 Allergy/Angioedema/Preeclampsia - urticaria, ACEi, BP+; Rx: antihistamine/epi
    • Other Causes - medications (CCBs, steroids), pregnancy, malnutrition

Teach me thyroidism according to final year student

Reading File
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Loading Image
I have everything I need. Here is the complete, final-year-level teaching on thyroid disorders:

🩺 Thyroid Disorders - Final Year MBBS Master Guide

Sources: Robbins & Kumar Basic Pathology | Textbook of Family Medicine 9e | Harrison's Principles of Internal Medicine 22E

PART 1 - PHYSIOLOGY (Know This Cold)

The HPT Axis

Hypothalamus
    ↓  TRH (Thyrotropin-Releasing Hormone)
Anterior Pituitary
    ↓  TSH (Thyroid-Stimulating Hormone)
Thyroid Gland
    ↓  T3 + T4 (Thyroid Hormones)
Peripheral Tissues
    ↑ T3/T4 → NEGATIVE FEEDBACK on hypothalamus + pituitary

Hormone Synthesis (Step by Step)

  1. Iodine trapping - dietary iodine (I⁻) actively pumped into follicular cells via Na⁺/I⁻ symporter
  2. Oxidation - TPO (thyroid peroxidase) oxidizes I⁻ → I²
  3. Organification - iodine binds to tyrosine residues on thyroglobulin → MIT (monoiodotyrosine) and DIT (diiodotyrosine)
  4. Coupling - TPO couples MIT + DIT → T3 (MIT+DIT), T4 (DIT+DIT)
  5. Storage - T3/T4 stored in follicular colloid as thyroglobulin
  6. Release - TSH stimulates endocytosis of colloid → proteolysis → T3 + T4 secreted into blood
  7. Peripheral conversion - 80% of T3 comes from deiodination of T4 in liver/kidney by deiodinase

Key Facts to Memorize

ParameterValue
T4 : T3 secretion ratio20:1
Biologically active formT3 (10× more potent than T4)
T3 receptor affinity10-fold greater than T4
Transport proteinsTBG (major), Transthyretin, Albumin
Half-life T4~7 days
Half-life T3~1 day
Actions of thyroid hormone: Increase BMR, carbohydrate and lipid catabolism, protein synthesis, cardiac contractility, growth and development (critical for brain in fetus/neonate)
  • Robbins & Kumar Basic Pathology, p. 729

PART 2 - HYPERTHYROIDISM

Definition

Elevated circulating thyroid hormones → hypermetabolic state = thyrotoxicosis

Causes (Must Know All)

CauseMechanismKey Feature
Graves disease (85%)TSH-receptor stimulating antibodies (TRAb)Diffuse goiter + exophthalmos + pretibial myxedema
Toxic Multinodular Goiter (Plummer disease)Autonomous nodules overproduce T4Multiple palpable nodules; common in iodine-deficient areas
Toxic adenomaSingle autonomously functioning noduleSolitary "hot" nodule on scan
Thyroiditis (transient)Follicle destruction → hormone dumpPainful (de Quervain) or painless (postpartum)
TSH-secreting pituitary adenomaRare; TSH is HIGH (not suppressed)Central hyperthyroidism
Factitious / IatrogenicExogenous T4 excessLow RAIU; suppressed TSH

Graves Disease - The Most High-Yield

Pathogenesis:
  • Autoimmune - TSH-Receptor Stimulating Antibodies (TRAb/TSH-RS Abs) bind TSH receptor on thyroid cells
  • Mimic TSH → constant stimulation → excess T4 production
  • TSH becomes suppressed (<0.01 mIU/L) due to negative feedback
  • Associated with HLA-DR3, CTLA4 polymorphisms
Classic Triad:
  1. Thyrotoxicosis (diffuse goiter in >90%)
  2. Ophthalmopathy (exophthalmos/proptosis) - due to glycosaminoglycan deposition in retroorbital tissue
  3. Dermopathy (pretibial myxedema) - nonpitting, nondependent edema over shin
Histology: Diffuse hyperplasia of follicles + lymphoid infiltrates + scalloped colloid

Clinical Features of Hyperthyroidism (System by System)

SystemFeatures
ConstitutionalWeight loss despite increased appetite, heat intolerance, sweating, warm moist skin
CardiovascularTachycardia, palpitations, atrial fibrillation, wide pulse pressure, systolic hypertension
GIDiarrhea, hypermotility, malabsorption, steatorrhea
NeuromuscularAnxiety, tremor, irritability, proximal muscle weakness (thyroid myopathy ~50%)
OcularLid lag, wide staring gaze (due to sympathetic stimulation of superior tarsal muscle)
ReproductiveOligomenorrhea, infertility
Skin/HairFine hair, onycholysis (Plummer's nails)

Diagnosis of Hyperthyroidism

Step 1: sTSH → if SUPPRESSED (<0.1 mIU/L), proceed
Step 2: Free T4 + Free T3 → elevated confirms thyrotoxicosis
Step 3: Determine etiology:
    ├── TRAb (TSH-Receptor Antibodies) → Graves disease
    ├── RAIU (Radioactive Iodine Uptake) scan:
    │       Diffuse ↑ uptake → Graves disease
    │       Focal ↑ uptake → toxic adenoma
    │       ↓ uptake → thyroiditis or exogenous T4
    └── Anti-TPO, Anti-Tg antibodies → Hashimoto
Exam tip: TSH is the SINGLE MOST USEFUL screening test. It is suppressed even in subclinical hyperthyroidism before T4/T3 become elevated.

Treatment of Hyperthyroidism

OptionDrug/MethodKey Detail
Antithyroid drugsPropylthiouracil (PTU) or Methimazole (MMI)Block TPO (organification). PTU also blocks peripheral T4→T3 conversion. MMI preferred (longer acting). PTU preferred in 1st trimester pregnancy
Beta-blockersPropranololControls sympathetic symptoms (tachycardia, tremor) - does NOT reduce hormone levels
Radioiodine (¹³¹I) ablation¹³¹IDestroys thyroid tissue; most common definitive Rx in US; often causes hypothyroidism
SurgerySubtotal/total thyroidectomyFor large goiters, suspected malignancy, ¹³¹I failure

PART 3 - THYROID STORM ⚠️

A medical emergency. Abrupt onset of severe hyperthyroidism, most often in Graves disease.
Precipitants: Infection, surgery, trauma, stopping antithyroid meds, contrast dye
Features: Hyperpyrexia (fever >40°C), extreme tachycardia, agitation, delirium, vomiting, heart failure
Treatment (BBBBSS - mnemonic):
  • Beta-blocker (propranolol IV) - control HR
  • Block synthesis (PTU preferred - also blocks conversion)
  • Block release (Lugol's iodine after PTU - Wolff-Chaikoff effect) - give 1 hour AFTER PTU
  • Block conversion (PTU, glucocorticoids, propranolol)
  • Steroids (hydrocortisone) - prevent adrenal crisis + reduce T4→T3 conversion
  • Support (IV fluids, cooling, treat precipitant)

PART 4 - HYPOTHYROIDISM

Definition

Insufficient thyroid hormone to meet body needs → hypometabolic state TSH > 10 mIU/L (primary hypothyroidism)

Causes

CauseNotes
Hashimoto thyroiditis#1 cause in iodine-sufficient countries (US, UK, India urban)
Iodine deficiency#1 cause worldwide (~2 billion affected); causes endemic goiter and cretinism
Post-radioiodine / post-surgeryIatrogenic; permanent
DrugsLithium, amiodarone, iodides, antithyroid drugs
CongenitalThyroid dysgenesis, dyshormonogenesis; detected by neonatal TSH screening
Central (secondary)Pituitary failure (TSH low); hypothalamic failure (TRH low)
Postpartum thyroiditisTransient; ~6 weeks postpartum

Hashimoto Thyroiditis - The Most High-Yield

Pathogenesis:
  • Breakdown of self-tolerance to thyroid antigens
  • Autoimmune destruction via 3 mechanisms:
Pathogenesis of Hashimoto thyroiditis - Robbins & Kumar
  1. CD8+ cytotoxic T cells directly kill thyrocytes via MHC-I
  2. CD4+ Th1 cells release IFN-γ → activate macrophages → follicle destruction
  3. Anti-TPO antibodies + Anti-Tg antibodies → complement-mediated and ADCC destruction
Genetics: CTLA4 polymorphism (T-cell inhibitor gene mutation), HLA-DR3/DR5; 40% concordance in monozygotic twins
Histology: Diffuse lymphoplasmacytic infiltrate + germinal centres + Hürthle cell (oxyphil) change + interstitial fibrosis + atrophic follicles
Hürthle cells = metaplastic follicular cells with abundant eosinophilic granular cytoplasm (packed with mitochondria) - key histological marker
Clinical course:
  • Middle-aged woman (F:M = 10-14:1)
  • Painless diffuse goiter
  • "Hashitoxicosis" first - transient thyrotoxicosis from follicle rupture releasing stored hormone
  • Then progressive hypothyroidism as gland fibroses
  • Robbins & Kumar Basic Pathology, p. 731

Clinical Features of Hypothyroidism (System by System)

SystemFeatures
ConstitutionalFatigue, weight gain, cold intolerance, low BMR
CardiovascularBradycardia, diastolic hypertension, pericardial effusion, hypercholesterolemia
GIConstipation, decreased gut motility
NeuromuscularLethargy, cognitive slowing ("myxedema madness"), carpal tunnel syndrome, delayed relaxation of deep tendon reflexes
Skin/HairDry rough skin, coarse hair, hair loss, brittle nails, myxedema (non-pitting edema due to glycosaminoglycan deposition)
ReproductiveMenorrhagia, infertility, hyperprolactinemia (TRH stimulates PRL)
EyesPeriorbital puffiness (morning), loss of outer 1/3 of eyebrows
VoiceHoarseness (myxedematous infiltration of vocal cords)
Myxedema = non-pitting, diffuse edema due to accumulation of glycosaminoglycans (hyaluronic acid) in dermis. Worst in face, hands, legs.

Diagnosis of Hypothyroidism

Primary hypothyroidism:
    TSH ↑↑ + Free T4 ↓ → confirms primary hypothyroidism
    + Anti-TPO antibodies (+) → Hashimoto thyroiditis

Secondary hypothyroidism (rare):
    TSH low/normal + Free T4 low → pituitary failure
    → MRI pituitary; evaluate rest of pituitary axis

Subclinical hypothyroidism:
    TSH mildly ↑ (4.5-10) + Normal Free T4 → asymptomatic
    → Monitor; treat if TSH >10 or symptomatic

Treatment of Hypothyroidism

Levothyroxine (L-thyroxine / T4) is the drug of choice
  • Dose: 1.6 µg/kg/day (adults)
  • Elderly / cardiac patients: start low (25-50 µg/day), titrate slowly
  • Monitor TSH annually; target TSH = 0.5-2.5 mIU/L
  • Taken on empty stomach; interactions with calcium, iron, PPIs (reduce absorption)
T3 (Liothyronine): Some refractory patients with normal TSH but persistent symptoms may benefit from T4+T3 combination

PART 5 - MYXEDEMA COMA ⚠️

Severe life-threatening hypothyroidism (end-stage). Medical emergency.
Precipitants: Cold exposure, infection, sedatives, surgery, stopping levothyroxine
Features: Hypothermia, bradycardia, hypotension, hypoventilation, hyponatremia, altered consciousness/coma, myxedematous facies
Treatment:
  • IV T3 (liothyronine) or IV T4 - rapid hormone replacement
  • IV hydrocortisone (adrenal insufficiency often coexists)
  • Passive rewarming (not active - risk of vasodilation)
  • IV fluids, treat precipitant, mechanical ventilation if needed

PART 6 - THYROIDITIS (Summary)

TypeCausePainful?CourseAntibodies
Hashimoto (chronic lymphocytic)AutoimmuneNoProgressive → hypothyroidismAnti-TPO +++, Anti-Tg+
de Quervain (subacute granulomatous)Viral (post-URI)YES (severe)Self-limited; hyperthyroid → euthyroid → transient hypothyroid → recoveryESR ↑↑, mild Anti-TPO
Painless/silent (subacute lymphocytic)AutoimmuneNoSelf-limited; postpartum most commonAnti-TPO+
Riedel thyroiditisFibrous replacementNoRare; hard "iron thyroid"; may be IgG4-relatedNone specific
Acute suppurativeBacterialYESRare; abscess; treat with antibiotics/drainage-

PART 7 - THYROID NEOPLASMS (High-Yield Summary)

TumourOrigin%Key FeaturePrognosis
Papillary carcinomaFollicular cells80%"Orphan Annie eye" nuclei (ground-glass), nuclear grooves, pseudoinclusions; spreads via lymphatics; RET/BRAF mutationsExcellent (5yr survival >95%)
Follicular carcinomaFollicular cells10%Distinguished by capsular + vascular invasion (not cytology); PAX8/PPARG fusion; spreads hematogenously (lung, bone)Good
Medullary carcinomaParafollicular C cells5-8%Secretes calcitonin (tumour marker); amyloid deposits (calcitonin-derived); RET proto-oncogene mutation; 30% familial (MEN2A, MEN2B)Intermediate
Anaplastic carcinomaDedifferentiated follicular/papillary<1%Uniformly lethal; TP53 loss; rapid growth, compresses tracheaVery poor (<6 months median survival)
Exam tip: Only 1% of thyroid nodules are malignant. Fine-needle aspiration cytology (FNAC) is the primary diagnostic tool for any thyroid nodule.

PART 8 - QUICK EXAM COMPARISONS

Hyper vs. Hypo - Side-by-Side

FeatureHyperthyroidismHypothyroidism
Weight↓ (despite increased appetite)
Heart rate↑ (tachycardia, AF)↓ (bradycardia)
TemperatureHeat intolerance, warm skinCold intolerance, dry cold skin
GIDiarrheaConstipation
ReflexesHyperreflexiaDelayed (slow relaxation)
MoodAnxiety, irritabilityLethargy, depression
MenstruationOligomenorrheaMenorrhagia
TSH↓ (suppressed)
Free T4
Cholesterol

TSH Interpretation Cheat Sheet

TSHFree T4Diagnosis
↓↓ (<0.01)Overt hyperthyroidism
↓ (0.1-0.4)NormalSubclinical hyperthyroidism
NormalNormalEuthyroid
↑ (4.5-10)NormalSubclinical hypothyroidism
↑↑ (>10)Overt hypothyroidism
↓ or normalCentral/secondary hypothyroidism
↑↑TSH-secreting pituitary adenoma or thyroid hormone resistance

PART 9 - HIGH-YIELD EXAM MNEMONICS

GRAVES (features of Graves disease):
  • Goiter (diffuse)
  • Retroorbital inflammation (exophthalmos)
  • Autoimmune (TRAb)
  • Vascularization of thyroid (bruit over gland)
  • Exophthalmos + pretibial myxedema
  • Suppressed TSH
Hypothyroid features - "SLOW":
  • Skin (dry, coarse), Slowed reflexes
  • Lethargy, weight gain, Lipids ↑
  • Oedema (myxedema, periorbital)
  • Weight gain, cold intolerance
Antithyroid drugs - PTU vs MMI:
  • PTU = Pregnancy (1st trimester) + blocks Peripheral T4→T3 conversion
  • MMI = standard choice, once-daily dosing, preferred long-term

Sources:
  • Robbins & Kumar Basic Pathology - Chapter 18 (Endocrine System), pp. 729-731
  • Textbook of Family Medicine 9e - Chapter 35 (Thyroid Disorders), pp. 1019-1022
  • Textbook of Family Medicine 9e - Hashimoto thyroiditis and Graves treatment sections
This is a shared conversation. Sign in to Orris to start your own chat.