Inguinal canal

Reading File
Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Loading Image
Loading Image
Loading Image
Excellent - I now have comprehensive information and three excellent diagrams. Let me compile the full answer.

Inguinal Canal

The inguinal canal is a slit-like oblique passage through the lower anterior abdominal wall, approximately 4-6 cm long, running downward and medially just above and parallel to the inguinal ligament. It serves as a pathway for structures to pass from the abdomen into the perineum/scrotum (or labia), and is the most common site for hernia formation.
Inguinal Canal - Anterior view showing deep and superficial rings, inguinal ligament, and spermatic cord
Fig. 4.42 Inguinal Canal - Gray's Anatomy for Students

Openings

Deep (Internal) Inguinal Ring

  • Lies midway between the anterior superior iliac spine (ASIS) and the pubic symphysis, just above the inguinal ligament
  • Located immediately lateral to the inferior epigastric vessels
  • Not a simple hole - it is the beginning of a tubular evagination of the transversalis fascia, which becomes the internal spermatic fascia around the spermatic cord
  • Clinically: found approximately 2-3 cm above and lateral to the femoral artery pulse in the groin

Superficial (External) Inguinal Ring

  • Located superior to the pubic tubercle
  • A triangular opening in the aponeurosis of the external oblique, with apex pointing superolaterally and base formed by the pubic crest
  • Bounded by a medial crus (attached to pubic symphysis) and a lateral crus (attached to pubic tubercle), held together at the apex by intercrural fibers
  • The aponeurosis continues over the spermatic cord as the external spermatic fascia

Walls

WallStructure
AnteriorAponeurosis of external oblique (entire length); reinforced laterally by lower fibers of internal oblique (covering the deep ring)
PosteriorTransversalis fascia (entire length); reinforced medially by conjoint tendon (inguinal falx) along the medial one-third
Roof (Superior)Arching fibers of transversus abdominis and internal oblique muscles
Floor (Inferior)Medial half of the inguinal ligament (rolled-under free margin of external oblique aponeurosis); lacunar ligament reinforces the medial part
Internal oblique muscle and conjoint tendon forming the posterior wall and roof
Fig. 4.45 Internal Oblique Muscle and the Inguinal Canal - Gray's Anatomy for Students

Contents

In Males

  • Spermatic cord (testicular artery, pampiniform venous plexus, vas deferens, lymphatics, cremasteric muscle and fascia, autonomic nerves)

In Females

  • Round ligament of the uterus (descends to end in labia majora)
  • Genital branch of the genitofemoral nerve

In Both Sexes

  • Ilioinguinal nerve (passes through part of the canal and exits via the superficial ring to supply the upper medial thigh, scrotum/labia majora, and skin over pubic symphysis)
  • Lymphatic vessels

Coverings of the Spermatic Cord (Derived from Canal Layers)

As the testis descends, it acquires three fascial coverings derived from the abdominal wall layers:
LayerDerived From
Internal spermatic fasciaTransversalis fascia (at deep ring)
Cremasteric fascia + cremaster muscleInternal oblique
External spermatic fasciaExternal oblique aponeurosis (at superficial ring)

Protective Mechanism (Valvular Action)

The oblique passage of the inguinal canal is an important mechanical defence against herniation. When intra-abdominal pressure rises (coughing, straining), the anterior and posterior walls are compressed together, and the arching fibers of the internal oblique and transversus abdominis contract to "shutter" the deep ring. Weakness of this mechanism leads to hernia formation.

Clinical Relevance: Inguinal Hernias

Relationship between indirect inguinal, direct inguinal, and femoral hernias
Fig. 64.10 Comparison of direct, indirect, and femoral hernia sacs - Bailey & Love

Indirect (Lateral) Inguinal Hernia

  • Enters via the deep inguinal ring, lateral to the inferior epigastric vessels
  • Travels the full length of the inguinal canal; can descend into the scrotum
  • Often congenital - due to persistence of the processus vaginalis (patent tunica vaginalis)
  • Also occurs later in life when the deep ring stretches under positive abdominal pressure
  • More common in males; can be present from birth in neonates and children

Direct (Medial) Inguinal Hernia

  • Pushes directly through the posterior wall (transversalis fascia) of the canal, medial to the inferior epigastric vessels
  • Does not pass through the deep ring; does NOT descend into the scrotum
  • Always acquired - due to weakening of Hesselbach's triangle (bounded by inferior epigastric vessels laterally, rectus abdominis medially, inguinal ligament inferiorly)

Key Distinguishing Landmark

The inferior epigastric vessels (lying just medial to the deep ring) separate indirect (lateral) from direct (medial) hernias.

Embryological Note

The inguinal canal in males forms as a pathway for testicular descent during fetal life. The gubernaculum connects the caudal pole of the testis to the scrotum. As the testis descends, it pulls a peritoneal sleeve (processus vaginalis) with it, which should obliterate after birth. Failure of obliteration leaves a potential pathway for indirect inguinal hernia or hydrocele formation.

Sources: Gray's Anatomy for Students, p. 352-354 | Bailey and Love's Short Practice of Surgery, 28th Ed., p. 1087 | General Anatomy and Musculoskeletal System (THIEME Atlas), p. 231 | Sabiston Textbook of Surgery

Create a study guide on inguinal hernia types and clinical recognition

Reading File
Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Finding Sources
Loading Image
Loading Image
Loading Image
Finding Sources
Loading Image

Inguinal Hernia: Types & Clinical Recognition

Study Guide


1. Overview & Epidemiology

