Whipples procedure steps

I'll look up the Whipple procedure (pancreaticoduodenectomy) steps from the medical library.
Searching sources...
Reading File
Finding Sources
Searching the Web

Whipple procedure pancreaticoduodenectomy surgical steps

Reading File
Finding Sources
Reading Web Page

https://www.sciencedirect.com/science/article/pii/S258984502…

Finding Sources
Reading Web Page

https://www.ncbi.nlm.nih.gov/books/NBK560747

Reading File
Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Reading File
I now have comprehensive information from two authoritative surgical textbooks (Fischer's Mastery of Surgery 8e and Schwartz's Principles of Surgery 11e) plus the GI Endoscopy textbook. Let me compile the full answer.
Loading Image
Here is a detailed, step-by-step account of the Whipple procedure (pancreaticoduodenectomy), drawn from Fischer's Mastery of Surgery 8e and Schwartz's Principles of Surgery 11e.

Whipple Procedure (Pancreaticoduodenectomy) - Operative Steps

Overview

The Whipple procedure removes the pancreatic head and uncinate process, duodenum, proximal jejunum, gallbladder, distal bile duct, and (in the classic variant) the gastric antrum. The pylorus-preserving variant (PPPD) spares the antrum and divides the duodenum 2 cm distal to the pylorus instead.

PHASE 1 - Preoperative & Entry

Staging laparoscopy (selective)
  • In patients with elevated CA 19-9 or questionable lesions on imaging, diagnostic laparoscopy is performed first to exclude occult peritoneal or liver metastases before committing to laparotomy.
Incision
  • Upper midline incision (standard). A bilateral subcostal (chevron) incision is used selectively in obese patients or those with prior lower abdominal surgery.
  • The umbilical ligament is divided and dissected back to the umbilical fissure of the liver. This pedicled flap is preserved for later coverage of the gastroduodenal artery (GDA) stump.
Exploration
  • Full abdominal exploration to confirm no metastatic disease (liver, peritoneum, lymph nodes).
  • A self-retaining retractor (e.g., Thompson Surgical System) is placed.

PHASE 2 - Resection (6 Steps per Evans et al.)

Step 1 - Entry into the lesser sac and SMV identification

  • The lesser sac is entered through the gastrocolic ligament.
  • The hepatic flexure of the colon is taken down.
  • The gastrocolic trunk is divided.
  • The inferior border of the pancreatic body is identified and the visceral peritoneum incised from left to right toward the SMV.
  • The infrapancreatic superior mesenteric vein (SMV) is carefully exposed at the inferior border of the pancreatic neck, near the uncinate process.
  • If venous resection is anticipated or the patient is morbidly obese, a Cattell-Braasch maneuver (mobilization of the entire right colon and small bowel mesentery root) may be performed.

Step 2 - Kocher maneuver

  • The peritoneum lateral to the duodenum is incised.
  • The duodenum and pancreatic head are mobilized off the retroperitoneum (Kocher maneuver), exposing the inferior vena cava (IVC) and left renal vein.
  • This allows palpation for vascular involvement and access to the SMA origin.
  • Note: Resectability is now primarily determined by preoperative imaging, not intraoperative palpation.

Step 3 - Cholecystectomy and bile duct division

  • The gallbladder is mobilized from the liver, and the cystic duct and artery are ligated and divided.
  • The common hepatic duct is circumferentially dissected and divided just above the cystic duct entry point.
  • The bile duct is then dissected inferiorly toward the duodenum; inferior traction on the distal bile duct exposes the anterior portal vein.
  • The GDA is ligated and divided at its origin from the hepatic artery after confirming hepatic artery patency (a test clamp is applied with confirmation of a hepatic artery pulse).

Step 4 - Gastric or duodenal division

  • Classic Whipple: The antrum is divided and the distal stomach resected.
  • Pylorus-preserving (PPPD): The duodenum is divided 2 cm distal to the pylorus with a GI stapler.

Step 5 - Jejunal division

  • The jejunum is divided approximately 10 cm distal to the ligament of Treitz using a GI stapler.
  • The jejunal mesentery is divided at the serosa/mesentery junction using an energy device - great care is taken here to avoid inadvertent SMA ligation as the bowel passes posterior to the SMA.
  • The duodenum and proximal jejunum are then delivered under the mesenteric vessels from left to right.

Step 6 - Pancreatic neck transection and uncinate process dissection

  • A retropancreatic tunnel is created anterior to the portal vein behind the pancreatic neck using a blunt-tipped clamp.
  • Hemostatic sutures are placed on both the superior and inferior sides of the planned transection line.
  • The pancreatic neck is divided with electrocautery anterior to the portal vein (cautery is avoided near the pancreatic duct).
  • The SMV is mobilized; small venous branches from the uncinate process draining into the portal vein/SMV are ligated individually.
  • The SMV is retracted medially, exposing the SMA beneath it.
  • A periadventitial dissection plane is developed along the SMA from caudal to cranial - all fibrofatty, lymphatic, and perineural tissue to the right and anterior to the SMA is taken with the specimen (critical for oncological clearance).
  • Multiple inferior pancreaticoduodenal arteries (IPDA) from the SMA are individually suture-ligated.
  • The uncinate process is freed from behind the SMV and SMA, completing the resection. The specimen is removed.

PHASE 3 - Reconstruction

Reconstruction restores three anastomotic connections using a single Roux limb of jejunum brought through the transverse mesocolon (retrocolic) or anterior to it (antecolic):

1. Pancreaticojejunostomy (PJ) - most proximal

The pancreatic remnant is anastomosed to the jejunum. Two main techniques:
  • Duct-to-mucosa (end-to-side): The pancreatic duct is sutured directly to the jejunal mucosa with an inner layer of interrupted absorbable sutures. An outer layer approximates the pancreatic capsule to the seromuscular layer of the jejunum. This is the preferred technique for soft pancreas or small duct.
  • Dunking (invagination) anastomosis: The pancreatic stump is intussuscepted (dunked) into the end of the jejunum - can be terminoterminal or terminolateral.
  • A pancreaticogastrostomy (PG) is an alternative to PJ, anastomosing the pancreatic remnant to the posterior stomach wall.

2. Hepaticojejunostomy (HJ) - 10-15 cm distal to PJ

  • The common hepatic duct stump is anastomosed end-to-side to the jejunum with a single layer of interrupted absorbable sutures.

3. Gastrojejunostomy or Duodenojejunostomy - most distal

  • Classic Whipple: A gastrojejunostomy is created (side-to-side or end-to-side) approximately 40-60 cm distal to the HJ - usually antecolic to avoid compression.
  • PPPD: A duodenojejunostomy is created, restoring pyloric continuity.
Whipple reconstruction: A = Classic Whipple with single jejunal loop anastomosed to bile duct, pancreatic duct, and stomach; B = Pylorus-preserving Whipple with duodenojejunostomy
Fig 12.13 - Classic Whipple (A) vs. Pylorus-Preserving Whipple (B) - Clinical Gastrointestinal Endoscopy 3e, p.189

PHASE 4 - Closure

  • Abdominal drains are placed near the pancreatic and biliary anastomoses (selective vs. routine placement remains debated; a randomized multicenter trial supported drain placement for patients who develop postoperative leaks).
  • The umbilical ligament pedicle flap may be sutured over the GDA stump to protect against postoperative hemorrhage from stump blowout.
  • Fascial and skin closure.

Classic vs. Pylorus-Preserving: Key Differences

FeatureClassic WhipplePPPD
Gastric divisionAntrum resectedDuodenum divided 2 cm distal to pylorus
Gastric anastomosisGastrojejunostomyDuodenojejunostomy
Oncologic marginSlightly widerEquivalent for most tumors
Delayed gastric emptyingLess commonMore common historically

Key Complications to Know

  • Postoperative pancreatic fistula (POPF) - most common major complication; results from pancreaticojejunostomy leak. Graded A/B/C by ISGPF criteria.
  • Delayed gastric emptying (DGE) - especially with PPPD.
  • Post-pancreatectomy hemorrhage - may be from GDA stump or pseudoaneurysm.
  • Bile leak from hepaticojejunostomy.
  • Wound infection / intra-abdominal abscess.

Sources: Fischer's Mastery of Surgery 8e, Chapter 183 (Surgical Technique) | Schwartz's Principles of Surgery 11e, Chapter 33 | Clinical Gastrointestinal Endoscopy 3e, p.189

When to do pppd and classical

The key distinction: PPPD is preferred when the pylorus and proximal duodenum are free of tumor, as it preserves gastric function. Classic Whipple is chosen when tumor is close to or involving the pylorus/duodenum, or when adequate margins require antral resection.
Searching sources...
Finding Sources
Searching PubMed

pylorus preserving pancreaticoduodenectomy versus classic Whipple

Finding Sources
Reading Article

PMID: 39757070

Finding Sources
Reading File
Reading File
Reading File
Here is a clear, evidence-based answer on when to choose each variant.

PPPD vs. Classic Whipple - When to Choose Each


PPPD (Pylorus-Preserving Pancreaticoduodenectomy)

PPPD is the current standard of care for most patients requiring pancreaticoduodenectomy. It was popularized by Traverso and Longmire in 1978 and is now the default choice at most high-volume centers.
Choose PPPD when:
  • Tumor is in the head of the pancreas, uncinate process, or ampulla, and is not encroaching on the pylorus or first part of the duodenum
  • The proximal duodenum and pylorus are free of tumor - clear resection margins can be achieved while preserving the pylorus
  • Periampullary tumors (ampullary carcinoma, distal cholangiocarcinoma, duodenal adenocarcinoma of D2/D3) where D1 is not involved
  • Benign or premalignant lesions (chronic pancreatitis, large symptomatic cysts, IPMN of the head) - preservation of gastric function is especially valued
  • The goal is to avoid postgastrectomy symptoms (dumping syndrome, alkaline reflux gastritis) by preserving antral and pyloric function
Advantages of PPPD:
  • Avoids postgastrectomy symptoms (dumping, alkaline reflux)
  • Better preservation of GI function and nutritional status long term
  • No difference in overall survival or recurrence vs. classic Whipple (well established across multiple RCTs and meta-analyses)
  • No difference in pancreatic fistula rates

Classic Whipple (Standard Pancreaticoduodenectomy)

Choose Classic Whipple when:
IndicationRationale
Tumor encroaches on D1 (first part of duodenum) or the distal stomachA clear resection margin cannot be achieved with PPPD; antral resection is required for R0
FAP (Familial Adenomatous Polyposis) with diffuse duodenal polyposisEntire duodenum including D1 must be removed
Tumor invades the pylorus or gastric antrum directlyPylorus preservation is oncologically unsafe
Gastric outlet obstruction from tumorAntral resection required
Lymph node involvement along the lesser curvature or in the perigastric regionEn bloc antral resection improves nodal clearance
Surgeon preference / specific anatomical factorsHistorically some surgeons prefer classic; equivalent oncologic outcomes
Advantages of Classic over PPPD:
  • Ensures wider proximal margin in tumors close to pylorus
  • May reduce risk of delayed gastric emptying (DGE) in some series - though this is debated

What the Evidence Shows

Oncologic outcomes are equivalent. Multiple RCTs and the meta-analysis by Iqbal et al. (2822 patients) found no difference in survival, recurrence, or lymph node yield between PPPD and classic Whipple.
Delayed gastric emptying (DGE): This has historically been cited as more common with PPPD. However, a 2025 RCT (Kumar et al., HPB, PMID 39757070) comparing pylorus-resecting PD vs. classic PD found no significant difference in DGE rates (41% vs. 49%, p=0.339), pancreatic fistula, morbidity, or mortality. Pylorus-resecting PD was faster by ~41 minutes.

