analyse_media
analyse_media
analyse_media
analyse_media
analyse_media
analyse_media
Based on my thorough analysis of all six textbook pages from SRB's Manual of Surgery, Chapter 32 - Peritoneum, here is a comprehensive structured summary:

Chapter 32: Peritoneum - SRB's Manual of Surgery


ANATOMY

Peritoneum

A serous membrane lining the abdominal cavity composed of:
  • Outer fibrous tissue layer (provides strength)
  • Inner mesothelial cell layer (secretes lubricating fluid)

Parts of Peritoneum

  1. Parietal peritoneum - Lines the inner surface of the abdominal wall and undersurface of diaphragm/pelvic wall. Loosely attached, innervated by somatic nerves - pain sensitive. Anterior peritoneum is most sensitive.
  2. Visceral peritoneum - Lines outer surface of abdominal viscera, firmly adherent, cannot be stripped off. Innervated by autonomic nervous system - NOT pain sensitive.

Peritoneal Cavity

  • Potential space between parietal and visceral peritoneum
  • Normally contains 100 mL of clear, straw-colored fluid secreted by mesothelial cells
  • Quantity and quality varies in pathological conditions
  • Lubricating function allowing frictionless movement of adjacent peritoneal surfaces

Spaces in Peritoneal Cavity

Peritoneal cavity (largest cavity in the body) is divided into different spaces by ligaments and mesenteries. Eleven ligaments: coronary, gastrohepatic, hepatoduodenal, falciform, phrenicocolic, splenorenal, gastrosplenic, duodenocolic, gastrocolic. Mesenteries: transverse mesocolon and bowel mesentery. Nine intra-abdominal spaces including right/left subphrenic, subhepatic, lesser sac, supramesenteric, inframesenteric, right/left paracolic gutters, and pelvic. Peritoneal cavity is surgically divided into supracolic and infracolic compartments.

PHYSIOLOGY

  • Surface area = 2 m², equal to surface area of skin
  • Bidirectional transfer of substances, fluids, and electrolytes
  • Used in peritoneal dialysis
  • Mesothelial cells facilitate rapid healing following injury
  • Adhesions occur due to delayed or incomplete peritoneal healing

Functions of Peritoneum (Box)

  • Fluid secretion (specific gravity <1.016, protein <3 g/dL, total count <3000 cells/L)
  • Fluid absorption
  • Keeps peritoneal surface lubricated
  • Localisation of inflammation and infection
  • Pain perception
  • Inflammatory response and immune activity
  • Peritoneal lymph flow via diaphragm, moved by negative pressure from respiratory movements

Diaphragmatic Defence

Movement of peritoneal fluid and lymph depends on diaphragmatic movement and phases of respiration. During inspiration, altered pressure makes all fluid, bacteria, and particles move upward toward the diaphragm. Fine intercellular pores called diaphragmatic stomatas cover the inferior surface of the diaphragm, leading to diaphragmatic lymphatics and regional lymph nodes and thoracic duct. During expiration, fluid moves toward diaphragm via capillary action. Peritoneal macrophages promote leukocyte migration. Peritoneal mast cells release vasoactive products causing vasodilation. Complements cause bacterial opsonization and phagocytosis. Release of fibrin causes adhesions and localisation of infection, often leading to localised abscess.

ACUTE PERITONITIS

Definition

Inflammation of the parietal and serosal layer of the peritoneum due to chemicals (acid/gastric content, bile) or due to bacterial infection. Peritoneal cavity is sterile normally.

Types (Box)

  1. Primary - 2. Secondary - 3. Tertiary

PRIMARY PERITONITIS

  • Commonly due to pneumococci; can occasionally be due to streptococci, haemophilus, Gonococcus (rare now), and other Gram-negative organisms (E. coli)
  • Common in young girls between 3-9 years of age and also in women
  • Primary streptococcal peritonitis: seen in infants and children below 4 years of age with cloudy fibrin flakes in peritoneal cavity; features of tonsillitis and pharyngitis; presents with gastroenteritis features; often greenish watery stool
  • No documented source of infection - infection usually spreads from lower genitals through Fallopian tubes, from upper respiratory tract infection, or from middle ear in males
  • Also common in cirrhotic patients with ascites as Spontaneous Bacterial Peritonitis (SBP):
    • Due to translocation of gut bacteria or through mesenteric lymphatics or blood spread
    • 30% of patients with ascites in cirrhosis will develop SBP
    • 90% of SBP is monomicrobial infection due to E. coli (40%), Klebsiella, Pseudomonas, Proteus (Gram-negative organisms), Streptococcus pneumoniae (15%), and Staphylococcus and anaerobic microorganisms (5%)
  • Can also occur in children with nephrotic syndrome or systemic lupus erythematosus
  • Ascitic fluid protein content becoming less than 1 g/dL increases risk of SBP

Diagnosis of SBP

  • WBC count >250 cells/mm² with >50% polymorphonuclear clear cells (PMN) suggestive of SBP
  • Uncommon after 10 years of age; common in malnourished child and child with nephritis
  • Child is toxic, severely ill and develops septicaemia very early
  • Also seen in ascites patient with indwelling catheter for peritoneal dialysis; patient with peritoneovenous shunt
  • Can also be due to Chlamydial, fungal, or mycobacterial infection
  • TC is very high (>30,000/mm³)

Treatment of SBP

  • Diagnostic tapping, tube peritoneal drainage and laparoscopic drainage and wash are useful methods
  • Broad spectrum antibiotics including combination of aminoglycosides, cephalosporins and metronidazole
  • Local instillation of antibiotics into the peritoneal cavity to achieve quick and effective results
  • Note: Mortality is high

SECONDARY PERITONITIS

  • Secondary to any bowel or other visceral pathology (e.g., trauma, appendicitis)
  • E. coli (70%) is the most common organism
  • Other bacteria: aerobic and anaerobic streptococci, Clostridium Welchii, bacteroides, staphylococci, Klebsiella, Salmonella typhi
  • Duodenal perforation and burst appendicitis are the most common causes

Bacteria Causing Peritonitis

a. Bacteria from GIT: E. coli, aerobic streptococci, Streptococcus faecalis, Staphylococcus, anaerobic streptococci, anaerobes (bacteroides), Klebsiella, Cl. Welchii
b. Bacteria NOT from GIT: Gonococcus, Pneumococcus, are from Fallopian tubes commonly in young females; Chlamydia, beta-haemolytic streptococci, Mycobacterium are few other bacteria
TypeSource
PrimaryMonomicrobial, extraperitoneal source, blood spread
SecondaryMost common, polymicrobial, intraperitoneal source
TertiaryDue to superadded infection following treatment of secondary/primary
Most common bacteria during peritonitis phase: E. coli During abscess formation: B. fragilis Mortality for diffuse peritonitis: 10%