Inguinal hernias account for ~75% of all abdominal wall hernias, making them the most common hernia type. Two-thirds of inguinal hernias are indirect.
FactDetail
Male : Female ratio10:1
Right > LeftRelates to later descent of right testis
Indirect : Direct ratio~2:1
Lifetime risk~25% in males; ~5% in females
Peak incidenceBimodal - ages 0-5 years AND 70-80 years
Most common type in womenIndirect inguinal (5x more common than femoral in women)
Groin hernia types - indirect inguinal, direct inguinal, and femoral hernia shown in anatomical context
FIGURE 84-1 Groin hernia types - Tintinalli's Emergency Medicine

2. The Key Anatomical Landmark: Inferior Epigastric Vessels

This is the single most important landmark for classifying groin hernias:
Indirect hernia = lateral to inferior epigastric vessels (through deep ring) Direct hernia = medial to inferior epigastric vessels (through Hesselbach's triangle) Femoral hernia = below the inguinal ligament

3. Indirect Inguinal Hernia

Mechanism

  • Hernia sac enters through the deep inguinal ring (lateral to inferior epigastric vessels)
  • Traverses the full length of the inguinal canal obliquely
  • May descend into the scrotum (becomes scrotal hernia) or labia majora
  • Follows the path of the persistent processus vaginalis
Cross-sectional diagram of indirect inguinal hernia showing path through internal ring via persistent processus vaginalis
FIGURE 84-4 Indirect inguinal hernia - Tintinalli's

Aetiology

TypeMechanism
CongenitalPersistence of processus vaginalis; all paediatric inguinal hernias are indirect
AcquiredDeep inguinal ring stretched over time under chronic raised intra-abdominal pressure
  • Premature infants have higher incidence (processus vaginalis closes in last months of gestation)
  • Infants are at high risk of incarceration due to narrow inguinal ring

Clinical Features

  • Swelling appears in the groin, lateral to pubic tubercle
  • May extend down into scrotum with Valsalva/straining
  • Swelling reduces when lying down (spontaneously or with gentle pressure)
  • Cough impulse present in reducible hernias
  • Spermatic cord on affected side is thicker than opposite side

4. Direct Inguinal Hernia

Mechanism

  • Protrudes directly through the posterior wall of the inguinal canal, medial to the inferior epigastric vessels
  • Does NOT pass through the deep ring; does NOT traverse the full canal
  • Does NOT descend into the scrotum (distinguishing clinical feature)
  • Area of weakness = Hesselbach's triangle
Cross-sectional diagram of direct inguinal hernia showing herniation directly through posterior wall medial to inferior epigastric vessels
FIGURE 84-3 Direct inguinal hernia - Tintinalli's

Hesselbach's Triangle (Triangle of Doom)

BorderStructure
LateralInferior epigastric vessels
MedialLateral border of rectus abdominis
InferiorInguinal ligament
  • A direct hernia balloons outward through weakened transversalis fascia here
  • Always acquired, never congenital

Risk Factors for Direct Hernia

  • Older age (muscle/fascia weakening)
  • Male sex
  • Chronic raised intra-abdominal pressure (chronic cough, constipation, prostatism, obesity, heavy lifting)
  • Connective tissue disorders
  • Previous right iliac fossa surgery (damage to ilioinguinal nerve)
  • Family history

5. Side-by-Side Comparison

FeatureIndirectDirect
Entry pointDeep inguinal ring (lateral to IEV)Posterior wall (medial to IEV)
OriginCongenital or acquiredAlways acquired
PathOblique through canalDirect anteriorly
Descent to scrotumYes - canNo
AgeAny (peaks in infants + adults)Older adults
SexM > FAlmost exclusively male
Neck of sacNarrow (at deep ring)Wide (diffuse bulge)
Incarceration riskHigherLower
Strangulation riskHigher (narrow neck)Lower
Ring occlusion testControlledNOT controlled (bulges medially)
Finger impulse directionTip of fingerPulp of finger
Shape at restMay be elongated/tubularRounded, diffuse

6. Clinical Examination

Inspection

  • Examine standing with patient coughing/straining
  • Look for visible groin swelling; note if it extends into scrotum
  • Indirect: swelling descends toward scrotum; direct: rounded hemisphere medially

Palpation - Invagination Technique (Males)

  1. Invaginate the scrotal skin with the index finger
  2. Follow the spermatic cord upward to the superficial inguinal ring
  3. Introduce fingertip into the external ring
  4. Ask the patient to cough
Interpretation:
  • Direct hernia: impulse felt on the pulp of the finger (pushes straight forward)
  • Indirect hernia: impulse felt on the tip of the finger (pushes down the canal from lateral)
Ring occlusion test - thumb pressing on deep inguinal ring; direct hernia bulges medially despite occlusion
Figs. 38.15 & 38.16 Ring occlusion test - S Das Manual on Clinical Surgery

Ring Occlusion Test

After reducing the hernia, press the thumb firmly over the deep inguinal ring (½ inch above the midpoint between ASIS and pubic symphysis). Ask the patient to cough:
  • Indirect hernia: controlled - no bulge (sac cannot escape from deep ring)
  • Direct hernia: NOT controlled - bulge appears medial to occluding thumb (hernia exits through posterior wall, not through deep ring)

Percussion

  • Resonant = enterocele (intestine present)
  • Dull = epiplocele (omentum present) or extraperitoneal fat

Auscultation

  • Bowel sounds over hernia sac = intestinal contents (enterocele)

7. Special Hernia Types

Sliding Hernia

  • Part of the hernia sac wall is formed by a viscus (usually sigmoid colon on left, caecum on right)
  • Retroperitoneal organ "slides" into the canal
  • Important surgical hazard: opening the sac may inadvertently enter the bowel lumen

Pantaloon Hernia (Combined/Saddle-Bag Hernia)

  • Both direct AND indirect components present simultaneously
  • Inferior epigastric vessels run between the two sacs
  • Like a pantaloon (trousers) straddling the vessels
  • Classified as Nyhus IIIB

Richter Hernia

  • Only the antimesenteric border of the bowel wall (not the full circumference) is trapped
  • May NOT cause complete bowel obstruction or vomiting - diagnosis easily missed
  • High risk of strangulation and gangrene because blood supply compromised to that wall segment
  • Requires urgent surgical repair

Maydl Hernia (Hernia-en-W)

  • Two loops of bowel herniate, with the interconnecting loop remaining in the peritoneal cavity
  • The intra-abdominal loop strangulates without external signs

Paediatric Inguinal Hernia

  • Always indirect (by definition - processus vaginalis patent)
  • High incarceration risk in infants due to narrow ring
  • Presents as groin bulge (noticed during nappy changes)
  • The cord on the affected side is thicker
  • Treatment = herniorrhaphy (ligating processus vaginalis); no floor reconstruction needed

8. Complications

Reducible → Irreducible → Incarcerated → Strangulated

StageDefinitionFeatures
ReducibleContents return to abdomen spontaneously or with pressureSoft, non-tender, cough impulse
IrreducibleCannot be reduced without surgical intervention; not yet compromisedFirm, no cough impulse
IncarceratedIrreducible + associated swelling/oedema of contentsPain, unable to reduce, no cough impulse
StrangulatedIncarcerated + vascular compromise/ischaemia of contentsAcutely tender, overlying erythema, systemic toxicity, obstruction
Key clinical rule: A strangulated hernia is a surgical emergency. The incarcerated hernia without overt strangulation signs may be carefully attempted for manual reduction (taxis) - but if not reducible, urgent groin exploration is required.
Femoral hernias are particularly dangerous - 40% present as emergencies with incarceration/strangulation (narrow femoral ring makes them highly susceptible).

9. Classification System: Nyhus

TypeDescription
IIndirect - normal-sized internal ring; typically infants, children, small adults
IIIndirect - dilated internal ring; posterior wall intact; inferior epigastric vessels not displaced; does not extend to scrotum
IIIADirect - posterior wall defect; size not taken into account
IIIBIndirect - dilated ring encroaching on Hesselbach's triangle (massive scrotal, sliding, or pantaloon type)
IIICFemoral hernia
IVARecurrent direct
IVBRecurrent indirect
IVCRecurrent femoral
IVDRecurrent combined
The European Hernia Society (EHS) classification uses: Location (M/L/F) + Defect size (1/2/3 fingers) + Status (P = primary, R = recurrent)

10. Differential Diagnosis of a Groin Swelling

ConditionKey Distinguishing Features
Indirect inguinal herniaAbove inguinal ligament, lateral, cough impulse, may reach scrotum
Direct inguinal herniaAbove inguinal ligament, medial, rounded, doesn't reach scrotum
Femoral herniaBelow inguinal ligament, lateral to pubic tubercle, more common in females
HydroceleTransilluminates brightly; can get above it on palpation; no cough impulse
Communicating hydroceleTransilluminates; fluctuates in size with posture (connected to peritoneum)
Encysted hydrocele of cordDescends with traction on testis; transilluminates
Varicocele"Bag of worms" feel; does not transilluminate; left > right
LymphadenopathyFirm/rubbery; no cough impulse; look for primary source (foot, leg, genitalia)
Saphena varixBelow inguinal ligament; has cough impulse; compressible; blue skin tinge; often with varicose veins below
Femoral artery aneurysmExpansile pulsatile swelling; moves side-to-side; may have bruit
Lipoma of cordSoft; no cough impulse; found in cord during surgery
Psoas abscessFluctuant; no cough impulse; usually midline origin with lateral tracking

11. Quick Reference: Clinical Pearl Mnemonics

"MALE gets indirect, OLD MALE gets direct"
  • Indirect: congenital (patent processus vaginalis) or early adult acquired
  • Direct: acquired later in life from posterior wall weakness
Impulse direction:
  • direct → down onto finger pulp (pulp = direct)
  • Indirect → up the canal onto finger tip (tip = indirect)
Ring occlusion test:
  • Blocking the deep ring: stops Indirect, doesn't stop Direct
  • "I" = Indirect = I can stop it; "D" = Direct = you can't stop it by blocking the deep ring
Femoral hernia vs inguinal hernia:
  • Inguinal = above and medial to the pubic tubercle
  • Femoral = below and lateral to the pubic tubercle

Sources: Tintinalli's Emergency Medicine | Mulholland & Greenfield's Surgery, 7e | Schwartz's Principles of Surgery, 11e | S Das Manual on Clinical Surgery, 13e | Bailey & Love's Short Practice of Surgery, 28e | Fischer's Mastery of Surgery, 8e | Roberts & Hedges' Clinical Procedures in Emergency Medicine

Generate a quick reference cheat sheet PDF for exams

Reading File
Running Command

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

Running Command

mkdir -p /home/daytona/workspace/inguinal-hernia && python3 -c "from reportlab.l…

Writing File

~/inguinal-hernia/build_cheatsheet.py

"""
Inguinal Hernia Quick Reference Cheat Sheet
Generates a 2-page A4 PDF optimised for exam revision.
"""

from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.units import mm, cm
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_RIGHT
from reportlab.platypus import (
    SimpleDocTemplate, Paragraph, Table, TableStyle, Spacer,
    HRFlowable, KeepTogether
)
from reportlab.platypus.flowables import HRFlowable
from reportlab.lib.colors import HexColor, white, black

# ── Colour palette ────────────────────────────────────────────────────────────
C_DARK   = HexColor("#1a2b4a")   # navy   - main headers
C_BLUE   = HexColor("#2563eb")   # blue   - section bars
C_TEAL   = HexColor("#0891b2")   # teal   - sub-headers
C_RED    = HexColor("#dc2626")   # red    - danger / strangulation
C_AMBER  = HexColor("#d97706")   # amber  - incarceration / caution
C_GREEN  = HexColor("#16a34a")   # green  - reducible / normal
C_LGREY  = HexColor("#f1f5f9")   # light grey - alt table rows
C_MGREY  = HexColor("#e2e8f0")   # medium grey - table header bg
C_TEXT   = HexColor("#1e293b")   # near-black body text
C_MUTED  = HexColor("#64748b")   # muted grey footnotes

OUTPUT = "/home/daytona/workspace/inguinal-hernia/Inguinal_Hernia_Cheatsheet.pdf"

# ── Document ──────────────────────────────────────────────────────────────────
doc = SimpleDocTemplate(
    OUTPUT,
    pagesize=A4,
    leftMargin=12*mm,
    rightMargin=12*mm,
    topMargin=12*mm,
    bottomMargin=10*mm,
    title="Inguinal Hernia Quick Reference",
    author="Orris Medical Study Guides",
)

W, H = A4
USABLE_W = W - 24*mm   # total usable width

# ── Styles ────────────────────────────────────────────────────────────────────
styles = getSampleStyleSheet()

def style(name, **kw):
    base = styles["Normal"]
    return ParagraphStyle(name, parent=base, **kw)

S_TITLE   = style("Title",   fontName="Helvetica-Bold",  fontSize=18, textColor=white,
                  leading=22, alignment=TA_CENTER, spaceAfter=2)
S_SUBTITLE= style("Sub",     fontName="Helvetica",       fontSize=9,  textColor=HexColor("#cbd5e1"),
                  leading=11, alignment=TA_CENTER, spaceAfter=0)
S_SEC     = style("Sec",     fontName="Helvetica-Bold",  fontSize=9,  textColor=white,
                  leading=11, alignment=TA_LEFT,   spaceBefore=2, spaceAfter=1)
S_BODY    = style("Body",    fontName="Helvetica",       fontSize=7.5, textColor=C_TEXT,
                  leading=10.5, spaceAfter=1)
S_BOLD    = style("Bold",    fontName="Helvetica-Bold",  fontSize=7.5, textColor=C_TEXT,
                  leading=10.5)
S_SMALL   = style("Small",   fontName="Helvetica",       fontSize=6.5, textColor=C_MUTED,
                  leading=9, alignment=TA_CENTER)
S_TH      = style("TH",      fontName="Helvetica-Bold",  fontSize=7,  textColor=C_DARK,
                  leading=9,  alignment=TA_CENTER)
S_TD      = style("TD",      fontName="Helvetica",       fontSize=7,  textColor=C_TEXT,
                  leading=9.5)
S_TDC     = style("TDC",     fontName="Helvetica",       fontSize=7,  textColor=C_TEXT,
                  leading=9.5, alignment=TA_CENTER)
S_TDB     = style("TDB",     fontName="Helvetica-Bold",  fontSize=7,  textColor=C_TEXT,
                  leading=9.5)
S_WARN    = style("Warn",    fontName="Helvetica-Bold",  fontSize=7.5, textColor=C_RED,
                  leading=10)
S_MNEM    = style("Mnem",    fontName="Helvetica-Oblique", fontSize=7.5, textColor=C_DARK,
                  leading=10.5, leftIndent=4)
S_NOTE    = style("Note",    fontName="Helvetica-Oblique", fontSize=6.5, textColor=C_MUTED,
                  leading=9)

def P(text, s=S_BODY): return Paragraph(text, s)
def PB(text):          return Paragraph(text, S_BOLD)
def PW(text):          return Paragraph(text, S_WARN)

def section_bar(title, color=C_BLUE):
    """Coloured section header bar."""
    t = Table([[P(title, S_SEC)]], colWidths=[USABLE_W])
    t.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,-1), color),
        ("LEFTPADDING",  (0,0), (-1,-1), 5),
        ("RIGHTPADDING", (0,0), (-1,-1), 5),
        ("TOPPADDING",   (0,0), (-1,-1), 3),
        ("BOTTOMPADDING",(0,0), (-1,-1), 3),
        ("ROUNDEDCORNERS", [3]),
    ]))
    return t