Summary Decision Table

ScenarioChoice
Pancreatic head cancer, pylorus uninvolvedPPPD (standard)
Ampullary or periampullary cancer, D1 freePPPD (standard)
Chronic pancreatitis / benign lesionPPPD preferred
Tumor at/near pylorus or antrumClassic Whipple
FAP with duodenal polyposisClassic Whipple
D1 involved or margin threatenedClassic Whipple
Gastric outlet obstruction from tumorClassic Whipple
Bailey and Love's 28e summarizes it clearly: "PPPD is the standard resection for tumours of the pancreatic head or ampulla. The Whipple procedure is now reserved for situations in which the entire duodenum has to be removed (e.g. FAP) or in which the tumour encroaches on the first part of the duodenum or distal stomach and PPPD would not achieve a clear resection margin."
Sources: Bailey and Love's Short Practice of Surgery 28e | Mulholland and Greenfield's Surgery 7e | Fischer's Mastery of Surgery 8e | Kumar et al. HPB 2025 (PMID 39757070)

Diagnotic molecular pathology

This is a broad topic. Let me clarify what you need before diving in.
Asking for Preferences

What aspect of diagnostic molecular pathology do you need? · What level of detail do you need?

Everything to write as short note

Searching sources...
Reading File
Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Finding Sources
Reading File
I now have comprehensive textbook content. Here is the complete short note.

Diagnostic Molecular Pathology - Short Note

Definition

Diagnostic molecular pathology refers to a group of tests that assess molecules (DNA, RNA, and proteins) in tissue to provide information useful for:
  • Diagnosis and tumour classification
  • Prognostic prediction
  • Identifying hereditary cancer risk
  • Determining treatment (theranostics)
  • Identifying residual disease after treatment
(Immunohistochemistry is conventionally considered separate from this category.)

Basic Methods

1. In Situ Hybridisation (ISH)

  • Uses a labelled oligonucleotide probe targeting a specific RNA or DNA sequence
  • Allows visualisation of the presence, absence and location of a nucleic acid sequence in tissue sections
  • Visualisation by: autoradiography, fluorescence (FISH), or bright-field (CISH) microscopy
  • FISH (Fluorescence ISH): detects gene amplifications, translocations, and deletions
  • CISH (Chromogenic ISH): combines ISH + IHC; common alternative to FISH for HER2 amplification detection
  • Key applications: HER2 amplification (breast, gastric, CRC), EBV, CMV, high-risk HPV detection

2. Polymerase Chain Reaction (PCR)

  • Amplifies DNA, yielding millions of copies from a single target sequence
  • RT-PCR (Reverse Transcriptase PCR): amplifies RNA by first converting to cDNA
  • Real-time PCR (qPCR): quantifies DNA/RNA in real time
  • Can be performed on fresh or formalin-fixed paraffin-embedded (FFPE) tissue
  • Applications:
    • Mutational analysis (e.g. KRAS, BRAF mutations)
    • Clonality testing (lymphoid tumours)
    • Microsatellite instability (MSI) testing
    • Fusion gene detection (e.g. BCR-ABL)
    • Infectious agent detection

3. Next-Generation Sequencing (NGS)

  • Performs massively parallel sequencing - simultaneously examines millions of DNA/RNA fragments
  • Works on FFPE tissue
  • Detects: point mutations, small insertions/deletions (indels), copy number variants (CNVs), gene fusions
  • Evaluates 20-500 genes in a single assay
  • Greater analytical sensitivity than Sanger sequencing - can detect low-frequency alleles
  • Targeted NGS panels identify multiple known mutations in one test
  • Also measures Tumour Mutation Burden (TMB)

4. Sanger Sequencing / Pyrosequencing

  • Traditional sequencing method; useful for targeted single-gene analysis
  • Less sensitive than NGS but widely available and reliable for known hotspot mutations

Types of Genetic Abnormalities Detected

TypeDescriptionExamples
Point mutationsSingle nucleotide change in DNA; germline or somaticTP53, KRAS mutations
IndelsInsertions/deletions causing frameshiftKIT mutations
Fusion genesFrom translocations or deletions; chimeric proteinsBCR-ABL t(9;22) in CML; BCL2 t(14;18) in follicular lymphoma; TMPRSS2-ERG in prostate cancer
Gene amplificationIncreased copy number → overexpressionHER2 in breast/gastric cancer
Microsatellite instability (MSI)Instability of short tandem repeats due to MMR deficiencyLynch syndrome, sporadic CRC
Epigenetic changesDNA methylation, histone modification silencing genesMLH1 hypermethylation in sporadic CRC

Mismatch Repair (MMR) and MSI

  • MMR genes (MLH1, MSH2, MSH6, PMS2) correct replication errors
  • Loss of MMR function → MSI-H (microsatellite instability-high) / dMMR (deficient MMR)
  • Causes:
    • Germline mutation = Lynch syndrome (autosomal dominant; risk of CRC, endometrial, other cancers at early age)
    • Sporadic somatic methylation of MLH1 (more common, ~85%)
  • Prevalence: ~15% of CRCs, ~30% of endometrial carcinomas
Testing for MSI/MMR:
  • IHC (preferred initial test in most centres) - loss of staining = gene abnormality
  • PCR-based microsatellite testing
  • NGS
Clinical value of MSI-H:
  • Phenotypic classification (e.g. medullary CRC is typically MSI-H; right-sided, mucinous)
  • Better prognosis overall
  • Predicts response to immune checkpoint inhibitors (ICIs)
  • No response to 5-fluorouracil
  • Screens for Lynch syndrome

Detection Methods - Summary Table

AbnormalityPreferred Method
Point mutations / small indelsNGS, PCR
Gene fusionsFISH, NGS, PCR
Gene amplificationsFISH, NGS
Tumour mutation burden (TMB)NGS
MSI/dMMRIHC (initial), PCR, NGS
Viral genomes (EBV, HPV, CMV)ISH
Rule: IHC is often a useful and sufficient initial test for many of these abnormalities before molecular testing.

Theranostics - Molecular Changes and Drug Therapy

Molecular testing increasingly guides targeted therapy ("theranostics"):
Molecular FindingTarget Drug
HER2 amplification (breast, gastric, CRC)Trastuzumab, pertuzumab
KRAS/BRAF wild-type (CRC)Anti-EGFR antibodies (cetuximab, panitumumab)
BRAF V600EBRAF inhibitors (vemurafenib, dabrafenib)
ALK, RET, NTRK, ROS1, FGFR2 fusionsTyrosine kinase inhibitors
MSI-H / high TMBImmune checkpoint inhibitors (pembrolizumab, nivolumab)
BCR-ABL t(9;22)Imatinib and other TKIs
PD-L1 expressionICIs
Tumours responding to ICIs: breast carcinoma, urothelial carcinoma, NSCLC, SCLC, hepatocellular carcinoma, malignant melanoma

Indications for Molecular Analysis of Tumour Tissue

  1. Diagnosis and classification
  2. Selection of therapy
  3. Prognosis
  4. Staging
  5. Monitoring disease burden
  6. Screening for germline mutations
  7. Confirmation of neoplasia (e.g. clonality testing in lymphoma)

Key Pathways Disrupted in Tumorigenesis

  • Signal transduction / proliferation: KRAS, EGFR, BRAF, growth factor receptors
  • Cell cycle control: p16 (CDKN2A), RB
  • DNA repair: BRCA1/2, MMR genes
  • Apoptosis: BCL2, TP53

Practical Notes

  • Pathologist assesses tumour cell content (%), cellularity, and necrosis before molecular analysis
  • Microdissection (conventional or laser-assisted) improves tumour DNA yield from FFPE sections
  • Germline vs. somatic testing: germline mutations are present in every cell (e.g. BRCA1/2, Lynch syndrome); somatic mutations are confined to tumour cells

Sources: Bailey and Love's Short Practice of Surgery 28e, Chapter 11 | Henry's Clinical Diagnosis and Management by Laboratory Methods 24e, Chapter on Molecular Diagnostics

Convert to pdf

Reading File
Running Command

ls /tmp/workspace/ 2>/dev/null || mkdir -p /tmp/workspace && echo "ready"

Writing File

~/diagnostic_molecular_pathology.py

from reportlab.lib.pagesizes import A4
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm
from reportlab.lib import colors
from reportlab.platypus import (
    SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
    HRFlowable, KeepTogether
)
from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_JUSTIFY

OUTPUT = "/tmp/workspace/Diagnostic_Molecular_Pathology.pdf"

doc = SimpleDocTemplate(
    OUTPUT,
    pagesize=A4,
    leftMargin=2*cm, rightMargin=2*cm,
    topMargin=2.2*cm, bottomMargin=2*cm,
    title="Diagnostic Molecular Pathology",
    author="Orris Medical"
)

styles = getSampleStyleSheet()

# Custom styles
HEADING1 = ParagraphStyle("H1", parent=styles["Normal"],
    fontSize=16, fontName="Helvetica-Bold", spaceAfter=6,
    spaceBefore=14, textColor=colors.HexColor("#1a3a5c"))

HEADING2 = ParagraphStyle("H2", parent=styles["Normal"],
    fontSize=12, fontName="Helvetica-Bold", spaceAfter=4,
    spaceBefore=10, textColor=colors.HexColor("#2e6da4"))

HEADING3 = ParagraphStyle("H3", parent=styles["Normal"],
    fontSize=11, fontName="Helvetica-Bold", spaceAfter=3,
    spaceBefore=8, textColor=colors.HexColor("#1a5276"))

BODY = ParagraphStyle("Body", parent=styles["Normal"],
    fontSize=9.5, fontName="Helvetica", spaceAfter=4,
    spaceBefore=2, leading=14, alignment=TA_JUSTIFY)

BULLET = ParagraphStyle("Bullet", parent=styles["Normal"],
    fontSize=9.5, fontName="Helvetica", spaceAfter=2,
    spaceBefore=1, leading=13, leftIndent=14, bulletIndent=4)

SMALL = ParagraphStyle("Small", parent=styles["Normal"],
    fontSize=8, fontName="Helvetica-Oblique", spaceAfter=3,
    textColor=colors.HexColor("#555555"))

TABLE_HEADER = ParagraphStyle("TH", parent=styles["Normal"],
    fontSize=9, fontName="Helvetica-Bold", textColor=colors.white, leading=12)

TABLE_CELL = ParagraphStyle("TC", parent=styles["Normal"],
    fontSize=9, fontName="Helvetica", leading=12)

def h1(text): return Paragraph(text, HEADING1)
def h2(text): return Paragraph(text, HEADING2)
def h3(text): return Paragraph(text, HEADING3)
def body(text): return Paragraph(text, BODY)
def bullet(text): return Paragraph(f"• {text}", BULLET)
def sp(h=4): return Spacer(1, h)
def hr(): return HRFlowable(width="100%", thickness=0.8, color=colors.HexColor("#2e6da4"), spaceAfter=4, spaceBefore=4)
def thin_hr(): return HRFlowable(width="100%", thickness=0.4, color=colors.HexColor("#aaaaaa"), spaceAfter=3, spaceBefore=3)

def make_table(headers, rows, col_widths=None):
    data = [[Paragraph(h, TABLE_HEADER) for h in headers]]
    for row in rows:
        data.append([Paragraph(str(c), TABLE_CELL) for c in row])
    t = Table(data, colWidths=col_widths, repeatRows=1)
    t.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,0), colors.HexColor("#2e6da4")),
        ("ROWBACKGROUNDS", (0,1), (-1,-1), [colors.HexColor("#f0f5fa"), colors.white]),
        ("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#b0c4de")),
        ("VALIGN", (0,0), (-1,-1), "MIDDLE"),
        ("LEFTPADDING", (0,0), (-1,-1), 5),
        ("RIGHTPADDING", (0,0), (-1,-1), 5),
        ("TOPPADDING", (0,0), (-1,-1), 4),
        ("BOTTOMPADDING", (0,0), (-1,-1), 4),
    ]))
    return t