TERTIARY PERITONITIS

  • Occurs after any abdominal surgeries; usually severe; patient may go in for SIRS or MODS early
  • Defined as persistent or recurrent intra-abdominal infection after adequate treatment for primary or secondary peritonitis - usually after 48 hours
  • Common in immunosuppressed individuals with ineffective peritoneal host defences against microbes
  • Infection due to E. faecalis, E. faecium, S. epidermidis, P. aeruginosa, C. albicans
  • Virulence and resistance to drugs are other factors
  • Difficult to diagnose clinically, causing delay in therapy
  • CT abdomen, total and platelet count, LFT, monitoring of renal functions, hourly urine output assessment, chest X-ray are required investigations
  • Treatment: aggressive antibiotic therapy, antifungal therapy, TPN, haemodynamic stability, exploration of abdomen, thorough wash, colostomy/ileostomy or exteriorisation of bowel segment; FFP, packed cells, platelet transfusions may be required; Ventilator/ICU care often needed
  • Often bacteria: enterococci, Candida, Staphylococcus epidermidis, Enterobacter, Pseudomonas show multidrug resistance
  • Mortality rate >50%; Problems: DIC, septicaemia, haemorrhage, pneumonia, ARDS

PATHOGENESIS (Acute Peritonitis)

  • Infected fluid secreted into peritoneal cavity containing bacteria and toxins causing shock, toxaemia
  • Fibrinogen forms fibrin to localise infection
  • Bowel adheres to each other with fluid collecting between loops
  • Thick flakes formed adhering to bowel surface
  • Peritoneum becomes thick, oedematous, velvety and reddish with loss of glistening appearance
  • Omentum is thickened, adherent
  • Site of perforation may be identified by location of the end of the omentum
  • Dilated bowel loops with site of obstruction/gangrene may be found
  • Pus often with pockets in subphrenic, paracolic and pelvic spaces
  • Peritoneal contents initially sterile but eventually become infected (e.g., acute pancreatitis, haemoperitoneum, ruptured urinary bladder) - due to transmural migration of bacteria
  • In perforated duodenal/gastric ulcers: contents initially sterile but later infected to form bacterial peritonitis
  • Bacterial load (2×10⁸ CFU/mL) and virulence overwhelm host defence, interfering with phagocytosis, leading to bacterial multiplication, toxaemia, and pus formation
  • Localised peritonitis: initially localised based on anatomical factors (supracolic/infracolic compartments); greater omentum, paracolic gutters, dilated small bowel, fibrin deposition, omental adhesions, thickened peritoneum, reduced bowel peristalsis - may resolve by proper therapy; if progresses it forms pelvic/subphrenic abscess; if further progresses - generalised peritonitis

Factors Affecting the Spread of Infection in Peritonitis (Box)

  • Rapidity by which the pus is gushed into the peritoneal cavity (e.g., burst appendix, perforations)
  • Amount of peristalsis (more peristalsis = more spread)
  • Virulence of the organism, bacterial load and nature
  • Localising action of the omentum (in children localisation is poor as omentum is small)
  • Immunosuppression (HIV, steroids)
  • Anatomical nature of the peritoneal cavity
  • Age, associated diseases (malignancy, malnutrition, anaemia)

Diffuse/Generalised Peritonitis

Sets in due to poor localisation, rapid peritoneal contamination, virulent organisms, immunodeficiency status, and small omentum in children (not properly developed). Diffuse peritonitis may occasionally get localised to form abscess. Mortality in diffuse generalised peritonitis is 10%.

CLINICAL FEATURES

  • Sudden onset of severe pain
  • Fever, vomiting
  • Tenderness: initially localised, later becomes diffused
  • Rebound tenderness (Blumberg sign)
  • Guarding and rigidity, dull flanks on percussion
  • Tachycardia, tachypnoea
  • Tenderness on P/R examination
  • Distension with silent abdomen
  • Eventually leading to Hippocrates facies, septicaemic shock, and loss of consciousness
  • Bowel sounds absent due to paralytic ileus
  • Fever may be absent in severe peritonitis due to loss of pyrogenic reaction
  • Total count may be very low in severe peritonitis

INVESTIGATIONS

Chest X-ray (Standing/Erect)

  • Shows ground glass appearance with gas under diaphragm - suggesting hollow viscous perforation (most common cause of peritonitis)
  • Left lateral decubitus X-ray - for very critical patients who cannot stand in erect posture
  • Must be differentiated from rare Chilaiditi syndrome (bowel interposition in front of/above liver, looks like gas under diaphragm radiologically)

Other Investigations

  • WBC/Total count: increased
  • MRI: reliable for identifying intra-abdominal abscess
  • Blood urea and serum creatinine
  • Serum amylase (4x normal = significant); LFT, platelet count, bleeding time, clotting time, prothrombin time assessed in severe peritonitis
  • Four-quadrant abdominal tap (paracentesis): reveals pus or infected fluid; should be analysed for amylase (will be high in pancreatitis), US-guided aspiration is better and more accurate; fluid sent for culture
  • Diagnostic peritoneal lavage (DPL): useful; DPL with >100 WBC/mL suggests peritonitis; fluid assessed for pH, sugar, protein, LDH, cell count, Gram stain, culture; fluid analysed for amylase or bilirubin or creatinine in suspected cases of pancreatitis or biliary leak/peritonitis or urinary leak; pH <7.0 and glucose <50 mg/dL of aspirated fluid - low in bacterial peritonitis but will show raised protein and LDH (greater than serum LDH); Diagnostic laparoscopy can also be used therapeutically for duodenal ulcer perforation or primary peritonitis to give peritoneal wash
  • US abdomen: shows fluid in abdominal cavity; also identifies haemoperitoneum, pancreatitis
  • CT scan: useful to confirm cause or rule out conditions like pancreatitis; CT scan detects bowel ischaemia, gangrene, perforation, internal hernias, and quantity of fluid in the peritoneal cavity

DIFFERENTIAL DIAGNOSIS

  • Pancreatitis: back pain is common; difficult to differentiate from acute peritonitis; serum amylase increased; CT abdomen may help
  • Intestinal obstruction: distension, vomiting, colicky pain; CT scan confirms intestinal obstruction and cause
  • Ruptured ectopic pregnancy: urine pregnancy test positive; history of amenorrhoea; palor, tachycardia, lower abdominal pain, distension are common presentations; US abdomen and pelvis confirms diagnosis
  • Acute pyelonephritis: guarding, tenderness, rigidity, tachypnoea may be present; urinary symptoms; tender renal angle; urine microscopy revealing pus cells; US abdomen may confirm
  • Acute mesenteric ischaemia: bloody diarrhoea, colicky pain, tender abdomen - features of mesenteric ischaemia; CT abdomen and angiogram useful
  • Diabetic acute abdomen: patient with diabetes mellitus; free fluid in flank may not be present; patient may be ketotic
  • Acute myocardial infarction and other cardiac diseases: ECG and echocardiography to be done in doubtful cases

