History taking and examination along with viva question for exploratory laparotomy in surgery viva

Reading File
Finding Sources
Finding Sources
Searching the Web

exploratory laparotomy surgery viva questions history examination MBBS

Finding Sources
Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
I now have comprehensive textbook content. Let me compile the complete, exam-oriented answer.

Exploratory Laparotomy - Surgery Viva Preparation

PART 1: HISTORY TAKING

Chief Complaint

Ask about abdominal pain - the cardinal presenting symptom leading to laparotomy.

History of Present Illness - SOCRATES for Pain

FeatureKey Points to Elicit
SiteWhere did pain start? Has it shifted? (e.g., periumbilical shifting to RIF = appendicitis)
OnsetSudden (perforation, rupture) vs. gradual (inflammation, obstruction)
CharacterColicky (obstruction, ureteric/biliary colic) vs. constant (peritonitis, ischemia)
RadiationShoulder tip (diaphragmatic irritation - free air/blood), loin to groin (ureteric colic)
Associated symptomsNausea, vomiting (early = appendicitis; feculent = obstruction), fever, jaundice, PR bleeding, haematuria
TimingDuration, progression, continuous vs. intermittent
Exacerbating/relievingWorse on movement (peritonitis); better when still
SeverityVAS 1-10

Sequence of Symptoms

  • Murphy's triad for appendicitis: Pain first, then vomiting, then fever
  • Reversed sequence (vomiting before pain) suggests medical causes (gastroenteritis, etc.)

Specific History Questions

For obstruction:
  • When did you last pass flatus/stool?
  • Any vomiting (nature - bilious/feculent)?
  • Distension?
  • Previous surgery/hernias?
For perforation:
  • History of peptic ulcer disease/NSAIDs/steroids?
  • Sudden onset severe pain ("like a knife")?
  • Typhoid fever (typhoid ulcer perforation)?
For bleeding/haemoperitoneum:
  • LMP (women of reproductive age - ectopic pregnancy)
  • History of trauma
  • Known aortic aneurysm
  • Anticoagulant use
For infection/inflammation:
  • Fever, chills, rigors
  • Urinary symptoms (UTI masquerading as acute abdomen)
  • Menstrual history and vaginal discharge (PID, ectopic)

Past History

  • Previous similar episodes
  • Previous abdominal surgeries (adhesions, anastomotic leak)
  • Known malignancy
  • Peptic ulcer disease / IBD / diverticular disease
  • Hernias

Drug History

  • NSAIDs, steroids (perforation risk; may mask signs)
  • Anticoagulants (haemoperitoneum risk)
  • Immunosuppressants (atypical presentations)

Social History

  • Alcohol (pancreatitis, liver disease)
  • Smoking
  • Travel history (amoebiasis, typhoid)

PART 2: EXAMINATION

General Examination

Look for:
  • Pallor (haemorrhage, anaemia)
  • Jaundice (biliary pathology)
  • Dehydration (dry mucous membranes, reduced skin turgor)
  • Fever (temperature chart)
  • Tachycardia / hypotension (shock - haemorrhagic or septic)
  • Tachypnoea (peritonitis causing splinting; respiratory compensation for metabolic acidosis)
  • Patient position: lying still = peritonitis; writhing = colic

Abdominal Examination - 4 Steps

1. Inspection
  • Distension (obstruction, paralytic ileus, free gas)
  • Visible peristalsis (intestinal obstruction)
  • Scars from previous surgery
  • Visible pulsation (AAA)
  • Hernia sites (groin, umbilicus, incisional)
  • Skin - Grey Turner's sign (flank bruising = retroperitoneal haemorrhage/pancreatitis), Cullen's sign (periumbilical bruising)