story = []

# ── TITLE ──────────────────────────────────────────────
story.append(sp(6))
story.append(Paragraph("DIAGNOSTIC MOLECULAR PATHOLOGY", ParagraphStyle(
    "Title", parent=styles["Normal"], fontSize=20, fontName="Helvetica-Bold",
    alignment=TA_CENTER, textColor=colors.HexColor("#1a3a5c"), spaceAfter=4)))
story.append(Paragraph("Short Note", ParagraphStyle(
    "Sub", parent=styles["Normal"], fontSize=12, fontName="Helvetica-Oblique",
    alignment=TA_CENTER, textColor=colors.HexColor("#2e6da4"), spaceAfter=2)))
story.append(Paragraph("Source: Bailey & Love's 28e | Henry's Clinical Diagnosis 24e", ParagraphStyle(
    "Src", parent=styles["Normal"], fontSize=8, fontName="Helvetica-Oblique",
    alignment=TA_CENTER, textColor=colors.HexColor("#777777"), spaceAfter=8)))
story.append(hr())
story.append(sp(6))

# ── 1. DEFINITION ──────────────────────────────────────
story.append(h1("1. Definition"))
story.append(body(
    "Diagnostic molecular pathology refers to multiple tests that assess <b>molecules "
    "(DNA, RNA, and proteins) in tissue</b> to provide information useful for:"
))
for item in [
    "Diagnosis and tumour classification",
    "Prognostic prediction",
    "Identifying hereditary cancer risk",
    "Determining treatment (theranostics)",
    "Identifying residual disease after treatment",
]:
    story.append(bullet(item))
story.append(body("<i>Note: Immunohistochemistry (IHC) is conventionally considered a separate category.</i>"))
story.append(sp(4))

# ── 2. BASIC METHODS ───────────────────────────────────
story.append(h1("2. Basic Methods"))

# ISH
story.append(h2("2.1 In Situ Hybridisation (ISH)"))
story.append(body(
    "Uses a <b>labelled oligonucleotide probe</b> targeting a specific RNA or DNA sequence, allowing "
    "visualisation of presence, absence, and location of nucleic acid sequences in tissue sections."
))
story.append(body("<b>Variants:</b>"))
for item in [
    "<b>FISH</b> (Fluorescence ISH) – fluorescence microscopy; detects gene amplifications, translocations, deletions",
    "<b>CISH</b> (Chromogenic ISH) – bright-field; combines ISH + IHC; common alternative to FISH for HER2 detection",
    "<b>Radioactive ISH</b> – autoradiography (less common now)",
]:
    story.append(bullet(item))
story.append(body("<b>Key applications:</b> HER2 amplification (breast, gastric, CRC), EBV, CMV, high-risk HPV detection"))
story.append(sp(4))

# PCR
story.append(h2("2.2 Polymerase Chain Reaction (PCR)"))
story.append(body(
    "Amplifies DNA, yielding millions of copies from a single target sequence. "
    "Can be performed on <b>fresh or formalin-fixed paraffin-embedded (FFPE)</b> tissue."
))
story.append(body("<b>Variants:</b>"))
for item in [
    "<b>RT-PCR</b> (Reverse Transcriptase PCR) – amplifies RNA by converting to cDNA first",
    "<b>Real-time PCR (qPCR)</b> – quantifies DNA/RNA; distinct from RT-PCR despite similar abbreviation",
]:
    story.append(bullet(item))
story.append(body("<b>Applications:</b> Mutational analysis (KRAS, BRAF), clonality testing in lymphoma, MSI testing, "
                  "fusion gene detection (BCR-ABL), infectious agent detection"))
story.append(sp(4))

# NGS
story.append(h2("2.3 Next-Generation Sequencing (NGS)"))
story.append(body(
    "Performs <b>massively parallel sequencing</b> — simultaneously examines millions of DNA/RNA fragments. "
    "Works on FFPE tissue. Evaluates <b>20–500 genes in a single assay</b>."
))
story.append(body("<b>Detects:</b> point mutations, small indels, copy number variants (CNVs), gene fusions, tumour mutation burden (TMB)"))
story.append(body("<b>Advantages over Sanger:</b> greater sensitivity (detects low-frequency alleles), higher throughput, "
                  "simultaneous multi-gene analysis"))
story.append(sp(4))

# Sanger
story.append(h2("2.4 Sanger Sequencing / Pyrosequencing"))
story.append(body(
    "Traditional targeted single-gene sequencing. Less sensitive than NGS but reliable for known hotspot mutations. "
    "Still widely used for specific variant confirmation."
))
story.append(sp(6))

# ── 3. GENETIC ABNORMALITIES ───────────────────────────
story.append(h1("3. Types of Genetic Abnormalities Detected"))
story.append(make_table(
    ["Type", "Description", "Examples"],
    [
        ["Point mutations", "Single nucleotide change; germline or somatic", "TP53, KRAS mutations"],
        ["Indels", "Insertions/deletions → frameshift", "KIT mutations"],
        ["Fusion genes", "From translocations/deletions; chimeric proteins", "BCR-ABL t(9;22) in CML; BCL2 t(14;18) in FL; TMPRSS2-ERG in prostate cancer"],
        ["Gene amplification", "Increased copy number → overexpression", "HER2 in breast/gastric/CRC"],
        ["MSI", "MMR deficiency → short tandem repeat instability", "Lynch syndrome, sporadic CRC (MLH1 methylation)"],
        ["Epigenetic changes", "DNA methylation/histone modification silencing genes", "MLH1 hypermethylation in sporadic CRC"],
    ],
    col_widths=[3.2*cm, 7.5*cm, 6.3*cm]
))
story.append(sp(8))

# ── 4. MMR / MSI ───────────────────────────────────────
story.append(h1("4. Mismatch Repair (MMR) and Microsatellite Instability (MSI)"))
story.append(body(
    "MMR genes (<b>MLH1, MSH2, MSH6, PMS2</b>) correct DNA replication errors. "
    "Loss of MMR function → <b>MSI-H</b> (microsatellite instability-high) / <b>dMMR</b> (deficient MMR)."
))
story.append(h3("Causes:"))
for item in [
    "<b>Germline mutation</b> = <b>Lynch syndrome</b> (autosomal dominant; risk of CRC, endometrial + other cancers at early age)",
    "<b>Sporadic somatic methylation of MLH1</b> (more common, ~85% of MSI-H cases)",
]:
    story.append(bullet(item))

story.append(h3("Prevalence:"))
for item in ["~15% of colorectal carcinomas (CRC)", "~30% of endometrial carcinomas"]:
    story.append(bullet(item))

story.append(h3("Testing for MSI/MMR:"))
for item in [
    "<b>IHC</b> – preferred initial test; loss of staining = gene abnormality",
    "<b>PCR-based microsatellite testing</b>",
    "<b>NGS</b>",
]:
    story.append(bullet(item))

story.append(h3("Clinical Value of MSI-H:"))
story.append(make_table(
    ["Clinical Use", "Detail"],
    [
        ["Phenotypic classification", "Medullary CRC typically MSI-H; right-sided, mucinous histology, BRAF V600E mutation"],
        ["Prognosis", "MSI-H = better overall prognosis"],
        ["Therapy prediction", "Responds to immune checkpoint inhibitors (ICIs); no response to 5-fluorouracil"],
        ["Germline screening", "Screens for Lynch syndrome"],
    ],
    col_widths=[5*cm, 12*cm]
))
story.append(sp(8))

# ── 5. DETECTION METHOD SUMMARY ───────────────────────
story.append(h1("5. Detection Methods — Summary"))
story.append(make_table(
    ["Abnormality", "Preferred Method(s)"],
    [
        ["Point mutations / small indels", "NGS, PCR"],
        ["Gene fusions", "FISH, NGS, PCR"],
        ["Gene amplifications", "FISH, NGS"],
        ["Tumour mutation burden (TMB)", "NGS"],
        ["MSI / dMMR", "IHC (initial), PCR, NGS"],
        ["Viral genomes (EBV, HPV, CMV)", "ISH"],
    ],
    col_widths=[9*cm, 8*cm]
))
story.append(body("<i>Rule: IHC is often a useful and sufficient initial test for many abnormalities before molecular testing.</i>"))
story.append(sp(8))

# ── 6. THERANOSTICS ───────────────────────────────────
story.append(h1("6. Theranostics — Molecular Changes and Drug Therapy"))
story.append(body(
    "An increasingly common reason for molecular testing is predicting drug response "
    "('theranostics') — particularly for targeted therapies and immune checkpoint inhibitors (ICIs)."
))
story.append(make_table(
    ["Molecular Finding", "Tumour Type", "Target Drug"],
    [
        ["HER2 amplification", "Breast, gastric, CRC", "Trastuzumab, pertuzumab"],
        ["KRAS/BRAF wild-type", "CRC", "Anti-EGFR (cetuximab, panitumumab)"],
        ["BRAF V600E", "Melanoma, CRC, others", "BRAF inhibitors (vemurafenib, dabrafenib)"],
        ["ALK, RET, NTRK, ROS1, FGFR2 fusions", "NSCLC, others", "Tyrosine kinase inhibitors (TKIs)"],
        ["MSI-H / high TMB", "Multiple", "ICIs (pembrolizumab, nivolumab)"],
        ["BCR-ABL t(9;22)", "CML", "Imatinib and other TKIs"],
        ["PD-L1 expression", "Multiple", "ICIs"],
    ],
    col_widths=[5.5*cm, 4.5*cm, 7*cm]
))

story.append(h3("Tumours Responding to ICIs:"))
for t in ["Malignant melanoma", "Non-small cell lung cancer (NSCLC)", "Small cell lung cancer (SCLC)",
          "Breast carcinoma", "Urothelial carcinoma", "Hepatocellular carcinoma"]:
    story.append(bullet(t))
story.append(sp(8))

# ── 7. INDICATIONS ────────────────────────────────────
story.append(h1("7. Indications for Molecular Analysis of Tumour Tissue"))
for i, item in enumerate([
    "Diagnosis and classification",
    "Selection of therapy",
    "Prognosis",
    "Staging",
    "Monitoring disease burden",
    "Screening for germline mutations",
    "Confirmation of neoplasia (e.g. clonality testing in lymphoma)",
], 1):
    story.append(Paragraph(f"{i}. {item}", BULLET))
story.append(sp(8))

# ── 8. PATHWAYS ───────────────────────────────────────
story.append(h1("8. Key Pathways Disrupted in Tumorigenesis"))
story.append(make_table(
    ["Pathway", "Key Genes"],
    [
        ["Signal transduction / proliferation", "KRAS, EGFR, BRAF, growth factor receptors"],
        ["Cell cycle control", "p16 (CDKN2A), RB"],
        ["DNA repair", "BRCA1/2, MMR genes (MLH1, MSH2, MSH6, PMS2)"],
        ["Apoptosis", "BCL2, TP53"],
    ],
    col_widths=[7*cm, 10*cm]
))
story.append(sp(8))