def h_rule():
    return HRFlowable(width="100%", thickness=0.5, color=C_MGREY, spaceAfter=2, spaceBefore=2)

def table_style(header_color=C_MGREY, alt=True):
    cmds = [
        ("BACKGROUND",   (0,0), (-1,0),  header_color),
        ("GRID",         (0,0), (-1,-1), 0.4, HexColor("#cbd5e1")),
        ("LEFTPADDING",  (0,0), (-1,-1), 4),
        ("RIGHTPADDING", (0,0), (-1,-1), 4),
        ("TOPPADDING",   (0,0), (-1,-1), 2),
        ("BOTTOMPADDING",(0,0), (-1,-1), 2),
        ("ROWBACKGROUNDS",(0,1),(-1,-1), [white, C_LGREY] if alt else [white]),
        ("VALIGN",       (0,0), (-1,-1), "MIDDLE"),
    ]
    return TableStyle(cmds)

# ══════════════════════════════════════════════════════════════════════════════
story = []

# ── PAGE HEADER ───────────────────────────────────────────────────────────────
header = Table(
    [[P("INGUINAL HERNIA", S_TITLE),
      P("Quick Reference Cheat Sheet  |  Surgery & Clinical Anatomy  |  Exam Edition", S_SUBTITLE)]],
    colWidths=[USABLE_W]
)
header.setStyle(TableStyle([
    ("BACKGROUND", (0,0), (-1,-1), C_DARK),
    ("TOPPADDING",   (0,0), (-1,-1), 8),
    ("BOTTOMPADDING",(0,0), (-1,-1), 6),
    ("LEFTPADDING",  (0,0), (-1,-1), 10),
]))
story.append(header)
story.append(Spacer(1, 3*mm))

