answer ut according to uhs standard pattern of the mbbs final yr
gastric volvulus organoaxial mesenteroaxial diagram

The image consists of a two-part educational composite illustrating organoaxial gastric volvulus. The left panel is a pathophysiology diagram depicting the mechanism of rotation: the stomach rotates along its longitudinal axis (the line connecting the gastroesophageal junction and the pylorus), indicated by a blue arrow. Below the rotation diagram, a second illustration shows the resulting massive gastric distention. The right panel is a coronal CT scan of the abdomen confirming these clinical findings. The CT demonstrates a grossly distended stomach occupying a significant portion of the abdominal cavity, containing mixed air and fluid levels, characteristic of a gastric outlet obstruction. Additionally, the CT reveals hyperdense intraperitoneal fluid within the paracolic gutters and pelvic recesses, highly suggestive of hemoperitoneum. This combination of findings highlights the risk of vascular compromise or splenic ligamentous traction associated with organoaxial torsion. The content is suitable for medical education regarding surgical emergencies and gastrointestinal radiology.

**Imaging Modality:** Fluoroscopic contrast study (Upper Gastrointestinal Series). **Anatomical Region:** Upper abdomen and lower thorax, focusing on the esophagus and stomach. **Observed Pathology:** Organoaxial gastric volvulus associated with a large hiatal hernia. **Characteristic Visual Features:** The image demonstrates a significant portion of the stomach herniated into the thoracic cavity. There is a characteristic rotation of the stomach along its longitudinal axis (the cardiopyloric line). The greater curvature is positioned superiorly to the lesser curvature, creating an "upside-down stomach" appearance. Contrast flow shows tapering and torsion at the point of rotation, with an abnormal horizontal orientation of the gastric body. The esophagus appears slightly dilated proximal to the herniation. **Diagnostic Differentiating Features:** The hallmark of organoaxial volvulus is the rotation around the long axis, distinguishing it from mesenteroaxial volvulus, which involves rotation around the short axis (mesentery). The presence of the stomach within the mediastinum confirms a paraesophageal or large sliding hiatal hernia as the predisposing anatomical defect. Such findings are critical for diagnosing acute or chronic gastric torsion and subsequent gastric outlet obstruction.

This diagnostic image is an upper gastrointestinal (GI) series using fluoroscopic radiography, demonstrating a case of gastric volvulus. The radiograph shows a nasogastric (NG) tube coursing down the esophagus and into the stomach, delivering water-soluble contrast media. Key clinical findings include a significantly distended stomach with the gastric antrum displaced superiorly into the supradiaphragmatic position, indicating an organoaxial or mesenteroaxial rotation. While the contrast fills the herniated antrum, there is a visible absence of contrast passage into the duodenum, characteristic of a high-grade obstruction or volvulus. The thoracic cavity shows a large gas-filled viscus consistent with a paraesophageal hiatal hernia. This image is an educational example of acute gastric volvulus presenting as a surgical emergency, illustrating the classic radiographic signs of abnormal gastric orientation and outflow obstruction within the mediastinum.
perforated peptic ulcer pneumoperitoneum X-ray free air under diaphragm

This diagnostic image is an upright plain chest/abdominal X-ray demonstrating a classic sign of pneumoperitoneum. The radiograph clearly shows crescent-shaped radiolucent areas of free air located immediately beneath both the right and left domes of the diaphragm, often referred to as 'free air under the diaphragm'. The diaphragm appears as a thin, curvilinear radio-opaque line separating the pleural cavity from the abdominal cavity. The right hemidiaphragm is elevated by the gas collection, which is positioned between the liver and the diaphragm. The mediastinal shadow, rib cage, and spine are visible, providing anatomical context. This finding is highly indicative of a hollow viscus perforation, such as a perforated peptic ulcer. The image serves as a critical educational example for surgical triage and radiological identification of gastrointestinal emergencies in pediatric or adult populations.