# ── 9. PRACTICAL NOTES ────────────────────────────────
story.append(h1("9. Practical Notes"))
for item in [
    "The pathologist assesses <b>tumour cell content (%)</b>, cellularity, and necrosis before molecular analysis",
    "<b>Microdissection</b> (conventional or laser-assisted) improves tumour DNA yield from FFPE sections",
    "<b>Germline mutations</b> are present in every cell of the body (e.g. BRCA1/2, Lynch syndrome MMR mutations)",
    "<b>Somatic mutations</b> are confined to tumour cells only (e.g. acquired KRAS, BRAF mutations)",
    "Adequate tumour DNA quality and quantity are essential — samples with high necrosis or low cellularity may fail",
]:
    story.append(bullet(item))

story.append(sp(10))
story.append(thin_hr())
story.append(Paragraph(
    "Sources: Bailey &amp; Love's Short Practice of Surgery 28e, Ch. 11 | "
    "Henry's Clinical Diagnosis and Management by Laboratory Methods 24e",
    SMALL))

doc.build(story)
print(f"PDF created: {OUTPUT}")
Running Command

cd /tmp/workspace && python diagnostic_molecular_pathology.py

Your PDF is ready:

Diagnostic Molecular Pathology

PDF Document · PDF

The document includes all 9 sections from the short note:
  1. Definition
  2. Basic Methods (ISH, PCR, NGS, Sanger)
  3. Types of Genetic Abnormalities
  4. MMR / MSI (with clinical value table)
  5. Detection Methods summary table
  6. Theranostics and drug targets
  7. Indications for molecular analysis
  8. Key pathways disrupted in tumorigenesis
  9. Practical notes
All formatted with colour-coded headings, structured tables, and source citations at the footer.

Tep and taap short note

Searching sources...
Finding Sources
Finding Sources
Reading File
Finding Sources
Reading File
Reading File
Reading File
Finding Sources
Reading File
Finding Sources
Reading File
I now have comprehensive material from Schwartz's 11e and Fischer's Mastery of Surgery 8e. Here is the complete short note.

TEP and TAPP - Short Note

(Laparoscopic Inguinal Hernia Repair)


Background

Laparoscopic inguinal hernia repairs have become widely popular due to noninferiority to open repair, improved cosmesis, and faster recovery. The two principal laparoscopic techniques are:
  • TEP - Totally Extraperitoneal Repair
  • TAPP - Transabdominal Preperitoneal Repair
Both involve dissection of the preperitoneal space and placement of a prosthetic mesh over the myopectineal orifice, but differ in how that space is accessed.
Over 20 million inguinal hernias are repaired worldwide annually. Lifetime risk: 27% in men, 3% in women.

Common Features of Both Procedures

  • Patient in Trendelenburg position; surgeon stands contralateral to the hernia
  • General anaesthesia required (patients cannot tolerate abdominal insufflation while awake)
  • Mesh size typically 10 × 15 cm, placed to cover the entire myopectineal orifice
  • Mesh is usually not fixed (or selectively fixed) to reduce chronic pain
  • Can repair both unilateral and bilateral hernias in the same sitting
  • IEHS guidelines: Grade A recommendation that TEP and TAPP are preferred over Lichtenstein repair for recurrent hernias after prior open anterior repair

TEP - Totally Extraperitoneal Repair

Definition

Access to the preperitoneal space without entering the peritoneal cavity. Dissection occurs entirely between the peritoneum and the anterior abdominal wall.

Steps

  1. Infraumbilical curvilinear incision (contralateral to hernia side)
  2. Dissect subcutaneous tissue down to anterior rectus sheath → incise fascia transversely
  3. Rectus muscle fibres retracted laterally to expose posterior rectus sheath
  4. Dissecting balloon (or blunt laparoscope) advanced toward pubic symphysis and inflated slowly under direct vision to develop the preperitoneal space
  5. Three trocars placed in midline:
    • 10/12 mm Hassan trocar at umbilicus
    • 5 mm trocar at 1/3 distance from umbilicus to pubic symphysis
    • 5 mm trocar at 2/3 distance from umbilicus to pubic symphysis
  6. Pneumopreperitoneum (CO₂) to 15 mmHg (not pneumoperitoneum)
  7. Preperitoneal fat dissected bluntly; inferior epigastric vessels identified and preserved
  8. Hernia sac reduced; cord structures skeletonised
  9. Mesh placed over myopectineal orifice; surgeon holds inferior mesh edge during slow desufflation to prevent peritoneal flap herniation below mesh
  10. Anterior rectus sheath closed with interrupted suture; skin closed

Key Technical Points

  • If peritoneal rent occurs → close immediately with absorbable endoloop or intracorporeal suture; otherwise field of view is compromised and small bowel obstruction risk rises
  • If significant pneumoperitoneum develops → Veress needle at Palmer's point to desufflate peritoneal gas
  • No need for peritoneal closure (peritoneum never opened)

Advantages

  • No intraperitoneal entry → no risk of visceral injury from ports
  • No port-site hernia through an iatrogenic peritoneal defect
  • No risk of intraperitoneal adhesions
  • Useful when prior surgery makes TAPP difficult (adhesions within peritoneum avoided)

Disadvantages / Contraindications

  • Smaller working space - steeper learning curve
  • Prior pelvic surgery, pelvic radiation, or lower midline incisions → preperitoneal space may be scarred, making safe access difficult
  • Peritoneal tear complicates the procedure significantly

TAPP - Transabdominal Preperitoneal Repair

Definition

Peritoneal cavity is entered first (transabdominal), then the preperitoneum is dissected through an incision in the peritoneum, mesh is placed, and the peritoneum is closed over the mesh.

Steps

  1. Pneumoperitoneum to 15 mmHg via Veress needle or Hasson (open) technique
  2. Three trocars placed:
    • 10 mm camera port: midline supra- or infraumbilical
    • Two 5 mm working trocars: lateral, slightly inferior to umbilical port (avoiding inferior epigastric vessels)
  3. Patient placed in Trendelenburg → pelvis inspected
  4. Key landmarks visualised: bladder, median and medial umbilical ligaments, external iliac vessels, inferior epigastric vessels
  5. Peritoneal incision made at medial umbilical ligament, 3-4 cm superior to hernia defect, carried laterally to ASIS
    • For bilateral repair: bilateral incisions with a midline bridge preserved (to protect patent urachus)
  6. Inferior peritoneal edge retracted; preperitoneal space dissected to expose spermatic cord
  7. Direct hernia sac: inverted and fixed to Cooper's ligament (prevents haematoma/seroma)
  8. Indirect hernia sac: grasped, elevated superiorly, space below developed bluntly; sac dissected from cord, cord skeletonised
  9. Mesh placed (10 × 15 cm) to cover myopectineal orifice
  10. Peritoneum closed over the mesh (staples, tacks, or suture) - critical to prevent mesh contact with bowel
  11. Desufflation, trocar removal, skin closure

Robotic TAPP

  • All robotic inguinofemoral hernia repairs are performed as TAPP
  • Camera port placed at least 2 cm supraumbilical (longer instruments need more space)
  • Two 8 mm robotic trocars in right and left midclavicular lines, 8-10 cm apart

Advantages

  • Wide operative field - no technical space constraints
  • Contralateral hernia can be identified without additional dissection of preperitoneal space
  • Better for bilateral hernias, large defects, and when scarring makes anterior approach challenging
  • Intraperitoneal perspective easier for surgeons learning the technique
  • Preferred approach for robotic surgery

Disadvantages / Contraindications

  • Peritoneal cavity entered → risk of visceral/vascular injury from trocar/instruments
  • Risk of port-site hernia through peritoneal defect
  • Extensive adhesiolysis may be required in patients with multiple prior abdominal surgeries
  • Peritoneum must be closed over mesh - technically important step

Critical Anatomy in the Preperitoneal Space

The preperitoneal space is divided into 3 zones:
ZoneLocationContent
Zone 1Lateral to internal inguinal ring / spermatic vesselsPsoas muscle posteriorly; ASIS laterally
Zone 2Medial to inferior epigastric vesselsSite of direct hernias
Zone 3Between zones 1 and 2Inferior epigastric vessels, internal inguinal ring, spermatic cord, external iliac vessels

Two Danger Triangles - MUST AVOID

Triangle of Doom (Zone 3):
  • Boundaries: vas deferens (medial), testicular vessels (lateral), peritoneal fold (inferior)
  • Contains: external iliac artery and vein - injury is catastrophic
Triangle of Pain (Zone 1):
  • Boundaries: iliopubic tract (superior), testicular vessels (medial), peritoneal fold (inferior)
  • Contains: lateral femoral cutaneous nerve, genitofemoral nerve, femoral nerve - injury causes chronic groin/thigh pain
Rule: No tacks, staples, or sutures lateral to the testicular vessels or below the iliopubic tract

TEP vs. TAPP - Comparison Table

FeatureTEPTAPP
Peritoneal entryNoYes
Working spaceSmaller (preperitoneal only)Larger (intraperitoneal view)
Learning curveSteeperLess steep
Visceral injury riskLowerHigher (trocars in abdomen)
Port-site herniaNoPossible
Adhesion riskNonePossible
Bilateral repairYes (no extra steps)Yes (bilateral incisions)
Peritoneal closure neededNoYes (over mesh)
Prior pelvic surgeryDifficult (scarred preperitoneal space)Better tolerated
Robotic platformNot standardPreferred
Recurrent hernia (after open)Both equally recommended (IEHS Grade A)Both equally recommended
AnaesthesiaGA requiredGA required

Indications for Laparoscopic Repair (TEP/TAPP)

  • Primary inguinal hernia (unilateral or bilateral)
  • Bilateral inguinal hernias - laparoscopic superior to open (Grade A evidence)
  • Recurrent hernia after prior open anterior repair - TEP/TAPP preferred over open
  • Hernia repair concurrent with another laparoscopic procedure (e.g. prostatectomy) without contamination
  • Femoral hernias (both techniques access the femoral canal well)

Contraindications

  • Inability to tolerate general anaesthesia
  • For TEP: Prior pelvic surgery/radiation or lower midline incisions (scarred preperitoneal space)
  • For TAPP: Multiple prior abdominal surgeries with extensive adhesions
  • Unstable cardiovascular disease
  • Uncontrolled coagulopathy

Complications Specific to Laparoscopic Repair

ComplicationNotes
Injury to triangle of doomExternal iliac vessel injury - rare but catastrophic
Injury to triangle of painChronic groin/thigh neuralgia
SeromaMost common; usually self-limiting
Peritoneal rent (TEP)Must be repaired to maintain working space
Port-site herniaMore common with TAPP
Mesh migration/foldingDuring desufflation in TEP if not held
Recurrence~1-2%; similar to open Lichtenstein
Conversion to openRequired in ~1-3%

Sources: Schwartz's Principles of Surgery 11e, Chapter 37 | Fischer's Mastery of Surgery 8e, Chapter 223 | Mulholland and Greenfield's Surgery 7e

Generate a PDF of this TEP/TAPP short note

Running Command

ls /tmp/workspace/

Writing File

~/tep_tapp.py

from reportlab.lib.pagesizes import A4
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm
from reportlab.lib import colors
from reportlab.platypus import (
    SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
    HRFlowable, KeepTogether
)
from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_JUSTIFY

OUTPUT = "/tmp/workspace/TEP_TAPP_Short_Note.pdf"

doc = SimpleDocTemplate(
    OUTPUT, pagesize=A4,
    leftMargin=2*cm, rightMargin=2*cm,
    topMargin=2.2*cm, bottomMargin=2*cm,
    title="TEP and TAPP - Laparoscopic Inguinal Hernia Repair",
    author="Orris Medical"
)

# ── Styles ────────────────────────────────────────────
TITLE_S = ParagraphStyle("TitleS", fontSize=18, fontName="Helvetica-Bold",
    alignment=TA_CENTER, textColor=colors.HexColor("#1a3a5c"), spaceAfter=4)