# ══════════════════════════════════════════════════════════════════════════════
# SECTION 1 – EPIDEMIOLOGY  (two mini-tables side by side)
# ══════════════════════════════════════════════════════════════════════════════
story.append(section_bar("1  EPIDEMIOLOGY & RISK FACTORS"))
story.append(Spacer(1, 1*mm))

epi_data = [
    [P("Parameter", S_TH), P("Value", S_TH)],
    [P("% of all hernias", S_TDC), P("75% inguinal  |  5% femoral  |  15% incisional/umbilical", S_TD)],
    [P("Indirect : Direct", S_TDC), P("2 : 1", S_TDC)],
    [P("Male : Female", S_TDC), P("10 : 1", S_TDC)],
    [P("Lifetime risk", S_TDC), P("~25% males  |  ~5% females", S_TDC)],
    [P("Peak ages", S_TDC), P("0–5 yrs  AND  70–80 yrs (bimodal)", S_TD)],
    [P("Right > Left", S_TDC), P("Due to later descent of right testis", S_TD)],
    [P("Most common in women", S_TDC), P("Indirect inguinal (5× > femoral)", S_TD)],
]
epi_t = Table(epi_data, colWidths=[USABLE_W*0.28, USABLE_W*0.72])
epi_t.setStyle(table_style())
story.append(epi_t)
story.append(Spacer(1, 2*mm))