TREATMENT

Acute Critical Care - Primary Assessment and Resuscitation (ABCDE):

  • Airway, Breathing, Circulation, Disability, Drugs
  • Secondary assessment: Fever, Fluid, Foley's, Gastric tube/other tubes, History and Head to toe examination, Investigations, Judgement

Sepsis 'SIX' Protocol/Bundle in First Hour (Box)

  • Three therapeutic (Give 3): IV Fluids, Antibiotics, High oxygen
  • Three diagnostic (Take 3): Blood culture, Serum lactate, Hourly urine output monitoring

Principles of Therapy in Peritonitis (Box)

  • To control source of infection - perforation
  • To eliminate bacteria and sepsis
  • To maintain vital organ function - cardiac, pulmonary, renal
  • Nutrition and metabolic support

Modalities of Therapy (Box)

  • Systemic antibiotic therapy: 3rd-generation cephalosporins or quinolones or piperacillin and tazobactam or meropenem, imipenem; single or combination therapy
  • Resuscitation with haemodynamic, pulmonary, renal supports with ICU care
  • Fluid therapy, parenteral or enteral nutrition if needed; blood or blood products transfusions
  • Electrolyte management: nasogastric tube aspiration, urinary catheter placement
  • Surgical drainage: main essential modality of treatment; laparotomy, laparoscopy (controversial); closure of perforation; resection of gangrene area; diversions like ileostomy or colostomy; peritoneal lavage (warm normal saline)
  • Percutaneous US/CT-guided drainage by placing pigtail/Foley/V-abdominal drainage tube catheters in selected patients who are unstable, severely ill, or subacute/localised sepsis

Mode of Infection

  • Perforation of GIT: duodenal/gastric/enteric/colonic ulcers; Meckel's diverticulitis perforation
  • Penetrating or blunt trauma
  • Surgery; drains; dialysis
  • Foreign body
  • Appendicitis, cholecystitis, diverticulitis
  • Intestinal obstruction with strangulation
  • Via Fallopian tubes
  • Through blood spread (septicaemia)
  • Transmural spread
  • Following uterine perforation/injury during abortion or termination of pregnancy

Scoring Systems Used in Peritonitis

  • APACHE II (Acute Physiology and Chronic Health Evaluation - 12 physiological variables)
  • Mannheim Peritonitis Index (8 parameters)
  • Both used to assess severity and predict outcome in peritonitis

Create a study guide PDF comparing primary vs secondary vs tertiary peritonitis

Reading File
Running Command

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

Running Command