A semi-upright anteroposterior (AP) chest X-ray demonstrating a large pneumoperitoneum. The primary diagnostic finding is a crescent-shaped radiolucency (free air) located subdiaphragmatically under the right dome of the diaphragm, highlighted by a red arrow. This free air clearly silhouettes the superior margin of the diaphragm and separates it from the underlying liver shadow. The left hemidiaphragm is also visible, with underlying gastric bubble and potentially additional free gas. The lung fields are relatively clear without focal consolidation or pleural effusion. The cardiac silhouette is within normal limits for this projection, though the AP view limits precise assessment of cardiothoracic ratio. Bony structures including the ribs and clavicles appear intact. This classic radiographic sign, known as the cupola sign or subdiaphragmatic free air, is a surgical emergency highly suggestive of a perforated viscus (e.g., perforated peptic ulcer or diverticulitis).

This diagnostic image is an upright abdominal X-ray (radiography) focusing on the upper abdominal region. The primary clinical finding is a prominent crescent-shaped area of increased radiolucency (darkness) located directly beneath the diaphragm, as indicated by the pink arrow. This radiographic sign, known as pneumoperitoneum, represents free intraperitoneal air, which in this clinical context is suggestive of a perforated hollow viscus, such as a peptic ulcer or duodenal perforation. The vertebral column is visible centrally, and the bowel gas pattern shows mottled soft tissue and gas densities. A large, well-defined convex opacity in the lower abdomen suggests the presence of a gravid uterus or a significant intra-abdominal mass, consistent with the patient's late-term pregnancy mentioned in the clinical context. The image serves as a critical educational example of 'free air under the diaphragm,' a surgical emergency requiring immediate intervention such as laparotomy.
| Type | Axis of Rotation | Frequency | Features |
|---|---|---|---|
| Type I - Organoaxial | Long longitudinal axis (GEJ to pylorus) | 59% | Stomach flips anteriorly; closed-loop obstruction; strangulation in 28% |
| Type II - Mesenteroaxial | Short transgastric axis (lesser to greater curvature) | 29% | Stomach folds on itself; usually incomplete and intermittent; infarction uncommon |
| Type III - Combined/Unclassified | Both axes | 12% | Seen in chronic cases |


| Condition | Procedure |
|---|---|
| Primary volvulus | Suture gastropexy to anterior abdominal wall ± gastrostomy tube (open or laparoscopic) |
| Secondary volvulus (paraesophageal hernia) | Repair of diaphragmatic defect + reduction of hernia sac + mobilization of distal esophagus + fundoplication |
| Category | Causes |
|---|---|
| Peptic ulcer (most common) | Duodenal ulcer (DU) > Gastric ulcer (GU); H. pylori, NSAIDs |
| Malignancy | ~6% of perforated GUs are malignant (gastric carcinoma) |
| Trauma | Blunt/penetrating abdominal trauma |
| Iatrogenic | Endoscopy, NG tube insertion |
| Foreign body | Ingested sharp objects |
| Volvulus | As a complication of gastric volvulus |
| Corrosives | Acid/alkali ingestion |
| Stress ulcers | Burns (Curling's ulcer), head injury (Cushing's ulcer) |

