Create a comprehensive, well detailed note for an MBBS student, for deep learning and passing of exams on these surgery topics: Chemotherapy in surgery Antibiotics in surgery Obstructive uropathy Intestinal obstruction Wounds in Surgery Tracheostomy Resuscitation in Surgery
mkdir -p /home/daytona/workspace/mbbs-surgery-notes && ls /home/daytona/workspac…
~/mbbs-surgery-notes/create_notes.js
const {
Document, Packer, Paragraph, TextRun, Table, TableRow, TableCell,
HeadingLevel, AlignmentType, BorderStyle, WidthType, ShadingType,
PageNumber, NumberFormat, Header, Footer, TableOfContents,
UnderlineType, PageBreak
} = require('docx');
const fs = require('fs');
// ─── Color Palette ─────────────────────────────────────────────────────────
const DARK_BLUE = "1A3A5C";
const MED_BLUE = "2563A8";
const LIGHT_BLUE = "D6E4F7";
const ACCENT_RED = "C0392B";
const ACCENT_GREEN= "1A6B3C";
const ACCENT_AMBER= "7B5800";
const BG_AMBER = "FFF8DC";
const BG_GREEN = "EAF7EE";
const BG_RED = "FDF2F2";
const WHITE = "FFFFFF";
const LIGHT_GREY = "F5F7FA";
const MID_GREY = "E8ECF2";
const DARK_TEXT = "1C2833";
// ─── Helper: main title ────────────────────────────────────────────────────
function mainTitle(text) {
return new Paragraph({
heading: HeadingLevel.TITLE,
alignment: AlignmentType.CENTER,
shading: { type: ShadingType.SOLID, color: DARK_BLUE, fill: DARK_BLUE },
spacing: { before: 0, after: 200 },
children: [new TextRun({ text, color: WHITE, bold: true, size: 52, font: "Calibri" })]
});
}
function subTitleLine(text) {
return new Paragraph({
alignment: AlignmentType.CENTER,
shading: { type: ShadingType.SOLID, color: MED_BLUE, fill: MED_BLUE },
spacing: { before: 0, after: 400 },
children: [new TextRun({ text, color: WHITE, size: 24, font: "Calibri", italics: true })]
});
}
// ─── Helper: topic section header ─────────────────────────────────────────
function sectionHeader(num, title) {
return new Paragraph({
heading: HeadingLevel.HEADING_1,
shading: { type: ShadingType.SOLID, color: DARK_BLUE, fill: DARK_BLUE },
spacing: { before: 480, after: 120 },
children: [
new TextRun({ text: ` ${num}. ${title} `, color: WHITE, bold: true, size: 36, font: "Calibri" })
]
});
}
// ─── Helper: sub-heading ──────────────────────────────────────────────────
function h2(text) {
return new Paragraph({
heading: HeadingLevel.HEADING_2,
shading: { type: ShadingType.SOLID, color: LIGHT_BLUE, fill: LIGHT_BLUE },
spacing: { before: 280, after: 80 },
border: { left: { style: BorderStyle.SINGLE, size: 18, color: MED_BLUE } },
children: [new TextRun({ text: ` ${text}`, color: DARK_BLUE, bold: true, size: 26, font: "Calibri" })]
});
}
function h3(text) {
return new Paragraph({
heading: HeadingLevel.HEADING_3,
spacing: { before: 200, after: 60 },
children: [new TextRun({ text, color: MED_BLUE, bold: true, size: 24, font: "Calibri", underline: { type: UnderlineType.SINGLE } })]
});
}
// ─── Helper: body paragraph ───────────────────────────────────────────────
function body(text, options = {}) {
return new Paragraph({
spacing: { before: 60, after: 80 },
indent: options.indent ? { left: 360 } : {},
children: [new TextRun({ text, size: 22, font: "Calibri", color: DARK_TEXT, ...options.run })]
});
}
// ─── Helper: bullet point ─────────────────────────────────────────────────
function bullet(text, level = 0, bold = false) {
return new Paragraph({
bullet: { level },
spacing: { before: 40, after: 40 },
indent: { left: 360 + level * 360, hanging: 260 },
children: [new TextRun({ text, size: 22, font: "Calibri", color: DARK_TEXT, bold })]
});
}
// ─── Helper: key point box (shaded) ───────────────────────────────────────
function keyBox(label, text, bgColor = BG_AMBER, textColor = ACCENT_AMBER) {
return new Paragraph({
shading: { type: ShadingType.SOLID, color: bgColor, fill: bgColor },
spacing: { before: 120, after: 120 },
border: { left: { style: BorderStyle.THICK, size: 20, color: textColor } },
children: [
new TextRun({ text: `${label}: `, bold: true, size: 22, font: "Calibri", color: textColor }),
new TextRun({ text, size: 22, font: "Calibri", color: DARK_TEXT })
]
});
}
// ─── Helper: exam high-yield box ─────────────────────────────────────────
function examBox(text) {
return new Paragraph({
shading: { type: ShadingType.SOLID, color: BG_RED, fill: BG_RED },
spacing: { before: 100, after: 100 },
border: {
top: { style: BorderStyle.SINGLE, size: 8, color: ACCENT_RED },
bottom: { style: BorderStyle.SINGLE, size: 8, color: ACCENT_RED },
left: { style: BorderStyle.THICK, size: 24, color: ACCENT_RED },
right: { style: BorderStyle.SINGLE, size: 8, color: ACCENT_RED },
},
children: [
new TextRun({ text: "EXAM HIGH-YIELD: ", bold: true, size: 22, font: "Calibri", color: ACCENT_RED }),
new TextRun({ text, size: 22, font: "Calibri", color: DARK_TEXT })
]
});
}
// ─── Helper: simple two-column table ─────────────────────────────────────
function twoColTable(rows, header1 = "Item", header2 = "Detail") {
const makeCell = (text, isHeader = false, bg = null) => new TableCell({
shading: isHeader
? { type: ShadingType.SOLID, color: DARK_BLUE, fill: DARK_BLUE }
: bg ? { type: ShadingType.SOLID, color: bg, fill: bg } : {},
margins: { top: 80, bottom: 80, left: 120, right: 120 },
children: [new Paragraph({
children: [new TextRun({ text, bold: isHeader, color: isHeader ? WHITE : DARK_TEXT, size: 21, font: "Calibri" })]
})]
});
return new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
rows: [
new TableRow({ children: [makeCell(header1, true), makeCell(header2, true)], tableHeader: true }),
...rows.map((r, i) => new TableRow({
children: [makeCell(r[0], false, i % 2 === 0 ? WHITE : LIGHT_GREY), makeCell(r[1], false, i % 2 === 0 ? WHITE : LIGHT_GREY)]
}))
]
});
}
// ─── Helper: three-column table ───────────────────────────────────────────
function threeColTable(rows, h1, h2, h3t) {
const makeCell = (text, isHeader = false, bg = null) => new TableCell({
shading: isHeader ? { type: ShadingType.SOLID, color: DARK_BLUE, fill: DARK_BLUE } : bg ? { type: ShadingType.SOLID, color: bg, fill: bg } : {},
margins: { top: 80, bottom: 80, left: 100, right: 100 },
children: [new Paragraph({ children: [new TextRun({ text, bold: isHeader, color: isHeader ? WHITE : DARK_TEXT, size: 21, font: "Calibri" })] })]
});
return new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
rows: [
new TableRow({ children: [makeCell(h1, true), makeCell(h2, true), makeCell(h3t, true)], tableHeader: true }),
...rows.map((r, i) => new TableRow({ children: r.map(c => makeCell(c, false, i % 2 === 0 ? WHITE : LIGHT_GREY)) }))
]
});
}
function spacer() {
return new Paragraph({ spacing: { before: 80, after: 80 }, children: [new TextRun("")] });
}
function pageBreak() {
return new Paragraph({ children: [new PageBreak()] });
}
// ═══════════════════════════════════════════════════════════════════════════
// DOCUMENT CONTENT
// ═══════════════════════════════════════════════════════════════════════════
const children = [
// ── COVER ──────────────────────────────────────────────────────────────
mainTitle("SURGERY"),
subTitleLine("Comprehensive MBBS Notes for Deep Learning & Exam Excellence"),
spacer(),
new Paragraph({ alignment: AlignmentType.CENTER, spacing: { before: 40, after: 40 }, children: [new TextRun({ text: "Topics Covered:", bold: true, size: 26, color: DARK_BLUE, font: "Calibri" })] }),
new Paragraph({ alignment: AlignmentType.CENTER, spacing: { before: 20, after: 200 }, children: [new TextRun({ text: "Chemotherapy | Antibiotics | Obstructive Uropathy | Intestinal Obstruction | Wounds | Tracheostomy | Resuscitation", size: 22, color: MED_BLUE, font: "Calibri" })] }),
pageBreak(),
// ══════════════════════════════════════════════════════════════════════
// TOPIC 1: CHEMOTHERAPY IN SURGERY
// ══════════════════════════════════════════════════════════════════════
sectionHeader(1, "CHEMOTHERAPY IN SURGERY"),
h2("1.1 Introduction & Definition"),
body("Chemotherapy refers to the use of chemical agents (drugs) to destroy or inhibit the growth of rapidly dividing cancer cells. In surgery, it is used in combination with operative treatment either to shrink tumors before surgery (neoadjuvant), destroy residual cells after surgery (adjuvant), or as the primary modality when surgery is not feasible (definitive/palliative)."),
spacer(),
h2("1.2 Classification of Chemotherapy Agents"),
h3("A. Alkylating Agents"),
bullet("Mechanism: Cross-link DNA strands → prevent replication"),
bullet("Examples: Cyclophosphamide, Chlorambucil, Melphalan, Busulfan, Ifosfamide, Cisplatin, Carboplatin"),
bullet("Key uses in surgery: Breast cancer, ovarian cancer, lymphomas, sarcomas"),
bullet("Toxicity: Bone marrow suppression, hemorrhagic cystitis (cyclophosphamide), nephrotoxicity (cisplatin)"),
spacer(),
h3("B. Antimetabolites"),
bullet("Mechanism: Structural analogs of normal metabolites → inhibit DNA/RNA synthesis"),
bullet("Examples: 5-Fluorouracil (5-FU), Methotrexate, Gemcitabine, Capecitabine, Pemetrexed"),
bullet("Key uses: Colorectal cancer (5-FU), breast cancer (methotrexate), pancreatic cancer (gemcitabine)"),
bullet("Toxicity: Mucositis, myelosuppression, hepatotoxicity (methotrexate)"),
spacer(),
h3("C. Antitumor Antibiotics"),
bullet("Mechanism: Intercalate DNA or generate free radicals → strand breaks"),
bullet("Examples: Doxorubicin, Bleomycin, Mitomycin C, Actinomycin D"),
bullet("Key uses: Breast, lung, Wilms tumor, osteosarcoma"),
bullet("Toxicity: Cardiotoxicity (doxorubicin - dose-dependent), pulmonary fibrosis (bleomycin)"),
spacer(),
h3("D. Plant Alkaloids (Mitotic Inhibitors)"),
bullet("Vinca Alkaloids: Vincristine, Vinblastine → inhibit microtubule polymerization"),
bullet("Taxanes: Paclitaxel, Docetaxel → stabilize microtubules → prevent depolymerization"),
bullet("Podophyllotoxins: Etoposide, Teniposide → inhibit topoisomerase II"),
bullet("Key uses: Breast, lung, testicular, ovarian cancers"),
bullet("Toxicity: Peripheral neuropathy (vincristine), neutropenia (vinblastine, taxanes)"),
spacer(),
h3("E. Hormonal Agents"),
bullet("Examples: Tamoxifen (SERM), Anastrozole/Letrozole (aromatase inhibitors), Leuprolide (GnRH agonist)"),
bullet("Key uses: Hormone receptor-positive breast cancer, prostate cancer"),
spacer(),
h3("F. Targeted Therapy & Immunotherapy (Modern)"),
bullet("Monoclonal antibodies: Trastuzumab (HER2+), Bevacizumab (anti-VEGF), Cetuximab (anti-EGFR)"),
bullet("Tyrosine kinase inhibitors (TKIs): Imatinib (GIST/CML), Erlotinib, Gefitinib"),
bullet("Checkpoint inhibitors: Pembrolizumab, Nivolumab (anti-PD-1)"),
spacer(),
h2("1.3 Neoadjuvant vs. Adjuvant Chemotherapy"),
twoColTable([
["Definition", "Given BEFORE surgery to downstage tumor", ],
["Purpose", "Reduce tumor size, eradicate micrometastases, assess chemo-sensitivity"],
["Examples", "Breast cancer (AC/TC regimen), rectal cancer (5-FU + radiotherapy), osteosarcoma"],
["Benefit", "May convert unresectable → resectable; allows breast-conserving surgery"],
], "NEOADJUVANT CHEMOTHERAPY", "Details"),
spacer(),
twoColTable([
["Definition", "Given AFTER surgery to destroy residual/micrometastatic cells"],
["Purpose", "Prevent recurrence, improve disease-free and overall survival"],
["Examples", "Colorectal cancer (FOLFOX/CAPOX), breast cancer (AC-T), lung cancer"],
["Timing", "Typically begins 4-6 weeks post-operatively"],
], "ADJUVANT CHEMOTHERAPY", "Details"),
spacer(),
h2("1.4 Chemotherapy in Specific Surgical Cancers"),
threeColTable([
["Colorectal Cancer", "FOLFOX (5-FU+Leucovorin+Oxaliplatin) or CAPOX", "Stage III (adjuvant); Stage II high-risk"],
["Breast Cancer", "AC-T (Adriamycin+Cyclophosphamide then Taxol)", "Neoadjuvant + adjuvant"],
["Gastric Cancer", "ECF (Epirubicin+Cisplatin+5-FU)", "Perioperative (FLOT preferred now)"],
["GIST", "Imatinib (targeted)", "Adjuvant or unresectable GIST"],
["Osteosarcoma", "MAP (Methotrexate+Adriamycin+Cisplatin)", "Neoadjuvant + adjuvant"],
["Wilms Tumor", "Vincristine + Actinomycin D", "Post-nephrectomy (adjuvant)"],
["Bladder Cancer", "MVAC or Gemcitabine+Cisplatin", "Neoadjuvant (muscle-invasive)"],
["Ovarian Cancer", "Carboplatin + Paclitaxel", "After debulking surgery"],
], "Cancer", "Regimen", "Role"),
spacer(),
h2("1.5 Intraperitoneal Chemotherapy (HIPEC)"),
body("Hyperthermic Intraperitoneal Chemotherapy (HIPEC) is administered directly into the peritoneal cavity during surgery at 40-42°C."),
bullet("Indications: Peritoneal carcinomatosis from colorectal cancer, ovarian cancer, pseudomyxoma peritonei, mesothelioma"),
bullet("Drugs used: Mitomycin C, Oxaliplatin, Cisplatin"),
bullet("Rationale: High local drug concentration with minimal systemic toxicity; hyperthermia enhances drug penetration"),
spacer(),
h2("1.6 Side Effects & Surgical Implications"),
twoColTable([
["Myelosuppression", "Neutropenia → increased infection risk. Delay surgery if ANC < 1000/µL"],
["Wound healing impairment", "Antimetabolites and alkylating agents impair fibroblast proliferation"],
["Thrombocytopenia", "Increased bleeding risk perioperatively. Transfuse if platelets < 50,000"],
["Anemia", "Fatigue; may need transfusion before surgery"],
["Mucositis/GI effects", "Poor nutrition → impaired healing; consider TPN"],
["Cardiotoxicity", "Doxorubicin: cardiomyopathy. Assess cardiac function before major surgery"],
["Nephrotoxicity", "Cisplatin: assess renal function; adjust doses/avoid nephrotoxic anesthetics"],
["Immunosuppression", "Increased SSI risk; consider antibiotic prophylaxis carefully"],
], "Side Effect", "Surgical Consideration"),
spacer(),
examBox("Neoadjuvant chemo for breast cancer enables breast-conserving surgery. 5-FU is the backbone of colorectal cancer chemotherapy. Cisplatin is nephrotoxic. Doxorubicin is cardiotoxic. HIPEC uses Mitomycin C for peritoneal carcinomatosis."),
pageBreak(),
// ══════════════════════════════════════════════════════════════════════
// TOPIC 2: ANTIBIOTICS IN SURGERY
// ══════════════════════════════════════════════════════════════════════
sectionHeader(2, "ANTIBIOTICS IN SURGERY"),
h2("2.1 Classification of Surgical Wounds (CDC Classification)"),
body("The risk of surgical site infection (SSI) depends on wound classification:"),
twoColTable([
["Class I – Clean", "No infection, no GI/GU/respiratory tract entered. SSI rate: 1-5%. E.g., hernia repair, thyroid surgery. Usually NO prophylaxis needed unless implant used."],
["Class II – Clean-Contaminated", "Controlled entry into GI/GU/respiratory tract. SSI rate: 5-15%. E.g., elective bowel surgery, cholecystectomy. Prophylaxis RECOMMENDED."],
["Class III – Contaminated", "Open fresh traumatic wounds, major break in sterile technique, GI spillage. SSI rate: 15-30%. Prophylaxis required + consider therapeutic antibiotics."],
["Class IV – Dirty/Infected", "Old traumatic wounds, perforated viscus, existing infection. SSI rate: >30%. THERAPEUTIC antibiotics mandatory (not just prophylaxis)."],
], "Class", "Description & Management"),
spacer(),
h2("2.2 Antibiotic Prophylaxis in Surgery"),
h3("Principles of Effective Prophylaxis"),
bullet("Timing: Administer IV within 60 minutes BEFORE skin incision (30 min for fluoroquinolones/vancomycin)"),
bullet("Spectrum: Must cover likely pathogens for the specific operation site"),
bullet("Duration: Single dose usually sufficient; re-dose for prolonged surgery (>4h) or significant blood loss (>1.5L)"),
bullet("Continuation: Should NOT be continued beyond 24 hours postoperatively (no benefit, increases resistance)"),
bullet("Route: IV is preferred for rapid attainment of tissue levels"),
spacer(),
h3("Common Prophylactic Regimens by Surgery Type"),
threeColTable([
["Clean – Cardiac/Vascular/Orthopedic (implant)", "Cefazolin (1st gen cephalosporin)", "2g IV; 3g if >120kg"],
["Clean-Contaminated – GI/Colorectal", "Cefoxitin OR Cefazolin + Metronidazole", "Covers gram-neg + anaerobes"],
["Hepatobiliary (cholecystectomy)", "Cefazolin", "2g IV pre-incision"],
["Head & Neck (contaminated)", "Clindamycin + Aminoglycoside (Gentamicin)", "Covers oral flora"],
["Urologic procedures", "Ciprofloxacin OR Trimethoprim-sulfamethoxazole", "Per AUA guidelines"],
["Appendectomy", "Cefoxitin OR Cefazolin + Metronidazole", "Single dose pre-op"],
["Penicillin allergy", "Clindamycin OR Vancomycin + Aztreonam", "For beta-lactam allergy"],
["MRSA colonized patients", "Add Vancomycin", "15mg/kg IV"],
], "Procedure", "Agent", "Notes"),
spacer(),
h2("2.3 Therapeutic Antibiotics in Surgery"),
body("Used when established infection is present (Class III/IV wounds, post-op infections, sepsis)."),
h3("Common Surgical Infections and Antibiotic Coverage"),
threeColTable([
["Intra-abdominal sepsis / peritonitis", "Piperacillin-tazobactam OR Meropenem", "Add Metronidazole if anaerobic coverage insufficient"],
["Surgical site infection (SSI)", "Cloxacillin/Flucloxacillin (if S. aureus)", "Adjust after culture results"],
["MRSA wound infection", "Vancomycin OR Linezolid", "Target trough 15-20 mg/L for vanco"],
["Gram-negative sepsis (post-op)", "Ceftriaxone OR Piperacillin-tazobactam", "Cover Pseudomonas if hospital-acquired"],
["Clostridial myonecrosis (gas gangrene)", "High-dose Penicillin G + Clindamycin", "Surgical debridement ESSENTIAL"],
["Necrotizing fasciitis", "Meropenem + Vancomycin + Clindamycin", "Urgent surgical debridement"],
["Biliary sepsis / cholangitis", "Piperacillin-tazobactam OR Ciprofloxacin + Metronidazole", "Early biliary decompression"],
["Pseudomembranous colitis (C. diff)", "Oral Vancomycin OR Fidaxomicin", "Stop precipitating antibiotics"],
], "Infection", "First-line Agent", "Notes"),
spacer(),
h2("2.4 Mechanism of Action (by class)"),
twoColTable([
["Beta-lactams (Penicillins, Cephalosporins, Carbapenems)", "Inhibit bacterial cell wall synthesis (bind PBPs)"],
["Aminoglycosides (Gentamicin, Amikacin)", "Bind 30S ribosomal subunit → misreading of mRNA (bactericidal)"],
["Fluoroquinolones (Ciprofloxacin, Levofloxacin)", "Inhibit DNA gyrase (topoisomerase II) and topoisomerase IV"],
["Macrolides (Erythromycin, Azithromycin)", "Bind 50S ribosomal subunit → inhibit translocation (bacteriostatic)"],
["Metronidazole", "Forms toxic nitroso radicals → DNA strand breaks (anaerobes/protozoa)"],
["Vancomycin", "Inhibits cell wall peptidoglycan synthesis (binds D-Ala-D-Ala)"],
["Clindamycin", "Binds 50S ribosomal subunit; covers MRSA and anaerobes"],
["Linezolid", "Binds 50S subunit; prevents formation of initiation complex (MRSA)"],
], "Class / Drug", "Mechanism"),
spacer(),
h2("2.5 Antimicrobial Resistance in Surgery"),
bullet("MRSA (Methicillin-resistant S. aureus): Common SSI pathogen; treat with Vancomycin/Linezolid"),
bullet("ESBL-producing Enterobacteriaceae: Resistant to cephalosporins; use Meropenem/Ertapenem"),
bullet("Carbapenem-resistant Enterobacteriaceae (CRE): Treat with Colistin, Ceftazidime-avibactam"),
bullet("Pseudomonas aeruginosa: Treat with Piperacillin-tazobactam, Cefepime, or Carbapenems"),
bullet("C. difficile: Caused by overgrowth after broad-spectrum antibiotic use; treat with oral Vancomycin"),
spacer(),
keyBox("PRINCIPLE", "The goal of prophylaxis is to provide tissue-level drug coverage at time of incision - NOT to sterilize the field or treat infection. Post-operative continuation beyond 24h increases resistance without benefit.", BG_GREEN, ACCENT_GREEN),
spacer(),
examBox("Cefazolin is the most commonly used prophylactic antibiotic. Give antibiotics within 60 min before incision. Never continue prophylaxis beyond 24 hours. Necrotizing fasciitis requires urgent surgery + Meropenem+Vancomycin+Clindamycin. C. diff colitis: oral Vancomycin/Fidaxomicin."),
pageBreak(),
// ══════════════════════════════════════════════════════════════════════
// TOPIC 3: OBSTRUCTIVE UROPATHY
// ══════════════════════════════════════════════════════════════════════
sectionHeader(3, "OBSTRUCTIVE UROPATHY"),
h2("3.1 Definition & Overview"),
body("Obstructive uropathy is a structural or functional obstruction of urine flow at any level of the urinary tract, from the renal calyces to the urethral meatus. It causes upstream dilation (hydronephrosis) and, if uncorrected, leads to obstructive nephropathy (progressive loss of renal function). Approximately 10% of all kidney failure results from obstructive uropathy."),
spacer(),
h2("3.2 Classification"),
h3("By Level of Obstruction"),
twoColTable([
["Upper urinary tract obstruction", "Above the ureterovesical junction (UVJ): pelviureteric junction (PUJ) obstruction, ureteral calculi, ureteral stricture"],
["Lower urinary tract obstruction", "Below UVJ: bladder neck obstruction, BPH, urethral stricture, posterior urethral valves (neonates)"],
["Bilateral obstruction", "BPH, retroperitoneal fibrosis, bilateral ureteral calculi, pelvic malignancy → anuria + AKI"],
["Unilateral obstruction", "Calculus, ureteral stricture, external compression → contralateral kidney compensates"],
], "Type", "Examples"),
spacer(),
h3("By Onset"),
bullet("Acute obstruction: Calculi, blood clots, sloughed papilla"),
bullet("Chronic obstruction: BPH, strictures, malignancy, retroperitoneal fibrosis"),
spacer(),
h2("3.3 Etiology"),
h3("Intrinsic Causes (Within the Lumen)"),
bullet("Calculi (urolithiasis): Most common cause of acute ureteral obstruction; 5-8mm stones often pass spontaneously; >10mm rarely pass"),
bullet("Blood clots: From trauma, tumor, AV malformation"),
bullet("Sloughed papilla: Diabetes, sickle cell disease, analgesic nephropathy"),
bullet("Fungus ball: Immunocompromised patients"),
bullet("Transitional cell carcinoma of ureter/renal pelvis"),
spacer(),
h3("Intrinsic Causes (Within the Wall)"),
bullet("Ureteropelvic junction (UPJ) obstruction: Congenital; most common cause in children"),
bullet("Ureteral strictures: Post-inflammatory (TB, schistosomiasis), iatrogenic (post-surgical, radiation)"),
bullet("Benign prostatic hyperplasia (BPH): Most common cause in men >50 years"),
bullet("Posterior urethral valves: Most common cause of severe obstructive uropathy in male neonates"),
spacer(),
h3("Extrinsic Causes (Outside the Wall)"),
bullet("Malignancy: Cervical, ovarian, prostate, bladder, colorectal cancers; retroperitoneal lymphoma"),
bullet("Retroperitoneal fibrosis (Ormond disease): Fibrous tissue encases ureters"),
bullet("Pregnancy: Physiological hydronephrosis (right > left due to dextrorotation of uterus)"),
bullet("Endometriosis: External compression of ureters"),
bullet("Pelvic inflammatory disease (PID), abdominal aortic aneurysm"),
spacer(),
h2("3.4 Pathophysiology"),
body("Obstruction → increased intraluminal pressure → dilation of collecting system (hydronephrosis) → compression of renal tubules → tubular atrophy → interstitial fibrosis → loss of nephrons → chronic kidney disease."),
bullet("Unilateral obstruction: GFR falls in the obstructed kidney; contralateral kidney compensates → total GFR maintained initially"),
bullet("Bilateral obstruction or single functioning kidney: Serum creatinine rises rapidly → post-renal AKI"),
bullet("Post-obstructive diuresis: After relief of bilateral obstruction → massive polyuria (loss of tubular concentrating ability) → monitor fluid/electrolytes carefully"),
spacer(),
h2("3.5 Clinical Features"),
h3("Symptoms"),
bullet("Renal colic: Severe, colicky flank pain radiating to groin/ipsilateral testis/labia → acute calculus obstruction"),
bullet("Bilateral flank pain + anuria/oliguria → bilateral obstruction (surgical emergency)"),
bullet("Hesitancy, poor stream, incomplete emptying, nocturia → lower tract obstruction (BPH)"),
bullet("Painless progressive renal failure → chronic bilateral obstruction (malignancy, retroperitoneal fibrosis)"),
bullet("Fever + rigors + flank pain (Triad = pyelonephritis) → infected obstructed kidney = EMERGENCY"),
spacer(),
h3("Signs"),
bullet("Flank tenderness (renal punch +ve)"),
bullet("Palpable bladder (>150mL retention) → dull suprapubic region on percussion"),
bullet("Enlarged prostate on DRE"),
bullet("Hypertension (from renin release)"),
spacer(),
h2("3.6 Investigations"),
h3("Laboratory"),
bullet("Serum creatinine & urea: Elevated in bilateral obstruction or single kidney"),
bullet("Urinalysis: Hematuria (calculi), pyuria (infection), casts"),
bullet("Urine culture: If infection suspected (urgent in obstructed infected kidney)"),
bullet("FBC: Leukocytosis (infection), anemia (CKD)"),
bullet("Electrolytes: Hyperkalemia (life-threatening in bilateral obstruction)"),
spacer(),
h3("Imaging"),
twoColTable([
["Ultrasound (KUB)", "FIRST LINE. Shows hydronephrosis and hydroureter. Note: Normal USS in 50% of acute obstruction! Also shows bladder residual volume."],
["Non-contrast CT KUB (NCCT)", "GOLD STANDARD for urolithiasis. Shows calculus location, size, HU density. Detects all radiopaque and radiolucent stones. Identifies level of obstruction."],
["Intravenous Urogram (IVU/IVP)", "Shows anatomical detail + function. Delayed nephrogram + dilated collecting system = obstruction. Being replaced by CT urography."],
["MRI Urography", "For pregnant women (avoids radiation), assessment of soft tissue masses causing obstruction."],
["Cystoscopy + retrograde pyelogram", "Direct visualization of ureteral orifice; retrograde contrast study for ureteral obstruction. Also allows stent placement."],
["Radionuclide scan (MAG-3/DTPA)", "Assesses differential renal function and degree of obstruction (drainage half-time T1/2 > 20 min = obstruction)"],
], "Test", "Details"),
spacer(),
h2("3.7 Management"),
h3("Emergency Management (Obstructed Infected Kidney)"),
body("This is a urological emergency - urgent decompression BEFORE antibiotics can fully work:"),
bullet("IV access + fluid resuscitation"),
bullet("IV broad-spectrum antibiotics (e.g., Piperacillin-tazobactam)"),
bullet("URGENT decompression: Ureteral stent (JJ stent) OR percutaneous nephrostomy (PCN)"),
bullet("PCN preferred if ureteral stent placement fails or patient is too unstable for cystoscopy"),
spacer(),
h3("Definitive Management by Cause"),
twoColTable([
["Ureteral calculus (<10mm)", "Analgesia (NSAIDs/opioids), alpha-blocker (tamsulosin) for medical expulsive therapy, hydration. Monitor 4-6 weeks."],
["Ureteral calculus (>10mm or not passing)", "Ureteroscopy + laser lithotripsy (URS) OR ESWL (extracorporeal shock wave lithotripsy)"],
["Large renal calculus (>2cm)", "Percutaneous nephrolithotomy (PCNL)"],
["Pelviureteric junction obstruction", "Pyeloplasty (Anderson-Hynes pyeloplasty - gold standard); laparoscopic preferred"],
["Benign Prostatic Hyperplasia", "Alpha-blockers (tamsulosin) and 5-alpha reductase inhibitors (finasteride) medically; TURP surgically"],
["Urethral stricture", "Urethral dilatation, urethrotomy, or urethroplasty"],
["Malignant ureteral obstruction", "Ureteral stenting or PCN for relief; treat underlying malignancy"],
["Posterior urethral valves (neonates)", "Urgent catheterization then endoscopic ablation of valves"],
], "Cause", "Management"),
spacer(),
h3("Post-Obstructive Diuresis Management"),
bullet("Monitor urine output hourly"),
bullet("Replace 50-75% of urinary losses with 0.45% NaCl or 0.9% NaCl"),
bullet("Monitor K+, Na+, Ca2+, Mg2+ every 6 hours"),
bullet("Expect resolution within 24-48 hours as tubular function recovers"),
spacer(),
examBox("MOST COMMON causes: BPH (#1 in adult males), calculi (#1 cause of acute colic), UPJ obstruction (#1 in children). GOLD STANDARD imaging: NCCT KUB for calculi. Infected obstructed kidney = EMERGENCY decompression. Post-obstructive diuresis: replace 50-75% of losses."),
pageBreak(),
// ══════════════════════════════════════════════════════════════════════
// TOPIC 4: INTESTINAL OBSTRUCTION
// ══════════════════════════════════════════════════════════════════════
sectionHeader(4, "INTESTINAL OBSTRUCTION"),
h2("4.1 Definition & Classification"),
body("Intestinal obstruction is a failure of normal progression of intestinal contents due to a mechanical or functional (adynamic) barrier. It is a common surgical emergency with high morbidity and mortality if untreated."),
spacer(),
h3("Mechanical vs. Functional (Paralytic Ileus)"),
twoColTable([
["Cause", "Physical blockage of the bowel lumen", "Loss of propulsive peristalsis without mechanical block"],
["Bowel sounds", "Hyperactive early ('tinkling'); then absent", "Absent/diminished throughout"],
["Pain", "Colicky, intermittent", "Constant, diffuse discomfort"],
["X-ray", "Dilated loops proximal to obstruction; collapsed distal", "Uniform dilation of all loops including colon/rectum"],
["Treatment", "Often surgical", "Conservative (treat underlying cause)"],
], "Feature", "Mechanical Obstruction"),
spacer(),
h2("4.2 Causes of Mechanical Obstruction"),
h3("Causes Accounting for 80% of Cases (Key Mnemonic: H-A-I-V)"),
bullet("Hernias: External hernias (inguinal, femoral, umbilical, incisional) - most common cause worldwide"),
bullet("Adhesions: Most common cause in developed countries (following previous abdominal surgery); bands of fibrous tissue"),
bullet("Intussusception: Telescoping of one segment into another; most common in children <2 years (ileo-colic); treat with air enema or surgery"),
bullet("Volvulus: Twisting of bowel on its mesentery; sigmoid colon (#1 site in adults), cecal volvulus, gastric volvulus"),
spacer(),
h3("Other Causes"),
bullet("Tumors: Colorectal carcinoma (#1 cause of large bowel obstruction in adults), lymphoma, carcinoid"),
bullet("Strictures: Crohn's disease, diverticular disease, ischemic strictures, radiation"),
bullet("Gallstone ileus: Gallstone erodes into bowel → Rigler's triad (SBO + pneumobilia + ectopic gallstone)"),
bullet("Intraluminal: Bezoar, foreign body, meconium ileus (neonates with cystic fibrosis)"),
bullet("Hirschsprung disease: Absence of ganglion cells in distal colon → functional obstruction in neonates"),
spacer(),
h2("4.3 Pathophysiology"),
bullet("Obstruction → bowel proximal to blockage distends with gas (swallowed air) and fluid (intestinal secretions)"),
bullet("Distension → increased intraluminal pressure → impaired venous drainage → mucosal edema → increased fluid secretion (vicious cycle)"),
bullet("Fluid sequestration in bowel ('third spacing') → dehydration, hypovolemia, electrolyte imbalances"),
bullet("Vomiting (especially in high SBO) → metabolic alkalosis (loss of HCl), hypokalemia, hyponatremia"),
bullet("Bacterial overgrowth in stagnant intestinal contents → translocation across compromised mucosa → sepsis"),
bullet("Strangulation: Compromise of blood supply → ischemia → gangrene → perforation → peritonitis → fatal if not treated urgently"),
spacer(),
keyBox("STRANGULATION SIGNS", "Tachycardia, fever, localized tenderness, rebound tenderness, WBC >20,000 - if ANY present, urgent surgery needed; cannot be safely observed.", BG_RED, ACCENT_RED),
spacer(),
h2("4.4 Clinical Features"),
h3("Cardinal Features of Small Bowel Obstruction (SBO)"),
bullet("Colicky central/periumbilical abdominal pain: Intermittent; coincides with peristaltic waves"),
bullet("Vomiting: Early, profuse, and bilious/feculent (high SBO: early vomiting; low SBO: late, feculent)"),
bullet("Distension: Moderate; more prominent in low SBO"),
bullet("Absolute constipation (obstipation): Late sign; may pass flatus/stool initially"),
spacer(),
h3("Large Bowel Obstruction (LBO) Features"),
bullet("Later and less frequent vomiting (feculent when present)"),
bullet("Pronounced abdominal distension (especially flanks)"),
bullet("Absolute constipation - earlier sign"),
bullet("Closed loop obstruction possible if ileocecal valve is competent → risk of cecal perforation (Laplace's law)"),
spacer(),
h3("Physical Examination Findings"),
bullet("Inspection: Distension, visible peristalsis (in thin patients), scars (previous surgery - adhesions), hernial orifices"),
bullet("Auscultation: Hyperactive, high-pitched 'tinkling' bowel sounds early; silence later"),
bullet("Percussion: Resonant/tympanic"),
bullet("Palpation: Tenderness (peritonism suggests strangulation/perforation), palpable mass (tumor, intussusception)"),
bullet("ALWAYS examine all hernial orifices (inguinal, femoral, umbilical, incisional) - irreducible hernia = obstruction until proven otherwise"),
bullet("PR examination: Mass (rectal cancer), blood (intussusception, volvulus, ischemia), empty rectum (obstruction above)"),
spacer(),
h2("4.5 Investigations"),
h3("Blood Tests"),
bullet("FBC: Leukocytosis (infection, strangulation)"),
bullet("U&E, Creatinine: Dehydration, AKI, electrolyte imbalances (hypokalemia, hyponatremia)"),
bullet("ABG: Metabolic alkalosis (vomiting), metabolic acidosis (strangulation, bowel ischemia)"),
bullet("Serum lactate: Elevated in bowel ischemia; useful marker of strangulation"),
bullet("CRP, WBC: Markers of severity"),
spacer(),
h3("Imaging"),
twoColTable([
["Erect + Supine AXR (Plain X-ray)", "FIRST-LINE. Dilated bowel loops, multiple fluid levels. SBO: central loops, valvulae conniventes visible (goes wall-to-wall). LBO: peripheral loops, haustrae visible (incomplete, only ½ wall)."],
["CT Abdomen/Pelvis with contrast", "GOLD STANDARD. Identifies: level and cause of obstruction, signs of strangulation (bowel wall thickening, mesenteric edema, pneumatosis), closed loop obstruction, free air."],
["Erect CXR", "To detect free air under diaphragm (perforation)"],
["Water-soluble contrast (Gastrografin)", "In SBO from adhesions: therapeutic (reduces need for surgery) and diagnostic. Can be used in pseudo-obstruction."],
["Colonoscopy", "For LBO: can decompress sigmoid volvulus; take biopsies for tumor diagnosis"],
["USS abdomen", "Useful in children for intussusception (doughnut/target sign); not primary modality in adults"],
], "Investigation", "Findings & Utility"),
spacer(),
h2("4.6 Management"),
h3("Initial Resuscitation (ALL patients)"),
bullet("IV access + blood tests + group & save"),
bullet("IV fluid resuscitation: 0.9% NaCl or Hartmann's solution; replace potassium"),
bullet("NG tube: Nasogastric decompression (Ryles tube) - decompress distended bowel, prevent aspiration"),
bullet("Urinary catheter: Monitor urine output (target >0.5mL/kg/hr)"),
bullet("Analgesia: Opioid analgesia; NSAIDs (if no contraindication)"),
bullet("Nil by mouth (NBM)"),
bullet("Antibiotics: Start broad-spectrum if strangulation/perforation suspected"),
spacer(),
h3("Conservative ('Drip and Suck') Management - Applicable to:"),
bullet("Adhesive SBO without signs of strangulation: 48-72h trial; 75-80% resolve conservatively"),
bullet("Early post-operative ileus"),
bullet("Pseudo-obstruction (Ogilvie syndrome): Neostigmine (anticholinesterase) or colonoscopic decompression"),
bullet("Incomplete obstruction: Monitor for improvement with repeated clinical and imaging reassessment"),
spacer(),
h3("Surgical Management"),
body("Indications for Emergency/Urgent Surgery:"),
bullet("Signs of strangulation or bowel ischemia"),
bullet("Perforation or peritonitis"),
bullet("Complete obstruction failing conservative management >48-72h"),
bullet("Closed loop obstruction"),
bullet("Irreducible hernia"),
spacer(),
h3("Operative Procedures by Cause"),
twoColTable([
["Adhesion band", "Division/lysis of adhesions (adhesiolysis); laparoscopic preferred if feasible"],
["Strangulated hernia", "Emergency hernia repair + resection of non-viable bowel + anastomosis or stoma"],
["Sigmoid volvulus", "Colonoscopic decompression (first attempt); Hartmann's procedure or sigmoidectomy if recurrent"],
["Intussusception (children)", "Air/hydrostatic enema (80% successful); laparotomy if failed or peritonitis"],
["Colorectal cancer", "Right hemicolectomy (right colon), left hemicolectomy or Hartmann's (left colon/sigmoid)"],
["Volvulus with gangrene", "Resection of gangrenous bowel + stoma (Hartmann's) - primary anastomosis risky"],
["Gallstone ileus", "Enterotomy + stone removal; consider cholecystectomy and fistula repair"],
], "Cause", "Operation"),
spacer(),
h2("4.7 Complications"),
bullet("Dehydration, electrolyte imbalances, metabolic alkalosis"),
bullet("Acute kidney injury (pre-renal)"),
bullet("Aspiration pneumonia"),
bullet("Bowel ischemia → gangrene → perforation → peritonitis → septic shock → death"),
bullet("Short bowel syndrome (after extensive bowel resection)"),
spacer(),
examBox("MOST COMMON causes: Adhesions (#1 in developed world), Hernias (#1 worldwide). SIGNS OF STRANGULATION = emergency operation. NG tube + IV fluids = initial management for all. Sigmoid volvulus: coffee bean sign on X-ray, treat with colonoscopic decompression. CT is the gold standard imaging."),
pageBreak(),
// ══════════════════════════════════════════════════════════════════════
// TOPIC 5: WOUNDS IN SURGERY
// ══════════════════════════════════════════════════════════════════════
sectionHeader(5, "WOUNDS IN SURGERY"),
h2("5.1 Definition & Classification of Wounds"),
body("A wound is a disruption of the continuity of body tissues, caused by mechanical, thermal, chemical, or radiation injury. In surgery, wound management and healing are central to operative outcomes."),
spacer(),
h3("By Mechanism"),
twoColTable([
["Incised wound", "Clean cut by sharp instrument. Straight edges, minimal tissue damage. Heals well by primary intention."],
["Lacerated wound", "Irregular tear due to blunt force. Ragged edges, more tissue damage."],
["Contused wound", "Caused by blunt trauma. Skin intact but underlying tissue bruised (haematoma)."],
["Puncture wound", "Small entry wound, depth greater than width. Risk of anaerobic infection (tetanus)."],
["Abrasion (graze)", "Superficial, epidermis removed by friction. Heals by re-epithelization."],
["Avulsion", "Tissue torn away from underlying structures. Skin flap or degloving injury."],
["Crush injury", "Extensive tissue necrosis, haematoma, high infection risk, compartment syndrome."],
["Gunshot wound (GSW)", "Entry + exit wound; high energy → extensive internal cavity; always explore."],
["Burn wound", "Thermal, chemical, electrical, radiation; classified by depth (superficial, partial, full thickness)."],
], "Type", "Features"),
spacer(),
h2("5.2 Wound Healing"),
h3("Phases of Wound Healing (RIMP)"),
twoColTable([
["Phase 1: Haemostasis / Inflammatory (0-5 days)", "Platelet aggregation → clot formation (haemostasis). Vasoconstriction then vasodilation. Neutrophils (0-2 days: phagocytosis, first responders). Macrophages (2-5 days: MOST IMPORTANT cell - orchestrate healing, phagocytosis, growth factor release). Release of PDGF, TGF-β, EGF, FGF, VEGF."],
["Phase 2: Proliferative (5 days - 3 weeks)", "Fibroblast migration and proliferation (key cell). Collagen synthesis (type III initially). Angiogenesis (new blood vessel formation via VEGF). Granulation tissue formation. Epithelialisation (keratinocyte migration from wound edges)."],
["Phase 3: Remodelling/Maturation (3 weeks - 2 years)", "Type III collagen → replaced by Type I collagen (stronger). Wound contraction by myofibroblasts. Maximum tensile strength = 80% of original at 6 months. Wound matures from red/raised scar to flat, pale scar."],
], "Phase", "Key Events"),
spacer(),
h3("Key Cells in Wound Healing"),
twoColTable([
["Platelets", "First responders; haemostasis; release PDGF, TGF-β"],
["Neutrophils", "0-2 days; phagocytosis; debridement; release proteases"],
["Macrophages", "2-5 days; MOST IMPORTANT; phagocytosis + orchestrate repair via growth factors"],
["Fibroblasts", "Collagen synthesis; key cell of proliferative phase"],
["Myofibroblasts", "Wound contraction; differentiated fibroblasts containing actin"],
["Keratinocytes", "Epithelialisation; migrate from wound edges and hair follicles"],
["Endothelial cells", "Angiogenesis; form new capillary loops"],
], "Cell", "Role"),
spacer(),
h2("5.3 Types of Wound Healing Intention"),
twoColTable([
["Primary Intention", "Wound edges approximated (sutured/stapled). Minimal scarring. Requires: clean wound, no tissue loss, minimal contamination. Examples: clean surgical incisions, lacerations repaired within 6h."],
["Secondary Intention", "Wound left open to granulate. Used for: contaminated wounds, significant tissue loss, abscess cavities, bites. Slower, more scarring, wound contraction prominent."],
["Delayed Primary Closure (Tertiary Intention)", "Wound initially left open → debrided and observed for 3-5 days → closed if clean. Used for contaminated traumatic wounds, bites, battlefield wounds."],
], "Type", "Description & Indications"),
spacer(),
h2("5.4 Factors Affecting Wound Healing"),
h3("Local Factors (at the wound site)"),
bullet("Blood supply: Ischemia → impaired healing (arterial disease, tight sutures)"),
bullet("Infection: Bacteria compete for nutrients, release proteases → destroy collagen; > 10⁵ organisms/g tissue = critical colonization"),
bullet("Foreign bodies: Delay healing, serve as nidus for infection (sutures, mesh, implants)"),
bullet("Dead space: Haematoma/seroma → infection medium"),
bullet("Wound edge apposition: Poor apposition → inadequate healing"),
bullet("Radiation exposure: Impairs angiogenesis and cellular proliferation"),
bullet("Surgical technique: Gentle tissue handling, good haemostasis, avoid excessive tension"),
spacer(),
h3("Systemic Factors"),
bullet("Malnutrition: Protein deficiency impairs collagen synthesis; Vitamin C deficiency (scurvy) impairs collagen cross-linking; Zinc deficiency impairs DNA synthesis"),
bullet("Diabetes mellitus: Impaired leukocyte function + neuropathy + ischemia + hyperglycemia → ALL impair healing"),
bullet("Steroid use: Impairs all phases (anti-inflammatory, anti-fibroblast); use Vitamin A topically to partially reverse"),
bullet("Jaundice: Impairs macrophage function and collagen synthesis; bile salts toxic to fibroblasts"),
bullet("Anemia/hypoxia: Oxygen is required for collagen hydroxylation; severe anemia impairs healing"),
bullet("Age: Elderly have reduced inflammatory response and collagen synthesis"),
bullet("Immunosuppression: HIV, chemotherapy, transplant drugs"),
bullet("Obesity: Adipose tissue poorly vascularized; technical difficulty; higher SSI risk"),
spacer(),
h2("5.5 Wound Complications"),
twoColTable([
["Haematoma", "Blood collection in wound. Risk: uncontrolled bleeding, inadequate haemostasis. Management: small → resolve; large → evacuation."],
["Seroma", "Serous fluid collection. Common after mastectomy, groin dissection. Management: aspiration if symptomatic, compressive dressing."],
["Surgical Site Infection (SSI)", "Most common wound complication. Superficial: skin/SQ tissue; Deep: fascia/muscle; Organ-space: deep to fascia. Diagnosis: within 30 days (1 year if implant). Treatment: open wound, culture, antibiotics if systemic."],
["Wound dehiscence", "Partial or complete disruption of wound closure. Risk factors: malnutrition, obesity, steroid use, infection, technical error. Superficial: apply dressings. Fascial (burst abdomen): emergency re-suture with mass closure technique."],
["Incisional hernia", "Late complication: abdominal wall weakness at old incision site. Risk: obesity, wound infection, poor technique, multiple operations."],
["Hypertrophic scar", "Raised scar WITHIN wound boundaries; regresses over time. Treat: silicone sheets, steroid injection."],
["Keloid", "Raised scar BEYOND wound boundaries; does not regress. Common in dark skin, ear lobes, presternal area. Treat: steroid injection, silicone, compression, surgery (recurrence risk)."],
["Wound contracture", "Myofibroblast contraction → joint deformity (especially burns over joints). Prevent with splinting; treat with Z-plasty or skin graft."],
], "Complication", "Details"),
spacer(),
h2("5.6 Wound Management Principles"),
h3("Initial Assessment (ABCDE first in trauma)"),
bullet("Assess wound: Site, size, depth, contamination, foreign bodies, neurovascular status distal to wound"),
bullet("Photograph if medicolegal concern"),
bullet("Tetanus prophylaxis: Check immunization status; give booster/immunoglobulin as appropriate"),
spacer(),
h3("Wound Cleaning & Debridement"),
bullet("Irrigate copiously with normal saline (high pressure reduces bacterial counts)"),
bullet("Debridement: Remove all devitalized tissue, foreign bodies, contamination"),
bullet("Excise wound edges if jagged (within golden period - 6h for clean wounds, less for contaminated)"),
bullet("Surgical debridement: Key for necrotizing fasciitis, gas gangrene, diabetic foot ulcers"),
spacer(),
h3("Wound Closure Techniques"),
bullet("Sutures: Interrupted (most secure), continuous/running, mattress (reduces tension). Absorbable (Vicryl, Monocryl) for deep layers. Non-absorbable (Prolene, Nylon) for skin."),
bullet("Staples: Faster than sutures; good for scalp, trunk, limbs. Not suitable for face/hands."),
bullet("Tissue adhesive (glue, e.g., Dermabond): For superficial lacerations in low-tension areas."),
bullet("Steri-strips: For small, low-tension wounds; reinforce skin closures."),
bullet("Vacuum-assisted closure (VAC/NPWT): Negative pressure dressing → promotes granulation, removes exudate, reduces edema. For complex wounds, open abdomens."),
spacer(),
h2("5.7 Dressings"),
twoColTable([
["Simple non-adherent", "Melolin, Telfa. For clean healing wounds."],
["Hydrocolloid", "DuoDERM. For moderately exuding wounds; maintains moist environment; promotes autolytic debridement."],
["Foam dressing", "Mepilex. Highly absorbent; for heavily exuding wounds."],
["Alginate", "Kaltostat, Aquacel. For heavily exuding wounds; haemostatic properties."],
["Silver dressings", "Mepilex Ag, Aquacel Ag. Antimicrobial; for infected/colonized wounds."],
["NPWT (VAC)", "Negative pressure wound therapy. Complex wounds, open abdomen, post-fasciotomy."],
["Honey dressings", "Manuka honey; antimicrobial + promotes debridement."],
], "Type", "Use"),
spacer(),
examBox("KEY CELLS: Macrophage = MOST IMPORTANT in healing. Fibroblast = key in proliferative phase. Keloid goes BEYOND wound margins; hypertrophic stays WITHIN. Burst abdomen = emergency re-closure. Wound dehiscence risk factors: malnutrition, obesity, steroids, infection. Tetanus prophylaxis for all traumatic wounds."),
pageBreak(),
// ══════════════════════════════════════════════════════════════════════
// TOPIC 6: TRACHEOSTOMY
// ══════════════════════════════════════════════════════════════════════
sectionHeader(6, "TRACHEOSTOMY"),
h2("6.1 Definition"),
body("Tracheostomy is a surgical procedure that creates an opening (stoma) in the anterior wall of the trachea, through which a tracheostomy tube is inserted to provide or maintain an airway. It is the most common surgical procedure in critically ill patients requiring prolonged mechanical ventilation."),
spacer(),
h2("6.2 Indications"),
h3("Three Broad Categories"),
twoColTable([
["1. Upper Airway Obstruction", "• Difficult/failed intubation\n• Significant maxillofacial trauma\n• Angioedema (severe)\n• Laryngeal/upper airway tumors\n• Bilateral vocal cord paralysis\n• Epiglottitis (when airway threatened)\n• Foreign body (when rigid bronchoscopy fails)"],
["2. Prolonged Mechanical Ventilation", "• ICU patients expected to need ventilation >7-14 days\n• Reduces dead space (decreases work of breathing)\n• Allows oral feeding and better oral hygiene\n• Enables earlier weaning from ventilator\n• Facilitates nursing care and physiotherapy"],
["3. Neurological Conditions", "• Brain injury (TBI, CVA) - impaired airway protection\n• Spinal cord injury at C1-C4 level\n• GBS, MND, severe neuromuscular disease\n• Severe agitation or delirium\n• Prolonged altered mental status - risk of aspiration"],
], "Category", "Specific Indications"),
spacer(),
h2("6.3 Contraindications (All Relative)"),
bullet("Recent anterior neck surgery (<7 days) - healing tissues"),
bullet("High ventilator settings: FiO2 >50% or PEEP >10 cmH2O"),
bullet("Elevated intracranial pressure"),
bullet("Hemodynamic instability"),
bullet("Significant bleeding risk (coagulopathy)"),
bullet("Local infection or malignancy at proposed stoma site"),
bullet("Predicted early mortality (futile procedure)"),
bullet("Pediatric patients: Anatomical considerations; different technique required"),
spacer(),
h2("6.4 Types of Tracheostomy"),
twoColTable([
["Surgical Tracheostomy (Open/Standard)", "Performed in OR or at bedside. Horizontal skin incision 2 cm below cricoid cartilage. Thyroid isthmus divided or retracted. Tracheal window created (usually 3rd/4th ring). Can be done in high-risk patients. Most controlled technique."],
["Percutaneous Dilatational Tracheostomy (PDT)", "Bedside ICU procedure (Ciaglia technique - 1985, most widely used). Uses Seldinger technique with serial dilation. Requires bronchoscopic guidance. Benefits: less wound infection, less bleeding, more cost-effective than OR. Periprocedural mortality <0.2%."],
["Cricothyroidotomy (Emergency)", "NOT a true tracheostomy. Incision through cricothyroid membrane in 'cannot intubate cannot oxygenate' emergency. Rapid, accessible, life-saving. Must be converted to formal tracheostomy within 72h (risk of subglottic stenosis)."],
["Mini-tracheostomy", "Small-bore tube through cricothyroid membrane for sputum clearance in spontaneously breathing patients. Does NOT provide ventilatory support."],
], "Type", "Details"),
spacer(),
h2("6.5 Timing of Tracheostomy"),
bullet("Early tracheostomy: Within 7 days of intubation. Benefits: reduced sedation use, earlier mobilization, shorter ICU LOS in some studies."),
bullet("Late tracheostomy: After 7-10 days. Most evidence shows NO significant difference in mortality or pneumonia rates vs. early."),
bullet("Guidelines (AHA/SCCM): No single recommended timing. Decision individualized based on predicted need, patient condition, and clinical trajectory."),
bullet("TracMan Trial (UK, 2013): Early (day 4) vs. late (day 10) tracheostomy - NO difference in 30-day mortality, ICU LOS, or duration of ventilation."),
spacer(),
h2("6.6 Surgical Anatomy"),
bullet("Trachea: 10-12 cm long; 15-20 C-shaped cartilaginous rings; extends from C6 (cricoid cartilage) to T4 (carina)"),
bullet("Incision site: Between 2nd and 4th tracheal rings (avoids cricoid - risk of subglottic stenosis above; innominate artery below)"),
bullet("Important structures: Thyroid isthmus overlies 2nd-4th rings; innominate (brachiocephalic) artery crosses trachea at 9th ring (below tracheostomy level)"),
bullet("Blood supply: Inferior thyroid artery (main); inferior thyroid veins drain inferiorly"),
bullet("Recurrent laryngeal nerves: Run in tracheoesophageal groove - at risk of injury laterally"),
spacer(),
h2("6.7 Tracheostomy Tubes"),
twoColTable([
["Cuffed tube", "Has inflatable cuff to seal trachea. Used in ICU ventilated patients; prevents aspiration. Cuff pressure: 20-25 cmH2O (prevents mucosal ischemia)."],
["Uncuffed tube", "No cuff. For patients who can protect airway; for pediatric patients; facilitates speech."],
["Fenestrated tube", "Has opening in the outer cannula. Allows air to pass through vocal cords → enables speech. Use with one-way speaking valve (Passy-Muir)."],
["Double-lumen tube", "Inner cannula can be removed for cleaning. Reduces risk of tube blockage. Standard in most patients."],
["Adjustable flange tube", "Variable-length tube for obese patients or those with thick necks."],
], "Type", "Purpose & Use"),
spacer(),
h2("6.8 Complications"),
h3("Early Complications (Within 24-48 hours)"),
bullet("Haemorrhage: Primary (intraoperative); secondary (erosion of innominate artery - catastrophic)"),
bullet("Tube displacement / decannulation: Life-threatening; secure tube well postoperatively"),
bullet("Surgical emphysema: Air in subcutaneous tissues"),
bullet("Pneumothorax/Pneumomediastinum: From dissection or paratracheal placement"),
bullet("Aspiration: During and after procedure"),
bullet("Tube obstruction: From secretions, kinking, blood clot → suction, change inner cannula"),
spacer(),
h3("Late Complications"),
bullet("Tracheal stenosis: Most feared late complication; from cuff over-inflation, infection, poor technique"),
bullet("Tracheomalacia: Softening of tracheal cartilage from prolonged cuff pressure"),
bullet("Tracheoesophageal fistula (TEF): Erosion through posterior tracheal wall; risk with NG tube + overinflated cuff"),
bullet("Tracheoinnominate artery fistula: Rare but catastrophic; erosion of tube tip into innominate artery → massive haemorrhage"),
bullet("Stomal infection: Regular cleaning; silver dressings if infected"),
bullet("Persistent tracheocutaneous fistula: After decannulation; surgical closure if >3 months"),
spacer(),
h2("6.9 Tracheostomy Care & Decannulation"),
h3("Daily Care"),
bullet("Inner cannula: Remove, clean, replace every 8 hours (or use disposable inner cannula)"),
bullet("Humidification: Essential to prevent secretion crusting; HME filters or heated humidification"),
bullet("Suction: As needed (not routinely); use appropriate catheter size (½ tube inner diameter)"),
bullet("Cuff pressure monitoring: Every 8 hours; target 20-25 cmH2O"),
bullet("Stoma care: Clean with saline, change dressings, check skin integrity"),
spacer(),
h3("Decannulation Criteria"),
bullet("Patient can protect airway (swallow, cough, conscious)"),
bullet("No longer requires mechanical ventilation"),
bullet("Respiratory secretions manageable"),
bullet("Able to tolerate cuff deflation + tube occlusion (trial period 24-48h)"),
bullet("Procedure: Downsize tube → deflate cuff → cap tube → remove tube if tolerated"),
spacer(),
examBox("TRACHEOSTOMY vs CRICOTHYROIDOTOMY: Cricothyroidotomy = emergency only, must convert within 72h. Incision site: 2nd-4th tracheal rings. Cuff pressure: 20-25 cmH2O. Most feared late complication: tracheal stenosis. Catastrophic complication: tracheo-innominate fistula → massive haemorrhage."),
pageBreak(),
// ══════════════════════════════════════════════════════════════════════
// TOPIC 7: RESUSCITATION IN SURGERY
// ══════════════════════════════════════════════════════════════════════
sectionHeader(7, "RESUSCITATION IN SURGERY"),
h2("7.1 Overview & ABCDE Approach"),
body("Resuscitation in surgery refers to the immediate management of life-threatening physiological disturbances caused by trauma, hemorrhage, sepsis, or cardiopulmonary arrest. The ABCDE framework provides a systematic approach to rapidly assess and treat life-threatening conditions in order of priority."),
spacer(),
twoColTable([
["A – Airway (with C-spine)", "Is airway patent? Look, listen, feel. If obstructed: chin lift/jaw thrust, airway adjuncts (OPA/NPA), intubation, surgical airway. C-spine protection in trauma."],
["B – Breathing", "RR, O2 sat, chest expansion, auscultation. Identify & treat: tension pneumothorax (needle decompression 2nd ICS MCL), open pneumothorax (3-sided seal), massive haemothorax (chest drain), flail chest (positive pressure ventilation)."],
["C – Circulation", "Pulse, BP, cap refill, skin colour/temp. Stop external bleeding (direct pressure, tourniquet, haemostatic dressings). IV access ×2 large bore. Fluid resuscitation. Blood transfusion. Pericardial tamponade (Beck's triad → emergency pericardiocentesis)."],
["D – Disability (Neurology)", "GCS, pupils (size, reactivity, symmetry), BM. AVPU scale. Signs of raised ICP: Cushing's triad (hypertension + bradycardia + irregular respirations)."],
["E – Exposure/Environment", "Full exposure of patient. Identify all injuries. Prevent hypothermia (warm blankets, warm fluids). Temperature monitoring."],
], "Step", "Assessment & Action"),
spacer(),
h2("7.2 Haemorrhagic Shock - Classification"),
body("Haemorrhagic shock is the most common cause of preventable death in trauma. Early recognition and treatment is critical."),
threeColTable([
["Class I", "Up to 750mL (<15%)", "Normal, <100bpm, normal BP, normal RR, normal GCS, normal urine >30mL/h"],
["Class II", "750-1500mL (15-30%)", "100-120bpm, pulse pressure decreased, RR 20-30, anxious, urine 20-30mL/h"],
["Class III", "1500-2000mL (30-40%)", ">120bpm, systolic BP drops, RR 30-40, confused, urine 5-15mL/h"],
["Class IV", ">2000mL (>40%)", ">140bpm, very low BP, lethargic/unresponsive, anuria, immediately life-threatening"],
], "Class", "Blood Loss", "Clinical Features"),
spacer(),
keyBox("IMPORTANT NOTE", "Systolic BP does NOT drop significantly until Class III shock (>30% blood loss). Tachycardia is the EARLIEST sign of hypovolaemia. In young fit patients and athletes, compensatory mechanisms can maintain BP much longer.", BG_AMBER, ACCENT_AMBER),
spacer(),
h2("7.3 Fluid Resuscitation in Surgery"),
h3("Permissive Hypotension (Damage Control Resuscitation)"),
bullet("In active haemorrhage (trauma), target MAP 50 mmHg (or systolic 80-90 mmHg)"),
bullet("Rationale: Aggressive fluid resuscitation → dilutional coagulopathy + hypothermia + acidosis ('lethal triad')"),
bullet("EXCEPTION: In TBI, maintain systolic ≥90 mmHg and MAP ≥80 mmHg to prevent secondary brain injury"),
spacer(),
h3("Types of IV Fluids"),
twoColTable([
["0.9% Normal Saline (NS)", "Isotonic. Large volumes cause hyperchloraemic metabolic acidosis. Used for: resuscitation, fluid maintenance, hyponatraemia."],
["Hartmann's / Ringer's Lactate (RL)", "Balanced crystalloid. Preferred for trauma and surgical resuscitation - does not cause acidosis. Slightly hypotonic (do NOT use in head injury)."],
["Colloids (Human Albumin 4.5%)", "Larger molecules, stay in intravascular space longer. Used in hypoalbuminaemia. No clear advantage over crystalloids in resuscitation."],
["Blood products (Packed Red Cells)", "Ideal for haemorrhagic shock. Target Hb >70g/L (>80 in cardiac patients)."],
["Fresh Frozen Plasma (FFP)", "Contains all clotting factors. Give 1:1:1 ratio with PRBC and platelets in massive haemorrhage."],
["Platelets", "Give in 1:1:1 ratio. Target platelets >100 × 10⁹/L in active bleeding."],
["Cryoprecipitate", "Rich in fibrinogen, vWF, Factor VIII, XIII. Give when fibrinogen <1.5 g/L."],
["Tranexamic Acid (TXA)", "Antifibrinolytic. 1g IV bolus within 3 hours of injury (CRASH-2 Trial). Second dose 1g over 8h. Reduces mortality from haemorrhage."],
], "Fluid", "Details & Use"),
spacer(),
h2("7.4 Massive Transfusion Protocol (MTP)"),
bullet("Definition: Transfusion of ≥10 units PRBC within 24 hours OR ≥4 units within 1 hour"),
bullet("Activation: Haemodynamic instability + ongoing haemorrhage + likely to need large transfusion"),
bullet("Ratio: PRBC : FFP : Platelets = 1:1:1 (balanced 'damage control resuscitation')"),
bullet("Monitor: ABG, TEG/ROTEM (viscoelastic testing), FBC, coagulation screen, fibrinogen every 30-60 min"),
bullet("Temperature: Warm all fluids; avoid hypothermia"),
bullet("Calcium: Give CaCl2 or calcium gluconate (citrate in blood products chelates calcium)"),
spacer(),
h2("7.5 Cardiac Arrest - Advanced Life Support (ALS)"),
h3("Adult BLS (Basic Life Support)"),
bullet("D-R-A-B-C: Danger → Response → (shout for help, call resuscitation team) → Airway → Breathing → CPR"),
bullet("Compression rate: 100-120/min; Depth: 5-6 cm; Ratio: 30:2 (compressions:breaths)"),
bullet("Defibrillation: As early as possible; use AED; 1 shock → immediately resume CPR (2 minutes) → reassess"),
spacer(),
h3("Shockable Rhythms (VF / pVT)"),
bullet("Defibrillation: Immediate 200J biphasic → CPR 2 min → check rhythm → repeat 200J if still VF/pVT"),
bullet("Adrenaline (Epinephrine) 1mg IV: After 3rd shock, then every 3-5 minutes"),
bullet("Amiodarone 300mg IV: After 3rd shock (for refractory VF/pVT); second dose 150mg"),
spacer(),
h3("Non-Shockable Rhythms (PEA / Asystole)"),
bullet("CPR 2 minutes + Adrenaline 1mg IV every 3-5 minutes"),
bullet("Identify and treat REVERSIBLE CAUSES - 4 Hs and 4 Ts:"),
twoColTable([
["Hypoxia", "Hypovolaemia", "Hypothermia", "Hypo/Hyperkalaemia"],
["Tension pneumothorax", "Tamponade (cardiac)", "Toxins/drugs", "Thrombosis (PE / MI)"],
], "4 Hs", "4 Ts"),
spacer(),
h2("7.6 Sepsis & Septic Shock - Surviving Sepsis Bundle"),
h3("Definitions (Sepsis-3)"),
bullet("Sepsis: Life-threatening organ dysfunction caused by dysregulated host response to infection (SOFA score increase ≥2)"),
bullet("Septic shock: Sepsis + vasopressor requirement + serum lactate >2 mmol/L despite adequate fluid resuscitation"),
bullet("Quick SOFA (qSOFA): ≥2 of: altered mental status, RR ≥22, systolic BP ≤100 → screen for sepsis outside ICU"),
spacer(),
h3("Hour-1 Bundle (Surviving Sepsis Campaign 2018)"),
bullet("1. Measure lactate; remeasure if initial >2 mmol/L (target < 2)"),
bullet("2. Blood cultures (×2 sets) BEFORE antibiotics"),
bullet("3. Broad-spectrum IV antibiotics WITHIN 1 HOUR of recognition"),
bullet("4. Fluid resuscitation: 30mL/kg crystalloid bolus if hypotension OR lactate ≥4 mmol/L"),
bullet("5. Vasopressors if hypotension persists: Noradrenaline (norepinephrine) FIRST LINE; target MAP ≥65 mmHg"),
spacer(),
h3("Surgical Implications of Sepsis"),
bullet("Identify and control SOURCE: Abscess drainage, bowel resection, debridement, cholecystectomy"),
bullet("Source control should occur within 6-12 hours of diagnosis"),
bullet("'Damage control surgery' may be appropriate: abbreviated initial procedure → resuscitate in ICU → re-look and definitive repair at 24-48h"),
spacer(),
h2("7.7 Perioperative Resuscitation Points"),
h3("Fluid Therapy Monitoring"),
bullet("Urine output: BEST bedside indicator of volume status; target >0.5 mL/kg/h"),
bullet("CVP (Central Venous Pressure): Target 8-12 cmH2O (not reliable alone)"),
bullet("Pulse pressure variation / stroke volume variation: Dynamic measures; better predictors of fluid responsiveness"),
bullet("Arterial line: Continuous BP monitoring + arterial blood gas sampling in unstable patients"),
bullet("Serum lactate: Marker of tissue hypoperfusion; clearance >10% per 2h indicates adequate resuscitation"),
spacer(),
h3("Special Situations"),
bullet("Paediatric fluid resuscitation: 20mL/kg isotonic fluid bolus; reassess; up to 60mL/kg in first hour for septic shock"),
bullet("Burns resuscitation: Parkland formula: 4mL × weight(kg) × %BSA burn (use crystalloid); give 50% in first 8 hours, 50% in next 16 hours"),
bullet("Pre-eclampsia/eclampsia: Cautious fluid resuscitation (risk of pulmonary oedema); MgSO4 for eclampsia; BP control"),
bullet("Head injury: Maintain systolic ≥90 mmHg; AVOID hypotonic fluids (RL contraindicated); normal saline preferred"),
spacer(),
examBox("EARLIEST SIGN of hypovolaemia = TACHYCARDIA. BP drops in Class III (>30% loss). 1:1:1 ratio in massive transfusion. Tranexamic acid within 3h of injury (CRASH-2). Surviving Sepsis Hour-1 Bundle: lactate + cultures + antibiotics + 30mL/kg fluids + vasopressors. Noradrenaline = first-line vasopressor for septic shock."),
pageBreak(),
// ── QUICK REVISION SUMMARY ───────────────────────────────────────────
sectionHeader("★", "QUICK REVISION SUMMARY FOR EXAMS"),
h2("High-Yield Facts at a Glance"),
threeColTable([
["Chemotherapy", "Most common alkylating agent in surgery", "Cyclophosphamide"],
["Chemotherapy", "HIPEC drug for peritoneal carcinomatosis", "Mitomycin C"],
["Chemotherapy", "Neoadjuvant purpose", "Downstage tumor; assess chemo sensitivity"],
["Chemotherapy", "Doxorubicin toxicity", "Cardiotoxicity (cardiomyopathy)"],
["Chemotherapy", "Cisplatin toxicity", "Nephrotoxicity"],
["Chemotherapy", "Bleomycin toxicity", "Pulmonary fibrosis"],
["Antibiotics", "Most common prophylactic antibiotic", "Cefazolin"],
["Antibiotics", "Timing of prophylaxis before incision", "Within 60 minutes"],
["Antibiotics", "Duration of post-op prophylaxis", "Max 24 hours"],
["Antibiotics", "Necrotizing fasciitis treatment", "Meropenem + Vancomycin + Clindamycin + surgery"],
["Antibiotics", "C. difficile treatment", "Oral Vancomycin or Fidaxomicin"],
["Obstructive Uropathy", "#1 cause in adult males", "BPH"],
["Obstructive Uropathy", "#1 cause of acute colic", "Urolithiasis"],
["Obstructive Uropathy", "#1 cause in children", "UPJ obstruction"],
["Obstructive Uropathy", "Gold standard imaging for calculi", "NCCT KUB"],
["Obstructive Uropathy", "Emergency: infected obstructed kidney", "Urgent decompression (JJ stent or PCN)"],
["Intestinal Obstruction", "#1 cause worldwide", "Hernias"],
["Intestinal Obstruction", "#1 cause in developed world", "Adhesions"],
["Intestinal Obstruction", "Sigmoid volvulus on X-ray", "Coffee bean sign"],
["Intestinal Obstruction", "Strangulation → action", "Emergency surgery"],
["Intestinal Obstruction", "Intussusception treatment in children", "Air enema (first-line)"],
["Wounds", "Most important cell in wound healing", "Macrophage"],
["Wounds", "Key cell in proliferative phase", "Fibroblast"],
["Wounds", "Keloid vs hypertrophic scar", "Keloid exceeds wound margins"],
["Wounds", "Burst abdomen management", "Emergency re-suture with mass closure"],
["Tracheostomy", "Incision site (tracheal ring level)", "2nd-4th tracheal rings"],
["Tracheostomy", "Cuff pressure target", "20-25 cmH2O"],
["Tracheostomy", "Most feared late complication", "Tracheal stenosis"],
["Tracheostomy", "Emergency airway: cricothyroidotomy converts to", "Formal tracheostomy within 72h"],
["Resuscitation", "Earliest sign of hypovolaemia", "Tachycardia"],
["Resuscitation", "Class III shock blood loss", ">30% (>1500mL); systolic BP drops"],
["Resuscitation", "First-line vasopressor in septic shock", "Noradrenaline"],
["Resuscitation", "Tranexamic acid window", "Within 3 hours of injury"],
["Resuscitation", "Massive transfusion ratio", "1:1:1 PRBC:FFP:Platelets"],
["Resuscitation", "Shockable rhythms", "VF and pulseless VT"],
["Resuscitation", "Reversible causes of cardiac arrest", "4 Hs and 4 Ts"],
], "Topic", "Question", "Answer"),
spacer(),
new Paragraph({
alignment: AlignmentType.CENTER,
spacing: { before: 300, after: 100 },
children: [new TextRun({ text: "Good Luck in Your Exams!", bold: true, size: 32, color: DARK_BLUE, font: "Calibri" })]
}),
new Paragraph({
alignment: AlignmentType.CENTER,
spacing: { before: 0, after: 0 },
children: [new TextRun({ text: "Sources: Sabiston Textbook of Surgery | Robbins & Kumar Pathology | Bailey & Love's Surgery | Katzung Pharmacology | Brenner & Rector's The Kidney | Sleisenger & Fordtran's GI Disease", size: 18, color: "888888", italics: true, font: "Calibri" })]
}),
];
// ═══════════════════════════════════════════════════════════════════════════
// BUILD DOCUMENT
// ═══════════════════════════════════════════════════════════════════════════
const doc = new Document({
title: "Surgery MBBS Notes",
description: "Comprehensive Surgery Notes for MBBS Students",
styles: {
default: {
document: {
run: { font: "Calibri", size: 22, color: DARK_TEXT }
}
}
},
sections: [{
properties: {
page: {
margin: { top: 720, bottom: 720, left: 900, right: 900 }
}
},
headers: {
default: new Header({
children: [new Paragraph({
alignment: AlignmentType.RIGHT,
border: { bottom: { style: BorderStyle.SINGLE, size: 6, color: MED_BLUE } },
children: [new TextRun({ text: "MBBS Surgery Notes | Comprehensive Guide", size: 18, color: MED_BLUE, font: "Calibri" })]
})]
})
},
footers: {
default: new Footer({
children: [new Paragraph({
alignment: AlignmentType.CENTER,
border: { top: { style: BorderStyle.SINGLE, size: 6, color: MID_GREY } },
children: [
new TextRun({ text: "Page ", size: 18, color: "888888", font: "Calibri" }),
new TextRun({ children: [PageNumber.CURRENT], size: 18, color: "888888", font: "Calibri" }),
new TextRun({ text: " of ", size: 18, color: "888888", font: "Calibri" }),
new TextRun({ children: [PageNumber.TOTAL_PAGES], size: 18, color: "888888", font: "Calibri" }),
]
})]
})
},
children
}]
});
Packer.toBuffer(doc).then(buffer => {
fs.writeFileSync('/home/daytona/workspace/mbbs-surgery-notes/MBBS_Surgery_Notes.docx', buffer);
console.log('Document created successfully!');
}).catch(err => {
console.error('Error:', err);
process.exit(1);
});
cd /home/daytona/workspace/mbbs-surgery-notes && node create_notes.js 2>&1
python3 /home/daytona/skills/docx/scripts/office/validate.py /home/daytona/works…
ls -lh /home/daytona/workspace/mbbs-surgery-notes/ && python3 -c "import zipfile…
MBBS Surgery Notes
Word Document · DOCX