SUB_S   = ParagraphStyle("SubS",   fontSize=11, fontName="Helvetica-Oblique",
    alignment=TA_CENTER, textColor=colors.HexColor("#2e6da4"), spaceAfter=2)
SRC_S   = ParagraphStyle("SrcS",   fontSize=8,  fontName="Helvetica-Oblique",
    alignment=TA_CENTER, textColor=colors.HexColor("#777777"), spaceAfter=8)
H1_S    = ParagraphStyle("H1S",    fontSize=13, fontName="Helvetica-Bold",
    textColor=colors.HexColor("#1a3a5c"), spaceBefore=12, spaceAfter=5)
H2_S    = ParagraphStyle("H2S",    fontSize=11, fontName="Helvetica-Bold",
    textColor=colors.HexColor("#2e6da4"), spaceBefore=9,  spaceAfter=4)
H3_S    = ParagraphStyle("H3S",    fontSize=10, fontName="Helvetica-Bold",
    textColor=colors.HexColor("#1a5276"), spaceBefore=7,  spaceAfter=3)
BODY_S  = ParagraphStyle("BodyS",  fontSize=9.5, fontName="Helvetica",
    leading=14, spaceAfter=4, spaceBefore=2, alignment=TA_JUSTIFY)
BULL_S  = ParagraphStyle("BullS",  fontSize=9.5, fontName="Helvetica",
    leading=13, spaceAfter=2, spaceBefore=1, leftIndent=14, bulletIndent=4)
NOTE_S  = ParagraphStyle("NoteS",  fontSize=8.5, fontName="Helvetica-Oblique",
    textColor=colors.HexColor("#444444"), spaceAfter=4, spaceBefore=2,
    leftIndent=10, leading=12)
SMALL_S = ParagraphStyle("SmallS", fontSize=8,  fontName="Helvetica-Oblique",
    textColor=colors.HexColor("#555555"), spaceAfter=3)
TH_S    = ParagraphStyle("THS",    fontSize=9,  fontName="Helvetica-Bold",
    textColor=colors.white, leading=12)
TC_S    = ParagraphStyle("TCS",    fontSize=9,  fontName="Helvetica", leading=12)
TC_B_S  = ParagraphStyle("TCBS",   fontSize=9,  fontName="Helvetica-Bold", leading=12)

def h1(t):  return Paragraph(t, H1_S)
def h2(t):  return Paragraph(t, H2_S)
def h3(t):  return Paragraph(t, H3_S)
def body(t):return Paragraph(t, BODY_S)
def bull(t):return Paragraph(f"• {t}", BULL_S)
def note(t):return Paragraph(f"<i>{t}</i>", NOTE_S)
def sp(h=4):return Spacer(1, h)
def hr():   return HRFlowable(width="100%", thickness=0.8,
                color=colors.HexColor("#2e6da4"), spaceAfter=4, spaceBefore=4)
def thr():  return HRFlowable(width="100%", thickness=0.4,
                color=colors.HexColor("#aaaaaa"), spaceAfter=3, spaceBefore=3)

def table(headers, rows, widths=None):
    data = [[Paragraph(h, TH_S) for h in headers]]
    for row in rows:
        cells = []
        for c in row:
            if isinstance(c, str) and c.startswith("<b>"):
                cells.append(Paragraph(c, TC_B_S))
            else:
                cells.append(Paragraph(str(c), TC_S))
        data.append(cells)
    t = Table(data, colWidths=widths, repeatRows=1)
    t.setStyle(TableStyle([
        ("BACKGROUND",  (0,0), (-1,0),  colors.HexColor("#2e6da4")),
        ("ROWBACKGROUNDS", (0,1), (-1,-1),
            [colors.HexColor("#eef4fb"), colors.white]),
        ("GRID",        (0,0), (-1,-1), 0.4, colors.HexColor("#b0c4de")),
        ("VALIGN",      (0,0), (-1,-1), "MIDDLE"),
        ("LEFTPADDING", (0,0), (-1,-1), 5),
        ("RIGHTPADDING",(0,0), (-1,-1), 5),
        ("TOPPADDING",  (0,0), (-1,-1), 4),
        ("BOTTOMPADDING",(0,0),(-1,-1), 4),
    ]))
    return t

W = 17*cm  # usable width

story = []

# ══ TITLE BLOCK ══════════════════════════════════════════
story += [sp(6),
    Paragraph("TEP &amp; TAPP", TITLE_S),
    Paragraph("Laparoscopic Inguinal Hernia Repair — Short Note", SUB_S),
    Paragraph("Sources: Schwartz's Principles of Surgery 11e | Fischer's Mastery of Surgery 8e | Mulholland &amp; Greenfield's Surgery 7e", SRC_S),
    hr(), sp(4)]

# ══ 1. BACKGROUND ════════════════════════════════════════
story += [h1("1. Background")]
story.append(body(
    "Laparoscopic inguinal hernia repairs have become widely popular due to noninferiority "
    "to open repair, improved cosmesis, and faster recovery. The two principal laparoscopic "
    "techniques are <b>TEP (Totally Extraperitoneal Repair)</b> and "
    "<b>TAPP (Transabdominal Preperitoneal Repair)</b>. "
    "Both involve dissection of the preperitoneal space and placement of a prosthetic mesh "
    "over the myopectineal orifice, but differ in how that space is accessed."
))
for b in [
    "Over <b>20 million</b> inguinal hernias repaired worldwide annually",
    "Lifetime risk: <b>27% in men</b>, 3% in women",
    "<b>General anaesthesia</b> required for both (patients cannot tolerate abdominal insufflation awake)",
    "IEHS guidelines: <b>Grade A recommendation</b> — TEP and TAPP preferred over Lichtenstein for recurrent hernias after prior open anterior repair",
]:
    story.append(bull(b))
story.append(sp(4))

# ══ 2. TEP ═══════════════════════════════════════════════
story += [h1("2. TEP — Totally Extraperitoneal Repair"), h2("Definition")]
story.append(body(
    "Access to the preperitoneal space <b>without entering the peritoneal cavity</b>. "
    "Dissection occurs entirely between the peritoneum and the anterior abdominal wall."
))

story.append(h2("Operative Steps"))
steps_tep = [
    ("1", "Infraumbilical curvilinear incision (contralateral to hernia side)"),
    ("2", "Dissect to anterior rectus sheath → incise fascia transversely; retract rectus muscle laterally"),
    ("3", "Advance dissecting balloon (or blunt laparoscope) toward pubic symphysis; inflate slowly under direct vision to develop preperitoneal space"),
    ("4", "Three midline trocars: 10/12 mm Hassan at umbilicus; 5 mm at 1/3 and 5 mm at 2/3 distance from umbilicus to pubic symphysis"),
    ("5", "Pneumopreperitoneum (CO₂) to 15 mmHg (NOT pneumoperitoneum)"),
    ("6", "Blunt dissection of preperitoneal fat; identify and preserve inferior epigastric vessels"),
    ("7", "Reduce hernia sac; skeletonise cord structures"),
    ("8", "Place 10×15 cm mesh over myopectineal orifice"),
    ("9", "Slow desufflation under direct vision — hold inferior mesh edge to prevent peritoneal flap herniation below mesh"),
    ("10","Close anterior rectus sheath with interrupted suture; skin closure"),
]
tep_table_data = [["Step", "Action"]]
for s, a in steps_tep:
    tep_table_data.append([Paragraph(s, TC_B_S), Paragraph(a, TC_S)])
t = Table(tep_table_data, colWidths=[1.2*cm, W-1.2*cm], repeatRows=1)
t.setStyle(TableStyle([
    ("BACKGROUND", (0,0), (-1,0), colors.HexColor("#2e6da4")),
    ("ROWBACKGROUNDS", (0,1), (-1,-1), [colors.HexColor("#eef4fb"), colors.white]),
    ("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#b0c4de")),
    ("VALIGN", (0,0), (-1,-1), "TOP"),
    ("LEFTPADDING", (0,0), (-1,-1), 5),
    ("RIGHTPADDING", (0,0), (-1,-1), 5),
    ("TOPPADDING", (0,0), (-1,-1), 4),
    ("BOTTOMPADDING", (0,0), (-1,-1), 4),
    ("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"),
    ("TEXTCOLOR", (0,0), (-1,0), colors.white),
]))
story.append(t)
story.append(sp(4))

story.append(h2("Key Technical Points"))
for b in [
    "<b>Peritoneal rent</b>: close immediately with absorbable endoloop or intracorporeal suture; unrepaired rent compromises field and risks small bowel obstruction",
    "<b>Significant pneumoperitoneum</b>: insert Veress needle at Palmer's point to desufflate",
    "No peritoneal closure required (peritoneum never formally opened)",
]:
    story.append(bull(b))

story.append(h2("Advantages"))
for b in [
    "No intraperitoneal entry → no risk of visceral injury from ports",
    "No port-site hernia through an iatrogenic peritoneal defect",
    "No intraperitoneal adhesions",
    "Preferred when prior surgery creates intraperitoneal adhesions",
]:
    story.append(bull(b))

story.append(h2("Disadvantages / Contraindications"))
for b in [
    "Smaller working space → steeper learning curve",
    "Prior pelvic surgery, radiation, or lower midline incisions → preperitoneal space may be scarred",
    "Peritoneal tear significantly complicates the procedure",
]:
    story.append(bull(b))
story.append(sp(6))

# ══ 3. TAPP ══════════════════════════════════════════════
story += [h1("3. TAPP — Transabdominal Preperitoneal Repair"), h2("Definition")]
story.append(body(
    "Peritoneal cavity is entered first (transabdominal), preperitoneum dissected through a "
    "peritoneal incision, mesh placed, and the <b>peritoneum is formally closed over the mesh</b>."
))

story.append(h2("Operative Steps"))
steps_tapp = [
    ("1", "Pneumoperitoneum to 15 mmHg via Veress needle or Hasson (open) technique"),
    ("2", "Three trocars: 10 mm camera (midline supra/infraumbilical) + two 5 mm working ports lateral and slightly inferior to umbilical port"),
    ("3", "Trendelenburg position; visualise bladder, umbilical ligaments, inferior epigastric vessels, external iliac vessels"),
    ("4", "Peritoneal incision at medial umbilical ligament, 3–4 cm superior to hernia defect, carried laterally to ASIS"),
    ("5", "Bilateral repair: bilateral incisions with midline bridge preserved (protects patent urachus)"),
    ("6", "Retract inferior peritoneal edge; bluntly dissect preperitoneal space; expose spermatic cord"),
    ("7", "Direct hernia sac: invert and fix to Cooper's ligament (prevents haematoma/seroma)"),
    ("8", "Indirect hernia sac: grasp, elevate superiorly; develop space below; dissect from cord; skeletonise cord"),
    ("9", "Place 10×15 cm mesh to cover myopectineal orifice"),
    ("10","Close peritoneum over mesh (staples, tacks, or suture) — critical to prevent mesh-bowel contact"),
    ("11","Desufflation, trocar removal, skin closure"),
]
tapp_table_data = [["Step", "Action"]]
for s, a in steps_tapp:
    tapp_table_data.append([Paragraph(s, TC_B_S), Paragraph(a, TC_S)])