| Procedure | Indication |
|---|---|
| Simple closure + Omental (Graham) patch | Most perforations; small to moderate size |
| Laparoscopic repair | Stable patients, small perforations (<10 mm); non-inferior to open (OR for septic complications 0.66) |
| Open laparotomy | Delayed presentation, shock, significant comorbidities, large perforations (>10 mm) |
| Perforation Site | Procedure |
|---|---|
| Small, prepyloric | Simple closure with omental patch |
| Angular notch (lesser curvature) | Antrectomy + lesser curve ulcer excision + Billroth I or II reconstruction |
| Large perforation / suspected malignancy | Gastric resection (distal gastrectomy) |
| Feature | Gastric Volvulus | Gastric Perforation |
|---|---|---|
| Classic triad | Borchardt's triad | Sudden-onset epigastric pain + peritonitis |
| Key investigation | CT scan (swirl sign) | Erect CXR (free air under diaphragm) |
| Emergency management | NG decompression | IV fluids, antibiotics, NG tube |
| Definitive surgery | Gastropexy / hernia repair | Graham patch / antrectomy |
| Post-op | PEG if high risk | H. pylori eradication |
Key exam points: Borchardt's triad for volvulus; Boey score for perforation prognosis; Graham omental patch for DU perforation; antrectomy for angular notch GU; always consider malignancy in perforated GU; H. pylori eradication after repair to prevent recurrence.
make a pdf of above answer precise
ls -la /tmp/workspace/ 2>/dev/null || mkdir -p /tmp/workspace && echo "created"
mkdir -p /tmp/workspace/gastric-surgery && cat > /tmp/workspace/gastric-surgery/make_pdf.py << '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) from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY from reportlab.platypus import PageBreak OUTPUT = "/tmp/workspace/gastric-surgery/Gastric_Volvulus_Perforation_UHS.pdf" doc = SimpleDocTemplate( OUTPUT, pagesize=A4, leftMargin=2*cm, rightMargin=2*cm, topMargin=2*cm, bottomMargin=2*cm, title="Gastric Volvulus & Perforation - UHS MBBS Final Year", author="Orris Medical" ) # ── Colour palette ────────────────────────────────────────────────────────── DARK_BLUE = colors.HexColor("#1a3a5c") MED_BLUE = colors.HexColor("#2563a8") LIGHT_BLUE = colors.HexColor("#dbeafe") ACCENT_RED = colors.HexColor("#b91c1c") ACCENT_YEL = colors.HexColor("#fef9c3") HEADER_BG = colors.HexColor("#1e3a5f") TABLE_HDR = colors.HexColor("#2563a8") TABLE_ALT = colors.HexColor("#f0f6ff") WHITE = colors.white LIGHT_GRAY = colors.HexColor("#f8f9fa") DARK_GRAY = colors.HexColor("#374151") styles = getSampleStyleSheet() # ── Custom styles ──────────────────────────────────────────────────────────── def S(name, **kw): return ParagraphStyle(name, **kw) title_style = S("MainTitle", fontSize=18, textColor=WHITE, fontName="Helvetica-Bold", alignment=TA_CENTER, spaceAfter=4, leading=22) subtitle_style = S("SubTitle", fontSize=11, textColor=colors.HexColor("#bfdbfe"), fontName="Helvetica", alignment=TA_CENTER, spaceAfter=2) part_style = S("PartHeader", fontSize=14, textColor=WHITE, fontName="Helvetica-Bold", alignment=TA_CENTER, spaceAfter=2, spaceBefore=4, leading=18) h1 = S("H1", fontSize=12, textColor=DARK_BLUE, fontName="Helvetica-Bold", spaceBefore=10, spaceAfter=4, leading=15, borderPad=4, leftIndent=0) h2 = S("H2", fontSize=10.5, textColor=MED_BLUE, fontName="Helvetica-Bold", spaceBefore=6, spaceAfter=3, leading=13) body = S("Body", fontSize=9.5, textColor=DARK_GRAY, fontName="Helvetica", spaceBefore=2, spaceAfter=2, leading=13, alignment=TA_JUSTIFY) bullet = S("Bullet", fontSize=9.5, textColor=DARK_GRAY, fontName="Helvetica", spaceBefore=1, spaceAfter=1, leading=12, leftIndent=14, firstLineIndent=-10) note_style = S("Note", fontSize=9, textColor=colors.HexColor("#1e3a5f"), fontName="Helvetica-BoldOblique", spaceBefore=3, spaceAfter=3, leading=12, backColor=ACCENT_YEL, borderPad=5, leftIndent=6) keybox = S("KeyBox", fontSize=9, textColor=colors.HexColor("#7f1d1d"), fontName="Helvetica-Bold", spaceBefore=2, spaceAfter=2, leading=12, backColor=colors.HexColor("#fee2e2"), borderPad=5, leftIndent=6) small = S("Small", fontSize=8.5, textColor=colors.HexColor("#6b7280"), fontName="Helvetica", spaceBefore=1, spaceAfter=1, leading=11) # ── Helpers ────────────────────────────────────────────────────────────────── def hr(color=MED_BLUE, w=1): return HRFlowable(width="100%", thickness=w, color=color, spaceAfter=4, spaceBefore=2) def title_banner(text, sub=""): banner_data = [[Paragraph(text, title_style)]] if sub: banner_data.append([Paragraph(sub, subtitle_style)]) t = Table(banner_data, colWidths=["100%"]) t.setStyle(TableStyle([ ("BACKGROUND", (0,0), (-1,-1), HEADER_BG), ("ROUNDEDCORNERS", [6]), ("TOPPADDING", (0,0), (-1,-1), 10), ("BOTTOMPADDING", (0,0), (-1,-1), 10), ("LEFTPADDING", (0,0), (-1,-1), 8), ("RIGHTPADDING", (0,0), (-1,-1), 8), ])) return t def part_banner(text): t = Table([[Paragraph(text, part_style)]], colWidths=["100%"]) t.setStyle(TableStyle([ ("BACKGROUND", (0,0), (-1,-1), MED_BLUE), ("TOPPADDING", (0,0), (-1,-1), 6), ("BOTTOMPADDING", (0,0), (-1,-1), 6), ("LEFTPADDING", (0,0), (-1,-1), 8), ("RIGHTPADDING", (0,0), (-1,-1), 8), ])) return t def make_table(headers, rows, col_widths=None): """Build a styled table.""" hdr_style = ParagraphStyle("TH", fontSize=9, textColor=WHITE, fontName="Helvetica-Bold", alignment=TA_CENTER, leading=11, spaceAfter=0, spaceBefore=0) cell_style = ParagraphStyle("TD", fontSize=9, textColor=DARK_GRAY, fontName="Helvetica", alignment=TA_LEFT, leading=11, spaceAfter=0, spaceBefore=0) header_row = [Paragraph(h, hdr_style) for h in headers] data = [header_row] for i, row in enumerate(rows): data.append([Paragraph(str(c), cell_style) for c in row]) avail = 17*cm # usable width if col_widths is None: w = avail / len(headers) col_widths = [w]*len(headers) t = Table(data, colWidths=col_widths, repeatRows=1) style_cmds = [ ("BACKGROUND", (0,0), (-1,0), TABLE_HDR), ("TEXTCOLOR", (0,0), (-1,0), WHITE), ("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"), ("FONTSIZE", (0,0), (-1,-1), 9), ("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#94a3b8")), ("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), ] for i in range(1, len(data)): bg = TABLE_ALT if i % 2 == 0 else WHITE style_cmds.append(("BACKGROUND", (0,i), (-1,i), bg)) t.setStyle(TableStyle(style_cmds)) return t def b(text): return Paragraph(f"<b>•</b> {text}", bullet) def bb(label, text): return Paragraph(f"<b>• {label}:</b> {text}", bullet) # ═══════════════════════════════════════════════════════════════════════════ # BUILD STORY # ═══════════════════════════════════════════════════════════════════════════ story = [] # ── TITLE ──────────────────────────────────────────────────────────────────── story.append(title_banner( "GASTRIC VOLVULUS & PERFORATION", "UHS MBBS Final Year | Surgery | Standard Answer Pattern" )) story.append(Spacer(1, 6)) # ══════════════════════════════════════════════════════════════════════════════ # PART 1 — GASTRIC VOLVULUS # ══════════════════════════════════════════════════════════════════════════════ story.append(part_banner("PART 1: GASTRIC VOLVULUS")) story.append(Spacer(1, 4)) # Definition story.append(Paragraph("1. DEFINITION", h1)) story.append(hr()) story.append(Paragraph( "Gastric volvulus is a rare but life-threatening condition in which the stomach " "rotates <b>more than 180° on its own axis</b>, leading to obstruction, strangulation, " "ischemia, and infarction - either intra-abdominally or intrathoracically. " "First described by Berti (1866); first surgical treatment 1897.", body)) story.append(Spacer(1, 4)) # Classification story.append(Paragraph("2. CLASSIFICATION (Singleton's)", h1)) story.append(hr()) cls_table = make_table( ["Type", "Axis of Rotation", "Freq.", "Key Features"], [ ["Type I\nOrganoaxial", "Long longitudinal axis\n(GEJ → Pylorus)", "59%", "Stomach flips anteriorly; closed-loop obstruction; strangulation in 28%"], ["Type II\nMesenteroaxial", "Short transgastric axis\n(lesser ↔ greater curvature)", "29%", "Stomach folds on itself; usually incomplete & intermittent; infarction uncommon"], ["Type III\nCombined", "Both axes", "12%", "Usually chronic cases"], ], col_widths=[3.2*cm, 4.2*cm, 1.5*cm, 8.1*cm] ) story.append(cls_table) story.append(Spacer(1, 4)) # Etiology story.append(Paragraph("3. ETIOLOGY", h1)) story.append(hr()) story.append(Paragraph("<b>A) Primary</b> - Laxity/abnormality of gastric ligaments:", h2)) story.append(b("Gastrocolic, gastrohepatic, gastrosplenic, gastrophrenic ligaments")) story.append(Paragraph("<b>B) Secondary</b> - Due to anatomic defects:", h2)) story.append(bb("Most common (adults)", "Paraesophageal hernia")) story.append(bb("Children (<1 yr)", "Congenital diaphragmatic defects (Foramen of Bochdalek, diaphragmatic eventration) - 10-20% of pediatric cases")) story.append(bb("Others", "Prior gastric surgery, neoplasia, connective tissue disorders")) story.append(Paragraph( "<b>Epidemiology:</b> Peak incidence in the 6th decade; men = women equally.", note_style)) story.append(Spacer(1, 4)) # Clinical Presentation story.append(Paragraph("4. CLINICAL PRESENTATION", h1)) story.append(hr()) story.append(Paragraph("<b>A) ACUTE GASTRIC VOLVULUS</b>", h2)) story.append(Paragraph( "<b>Borchardt's Triad</b> (present in ~70% of acute cases):", body)) tri_table = make_table( ["No.", "Feature", "Explanation"], [ ["1", "Acute-onset severe epigastric / substernal pain", "Radiates to neck & shoulders; mimics MI"], ["2", "Violent retching with minimal/no vomiting", "Dry heaving due to closed-loop obstruction"], ["3", "Inability to pass NG tube into stomach", "Indicates complete volvulus"], ], col_widths=[1.2*cm, 7.5*cm, 8.3*cm] ) story.append(tri_table) story.append(Spacer(1, 3)) story.append(b("Upper abdominal distension and tenderness")) story.append(b("Hematemesis = ominous sign of mucosal ischemia; may progress to hypovolemic shock")) story.append(b("Multi-organ failure in advanced cases")) story.append(Spacer(1, 4)) story.append(Paragraph("<b>B) CHRONIC GASTRIC VOLVULUS</b>", h2)) story.append(b("Intermittent vague upper abdominal symptoms for years")) story.append(b("Pyrosis, early satiety, bloating, shortness of breath, burping")) story.append(b("Symptoms worsen with large meals; vomiting may relieve discomfort")) story.append(b("Often diagnosed incidentally or during workup for PUD / MI / cholecystitis")) story.append(Paragraph("<b>Mortality:</b> <13% in chronic form vs 15-20% in acute form.", note_style)) story.append(Spacer(1, 4)) # Diagnosis story.append(Paragraph("5. DIAGNOSIS", h1)) story.append(hr()) story.append(Paragraph("<b>A) Plain X-ray (Erect Chest + Abdomen):</b>", h2)) story.append(b("Spherical gas-filled viscus in chest or upper abdomen (retrocardiac position)")) story.append(b("Air-fluid level within the viscus")) story.append(b("Paucity of air in rest of GI tract")) story.append(b('"Upside-down stomach" - greater curvature above lesser curvature')) story.append(b("In mesenteroaxial: spherical stomach on supine film")) story.append(Paragraph("<b>B) CT Scan (Investigation of Choice):</b>", h2)) story.append(b("<b>Swirl sign</b> of esophagus and stomach (pathognomonic)")) story.append(b("Dilated, distended stomach")) story.append(b("Pneumatosis (gastric wall air) = necrosis; Free air = perforation")) story.append(b("Identifies associated defects (paraesophageal hernia)")) story.append(b("Excludes other diagnoses")) story.append(Paragraph("<b>C) Contrast Study (Barium/Water-Soluble):</b>", h2)) story.append(b('"Beaking" / torsion at rotation point; no passage of contrast into duodenum')) story.append(Spacer(1, 4)) # Surgical Management - Volvulus story.append(Paragraph("6. SURGICAL MANAGEMENT", h1)) story.append(hr()) story.append(Paragraph("<b>Step 1 - Initial Resuscitation (ALL patients):</b>", h2)) story.append(b("IV fluids + electrolyte correction")) story.append(b("Analgesics and antiemetics")) story.append(b("Attempted NG tube decompression (may spontaneously detorse)")) story.append(b("If NG fails: Endoscopic decompression (limit insufflation, assess mucosa, place NG)")) story.append(Spacer(1, 3)) story.append(Paragraph("<b>Step 2 - Indications for Immediate Surgery:</b>", h2)) story.append(b("Failed NG / endoscopic decompression")) story.append(b("Gastric perforation")) story.append(b("Severe sepsis or refractory hypotension")) story.append(b("Signs of gastric ischemia / necrosis")) story.append(Spacer(1, 3)) story.append(Paragraph("<b>Step 3 - Operative Management:</b>", h2)) op_table = make_table( ["Patient Status", "Approach", "Procedure"], [ ["Unstable", "Urgent open laparotomy", "Detorse stomach → assess viability → resect ischemic areas\nIf entire stomach necrotic: total gastrectomy + jejunostomy + esophagostomy (reconstruction later)"], ["Stable - Primary volvulus", "Open or laparoscopic", "Suture gastropexy to anterior abdominal wall ± gastrostomy tube"], ["Stable - Secondary (PEH)", "Open or laparoscopic", "Repair paraesophageal hernia + reduce hernia sac + mobilize distal esophagus + fundoplication"], ["High surgical risk", "Endoscopic", "Endoscopic detorsion + 2 PEG tubes for fixation (prevents re-rotation)"], ], col_widths=[3.5*cm, 4.5*cm, 9*cm] ) story.append(op_table) story.append(Spacer(1, 6)) # ══════════════════════════════════════════════════════════════════════════════ # PAGE BREAK before Part 2 # ══════════════════════════════════════════════════════════════════════════════ story.append(PageBreak()) # ══════════════════════════════════════════════════════════════════════════════ # PART 2 — GASTRIC PERFORATION # ══════════════════════════════════════════════════════════════════════════════ story.append(part_banner("PART 2: GASTRIC PERFORATION")) story.append(Spacer(1, 4)) # Definition story.append(Paragraph("1. DEFINITION", h1)) story.append(hr()) story.append(Paragraph( "Gastric perforation is a <b>full-thickness breach of the gastric wall</b> allowing " "gastric contents to escape into the peritoneal cavity, most commonly due to peptic ulcer disease.", body)) story.append(Spacer(1, 4)) # Etiology story.append(Paragraph("2. ETIOLOGY", h1)) story.append(hr()) et_table = make_table( ["Category", "Details"], [ ["Peptic ulcer disease (MC)", "H. pylori, NSAIDs; DU > GU; ~20% of perforations are GU"], ["Malignancy", "~6% of perforated GUs are malignant (gastric carcinoma)"], ["Gastric volvulus", "Ischemia → necrosis → perforation"], ["Trauma", "Blunt / penetrating abdominal trauma"], ["Iatrogenic", "Endoscopy, NG tube, surgical injury"], ["Corrosives", "Acid / alkali ingestion"], ["Stress ulcers", "Burns (Curling's ulcer), Head injury (Cushing's ulcer)"], ["Foreign body", "Ingested sharp objects"], ], col_widths=[5*cm, 12*cm] ) story.append(et_table) story.append(Spacer(1, 4)) # Clinical Presentation story.append(Paragraph("3. CLINICAL PRESENTATION", h1)) story.append(hr()) story.append(Paragraph("<b>A) Symptoms:</b>", h2)) story.append(b("<b>Sudden-onset severe epigastric pain</b> (knife-like) - rapidly becomes generalized")) story.append(b("Nausea and vomiting")) story.append(b("History: PUD, NSAID / steroid use, smoking")) story.append(Paragraph("<b>B) Signs:</b>", h2)) story.append(b("Patient lies still (peritonism worsens with movement)")) story.append(b("<b>Board-like rigidity</b> - hallmark of generalized peritonitis")) story.append(b("Guarding and rebound tenderness")) story.append(b("<b>Obliteration of liver dullness</b> on percussion (free air under diaphragm)")) story.append(b("Absent bowel sounds (paralytic ileus)")) story.append(b("Tachycardia, fever → later: septic shock")) story.append(Paragraph("<b>C) Three Stages of Progression:</b>", h2)) stage_table = make_table( ["Stage", "Timing", "Pathology", "Clinical Features"], [ ["1", "0-6 hours", "Chemical peritonitis", "Severe localized epigastric pain, rigidity"], ["2", "6-12 hours", "Dilution of chemical stimulus", "Relative improvement, patient may feel better"], ["3", ">12 hours", "Bacterial peritonitis", "Generalized sepsis, deterioration, shock"], ], col_widths=[1.5*cm, 2.5*cm, 4.5*cm, 8.5*cm] ) story.append(stage_table) story.append(Spacer(1, 4)) # Diagnosis - Perforation story.append(Paragraph("4. DIAGNOSIS", h1)) story.append(hr()) story.append(Paragraph("<b>A) Erect Chest X-ray / Upright Abdominal X-ray:</b>", h2)) story.append(b("<b>Free air (pneumoperitoneum) under diaphragm</b> - present in 70-80%")) story.append(b("Crescent-shaped radiolucency between liver and right dome of diaphragm (Cupola sign)")) story.append(b("Absent in ~20-30% cases - do not rule out perforation on negative X-ray")) story.append(Paragraph("<b>B) CT Scan Abdomen (most sensitive):</b>", h2)) story.append(b("Free intraperitoneal air and peritoneal fluid")) story.append(b("Localizes site of perforation")) story.append(b("Identifies associated pathology")) story.append(Paragraph("<b>C) Laboratory:</b>", h2)) story.append(b("Leukocytosis (WBC >10,000)")) story.append(b("Raised serum amylase (chemical peritonitis)")) story.append(b("ABG: Metabolic acidosis in advanced sepsis")) story.append(b("Raised creatinine in septic shock")) story.append(Spacer(1, 4)) # Surgical Management - Perforation story.append(Paragraph("5. SURGICAL MANAGEMENT", h1)) story.append(hr()) story.append(Paragraph("<b>A) Pre-operative Resuscitation (PULP Protocol):</b>", h2)) story.append(b("IV fluids - goal-directed fluid therapy")) story.append(b("IV broad-spectrum antibiotics (initiated immediately)")) story.append(b("NG tube (double-barreled) insertion + urinary catheter")) story.append(b("IV Proton Pump Inhibitor (PPI)")) story.append(b("Electrolyte correction; respiratory and circulatory support")) story.append(Paragraph( "<b>KEY:</b> Surgery within 6 hours → mortality 17%; without protocol → mortality 27% (Danish multicenter study, n=2619)", note_style)) story.append(Spacer(1, 4)) story.append(Paragraph("<b>B) Prognostic Scoring:</b>", h2)) boey_table = make_table( ["Boey Score (3 factors)", "PULP Score Variables"], [ ["1. Preoperative shock", "Age >65, Active malignancy, Cirrhosis, Glucocorticoid use"], ["2. Major medical illness (ASA >1)", "Perforation >24 hrs, Shock, Raised creatinine, ASA >1"], ["3. Perforation >12 hours", "AUROC = 0.83 for predicting mortality"], ], col_widths=[8.5*cm, 8.5*cm] ) story.append(boey_table) story.append(Spacer(1, 4)) story.append(Paragraph("<b>C) Operative Options:</b>", h2)) story.append(Paragraph("<b>For Perforated Duodenal Ulcer (DU) / Juxta-pyloric Ulcer:</b>", ParagraphStyle("h3", fontSize=9.5, textColor=DARK_BLUE, fontName="Helvetica-Bold", spaceBefore=4, spaceAfter=2, leading=12))) du_table = make_table( ["Procedure", "Indication"], [ ["Simple closure + <b>Graham Omental Patch</b>", "Most perforations; preferred for small to moderate size"], ["Laparoscopic repair", "Stable patients; small perforations (<10 mm); non-inferior to open repair " "(OR for septic complications 0.66, pulmonary complications 0.43)"], ["Open laparotomy", "Delayed presentation, shock, significant comorbidities, large perforations (>10 mm)"], ], col_widths=[6*cm, 11*cm] ) story.append(du_table) story.append(Spacer(1, 3)) story.append(Paragraph("<b>For Perforated Gastric Ulcer (GU):</b>", ParagraphStyle("h3b", fontSize=9.5, textColor=DARK_BLUE, fontName="Helvetica-Bold", spaceBefore=4, spaceAfter=2, leading=12))) gu_table = make_table( ["Location", "Procedure"], [ ["Small / prepyloric", "Simple closure with omental patch"], ["Angular notch (lesser curvature)", "Antrectomy + lesser curve ulcer excision + Billroth I or II reconstruction"], ["Large / suspected malignancy", "Gastric resection (distal gastrectomy)"], ], col_widths=[5*cm, 12*cm] ) story.append(gu_table) story.append(Paragraph( "<b>IMPORTANT:</b> ~6% of perforated GUs are malignant - always send tissue for biopsy.", keybox)) story.append(Spacer(1, 4)) story.append(Paragraph("<b>D) Post-operative Management:</b>", h2)) story.append(b("IV PPI + conversion to oral PPI")) story.append(b("<b>H. pylori eradication</b> if Hp-positive: reduces ulcer relapse from 38.1% → 4.8% at 1 year")) story.append(b("Continued IV antibiotics")) story.append(b("Nutritional support")) story.append(Spacer(1, 4)) story.append(Paragraph("<b>E) Complications:</b>", h2)) comp_table = make_table( ["Early", "Late"], [ ["Septic shock", "Adhesive intestinal obstruction"], ["Generalized peritonitis", "Re-operation (17% in large series)"], ["Intra-abdominal abscess", "Malnutrition / dumping syndrome"], ], col_widths=[8.5*cm, 8.5*cm] ) story.append(comp_table) story.append(Paragraph( "<b>Mortality:</b> 90-day mortality ~25.5% in large Danish series (726 patients, 2011-2013). " "Re-operation required in 17.1%; one-third due to persistent leaks.", note_style)) story.append(Spacer(1, 6)) # ══════════════════════════════════════════════════════════════════════════════ # SUMMARY TABLE # ══════════════════════════════════════════════════════════════════════════════ story.append(Paragraph("QUICK COMPARISON SUMMARY", h1)) story.append(hr(color=ACCENT_RED, w=1.5)) sum_table = make_table( ["Feature", "Gastric Volvulus", "Gastric Perforation"], [ ["Classic presentation", "Borchardt's Triad", "Sudden knife-like epigastric pain + peritonitis"], ["Key clinical sign", "Inability to pass NG tube", "Board-like rigidity + obliterated liver dullness"], ["Key investigation", "CT scan (Swirl sign)", "Erect CXR (free air under diaphragm)"], ["Emergency Rx", "NG decompression ± endoscopy", "IV fluids, antibiotics, NG tube, surgery within 6 hrs"], ["Definitive surgery", "Gastropexy / hernia repair", "Graham patch (DU) / Antrectomy (angular GU)"], ["Post-op essential", "Fixation prevents recurrence", "H. pylori eradication (relapse ↓ from 38% → 5%)"], ["Mortality", "15-20% (acute)", "~25.5% (90-day)"], ], col_widths=[4.5*cm, 6.25*cm, 6.25*cm] ) story.append(sum_table) story.append(Spacer(1, 6)) # ── KEY EXAM POINTS ───────────────────────────────────────────────────────── story.append(Paragraph( "★ KEY EXAM POINTS: Borchardt's triad for volvulus diagnosis | Swirl sign on CT | " "Boey score for perforation prognosis | Graham patch for DU perforation | " "Antrectomy for angular notch GU | Always biopsy perforated GU (6% malignant) | " "H. pylori eradication after repair | Surgery within 6 hrs reduces mortality", keybox)) story.append(Spacer(1, 4)) story.append(Paragraph( "Sources: Sabiston Textbook of Surgery | Yamada's Textbook of Gastroenterology | " "Sleisenger & Fordtran's GI and Liver Disease", small)) # ── BUILD ──────────────────────────────────────────────────────────────────── doc.build(story) print(f"PDF created: {OUTPUT}") PYEOF echo "Script written successfully"
cd /tmp/workspace/gastric-surgery && python make_pdf.py
ls -lh /tmp/workspace/gastric-surgery/Gastric_Volvulus_Perforation_UHS.pdf
Gastric Volvulus Perforation UHS
PDF Document · PDF