Meckel diverticulum for 10 marks wifrom sabiston
| Feature | Detail |
|---|---|
| Incidence | ~2% of the population |
| Location | 2 feet (45-60 cm) proximal to the ileocecal valve |
| Length | ~2 inches (3-6 cm) |
| Site | Antimesenteric border of the ileum |
| Ectopic tissue | ~50% contain it |
| Age of presentation | Most before age 2 |
| Sex predilection | Males more commonly symptomatic |
| Tumor Type | Frequency |
|---|---|
| NET (neuroendocrine tumor) | 33%-44% - most common malignancy |
| Leiomyosarcoma | 18%-25% |
| Adenocarcinoma | 12%-16% (from gastric mucosa) |
| GIST | 12% |
| Lymphoma / Pancreatic malignancies | Less frequent |
| Investigation | Comment |
|---|---|
| Plain X-ray, CT, Ultrasound | Rarely helpful |
| Tc-99m pertechnetate scintigraphy (Meckel scan) | Most accurate test in children: sensitivity 85%, specificity 95%, accuracy 90% |
| Meckel scan in adults | Sensitivity falls to ~63% (less gastric mucosa) |
| Cimetidine enhancement | Blocks acid secretion without affecting radionuclide uptake → increases radionuclide concentration in diverticulum wall → improves sensitivity |
| Barium contrast / Mesenteric arteriography / Double-balloon endoscopy | For false-negative Meckel scans |
| Angiography | Useful in active acute hemorrhage |
Note: Surgical intervention should NOT be delayed for imaging in hemodynamically unstable patients with active hemorrhage.
Classified stoma and colostomy with therapuetic uses and techqine with diagram amd from standard text books
| Type | Organ | Effluent |
|---|---|---|
| Ileostomy | Small bowel (ileum) | Liquid, green, enzyme-rich |
| Colostomy | Large bowel (colon) | Semi-formed to solid |
| Urostomy / Ileal conduit | Urinary tract | Urine |
| Type | Description | Common Indication |
|---|---|---|
| Temporary (diverting) | Closed at a later date once indication resolves | Protect anastomosis, trauma, diverticulitis |
| Permanent | Never reversed | APR, total proctocolectomy, incontinence |

| Configuration | Description |
|---|---|
| End stoma | One limb of divided bowel brought out; distal bowel removed or closed as Hartmann's pouch |
| Loop stoma | Loop of bowel exteriorised over a rod/bridge; both limbs open (proximal functional, distal non-functional) |
| End-loop stoma | End of bowel brought through aperture with adjacent loop sutured alongside |
| Double-barrel (Paul-Mikulicz) | Both cut ends brought out side by side when patient too ill for anastomosis |
| Continent stoma | Internal pouch (Kock pouch/ileoanal) with valve mechanism - catheterised to empty |
| Site | Effluent | Notes |
|---|---|---|
| Caecostomy / Ascending | Liquid | More electrolyte disturbance |
| Transverse colostomy | Semi-liquid | Seldom used now (prone to prolapse, difficult to pouch) |
| Descending colostomy | Semi-formed | Preferred over transverse |
| Sigmoid colostomy | Formed | Best formed stool; most common permanent colostomy |



| Complication | Notes |
|---|---|
| Ischaemia / Necrosis | Inspect day 1 postop; use proctoscope to assess viability below fascia; urgent surgery if below fascia |
| Mucocutaneous separation | Usually managed conservatively with stoma care |
| Prolapse | More common with loop stomas, especially transverse; treatment is reversal or conversion to end-stoma |
| Retraction | Mainly in obese patients; may require revision |
| Stenosis | Minor - dilatation; severe - revision surgery |
| Parastomal hernia | Up to 50% long-term; simple repair has ~100% recurrence; needs mesh repair or stoma relocation |
| Skin irritation | Most common; managed by stoma nurses |
| Feature | Ileostomy | Colostomy |
|---|---|---|
| Site | Right iliac fossa | Left iliac fossa (end); variable (loop) |
| Spout | Yes (3 cm above skin) | Flush or slightly everted |
| Effluent | Liquid, green | Formed / semi-formed |
| Electrolyte risk | Higher | Lower |
Key surgical teaching: "It is imperative that every stoma must be well made. Proper stoma construction as a prophylactic measure is vastly superior to any therapeutic options to improve upon a suboptimally constructed stoma." - Sabiston
Add stoma marking in this and prars stoma hernia management and causes also




| Type | Effluent | Site |
|---|---|---|
| Ileostomy | Liquid, green, caustic | Right iliac fossa |
| Colostomy | Semi-formed to solid | Left iliac fossa (end); variable (loop) |
| Urostomy/Ileal conduit | Urine | Right iliac fossa |
| Temporary | Permanent |
|---|---|
| Protect anastomosis | APR for low rectal cancer |
| Trauma | Ulcerative colitis / FAP |
| Diverticulitis | Severe incontinence |
| Downstaging CRT | Bedridden patients |