t2 = Table(tapp_table_data, colWidths=[1.2*cm, W-1.2*cm], repeatRows=1)
t2.setStyle(TableStyle([
    ("BACKGROUND", (0,0), (-1,0), colors.HexColor("#2e6da4")),
    ("ROWBACKGROUNDS", (0,1), (-1,-1), [colors.HexColor("#eef4fb"), colors.white]),
    ("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#b0c4de")),
    ("VALIGN", (0,0), (-1,-1), "TOP"),
    ("LEFTPADDING", (0,0), (-1,-1), 5),
    ("RIGHTPADDING", (0,0), (-1,-1), 5),
    ("TOPPADDING", (0,0), (-1,-1), 4),
    ("BOTTOMPADDING", (0,0), (-1,-1), 4),
    ("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"),
    ("TEXTCOLOR", (0,0), (-1,0), colors.white),
]))
story.append(t2)
story.append(sp(4))

story.append(h2("Robotic TAPP"))
for b in [
    "All robotic inguinofemoral hernia repairs use TAPP (not TEP)",
    "Camera port placed ≥2 cm supraumbilical (longer instruments need more space)",
    "Two 8 mm robotic trocars in right and left midclavicular lines, 8–10 cm apart",
]:
    story.append(bull(b))

story.append(h2("Advantages"))
for b in [
    "Wide operative field — no technical space constraints",
    "Contralateral hernia identified without additional preperitoneal dissection",
    "Better for bilateral hernias, large defects, and anterior approach scarring",
    "Preferred platform for robotic surgery",
    "Less steep learning curve than TEP",
]:
    story.append(bull(b))

story.append(h2("Disadvantages / Contraindications"))
for b in [
    "Peritoneal cavity entered → risk of visceral/vascular injury",
    "Risk of port-site hernia through peritoneal defect",
    "Multiple prior abdominal surgeries → extensive adhesiolysis may be required",
    "Peritoneum must be closed over mesh — technically critical",
]:
    story.append(bull(b))
story.append(sp(6))

# ══ 4. CRITICAL ANATOMY ══════════════════════════════════
story += [h1("4. Critical Preperitoneal Anatomy")]
story.append(body("The preperitoneal space is divided into <b>3 operative zones</b>:"))
story.append(table(
    ["Zone", "Location", "Contents / Significance"],
    [
        ["Zone 1", "Lateral to internal inguinal ring / spermatic vessels", "Psoas muscle posteriorly; ASIS laterally; <b>Triangle of Pain</b>"],
        ["Zone 2", "Medial to inferior epigastric vessels", "Site of direct hernias"],
        ["Zone 3", "Central — between zones 1 and 2", "Inferior epigastric vessels, internal inguinal ring, spermatic cord, external iliac vessels; <b>Triangle of Doom</b>"],
    ],
    widths=[2*cm, 5.5*cm, W-7.5*cm]
))
story.append(sp(6))

story.append(h2("Two Danger Triangles"))
story.append(table(
    ["Triangle", "Zone", "Boundaries", "Contents", "Consequence of Injury"],
    [
        ["<b>Triangle of Doom</b>", "Zone 3",
         "Vas deferens (medial)\nTesticular vessels (lateral)\nPeritoneal fold (inferior)",
         "External iliac artery and vein",
         "Catastrophic haemorrhage"],
        ["<b>Triangle of Pain</b>", "Zone 1",
         "Iliopubic tract (superior)\nTesticular vessels (medial)\nPeritoneal fold (inferior)",
         "Lateral femoral cutaneous nerve\nGenitofemoral nerve\nFemoral nerve",
         "Chronic groin/thigh neuralgia"],
    ],
    widths=[3.2*cm, 1.5*cm, 4*cm, 4.5*cm, W-13.2*cm]
))
story.append(note(
    "RULE: No tacks, staples, or sutures lateral to the testicular vessels or below the iliopubic tract."
))
story.append(sp(6))

# ══ 5. TEP vs TAPP COMPARISON ════════════════════════════
story += [h1("5. TEP vs. TAPP — Comparison")]
story.append(table(
    ["Feature", "TEP", "TAPP"],
    [
        ["Peritoneal entry",        "<b>No</b>",                   "<b>Yes</b>"],
        ["Working space",           "Smaller (preperitoneal only)", "Larger (intraperitoneal view)"],
        ["Learning curve",          "Steeper",                     "Less steep"],
        ["Visceral injury risk",    "Lower",                       "Higher (trocars in abdomen)"],
        ["Port-site hernia",        "No",                          "Possible"],
        ["Adhesion risk",           "None",                        "Possible"],
        ["Bilateral repair",        "Yes (no extra steps)",        "Yes (bilateral incisions)"],
        ["Peritoneal closure",      "Not required",                "<b>Required</b> (over mesh)"],
        ["Prior pelvic surgery",    "Difficult (scarred space)",   "Better tolerated"],
        ["Robotic platform",        "Not standard",                "<b>Preferred</b>"],
        ["Recurrent hernia (post-open)", "IEHS Grade A",          "IEHS Grade A"],
        ["Anaesthesia",             "GA required",                 "GA required"],
    ],
    widths=[5*cm, 6*cm, 6*cm]
))
story.append(sp(6))

# ══ 6. INDICATIONS ═══════════════════════════════════════
story += [h1("6. Indications for Laparoscopic Repair (TEP/TAPP)")]
for b in [
    "Primary inguinal hernia (unilateral or bilateral)",
    "<b>Bilateral inguinal hernias</b> — laparoscopic superior to open (Grade A evidence)",
    "<b>Recurrent hernia after prior open anterior repair</b> — TEP/TAPP preferred (IEHS Grade A)",
    "Concurrent hernia repair during another laparoscopic procedure (e.g. prostatectomy) without contamination",
    "Femoral hernias (both techniques access femoral canal well)",
]:
    story.append(bull(b))
story.append(sp(4))

story += [h1("7. Contraindications")]
story.append(table(
    ["Contraindication", "Applies To"],
    [
        ["Inability to tolerate general anaesthesia", "Both TEP and TAPP"],
        ["Prior pelvic surgery / radiation / lower midline incisions", "TEP primarily"],
        ["Multiple prior abdominal surgeries with extensive adhesions", "TAPP primarily"],
        ["Uncontrolled coagulopathy", "Both"],
        ["Unstable cardiovascular disease", "Both"],
    ],
    widths=[10*cm, 7*cm]
))
story.append(sp(6))

# ══ 8. COMPLICATIONS ═════════════════════════════════════
story += [h1("8. Complications of Laparoscopic Repair")]
story.append(table(
    ["Complication", "Notes"],
    [
        ["Injury to triangle of doom", "External iliac vessel injury — rare but catastrophic haemorrhage"],
        ["Injury to triangle of pain", "Chronic groin/thigh neuralgia from nerve injury"],
        ["Seroma",                     "Most common; usually self-limiting"],
        ["Peritoneal rent (TEP)",      "Must be repaired immediately to maintain working space"],
        ["Port-site hernia",           "More common with TAPP through peritoneal defect"],
        ["Mesh migration/folding",     "During desufflation in TEP if inferior edge not held"],
        ["Recurrence",                 "~1–2%; similar to open Lichtenstein"],
        ["Conversion to open",         "Required in ~1–3%"],
    ],
    widths=[5.5*cm, W-5.5*cm]
))

story += [sp(10), thr(),
    Paragraph(
        "Sources: Schwartz's Principles of Surgery 11e, Ch. 37 | "
        "Fischer's Mastery of Surgery 8e, Ch. 223 | "
        "Mulholland &amp; Greenfield's Surgery 7e",
        SMALL_S)]

doc.build(story)
print(f"PDF created: {OUTPUT}")
Running Command

cd /tmp/workspace && python tep_tapp.py

Your PDF is ready:

TEP TAPP Short Note

PDF Document · PDF

The document covers all 8 sections:
  1. Background and epidemiology
  2. TEP - definition, operative steps (numbered table), key technical points, advantages/disadvantages
  3. TAPP - definition, operative steps (numbered table), robotic TAPP, advantages/disadvantages
  4. Critical preperitoneal anatomy - 3 zones + Triangle of Doom and Triangle of Pain table
  5. TEP vs. TAPP comparison table
  6. Indications
  7. Contraindications
  8. Complications

Surgery role in monkey pox

Surgery plays a limited but specific role in mpox (monkeypox) - mainly for managing complications like secondary-infected lesions, abscesses, and severe anorectal disease, not the primary infection itself.
Searching sources...
Finding Sources
Finding Sources
Searching the Web

mpox monkeypox surgical management role of surgery complications 2024 2025

Reading Web Page

https://pmc.ncbi.nlm.nih.gov/articles/PMC11434558

Searching PubMed

mpox monkeypox surgery surgical complications

Reading Article

PMID: 40493066

Reading Article

PMID: 37186888

Here is a comprehensive short note on the surgical role in mpox.

Role of Surgery in Mpox (Monkeypox)

Overview

Mpox (formerly monkeypox) is an orthopoxvirus infection that typically causes a self-limited febrile illness with characteristic skin lesions and lymphadenopathy. Surgery is not part of routine mpox management - the primary treatment is supportive care, antivirals (tecovirimat, brincidofovir), and vaccinia immune globulin (VIG) for severe cases. However, surgery has a defined and increasingly recognised role in managing complications, particularly in immunocompromised patients and those with severe/refractory disease.
A 2025 review (Chryssofos et al., Am Surg, PMID 40493066) targeting surgeons specifically calls for heightened awareness and preparedness, particularly with the emergence of the more virulent Clade Ib variant (2024).

When Surgery Is Needed

1. Skin and Soft Tissue Complications

These represent the most common surgical indications:
ComplicationSurgical Intervention
Cutaneous abscess (secondary bacterial superinfection of lesions)Incision and drainage (I&D)
Cellulitis unresponsive to antibioticsWound exploration, drainage
Necrotising soft tissue infection (NSTI)Urgent surgical debridement; repeated re-look operations; possible skin grafting
Skin exfoliation (confluent lesions forming large denuded areas)Surgical debridement by expert + wound care; possible split-skin grafting
Cutaneous scarring / contractureReconstructive surgery (delayed)
  • NICD guidelines (2025) state: For complications such as exfoliation or suspicion of deeper soft tissue infection (pyomyositis, abscess, necrotising infection), consult a surgeon. Debridement should NOT be done unless performed by an expert wearing appropriate PPE.
  • Confluent lesions are particularly susceptible to bacterial skin and soft tissue infections; subcutaneous fluid accumulation in the crusting phase can lead to intravascular depletion and shock.

2. Anorectal / Colorectal Manifestations

This is the most significant and emerging surgical area in mpox:
  • Mpox proctitis and perianal disease are increasingly recognised, particularly in men who have sex with men (MSM) and HIV-positive individuals
  • Lesions can progress to perianal abscesses, fistula-in-ano, and severe proctitis refractory to antiviral therapy
  • A case report (Cherfan et al., Am Surg 2023, PMID 37186888) documented an HIV-positive male on tecovirimat + VIG whose perianal lesions evolved into abscesses requiring incision and drainage - surgery provided immediate relief and reduced long-term morbidity
  • In the most severe cases: defunctioning colostomy may be necessary to divert faecal stream and allow healing
  • Colorectal manifestations often require: surgical drainage of abscesses, examination under anaesthesia (EUA), and in refractory cases, colostomy

3. Ophthalmic Manifestations

  • Mpox can cause conjunctivitis, keratitis, corneal ulceration, and canalicular obstruction
  • Surgical indications:
    • Dacryocystorhinostomy (DCR) for canalicular/nasolacrimal obstruction post-mpox (Felguera-García et al., Orbit 2025, PMID 39087983)
    • Corneal procedures (keratoplasty) for vision-threatening corneal scarring
    • Prompt and aggressive ophthalmic management is required to prevent permanent vision loss