mkdir -p /tmp/workspace/peritonitis-guide && python3 << 'PYEOF' from reportlab.lib.pagesizes import A4 from reportlab.lib import colors from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle from reportlab.lib.units import cm, mm from reportlab.platypus import (SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, HRFlowable, KeepTogether, PageBreak) from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY from reportlab.platypus import flowables OUTPUT = "/tmp/workspace/peritonitis-guide/Peritonitis_Study_Guide.pdf" doc = SimpleDocTemplate( OUTPUT, pagesize=A4, leftMargin=1.8*cm, rightMargin=1.8*cm, topMargin=2*cm, bottomMargin=2*cm, title="Peritonitis Study Guide", author="SRB's Manual of Surgery - Ch. 32", ) W, H = A4 # ── Colour palette ────────────────────────────────────────────────────────── C_PRIMARY = colors.HexColor("#1A5276") # deep blue C_SECONDARY = colors.HexColor("#196F3D") # deep green C_TERTIARY = colors.HexColor("#7B241C") # deep red C_ACCENT = colors.HexColor("#2E4057") # dark slate C_LIGHT_BLUE = colors.HexColor("#D6EAF8") C_LIGHT_GRN = colors.HexColor("#D5F5E3") C_LIGHT_RED = colors.HexColor("#FADBD8") C_YELLOW = colors.HexColor("#FEF9E7") C_GREY_BG = colors.HexColor("#F2F3F4") C_HEADER_BG = colors.HexColor("#1A1A2E") C_WHITE = colors.white C_BLACK = colors.HexColor("#1C1C1C") C_MID_GREY = colors.HexColor("#707B7C") # ── Styles ─────────────────────────────────────────────────────────────────── ss = getSampleStyleSheet() def style(name, parent="Normal", **kw): s = ParagraphStyle(name, parent=ss[parent], **kw) return s S_TITLE = style("Title2", fontSize=24, leading=28, textColor=C_WHITE, alignment=TA_CENTER, fontName="Helvetica-Bold", spaceAfter=4) S_SUBTITLE = style("Subtitle2", fontSize=12, leading=16, textColor=colors.HexColor("#AED6F1"), alignment=TA_CENTER, fontName="Helvetica", spaceAfter=6) S_SOURCE = style("Source", fontSize=9, leading=12, textColor=colors.HexColor("#85C1E9"), alignment=TA_CENTER, fontName="Helvetica-Oblique") S_SECTION = style("Section", fontSize=14, leading=18, textColor=C_WHITE, fontName="Helvetica-Bold", alignment=TA_CENTER, spaceAfter=2) S_H2 = style("H2", fontSize=11, leading=14, textColor=C_ACCENT, fontName="Helvetica-Bold", spaceBefore=6, spaceAfter=3) S_BODY = style("Body2", fontSize=9, leading=13, textColor=C_BLACK, fontName="Helvetica", spaceAfter=2) S_BODY_J = style("BodyJ", fontSize=9, leading=13, textColor=C_BLACK, fontName="Helvetica", spaceAfter=2, alignment=TA_JUSTIFY) S_BULLET = style("Bullet2", fontSize=9, leading=13, textColor=C_BLACK, fontName="Helvetica", leftIndent=12, bulletIndent=0, spaceAfter=1) S_TABLE_HDR = style("TblHdr", fontSize=9, leading=11, textColor=C_WHITE, fontName="Helvetica-Bold", alignment=TA_CENTER) S_TABLE_CELL = style("TblCell", fontSize=8.5, leading=12, textColor=C_BLACK, fontName="Helvetica", alignment=TA_LEFT) S_TABLE_CELL_C = style("TblCellC", fontSize=8.5, leading=12, textColor=C_BLACK, fontName="Helvetica", alignment=TA_CENTER) S_LABEL_P = style("LabelP", fontSize=9, leading=12, textColor=C_PRIMARY, fontName="Helvetica-Bold") S_LABEL_S = style("LabelS", fontSize=9, leading=12, textColor=C_SECONDARY, fontName="Helvetica-Bold") S_LABEL_T = style("LabelT", fontSize=9, leading=12, textColor=C_TERTIARY, fontName="Helvetica-Bold") S_CAPTION = style("Caption", fontSize=8, leading=10, textColor=C_MID_GREY, fontName="Helvetica-Oblique", alignment=TA_CENTER) S_BOX_TITLE = style("BoxTitle", fontSize=10, leading=13, textColor=C_ACCENT, fontName="Helvetica-Bold", spaceBefore=2, spaceAfter=2) S_BOX_BODY = style("BoxBody", fontSize=8.5, leading=12, textColor=C_BLACK, fontName="Helvetica", spaceAfter=1) S_MNEMO = style("Mnemo", fontSize=10, leading=14, textColor=C_ACCENT, fontName="Helvetica-Bold", alignment=TA_CENTER) story = [] # ═══════════════════════════════════════════════════════════════════ # COVER / HEADER BANNER (rendered as a 1-cell table acting as banner) # ═══════════════════════════════════════════════════════════════════ banner_data = [[ Paragraph("PERITONITIS", S_TITLE), Paragraph("Primary · Secondary · Tertiary", S_SUBTITLE), Paragraph("Study Guide | Based on SRB's Manual of Surgery, Chapter 32 – Peritoneum", S_SOURCE), ]] banner_tbl = Table([[ [ Paragraph("PERITONITIS", S_TITLE), Spacer(1, 4), Paragraph("Primary &nbsp;·&nbsp; Secondary &nbsp;·&nbsp; Tertiary", S_SUBTITLE), Spacer(1, 4), Paragraph("Study Guide &nbsp;|&nbsp; SRB's Manual of Surgery, Chapter 32 – Peritoneum", S_SOURCE), ] ]], colWidths=[doc.width]) banner_tbl.setStyle(TableStyle([ ("BACKGROUND", (0,0), (-1,-1), C_HEADER_BG), ("ALIGN", (0,0), (-1,-1), "CENTER"), ("VALIGN", (0,0), (-1,-1), "MIDDLE"), ("TOPPADDING", (0,0), (-1,-1), 18), ("BOTTOMPADDING", (0,0), (-1,-1), 18), ("LEFTPADDING", (0,0), (-1,-1), 10), ("RIGHTPADDING", (0,0), (-1,-1), 10), ("ROUNDEDCORNERS", [6, 6, 6, 6]), ])) story.append(banner_tbl) story.append(Spacer(1, 10)) # ═══════════════════════════════════════════════════════════════════ # QUICK-REFERENCE CARDS (3 columns: Primary | Secondary | Tertiary) # ═══════════════════════════════════════════════════════════════════ def card_header(text, bg): t = Table([[Paragraph(text, S_SECTION)]], colWidths=[(doc.width - 8)/3]) t.setStyle(TableStyle([ ("BACKGROUND", (0,0), (-1,-1), bg), ("ALIGN", (0,0), (-1,-1), "CENTER"), ("TOPPADDING", (0,0), (-1,-1), 6), ("BOTTOMPADDING", (0,0), (-1,-1), 6), ])) return t def bullet_block(items, color_bg): rows = [[Paragraph("• " + i, S_BULLET)] for i in items] t = Table(rows, colWidths=[(doc.width - 8)/3]) t.setStyle(TableStyle([ ("BACKGROUND", (0,0), (-1,-1), color_bg), ("LEFTPADDING", (0,0), (-1,-1), 8), ("RIGHTPADDING", (0,0), (-1,-1), 6), ("TOPPADDING", (0,0), (-1,-1), 3), ("BOTTOMPADDING",(0,0), (-1,-1), 3), ])) return t # ── Section header helper ───────────────────────────────────────── def section_banner(text, bg=C_ACCENT): t = Table([[Paragraph(text, S_SECTION)]], colWidths=[doc.width]) t.setStyle(TableStyle([ ("BACKGROUND", (0,0), (-1,-1), bg), ("ALIGN", (0,0), (-1,-1), "CENTER"), ("TOPPADDING", (0,0), (-1,-1), 5), ("BOTTOMPADDING", (0,0), (-1,-1), 5), ("LEFTPADDING", (0,0), (-1,-1), 8), ])) return t # ── 1. OVERVIEW ────────────────────────────────────────────────── story.append(section_banner("1. OVERVIEW — WHAT IS PERITONITIS?")) story.append(Spacer(1, 6)) overview_text = ( "Peritonitis is defined as <b>inflammation of the parietal and serosal layer of the peritoneum</b> " "due to chemicals (gastric acid, bile) or bacterial infection. The peritoneal cavity is " "normally sterile. There are three distinct types based on source, microbiology, and clinical context." ) story.append(Paragraph(overview_text, S_BODY_J)) story.append(Spacer(1, 8)) # ── 2. SIDE-BY-SIDE COMPARISON TABLE ──────────────────────────── story.append(section_banner("2. AT-A-GLANCE COMPARISON")) story.append(Spacer(1, 6)) col_w = [3.8*cm, 5.0*cm, 5.0*cm, 5.0*cm] comp_headers = [ Paragraph("FEATURE", S_TABLE_HDR), Paragraph("PRIMARY", S_TABLE_HDR), Paragraph("SECONDARY", S_TABLE_HDR), Paragraph("TERTIARY", S_TABLE_HDR), ] def R(feature, primary, secondary, tertiary): return [ Paragraph(feature, S_TABLE_CELL), Paragraph(primary, S_TABLE_CELL), Paragraph(secondary, S_TABLE_CELL), Paragraph(tertiary, S_TABLE_CELL), ] comp_rows = [ comp_headers, R("Frequency", "Rare (1% of all peritonitis)", "Most common type", "Uncommon; post-surgical"), R("Source", "No identifiable source (spontaneous)", "Bowel/visceral perforation or pathology", "Failed treatment of 1° or 2°"), R("Timing", "Spontaneous onset", "Acute; follows a precipitating event", "After ≥48 h of adequate treatment"), R("Microbiology", "Monomicrobial; extra-peritoneal source (blood spread)", "Polymicrobial; intra-peritoneal source", "MDR organisms; superadded infection"), R("Common organisms", "Pneumococci, Streptococci, E. coli; SBP = E. coli (40%), Klebsiella, Pseudomonas", "E. coli (70%), Clostridium Welchii, Bacteroides, Klebsiella, Salmonella typhi", "E. faecalis/faecium, S. epidermidis, P. aeruginosa, Candida albicans"), R("At-risk population", "Young girls (3–9 yrs), cirrhotic patients (SBP), nephrotic syndrome, SLE", "All ages; following hollow viscus perforation, appendicitis, trauma", "Immunosuppressed, post-laparotomy patients; SIRS/MODS"), R("Pathophysiology", "Haematogenous/lymphatic spread; gut translocation (SBP)", "Direct contamination from ruptured hollow viscus", "Persistent infection despite surgery; host defence failure"), R("Diagnosis", "SBP: ascitic WBC >250 cells/mm² with >50% PMN; TC >30,000/mm³", "Clinical + imaging; X-ray shows gas under diaphragm", "Difficult; CT abdomen, LFT, platelet count, urine output monitoring"), R("Treatment", "Tapping + peritoneal drainage; broad-spectrum antibiotics (aminoglycosides + cephalosporins + metronidazole)", "Surgical drainage (main); laparotomy/laparoscopy; closure of perforation; peritoneal lavage", "Aggressive antibiotics + antifungals; TPN; re-exploration; FFP/platelets; Ventilator/ICU"), R("Mortality", "High (SBP mortality significant)", "10% (diffuse peritonitis)", ">50%; complicated by DIC, ARDS, haemorrhage"), ] comp_table = Table(comp_rows, colWidths=col_w, repeatRows=1) comp_table.setStyle(TableStyle([ # Header row ("BACKGROUND", (0,0), (0,-1), C_GREY_BG), ("BACKGROUND", (1,0), (1,0), C_PRIMARY), ("BACKGROUND", (2,0), (2,0), C_SECONDARY), ("BACKGROUND", (3,0), (3,0), C_TERTIARY), # Column header (feature col) ("BACKGROUND", (0,0), (0,0), C_ACCENT), # Alternating row shading *[("BACKGROUND", (1,r), (1,r), C_LIGHT_BLUE) for r in range(1, len(comp_rows), 2)], *[("BACKGROUND", (2,r), (2,r), C_LIGHT_GRN) for r in range(1, len(comp_rows), 2)], *[("BACKGROUND", (3,r), (3,r), C_LIGHT_RED) for r in range(1, len(comp_rows), 2)], # Grid ("GRID", (0,0), (-1,-1), 0.5, colors.HexColor("#BFC9CA")), ("VALIGN", (0,0), (-1,-1), "TOP"), ("TOPPADDING", (0,0), (-1,-1), 4), ("BOTTOMPADDING", (0,0), (-1,-1), 4), ("LEFTPADDING", (0,0), (-1,-1), 5), ("RIGHTPADDING", (0,0), (-1,-1), 5), ("FONTNAME", (0,1), (0,-1), "Helvetica-Bold"), ("FONTSIZE", (0,1), (0,-1), 8.5), ])) story.append(comp_table) story.append(Spacer(1, 10)) # ── 3. DEEP-DIVE CARDS ────────────────────────────────────────── story.append(section_banner("3. DETAILED BREAKDOWN")) story.append(Spacer(1, 6)) # ---- helpers ---- def detail_card(title_text, bg_color, light_bg, sub_sections): """sub_sections: list of (heading, list_of_strings)""" elements = [] # Title bar hdr = Table([[Paragraph(title_text, S_SECTION)]], colWidths=[doc.width]) hdr.setStyle(TableStyle([ ("BACKGROUND", (0,0),(-1,-1), bg_color), ("TOPPADDING", (0,0),(-1,-1), 6), ("BOTTOMPADDING",(0,0),(-1,-1), 6), ])) elements.append(hdr) # Content for heading, bullets in sub_sections: elements.append(Spacer(1, 4)) elements.append(Paragraph(heading, S_H2)) for b in bullets: elements.append(Paragraph("• &nbsp;" + b, S_BULLET)) return KeepTogether(elements) story.append(detail_card( "PRIMARY PERITONITIS", C_PRIMARY, C_LIGHT_BLUE, [ ("Definition & Epidemiology", [ "Peritonitis with <b>no documented intra-abdominal source</b> of infection", "Represents <b>~1% of all peritonitis</b> cases", "Two main contexts: (a) <b>children 3–9 years</b>, especially girls; (b) <b>cirrhotic adults</b> with ascites (SBP)", ]), ("Pathogenesis — How does infection reach the peritoneum?", [ "<b>Haematogenous spread</b>: from blood (e.g., pneumococcal bacteraemia)", "<b>Lymphatic spread</b>: from genitals via Fallopian tubes", "<b>Upper respiratory tract / middle ear</b>: in males", "<b>Gut translocation</b> in cirrhosis: bacteria cross gut wall → mesenteric lymphatics → peritoneum", "SBP ascitic fluid protein &lt;1 g/dL ↑ risk", ]), ("Spontaneous Bacterial Peritonitis (SBP) — Specific", [ "30% of cirrhotic patients with ascites develop SBP", "90% are monomicrobial: <b>E. coli (40%)</b>, Klebsiella, Pseudomonas, Proteus, S. pneumoniae (15%), Staphylococcus, anaerobes (5%)", "Also occurs with: nephrotic syndrome, SLE, peritoneovenous shunts, peritoneal dialysis catheters, Chlamydial/fungal/mycobacterial infection", ]), ("Primary Streptococcal Peritonitis (Children)", [ "Infants and children &lt;4 years", "Cloudy fibrin flakes in peritoneal cavity", "Features of tonsillitis/pharyngitis + gastroenteritis", "Often greenish watery stool", "No documented source of infection", ]), ("Diagnosis", [ "Ascitic fluid WBC <b>&gt;250 cells/mm²</b> with <b>&gt;50% PMN</b> → diagnostic of SBP", "Total count (TC) very high: <b>&gt;30,000/mm³</b>", "Culture: usually monomicrobial", "Patient: toxic, severely ill, develops septicaemia early", "Uncommon after 10 years of age", ]), ("Treatment", [ "Diagnostic tapping + tube peritoneal drainage", "Laparoscopic drainage and wash (useful)", "Broad-spectrum antibiotics: <b>aminoglycosides + cephalosporins + metronidazole</b>", "Local instillation of antibiotics into peritoneal cavity", "<b>Note: Mortality is HIGH</b>", ]), ] )) story.append(Spacer(1, 10)) story.append(detail_card( "SECONDARY PERITONITIS", C_SECONDARY, C_LIGHT_GRN, [ ("Definition & Epidemiology", [ "<b>Most common type</b> of peritonitis", "Secondary to bowel or other visceral pathology (perforation, obstruction, trauma)", "<b>Duodenal perforation</b> and <b>burst appendicitis</b> are the most common causes", ]), ("Common Causes (Mode of Infection)", [ "Perforation of GIT: duodenal ulcer, gastric ulcer, enteric/colonic ulcers, Meckel's diverticulitis", "Appendicitis, cholecystitis, diverticulitis", "Intestinal obstruction with strangulation", "Penetrating or blunt trauma", "Surgery; drains; dialysis; foreign body", "Via Fallopian tubes; blood spread (septicaemia); transmural spread", "Uterine perforation during abortion or termination of pregnancy", ]), ("Microbiology (Polymicrobial)", [ "<b>From GIT</b>: E. coli (most common, 70%), aerobic streptococci, Streptococcus faecalis, Staphylococcus, anaerobic streptococci, Bacteroides (anaerobes), Klebsiella, Clostridium Welchii", "<b>Not from GIT</b>: Gonococcus, Pneumococcus (from Fallopian tubes, in young females); Chlamydia, beta-haemolytic streptococci, Mycobacterium", "Most common bacterium during peritonitis phase: <b>E. coli</b>", "Most common during abscess formation: <b>Bacteroides fragilis</b>", ]), ("Pathogenesis", [ "Direct contamination from ruptured hollow viscus", "Fibrinogen → Fibrin → attempts to localise infection", "Bowel adheres to itself; thick flakes on bowel surface", "Peritoneum: thick, oedematous, velvety, reddish — <b>loses glistening appearance</b>", "Pus collects in subphrenic, paracolic, and pelvic spaces", "Bacterial load (2×10⁸ CFU/mL) overwhelms host defence → multiplication, toxaemia, pus", ]), ("Investigations", [ "<b>Erect CXR</b>: ground glass appearance + gas under diaphragm (hollow viscus perforation)", "<b>Left lateral decubitus X-ray</b>: for critically ill patients who cannot stand", "CT abdomen: detects bowel ischaemia, gangrene, perforation, internal hernias, fluid", "US abdomen: fluid in abdominal cavity; haemoperitoneum, pancreatitis", "Four-quadrant tap / DPL: pus or infected fluid; DPL WBC &gt;100/mL suggests peritonitis", "Serum amylase (4× normal = significant), LFT, platelet count, blood cultures", "Diagnostic laparoscopy: also therapeutic for duodenal ulcer perforation", ]), ("Treatment", [ "Primary assessment: ABCDE (Airway, Breathing, Circulation, Disability, Drugs)", "Secondary: Fever/Fluid/Foley's/Gastric tube/History/Investigations/Judgement", "<b>Sepsis SIX in first hour</b>: IV fluids + Antibiotics + High O₂ (Give 3); Blood culture + Serum lactate + Hourly urine output (Take 3)", "Antibiotics: 3rd-gen cephalosporins or quinolones or piperacillin-tazobactam or meropenem/imipenem", "<b>Surgical drainage (MAIN modality)</b>: laparotomy; closure of perforation; resection of gangrene; diversion (ileostomy/colostomy); peritoneal lavage with warm normal saline", "Laparoscopy: controversial but increasingly used", "Percutaneous US/CT-guided drainage: for unstable or subacute/localised sepsis", "Mortality for diffuse peritonitis: <b>10%</b>", ]), ] )) story.append(Spacer(1, 10)) story.append(detail_card( "TERTIARY PERITONITIS", C_TERTIARY, C_LIGHT_RED, [ ("Definition", [ "Persistent or recurrent intra-abdominal infection after <b>adequate treatment</b> for primary or secondary peritonitis — usually occurring <b>after 48 hours</b>", "Occurs after any abdominal surgery; usually severe", "Patient often progresses to <b>SIRS</b> or <b>MODS</b> early", ]), ("Why does it happen?", [ "Common in <b>immunosuppressed</b> individuals with ineffective peritoneal host defences", "Virulence and drug resistance of organisms are key factors", "Difficult to diagnose clinically — causes delay in therapy", ]), ("Causative Organisms (MDR)", [ "Enterococcus faecalis / faecium", "Staphylococcus epidermidis", "Pseudomonas aeruginosa", "Candida albicans", "Enterobacter, Pseudomonas — multidrug resistant", "Note: enterococci, Candida, S. epidermidis, Enterobacter, Pseudomonas all show MDR", ]), ("Clinical Features & Investigations", [ "Clinically difficult to diagnose; often presents as persistent SIRS/MODS", "CT abdomen", "Total and platelet count; LFT", "Monitoring renal functions (hourly urine output)", "Chest X-ray", ]), ("Treatment (Aggressive & Multi-modal)", [ "Aggressive <b>antibiotic therapy</b>", "<b>Antifungal therapy</b> (Candida coverage)", "<b>TPN</b> (Total Parenteral Nutrition)", "Maintaining haemodynamic stability", "Re-exploration of abdomen; thorough wash", "Colostomy / ileostomy or exteriorisation of bowel segment", "FFP, packed cells, platelet transfusions as needed", "<b>Ventilator / ICU care</b> often required", ]), ("Prognosis", [ "<b>Mortality &gt;50%</b>", "Complications: DIC, septicaemia, haemorrhage, pneumonia, <b>ARDS</b>", ]), ] )) story.append(Spacer(1, 10)) # ── 4. BACTERIA TABLE ──────────────────────────────────────────── story.append(section_banner("4. BACTERIOLOGY SUMMARY")) story.append(Spacer(1, 6)) bact_data = [ [Paragraph("TYPE", S_TABLE_HDR), Paragraph("MICROBIOLOGY", S_TABLE_HDR), Paragraph("SOURCE", S_TABLE_HDR), Paragraph("KEY POINT", S_TABLE_HDR)], [Paragraph("Primary", S_TABLE_CELL_C), Paragraph("Monomicrobial\nE. coli (40%), Klebsiella, Pseudomonas, Proteus, S. pneumoniae (15%), Staphylococcus, anaerobes (5%)", S_TABLE_CELL), Paragraph("Extraperitoneal\n(blood/lymphatic spread)", S_TABLE_CELL_C), Paragraph("SBP: 90% monomicrobial; cirrhosis + ascites + protein &lt;1 g/dL = high risk", S_TABLE_CELL)], [Paragraph("Secondary", S_TABLE_CELL_C), Paragraph("Polymicrobial\nE. coli (70% — most common), Clostridium Welchii, Bacteroides, Streptococcus faecalis, Klebsiella, Staphylococcus, Salmonella typhi", S_TABLE_CELL), Paragraph("Intraperitoneal\n(perforation/visceral pathology)", S_TABLE_CELL_C), Paragraph("During peritonitis: E. coli\nDuring abscess formation: B. fragilis", S_TABLE_CELL)], [Paragraph("Tertiary", S_TABLE_CELL_C), Paragraph("MDR organisms\nE. faecalis, E. faecium, S. epidermidis, P. aeruginosa, Candida albicans, Enterobacter", S_TABLE_CELL), Paragraph("Superadded infection\n(nosocomial/post-surgical)", S_TABLE_CELL_C), Paragraph("Multidrug resistance is hallmark; Candida coverage essential; mortality &gt;50%", S_TABLE_CELL)], ] bact_table = Table(bact_data, colWidths=[2.5*cm, 6.5*cm, 4.0*cm, 5.8*cm], repeatRows=1) bact_table.setStyle(TableStyle([ ("BACKGROUND", (0,0),(-1,0), C_ACCENT), ("BACKGROUND", (0,1),(-1,1), C_LIGHT_BLUE), ("BACKGROUND", (0,2),(-1,2), C_LIGHT_GRN), ("BACKGROUND", (0,3),(-1,3), C_LIGHT_RED), ("BACKGROUND", (0,1),(0,1), colors.HexColor("#AED6F1")), ("BACKGROUND", (0,2),(0,2), colors.HexColor("#A9DFBF")), ("BACKGROUND", (0,3),(0,3), colors.HexColor("#F1948A")), ("FONTNAME", (0,1),(0,-1), "Helvetica-Bold"), ("GRID", (0,0),(-1,-1), 0.5, colors.HexColor("#BFC9CA")), ("VALIGN", (0,0),(-1,-1), "TOP"), ("TOPPADDING", (0,0),(-1,-1), 5), ("BOTTOMPADDING",(0,0),(-1,-1), 5), ("LEFTPADDING",(0,0),(-1,-1), 5), ("RIGHTPADDING",(0,0),(-1,-1), 5), ])) story.append(bact_table) story.append(Spacer(1, 10)) # ── 5. TREATMENT PRINCIPLES ────────────────────────────────────── story.append(section_banner("5. TREATMENT PRINCIPLES (COMMON TO ALL)")) story.append(Spacer(1, 6)) treat_data = [ [Paragraph("PRINCIPLE", S_TABLE_HDR), Paragraph("DETAILS", S_TABLE_HDR)], [Paragraph("1. Control source of infection", S_TABLE_CELL), Paragraph("Identify and close/repair the perforation; drain abscess; remove infected focus", S_TABLE_CELL)], [Paragraph("2. Eliminate bacteria and sepsis", S_TABLE_CELL), Paragraph("Broad-spectrum IV antibiotics ± antifungals; peritoneal lavage with warm normal saline", S_TABLE_CELL)], [Paragraph("3. Resuscitation (ABCDE)", S_TABLE_CELL), Paragraph("IV fluids, airway management, vasopressors if needed; Foley catheter + nasogastric tube; FFP/blood products", S_TABLE_CELL)], [Paragraph("4. Vital organ support", S_TABLE_CELL), Paragraph("Cardiac, pulmonary, renal support; ICU care; ventilator if needed", S_TABLE_CELL)], [Paragraph("5. Nutrition & metabolic support", S_TABLE_CELL), Paragraph("Enteral nutrition preferred; TPN if gut not usable; electrolyte correction", S_TABLE_CELL)], [Paragraph("6. Sepsis SIX Bundle", S_TABLE_CELL), Paragraph("Give 3: IV Fluids + Antibiotics + High O₂ — Take 3: Blood cultures + Serum lactate + Hourly urine output", S_TABLE_CELL)], [Paragraph("7. Scoring systems", S_TABLE_CELL), Paragraph("APACHE II (12 physiological variables) and Mannheim Peritonitis Index (8 parameters) to assess severity and predict outcome", S_TABLE_CELL)], ] treat_table = Table(treat_data, colWidths=[5.5*cm, 13.3*cm], repeatRows=1) treat_table.setStyle(TableStyle([ ("BACKGROUND", (0,0),(-1,0), C_ACCENT), *[("BACKGROUND", (0,r),(-1,r), C_GREY_BG) for r in range(1, len(treat_data), 2)], ("FONTNAME", (0,1),(0,-1), "Helvetica-Bold"), ("FONTSIZE", (0,1),(0,-1), 8.5), ("GRID", (0,0),(-1,-1), 0.5, colors.HexColor("#BFC9CA")), ("VALIGN", (0,0),(-1,-1), "TOP"), ("TOPPADDING", (0,0),(-1,-1), 5), ("BOTTOMPADDING",(0,0),(-1,-1), 5), ("LEFTPADDING",(0,0),(-1,-1), 6), ("RIGHTPADDING",(0,0),(-1,-1), 6), ])) story.append(treat_table) story.append(Spacer(1, 10)) # ── 6. MNEMONICS & HIGH-YIELD BOX ─────────────────────────────── story.append(section_banner("6. MNEMONICS & HIGH-YIELD FACTS")) story.append(Spacer(1, 6)) mnem_data = [ [ # Mnemonic 1 [ Paragraph("Sepsis SIX Bundle", S_BOX_TITLE), Paragraph("<b>GIVE 3 (therapeutic):</b>", S_BOX_BODY), Paragraph("• IV Fluids", S_BOX_BODY), Paragraph("• Antibiotics", S_BOX_BODY), Paragraph("• High O₂", S_BOX_BODY), Spacer(1,3), Paragraph("<b>TAKE 3 (diagnostic):</b>", S_BOX_BODY), Paragraph("• Blood culture", S_BOX_BODY), Paragraph("• Serum lactate", S_BOX_BODY), Paragraph("• Hourly urine output", S_BOX_BODY), ], # Mnemonic 2 [ Paragraph("Secondary Assessment — FFGHIJ", S_BOX_TITLE), Paragraph("• <b>F</b>ever", S_BOX_BODY), Paragraph("• <b>F</b>luid", S_BOX_BODY), Paragraph("• <b>F</b>oley's catheter", S_BOX_BODY), Paragraph("• <b>G</b>astric tube/other tubes", S_BOX_BODY), Paragraph("• <b>H</b>istory and Head-to-toe", S_BOX_BODY), Paragraph("• <b>I</b>nvestigations", S_BOX_BODY), Paragraph("• <b>J</b>udgement", S_BOX_BODY), ], # High-yield facts [ Paragraph("High-Yield Numbers", S_BOX_TITLE), Paragraph("• Most common cause 2° peritonitis: <b>duodenal perforation + appendicitis</b>", S_BOX_BODY), Paragraph("• Most common organism: <b>E. coli</b>", S_BOX_BODY), Paragraph("• Abscess formation: <b>B. fragilis</b>", S_BOX_BODY), Paragraph("• Peritoneal fluid (normal): <b>100 mL</b>", S_BOX_BODY), Paragraph("• SBP diagnostic: ascitic WBC <b>&gt;250/mm²</b> + &gt;50% PMN", S_BOX_BODY), Paragraph("• Bacterial load to overwhelm: <b>2×10⁸ CFU/mL</b>", S_BOX_BODY), Paragraph("• Mortality — 2°: <b>10%</b> | 3°: <b>&gt;50%</b>", S_BOX_BODY), Paragraph("• Tertiary defined: persists after <b>&gt;48 h</b> adequate treatment", S_BOX_BODY), ], ] ] mnem_table = Table(mnem_data, colWidths=[(doc.width - 8)/3]*3) mnem_table.setStyle(TableStyle([ ("BACKGROUND", (0,0),(0,0), C_LIGHT_BLUE), ("BACKGROUND", (1,0),(1,0), C_LIGHT_GRN), ("BACKGROUND", (2,0),(2,0), C_YELLOW), ("VALIGN", (0,0),(-1,-1), "TOP"), ("GRID", (0,0),(-1,-1), 0.5, colors.HexColor("#BFC9CA")), ("TOPPADDING", (0,0),(-1,-1), 8), ("BOTTOMPADDING",(0,0),(-1,-1), 8), ("LEFTPADDING",(0,0),(-1,-1), 8), ("RIGHTPADDING",(0,0),(-1,-1), 8), ])) story.append(mnem_table) story.append(Spacer(1, 10)) # ── 7. FACTORS AFFECTING SPREAD ────────────────────────────────── story.append(section_banner("7. FACTORS AFFECTING SPREAD OF INFECTION")) story.append(Spacer(1, 6)) spread_items = [ "Rapidity by which pus is gushed into the peritoneal cavity (e.g., burst appendix, perforations)", "Amount of peristalsis — more peristalsis = more spread", "Virulence of the organism, bacterial load and nature", "Localising action of the omentum (in children: poor localisation because omentum is small)", "Immunosuppression (HIV, steroids)", "Anatomical nature of the peritoneal cavity", "Age, associated diseases (malignancy, malnutrition, anaemia)", ] for item in spread_items: story.append(Paragraph("• &nbsp;" + item, S_BULLET)) story.append(Spacer(1, 10)) # ── 8. DIFFERENTIAL DIAGNOSIS ──────────────────────────────────── story.append(section_banner("8. DIFFERENTIAL DIAGNOSIS OF ACUTE PERITONITIS")) story.append(Spacer(1, 6)) dd_data = [ [Paragraph("CONDITION", S_TABLE_HDR), Paragraph("KEY DIFFERENTIATING FEATURE", S_TABLE_HDR), Paragraph("INVESTIGATION", S_TABLE_HDR)], [Paragraph("Pancreatitis", S_TABLE_CELL), Paragraph("Back pain is common; difficult to differentiate clinically", S_TABLE_CELL), Paragraph("Serum amylase ↑; CT abdomen", S_TABLE_CELL)], [Paragraph("Intestinal obstruction", S_TABLE_CELL), Paragraph("Distension, vomiting, colicky pain; dilated bowel loops on X-ray", S_TABLE_CELL), Paragraph("Plain X-ray (multiple air-fluid levels); CT abdomen", S_TABLE_CELL)], [Paragraph("Ruptured ectopic pregnancy", S_TABLE_CELL), Paragraph("Urine pregnancy test +ve; amenorrhoea; lower abdominal pain", S_TABLE_CELL), Paragraph("Urine β-hCG; US abdomen + pelvis", S_TABLE_CELL)], [Paragraph("Acute pyelonephritis", S_TABLE_CELL), Paragraph("Urinary symptoms; tender renal angle; may mimic peritonitis", S_TABLE_CELL), Paragraph("Urine microscopy (pus cells); US abdomen", S_TABLE_CELL)], [Paragraph("Acute mesenteric ischaemia", S_TABLE_CELL), Paragraph("Bloody diarrhoea, colicky pain, tender abdomen", S_TABLE_CELL), Paragraph("CT abdomen + angiogram", S_TABLE_CELL)], [Paragraph("Diabetic acute abdomen", S_TABLE_CELL), Paragraph("Diabetes mellitus patient; free fluid in flank may be absent; ketoacidosis", S_TABLE_CELL), Paragraph("Blood glucose; urinalysis for ketones; free fluid assessment", S_TABLE_CELL)], [Paragraph("Acute MI / Cardiac", S_TABLE_CELL), Paragraph("Cardiac history; epigastric pain can mimic peritonitis", S_TABLE_CELL), Paragraph("ECG; echocardiography; troponin", S_TABLE_CELL)], ] dd_table = Table(dd_data, colWidths=[4.5*cm, 7.5*cm, 6.8*cm], repeatRows=1) dd_table.setStyle(TableStyle([ ("BACKGROUND", (0,0),(-1,0), C_ACCENT), *[("BACKGROUND", (0,r),(-1,r), C_GREY_BG) for r in range(1, len(dd_data), 2)], ("GRID", (0,0),(-1,-1), 0.5, colors.HexColor("#BFC9CA")), ("VALIGN", (0,0),(-1,-1), "TOP"), ("TOPPADDING", (0,0),(-1,-1), 4), ("BOTTOMPADDING",(0,0),(-1,-1), 4), ("LEFTPADDING",(0,0),(-1,-1), 5), ("RIGHTPADDING",(0,0),(-1,-1), 5), ])) story.append(dd_table) story.append(Spacer(1, 10)) # ── Footer note ────────────────────────────────────────────────── story.append(HRFlowable(width="100%", thickness=1, color=C_MID_GREY)) story.append(Spacer(1, 4)) story.append(Paragraph( "Source: SRB's Manual of Surgery — Chapter 32: Peritoneum &nbsp;|&nbsp; Section 2: Gastrointestinal Surgery", S_CAPTION)) story.append(Paragraph( "Study guide created for educational purposes. Always verify clinical decisions with current guidelines.", S_CAPTION)) # ── Build ───────────────────────────────────────────────────────── doc.build(story) print("PDF created:", OUTPUT) PYEOF