# ══════════════════════════════════════════════════════════════════════════════
# SECTION 2 – TYPE COMPARISON (full-width)
# ══════════════════════════════════════════════════════════════════════════════
story.append(section_bar("2  INDIRECT vs DIRECT vs FEMORAL — COMPARISON"))
story.append(Spacer(1, 1*mm))

CW = USABLE_W / 4
comp_data = [
    [P("Feature", S_TH), P("INDIRECT", S_TH), P("DIRECT", S_TH), P("FEMORAL", S_TH)],
    [P("Entry point", S_TDB),
     P("Deep inguinal ring — lateral to IEV", S_TD),
     P("Posterior wall (Hesselbach's △) — medial to IEV", S_TD),
     P("Femoral canal — below inguinal lig.", S_TD)],
    [P("Relation to IEV", S_TDB),
     P("Lateral", S_TDC), P("Medial", S_TDC), P("Below lig.", S_TDC)],
    [P("Relation to pubic tubercle", S_TDB),
     P("Above & lateral", S_TDC), P("Above & medial", S_TDC), P("Below & lateral", S_TDC)],
    [P("Aetiology", S_TDB),
     P("Congenital (patent PV) or acquired", S_TD),
     P("Always acquired", S_TD),
     P("Acquired (raised IAP in women)", S_TD)],
    [P("Descends to scrotum?", S_TDB),
     P("YES", S_TDC), P("NO", S_TDC), P("NO", S_TDC)],
    [P("Neck of sac", S_TDB),
     P("Narrow", S_TDC), P("Wide (diffuse)", S_TDC), P("Very narrow", S_TDC)],
    [P("Strangulation risk", S_TDB),
     P("Moderate", S_TDC),
     P("Low", S_TDC),
     P("HIGH (40% present as emergency)", S_TDC)],
    [P("Ring occlusion test", S_TDB),
     P("Controlled (no bulge)", S_TDC),
     P("NOT controlled (medial bulge)", S_TDC),
     P("N/A", S_TDC)],
    [P("Finger tip/pulp", S_TDB),
     P("TIP of finger", S_TDC), P("PULP of finger", S_TDC), P("—", S_TDC)],
    [P("Sex predominance", S_TDB),
     P("M >> F", S_TDC), P("Almost exclusively M", S_TDC), P("F > M", S_TDC)],
]
comp_t = Table(comp_data, colWidths=[CW*0.85, CW*1.05, CW*1.05, CW*1.05])
ts = table_style(header_color=HexColor("#dbeafe"))
ts.add("BACKGROUND", (1,0), (1,0), HexColor("#dbeafe"))
ts.add("BACKGROUND", (2,0), (2,0), HexColor("#fce7f3"))
ts.add("BACKGROUND", (3,0), (3,0), HexColor("#fef3c7"))
comp_t.setStyle(ts)
story.append(comp_t)
story.append(Spacer(1, 2*mm))

# ══════════════════════════════════════════════════════════════════════════════
# SECTION 3 + 4 side by side: Hesselbach's Triangle  |  Clinical Exam
# ══════════════════════════════════════════════════════════════════════════════
HALF = (USABLE_W - 4*mm) / 2