4. Facial and Oropharyngeal Lesions

  • Facial lesions may cause significant scarring requiring reconstructive surgery (delayed, once infection resolved)
  • Oropharyngeal lesions can cause airway compromise - critically important for anaesthetic planning:
    • Awake fibreoptic intubation may be required
    • Emergency surgical airway (cricothyrotomy/tracheostomy) in extreme cases of airway obstruction
  • Severe tonsillitis or tonsillar necrosis from mpox lesions may warrant surgical consultation

5. Lymph Node Complications

  • Mpox characteristically causes prominent lymphadenopathy (a distinguishing feature from smallpox)
  • Rarely: necrotising lymphadenitis or obstructing lymphadenopathy (e.g. mediastinal, causing airway obstruction) may require surgical or interventional drainage

6. Urogenital Complications

  • Balanitis / balanoposthitis causing urethral meatal obstruction - may require:
    • Urological surgery (meatotomy, catheterisation)
    • Dorsal slit procedure
  • Severe genital scarring may require reconstructive procedures (delayed)

7. Mpox in Solid Organ Transplant Recipients

  • Transplant recipients on immunosuppression are high-risk for severe mpox
  • Surgical challenges include: delayed diagnosis, complex drug interactions (antivirals + immunosuppressants), stringent isolation needs, and higher complication rates
  • Multidisciplinary team (ID specialist + transplant surgeon + critical care) is essential

Perioperative Considerations

When a patient with mpox requires surgery (elective or emergency), strict protocols apply:

Infection Control in the OR

  • Elective surgery must be deferred until the patient is non-infectious (typically after all lesions have crusted and fallen off)
  • For emergency surgery: proceed with maximal precautions
  • Use standard + contact + droplet + airborne precautions (PPE: N95/FFP3 respirator, gown, gloves, eye protection)
  • Minimise OR traffic and number of personnel
  • Use EPA-registered disinfectants for all surfaces and equipment after the case
  • Single-use equipment preferred where possible

Anaesthetic Considerations

  • Oropharyngeal lesions mandate careful airway assessment preoperatively
  • Awake fibreoptic intubation may be preferred to avoid trauma to lesions (which could release infectious viral particles)
  • Full airborne precautions during intubation/extubation
  • Preoperative screening: fever, rash, swollen lymph nodes

Surgeon Awareness

  • Mpox can mimic common surgical conditions: perianal abscess, pilonidal disease, STIs, cellulitis, lymphadenitis - surgeons must consider mpox in the differential, especially in at-risk populations
  • Biopsy of suspicious lesions (with appropriate PPE) can secure the diagnosis

Summary Table - Surgical Indications in Mpox

SystemComplicationSurgical Procedure
Skin/Soft tissueAbscessIncision and drainage
Skin/Soft tissueNSTIDebridement ± skin grafting
Skin/Soft tissueSkin exfoliationExpert debridement ± grafting
AnorectalPerianal abscessI&D ± EUA
AnorectalSevere proctitis/fistulaEUA, fistulotomy
AnorectalRefractory/severe diseaseDefunctioning colostomy
OphthalmicCanalicular obstructionDCR
OphthalmicCorneal scarringKeratoplasty (delayed)
UrogenitalUrethral meatal obstructionMeatotomy / catheterisation
OropharyngealAirway compromiseAwake intubation / tracheostomy
Lymph nodesNecrotising / obstructingSurgical/interventional drainage
FacialScarring / deformityReconstructive surgery (delayed)

Key Principles

  1. Surgery is reactive, not primary - treat the infection first with antivirals/supportive care
  2. Immunocompromised patients (HIV, transplant recipients) are at highest risk of complications requiring surgery
  3. Anorectal disease is the most common and clinically significant surgical indication
  4. All surgical intervention on active mpox patients requires full PPE - the virus is highly infectious via direct contact with lesions
  5. Defer elective surgery until lesions have fully resolved
  6. A multidisciplinary approach (surgeon + ID specialist + critical care) optimises outcomes

Sources: Chryssofos et al., Am Surg 2025 (PMID 40493066) | Cherfan et al., Am Surg 2023 (PMID 37186888) | NICD Clinical Guidelines May 2025 | WHO Living Guideline May 2025 | UpToDate: Treatment and prevention of mpox

Generate a PDF of the mpox surgery short note

Writing File

~/mpox_surgery.py

from reportlab.lib.pagesizes import A4
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm
from reportlab.lib import colors
from reportlab.platypus import (
    SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
    HRFlowable, KeepTogether
)
from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_JUSTIFY

OUTPUT = "/tmp/workspace/Mpox_Surgery_Short_Note.pdf"

doc = SimpleDocTemplate(
    OUTPUT, pagesize=A4,
    leftMargin=2*cm, rightMargin=2*cm,
    topMargin=2.2*cm, bottomMargin=2*cm,
    title="Role of Surgery in Mpox (Monkeypox)",
    author="Orris Medical"
)

# ── Styles ──────────────────────────────────────────────
TITLE_S = ParagraphStyle("TitleS", fontSize=18, fontName="Helvetica-Bold",
    alignment=TA_CENTER, textColor=colors.HexColor("#1a3a5c"), spaceAfter=4)
SUB_S   = ParagraphStyle("SubS",   fontSize=11, fontName="Helvetica-Oblique",
    alignment=TA_CENTER, textColor=colors.HexColor("#2e6da4"), spaceAfter=2)
SRC_S   = ParagraphStyle("SrcS",   fontSize=8,  fontName="Helvetica-Oblique",
    alignment=TA_CENTER, textColor=colors.HexColor("#777777"), spaceAfter=8)
H1_S    = ParagraphStyle("H1S",    fontSize=13, fontName="Helvetica-Bold",
    textColor=colors.HexColor("#1a3a5c"), spaceBefore=12, spaceAfter=5)
H2_S    = ParagraphStyle("H2S",    fontSize=11, fontName="Helvetica-Bold",
    textColor=colors.HexColor("#2e6da4"), spaceBefore=9,  spaceAfter=4)
H3_S    = ParagraphStyle("H3S",    fontSize=10, fontName="Helvetica-Bold",
    textColor=colors.HexColor("#1a5276"), spaceBefore=7,  spaceAfter=3)
BODY_S  = ParagraphStyle("BodyS",  fontSize=9.5, fontName="Helvetica",
    leading=14, spaceAfter=4, spaceBefore=2, alignment=TA_JUSTIFY)
BULL_S  = ParagraphStyle("BullS",  fontSize=9.5, fontName="Helvetica",
    leading=13, spaceAfter=2, spaceBefore=1, leftIndent=14, bulletIndent=4)
NOTE_S  = ParagraphStyle("NoteS",  fontSize=8.8, fontName="Helvetica-Oblique",
    textColor=colors.HexColor("#333333"), spaceAfter=4, spaceBefore=3,
    leftIndent=10, leading=13,
    borderColor=colors.HexColor("#2e6da4"), borderWidth=0.5,
    borderPadding=(4,6,4,6), backColor=colors.HexColor("#eef4fb"))
SMALL_S = ParagraphStyle("SmallS", fontSize=8,  fontName="Helvetica-Oblique",
    textColor=colors.HexColor("#555555"), spaceAfter=3)
TH_S    = ParagraphStyle("THS",    fontSize=9,  fontName="Helvetica-Bold",
    textColor=colors.white, leading=12)
TC_S    = ParagraphStyle("TCS",    fontSize=9,  fontName="Helvetica", leading=12)
TC_B_S  = ParagraphStyle("TCBS",   fontSize=9,  fontName="Helvetica-Bold", leading=12)

def h1(t):  return Paragraph(t, H1_S)
def h2(t):  return Paragraph(t, H2_S)
def h3(t):  return Paragraph(t, H3_S)
def body(t):return Paragraph(t, BODY_S)
def bull(t):return Paragraph(f"• {t}", BULL_S)
def note(t):return Paragraph(t, NOTE_S)
def sp(h=4):return Spacer(1, h)
def hr():   return HRFlowable(width="100%", thickness=0.8,
                color=colors.HexColor("#2e6da4"), spaceAfter=4, spaceBefore=4)
def thr():  return HRFlowable(width="100%", thickness=0.4,
                color=colors.HexColor("#aaaaaa"), spaceAfter=3, spaceBefore=3)

W = 17*cm

def tbl(headers, rows, widths=None):
    data = [[Paragraph(h, TH_S) for h in headers]]
    for row in rows:
        cells = []
        for c in row:
            if str(c).startswith("<b>"):
                cells.append(Paragraph(str(c), TC_B_S))
            else:
                cells.append(Paragraph(str(c), TC_S))
        data.append(cells)
    t = Table(data, colWidths=widths, repeatRows=1)
    t.setStyle(TableStyle([
        ("BACKGROUND",     (0,0), (-1,0),  colors.HexColor("#2e6da4")),
        ("ROWBACKGROUNDS", (0,1), (-1,-1), [colors.HexColor("#eef4fb"), colors.white]),
        ("GRID",           (0,0), (-1,-1), 0.4, colors.HexColor("#b0c4de")),
        ("VALIGN",         (0,0), (-1,-1), "TOP"),
        ("LEFTPADDING",    (0,0), (-1,-1), 5),
        ("RIGHTPADDING",   (0,0), (-1,-1), 5),
        ("TOPPADDING",     (0,0), (-1,-1), 4),
        ("BOTTOMPADDING",  (0,0), (-1,-1), 4),
    ]))
    return t

story = []

# ══ TITLE ════════════════════════════════════════════════
story += [
    sp(6),
    Paragraph("Role of Surgery in Mpox", TITLE_S),
    Paragraph("(Monkeypox) — Short Note", SUB_S),
    Paragraph(
        "Sources: Chryssofos et al., Am Surg 2025 (PMID 40493066) | "
        "Cherfan et al., Am Surg 2023 (PMID 37186888) | "
        "NICD Guidelines May 2025 | WHO Living Guideline 2025 | UpToDate",
        SRC_S),
    hr(), sp(4),
]

# ══ 1. OVERVIEW ══════════════════════════════════════════
story += [h1("1. Overview")]
story.append(body(
    "Mpox (formerly monkeypox) is an <b>orthopoxvirus</b> infection causing a self-limited "
    "febrile illness with characteristic skin lesions and lymphadenopathy. "
    "<b>Surgery is not part of routine mpox management</b> — primary treatment is supportive "
    "care, antivirals (tecovirimat, brincidofovir), and vaccinia immune globulin (VIG) for "
    "severe cases. However, surgery has a defined and increasingly recognised role in "
    "<b>managing complications</b>, particularly in immunocompromised patients and those "
    "with severe or refractory disease."
))
story.append(body(
    "A 2025 review by Chryssofos et al. specifically targeting surgeons calls for "
    "heightened awareness and preparedness, particularly with the emergence of the more "
    "virulent <b>Clade Ib variant (2024)</b>, which has reached the United States and Europe."
))
story.append(sp(4))

# ══ 2. WHEN SURGERY IS NEEDED ════════════════════════════
story += [h1("2. Surgical Indications by System")]

# 2.1 Skin
story += [h2("2.1 Skin and Soft Tissue Complications")]
story.append(body(
    "The most common surgical indications arise from <b>secondary bacterial superinfection</b> "
    "of confluent or necrotic lesions, and from skin exfoliation forming large denuded areas."
))
story.append(tbl(
    ["Complication", "Surgical Intervention"],
    [
        ["<b>Cutaneous abscess</b> (secondary bacterial superinfection)", "Incision and drainage (I&amp;D)"],
        ["<b>Cellulitis</b> unresponsive to antibiotics", "Wound exploration, drainage"],
        ["<b>Necrotising soft tissue infection (NSTI)</b>", "Urgent surgical debridement; repeated re-look operations; possible skin grafting"],
        ["<b>Skin exfoliation</b> (confluent lesions, large denuded areas)", "Expert debridement (with full PPE) + wound care; split-skin grafting"],
        ["<b>Cutaneous scarring / contracture</b> (delayed)", "Reconstructive surgery after infection resolved"],
    ],
    widths=[7.5*cm, W-7.5*cm]
))
story.append(note(
    "NICD 2025: Debridement should NOT be performed unless by an expert wearing "
    "appropriate PPE. Optimal management of skin lesions remains uncertain and needs further research."
))
story.append(sp(4))