Running Command

ls -lh /tmp/workspace/peritonitis-guide/

Your study guide is ready! Download it here:

Peritonitis Study Guide

PDF Document · PDF


Here's what's packed into the PDF (all sourced directly from your SRB's Manual of Surgery, Ch. 32):
8 Sections:
  1. Overview - Definition of peritonitis and the three-type framework
  2. At-a-Glance Comparison Table - Side-by-side across 10 features (frequency, source, timing, microbiology, organisms, population, pathophysiology, diagnosis, treatment, mortality) - colour coded Blue / Green / Red for Primary / Secondary / Tertiary
  3. Detailed Breakdown - Deep-dive cards for each type with sub-sections on definition, pathogenesis, organisms, diagnosis, and treatment
  4. Bacteriology Summary Table - Organism profiles for all three types including the key distinction: E. coli (during peritonitis) vs B. fragilis (during abscess formation)
  5. Treatment Principles - Common to all three types (ABCDE, Sepsis SIX, surgical drainage, nutrition, scoring)
  6. Mnemonics & High-Yield Facts - Sepsis SIX bundle, FFGHIJ secondary assessment, plus key numbers (100 mL normal peritoneal fluid, SBP WBC >250/mm², 2×10⁸ CFU/mL bacterial load, 10% vs >50% mortality)
  7. Factors Affecting Spread - The 7 key factors from the textbook box
  8. Differential Diagnosis - 7 conditions with key differentiating features and investigations
This is a shared conversation. Sign in to Orris to start your own chat.