# --- Hesselbach's triangle ---
hess_items = [
    section_bar("3  HESSELBACH'S TRIANGLE", color=C_TEAL),
    Spacer(1, 1*mm),
    Table([
        [P("Border", S_TH), P("Structure", S_TH)],
        [P("Lateral", S_TDC),   P("Inferior epigastric vessels (IEV)", S_TD)],
        [P("Medial", S_TDC),    P("Lateral border of rectus abdominis", S_TD)],
        [P("Inferior", S_TDC),  P("Inguinal ligament", S_TD)],
    ], colWidths=[HALF*0.3, HALF*0.7], style=table_style(alt=False)),
    Spacer(1, 1.5*mm),
    P("<b>Direct hernia</b> occurs here — posterior wall weakness allows peritoneum to balloon forward.", S_BODY),
    Spacer(1, 1.5*mm),
    section_bar("4  DEEP INGUINAL RING LOCATION", color=C_TEAL),
    Spacer(1, 1*mm),
    P("Midpoint between <b>ASIS</b> and <b>pubic symphysis</b>, just above inguinal ligament, immediately <b>lateral to IEV</b>.", S_BODY),
    Spacer(1, 1.5*mm),
    P("• Normal ring = triangular slit admitting only fingertip", S_BODY),
    P("• If >1 finger enters easily = abnormally enlarged", S_BODY),
]

# --- Clinical examination ---
exam_items = [
    section_bar("5  CLINICAL EXAMINATION STEPS", color=C_TEAL),
    Spacer(1, 1*mm),
    P("<b>1. Inspect</b> standing — look for groin swelling with cough/Valsalva", S_BODY),
    P("<b>2. Invagination technique</b> (males):", S_BODY),
    P("  • Invaginate scrotal skin with index finger", S_BODY),
    P("  • Follow spermatic cord up to external ring", S_BODY),
    P("  • Ask patient to cough", S_BODY),
    P("  → Impulse on <b>TIP</b> = <b>INDIRECT</b>", S_BODY),
    P("  → Impulse on <b>PULP</b> = <b>DIRECT</b>", S_BODY),
    Spacer(1, 1.5*mm),
    P("<b>3. Ring Occlusion Test</b> (after reduction):", S_BODY),
    P("  • Press thumb on deep ring (½\" above mid-inguinal point)", S_BODY),
    P("  • Ask to cough", S_BODY),
    P("  → Controlled = <b>INDIRECT</b>  |  Medial bulge = <b>DIRECT</b>", S_BODY),
    Spacer(1, 1.5*mm),
    P("<b>4. Percussion:</b> Resonant = bowel (enterocele)  |  Dull = omentum/fat", S_BODY),
    P("<b>5. Can you get above the swelling?</b>", S_BODY),
    P("  → Yes = hydrocele  |  No = hernia (descends from abdomen)", S_BODY),
    P("<b>6. Transillumination:</b> Positive = hydrocele  |  Negative = hernia", S_BODY),
]

two_col = Table(
    [[hess_items, exam_items]],
    colWidths=[HALF, HALF],
)
two_col.setStyle(TableStyle([
    ("VALIGN",       (0,0), (-1,-1), "TOP"),
    ("LEFTPADDING",  (0,0), (-1,-1), 0),
    ("RIGHTPADDING", (0,0), (-1,-1), 0),
    ("TOPPADDING",   (0,0), (-1,-1), 0),
    ("BOTTOMPADDING",(0,0), (-1,-1), 0),
    ("INNERGRID",    (0,0), (-1,-1), 0, white),
    ("RIGHTPADDING", (0,0), (0,-1),  4),
]))
story.append(two_col)
story.append(Spacer(1, 2*mm))

# ══════════════════════════════════════════════════════════════════════════════
# SECTION 6 – COMPLICATIONS LADDER
# ══════════════════════════════════════════════════════════════════════════════
story.append(section_bar("6  COMPLICATIONS — REDUCIBLE → STRANGULATED", color=C_RED))
story.append(Spacer(1, 1*mm))

comp2_data = [
    [P("Stage", S_TH), P("Definition", S_TH), P("Clinical Signs", S_TH), P("Action", S_TH)],
    [P("Reducible", S_TDC),
     P("Contents return spontaneously", S_TD),
     P("Soft, non-tender, cough impulse present", S_TD),
     P("Elective repair", S_TDC)],
    [P("Irreducible", S_TDC),
     P("Cannot be manually reduced; no vascular compromise", S_TD),
     P("Firm, no cough impulse", S_TD),
     P("Urgent review", S_TDC)],
    [P("Incarcerated", S_TDC),
     P("Irreducible + oedema of contents", S_TD),
     P("Pain, swelling, tender; no cough impulse", S_TD),
     P("Attempt taxis (careful reduction); if fails → surgery", S_TDC)],
    [P("STRANGULATED", S_TDB),
     P("Incarcerated + vascular compromise → ischaemia/gangrene", S_TD),
     P("Acutely tender, erythema, systemic toxicity, bowel obstruction", S_TD),
     P("EMERGENCY surgery", S_TDC)],
]
comp2_t = Table(comp2_data, colWidths=[USABLE_W*0.13, USABLE_W*0.28, USABLE_W*0.33, USABLE_W*0.26])
comp2_ts = table_style(header_color=HexColor("#fee2e2"))
comp2_ts.add("BACKGROUND", (0,4), (-1,4), HexColor("#fef2f2"))
comp2_ts.add("TEXTCOLOR",  (0,4), (-1,4), C_RED)
comp2_t.setStyle(comp2_ts)
story.append(comp2_t)
story.append(Spacer(1, 2*mm))