# 2.2 Anorectal
story += [h2("2.2 Anorectal / Colorectal Manifestations")]
story.append(body(
    "This is the <b>most significant and emerging surgical area</b> in mpox — particularly in "
    "men who have sex with men (MSM) and HIV-positive individuals."
))
for b in [
    "Mpox proctitis and perianal disease can progress to <b>perianal abscesses, fistula-in-ano, and severe proctitis</b> refractory to antiviral therapy",
    "Case report (Cherfan et al., 2023): HIV-positive male on tecovirimat + VIG developed perianal abscesses requiring <b>incision and drainage</b> — surgery provided immediate relief and reduced long-term morbidity",
    "In the most severe cases: <b>defunctioning colostomy</b> to divert faecal stream and allow healing",
]:
    story.append(bull(b))
story.append(body("<b>Colorectal surgical procedures used:</b>"))
for b in [
    "Incision and drainage of perianal abscess",
    "Examination under anaesthesia (EUA)",
    "Fistulotomy / seton placement",
    "Defunctioning colostomy (refractory/severe cases)",
]:
    story.append(bull(b))
story.append(sp(4))

# 2.3 Ophthalmic
story += [h2("2.3 Ophthalmic Manifestations")]
story.append(body(
    "Mpox can cause conjunctivitis, keratitis, corneal ulceration, and <b>canalicular/nasolacrimal "
    "obstruction</b>. Prompt management is required to prevent permanent vision loss."
))
for b in [
    "<b>Dacryocystorhinostomy (DCR)</b> — for canalicular/nasolacrimal duct obstruction post-mpox (Felguera-García et al., Orbit 2025, PMID 39087983)",
    "<b>Keratoplasty</b> — for vision-threatening corneal scarring (delayed, after resolution of active infection)",
    "Conjunctival/corneal debridement for recalcitrant corneal ulcers",
]:
    story.append(bull(b))
story.append(sp(4))

# 2.4 Oropharyngeal / Airway
story += [h2("2.4 Oropharyngeal and Airway Complications")]
for b in [
    "Oropharyngeal mpox lesions risk <b>airway compromise</b> — critical for anaesthetic planning",
    "<b>Awake fibreoptic intubation</b> preferred to avoid trauma to lesions (releasing infectious viral particles)",
    "Emergency <b>surgical airway</b> (cricothyrotomy / tracheostomy) in extreme cases of airway obstruction",
    "Severe tonsillar necrosis or pharyngeal lesions may warrant <b>surgical consultation</b>",
    "Facial lesion scarring may require <b>delayed reconstructive surgery</b> once infection resolved",
]:
    story.append(bull(b))
story.append(sp(4))

# 2.5 Lymph nodes
story += [h2("2.5 Lymph Node Complications")]
story.append(body(
    "Mpox characteristically causes <b>prominent lymphadenopathy</b> "
    "(a key distinguishing feature from smallpox)."
))
for b in [
    "Rarely: <b>necrotising lymphadenitis</b> or obstructing lymphadenopathy (e.g. mediastinal, causing airway obstruction)",
    "May require <b>surgical or interventional (CT-guided) drainage</b>",
]:
    story.append(bull(b))
story.append(sp(4))

# 2.6 Urogenital
story += [h2("2.6 Urogenital Complications")]
for b in [
    "<b>Balanitis / balanoposthitis</b> causing urethral meatal obstruction — meatotomy, dorsal slit, or urethral catheterisation",
    "Severe genital scarring — reconstructive procedures (delayed)",
]:
    story.append(bull(b))
story.append(sp(4))

# 2.7 Transplant recipients
story += [h2("2.7 Solid Organ Transplant Recipients")]
for b in [
    "Highest risk group for severe mpox requiring surgery",
    "Complex drug interactions between antivirals and immunosuppressants",
    "Stringent isolation protocols and specialised surgical teams required",
    "<b>Multidisciplinary team</b> (ID specialist + transplant surgeon + critical care) is essential",
    "Delayed diagnosis due to atypical presentations in immunosuppressed patients",
]:
    story.append(bull(b))
story.append(sp(6))

# ══ 3. PERIOPERATIVE CONSIDERATIONS ═════════════════════
story += [h1("3. Perioperative Considerations")]

story += [h2("3.1 General Principles")]
story.append(tbl(
    ["Principle", "Detail"],
    [
        ["<b>Defer elective surgery</b>", "Until all lesions have crusted and fallen off (patient non-infectious)"],
        ["<b>Emergency surgery</b>", "Proceed with maximal infection control precautions"],
        ["<b>Preoperative screening</b>", "Assess for fever, rash, swollen lymph nodes, oropharyngeal lesions"],
        ["<b>Airway assessment</b>", "Mandatory — oropharyngeal lesions may complicate intubation"],
        ["<b>Multidisciplinary planning</b>", "ID specialist + surgeon + anaesthetist + critical care"],
    ],
    widths=[5*cm, W-5*cm]
))
story.append(sp(4))

story += [h2("3.2 Infection Control in the Operating Room")]
for b in [
    "Full <b>PPE: N95/FFP3 respirator, gown, gloves, eye/face protection</b>",
    "Standard + contact + droplet + <b>airborne precautions</b> throughout",
    "<b>Minimise OR traffic</b> — limit number of personnel to essential only",
    "Prefer <b>single-use equipment</b>",
    "<b>EPA-registered disinfectants</b> for all surfaces and equipment after the case",
    "Aerosol-generating procedures (intubation, extubation, surgical diathermy on lesions) require highest level PPE",
    "Surgical smoke from electrocautery on lesions may contain viable virus — use smoke evacuators",
]:
    story.append(bull(b))
story.append(sp(4))

story += [h2("3.3 Anaesthetic Considerations")]
for b in [
    "Pre-anaesthetic airway examination is mandatory",
    "Awake fibreoptic intubation preferred if oropharyngeal lesions present",
    "Rapid-sequence induction (RSI) if oropharyngeal lesions absent and airway is clear",
    "Extubation in negative-pressure room if available",
    "Full airborne precautions during intubation and extubation",
]:
    story.append(bull(b))
story.append(sp(6))

# ══ 4. MPOX MIMICKING SURGICAL CONDITIONS ════════════════
story += [h1("4. Mpox Mimicking Surgical Conditions")]
story.append(body(
    "Surgeons must consider mpox in the differential diagnosis of common surgical presentations, "
    "especially in at-risk populations (MSM, HIV-positive, sexual contacts, travellers from endemic regions)."
))
story.append(tbl(
    ["Surgical Presentation", "Mpox Mimicry"],
    [
        ["Perianal abscess / fistula", "Mpox perianal lesions, proctitis, abscess"],
        ["Inguinal lymphadenopathy / abscess", "Mpox inguinal lymphadenitis (often bilateral — clue to mpox)"],
        ["Pilonidal disease", "Mpox sacral / perianal lesions"],
        ["Cellulitis / NSTI", "Confluent infected mpox skin lesions"],
        ["STI-related genital ulcer", "Mpox genital lesions"],
        ["Dacryocystitis", "Mpox-related lacrimal duct obstruction"],
    ],
    widths=[6*cm, W-6*cm]
))
story.append(note(
    "Key diagnostic tip: Biopsy of suspicious lesions (with full PPE) can confirm mpox via PCR. "
    "Bilateral lymphadenopathy is a distinguishing feature of mpox vs. most other infections."
))
story.append(sp(6))

# ══ 5. MASTER SUMMARY TABLE ══════════════════════════════
story += [h1("5. Summary — Surgical Indications in Mpox")]
story.append(tbl(
    ["System", "Complication", "Surgical Procedure"],
    [
        ["Skin/Soft tissue", "Abscess",                    "Incision and drainage"],
        ["Skin/Soft tissue", "NSTI",                       "Debridement ± skin grafting"],
        ["Skin/Soft tissue", "Skin exfoliation",           "Expert debridement ± grafting"],
        ["Skin/Soft tissue", "Scarring/contracture",       "Reconstructive surgery (delayed)"],
        ["Anorectal",        "Perianal abscess",           "I&amp;D ± examination under anaesthesia (EUA)"],
        ["Anorectal",        "Fistula-in-ano",             "EUA, fistulotomy / seton"],
        ["Anorectal",        "Refractory proctitis",       "Defunctioning colostomy"],
        ["Ophthalmic",       "Canalicular obstruction",    "Dacryocystorhinostomy (DCR)"],
        ["Ophthalmic",       "Corneal scarring",           "Keratoplasty (delayed)"],
        ["Urogenital",       "Urethral meatal obstruction","Meatotomy / catheterisation / dorsal slit"],
        ["Oropharyngeal",    "Airway compromise",          "Awake intubation / tracheostomy"],
        ["Lymph nodes",      "Necrotising/obstructing",    "Surgical/interventional drainage"],
        ["Facial",           "Scarring/deformity",         "Reconstructive surgery (delayed)"],
    ],
    widths=[3.5*cm, 5.5*cm, W-9*cm]
))
story.append(sp(6))

# ══ 6. KEY PRINCIPLES ════════════════════════════════════
story += [h1("6. Key Principles")]
for i, b in enumerate([
    "<b>Surgery is reactive, not primary</b> — treat the infection first with antivirals and supportive care",
    "<b>Immunocompromised patients</b> (HIV, transplant recipients) are at highest risk of complications requiring surgery",
    "<b>Anorectal disease</b> is the most common and clinically significant surgical indication",
    "<b>All surgical intervention on active mpox patients requires full PPE</b> — the virus is highly infectious via direct contact with lesions",
    "<b>Defer elective surgery</b> until all lesions have fully resolved",
    "<b>Mpox can mimic common surgical conditions</b> — maintain a high index of suspicion in at-risk populations",
    "A <b>multidisciplinary approach</b> (surgeon + ID specialist + critical care + anaesthetist) optimises outcomes",
], 1):
    story.append(Paragraph(f"{i}. {b}", BULL_S))

story += [sp(10), thr(),
    Paragraph(
        "Sources: Chryssofos et al., Am Surg 2025 (PMID 40493066) | "
        "Cherfan et al., Am Surg 2023 (PMID 37186888) | "
        "Felguera-Garcia et al., Orbit 2025 (PMID 39087983) | "
        "NICD Clinical Guidelines May 2025 | WHO Living Guideline May 2025 | UpToDate",
        SMALL_S)]

doc.build(story)
print(f"PDF created: {OUTPUT}")
Running Command

cd /tmp/workspace && python mpox_surgery.py

Your PDF is ready:

Mpox Surgery Short Note

PDF Document · PDF

The document covers all 6 sections with colour-coded headings and formatted tables:
  1. Overview - when surgery is and isn't indicated
  2. Surgical Indications by System - skin/soft tissue, anorectal, ophthalmic, oropharyngeal/airway, lymph nodes, urogenital, transplant recipients
  3. Perioperative Considerations - general principles, OR infection control, anaesthetic considerations
  4. Mpox Mimicking Surgical Conditions - differential diagnosis table
  5. Master Summary Table - all indications at a glance
  6. Key Principles - 7 take-home points
This is a shared conversation. Sign in to Orris to start your own chat.