| Configuration | Description |
|---|---|
| End stoma | Single limb; distal bowel removed or closed (Hartmann's) |
| Loop stoma | Loop brought out over a rod; two openings (proximal = functional) |
| End-loop stoma | End of bowel with adjacent loop sutured to it |
| Double-barrel | Both cut ends brought out side-by-side (Paul-Mikulicz) |
| Continent stoma | Internal pouch with valve; emptied by catheter |
| Type | Use | Site |
|---|---|---|
| Loop colostomy | Temporary diversion, protect anastomosis, trauma | Sigmoid or transverse |
| End colostomy | After APR, Hartmann's; permanent | Left iliac fossa |
| Double-barrel | Emergency resection, too ill for anastomosis | Variable |
| Palliative colostomy | Unresectable rectal cancer, obstruction | Sigmoid |
| Technique | Description | Recurrence |
|---|---|---|
| Keyhole / Slit mesh | Mesh placed with central aperture to accommodate bowel; mesh can be placed in onlay, retromuscular, or intraperitoneal positions | 21-73% |
| Sugarbaker technique | Large underlay mesh placed intraperitoneally; stoma limb exits the mesh lateral to the fascial defect (no central hole); bowel is sandwiched between mesh and abdominal wall | 7-15% - best results |
| Modified laparoscopic Sugarbaker | Laparoscopic version of Sugarbaker; equivalent recurrence to open repair | 7-15% |
| Feature | Detail |
|---|---|
| Incidence | >50% at 5 years |
| Most common symptom | Appliance leakage / difficulty pouching |
| Best investigation | CT abdomen (defines anatomy, detects obstruction) |
| Conservative | Hernia belt, appliance revision |
| Best surgical option | Sugarbaker mesh (lowest recurrence 7-15%) |
| Avoid | Simple suture repair alone (~100% recurrence) |
| Prevent | Correct siting + rectus passage + mesh at creation |
Add stoma care also in this
| Phase | Role |
|---|---|
| Preoperative | Counselling, explanation, reassurance; stoma siting and marking |
| Intraoperative | Advises on site if marking not done |
| Early postoperative | Appliance fitting, monitoring stoma viability, patient teaching |
| Long-term | Troubleshooting complications, appliance advice, psychological support, liaison with support groups |

| Type | Description | Used For |
|---|---|---|
| One-piece | Bag and flange are inseparable; non-irritant adhesive back; hole cut to fit stoma | Simple, disposable |
| Two-piece | Flange (baseplate) and bag are separable; bag can be removed and replaced without disturbing the skin seal | Better for skin protection; bag changed more frequently than baseplate |
| Drainable bag | Open bottom with clip/tie; emptied when half-full | Ileostomy (liquid output), transverse colostomy |
| Non-drainable bag | Closed end; disposed after each use | Sigmoid colostomy (formed stool) |

| Accessory | Purpose |
|---|---|
| Karaya gum / Karaya paste | Skin protectant; fills skin irregularities between flange and stoma to prevent leakage; applied on the skin side of the gasket |
| Stomahesive paste (sodium carboxymethyl cellulose + gelatin + pectin + polyisobutylene) | Non-reactive barrier; sticks to moist surfaces; moulded to skin contours; cuts with scissors; used as baseplate material |
| Barrier creams | Protect peristomal skin from effluent excoriation |
| Charcoal filter / Filtrodor | Punctured into the bag; allows flatus to escape while trapping odour |
| Deodorants | Reduce odour from stoma effluent |
| Waist belt | Provides additional security to prevent bag detachment |
| Hernia support belt | Used when parastomal hernia is present; reduces bulging and aids appliance adhesion |
| Plastic cap | Used by patients on the natural or irrigation method of colostomy management between evacuations |
| Feature | Detail |
|---|---|
| Output | ~500 ml/day (normal); >1000 ml/day = high output |
| Electrolyte content | Na 110-120 mmol/L; K 6-12 mmol/L |
| Hazard | Proteolytic enzymes in effluent digest skin rapidly - bag must not leak |
| Flange change | Every 4-5 days; not more often to avoid skin trauma |
| Bag emptying | When half-full - prevents weight detaching flange |
| Spout | 2-3 cm above skin - directs effluent into bag without skin contact |
| Problem | Cause | Management |
|---|---|---|
| Excoriation / chemical dermatitis | Effluent contact with skin (leakage); most severe with ileostomy | Ensure correct appliance size; use Stomahesive or karaya as barrier; barrier creams |
| Allergic contact dermatitis | Allergy to adhesive in appliance | Skin reaction matches the shape of the appliance; remove appliance; use Stomahesive; may need steroid cream |
| Mechanical trauma | Overly frequent appliance changes; rough skin cleaning | Gentle cleaning with warm water; reduce frequency of flange changes |
| Fungal infection | Secondary candidal infection in moist, excoriated skin | Antifungal powder applied to skin under the flange |
| Maceration | Moisture from leakage | Improve bag seal; use Stomahesive paste to fill contour gaps |
| Leakage | Poorly fitting appliance; irregular skin contour; stoma retraction; ulceration | Correct appliance size; karaya/Stomahesive paste; revise stoma if retracted |
| Type of Stoma | Dietary Advice |
|---|---|
| Colostomy | Regular meals; avoid gas-producing foods (beans, cabbage, onions, carbonated drinks) if bothersome; avoid foods causing diarrhoea |
| Ileostomy | Avoid large boluses of fibrous/high-residue food (risk of food bolus obstruction at fascia); ensure adequate fluid and salt intake to compensate for losses; restrict high-oxalate foods (spinach, leafy greens) to reduce renal stone risk |
| Both | Chew food thoroughly; avoid dehydration; reintroduce foods one at a time postoperatively |
| Phase | Key Action |
|---|---|
| Preoperative | Counselling + stoma siting by ET nurse |
| Day 0-1 | Translucent drainable bag; inspect stoma viability |
| Day 1-10 | Monitor output; electrolyte balance; remove mucocutaneous sutures day 10 |
| Weeks 1-4 | Teach appliance management; stoma shrinks - resize appliance |
| Long-term (colostomy) | Natural / appliance / irrigation method |
| Long-term (ileostomy) | Drainable bag; flange every 4-5 days; skin protection |
| Ongoing | Skin care, diet, psychological support, surveillance for complications |
Create a summary document of stoma marking, classification and care for study
mkdir -p /home/daytona/workspace/stoma-study && ls /home/daytona/workspace/stoma-study
~/stoma-study/generate.js
const {
Document, Packer, Paragraph, TextRun, Table, TableRow, TableCell,
HeadingLevel, AlignmentType, BorderStyle, WidthType, ShadingType,
VerticalAlign, PageNumber, Header, Footer, PageBreak,
TableOfContents, StyleLevel
} = require('docx');
const fs = require('fs');
// ── Colour palette ──────────────────────────────────────────────────
const TEAL = "1B6CA8"; // heading 1
const STEEL = "2E86AB"; // heading 2
const SLATE = "3D5A80"; // heading 3
const LIGHT_BG = "E8F4FD"; // table header fill
const ALT_ROW = "F5FAFE"; // alternate table row
const WHITE = "FFFFFF";
const DARK_TXT = "1A1A2E";
// ── Helpers ──────────────────────────────────────────────────────────
function h1(text) {
return new Paragraph({
heading: HeadingLevel.HEADING_1,
spacing: { before: 360, after: 120 },
children: [new TextRun({
text, bold: true, size: 32, color: WHITE,
font: "Calibri"
})],
shading: { type: ShadingType.SOLID, color: TEAL },
indent: { left: 120, right: 120 },
});
}
function h2(text) {
return new Paragraph({
heading: HeadingLevel.HEADING_2,
spacing: { before: 280, after: 80 },
children: [new TextRun({
text, bold: true, size: 26, color: WHITE, font: "Calibri"
})],
shading: { type: ShadingType.SOLID, color: STEEL },
indent: { left: 80 },
});
}
function h3(text) {
return new Paragraph({
heading: HeadingLevel.HEADING_3,
spacing: { before: 200, after: 60 },
children: [new TextRun({
text, bold: true, size: 22, color: WHITE, font: "Calibri"
})],
shading: { type: ShadingType.SOLID, color: SLATE },
indent: { left: 60 },
});
}
function para(text, { bold = false, italic = false, size = 20, indent = 0, spacing = 160 } = {}) {
return new Paragraph({
spacing: { before: 60, after: spacing },
indent: indent ? { left: indent } : {},
children: [new TextRun({ text, bold, italic, size, color: DARK_TXT, font: "Calibri" })]
});
}
function bullet(text, level = 0) {
return new Paragraph({
bullet: { level },
spacing: { before: 40, after: 40 },
indent: { left: 360 + level * 360 },
children: [new TextRun({ text, size: 20, color: DARK_TXT, font: "Calibri" })]
});
}
function divider() {
return new Paragraph({
spacing: { before: 40, after: 40 },
border: { bottom: { style: BorderStyle.SINGLE, size: 6, color: TEAL } },
children: []
});
}
function keyBox(label, value) {
return new Paragraph({
spacing: { before: 60, after: 60 },
indent: { left: 200 },
shading: { type: ShadingType.SOLID, color: LIGHT_BG },
children: [
new TextRun({ text: `${label}: `, bold: true, size: 20, color: TEAL, font: "Calibri" }),
new TextRun({ text: value, size: 20, color: DARK_TXT, font: "Calibri" })
]
});
}
function pageBreak() {
return new Paragraph({ children: [new PageBreak()] });
}
// ── Table builder ─────────────────────────────────────────────────────
function makeTable(headers, rows, colWidths) {
const totalWidth = colWidths.reduce((a, b) => a + b, 0);
const makeBorder = () => ({ style: BorderStyle.SINGLE, size: 4, color: "AACCE0" });
const headerCells = headers.map((h, i) =>
new TableCell({
width: { size: colWidths[i], type: WidthType.DXA },
shading: { type: ShadingType.SOLID, color: TEAL },
verticalAlign: VerticalAlign.CENTER,
borders: { top: makeBorder(), bottom: makeBorder(), left: makeBorder(), right: makeBorder() },
children: [new Paragraph({
alignment: AlignmentType.CENTER,
children: [new TextRun({ text: h, bold: true, size: 18, color: WHITE, font: "Calibri" })]
})]
})
);
const dataRows = rows.map((row, ri) =>
new TableRow({
children: row.map((cell, ci) =>
new TableCell({
width: { size: colWidths[ci], type: WidthType.DXA },
shading: { type: ShadingType.SOLID, color: ri % 2 === 0 ? WHITE : ALT_ROW },
verticalAlign: VerticalAlign.CENTER,
borders: { top: makeBorder(), bottom: makeBorder(), left: makeBorder(), right: makeBorder() },
children: [new Paragraph({
children: [new TextRun({ text: cell, size: 18, color: DARK_TXT, font: "Calibri" })]
})]
})
)
})
);
return new Table({
width: { size: totalWidth, type: WidthType.DXA },
rows: [new TableRow({ children: headerCells, tableHeader: true }), ...dataRows]
});
}
// ── Cover Page ───────────────────────────────────────────────────────
function coverPage() {
return [
new Paragraph({ spacing: { before: 2000 }, children: [] }),
new Paragraph({
alignment: AlignmentType.CENTER,
spacing: { before: 200, after: 200 },
shading: { type: ShadingType.SOLID, color: TEAL },
children: [new TextRun({ text: "STOMA", bold: true, size: 72, color: WHITE, font: "Calibri" })]
}),
new Paragraph({
alignment: AlignmentType.CENTER,
spacing: { before: 80, after: 80 },
children: [new TextRun({ text: "Classification • Marking • Care • Parastomal Hernia", bold: true, size: 28, color: STEEL, font: "Calibri" })]
}),
new Paragraph({
alignment: AlignmentType.CENTER,
spacing: { before: 120, after: 120 },
children: [new TextRun({ text: "A Comprehensive Surgical Study Guide", italic: true, size: 24, color: SLATE, font: "Calibri" })]
}),
divider(),
new Paragraph({
alignment: AlignmentType.CENTER,
spacing: { before: 200, after: 40 },
children: [new TextRun({ text: "Sources:", bold: true, size: 22, color: TEAL, font: "Calibri" })]
}),
new Paragraph({
alignment: AlignmentType.CENTER,
spacing: { before: 20, after: 20 },
children: [new TextRun({ text: "Sabiston Textbook of Surgery", italic: true, size: 20, color: DARK_TXT, font: "Calibri" })]
}),
new Paragraph({
alignment: AlignmentType.CENTER,
spacing: { before: 20, after: 20 },
children: [new TextRun({ text: "Bailey & Love's Short Practice of Surgery, 28th Ed.", italic: true, size: 20, color: DARK_TXT, font: "Calibri" })]
}),
new Paragraph({
alignment: AlignmentType.CENTER,
spacing: { before: 20, after: 20 },
children: [new TextRun({ text: "Fischer's Mastery of Surgery, 8th Ed.", italic: true, size: 20, color: DARK_TXT, font: "Calibri" })]
}),
new Paragraph({
alignment: AlignmentType.CENTER,
spacing: { before: 20, after: 20 },
children: [new TextRun({ text: "Pye's Surgical Handicraft, 22nd Ed.", italic: true, size: 20, color: DARK_TXT, font: "Calibri" })]
}),
pageBreak()
];
}
// ─────────────────────────────────────────────────────────────────────
// CONTENT SECTIONS
// ─────────────────────────────────────────────────────────────────────
function section1_definition() {
return [
h1("SECTION 1: DEFINITION & OVERVIEW"),
para("A stoma (Greek: 'mouth') is a surgically created opening between a hollow organ and the body surface. In colorectal surgery, it most commonly refers to an opening of the bowel (intestinal stoma) or urinary tract (urostomy) onto the anterior abdominal wall."),
para("Key principle: Every stoma must be well made. Proper stoma construction as a prophylactic maneuver is vastly superior to any therapeutic options to attempt to improve upon a suboptimally constructed stoma. (Sabiston)", { italic: true }),
divider()
];
}
function section2_classification() {
return [
h1("SECTION 2: CLASSIFICATION OF STOMAS"),
h2("A. By Content Drained"),
makeTable(
["Type", "Organ Used", "Effluent", "Site"],
[
["Ileostomy", "Ileum (small bowel)", "Liquid, green, enzyme-rich", "Right iliac fossa"],
["Colostomy", "Colon (large bowel)", "Semi-formed to solid", "Left iliac fossa (end)"],
["Urostomy / Ileal conduit", "Urinary tract via ileal segment", "Urine", "Right iliac fossa"],
],
[2000, 2200, 2400, 2200]
),
new Paragraph({ spacing: { before: 120 }, children: [] }),
h2("B. By Duration"),
makeTable(
["Temporary", "Permanent"],
[
["Protect distal anastomosis", "APR for low rectal / anal canal cancer"],
["Traumatic bowel/rectal injury", "Total proctocolectomy (UC, FAP)"],
["Acute diverticulitis / Hartmann's", "Faecal incontinence, unfit for repair"],
["Downstaging chemoradiotherapy", "Hirschsprung's (staged - later made permanent)"],
["High anal fistula treatment", "Bedridden / neurologically compromised patients"],
],
[4400, 4400]
),
new Paragraph({ spacing: { before: 120 }, children: [] }),
h2("C. By Configuration (Sabiston Fig. 95.18)"),
makeTable(
["Type", "Description", "Key Use"],
[
["End stoma", "Single limb exteriorised; distal bowel removed or closed as Hartmann's pouch", "Permanent colostomy after APR; permanent ileostomy"],
["Loop stoma", "Loop of bowel brought out over a rod/bridge; two openings - proximal (active) and distal (inactive)", "Temporary diversion; protect anastomosis"],
["End-loop stoma", "Cut end of bowel with adjacent loop sutured alongside it", "When end stoma has insufficient length to reach skin"],
["Double-barrel (Paul-Mikulicz)", "Both cut ends brought out side by side as two adjacent stomas", "Emergency resection; patient too ill for anastomosis"],
["Continent stoma (Kock pouch)", "Internal reservoir with nipple valve; emptied by catheter", "Avoids external bag; requires motivated patient"],
],
[2000, 4000, 2800]
),
new Paragraph({ spacing: { before: 120 }, children: [] }),
h2("D. Colostomy - By Site"),
makeTable(
["Site", "Effluent Consistency", "Notes"],
[
["Caecostomy / Ascending", "Liquid, enzyme-rich", "High electrolyte loss; rarely used"],
["Transverse", "Semi-liquid", "Seldom used now - prone to prolapse; difficult to pouch (belt line)"],
["Descending", "Semi-formed", "Better than transverse; more of colon in circuit"],
["Sigmoid", "Formed", "Best formed stool; ideal for permanent end colostomy"],
],
[2200, 2400, 4200]
),
new Paragraph({ spacing: { before: 120 }, children: [] }),
h2("Ileostomy vs Colostomy - Quick Comparison"),
makeTable(
["Feature", "Ileostomy", "Colostomy"],
[
["Position", "Right iliac fossa", "Left iliac fossa (end); variable (loop)"],
["Spout", "YES - 2-3 cm above skin (prevents skin contact)", "Flush or slightly everted only"],
["Effluent", "Liquid, green, caustic enzymes", "Formed / semi-formed"],
["Electrolyte risk", "HIGH (sodium, potassium loss)", "Lower"],
["Skin risk", "HIGH - proteolytic enzymes destroy skin on contact", "Lower"],
["Bag type", "Always drainable bag", "Non-drainable (sigmoid); drainable (transverse/right)"],
["Output", "~500 ml/day (normal)", "1-3 actions/day"],
],
[2400, 2800, 2800]
),
new Paragraph({ spacing: { before: 120 }, children: [] }),
pageBreak()
];
}
function section3_marking() {
return [
h1("SECTION 3: STOMA SITING AND MARKING"),
para("Preoperative stoma marking is one of the most critical steps. A poorly sited stoma causes appliance leakage, skin excoriation, and severely impaired quality of life - complications that are largely preventable."),
h2("Who Marks the Stoma?"),
bullet("Ideally: trained Enterostomal Therapy (ET) nurse / Stoma Care Nurse - preoperatively"),
bullet("If no ET nurse available: the operating surgeon must perform siting"),
bullet("Every GI surgeon must know stoma siting principles (Fischer's Mastery)"),
new Paragraph({ spacing: { before: 120 }, children: [] }),
h2("Four-Step Siting Process"),
h3("Step 1 - Assess in Three Positions"),
bullet("Supine (lying)", 0),
bullet("Sitting (most important - folds change dramatically)", 0),
bullet("Standing and bending", 0),
h3("Step 2 - Areas to AVOID"),
makeTable(
["Avoid", "Reason"],
[
["Skin creases and folds", "Appliance will not seal; leakage inevitable"],
["Bony prominences (ASIS, costal margin)", "Appliance will not lie flat"],
["Belt line / waistband area", "Appliance dislodged by clothing"],
["Previous scars, skin grafts", "Poor adhesion, irregular contour"],
["The umbilicus", "Irregular surface"],
["Areas patient cannot see", "Patient cannot manage stoma independently"],
],
[3000, 5800]
),
new Paragraph({ spacing: { before: 120 }, children: [] }),
h3("Step 3 - The Ideal Zone"),
bullet("Within the RECTUS ABDOMINIS MUSCLE - single most important principle (reduces parastomal hernia)"),
bullet("On the INFRAUMBILICAL FAT MOUND - flat surface for bag adherence (Sabiston Fig. 95.15)"),
bullet("Ileostomy: right paramedian, infraumbilical (right iliac fossa)"),
bullet("End colostomy: left paramedian, infraumbilical (left iliac fossa)"),
bullet("General landmark: midpoint between anterior superior iliac spine (ASIS) and umbilicus"),
new Paragraph({ spacing: { before: 80 }, children: [] }),
keyBox("Emergency fallback (no marking done)", "5 cm lateral to midline + 4 cm below umbilicus, within rectus muscle"),
new Paragraph({ spacing: { before: 80 }, children: [] }),
h3("Step 4 - Marking Technique"),
bullet("Mark with waterproof/permanent ink marker"),
bullet("Apply a disposable appliance over the marked site - patient tests it by sitting, bending, walking"),
bullet("At surgery: scratch the skin with a needle over the mark (prevents washoff during skin prep)"),
new Paragraph({ spacing: { before: 120 }, children: [] }),
h2("Special Patient Considerations"),
makeTable(
["Patient Type", "Special Consideration"],
[
["Obese patient", "Creases shift with position - assess sitting is critical; may need higher placement"],
["Elderly", "Assess manual dexterity - stoma must be reachable and visible"],
["Visually impaired", "May need carer involvement; tactile landmarks important"],
["Wheelchair user", "Assess in seated position primarily; avoid sites compressed by chair"],
["Athletes / Active patients", "Avoid belt line; discuss waterproof appliances, sport covers"],
["Religious considerations", "Discuss clothing requirements (e.g. sari, dhoti, habits)"],
],
[2400, 6400]
),
new Paragraph({ spacing: { before: 120 }, children: [] }),
pageBreak()
];
}
function section4_technique() {
return [
h1("SECTION 4: COLOSTOMY - THERAPEUTIC USES AND OPERATIVE TECHNIQUE"),
h2("Indications for Colostomy"),
makeTable(
["Indication Type", "Specific Situations"],
[
["Protective / Defunctioning", "Protect distal anastomosis; healing of high anal fistula; defunction obstructing rectal cancer prior to chemoradiotherapy"],
["Emergency", "Left colonic obstruction (sigmoid volvulus, carcinoma); perforated diverticulitis; rectal trauma"],
["Permanent", "APR for low rectal/anal canal carcinoma; total proctocolectomy; severe faecal incontinence"],
["Palliative", "Unresectable rectal cancer with obstruction; advanced pelvic malignancy; during downstaging CRT"],
["Other", "Hirschsprung's disease (staged); anorectal malformations; radiation proctitis stricture; Crohn's anal stricture"],
],
[2400, 6400]
),
new Paragraph({ spacing: { before: 120 }, children: [] }),
h2("Operative Technique - End Colostomy (Permanent)"),
para("Used after APR or Hartmann's procedure. Site: left iliac fossa."),
bullet("1. Mobilise sigmoid/descending colon with adequate mesenteric length - must reach skin WITHOUT tension"),
bullet("2. Excise circular disc of skin (~2-3 cm) at pre-marked LIF site"),
bullet("3. Divide subcutaneous fat to anterior rectus sheath"),
bullet("4. SPLIT rectus muscle longitudinally (muscle-splitting incision - preserves function)"),
bullet("5. Sharply divide posterior rectus sheath and peritoneum"),
bullet("6. Aperture must admit TWO FINGERS comfortably"),
bullet("7. Deliver bowel through trephine; check no mesenteric twisting"),
bullet("8. Suture colon margin FLUSH or with slight eversion to skin (mucocutaneous anastomosis)"),
bullet("9. End colostomy protrudes only 0.5-1 cm above skin (unlike ileostomy spout)"),
new Paragraph({ spacing: { before: 80 }, children: [] }),
keyBox("Key principle", "Rectus muscle SPLIT (not cut across) + aperture within rectus = reduces parastomal hernia"),
new Paragraph({ spacing: { before: 120 }, children: [] }),
h2("Operative Technique - Loop Colostomy (Temporary)"),
bullet("1. Mobilise loop of sigmoid (or transverse) colon"),
bullet("2. Bring loop out through abdominal wall incision (transverse incision in wall)"),
bullet("3. Close the abdomen first"),
bullet("4. Pass a ROD or BRIDGE beneath the loop - prevents retraction; removed after a few days"),
bullet("5. Incise colon transversely on antimesenteric border (~2/3 circumference)"),
bullet("6. Suture colonic edges to adjacent skin (mucocutaneous anastomosis)"),
bullet("7. Two openings created: PROXIMAL (functional/active) + DISTAL (inactive/efferent)"),
bullet("8. Function expected within 2-7 days postoperatively"),
new Paragraph({ spacing: { before: 80 }, children: [] }),
keyBox("Closure note", "~25% of temporary stomas are NEVER closed due to complications or change in comorbidity"),
new Paragraph({ spacing: { before: 120 }, children: [] }),
h2("Double-Barrel Colostomy (Paul-Mikulicz)"),
bullet("Used when bowel resection done but patient too ill for primary anastomosis"),
bullet("Both cut ends brought out as two adjacent stomas on abdominal wall"),
bullet("Advantage: subsequent closure by local mobilisation and reanastomosis without full laparotomy"),
new Paragraph({ spacing: { before: 120 }, children: [] }),
pageBreak()
];
}
function section5_stomaCare() {
return [
h1("SECTION 5: STOMA CARE"),
h2("A. Stoma Care Nurse Role"),
makeTable(
["Phase", "Role"],
[
["Preoperative", "Counselling + reassurance + stoma siting and marking"],
["Intraoperative", "Available for advice if marking not pre-done"],
["Early postoperative (Day 0-10)", "Appliance fitting; stoma inspection; patient teaching; electrolyte monitoring"],
["Long-term", "Troubleshooting; appliance updates; psychological support; support group liaison"],
],
[2400, 6400]
),
new Paragraph({ spacing: { before: 120 }, children: [] }),
h2("B. Stoma Appliances"),
makeTable(
["Component", "Description"],
[
["Flange / Baseplate", "Adhesive plate that sticks to peristomal skin; has central aperture cut to fit stoma size; made of Stomahesive material"],
["Bag", "Collects output; attached to flange"],
["One-piece appliance", "Flange and bag inseparable; simpler to apply; change whole unit each time"],
["Two-piece appliance", "Flange and bag separable; bag changed more frequently; flange stays 3-5 days; better for skin protection"],
["Drainable bag", "Open bottom with clip; emptied when half-full; MANDATORY for ileostomy"],
["Non-drainable bag", "Closed bottom; disposed after each use; used for sigmoid colostomy (formed stool)"],
],
[2800, 6000]
),
new Paragraph({ spacing: { before: 120 }, children: [] }),
h2("C. Key Accessories"),
makeTable(
["Accessory", "Purpose / Use"],
[
["Karaya gum / paste", "Fills skin irregularities between flange and stoma; excellent skin protectant"],
["Stomahesive paste", "Na carboxymethyl cellulose + gelatin + pectin; non-reactive; sticks to moist skin; cut to shape"],
["Barrier creams", "Protect peristomal skin from enzymatic excoriation"],
["Charcoal / Filtrodor filter", "Punctured into bag; releases flatus silently while trapping odour"],
["Waist belt", "Additional security to prevent bag detachment"],
["Hernia support belt", "Used when parastomal hernia present; reduces bulge; aids appliance adhesion"],
["Deodorants", "Reduce odour from stoma effluent"],
["Plastic cap + belt", "Used by natural/irrigation method patients between evacuations (no bag needed)"],
],
[2800, 6000]
),
new Paragraph({ spacing: { before: 120 }, children: [] }),
h2("D. Immediate Postoperative Care (Day 0-10)"),
bullet("Apply TRANSLUCENT drainable bag at end of surgery - allows inspection without removal"),
bullet("Inspect stoma daily through transparent bag for:"),
bullet("Colour: healthy = pink/red and moist", 1),
bullet("Necrosis: dark/dusky/black colour - assess depth with paediatric proctoscope", 1),
bullet("Viability check: viable stoma BLEEDS when gently pricked with needle", 1),
bullet("Retraction, prolapse, oedema (oedema common in first week; settles spontaneously)", 1),
bullet("Ileostomy acts within 24-48 h; high output (>1000 ml/day) common initially - monitor Na+, K+"),
bullet("Colostomy acts within 3-5 days (flatus appears first, then stool)"),
bullet("Remove mucocutaneous sutures at Day 10 (even absorbable ones)"),
bullet("Stoma shrinks over weeks 1-6 - resize the appliance aperture accordingly"),
new Paragraph({ spacing: { before: 120 }, children: [] }),
h2("E. Long-Term Colostomy Management Methods"),
h3("1. Natural Method"),
bullet("Relies on predictable daily action (often stimulus-triggered, e.g. morning coffee)"),
bullet("Between actions: plastic cap with belt - no bag required"),
bullet("Dietary adjustment + antimotility drugs (codeine, loperamide, Lomotil) to regulate timing"),
new Paragraph({ spacing: { before: 60 }, children: [] }),
h3("2. Appliance Method (most common)"),
bullet("One- or two-piece non-drainable bags changed after each action"),
bullet("One-piece bags applied over Stomahesive base (base stays in place several days)"),
new Paragraph({ spacing: { before: 60 }, children: [] }),
h3("3. Colostomy Irrigation Method"),
para("Gives freedom from permanent bag between irrigations. Technique:"),
bullet("Start 2-4 weeks postoperatively under stoma therapist supervision"),
bullet("Patient sits on toilet; plastic cone connected to reservoir suspended at head height"),
bullet("750-1000 ml of room-temperature water run into stoma via cone"),
bullet("Long plastic sleeve applied to stoma; directed into toilet bowl"),
bullet("Colon evacuates in 10-30 minutes; sleeve folded and clipped"),
bullet("Patient ambulates normally while residual evacuation occurs"),
bullet("Sleeve removed; stoma cleaned; adhesive stoma seal applied"),
bullet("Repeat every 24-48 hours"),
bullet("NOT suitable for transverse/right-sided colostomies or incontinent bowel"),
new Paragraph({ spacing: { before: 120 }, children: [] }),
h2("F. Peristomal Skin Care"),
makeTable(
["Problem", "Cause", "Management"],
[
["Chemical excoriation", "Effluent contact with skin (leakage or oversized aperture)", "Correct appliance size; Stomahesive / karaya barrier"],
["Allergic dermatitis", "Allergy to adhesive (rash matches exact appliance shape)", "Remove; use Stomahesive; steroid cream if needed"],
["Mechanical trauma", "Frequent flange changes; rough cleaning", "Gentle warm water cleaning; reduce change frequency"],
["Fungal infection (Candida)", "Moist excoriated skin under flange", "Antifungal powder applied under flange"],
["Maceration", "Moisture from effluent leakage", "Improve seal; Stomahesive paste to fill gaps"],
["Leakage causes", "Wrong size; irregular contour; retraction; ulceration; poor tuition", "Address specific cause; revise stoma if retracted"],
],
[2000, 2800, 4000]
),
new Paragraph({ spacing: { before: 120 }, children: [] }),
h2("G. Dietary Guidance"),
makeTable(
["Stoma Type", "Advice"],
[
["Ileostomy", "Avoid large fibrous boluses (obstruction risk); adequate fluid + salt intake; restrict high-oxalate foods (spinach, leafy greens) to reduce renal stones; chew food thoroughly"],
["Colostomy", "Avoid gas-producing foods if bothersome (beans, cabbage, onions, carbonated drinks); regular mealtimes help regularity"],
["Both", "Reintroduce foods one at a time; avoid dehydration; alcohol increases ileostomy output"],
],
[2000, 6800]
),
new Paragraph({ spacing: { before: 120 }, children: [] }),
h2("H. Ileostomy Physiology and High Output"),
keyBox("Normal output", "~500 ml/day"),
keyBox("High output (abnormal)", ">1000 ml/day - risk of Na/K depletion"),
keyBox("Electrolyte composition", "Na 110-120 mmol/L | K 6-12 mmol/L | Cl 40-70 mmol/L"),
new Paragraph({ spacing: { before: 80 }, children: [] }),
para("Causes of high output ileostomy:", { bold: true }),
bullet("Subacute small bowel obstruction"),
bullet("Crohn's disease / IBD flare"),
bullet("Short bowel syndrome"),
bullet("Drugs: laxatives, antibiotics"),
bullet("Diet: onions, vegetables, fruits, alcohol"),
para("Treatment: Loperamide, codeine, Lomotil; bulk agents; dietary modification; oral rehydration solutions"),
new Paragraph({ spacing: { before: 120 }, children: [] }),
pageBreak()
];
}
function section6_paraHernia() {
return [
h1("SECTION 6: PARASTOMAL HERNIA"),
h2("Definition"),
para("A parastomal hernia is herniation of abdominal contents (bowel loops or fat) through the fascial defect adjacent to the stoma. Creating a stoma inherently creates a potential hernia - the defect tends to enlarge over time."),
keyBox("Incidence", "Over 50% at 5 years (Bailey & Love)"),
keyBox("Most preventable by", "Correct siting within rectus muscle + appropriate aperture size"),
new Paragraph({ spacing: { before: 120 }, children: [] }),
h2("Causes and Risk Factors"),
h3("Technical (Surgical) Factors"),
makeTable(
["Factor", "Detail"],
[
["Aperture too large", "Most direct preventable cause - opens up space for herniation"],
["Stoma outside rectus muscle", "Lateral placement has dramatically higher hernia rates"],
["Excessive tension on bowel", "Leads to retraction → enlargement of defect"],
["Failure to anchor bowel to abdominal wall", "Allows movement and gradual defect widening"],
],
[3000, 5800]
),
new Paragraph({ spacing: { before: 80 }, children: [] }),
h3("Patient Factors"),
makeTable(
["Factor", "Mechanism"],
[
["Obesity / high BMI", "Raised intra-abdominal pressure + weak tissue + technical difficulty"],
["Smoking", "Impairs collagen synthesis and wound healing"],
["Poorly controlled diabetes", "Impaired wound healing"],
["Malnutrition / hypoalbuminaemia", "Poor fascial healing"],
["Chronic steroid use / immunosuppression", "Impaired healing"],
["Chronic cough or straining", "Persistently raised intra-abdominal pressure"],
["Weight gain after surgery", "Increases abdominal wall strain"],
["Duration of stoma", "Risk directly proportional to time stoma present"],
],
[3000, 5800]
),
new Paragraph({ spacing: { before: 120 }, children: [] }),
h2("Clinical Features"),
bullet("Bulge / swelling adjacent to the stoma (most noticeable on coughing or straining)"),
bullet("MOST COMMON COMPLAINT: difficulty fitting and maintaining the stoma appliance"),
bullet("Appliance bag leakage, poor adhesion, peristomal skin excoriation"),
bullet("Intermittent stoma obstruction"),
bullet("Pain or discomfort around the stoma site"),
bullet("EMERGENCY: acute obstruction or strangulation of herniated bowel"),
new Paragraph({ spacing: { before: 120 }, children: [] }),
h2("Investigations"),
bullet("Clinical diagnosis (examination with patient standing / straining)"),
bullet("CT abdomen/pelvis: defines anatomy, detects obstruction, identifies strangulation"),
new Paragraph({ spacing: { before: 120 }, children: [] }),
h2("Management"),
h3("1. Conservative (Non-operative)"),
bullet("Hernia support / stoma belt"),
bullet("Appliance revision (larger aperture, convex baseplate, different system)"),
bullet("Lifestyle: weight loss, smoking cessation, control of cough"),
bullet("Temporary ileostomies: conservative management until stoma reversal (with simultaneous fascial repair)"),
new Paragraph({ spacing: { before: 80 }, children: [] }),
h3("2. Surgical - Indications"),
bullet("Significant symptoms or inability to adequately pouch the stoma"),
bullet("Acute obstruction, strangulation, or incarceration (emergency surgery)"),
bullet("Intractable appliance problems despite conservative measures"),
new Paragraph({ spacing: { before: 80 }, children: [] }),
h3("3. Surgical Options"),
makeTable(
["Technique", "Description", "Recurrence Rate"],
[
["Primary suture repair", "Simple fascial closure around stoma", "~100% - NOT recommended alone"],
["Stoma relocation / re-siting", "Move stoma to opposite side of abdomen", "Same rate at new site - no longer recommended (Bailey & Love)"],
["Keyhole / Slit mesh", "Mesh with central aperture accommodating bowel; placed as onlay, retromuscular, or intraperitoneal", "21-73%"],
["Sugarbaker technique (BEST)", "Large mesh underlay placed intraperitoneally; stoma exits LATERAL to defect (no central hole; bowel sandwiched between mesh and wall)", "7-15% (best results)"],
["Laparoscopic Sugarbaker", "Laparoscopic version; equivalent outcomes to open", "7-15%"],
["Stoma reversal", "Restore bowel continuity; eliminates the problem entirely; IDEAL if feasible", "N/A"],
],
[2400, 4000, 2400]
),
new Paragraph({ spacing: { before: 80 }, children: [] }),
para("Mesh safety note: mesh infection rate only 2-2.6% in large series; bowel erosion extremely rare - previously overestimated risk. (Fischer's Mastery)", { italic: true }),
new Paragraph({ spacing: { before: 120 }, children: [] }),
h2("Prevention of Parastomal Hernia"),
makeTable(
["Prevention Strategy", "Evidence / Comment"],
[
["Site stoma through rectus abdominis muscle", "Single most important technical step"],
["Correct aperture size (two-finger rule)", "Large enough for tension-free passage; small enough to prevent hernia"],
["Ensure no tension on mesentery", "Prevents defect enlargement from retraction forces"],
["Prophylactic mesh at stoma creation", "Meta-analysis of 12 RCTs: reduces hernia by ~40%; however, RCTs in last 5 years show no clear advantage (Sabiston)"],
["Laparoscopic stoma creation", "Some evidence of lower hernia rates vs open"],
["Patient optimisation", "Weight loss, smoking cessation, glucose control before elective surgery"],
],
[3200, 5600]
),
new Paragraph({ spacing: { before: 120 }, children: [] }),
pageBreak()
];
}
function section7_complications() {
return [
h1("SECTION 7: COMPLICATIONS OF STOMAS - QUICK REFERENCE"),
makeTable(
["Complication", "Timing", "Features", "Management"],
[
["Ischaemia / Necrosis", "Early (Day 0-2)", "Dusky/black stoma; inspect daily; use proctoscope to assess depth below fascia", "If superficial: observe; If below fascia: urgent reoperation"],
["Mucocutaneous separation", "Early", "Mucocutaneous sutures pull through; raw area around stoma", "Usually conservative with intensive stoma care"],
["High output (ileostomy)", "Early", ">1000 ml/day; electrolyte depletion", "Loperamide; codeine; dietary adjustment; ORS"],
["Skin excoriation", "Early/Late", "Erythema/ulceration around stoma", "Correct fit; barrier products; stoma nurse review"],
["Retraction", "Early/Late", "Stoma retracts below skin; leakage", "Karaya paste; convex appliance; surgical refashioning if severe"],
["Prolapse", "Late", "Stoma protrudes excessively; more common in loop stomas", "Hernia belt; convert to end stoma; resect redundant bowel"],
["Stenosis", "Late", "Narrowing; obstruction", "Dilatation; surgical revision"],
["Parastomal hernia", "Late", "Bulge around stoma; appliance difficulties; obstruction risk", "Belt; mesh repair (Sugarbaker preferred); reversal if feasible"],
["Food bolus obstruction", "Any", "Ileostomy more common; high fibrous food intake", "NGT decompression; hydration; stoma catheterisation; surgery if needed"],
],
[2000, 1500, 3000, 2500]
),
new Paragraph({ spacing: { before: 120 }, children: [] }),
pageBreak()
];
}
function section8_examTips() {
return [
h1("SECTION 8: EXAM REVISION - KEY POINTS"),
h2("Must-Know Facts"),
bullet("A stoma is sited within the RECTUS ABDOMINIS MUSCLE - reduces parastomal hernia"),
bullet("Ileostomy HAS a spout (2-3 cm); colostomy is FLUSH or slightly everted only"),
bullet("Loop stoma has a ROD/BRIDGE to prevent retraction - removed after a few days"),
bullet("~25% of temporary stomas are NEVER reversed"),
bullet("Parastomal hernia rate: >50% at 5 years"),
bullet("Best repair for parastomal hernia: SUGARBAKER technique (7-15% recurrence)"),
bullet("Simple suture repair of parastomal hernia: ~100% recurrence - do NOT use alone"),
bullet("Transverse loop colostomy: AVOID - prone to prolapse, difficult to site, poor adhesion"),
bullet("Colostomy irrigation: 750-1000 ml water, every 24-48 h, sigmoid colostomy only"),
bullet("High output ileostomy: >1000 ml/day (normal ~500 ml/day)"),
new Paragraph({ spacing: { before: 120 }, children: [] }),
h2("Ileostomy Electrolytes (Memorise)"),
keyBox("Sodium", "110-120 mmol/L"),
keyBox("Potassium", "6-12 mmol/L"),
keyBox("Chloride", "40-70 mmol/L"),
keyBox("Bicarbonate", "30-40 mmol/L"),
new Paragraph({ spacing: { before: 120 }, children: [] }),
h2("Appliance Summary"),
makeTable(
["Stoma", "Appliance Type"],
[
["Ileostomy", "Drainable bag - ALWAYS (liquid, enzymatic output)"],
["Sigmoid colostomy", "Non-drainable bag (formed stool)"],
["Transverse colostomy", "Drainable bag (semi-liquid, like ileostomy)"],
["Colostomy irrigation", "No bag needed between irrigations - plastic cap only"],
],
[2800, 6000]
),
new Paragraph({ spacing: { before: 120 }, children: [] }),
h2("Parastomal Hernia Repair - Recurrence Rates"),
makeTable(
["Technique", "Recurrence"],
[
["Primary suture repair", "~100% - NOT recommended"],
["Stoma relocation", "Same rate at new site - NOT recommended"],
["Keyhole mesh", "21-73%"],
["Sugarbaker (BEST)", "7-15%"],
["Laparoscopic Sugarbaker", "7-15%"],
],
[4000, 4800]
),
new Paragraph({ spacing: { before: 120 }, children: [] }),
h2("Sources"),
bullet("Sabiston Textbook of Surgery - Chapter 95 (Stoma Types, Colostomy, Stoma Marking)"),
bullet("Bailey & Love's Short Practice of Surgery, 28th Ed. - Chapter 64 (Parastomal Hernia), Chapter 77 (Stoma types, complications)"),
bullet("Fischer's Mastery of Surgery, 8th Ed. - Chapter 129 (Ostomy Marking), Chapter 143 (Stoma Complications, Parastomal Hernia)"),
bullet("Pye's Surgical Handicraft, 22nd Ed. - Chapter 20 (Stoma Care, Appliances, Irrigation)"),
];
}
// ─────────────────────────────────────────────────────────────────────
// ASSEMBLE DOCUMENT
// ─────────────────────────────────────────────────────────────────────
const doc = new Document({
styles: {
default: {
document: {
run: { font: "Calibri", size: 20, color: DARK_TXT }
}
}
},
sections: [{
properties: {
page: {
margin: { top: 900, bottom: 900, left: 900, right: 900 }
}
},
headers: {
default: new Header({
children: [
new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
borders: {
top: { style: BorderStyle.NONE }, bottom: { style: BorderStyle.SINGLE, size: 6, color: TEAL },
left: { style: BorderStyle.NONE }, right: { style: BorderStyle.NONE },
insideH: { style: BorderStyle.NONE }, insideV: { style: BorderStyle.NONE }
},
rows: [new TableRow({
children: [
new TableCell({
borders: { top: { style: BorderStyle.NONE }, bottom: { style: BorderStyle.NONE }, left: { style: BorderStyle.NONE }, right: { style: BorderStyle.NONE } },
children: [new Paragraph({
children: [new TextRun({ text: "STOMA - Surgical Study Guide", bold: true, size: 18, color: TEAL, font: "Calibri" })]
})]
}),
new TableCell({
borders: { top: { style: BorderStyle.NONE }, bottom: { style: BorderStyle.NONE }, left: { style: BorderStyle.NONE }, right: { style: BorderStyle.NONE } },
children: [new Paragraph({
alignment: AlignmentType.RIGHT,
children: [new TextRun({ text: "Sabiston • Bailey & Love • Fischer's • Pye's", size: 16, color: SLATE, font: "Calibri", italic: true })]
})]
})
]
})]
})
]
})
},
footers: {
default: new Footer({
children: [new Paragraph({
alignment: AlignmentType.CENTER,
children: [
new TextRun({ text: "Page ", size: 16, color: SLATE, font: "Calibri" }),
new TextRun({ children: [PageNumber.CURRENT], size: 16, color: SLATE, font: "Calibri" }),
new TextRun({ text: " of ", size: 16, color: SLATE, font: "Calibri" }),
new TextRun({ children: [PageNumber.TOTAL_PAGES], size: 16, color: SLATE, font: "Calibri" }),
]
})]
})
},
children: [
...coverPage(),
...section1_definition(),
...section2_classification(),
...section3_marking(),
...section4_technique(),
...section5_stomaCare(),
...section6_paraHernia(),
...section7_complications(),
...section8_examTips(),
]
}]
});
Packer.toBuffer(doc).then(buffer => {
fs.writeFileSync("/home/daytona/workspace/stoma-study/Stoma_Study_Guide.docx", buffer);
console.log("SUCCESS: Document written.");
}).catch(err => {
console.error("ERROR:", err);
process.exit(1);
});
cd /home/daytona/workspace/stoma-study && node generate.js 2>&1
python /home/daytona/skills/docx/scripts/office/validate.py /home/daytona/workspace/stoma-study/Stoma_Study_Guide.docx 2>&1
cd /home/daytona/workspace/stoma-study && python -c "import zipfile; z = zipfile.ZipFile('Stoma_Study_Guide.docx'); print('Files in docx:', z.namelist()[:10]); print('File size:', __import__('os').path.getsize('Stoma_Study_Guide.docx'), 'bytes')"
Stoma Study Guide
Word Document · DOCX
| Section | Content |
|---|---|
| 1 | Definition & Overview |
| 2 | Classification - by content, duration, configuration, site (with full comparison tables) |
| 3 | Stoma Siting & Marking - 4-step process, areas to avoid, special patient considerations |
| 4 | Colostomy - Indications, end colostomy technique, loop colostomy technique, double-barrel |
| 5 | Stoma Care - Nurse role, appliances, accessories, postoperative care, irrigation method, skin care, diet, ileostomy physiology |
| 6 | Parastomal Hernia - Definition, causes, clinical features, management (all repair techniques with recurrence rates) |
| 7 | Complications Quick Reference Table |
| 8 | Exam Revision - Key facts, must-memorise electrolytes, appliance summary, repair recurrence rates |
In this i am only able to one page only
cd /home/daytona/workspace/stoma-study && python3 -c " import zipfile, re with zipfile.ZipFile('Stoma_Study_Guide.docx') as z: xml = z.read('word/document.xml').decode('utf-8') # Count page breaks pb = xml.count('lastRenderedPageBreak') + xml.count('pageBreak') + xml.count('w:br w:type=\"page\"') + xml.count('w:type=\"page\"') print('Page break markers found:', pb) print('Document XML size:', len(xml), 'bytes') # Check for sectPr print('Section properties (sectPr):', xml.count('sectPr')) print('First 2000 chars of body:') body_start = xml.find('<w:body>') print(xml[body_start:body_start+500]) "
cd /home/daytona/workspace/stoma-study && python3 -c " import zipfile, re with zipfile.ZipFile('Stoma_Study_Guide.docx') as z: xml = z.read('word/document.xml').decode('utf-8') # Find actual page break XML idx = xml.find('PageBreak') print('PageBreak at:', idx) print('Context:', xml[max(0,idx-100):idx+200]) # Check w:br type page idx2 = xml.find('w:type=\"page\"') print('w:type=page at:', idx2) if idx2 > 0: print('Context:', xml[max(0,idx2-100):idx2+200]) "
cd /home/daytona/workspace/stoma-study && python /home/daytona/skills/docx/scripts/office/soffice.py --headless --convert-to pdf Stoma_Study_Guide.docx 2>&1
libreoffice --headless --convert-to pdf --outdir /home/daytona/workspace/stoma-study/ /home/daytona/workspace/stoma-study/Stoma_Study_Guide.docx 2>&1
ls -la /home/daytona/workspace/stoma-study/ && df -h /home/daytona/workspace/
# Try converting to PDF using a temp directory cp /home/daytona/workspace/stoma-study/Stoma_Study_Guide.docx /tmp/Stoma_Study_Guide.docx libreoffice --headless --convert-to pdf --outdir /tmp/ /tmp/Stoma_Study_Guide.docx 2>&1 ls -la /tmp/Stoma_Study_Guide.pdf 2>/dev/null && echo "PDF created" || echo "PDF not created"
# Check page count and copy to workspace python3 -c " import subprocess result = subprocess.run(['pdfinfo', '/tmp/Stoma_Study_Guide.pdf'], capture_output=True, text=True) print(result.stdout) " cp /tmp/Stoma_Study_Guide.pdf /home/daytona/workspace/stoma-study/Stoma_Study_Guide.pdf ls -lh /home/daytona/workspace/stoma-study/Stoma_Study_Guide.pdf
Stoma Study Guide
PDF Document · PDF
Stoma Study Guide
Word Document · DOCX
Stoma care
| Phase | Responsibilities |
|---|---|
| Preoperative | Counselling, reassurance, explanation; stoma siting and marking |
| Intraoperative | Available to advise if pre-marking not done |
| Early postoperative | Appliance fitting; stoma viability checks; patient education |
| Long-term | Troubleshooting complications; appliance updates; psychological support; liaison with patient associations |
"A stoma is compatible with a normal life" - patients must be told this explicitly before surgery.
| Feature | One-Piece | Two-Piece |
|---|---|---|
| Bag + flange | Inseparable | Separable (click/lock mechanism) |
| Skin trauma | Higher (whole unit changed) | Lower (bag changed; base stays 3-5 days) |
| Ease of use | Simpler | Better skin protection |
| Use | Simple, active patients | Sensitive peristomal skin |
| Type | Description | Used For |
|---|---|---|
| Drainable | Open bottom with clip/tie; emptied when half-full | Ileostomy (MANDATORY); transverse colostomy |
| Non-drainable | Closed end; disposed after each use | Sigmoid colostomy (formed stool) |