# ══════════════════════════════════════════════════════════════════════════════
# SECTION 7 – NYHUS + 8 – SPECIAL TYPES  side by side
# ══════════════════════════════════════════════════════════════════════════════
nyhus_items = [
    section_bar("7  NYHUS CLASSIFICATION", color=HexColor("#7c3aed")),
    Spacer(1, 1*mm),
    Table([
        [P("Type", S_TH), P("Description", S_TH)],
        [P("I",    S_TDC), P("Indirect — normal-sized ring (infants, children)", S_TD)],
        [P("II",   S_TDC), P("Indirect — dilated ring; posterior wall intact; not scrotal", S_TD)],
        [P("IIIA",S_TDC), P("Direct — posterior wall defect", S_TD)],
        [P("IIIB",S_TDC), P("Indirect — ring encroaches on Hesselbach's △ (scrotal/sliding/pantaloon)", S_TD)],
        [P("IIIC",S_TDC), P("Femoral", S_TD)],
        [P("IV",  S_TDC), P("Recurrent (A=direct, B=indirect, C=femoral, D=combined)", S_TD)],
    ], colWidths=[HALF*0.18, HALF*0.82], style=table_style(alt=True)),
    Spacer(1, 1.5*mm),
    P("<b>EHS Classification:</b> Location (M/L/F) + Size (1/2/3 fingers) + Status (P/R)", S_BODY),
]

special_items = [
    section_bar("8  SPECIAL HERNIA TYPES", color=HexColor("#7c3aed")),
    Spacer(1, 1*mm),
    PB("Sliding hernia"),
    P("Part of sac wall IS the viscus (sigmoid left, caecum right). Risk of bowel injury on opening sac.", S_BODY),
    Spacer(1, 1*mm),
    PB("Pantaloon (Saddle-bag) hernia"),
    P("Direct + indirect components straddle the IEV. Both sacs present simultaneously = Nyhus IIIB.", S_BODY),
    Spacer(1, 1*mm),
    PB("Richter hernia"),
    P("Only antimesenteric wall of bowel trapped. NO obstruction/vomiting initially. High strangulation risk.", S_BODY),
    Spacer(1, 1*mm),
    PB("Maydl hernia (hernia-en-W)"),
    P("Two loops herniate; intervening loop remains in abdomen and strangulates without external signs.", S_BODY),
]

two_col2 = Table(
    [[nyhus_items, special_items]],
    colWidths=[HALF, HALF],
)
two_col2.setStyle(TableStyle([
    ("VALIGN",       (0,0), (-1,-1), "TOP"),
    ("LEFTPADDING",  (0,0), (-1,-1), 0),
    ("RIGHTPADDING", (0,0), (-1,-1), 0),
    ("TOPPADDING",   (0,0), (-1,-1), 0),
    ("BOTTOMPADDING",(0,0), (-1,-1), 0),
    ("RIGHTPADDING", (0,0), (0,-1),  4),
]))
story.append(two_col2)
story.append(Spacer(1, 2*mm))

# ══════════════════════════════════════════════════════════════════════════════
# SECTION 9 – DIFFERENTIAL DIAGNOSIS TABLE
# ══════════════════════════════════════════════════════════════════════════════
story.append(section_bar("9  DIFFERENTIAL DIAGNOSIS OF A GROIN SWELLING", color=HexColor("#0f766e")))
story.append(Spacer(1, 1*mm))

dd_data = [
    [P("Condition", S_TH), P("Position", S_TH), P("Cough Impulse", S_TH), P("Transilluminates", S_TH), P("Key Feature", S_TH)],
    [P("Indirect inguinal hernia", S_TD), P("Above lig., lateral", S_TDC), P("Yes", S_TDC), P("No", S_TDC),     P("May descend to scrotum", S_TD)],
    [P("Direct inguinal hernia",   S_TD), P("Above lig., medial",  S_TDC), P("Yes", S_TDC), P("No", S_TDC),     P("Rounded, does not reach scrotum", S_TD)],
    [P("Femoral hernia",           S_TD), P("Below lig., lateral to PT", S_TDC), P("Rarely", S_TDC), P("No", S_TDC), P("F>M; HIGH strangulation risk", S_TD)],
    [P("Hydrocele",                S_TD), P("Scrotum",             S_TDC), P("No",  S_TDC), P("YES brightly", S_TDC), P("Can get above it", S_TD)],
    [P("Communicating hydrocele",  S_TD), P("Scrotum/cord",        S_TDC), P("No",  S_TDC), P("Yes", S_TDC),    P("Fluctuates in size with posture", S_TD)],
    [P("Encysted hydrocele cord",  S_TD), P("Cord, inguinal",      S_TDC), P("No",  S_TDC), P("Yes", S_TDC),    P("Descends + fixes with testicular traction", S_TD)],
    [P("Varicocele",               S_TD), P("Cord/scrotum",        S_TDC), P("No",  S_TDC), P("No", S_TDC),     P("\"Bag of worms\"; L > R", S_TD)],
    [P("Lymphadenopathy",          S_TD), P("Below lig. (femoral)", S_TDC), P("No", S_TDC), P("No", S_TDC),     P("Firm/rubbery; seek primary source", S_TD)],
    [P("Saphena varix",            S_TD), P("Below lig.",          S_TDC), P("Yes", S_TDC), P("No", S_TDC),     P("Blue tinge; compressible; disappears lying down", S_TD)],
    [P("Femoral artery aneurysm",  S_TD), P("Below lig.",          S_TDC), P("No",  S_TDC), P("No", S_TDC),     P("Expansile pulsation; side-to-side movement", S_TD)],
    [P("Psoas abscess",            S_TD), P("Below lig., lateral", S_TDC), P("No",  S_TDC), P("No", S_TDC),     P("Fluctuant; tracks from spine/hip pathology", S_TD)],
]
CW2 = [USABLE_W*0.22, USABLE_W*0.17, USABLE_W*0.11, USABLE_W*0.12, USABLE_W*0.38]
dd_t = Table(dd_data, colWidths=CW2)
dd_t.setStyle(table_style(header_color=HexColor("#ccfbf1")))
story.append(dd_t)
story.append(Spacer(1, 2*mm))