2. Palpation
  • Start away from site of maximal pain
  • Tenderness and its site
  • Guarding (voluntary vs. involuntary)
  • Rigidity (board-like = generalised peritonitis)
  • Rebound tenderness (Blumberg's sign = peritoneal irritation)
  • Rovsing's sign (RIF pain on palpating LIF = appendicitis)
  • Murphy's sign (arrest of inspiration on palpating RUQ = acute cholecystitis)
  • Masses (tumour, appendix mass, aortic aneurysm)
3. Percussion
  • Loss of liver dullness = pneumoperitoneum (free gas under diaphragm)
  • Shifting dullness (ascites/haemoperitoneum)
  • Resonance over abdomen (distended loops in obstruction)
4. Auscultation
  • Absent bowel sounds = paralytic ileus, generalised peritonitis (late obstruction)
  • High-pitched tinkling sounds = mechanical obstruction
  • Succussion splash (heard >3 h post meal) = gastric outlet obstruction

Special Examinations

  • Digital Rectal Examination: Boggy mass (pelvic abscess), blood (rectal carcinoma, ischaemic bowel), tenderness (pelvic peritonitis), empty rectum (obstruction)
  • Per Vaginum in women: cervical excitation (ectopic, PID), adnexal tenderness/mass
  • Hernial orifices: Always examine for irreducible/strangulated hernia as a cause of obstruction
  • Genitalia in males: Testicular torsion can present with abdominal pain

PART 3: INVESTIGATIONS BEFORE LAPAROTOMY

Bloods

  • CBC: Leucocytosis (infection/inflammation), anaemia (haemorrhage), thrombocytosis (acute phase)
  • LFTs + Amylase: Rule out pancreatitis, hepatobiliary cause
  • RFTs + Electrolytes: Assess renal function, dehydration
  • Serum lactate: Elevated in bowel ischemia, sepsis
  • Coagulation (PT/INR, APTT): Pre-operative
  • Blood group and cross-match
  • ABG: Metabolic acidosis (ischemia, sepsis), respiratory compensation
  • Urine hCG in women (exclude ectopic pregnancy)

Imaging

  • Erect Chest X-ray: Free gas under diaphragm (perforation) - best initial investigation for suspected perforation
  • Supine/erect abdominal X-ray: Dilated loops, fluid levels, step-ladder pattern (obstruction), Rigler's sign
  • Ultrasound abdomen: First-line for hepatobiliary, pelvic, free fluid (FAST in trauma); limited by bowel gas
  • CT abdomen with contrast: Gold standard - identifies cause, site, perforation, obstruction, ischemia, haematoma, aortic pathology
  • eFAST in trauma (haemoperitoneum, pericardial tamponade, haemothorax)

PART 4: INDICATIONS FOR EXPLORATORY LAPAROTOMY

Absolute Indications (Operate Immediately)

  1. Generalised peritonitis - board-like abdomen
  2. Haemodynamic instability with suspected intra-abdominal source (trauma, ruptured AAA, ectopic)
  3. Pneumoperitoneum (free gas on erect CXR)
  4. Evisceration (bowel through abdominal wound)
  5. Strangulated hernia / closed loop obstruction (signs of ischaemia)
  6. Ruptured ectopic pregnancy
  7. Penetrating abdominal trauma with peritonitis or unstable vitals
(Source: Current Surgical Therapy 14e; Sabiston 21e)

Relative / Urgent Indications

  • Failure of conservative management (e.g., appendix mass with deterioration)
  • Suspected bowel ischemia/mesenteric infarction
  • Intestinal obstruction not responding to conservative treatment
  • Intraperitoneal bladder rupture
  • Haemoperitoneum with CT evidence of solid organ injury requiring surgery

Contraindications

  • Haemodynamically stable patient with no peritonism and no clear indication
  • Conditions managed non-operatively (e.g., uncomplicated splenic injury, low-grade liver laceration)
  • Medical causes of acute abdomen (DKA, MI, porphyria, sickle cell crisis - must be excluded before surgery)

PART 5: CAUSES OF ACUTE ABDOMEN (Differential for Viva)

Surgical Causes (S Das - A Manual on Clinical Surgery)

Intra-abdominal - Inflammation: Acute appendicitis, acute cholecystitis, acute pancreatitis, acute diverticulitis, salpingitis, mesenteric lymphadenitis
Perforation: Peptic ulcer, typhoid ulcer, diverticular disease, Crohn's/UC, carcinoma
Obstruction: Adhesional bands, volvulus, intussusception, hernia (incarcerated/strangulated), gallstone ileus, tumour
Haemorrhage: Ruptured ectopic gestation, ruptured splenic/hepatic trauma, ruptured AAA, ruptured lutein cyst
Vascular: Mesenteric artery occlusion (embolus/thrombosis), ischemic colitis
Torsion: Twisted ovarian cyst, testicular torsion
Extra-abdominal - Must Exclude:
  • Thoracic: MI, basal pneumonia, pleurisy, pneumothorax
  • Metabolic: DKA, Addisonian crisis, porphyria, uraemia, sickle cell crisis
  • Neurological: Herpes zoster, Tabes dorsalis (gastric crisis), Pott's disease

PART 6: VIVA QUESTIONS AND ANSWERS

Q1: What is an exploratory laparotomy? A surgical procedure involving opening the abdominal cavity through a midline incision to examine the peritoneal contents, identify pathology, and perform definitive or damage control surgery.
Q2: What is the incision used for exploratory laparotomy? Standard midline (median) laparotomy from xiphisternum to pubic symphysis - provides widest access, can be extended, has good healing, avoids nerve damage. In trauma: right sub-costal (Kocher) for hepatobiliary, Pfannenstiel for pelvic.
Q3: What do you find on erect CXR in a perforation? Free gas (air) under the diaphragm - classically described as a crescent of gas under the right hemidiaphragm. Absent in 20-30% of perforations (get CT if clinical suspicion remains).
Q4: What is Rigidity? Differentiate voluntary vs. involuntary.
  • Voluntary guarding: Voluntary contraction of abdominal muscles due to fear of pain - relaxes on distraction
  • Involuntary rigidity (board-like abdomen): Reflex contraction due to peritoneal irritation - does not relax, indicates peritonitis; indicates urgent surgery
Q5: What is Rebound tenderness (Blumberg's sign)? Pain on sudden release of pressure from the abdomen - indicates parietal peritoneal irritation. Deep palpation compresses the inflamed peritoneum; sudden release causes painful snapping back.
Q6: Enumerate the signs of peritonitis.
  • Tachycardia, fever, hypotension (severe)
  • Board-like rigidity
  • Rebound tenderness
  • Absent bowel sounds
  • Tenderness all over the abdomen
  • Patient lying still (any movement exacerbates pain)
  • Loss of liver dullness if pneumoperitoneum present
Q7: What is Murphy's sign? Arrest of inspiration on palpation of the right hypochondrium - positive in acute cholecystitis. As the patient inhales deeply, the inflamed gallbladder descends and contacts the examiner's hand, causing pain that halts breathing.
Q8: What are the signs of intestinal obstruction?
  • Colicky abdominal pain
  • Vomiting (bilious or feculent)
  • Absolute constipation (no flatus or stool)
  • Abdominal distension
  • High-pitched/tinkling bowel sounds
  • Visible peristalsis
  • X-ray: dilated loops with fluid levels (step-ladder pattern)
Q9: What is damage control laparotomy? An abbreviated surgery used in unstable trauma patients - hemorrhage control and contamination control only, abdominal cavity temporarily closed, definitive repair performed after resuscitation in ICU (2nd-look laparotomy within 24-48 hours).
Q10: What is a "second-look" laparotomy? A planned re-operation 24-48 hours after initial laparotomy to assess bowel viability (after revascularization for mesenteric ischemia or in damage control settings), complete anastomosis, or washout abdomen.
Q11: What are the complications of laparotomy?
  • Early: Haemorrhage, anastomotic leak, bowel injury, infection (wound, intra-abdominal abscess), paralytic ileus
  • Late: Adhesions (future obstruction), incisional hernia, wound dehiscence, enterocutaneous fistula
Q12: What is meant by "medical causes of acute abdomen"? Conditions causing abdominal pain without requiring surgery:
  • DKA (tight girdle pain around abdomen)
  • Acute MI (especially inferior MI - epigastric pain)
  • Basal pneumonia/pleurisy
  • Sickle cell crisis
  • Porphyria
  • Herpes zoster These must be actively excluded before proceeding to laparotomy.
Q13: What is Grey Turner's and Cullen's sign?
  • Grey Turner's sign: Flank/loin bruising due to tracking of retroperitoneal haemorrhage - seen in severe pancreatitis, retroperitoneal bleed
  • Cullen's sign: Periumbilical bruising - same causes; indicates haemoperitoneum tracking along falciform ligament
Q14: What is the significance of shifting dullness in acute abdomen? Indicates free fluid (haemoperitoneum, ascites, purulent exudate). Central resonance with dullness in flanks that shifts with patient position.
Q15: What precautions do you take before performing laparotomy?
  • Resuscitate (IV fluids, blood transfusion if needed)
  • IV antibiotics (broad-spectrum - cover gram-negatives and anaerobes)
  • NBM + NGT decompression
  • Urinary catheter (monitor urine output)
  • Correct electrolyte imbalances
  • Consent with explanation of findings and possible procedures
  • Cross-match blood
  • VTE prophylaxis
  • Anaesthesia fitness

Key Textbook References:
  • Sabiston Textbook of Surgery (21e) - Chapter on Acute Abdomen
  • Bailey and Love's Short Practice of Surgery (28e)
  • S Das - A Manual on Clinical Surgery (13e)
  • Current Surgical Therapy (14e)

Give it in a downloadable pdf format

Reading File
Running Command

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

Running Command

mkdir -p /tmp/workspace/laparotomy-viva && python3 -c "from reportlab.lib import colors; print('reportlab ok')"

Writing File

~/laparotomy-viva/generate_pdf.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, PageBreak
)
from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_JUSTIFY

OUTPUT = "/tmp/workspace/laparotomy-viva/Exploratory_Laparotomy_Viva.pdf"

doc = SimpleDocTemplate(
    OUTPUT,
    pagesize=A4,
    leftMargin=2*cm, rightMargin=2*cm,
    topMargin=2*cm, bottomMargin=2*cm,
    title="Exploratory Laparotomy - Surgery Viva",
    author="Orris Medical"
)

styles = getSampleStyleSheet()

# Custom styles
title_style = ParagraphStyle(
    'CustomTitle',
    parent=styles['Title'],
    fontSize=20,
    textColor=colors.HexColor('#1a2e5a'),
    spaceAfter=6,
    fontName='Helvetica-Bold',
    alignment=TA_CENTER
)

subtitle_style = ParagraphStyle(
    'Subtitle',
    parent=styles['Normal'],
    fontSize=11,
    textColor=colors.HexColor('#4a4a4a'),
    spaceAfter=12,
    fontName='Helvetica',
    alignment=TA_CENTER
)

h1_style = ParagraphStyle(
    'H1',
    parent=styles['Heading1'],
    fontSize=13,
    textColor=colors.white,
    fontName='Helvetica-Bold',
    spaceAfter=4,
    spaceBefore=10,
    leftIndent=0,
    backColor=colors.HexColor('#1a2e5a'),
    borderPad=5
)

h2_style = ParagraphStyle(
    'H2',
    parent=styles['Heading2'],
    fontSize=11,
    textColor=colors.HexColor('#1a2e5a'),
    fontName='Helvetica-Bold',
    spaceAfter=3,
    spaceBefore=8,
    borderPad=2,
)

h3_style = ParagraphStyle(
    'H3',
    parent=styles['Heading3'],
    fontSize=10,
    textColor=colors.HexColor('#2e6da4'),
    fontName='Helvetica-Bold',
    spaceAfter=2,
    spaceBefore=5,
)

body_style = ParagraphStyle(
    'Body',
    parent=styles['Normal'],
    fontSize=9.5,
    fontName='Helvetica',
    leading=14,
    spaceAfter=3,
    alignment=TA_JUSTIFY
)

bullet_style = ParagraphStyle(
    'Bullet',
    parent=styles['Normal'],
    fontSize=9.5,
    fontName='Helvetica',
    leading=13,
    spaceAfter=2,
    leftIndent=14,
    bulletIndent=4,
)

qa_q_style = ParagraphStyle(
    'QA_Q',
    parent=styles['Normal'],
    fontSize=9.5,
    fontName='Helvetica-Bold',
    leading=13,
    spaceAfter=2,
    textColor=colors.HexColor('#1a2e5a'),
    backColor=colors.HexColor('#eef3fb'),
    borderPad=4,
    leftIndent=0,
)

qa_a_style = ParagraphStyle(
    'QA_A',
    parent=styles['Normal'],
    fontSize=9.5,
    fontName='Helvetica',
    leading=13,
    spaceAfter=6,
    leftIndent=10,
    textColor=colors.HexColor('#222222'),
)

def section_header(text):
    return [
        Spacer(1, 0.3*cm),
        Paragraph(f"  {text}", h1_style),
        Spacer(1, 0.15*cm),
    ]

def sub_header(text):
    return [Paragraph(text, h2_style)]

def sub_sub_header(text):
    return [Paragraph(text, h3_style)]

def body(text):
    return [Paragraph(text, body_style)]

def bullet(items):
    out = []
    for item in items:
        out.append(Paragraph(f"• {item}", bullet_style))
    return out

def qa_pair(q, a_items):
    out = []
    out.append(Paragraph(f"Q: {q}", qa_q_style))
    for a in a_items:
        out.append(Paragraph(f"A: {a}" if a_items.index(a) == 0 else f"   {a}", qa_a_style))
    out.append(Spacer(1, 0.1*cm))
    return out

def make_table(headers, rows, col_widths=None):
    data = [headers] + rows
    t = Table(data, colWidths=col_widths, repeatRows=1)
    t.setStyle(TableStyle([
        ('BACKGROUND', (0, 0), (-1, 0), colors.HexColor('#1a2e5a')),
        ('TEXTCOLOR', (0, 0), (-1, 0), colors.white),
        ('FONTNAME', (0, 0), (-1, 0), 'Helvetica-Bold'),
        ('FONTSIZE', (0, 0), (-1, 0), 9),
        ('FONTNAME', (0, 1), (-1, -1), 'Helvetica'),
        ('FONTSIZE', (0, 1), (-1, -1), 8.5),
        ('ROWBACKGROUNDS', (0, 1), (-1, -1), [colors.white, colors.HexColor('#f0f4fb')]),
        ('GRID', (0, 0), (-1, -1), 0.4, colors.HexColor('#c0c8d8')),
        ('VALIGN', (0, 0), (-1, -1), 'TOP'),
        ('TOPPADDING', (0, 0), (-1, -1), 4),
        ('BOTTOMPADDING', (0, 0), (-1, -1), 4),
        ('LEFTPADDING', (0, 0), (-1, -1), 6),
        ('RIGHTPADDING', (0, 0), (-1, -1), 6),
    ]))
    return t

story = []

# ─── COVER ───────────────────────────────────────────────────────────────────
story.append(Spacer(1, 3*cm))
story.append(Paragraph("Exploratory Laparotomy", title_style))
story.append(Paragraph("History Taking · Examination · Viva Questions", subtitle_style))
story.append(Spacer(1, 0.3*cm))
story.append(HRFlowable(width="100%", thickness=2, color=colors.HexColor('#1a2e5a')))
story.append(Spacer(1, 0.2*cm))
story.append(Paragraph("Surgery Viva Preparation Guide", subtitle_style))
story.append(Paragraph("Based on: Sabiston 21e · Bailey & Love 28e · S Das 13e · Current Surgical Therapy 14e", ParagraphStyle('ref', parent=styles['Normal'], fontSize=8, textColor=colors.grey, alignment=TA_CENTER)))
story.append(Spacer(1, 3*cm))
story.append(PageBreak())

# ─── PART 1: HISTORY TAKING ──────────────────────────────────────────────────
story += section_header("PART 1: HISTORY TAKING")

story += sub_header("Chief Complaint")
story += body("Abdominal pain is the cardinal presenting symptom. Characterise it fully using the SOCRATES framework.")

story.append(Spacer(1, 0.2*cm))
story += sub_header("SOCRATES Pain Analysis")
tbl = make_table(
    [Paragraph('<b>Feature</b>', ParagraphStyle('th', fontSize=9, fontName='Helvetica-Bold', textColor=colors.white)), 
     Paragraph('<b>Key Questions / Significance</b>', ParagraphStyle('th', fontSize=9, fontName='Helvetica-Bold', textColor=colors.white))],
    [
        [Paragraph('Site', body_style), Paragraph('Where did pain start? Has it shifted? Periumbilical → RIF = appendicitis; Epigastric = peptic ulcer/pancreatitis; Loin = ureteric colic', body_style)],
        [Paragraph('Onset', body_style), Paragraph('Sudden onset (perforation, rupture, torsion) vs. gradual onset (inflammation, obstruction)', body_style)],
        [Paragraph('Character', body_style), Paragraph('Colicky = obstruction, biliary/ureteric colic; Constant = peritonitis, ischaemia; Burning = peptic ulcer', body_style)],
        [Paragraph('Radiation', body_style), Paragraph('Shoulder tip = diaphragmatic irritation (free air/blood under diaphragm); Loin to groin = ureteric colic; Back = pancreatitis, AAA', body_style)],
        [Paragraph('Associations', body_style), Paragraph('Nausea/vomiting (early = appendicitis; feculent = obstruction), fever, jaundice, PR bleeding, haematuria, vaginal discharge', body_style)],
        [Paragraph('Timing', body_style), Paragraph('Duration, progression, continuous vs. intermittent', body_style)],
        [Paragraph('Exacerbating / Relieving', body_style), Paragraph('Worse on movement = peritonitis; relieved by lying still; leaning forward = pancreatitis', body_style)],
        [Paragraph('Severity', body_style), Paragraph('VAS 1-10; sudden maximum-severity pain = perforation or rupture', body_style)],
    ],
    col_widths=[3.5*cm, 12.5*cm]
)
story.append(tbl)
story.append(Spacer(1, 0.3*cm))

story += sub_header("Sequence of Symptoms (Important for Viva)")
story += bullet([
    "Murphy's sequence for appendicitis: Pain → Vomiting → Fever",
    "Reversed sequence (vomiting before pain) suggests a medical/non-surgical cause (e.g., gastroenteritis)",
    "Absolute constipation (no flatus + no stool) = mechanical intestinal obstruction",
])

story.append(Spacer(1, 0.3*cm))
story += sub_header("Specific Directed History")

story += sub_sub_header("For Intestinal Obstruction:")
story += bullet([
    "Last passage of flatus and stool?",
    "Nature of vomiting — bilious (small bowel) or feculent (large bowel / late obstruction)?",
    "Abdominal distension?",
    "Previous abdominal surgery (adhesions), known hernia, history of malignancy",
])

story += sub_sub_header("For Perforation:")
story += bullet([
    "Known peptic ulcer disease? NSAIDs / steroid / aspirin use?",
    "Sudden onset severe 'knife-like' pain?",
    "History of typhoid fever (typhoid ulcer perforation)?",
    "History of IBD or diverticular disease?",
])

story += sub_sub_header("For Haemoperitoneum / Bleeding:")
story += bullet([
    "Last menstrual period (LMP) — in women of reproductive age, must exclude ectopic pregnancy",
    "History of trauma (road traffic accident, assault)",
    "Known aortic aneurysm or vascular disease",
    "Anticoagulant / antiplatelet use",
])

story += sub_sub_header("For Infection / Peritonitis:")
story += bullet([
    "Fever, chills, rigors — duration and progression?",
    "Urinary symptoms (frequency, dysuria — UTI can mimic acute abdomen)",
    "In women: vaginal discharge, dyspareunia, irregular periods (PID, ectopic)",
])

story.append(Spacer(1, 0.3*cm))
story += sub_header("Past Medical & Surgical History")
story += bullet([
    "Previous similar episodes",
    "Previous abdominal operations — adhesions, anastomotic complications",
    "Known malignancy — bowel obstruction, perforation of tumour",
    "Peptic ulcer disease / IBD / diverticular disease",
    "Known hernias",
    "Diabetes (DKA can mimic acute abdomen)",
])

story += sub_header("Drug History")
story += bullet([
    "NSAIDs and steroids — increase risk of peptic perforation; may also mask signs",
    "Anticoagulants (warfarin, novel anticoagulants) — haemoperitoneum risk",
    "Immunosuppressants — atypical presentations, increased infection risk",
    "Opioid analgesics — may confound examination",
])

story += sub_header("Social History")
story += bullet([
    "Alcohol — acute pancreatitis, liver disease, Mallory-Weiss",
    "Smoking — vascular disease, malignancy",
    "Travel history — typhoid, amoebic liver abscess, parasitic infections",
    "Occupation — may suggest specific risks",
])

story.append(PageBreak())

# ─── PART 2: EXAMINATION ─────────────────────────────────────────────────────
story += section_header("PART 2: CLINICAL EXAMINATION")

story += sub_header("General Examination")
tbl2 = make_table(
    [Paragraph('<b>Sign</b>', ParagraphStyle('th', fontSize=9, fontName='Helvetica-Bold', textColor=colors.white)),
     Paragraph('<b>Significance</b>', ParagraphStyle('th', fontSize=9, fontName='Helvetica-Bold', textColor=colors.white))],
    [
        [Paragraph('Pallor', body_style), Paragraph('Haemorrhage (haemoperitoneum, ruptured ectopic, ruptured AAA), anaemia', body_style)],
        [Paragraph('Jaundice', body_style), Paragraph('Biliary obstruction, cholangitis, hepatic pathology', body_style)],
        [Paragraph('Dehydration', body_style), Paragraph('Dry mucous membranes, reduced skin turgor — vomiting, obstruction, peritonitis', body_style)],
        [Paragraph('Fever', body_style), Paragraph('Infection/inflammation — peritonitis, appendicitis, cholecystitis', body_style)],
        [Paragraph('Tachycardia / Hypotension', body_style), Paragraph('Haemorrhagic or septic shock — indicates urgent intervention', body_style)],
        [Paragraph('Tachypnoea', body_style), Paragraph('Peritonitis (splinting of diaphragm), or respiratory compensation for metabolic acidosis', body_style)],
        [Paragraph('Patient position', body_style), Paragraph('Lying perfectly still = peritonitis; writhing restlessly = colic (renal / biliary)', body_style)],
    ],
    col_widths=[3.5*cm, 12.5*cm]
)
story.append(tbl2)

story.append(Spacer(1, 0.3*cm))
story += sub_header("Abdominal Examination — 4 Steps (IPPA)")

story += sub_sub_header("1. Inspection")
story += bullet([
    "Distension — obstruction, paralytic ileus, free gas, ascites",
    "Visible peristalsis — intestinal obstruction (ladder pattern)",
    "Previous surgical scars — adhesions, history of surgery",
    "Visible pulsation — aortic aneurysm",
    "Hernia sites — groin (inguinal/femoral), umbilical, incisional",
    "Grey Turner's sign — flank bruising (retroperitoneal haemorrhage, severe pancreatitis)",
    "Cullen's sign — periumbilical bruising (haemoperitoneum, severe pancreatitis)",
    "Caput medusae — portal hypertension",
])

story += sub_sub_header("2. Palpation")
story += body("Begin gently, away from the site of maximal pain. Progress from superficial to deep.")
story += bullet([
    "Tenderness and its site — helps localise pathology",
    "Voluntary guarding vs. involuntary rigidity (board-like abdomen = generalised peritonitis)",
    "Rebound tenderness (Blumberg's sign) — pain on sudden release of pressure = peritoneal irritation",
    "Rovsing's sign — RIF pain on palpating LIF = appendicitis",
    "Murphy's sign — arrest of deep inspiration on palpating RUQ = acute cholecystitis",
    "Mass — appendix mass, tumour, aortic aneurysm, intussusception (sausage-shaped)",
    "Obturator sign — pain on internal rotation of flexed right hip = pelvic appendicitis / pelvic abscess",
    "Psoas sign — pain on passive extension of right hip = retrocaecal appendicitis",
])

story += sub_sub_header("3. Percussion")
story += bullet([
    "Loss of liver dullness — pneumoperitoneum (free gas under diaphragm)",
    "Shifting dullness — free fluid (haemoperitoneum, ascites, purulent exudate)",
    "Resonance / hyper-resonance — distended bowel loops (obstruction)",
    "Tenderness on percussion = peritoneal irritation (more gentle alternative to rebound test)",
])

story += sub_sub_header("4. Auscultation")
story += bullet([
    "Absent bowel sounds — paralytic ileus, generalised peritonitis (late), post-surgery",
    "High-pitched tinkling bowel sounds — mechanical intestinal obstruction",
    "Bruit — aortic / renal artery stenosis",
    "Succussion splash (heard >3 hours after a meal) — gastric outlet obstruction",
])

story.append(Spacer(1, 0.3*cm))
story += sub_header("Special Examinations — NEVER Miss in Viva")
tbl3 = make_table(
    [Paragraph('<b>Examination</b>', ParagraphStyle('th', fontSize=9, fontName='Helvetica-Bold', textColor=colors.white)),
     Paragraph('<b>What to Find / Significance</b>', ParagraphStyle('th', fontSize=9, fontName='Helvetica-Bold', textColor=colors.white))],
    [
        [Paragraph('Digital Rectal Examination (DRE)', body_style), Paragraph('Boggy mass (pelvic abscess), fresh blood (carcinoma, ischaemic bowel), tenderness (pelvic peritonitis), empty rectum (obstruction), faecal impaction', body_style)],
        [Paragraph('Per Vaginum (PV) in women', body_style), Paragraph('Cervical excitation tenderness = ectopic pregnancy or PID; adnexal mass/tenderness; vaginal bleeding', body_style)],
        [Paragraph('Hernial orifices', body_style), Paragraph('Always examine inguinal, femoral, umbilical, and incisional sites — strangulated hernia is a common cause of obstruction missed by students', body_style)],
        [Paragraph('Genitalia (males)', body_style), Paragraph('Testicular torsion presents with abdominal pain — always examine testes', body_style)],
        [Paragraph('Chest examination', body_style), Paragraph('Basal pneumonia / pleurisy / MI can mimic acute abdomen — must be excluded', body_style)],
    ],
    col_widths=[4.5*cm, 11.5*cm]
)
story.append(tbl3)

story.append(PageBreak())

# ─── PART 3: INVESTIGATIONS ───────────────────────────────────────────────────
story += section_header("PART 3: INVESTIGATIONS BEFORE LAPAROTOMY")

story += sub_header("Blood Tests")
tbl4 = make_table(
    [Paragraph('<b>Test</b>', ParagraphStyle('th', fontSize=9, fontName='Helvetica-Bold', textColor=colors.white)),
     Paragraph('<b>Purpose / Interpretation</b>', ParagraphStyle('th', fontSize=9, fontName='Helvetica-Bold', textColor=colors.white))],
    [
        [Paragraph('CBC / FBC', body_style), Paragraph('Leucocytosis = infection/inflammation; leucopaenia = overwhelming sepsis; anaemia = haemorrhage; thrombocytosis = acute phase', body_style)],
        [Paragraph('Serum amylase / lipase', body_style), Paragraph('>3× upper limit = pancreatitis (rule out before laparotomy)', body_style)],
        [Paragraph('LFTs', body_style), Paragraph('Biliary obstruction, hepatocellular damage, pancreatitis', body_style)],
        [Paragraph('Urea, creatinine, electrolytes', body_style), Paragraph('Assess renal function, dehydration; hypokalaemia in obstruction/vomiting', body_style)],
        [Paragraph('Serum lactate', body_style), Paragraph('Elevated in bowel ischaemia, sepsis, haemorrhagic shock — prognostic marker', body_style)],
        [Paragraph('Coagulation (PT/INR, APTT)', body_style), Paragraph('Pre-operative; DIC screen in sepsis/haemorrhage', body_style)],
        [Paragraph('Group & cross-match', body_style), Paragraph('Mandatory before any laparotomy; order at least 2 units PRBC', body_style)],
        [Paragraph('ABG', body_style), Paragraph('Metabolic acidosis = ischaemia or sepsis; respiratory compensation', body_style)],
        [Paragraph('Urine β-hCG', body_style), Paragraph('In all women of childbearing age — exclude ectopic pregnancy BEFORE any surgery', body_style)],
        [Paragraph('Blood cultures', body_style), Paragraph('If sepsis suspected — take before antibiotics', body_style)],
    ],
    col_widths=[4.5*cm, 11.5*cm]
)
story.append(tbl4)

story.append(Spacer(1, 0.3*cm))
story += sub_header("Imaging")
tbl5 = make_table(
    [Paragraph('<b>Investigation</b>', ParagraphStyle('th', fontSize=9, fontName='Helvetica-Bold', textColor=colors.white)),
     Paragraph('<b>Use</b>', ParagraphStyle('th', fontSize=9, fontName='Helvetica-Bold', textColor=colors.white))],
    [
        [Paragraph('Erect Chest X-ray', body_style), Paragraph('FREE GAS under diaphragm = perforation (best initial for suspected hollow viscus perforation). Also: basal pneumonia, pleural effusion', body_style)],
        [Paragraph('Supine + Erect AXR', body_style), Paragraph('Dilated bowel loops, fluid levels, step-ladder pattern (obstruction); Rigler\'s sign (both sides of bowel wall visible = free gas)', body_style)],
        [Paragraph('Ultrasound abdomen & pelvis', body_style), Paragraph('First-line for hepatobiliary (stones, dilated ducts, cholecystitis), pelvic pathology, free fluid. Limited by obesity and bowel gas', body_style)],
        [Paragraph('CT abdomen/pelvis with contrast', body_style), Paragraph('GOLD STANDARD — identifies cause, site of perforation, level of obstruction, ischaemia, solid organ injury, haematoma, AAA, pelvic pathology. Essential before elective/semi-elective laparotomy', body_style)],
        [Paragraph('FAST / eFAST (trauma)', body_style), Paragraph('Focused Assessment with Sonography in Trauma — bedside; detects haemoperitoneum, pericardial tamponade, haemothorax rapidly', body_style)],
    ],
    col_widths=[4.5*cm, 11.5*cm]
)
story.append(tbl5)

story.append(PageBreak())

# ─── PART 4: INDICATIONS ─────────────────────────────────────────────────────
story += section_header("PART 4: INDICATIONS FOR EXPLORATORY LAPAROTOMY")

story += sub_header("Absolute Indications — Operate Without Delay")
tbl6 = make_table(
    [Paragraph('<b>Indication</b>', ParagraphStyle('th', fontSize=9, fontName='Helvetica-Bold', textColor=colors.white)),
     Paragraph('<b>Clinical Features</b>', ParagraphStyle('th', fontSize=9, fontName='Helvetica-Bold', textColor=colors.white))],
    [
        [Paragraph('Generalised peritonitis', body_style), Paragraph('Board-like rigidity, absent bowel sounds, rebound tenderness all over abdomen', body_style)],
        [Paragraph('Pneumoperitoneum', body_style), Paragraph('Free gas under diaphragm on erect CXR — hollow viscus perforation', body_style)],
        [Paragraph('Haemodynamic instability with suspected intra-abdominal haemorrhage', body_style), Paragraph('Trauma, ruptured AAA, ruptured ectopic — FAST positive', body_style)],
        [Paragraph('Evisceration', body_style), Paragraph('Bowel protruding through abdominal wound', body_style)],
        [Paragraph('Strangulated hernia / closed loop obstruction', body_style), Paragraph('Signs of bowel ischaemia: constant pain, fever, high lactate, dark blood PR', body_style)],
        [Paragraph('Ruptured ectopic pregnancy', body_style), Paragraph('Positive βhCG, haemodynamic instability, acute abdomen', body_style)],
        [Paragraph('Penetrating abdominal trauma', body_style), Paragraph('With peritonitis or haemodynamic instability', body_style)],
    ],
    col_widths=[5*cm, 11*cm]
)
story.append(tbl6)

story.append(Spacer(1, 0.3*cm))
story += sub_header("Relative / Urgent Indications")
story += bullet([
    "Failure of conservative management (e.g., appendix mass with clinical deterioration)",
    "Suspected mesenteric ischaemia / bowel infarction",
    "Intestinal obstruction not responding to conservative treatment after 24-48 h",
    "Intraperitoneal bladder rupture",
    "CT evidence requiring operative intervention (grade V solid organ injury, free perforation)",
])

story += sub_header("Causes of Acute Abdomen — Differential Diagnosis")
story += sub_sub_header("Intra-abdominal Surgical Causes (S Das Classification)")
tbl7 = make_table(
    [Paragraph('<b>Category</b>', ParagraphStyle('th', fontSize=9, fontName='Helvetica-Bold', textColor=colors.white)),
     Paragraph('<b>Examples</b>', ParagraphStyle('th', fontSize=9, fontName='Helvetica-Bold', textColor=colors.white))],
    [
        [Paragraph('Inflammation', body_style), Paragraph('Acute appendicitis, acute cholecystitis, acute pancreatitis, diverticulitis, salpingitis, mesenteric lymphadenitis, amoebic liver abscess', body_style)],
        [Paragraph('Perforation', body_style), Paragraph('Perforated peptic ulcer, typhoid ulcer, diverticular disease, UC/Crohn\'s, carcinoma of colon', body_style)],
        [Paragraph('Obstruction', body_style), Paragraph('Adhesional bands, hernia (incarcerated/strangulated), volvulus, intussusception, gallstone ileus, tumour, round worms, faecolith', body_style)],
        [Paragraph('Haemorrhage', body_style), Paragraph('Ruptured ectopic pregnancy, ruptured AAA, ruptured malarial spleen, traumatic splenic/hepatic laceration, ruptured lutein cyst', body_style)],
        [Paragraph('Vascular', body_style), Paragraph('Mesenteric artery occlusion (embolus/thrombosis), ischaemic colitis, aortic dissection', body_style)],
        [Paragraph('Torsion', body_style), Paragraph('Twisted ovarian cyst, testicular torsion, uterine torsion, greater omentum torsion', body_style)],
    ],
    col_widths=[4*cm, 12*cm]
)
story.append(tbl7)

story.append(Spacer(1, 0.2*cm))
story += sub_sub_header("Extra-abdominal Causes (MUST Be Excluded Before Surgery)")
story += bullet([
    "Thoracic: Inferior MI (epigastric pain!), basal pneumonia, pleurisy, pneumothorax, pericarditis",
    "Metabolic: Diabetic ketoacidosis (DKA), Addisonian crisis, porphyria, uraemia, sickle cell crisis",
    "Neurological: Herpes zoster (pre-rash phase), Tabes dorsalis (gastric crisis), Pott's disease",
    "Haematological: Sickle cell crisis, haemophilia",
])

story.append(PageBreak())

# ─── PART 5: VIVA Q&A ────────────────────────────────────────────────────────
story += section_header("PART 5: VIVA QUESTIONS & MODEL ANSWERS")

viva_items = [
    (
        "What is an exploratory laparotomy? Define it.",
        ["A surgical procedure in which the abdominal cavity is opened — usually through a midline incision — to inspect the peritoneal contents, identify pathology, and perform definitive or damage-control surgery. It is both diagnostic and therapeutic."]
    ),
    (
        "What incision is used for exploratory laparotomy?",
        ["Standard: Midline (median) laparotomy — from xiphisternum to pubic symphysis.",
         "Advantages: Widest access to all quadrants, rapid entry, extensible, avoids major nerves and vessels, good wound healing along linea alba.",
         "Alternatives: Kocher's (right subcostal) for hepatobiliary; Pfannenstiel for pelvic; Rutherford-Morrison for right iliac fossa."]
    ),
    (
        "What do you see on erect chest X-ray in a perforated viscus?",
        ["Free gas (air) under the diaphragm — classically a crescent-shaped lucency beneath the right hemidiaphragm.",
         "Note: Absent in up to 30% of perforations — do CT abdomen if clinical suspicion remains despite negative CXR.",
         "Patient must be upright for at least 10 minutes before the film for free gas to rise."]
    ),
    (
        "Differentiate voluntary guarding from involuntary rigidity.",
        ["Voluntary guarding: Conscious contraction of abdominal muscles by the patient due to anticipation of pain or anxiety. Relaxes on distraction (talk to patient, examine elsewhere, reassure).",
         "Involuntary rigidity (board-like abdomen): Reflex spasm of abdominal muscles due to parietal peritoneal irritation. Cannot be overcome — present even under anaesthesia. Indicates peritonitis and is an absolute indication for surgery."]
    ),
    (
        "What is rebound tenderness (Blumberg's sign)?",
        ["Pain that is elicited on sudden release of deep pressure applied to the abdomen.",
         "Mechanism: Deep palpation momentarily displaces inflamed parietal peritoneum away from the inflamed viscus; sudden release causes snap-back contact causing sharp pain.",
         "Significance: Indicates parietal peritoneal irritation = peritonitis."]
    ),
    (
        "Enumerate the clinical signs of peritonitis.",
        ["General: Fever, tachycardia, hypotension (in severe/advanced), dehydration",
         "Abdominal: Board-like rigidity, rebound tenderness, generalised tenderness, absent bowel sounds",
         "Posture: Patient lying absolutely still — any movement exacerbates pain",
         "Other: Loss of liver dullness (if pneumoperitoneum), shifting dullness (if exudate), tenderness on DRE"]
    ),
    (
        "What is Murphy's sign? How do you elicit it?",
        ["Definition: Arrest of deep inspiration due to pain when the examiner palpates the right hypochondrium.",
         "Method: Patient supine. Examiner places fingers below the right costal margin and asks the patient to exhale and then inhale deeply. As the diaphragm descends during inhalation, the inflamed gallbladder contacts the examiner's fingers causing pain that halts the breath.",
         "Significance: Positive in acute cholecystitis. Note: Murphy's sign can be false negative in gangrenous cholecystitis (nerve endings destroyed)."]
    ),
    (
        "List the classic features of intestinal obstruction.",
        ["Symptoms: Colicky abdominal pain, vomiting (bilious = small bowel; feculent = large bowel / late), absolute constipation (no flatus, no stool), progressive abdominal distension",
         "Signs: Visible peristalsis, high-pitched tinkling bowel sounds, resonance on percussion, empty rectum on DRE",
         "X-ray: Dilated loops of bowel, multiple fluid levels, 'step-ladder pattern' (SBO); haustral markings present in large bowel obstruction",
         "Note: In strangulated obstruction, pain becomes constant (ischaemia), patient systemically unwell — operate urgently"]
    ),
    (
        "What is damage control laparotomy (DCL)?",
        ["An abbreviated operative strategy used in haemodynamically unstable trauma patients.",
         "Steps: (1) Control haemorrhage — packing, vessel ligation; (2) Control contamination — temporary bowel closure/stapling; (3) Temporary abdominal closure (TAC) using negative pressure wound therapy; (4) Resuscitate in ICU; (5) Return for definitive surgery in 24-48 hours (second-look laparotomy).",
         "Goal: Prevent the lethal triad of hypothermia, coagulopathy, and acidosis."]
    ),
    (
        "What is a second-look laparotomy?",
        ["A planned re-operation, usually within 24-48 hours of the initial surgery.",
         "Indications: (a) Damage control surgery — to complete definitive repair after resuscitation; (b) Mesenteric ischaemia — to assess bowel viability after revascularisation; (c) Peritoneal washout for severe contamination.",
         "Also called 'relook laparotomy.'"]
    ),
    (
        "What are the pre-operative preparations before laparotomy?",
        ["Resuscitation: IV fluids (crystalloid ± colloid), blood transfusion if needed, treat shock",
         "IV broad-spectrum antibiotics: Cover Gram-negatives + anaerobes (e.g., cefuroxime + metronidazole, or piperacillin-tazobactam)",
         "Nasogastric tube (NGT): Decompress stomach, reduce aspiration risk",
         "Urinary catheter: Monitor urine output (target >0.5 mL/kg/hr)",
         "Correct electrolytes and metabolic abnormalities",
         "Blood group + cross-match (at least 2 units PRBC)",
         "Informed consent: Explain findings, possible procedures including stoma formation",
         "VTE prophylaxis: Compression stockings, LMWH when appropriate",
         "Anaesthesia fitness assessment: ASA grading, airway assessment"]
    ),
    (
        "What are the complications of laparotomy?",
        ["Early (within 30 days): Haemorrhage (intra-op or reactionary), anastomotic leak, iatrogenic bowel injury, wound infection, intra-abdominal abscess, paralytic ileus, respiratory complications (atelectasis, pneumonia)",
         "Late: Adhesions (most common cause of SBO in adults who had prior surgery), incisional hernia (5-15%), wound dehiscence/burst abdomen, enterocutaneous fistula, chronic pain, stoma complications"]
    ),
    (
        "What are the medical causes of acute abdomen that must be excluded before surgery?",
        ["Cardiac: Inferior MI (epigastric pain, ECG changes), aortic dissection",
         "Pulmonary: Basal pneumonia, diaphragmatic pleurisy, spontaneous pneumothorax",
         "Metabolic: DKA (tight girdle pain, acetone breath, hyperglycaemia), Addisonian crisis, porphyria (colicky pain + dark urine + neuropsychiatric), uraemia",
         "Haematological: Sickle cell crisis, haemophilia",
         "Neurological: Herpes zoster (pre-rash phase of thoracoabdominal dermatomal pain), Tabes dorsalis, Pott's disease"]
    ),
    (
        "What is Grey Turner's sign and Cullen's sign?",
        ["Grey Turner's sign: Bruising (ecchymosis) in the flanks / loin — indicates retroperitoneal haemorrhage. Seen in severe acute pancreatitis, retroperitoneal bleeding.",
         "Cullen's sign: Periumbilical bruising — blood tracking along the falciform ligament. Same causes; also seen in ruptured ectopic pregnancy.",
         "Both signs take 24-48 hours to appear and indicate severe, life-threatening pathology."]
    ),
    (
        "What is Rovsing's sign?",
        ["Pain in the right iliac fossa elicited by palpation of the left iliac fossa.",
         "Mechanism: Pressure on the left side displaces bowel gas/contents rightward, distending the appendix region.",
         "Significance: Positive in acute appendicitis."]
    ),
    (
        "What is the Psoas sign and Obturator sign?",
        ["Psoas sign (Cope's sign): Pain on passive extension of the right hip with the patient lying on the left side. Indicates inflammation adjacent to the iliopsoas muscle — seen in retrocaecal appendicitis.",
         "Obturator sign: Pain on passive internal rotation of the flexed right hip. Indicates inflammation near the obturator internus — seen in pelvic appendicitis, pelvic abscess, Meckel's diverticulitis."]
    ),
    (
        "What is the significance of absent bowel sounds?",
        ["Absent bowel sounds = adynamic (paralytic) ileus — no peristalsis.",
         "Causes: Generalised peritonitis (most important surgical cause), post-operative ileus, mesenteric ischaemia (advanced), electrolyte imbalance (hypokalaemia), retroperitoneal haematoma.",
         "Distinction: In mechanical obstruction (early), bowel sounds are increased and high-pitched/tinkling. As obstruction progresses and bowel becomes ischaemic, sounds diminish and eventually disappear."]
    ),
]

for q, a_list in viva_items:
    block = []
    block.append(Paragraph(f"Q: {q}", qa_q_style))
    for i, a in enumerate(a_list):
        if i == 0:
            block.append(Paragraph(f"A: {a}", qa_a_style))
        else:
            block.append(Paragraph(f"    {a}", qa_a_style))
    block.append(Spacer(1, 0.1*cm))
    story.append(KeepTogether(block))

story.append(PageBreak())

# ─── PART 6: QUICK REFERENCE ─────────────────────────────────────────────────
story += section_header("PART 6: QUICK REFERENCE SUMMARY")

story += sub_header("Signs and Their Diagnoses — Cheat Sheet")
tbl8 = make_table(
    [Paragraph('<b>Sign / Finding</b>', ParagraphStyle('th', fontSize=9, fontName='Helvetica-Bold', textColor=colors.white)),
     Paragraph('<b>Diagnosis</b>', ParagraphStyle('th', fontSize=9, fontName='Helvetica-Bold', textColor=colors.white))],
    [
        [Paragraph('Free gas under diaphragm (erect CXR)', body_style), Paragraph('Hollow viscus perforation (peptic ulcer most common)', body_style)],
        [Paragraph('Board-like rigidity + absent bowel sounds', body_style), Paragraph('Generalised peritonitis', body_style)],
        [Paragraph('Murphy\'s sign positive', body_style), Paragraph('Acute cholecystitis', body_style)],
        [Paragraph('Pain shifting: periumbilical → RIF', body_style), Paragraph('Acute appendicitis', body_style)],
        [Paragraph('Rovsing\'s sign positive', body_style), Paragraph('Acute appendicitis', body_style)],
        [Paragraph('Tinkling bowel sounds + distension', body_style), Paragraph('Mechanical intestinal obstruction', body_style)],
        [Paragraph('Grey Turner\'s + Cullen\'s signs', body_style), Paragraph('Severe pancreatitis / retroperitoneal haemorrhage', body_style)],
        [Paragraph('FAST positive + haemodynamic instability', body_style), Paragraph('Haemoperitoneum — surgical emergency', body_style)],
        [Paragraph('Cervical excitation on PV + positive βhCG', body_style), Paragraph('Ectopic pregnancy', body_style)],
        [Paragraph('Empty rectum on DRE + absolute constipation', body_style), Paragraph('Mechanical bowel obstruction', body_style)],
        [Paragraph('Succussion splash', body_style), Paragraph('Gastric outlet obstruction', body_style)],
        [Paragraph('Boggy mass on DRE', body_style), Paragraph('Pelvic abscess', body_style)],
    ],
    col_widths=[7*cm, 9*cm]
)
story.append(tbl8)

story.append(Spacer(1, 0.4*cm))
story += sub_header("Investigations — What to Order and Why")
story += bullet([
    "All patients: CBC, RFTs, electrolytes, amylase, LFTs, coagulation, group & cross-match, urine dipstick",
    "Women of childbearing age: βhCG (MANDATORY before any laparotomy)",
    "Suspected ischaemia/sepsis: Add serum lactate + ABG",
    "Suspected infection: Blood cultures before antibiotics",
    "Imaging: Erect CXR first → ultrasound (haemodynamically stable) → CT (gold standard for definitive diagnosis)",
    "Trauma: eFAST at bedside → CT trauma series if stable; straight to theatre if unstable",
])

story.append(Spacer(1, 0.4*cm))
story += sub_header("Key References")
story += bullet([
    "Sabiston Textbook of Surgery, 21st Edition — Chapter: Acute Abdomen",
    "Bailey and Love's Short Practice of Surgery, 28th Edition",
    "S Das — A Manual on Clinical Surgery, 13th Edition",
    "Current Surgical Therapy, 14th Edition — Abdominal Trauma",
    "Schwartz's Principles of Surgery, 11th Edition",
])

story.append(Spacer(1, 0.5*cm))
story.append(HRFlowable(width="100%", thickness=1, color=colors.HexColor('#1a2e5a')))
story.append(Spacer(1, 0.2*cm))
story.append(Paragraph("Generated by Orris Medical AI — For educational purposes only. Always refer to current clinical guidelines.", ParagraphStyle('footer', fontSize=7.5, textColor=colors.grey, alignment=TA_CENTER)))

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

python3 /tmp/workspace/laparotomy-viva/generate_pdf.py 2>&1

Running Command

ls -lh /tmp/workspace/laparotomy-viva/Exploratory_Laparotomy_Viva.pdf

Your PDF is ready. Here is the download link:

Exploratory Laparotomy Viva

PDF Document · PDF

What's inside (6 sections, ~28KB):
  1. History Taking - SOCRATES pain analysis table, sequence of symptoms, directed history for obstruction/perforation/haemorrhage/infection, drug history, social history
  2. Clinical Examination - General exam signs table, full IPPA abdominal exam with all eponymous signs (Murphy's, Rovsing's, Blumberg's, Grey Turner's, Cullen's, Psoas, Obturator), special examinations (DRE, PV, hernial orifices)
  3. Investigations - Blood tests and imaging with interpretation, organized in table format
  4. Indications for Laparotomy - Absolute vs. relative indications, differential diagnosis tables (S Das classification)
  5. 16 Viva Q&A pairs - Model answers for every likely question
  6. Quick Reference Summary - Signs-to-diagnosis cheat sheet, investigation guide
This is a shared conversation. Sign in to Orris to start your own chat.