| Accessory | Purpose |
|---|---|
| Karaya gum / paste | Fills skin irregularities between flange and stoma; excellent skin protectant; applied on skin side of gasket |
| Stomahesive paste | Na-carboxymethyl cellulose + gelatin + pectin + polyisobutylene; sticks to moist skin; non-reactive; cut to any shape |
| Barrier creams | Protect peristomal skin from enzymatic excoriation |
| Charcoal filter / Filtrodor | Punctured into the bag; gas escapes silently; odour trapped |
| Deodorants | Added inside the bag to reduce odour |
| Waist belt | Extra security; prevents bag detachment |
| Hernia support belt | Reduces parastomal hernia bulge; aids appliance adhesion |
| Plastic cap + belt | Used by natural/irrigation method patients between evacuations - no bag needed |
| What to Check | Normal | Abnormal - Act |
|---|---|---|
| Colour | Pink/red, moist | Dusky/black = ischaemia |
| Viability test | Bleeds when gently pricked | No bleeding = necrosis |
| Depth of necrosis | - | Use paediatric proctoscope: if viable below fascia = observe; if necrotic below fascia = urgent surgery |
| Oedema | Mild (common in week 1, settles) | Massive/worsening = review |
| Retraction | Stoma at or above skin level | Sinking below skin = appliance problem |
| Parameter | Value |
|---|---|
| Normal daily output | ~500 ml |
| High output (abnormal) | >1000 ml/day |
| Sodium | 110-120 mmol/L |
| Potassium | 6-12 mmol/L |
| Chloride | 40-70 mmol/L |
| Bicarbonate | 30-40 mmol/L |
| Enzymes | Proteolytic - digest skin rapidly on contact |
| Problem | Cause | Management |
|---|---|---|
| Chemical excoriation | Effluent contacts skin (leakage or oversized aperture) | Correct appliance size; karaya / Stomahesive barrier; barrier cream |
| Allergic contact dermatitis | Allergy to adhesive - rash matches exact shape of appliance | Remove appliance; use Stomahesive sheet; steroid cream if needed |
| Mechanical trauma | Excessive frequency of flange changes; rough cleaning | Gentle warm water cleaning; reduce change frequency |
| Candidal (fungal) infection | Moist, excoriated skin under the flange | Antifungal powder applied under flange before application |
| Maceration | Chronic moisture from leakage | Improve bag seal; Stomahesive paste to fill skin contour irregularities |
| Leakage (cause of most skin problems) | Wrong aperture size; irregular contour; retraction; ulceration; poor patient education; lack of dexterity | Address specific cause; revise stoma if retracted |
| Stoma Type | Key Advice |
|---|---|
| Ileostomy | Chew food thoroughly; avoid large fibrous boluses (obstruction risk at fascia); adequate fluid + salt intake; restrict high-oxalate foods; avoid alcohol (increases output) |
| Sigmoid colostomy | Regular meals for regularity; avoid gas-producing foods if troublesome (beans, cabbage, onions, fizzy drinks) |
| Both | Reintroduce foods one at a time postoperatively; avoid dehydration; maintain normal mealtimes |
| Concern | Approach |
|---|---|
| Body image / self-esteem | Pre- and postoperative counselling; normalise stoma as compatible with full life |
| Sexual function | Discuss APR-related nerve injury preoperatively; address concerns openly |
| Relationships | Involve partner in stoma education if patient wishes |
| Return to activities | Swimming, sport, exercise, travel all possible with appropriate appliances |
| Support groups | Colostomy UK, IA (Ileostomy Association) - peer support invaluable |
| Emotional impact | Counselling referral if needed; stoma care nurse ongoing support |
| Complication | Features | Management |
|---|---|---|
| Ischaemia / Necrosis | Dusky/black stoma - Day 0-2; assess depth with proctoscope | Superficial: observe; Below fascia: urgent surgery |
| Mucocutaneous separation | Sutures pull through; raw peri-stomal ring | Conservative intensive care; stoma nurse |
| Retraction | Stoma sinks below skin; major leakage problem | Convex appliance; karaya; surgical refashioning |
| Prolapse | Excessive protrusion; common in loop stomas | Hernia belt; convert to end stoma; resect redundant bowel |
| Stenosis | Narrowing; obstruction | Dilatation; surgical revision |
| Parastomal hernia | Bulge around stoma; appliance difficulties | Belt; mesh repair (Sugarbaker); reversal if feasible |
| High output | >1000 ml/day (ileostomy) | Loperamide; codeine; dietary change; rehydration |
| Skin excoriation | Redness, ulceration, pain | Correct size; barrier products; antifungal if candida |
| Feature | Ileostomy | Colostomy (sigmoid) |
|---|---|---|
| Bag type | Drainable (always) | Non-drainable |
| Empty bag when | Half full | After each action |
| Flange change | Every 4-5 days | Every few days |
| Output | ~500 ml/day (liquid) | 1-3 times/day (solid) |
| Main skin risk | HIGH (proteolytic enzymes) | Lower |
| Spout needed | YES - 2-3 cm | No - flush or slightly everted |
| Irrigation possible | No | Yes (sigmoid only) |
| Electrolyte loss | Significant - monitor Na+/K+ | Minimal |
Generate flashcards for appliance types and complications
~/stoma-study/flashcards.js
const pptxgen = require("pptxgenjs");
const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Stoma Appliances & Complications - Flashcards";
// ── Colour palette ──────────────────────────────────────────────────
const C = {
teal: "0D7377",
darkTeal: "14A085",
lightTeal: "D4F1EE",
navy: "1A2550",
red: "C0392B",
lightRed: "FDECEA",
orange: "E67E22",
lightOrange: "FEF0E4",
green: "1A7A4A",
lightGreen:"E8F8F0",
purple: "6C3483",
lightPurple:"F4ECF7",
white: "FFFFFF",
offWhite: "F8FAFB",
dark: "1C2833",
gray: "566573",
lightGray: "EBF5FB",
};
// ── Helpers ──────────────────────────────────────────────────────────
function cardBg(slide, bgColor) {
slide.addShape(pres.ShapeType.rect, {
x: 0, y: 0, w: "100%", h: "100%",
fill: { color: bgColor || C.white },
line: { color: bgColor || C.white },
});
}
function topBanner(slide, text, color, textColor) {
slide.addShape(pres.ShapeType.rect, {
x: 0, y: 0, w: "100%", h: 1.1,
fill: { color: color },
line: { color: color },
});
slide.addText(text, {
x: 0, y: 0, w: "100%", h: 1.1,
fontSize: 22, bold: true, color: textColor || C.white,
align: "center", valign: "middle", fontFace: "Calibri",
});
}
function sectionLabel(slide, label, color) {
slide.addShape(pres.ShapeType.roundRect, {
x: 0.3, y: 0.15, w: 1.8, h: 0.4,
fill: { color: color },
line: { color: color },
rectRadius: 0.05,
});
slide.addText(label, {
x: 0.3, y: 0.15, w: 1.8, h: 0.4,
fontSize: 11, bold: true, color: C.white,
align: "center", valign: "middle", fontFace: "Calibri",
});
}
function questionBox(slide, question, color) {
slide.addShape(pres.ShapeType.rect, {
x: 0.4, y: 1.25, w: 9.2, h: 1.5,
fill: { color: color },
line: { color: color },
shadow: { type: "outer", color: "999999", blur: 6, offset: 2, angle: 45, opacity: 0.3 },
});
slide.addText("Q: " + question, {
x: 0.4, y: 1.25, w: 9.2, h: 1.5,
fontSize: 20, bold: true, color: C.white,
align: "center", valign: "middle", fontFace: "Calibri",
margin: 15,
});
}
function answerBox(slide, answerLines, y, h, bgColor, textColor) {
slide.addShape(pres.ShapeType.rect, {
x: 0.4, y: y, w: 9.2, h: h,
fill: { color: bgColor },
line: { color: bgColor },
});
const items = answerLines.map((line, i) => ({
text: line,
options: { bullet: line.startsWith("•") ? false : true, breakLine: i < answerLines.length - 1, fontSize: 16, color: textColor || C.dark, fontFace: "Calibri" }
}));
slide.addText(items, {
x: 0.5, y: y, w: 9.0, h: h,
valign: "middle", fontFace: "Calibri", margin: 12,
});
}
function cardNumber(slide, num, total) {
slide.addText(`${num} / ${total}`, {
x: 8.8, y: 5.2, w: 1.1, h: 0.3,
fontSize: 10, color: C.gray, align: "right", fontFace: "Calibri",
});
}
function sourceTag(slide) {
slide.addText("Source: Pye's • Bailey & Love • Fischer's • Sabiston", {
x: 0.3, y: 5.2, w: 7, h: 0.3,
fontSize: 9, color: C.gray, italic: true, fontFace: "Calibri",
});
}
// ────────────────────────────────────────────────────────────────────
// COVER SLIDE
// ────────────────────────────────────────────────────────────────────
function coverSlide() {
const s = pres.addSlide();
// Dark gradient background
s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: "100%", fill: { color: C.navy }, line: { color: C.navy } });
// Accent bar
s.addShape(pres.ShapeType.rect, { x: 0, y: 4.2, w: "100%", h: 1.425, fill: { color: C.teal }, line: { color: C.teal } });
// Title
s.addText("STOMA CARE", {
x: 0.5, y: 0.7, w: 9, h: 1.2,
fontSize: 54, bold: true, color: C.white,
align: "center", fontFace: "Calibri", charSpacing: 8,
});
// Subtitle
s.addText("Appliance Types & Complications", {
x: 0.5, y: 1.9, w: 9, h: 0.8,
fontSize: 26, color: C.darkTeal, bold: false,
align: "center", fontFace: "Calibri",
});
// Divider
s.addShape(pres.ShapeType.line, {
x: 3, y: 2.85, w: 4, h: 0,
line: { color: C.teal, width: 2 },
});
s.addText("Flashcard Study Set", {
x: 0.5, y: 3.0, w: 9, h: 0.5,
fontSize: 14, color: "AABBCC", italic: true,
align: "center", fontFace: "Calibri",
});
// Bottom bar text
s.addText("28 Cards | Sabiston • Bailey & Love • Fischer's Mastery • Pye's Surgical Handicraft", {
x: 0, y: 4.2, w: "100%", h: 1.425,
fontSize: 14, color: C.white, align: "center", valign: "middle", fontFace: "Calibri",
});
}
// ────────────────────────────────────────────────────────────────────
// SECTION DIVIDER
// ────────────────────────────────────────────────────────────────────
function sectionDivider(title, subtitle, color) {
const s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: "100%", fill: { color: color }, line: { color: color } });
s.addShape(pres.ShapeType.rect, { x: 0, y: 2.2, w: "100%", h: 0.08, fill: { color: C.white }, line: { color: C.white } });
s.addText(title, {
x: 0.5, y: 1.2, w: 9, h: 1.0,
fontSize: 40, bold: true, color: C.white,
align: "center", fontFace: "Calibri", charSpacing: 4,
});
s.addText(subtitle, {
x: 0.5, y: 2.5, w: 9, h: 0.8,
fontSize: 18, color: C.white, italic: true,
align: "center", fontFace: "Calibri",
});
}
// ────────────────────────────────────────────────────────────────────
// FLASHCARD BUILDER - standard Q&A
// ────────────────────────────────────────────────────────────────────
function flashcard({ num, total, section, sectionColor, question, answers, qColor, answerBg, textColor }) {
const s = pres.addSlide();
cardBg(s, C.offWhite);
// Top banner
topBanner(s, section, sectionColor);
// Question box
questionBox(s, question, qColor || sectionColor);
// Answer area
answerBox(s, answers, 2.85, 2.0, answerBg || C.lightGray, textColor || C.dark);
cardNumber(s, num, total);
sourceTag(s);
}
// ────────────────────────────────────────────────────────────────────
// COMPARISON CARD - two columns
// ────────────────────────────────────────────────────────────────────
function compCard({ num, total, section, sectionColor, question, leftTitle, leftItems, rightTitle, rightItems }) {
const s = pres.addSlide();
cardBg(s, C.offWhite);
topBanner(s, section, sectionColor);
questionBox(s, question, sectionColor);
// Left column
s.addShape(pres.ShapeType.rect, {
x: 0.4, y: 2.85, w: 4.4, h: 2.0,
fill: { color: C.lightTeal }, line: { color: C.lightTeal },
});
s.addText(leftTitle, {
x: 0.4, y: 2.85, w: 4.4, h: 0.35,
fontSize: 13, bold: true, color: C.teal,
align: "center", valign: "middle", fontFace: "Calibri",
});
s.addText(leftItems.map((t, i) => ({
text: t,
options: { bullet: true, breakLine: i < leftItems.length - 1, fontSize: 14, color: C.dark, fontFace: "Calibri" }
})), { x: 0.5, y: 3.2, w: 4.2, h: 1.6, valign: "top", margin: 8 });
// Right column
s.addShape(pres.ShapeType.rect, {
x: 5.2, y: 2.85, w: 4.4, h: 2.0,
fill: { color: C.lightOrange }, line: { color: C.lightOrange },
});
s.addText(rightTitle, {
x: 5.2, y: 2.85, w: 4.4, h: 0.35,
fontSize: 13, bold: true, color: C.orange,
align: "center", valign: "middle", fontFace: "Calibri",
});
s.addText(rightItems.map((t, i) => ({
text: t,
options: { bullet: true, breakLine: i < rightItems.length - 1, fontSize: 14, color: C.dark, fontFace: "Calibri" }
})), { x: 5.3, y: 3.2, w: 4.2, h: 1.6, valign: "top", margin: 8 });
cardNumber(s, num, total);
sourceTag(s);
}
// ────────────────────────────────────────────────────────────────────
// TABLE CARD
// ────────────────────────────────────────────────────────────────────
function tableCard({ num, total, section, sectionColor, question, headers, rows }) {
const s = pres.addSlide();
cardBg(s, C.offWhite);
topBanner(s, section, sectionColor);
questionBox(s, question, sectionColor);
const colW = 9.2 / headers.length;
const startX = 0.4, startY = 2.88;
const rowH = 1.7 / rows.length;
// Header row
headers.forEach((h, ci) => {
s.addShape(pres.ShapeType.rect, {
x: startX + ci * colW, y: startY, w: colW, h: 0.38,
fill: { color: sectionColor }, line: { color: C.white },
});
s.addText(h, {
x: startX + ci * colW, y: startY, w: colW, h: 0.38,
fontSize: 12, bold: true, color: C.white,
align: "center", valign: "middle", fontFace: "Calibri",
});
});
// Data rows
rows.forEach((row, ri) => {
row.forEach((cell, ci) => {
const bg = ri % 2 === 0 ? C.lightGray : C.white;
s.addShape(pres.ShapeType.rect, {
x: startX + ci * colW, y: startY + 0.38 + ri * rowH, w: colW, h: rowH,
fill: { color: bg }, line: { color: "CCDDEE" },
});
s.addText(cell, {
x: startX + ci * colW + 0.05, y: startY + 0.38 + ri * rowH, w: colW - 0.1, h: rowH,
fontSize: 12, color: C.dark,
align: "center", valign: "middle", fontFace: "Calibri",
});
});
});
cardNumber(s, num, total);
sourceTag(s);
}
// ════════════════════════════════════════════════════════════════════
// BUILD ALL CARDS
// ════════════════════════════════════════════════════════════════════
coverSlide();
// ─── SECTION 1: APPLIANCE TYPES ──────────────────────────────────
sectionDivider("SECTION 1", "Stoma Appliances", C.teal);
const SA = "SECTION 1 · Appliance Types";
const total = 28;
flashcard({
num: 1, total, section: SA, sectionColor: C.teal,
question: "What are the TWO main components of every stoma appliance?",
answers: [
"1. FLANGE / BASEPLATE - adhesive plate that sticks to peristomal skin; has a central aperture cut to fit the stoma",
"2. BAG - collects stoma output (stool or urine)",
"Together they form either a one-piece or two-piece system",
],
answerBg: C.lightTeal,
});
compCard({
num: 2, total, section: SA, sectionColor: C.teal,
question: "One-piece vs Two-piece appliance - key differences?",
leftTitle: "ONE-PIECE",
leftItems: ["Bag + flange are inseparable", "Simpler to apply", "Entire unit changed each time", "Higher skin trauma from frequent removal", "Better for active patients"],
rightTitle: "TWO-PIECE",
rightItems: ["Bag separates from baseplate (click/lock)", "Baseplate stays 3-5 days on skin", "Only bag is changed frequently", "Less skin trauma - better for sensitive skin", "More expensive but skin-friendly"],
});
compCard({
num: 3, total, section: SA, sectionColor: C.teal,
question: "Drainable vs Non-drainable bag - when to use each?",
leftTitle: "DRAINABLE BAG",
leftItems: ["Open bottom with clip/tie", "Emptied when HALF-FULL", "Used for: Ileostomy (MANDATORY)", "Also: transverse colostomy", "Also: right-sided colostomy", "Reason: liquid/semi-liquid output"],
rightTitle: "NON-DRAINABLE BAG",
rightItems: ["Closed end, disposed after use", "Used for: sigmoid colostomy", "Reason: formed solid stool", "Changed after each action", "Cannot be emptied - replace whole bag"],
});
flashcard({
num: 4, total, section: SA, sectionColor: C.teal,
question: "Why must the bag be emptied when HALF-FULL?",
answers: [
"A bag that is more than half-full becomes TOO HEAVY",
"The excess weight detaches the flange from the peristomal skin",
"This causes LEAKAGE → skin excoriation and appliance failure",
"Rule: Empty drainable bags when half-full; replace non-drainable bags after each action",
],
answerBg: C.lightTeal,
});
flashcard({
num: 5, total, section: SA, sectionColor: C.teal,
question: "How do you choose the correct aperture (hole) size for the flange?",
answers: [
"Measure stoma diameter carefully with measuring guide",
"Cut aperture to fit SNUGLY around stoma (1-2 mm clearance only)",
"TOO SMALL → pressure on stoma → ischaemia / ulceration",
"TOO LARGE → effluent contacts skin → excoriation / chemical dermatitis",
"IMPORTANT: Stoma shrinks over 4-6 weeks → re-measure and resize regularly",
"Sizes available: 25-100 mm diameter",
],
answerBg: C.lightTeal,
});
flashcard({
num: 6, total, section: SA, sectionColor: C.teal,
question: "What is Stomahesive and what is it made of?",
answers: [
"A skin barrier material used in flanges and as a standalone protective sheet",
"Composition: Sodium carboxymethyl cellulose + gelatin + pectin + polyisobutylene",
"Properties: Non-reactive to skin; sticks to MOIST surfaces; mouldable to skin contours; easily cut with scissors",
"Uses: As flange baseplate material; as paste to fill skin irregularities; as protective sheet around stoma",
],
answerBg: C.lightTeal,
});
flashcard({
num: 7, total, section: SA, sectionColor: C.teal,
question: "Name 6 key stoma care accessories and their purposes",
answers: [
"Karaya gum/paste → fills skin irregularities; excellent protectant",
"Stomahesive paste → barrier; sticks to moist skin; mouldable",
"Barrier creams → protect skin from enzymatic excoriation",
"Charcoal filter (Filtrodor) → gas escapes silently; odour trapped",
"Waist belt → extra security to prevent bag detachment",
"Hernia support belt → reduces parastomal hernia bulge; aids bag adhesion",
"Plastic cap → used by irrigation/natural method patients between evacuations",
],
answerBg: C.lightTeal,
});
tableCard({
num: 8, total, section: SA, sectionColor: C.teal,
question: "Which appliance type for which stoma? Quick reference",
headers: ["Stoma Type", "Bag Type", "Why"],
rows: [
["Ileostomy", "Drainable (ALWAYS)", "Liquid output; enzyme-rich"],
["Sigmoid colostomy", "Non-drainable", "Formed stool"],
["Transverse colostomy", "Drainable (large)", "Semi-liquid; near belt line"],
["Right/Ascending colostomy", "Drainable", "Liquid, enzyme-rich like ileostomy"],
["Urostomy / Ileal conduit", "Drainable (urostomy bag)", "Continuous urine output"],
],
});
flashcard({
num: 9, total, section: SA, sectionColor: C.teal,
question: "How often should the flange be changed for an ileostomy?",
answers: [
"EVERY 4-5 DAYS (not more frequently - reduces skin trauma)",
"The bag is DRAINED (emptied) whenever half-full - independent of flange change",
"Two-piece: bag changed more frequently; baseplate (flange) every 4-5 days",
"AVOID changing the flange too often - each removal strips the skin barrier and causes trauma",
"Stoma shrinks over weeks 1-6 → re-measure and resize aperture each flange change during this period",
],
answerBg: C.lightTeal,
});
flashcard({
num: 10, total, section: SA, sectionColor: C.teal,
question: "What are the THREE methods of long-term sigmoid colostomy management?",
answers: [
"1. NATURAL METHOD - relies on predictable daily action (stimulus-triggered); plastic cap between actions; no bag needed",
"2. APPLIANCE METHOD (most common) - non-drainable bags changed after each action; Stomahesive base stays in place",
"3. IRRIGATION METHOD - 750-1000 ml water instilled every 24-48 h; colon evacuates in 10-30 min; no bag needed between irrigations",
],
answerBg: C.lightTeal,
});
flashcard({
num: 11, total, section: SA, sectionColor: C.teal,
question: "Describe the colostomy irrigation technique step by step",
answers: [
"1. Patient sits on toilet; plastic cone connected to reservoir at head height",
"2. Gently insert cone into stoma (cone design = NO perforation risk)",
"3. Run 750-1000 ml room-temperature water into colon",
"4. Apply long plastic sleeve over stoma; direct into toilet bowl",
"5. Colon evacuates in 10-30 minutes",
"6. Fold and clip sleeve; patient ambulates; residual evacuation continues",
"7. Remove sleeve; clean stoma; apply adhesive stoma seal",
"Frequency: Every 24-48 hours | Start: 2-4 weeks postop under stoma therapist supervision",
],
answerBg: C.lightTeal,
});
// ─── SECTION 2: COMPLICATIONS ─────────────────────────────────────
sectionDivider("SECTION 2", "Stoma Complications", C.red);
const SC = "SECTION 2 · Complications";
flashcard({
num: 12, total, section: SC, sectionColor: C.red,
question: "How do you assess stoma viability in the immediate postoperative period?",
answers: [
"Apply TRANSLUCENT bag at end of surgery → allows inspection without removal",
"Inspect DAILY through transparent bag for first 48 hours",
"COLOUR: pink/red + moist = healthy",
"ISCHAEMIA: dusky/dark → use PAEDIATRIC PROCTOSCOPE to assess depth below fascia",
"VIABILITY TEST: viable stoma BLEEDS when gently pricked with a needle",
"If necrosis ABOVE fascia → observe (may slough; worst result = stenosis)",
"If necrosis BELOW fascia → URGENT SURGICAL REVISION",
],
answerBg: C.lightRed,
textColor: C.dark,
});
flashcard({
num: 13, total, section: SC, sectionColor: C.red,
question: "Stoma ISCHAEMIA - causes, features, and management",
answers: [
"CAUSES: Inadequate blood supply at creation; excessive tension; too-small aperture compressing mesentery; twisting of mesentery",
"FEATURES: Dusky, dark, or black coloured mucosa (vs healthy pink); usually evident Day 0-2",
"ASSESSMENT: Paediatric proctoscope to check viability below fascia level",
"Mx if SUPERFICIAL (above fascia): observe; will slough → may stenose later",
"Mx if BELOW FASCIA: urgent reoperation and stoma refashioning",
],
answerBg: C.lightRed,
});
flashcard({
num: 14, total, section: SC, sectionColor: C.red,
question: "Stoma RETRACTION - causes, features, management",
answers: [
"DEFINITION: Stoma recedes below the skin surface",
"CAUSES: Obesity (subcutaneous fat too thick); tension at creation; ischaemia/necrosis; weight gain postop",
"FEATURES: Leakage (effluent pools around retracted stoma); skin excoriation; appliance failure",
"Mx CONSERVATIVE: Convex baseplate/flange; karaya paste to build up skin contour; stoma nurse review",
"Mx SURGICAL: Stoma refashioning/revision if conservative measures fail",
],
answerBg: C.lightRed,
});
flashcard({
num: 15, total, section: SC, sectionColor: C.red,
question: "Stoma PROLAPSE - causes, features, management",
answers: [
"DEFINITION: Bowel protrudes excessively above skin level",
"CAUSES: Loop stomas (especially transverse loop colostomy); obesity; increased intra-abdominal pressure; parastomal hernia; pregnancy",
"FEATURES: Unsightly; appliance difficulties; risk of ischaemia if tightly prolapsed",
"Mx CONSERVATIVE: Hernia belt with prolapse cover; revised pouching system",
"Mx SURGICAL: Convert to end stoma; local resection of redundant bowel",
"EMERGENCY: Obstruction, ischaemia, incarceration → urgent surgery",
"Reduction: gentle pressure supine; sugar applied to mucosa draws out oedema to aid reduction",
],
answerBg: C.lightRed,
});
flashcard({
num: 16, total, section: SC, sectionColor: C.red,
question: "Stoma STENOSIS - causes, features, management",
answers: [
"DEFINITION: Narrowing of the stoma lumen",
"CAUSES: Ischaemia at original creation; Crohn's disease recurrence; mucocutaneous separation with fibrotic healing",
"FEATURES: Difficulty passing stool; ribbon-like stools; obstruction",
"Mx: Minor degrees → regular dilatation with finger or dilator",
"Mx: Severe or recurrent → surgical revision/refashioning",
],
answerBg: C.lightRed,
});
flashcard({
num: 17, total, section: SC, sectionColor: C.red,
question: "Mucocutaneous separation - causes and management",
answers: [
"DEFINITION: Separation of the mucocutaneous suture line around the stoma",
"CAUSES: Ischaemia; wound infection; malnutrition; steroid use; sutures cutting through tissue",
"FEATURES: Raw, exposed area around the stoma; appliance sealing becomes difficult",
"MANAGEMENT: Usually conservative with intensive stoma care; barrier products to protect exposed tissue; wound packing if deep; allow to heal by secondary intention",
"Worst outcome: fibrotic healing → stenosis",
],
answerBg: C.lightRed,
});
flashcard({
num: 18, total, section: SC, sectionColor: C.red,
question: "HIGH OUTPUT ILEOSTOMY - definition, causes, management",
answers: [
"DEFINITION: Output >1000 ml/day (normal ~500 ml/day)",
"RISK: Sodium + potassium depletion; dehydration; renal stones (uric acid + oxalate)",
"CAUSES: Subacute SBO; Crohn's disease; short bowel syndrome; antibiotics; laxatives; diet (onions, vegetables, alcohol)",
"Mx: Loperamide (first line); codeine; Lomotil (diphenoxylate + atropine)",
"Mx: Oral rehydration solution (high sodium); dietary modification",
"Mx: Restrict high-oxalate foods (spinach, leafy greens) → reduces renal stone risk",
"Mx: Treat underlying cause (obstruction, Crohn's flare)",
],
answerBg: C.lightRed,
});
flashcard({
num: 19, total, section: SC, sectionColor: C.red,
question: "PERISTOMAL SKIN EXCORIATION - causes and management",
answers: [
"CAUSE: Effluent contacts peristomal skin (ileostomy worst - proteolytic enzymes)",
"Usually due to: wrong aperture size (too large); leakage; poor adhesion",
"FEATURES: Erythema, ulceration, pain, weeping skin around stoma",
"Mx: Correct aperture size (snug fit); karaya paste / Stomahesive paste to fill gaps",
"Mx: Barrier creams; protective Stomahesive sheet under flange",
"Mx: Stoma nurse review; may need convex baseplate if skin contour irregular",
],
answerBg: C.lightRed,
});
flashcard({
num: 20, total, section: SC, sectionColor: C.red,
question: "ALLERGIC CONTACT DERMATITIS around a stoma - how to diagnose and treat",
answers: [
"DIAGNOSIS: Rash and erythema corresponds EXACTLY to the shape/outline of the appliance",
"→ This pattern distinguishes allergy from chemical excoriation (which is around the stoma itself)",
"CAUSE: Allergy to adhesive component of the flange; uncommon but important",
"MANAGEMENT:",
"Remove appliance; gently clean skin",
"Apply Stomahesive sheet or karaya sheet to skin before reapplying bag",
"May need steroid cream for severe reactions",
"Switch to hypoallergenic appliance if available",
],
answerBg: C.lightRed,
});
flashcard({
num: 21, total, section: SC, sectionColor: C.red,
question: "FUNGAL INFECTION (Candida) around a stoma - features and management",
answers: [
"SETTING: Occurs in moist, excoriated peristomal skin under the flange",
"FEATURES: Satellite lesions; erythematous rash with papules; itching; classic candidal appearance",
"Predisposed by: antibiotics; diabetes; immunosuppression; prolonged skin moisture",
"MANAGEMENT: Antifungal powder (e.g. nystatin or clotrimazole) applied to the skin under the flange before application",
"Treat underlying cause (e.g. hyperglycaemia); address moisture/leakage causing maceration",
],
answerBg: C.lightRed,
});
// ─── SECTION 3: PARASTOMAL HERNIA ────────────────────────────────
sectionDivider("SECTION 3", "Parastomal Hernia", C.purple);
const PH = "SECTION 3 · Parastomal Hernia";
flashcard({
num: 22, total, section: PH, sectionColor: C.purple,
question: "Define parastomal hernia and give its incidence",
answers: [
"DEFINITION: Herniation of abdominal contents (bowel or fat) through the fascial defect ADJACENT to the stoma",
"Creating a stoma inherently creates a potential hernia - the fascia defect tends to enlarge over time",
"INCIDENCE: >50% at 5 years (Bailey & Love)",
"Most common complaint: difficulty fitting and maintaining the stoma appliance",
"Risk directly proportional to length of time the stoma has been present (Fischer's)",
],
answerBg: C.lightPurple,
});
flashcard({
num: 23, total, section: PH, sectionColor: C.purple,
question: "What are the CAUSES and RISK FACTORS for parastomal hernia?",
answers: [
"TECHNICAL: Aperture too large; stoma outside rectus muscle (most preventable); excessive tension; failed bowel anchoring",
"PATIENT: Obesity/high BMI; smoking; poorly controlled diabetes; malnutrition; steroids/immunosuppression",
"MECHANICAL: Chronic cough or straining (raised IAP); weight gain after surgery",
"TIME: Risk directly proportional to duration of stoma",
"KEY PREVENTION: Site within rectus abdominis + correct aperture size (two-finger rule)",
],
answerBg: C.lightPurple,
});
flashcard({
num: 24, total, section: PH, sectionColor: C.purple,
question: "Clinical features of parastomal hernia",
answers: [
"Bulge or swelling ADJACENT to the stoma (visible on coughing/straining/standing)",
"Most common complaint: DIFFICULTY FITTING/MAINTAINING APPLIANCE",
"Leakage due to poor bag adhesion over the bulge",
"Peristomal skin excoriation secondary to leakage",
"Intermittent stoma obstruction",
"Pain or discomfort around the stoma",
"EMERGENCY: acute obstruction or strangulation of herniated bowel",
],
answerBg: C.lightPurple,
});
tableCard({
num: 25, total, section: PH, sectionColor: C.purple,
question: "Parastomal hernia repair options - techniques and recurrence rates",
headers: ["Technique", "Description", "Recurrence"],
rows: [
["Primary suture", "Simple fascial closure", "~100% - AVOID alone"],
["Stoma relocation", "Move to opposite side", "Same rate - NOT recommended"],
["Keyhole mesh", "Mesh with central aperture; onlay/sublay/intraperitoneal", "21-73%"],
["Sugarbaker (BEST)", "Underlay mesh; stoma exits LATERAL to defect (no hole)", "7-15%"],
["Lap. Sugarbaker", "Laparoscopic version; equivalent outcomes", "7-15%"],
["Stoma reversal", "Restore bowel continuity; eliminates problem", "N/A - IDEAL"],
],
});
flashcard({
num: 26, total, section: PH, sectionColor: C.purple,
question: "Why is the Sugarbaker technique preferred over the keyhole mesh technique?",
answers: [
"KEYHOLE: Mesh has central aperture through which bowel passes → weak point; recurrence 21-73%",
"SUGARBAKER: Large underlay mesh placed intraperitoneally; the stoma limb exits LATERAL to the fascial defect",
"→ No central hole = mesh covers the entire defect",
"→ Bowel sandwiched between mesh and anterior abdominal wall",
"→ Recurrence only 7-15%",
"Mesh infection rate: only 2-2.6% in large series (much lower than historically feared)",
"Laparoscopic Sugarbaker achieves equivalent recurrence rates to open",
],
answerBg: C.lightPurple,
});
flashcard({
num: 27, total, section: PH, sectionColor: C.purple,
question: "How do you PREVENT a parastomal hernia at the time of stoma creation?",
answers: [
"1. SITE within the RECTUS ABDOMINIS MUSCLE (single most important step)",
"2. Correct aperture - TWO-FINGER RULE (not so large as to cause hernia)",
"3. NO TENSION on the mesentery - mobilise bowel adequately",
"4. Prophylactic MESH at creation: large-pore polypropylene in retromuscular space",
" → Meta-analysis of 12 RCTs: reduces hernia by ~40%",
" → BUT: recent 5-year RCTs show NO clear advantage (Sabiston)",
"5. Patient optimisation: weight loss, smoking cessation, glucose control",
],
answerBg: C.lightPurple,
});
// ─── FINAL SUMMARY CARD ──────────────────────────────────────────
sectionDivider("RAPID REVIEW", "Complications at a Glance", C.navy);
tableCard({
num: 28, total, section: "RAPID REVIEW · All Complications",
sectionColor: C.navy,
question: "All stoma complications - timing, key feature, key action",
headers: ["Complication", "Timing", "Key Feature", "Key Action"],
rows: [
["Ischaemia", "Day 0-2", "Dusky/black stoma", "Proctoscope → if below fascia: urgent surgery"],
["Mucocutaneous separation", "Early", "Raw ring around stoma", "Conservative care; wound packing"],
["High output (ileo)", "Early", ">1000 ml/day", "Loperamide; rehydrate; diet"],
["Retraction", "Early/Late", "Stoma sinks below skin", "Convex appliance → refashion if fails"],
["Prolapse", "Late", "Bowel protrudes excessively", "Belt; convert to end stoma"],
["Stenosis", "Late", "Narrowing, obstruction", "Dilatation → revision"],
["Parastomal hernia", "Late", "Bulge; appliance failure", "Belt → Sugarbaker mesh repair"],
["Skin excoriation", "Any", "Erythema/ulceration", "Correct aperture; barrier products"],
],
});
// ── Write file ───────────────────────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/workspace/stoma-study/Stoma_Flashcards.pptx" })
.then(() => console.log("SUCCESS: Stoma_Flashcards.pptx created"))
.catch(e => { console.error("ERROR:", e); process.exit(1); });
cd /home/daytona/workspace/stoma-study && node flashcards.js 2>&1
ls -lh /home/daytona/workspace/stoma-study/Stoma_Flashcards.pptx && python3 -c " import zipfile z = zipfile.ZipFile('/home/daytona/workspace/stoma-study/Stoma_Flashcards.pptx') slides = [f for f in z.namelist() if f.startswith('ppt/slides/slide') and f.endswith('.xml')] print(f'Total slides: {len(slides)}') "
Stoma Flashcards
Presentation · PPTX
| # | Topic |
|---|---|
| 1 | Two main components of every appliance |
| 2 | One-piece vs Two-piece comparison |
| 3 | Drainable vs Non-drainable - when to use each |
| 4 | Why empty when half-full |
| 5 | Choosing correct aperture size |
| 6 | What is Stomahesive (composition + properties) |
| 7 | 6 key accessories and their purposes |
| 8 | Which appliance for which stoma (table) |
| 9 | Flange change frequency for ileostomy |
| 10 | Three methods of long-term colostomy management |
| 11 | Colostomy irrigation technique - step by step |