# ══════════════════════════════════════════════════════════════════════════════
# SECTION 10 – MNEMONICS BANNER
# ══════════════════════════════════════════════════════════════════════════════
story.append(section_bar("10  EXAM MNEMONICS & HIGH-YIELD PEARLS", color=HexColor("#b45309")))
story.append(Spacer(1, 1*mm))

mem_left = [
    PB("INDIRECT vs DIRECT — remember by age:"),
    P(""Young MALE gets Indirect (congenital/lateral), OLD MALE gets Direct (acquired/medial)"", S_MNEM),
    Spacer(1, 2),
    PB("Finger impulse direction:"),
    P("d<b>I</b>rect → t<b>I</b>p of finger    |    <b>D</b>irect → pul<b>P</b> of finger", S_MNEM),
    Spacer(1, 2),
    PB("Relation to pubic tubercle (PT):"),
    P("Inguinal hernia = <b>above & medial</b> to PT", S_MNEM),
    P("Femoral hernia  = <b>below & lateral</b> to PT", S_MNEM),
]

mem_right = [
    PB("Ring Occlusion Test:"),
    P("Blocking deep ring STOPS indirect (sac exits here)", S_MNEM),
    P("Blocking deep ring FAILS to stop direct (sac exits medially)", S_MNEM),
    Spacer(1, 2),
    PB("Richter hernia warning:"),
    P("NO bowel obstruction/vomiting despite strangulation → diagnosis easily missed!", S_MNEM),
    Spacer(1, 2),
    PB("Femoral = most dangerous groin hernia:"),
    P("40% of femoral hernias present as emergencies. Always repair.", S_MNEM),
]

mnem_t = Table([[mem_left, mem_right]], colWidths=[HALF, HALF])
mnem_t.setStyle(TableStyle([
    ("BACKGROUND",   (0,0), (-1,-1), HexColor("#fffbeb")),
    ("VALIGN",       (0,0), (-1,-1), "TOP"),
    ("LEFTPADDING",  (0,0), (-1,-1), 6),
    ("RIGHTPADDING", (0,0), (-1,-1), 6),
    ("TOPPADDING",   (0,0), (-1,-1), 4),
    ("BOTTOMPADDING",(0,0), (-1,-1), 4),
    ("LINEBEFORE",   (1,0), (1,-1), 0.5, HexColor("#fde68a")),
    ("BOX",          (0,0), (-1,-1), 0.5, HexColor("#fde68a")),
]))
story.append(mnem_t)
story.append(Spacer(1, 2*mm))

# ══════════════════════════════════════════════════════════════════════════════
# FOOTER
# ══════════════════════════════════════════════════════════════════════════════
story.append(h_rule())
story.append(P(
    "Sources: Gray's Anatomy for Students  |  Bailey & Love's Short Practice of Surgery 28e  |  "
    "Schwartz's Principles of Surgery 11e  |  Tintinalli's Emergency Medicine  |  "
    "Mulholland & Greenfield's Surgery 7e  |  S Das Manual on Clinical Surgery 13e  |  Fischer's Mastery of Surgery 8e",
    S_SMALL
))

# ── BUILD ─────────────────────────────────────────────────────────────────────
doc.build(story)
print(f"PDF written to: {OUTPUT}")
Running Command

cd /home/daytona/workspace/inguinal-hernia && python3 build_cheatsheet.py 2>&1

Editing File

~/inguinal-hernia/build_cheatsheet.py

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/inguinal-hernia/build_cheatsheet.py'
Running Command

cd /home/daytona/workspace/inguinal-hernia && python3 build_cheatsheet.py 2>&1

Running Command

ls -lh /home/daytona/workspace/inguinal-hernia/Inguinal_Hernia_Cheatsheet.pdf

Your cheat sheet is ready to download:

Inguinal Hernia Cheatsheet

PDF Document · PDF


Here's what's packed into the single A4 page:
SectionContent
1. EpidemiologyKey stats - ratios, lifetime risk, bimodal age peaks
2. Comparison tableIndirect vs Direct vs Femoral across 10 features
3. Hesselbach's TriangleBorders with structures
4. Deep ring locationAnatomical landmarks
5. Clinical ExaminationStep-by-step invagination + ring occlusion test
6. Complications ladderReducible → Irreducible → Incarcerated → Strangulated with actions
7. Nyhus ClassificationAll types I–IV with descriptions
8. Special hernia typesSliding, Pantaloon, Richter, Maydl
9. Differential diagnosis12-condition table with key distinguishing features
10. Mnemonics & PearlsHigh-yield memory aids for the exam
The layout uses colour-coded section bars, alternating row shading, and a warm mnemonic panel at the bottom for quick visual scanning during revision.
This is a shared conversation. Sign in to Orris to start your own chat.