Indications for below knee amputation and surgical causes


Generate a surgical reference guide with step-by-step BKA technique
Hi I am 3rd year surgical pg resident I a
Hi I am 3rd year surgical pg resident I will present case on below knee amputation stump so can you please guide me through i would like to details for amputation related causes and management investigation management and outcomes ,….following below knee amputation rehabilitation and prosthesis types and all indications
ls /home/daytona/workspace/ && mkdir -p /home/daytona/workspace/bka-reference
~/bka-reference/generate_bka.js
const {
Document, Packer, Paragraph, TextRun, Table, TableRow, TableCell,
HeadingLevel, AlignmentType, BorderStyle, WidthType, ShadingType,
VerticalAlign, PageNumber, Header, Footer, TableOfContents,
PageBreak, UnderlineType
} = require('docx');
const fs = require('fs');
// ─── Helpers ─────────────────────────────────────────────────────────────────
function h1(text) {
return new Paragraph({
text,
heading: HeadingLevel.HEADING_1,
spacing: { before: 400, after: 120 },
thematicBreak: false,
});
}
function h2(text) {
return new Paragraph({
text,
heading: HeadingLevel.HEADING_2,
spacing: { before: 280, after: 80 },
});
}
function h3(text) {
return new Paragraph({
text,
heading: HeadingLevel.HEADING_3,
spacing: { before: 180, after: 60 },
});
}
function body(text, options = {}) {
return new Paragraph({
children: [new TextRun({ text, size: 22, font: 'Calibri', ...options })],
spacing: { after: 80 },
});
}
function bullet(text, level = 0) {
return new Paragraph({
children: [new TextRun({ text, size: 22, font: 'Calibri' })],
bullet: { level },
spacing: { after: 60 },
});
}
function numbered(text, level = 0) {
return new Paragraph({
children: [new TextRun({ text, size: 22, font: 'Calibri' })],
numbering: { reference: 'my-numbering', level },
spacing: { after: 60 },
});
}
function boldBullet(label, text, level = 0) {
return new Paragraph({
children: [
new TextRun({ text: label + ': ', bold: true, size: 22, font: 'Calibri' }),
new TextRun({ text, size: 22, font: 'Calibri' }),
],
bullet: { level },
spacing: { after: 60 },
});
}
function boldNumbered(label, text, level = 0) {
return new Paragraph({
children: [
new TextRun({ text: label + ': ', bold: true, size: 22, font: 'Calibri' }),
new TextRun({ text, size: 22, font: 'Calibri' }),
],
numbering: { reference: 'my-numbering', level },
spacing: { after: 60 },
});
}
function pageBreak() {
return new Paragraph({ children: [new PageBreak()] });
}
function spacer() {
return new Paragraph({ text: '', spacing: { after: 80 } });
}
function infoBox(label, text) {
return new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
rows: [
new TableRow({
children: [
new TableCell({
shading: { fill: 'E8F4FD', type: ShadingType.CLEAR },
borders: {
top: { style: BorderStyle.SINGLE, size: 4, color: '2E75B6' },
bottom: { style: BorderStyle.SINGLE, size: 4, color: '2E75B6' },
left: { style: BorderStyle.THICK, size: 12, color: '2E75B6' },
right: { style: BorderStyle.SINGLE, size: 4, color: '2E75B6' },
},
children: [
new Paragraph({
children: [new TextRun({ text: label + ': ', bold: true, size: 22, font: 'Calibri', color: '1F4E79' })],
spacing: { before: 60, after: 40 },
}),
new Paragraph({
children: [new TextRun({ text, size: 22, font: 'Calibri' })],
spacing: { after: 60 },
}),
],
}),
],
}),
],
});
}
function warningBox(label, text) {
return new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
rows: [
new TableRow({
children: [
new TableCell({
shading: { fill: 'FFF2CC', type: ShadingType.CLEAR },
borders: {
top: { style: BorderStyle.SINGLE, size: 4, color: 'BF8F00' },
bottom: { style: BorderStyle.SINGLE, size: 4, color: 'BF8F00' },
left: { style: BorderStyle.THICK, size: 12, color: 'BF8F00' },
right: { style: BorderStyle.SINGLE, size: 4, color: 'BF8F00' },
},
children: [
new Paragraph({
children: [new TextRun({ text: '⚠ ' + label, bold: true, size: 22, font: 'Calibri', color: '7F5E00' })],
spacing: { before: 60, after: 40 },
}),
new Paragraph({
children: [new TextRun({ text, size: 22, font: 'Calibri' })],
spacing: { after: 60 },
}),
],
}),
],
}),
],
});
}
// Simple 2-col table
function twoColTable(rows, headers) {
const headerRow = new TableRow({
tableHeader: true,
children: headers.map(h =>
new TableCell({
shading: { fill: '2E75B6', type: ShadingType.CLEAR },
children: [new Paragraph({
children: [new TextRun({ text: h, bold: true, color: 'FFFFFF', size: 22, font: 'Calibri' })],
alignment: AlignmentType.CENTER,
})],
verticalAlign: VerticalAlign.CENTER,
})
),
});
const dataRows = rows.map(row =>
new TableRow({
children: row.map((cell, i) =>
new TableCell({
shading: { fill: i === 0 ? 'D6E4F0' : 'FFFFFF', type: ShadingType.CLEAR },
children: [new Paragraph({
children: [new TextRun({ text: cell, size: 22, font: 'Calibri', bold: i === 0 })],
spacing: { before: 60, after: 60 },
})],
})
),
})
);
return new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
rows: [headerRow, ...dataRows],
});
}
// ─── Document sections ────────────────────────────────────────────────────────
const titlePage = [
spacer(), spacer(),
new Paragraph({
children: [new TextRun({ text: 'BELOW-KNEE AMPUTATION', bold: true, size: 52, font: 'Calibri', color: '1F4E79' })],
alignment: AlignmentType.CENTER,
spacing: { after: 160 },
}),
new Paragraph({
children: [new TextRun({ text: 'Transtibial Amputation (BKA)', bold: true, size: 32, font: 'Calibri', color: '2E75B6' })],
alignment: AlignmentType.CENTER,
spacing: { after: 120 },
}),
new Paragraph({
children: [new TextRun({ text: 'Surgical Reference Guide for Residents', size: 28, font: 'Calibri', color: '595959', italics: true })],
alignment: AlignmentType.CENTER,
spacing: { after: 400 },
}),
new Paragraph({
children: [new TextRun({ text: 'Comprehensive Case Presentation Resource', size: 24, font: 'Calibri', color: '7F7F7F' })],
alignment: AlignmentType.CENTER,
spacing: { after: 80 },
}),
new Paragraph({
children: [new TextRun({ text: 'Sources: Sabiston | Mulholland & Greenfield | Fischer\'s Mastery | Campbell\'s Orthopaedics | Pye\'s Surgical Handicraft', size: 20, font: 'Calibri', color: '7F7F7F', italics: true })],
alignment: AlignmentType.CENTER,
spacing: { after: 80 },
}),
pageBreak(),
];
// ─── SECTION 1: Definition & Overview ─────────────────────────────────────────
const section1 = [
h1('1. DEFINITION AND OVERVIEW'),
body('Below-knee amputation (BKA), also termed transtibial amputation, is the surgical removal of the lower limb through the tibia and fibula, distal to the knee joint. It is the most functionally favored major lower limb amputation, as preservation of the knee joint dramatically reduces energy cost of ambulation and enables better prosthetic fitting compared to above-knee (transfemoral) amputation.'),
spacer(),
twoColTable([
['Level', 'Through tibia and fibula, 10-15 cm distal to tibial tuberosity'],
['Preferred over AKA?', 'Yes - preserves knee joint; 65% ambulation rate vs much lower in AKA'],
['30-day mortality (vascular)', '~8.9% (vs 27.7% for above-knee amputation)'],
['Preferred technique', 'Long posterior flap (Burgess myoplastic technique)'],
['Anesthesia', 'General or spinal +/- regional nerve block'],
], ['Parameter', 'Detail']),
spacer(),
];
// ─── SECTION 2: Indications ───────────────────────────────────────────────────
const section2 = [
h1('2. INDICATIONS FOR BKA'),
h2('2.1 Vascular / Ischemic (Most Common)'),
bullet('Chronic Limb-Threatening Ischemia (CLTI) - arterial occlusive disease causing >2 weeks of rest pain or tissue loss with no viable revascularization option'),
bullet('Peripheral Arterial Disease (PAD) with inadequate flow into the foot when all revascularization options are exhausted'),
bullet('Acute Limb Ischemia - irreversible ischemia (profound sensory/motor loss, inaudible Doppler signals in both artery and vein - Rutherford Class III)'),
bullet('Chronic ischemia with gangrene: chronic ischemia and infection are the most common indications for major amputation among hospital inpatients'),
spacer(),
h2('2.2 Infective'),
bullet('Wet gangrene of foot not amenable to local treatment or revascularization'),
bullet('Diabetic foot infection - necrotizing fasciitis, spreading cellulitis, deep space infection with systemic sepsis'),
bullet('Osteomyelitis of the foot/ankle not responding to antibiotics and limited debridement'),
bullet('Gas gangrene (clostridial myonecrosis) of the foot or lower leg'),
bullet('Fournier\'s gangrene extending to the foot'),
spacer(),
h2('2.3 Traumatic'),
bullet('Mangled lower extremity with non-reconstructable vascular injury (assessed using LEAP - Lower Extremity Assessment Project criteria, MESS score, etc.)'),
bullet('Devascularized limb with irreversible ischemia after failed revascularization'),
bullet('Blast/crush injury with extensive tissue loss'),
bullet('Failed limb salvage after trauma'),
spacer(),
h2('2.4 Oncological'),
bullet('Soft tissue sarcoma (STS) with direct extensive involvement of major neurovascular structures, or tumor volume encompassing too much of the limb to allow a functional remnant - now only ~5-10% of cases'),
bullet('Bone tumors (osteosarcoma) not amenable to limb-sparing surgery'),
bullet('Advanced melanoma: intractable pain or uncontrolled sepsis source (now rare with modern immunotherapy/regional perfusion)'),
spacer(),
h2('2.5 Other'),
bullet('Severe non-reconstructable trauma with irreparable soft tissue loss'),
bullet('Congenital limb deficiency (selected cases)'),
bullet('Painful, non-functional limb (e.g., chronic regional pain syndrome unresponsive to all treatment)'),
spacer(),
warningBox('Contraindications to BKA (prefer AKA)', 'Fixed knee flexion contracture | Non-functional knee joint | Insufficient viable tissue for flap coverage in lower leg | Inadequate arterial perfusion - ABI <0.5 AND no patent profunda artery'),
spacer(),
];
// ─── SECTION 3: Pre-op Assessment & Investigations ───────────────────────────
const section3 = [
h1('3. PREOPERATIVE ASSESSMENT AND INVESTIGATIONS'),
h2('3.1 Clinical Assessment'),
bullet('Full history: onset, duration, comorbidities (DM, HTN, CKD, CAD, smoking history)'),
bullet('Vascular examination: pulse exam of all lower limb vessels (femoral, popliteal, DP, PT), capillary refill, skin temperature, trophic changes'),
bullet('Assess knee joint: range of motion, any flexion contracture (contraindication to BKA)'),
bullet('Neurological: sensation, motor power (peripheral neuropathy assessment in diabetics)'),
bullet('Nutritional and functional status, cognitive assessment, social support'),
spacer(),
h2('3.2 Investigations'),
h3('Vascular Assessment'),
twoColTable([
['Ankle-Brachial Index (ABI)', 'ABI >0.5 suggests adequate perfusion for BKA healing; ABI <0.45 predicts poor healing'],
['Toe pressure / TBI', 'Toe pressure >30 mmHg associated with healing; more reliable in diabetics with calcified vessels'],
['Transcutaneous oxygen (TcPO2)', 'TcPO2 >40 mmHg at proposed level predicts healing; <20 mmHg suggests poor prognosis'],
['Doppler ultrasonography', 'Assess patency of popliteal and tibial vessels; assess flow direction'],
['CT Angiography (CTA)', 'First-line imaging - rapid, guides revascularization planning before deciding on amputation level'],
['MR Angiography', 'Alternative if CTA contraindicated (allergy, CKD)'],
['Conventional arteriography', 'Gold standard; used when endovascular intervention is planned simultaneously'],
], ['Investigation', 'Relevance to BKA']),
spacer(),
h3('Routine Pre-operative Investigations'),
bullet('FBC - assess anaemia (affects wound healing), infection (leucocytosis)'),
bullet('RFT/UEC - renal function (contrast clearance, drug dosing, mortality risk)'),
bullet('HbA1c + blood glucose - glycaemic control (target HbA1c <8% ideally for wound healing)'),
bullet('Coagulation profile (PT, aPTT, INR) - especially if on anticoagulants'),
bullet('LFTs + albumin - nutritional marker; albumin <3.5 g/dL = poor wound healing'),
bullet('ECG + cardiac assessment - high cardiovascular risk population (stress echo/angiography if indicated)'),
bullet('Chest X-ray'),
bullet('Blood cultures + wound swab C&S if active infection'),
bullet('Plain X-ray foot/leg - assess for osteomyelitis, gas in tissues, foreign bodies'),
bullet('MRI foot - gold standard for osteomyelitis extent and soft tissue infection mapping'),
bullet('Bone scan/WBC-labelled scan - if MRI unavailable for osteomyelitis assessment'),
bullet('Blood group & save / crossmatch'),
spacer(),
infoBox('WIFI Classification', 'The Society of Vascular Surgery (SVS) WIFI (Wound, Ischemia, Foot Infection) system scores wound characteristics, degree of pedal perfusion, and extent of infection. Worsening WIFI scores correlate strongly with risk of major amputation and guide goal-directed therapy.'),
spacer(),
];
// ─── SECTION 4: Management – Non-surgical / Pre-op optimization ───────────────
const section4 = [
h1('4. PRE-OPERATIVE OPTIMIZATION AND DECISION-MAKING'),
h2('4.1 General Optimization'),
bullet('Glycaemic control: tighten HbA1c; sliding scale insulin perioperatively'),
bullet('Nutritional support: correct hypoalbuminaemia (enteral or parenteral nutrition); ensure zinc, vitamin C supplementation'),
bullet('Cardiac optimization: beta-blockade, treat active coronary disease or heart failure'),
bullet('Renal: optimize fluid balance; avoid nephrotoxic agents'),
bullet('DVT prophylaxis: LMWH + TED stockings on contralateral limb'),
bullet('Smoking cessation: reduces postoperative wound complications'),
bullet('Antibiotic therapy: treat active infection; broad-spectrum covering gram-positive, gram-negative and anaerobes (e.g. co-amoxiclav + metronidazole; piperacillin-tazobactam if high risk)'),
bullet('Anticoagulant/antiplatelet management: bridge as needed'),
spacer(),
h2('4.2 Deciding Between Revascularization vs. Primary Amputation'),
bullet('Always consider revascularization first if the limb is potentially salvageable (Rutherford Class I-IIb)'),
bullet('Endovascular (angioplasty/stenting) vs. open bypass - guided by anatomy, fitness, TASC classification'),
bullet('A median of two revascularization procedures are now performed before amputation in European centers'),
bullet('Amputation is indicated if: revascularization not feasible, failed revascularization, tissue loss too extensive, patient not fit for bypass, sepsis requiring urgent source control'),
spacer(),
h2('4.3 Staged vs. Single-Stage BKA'),
infoBox('Two-Stage Approach (recommended for grossly infected/septic foot)', 'Stage 1 - Guillotine (open) amputation at distal leg/ankle level, as distal as possible to healthy tissue. Wound left open. Negative pressure wound therapy (NPWT/VAC). Stage 2 - Formal BKA once infection has resolved (typically within 1 week). Two-stage approach has significantly better outcomes than one-stage BKA in the septic foot.'),
spacer(),
];
// ─── SECTION 5: Surgical Technique ───────────────────────────────────────────
const section5 = [
h1('5. SURGICAL TECHNIQUE - BKA (LONG POSTERIOR FLAP / BURGESS TECHNIQUE)'),
h2('5.1 Positioning and Setup'),
bullet('Patient: supine'),
bullet('Tourniquet: avoid if peripheral vascular disease (impairs assessment of bleeding; may worsen ischemia); use with caution - inflate if needed for trauma/oncology cases'),
bullet('Prep and drape entire lower limb'),
spacer(),
h2('5.2 Flap Planning (on the skin with a marker)'),
bullet('Tibial transection level: 10-15 cm distal to the tibial tuberosity (at the level of greatest calf circumference)'),
bullet('Anterior incision: placed 1 cm distal to planned tibial cut; length = 2/3 of calf circumference at this level'),
bullet('Longitudinal medial & lateral limbs: each = 1/3 of calf circumference'),
bullet('Posterior flap length: 1/3 of circumference - err on the side of making it too long (trim at closure)'),
bullet('Curve the medial/lateral-to-posterior transitions to avoid dog-ear redundancy at corners'),
infoBox('Why Long Posterior Flap?', 'The gastrocnemius and soleus muscles are supplied by the sural arteries, which originate PROXIMAL to the knee and are usually patent even in PAD patients who have compromised tibial vessels. This gives the posterior flap superior vascularity and the highest primary healing rate.'),
spacer(),
h2('5.3 Step-by-Step Technique'),
numbered('Skin incision down to fascia. Ligate and divide the greater and lesser saphenous veins.'),
numbered('Anterior compartment: Deepen incision through periosteum of tibia. Divide muscles of anterior compartment at skin incision level. Identify, ligate, and divide the anterior tibial neurovascular bundle.'),
numbered('Tibial transection: Strip periosteum circumferentially. Transect tibia at planned level with oscillating saw. Bevel the anterior edge of the tibial cut at 45 degrees (prevents pressure sore under prosthesis).'),
numbered('Fibular transection: Clear fibula and transect 2 cm PROXIMAL to tibial cut using bone cutter or saw.'),
numbered('Posterior compartment: Retract tibia anteriorly. Identify, ligate, and divide the posterior tibial and peroneal neurovascular bundles (suture ligature).'),
numbered('Posterior muscle division: Divide with amputation knife or electrocautery along plane of longitudinal incisions. Take extreme caution not to damage posterior flap skin edges. Complete division of gastrocnemius tendon with scalpel distally.'),
numbered('Specimen removal and haemostasis: Manual compression with swab. Identify and ligate remaining vessels.'),
numbered('Nerve handling: Posterior tibial nerve retracted distally, highly ligated, sharply divided, and ALLOWED TO RETRACT - prevents painful neuroma at weight-bearing end.'),
numbered('Flap assessment: Rotate posterior flap anteriorly. Assess thickness and tension. Debulk gastrocnemius/soleus musculature if needed for tension-free closure.'),
numbered('Wound irrigation: Thorough saline irrigation. File rough bone edges smooth. Do NOT use bone wax.'),
numbered('Drain: Optional closed suction drain to prevent haematoma.'),
numbered('Closure: Deep posterior musculature sutured to cover and stabilize tibial end (myodesis - absorbable). Gastrocnemius fascia to anterior fascia (absorbable). Subcutaneous layer (absorbable). Skin - monofilament suture or staples.'),
spacer(),
h2('5.4 Alternative Flap Techniques'),
twoColTable([
['Long posterior flap (Burgess)', 'PREFERRED. Best blood supply via sural arteries. Highest primary healing rate.'],
['Sagittal (equal anteroposterior) flaps', 'Equal medial and lateral myocutaneous flaps. Used when posterior flap unavailable.'],
['Skew flap', 'Equal anteromedial and posterolateral flaps. Alternative when standard posterior flap not possible.'],
['Ertl (Osteomyoplastic) amputation', 'Bone bridge created between tibia and fibula using resected fibula. More stable end-bearing stump. Prevents fibular instability.'],
['Guillotine (open) amputation', 'For grossly septic foot. Circumferential incision at ankle level. All structures divided. Wound left open. Stage 1 of two-stage procedure.'],
], ['Technique', 'Indication / Advantage']),
spacer(),
warningBox('Critical Technical Points', '1. Never use bone wax (increases infection risk) | 2. Bevel anterior tibial edge 45 degrees | 3. Fibula cut 2 cm proximal to tibia | 4. Nerves must retract proximally - never leave at stump end | 5. Posterior flap skin edges must be protected throughout'),
spacer(),
];
// ─── SECTION 6: Postoperative Management ─────────────────────────────────────
const section6 = [
h1('6. POSTOPERATIVE MANAGEMENT'),
h2('6.1 Immediate Postoperative Care'),
bullet('Position: stump elevated to reduce oedema; avoid prolonged hip/knee flexion'),
bullet('Pain control: regular analgesia; consider regional nerve catheter (popliteal or epidural); manage phantom limb pain proactively (see below)'),
bullet('Wound care: rigid dressing preferred in early postoperative period to control oedema and shape stump; left undisturbed 4-5 days unless clinical concern'),
bullet('DVT prophylaxis: LMWH + compression stockings on contralateral limb'),
bullet('Glycaemic control: tight perioperative glucose management'),
bullet('Nutritional support: ensure adequate protein and caloric intake'),
bullet('Drain management: remove drain when output <30 mL/24 hours (usually 24-48 hrs)'),
spacer(),
h2('6.2 Stump Care and Shaping'),
bullet('Crepe bandaging / shrinker sock: applied in figure-of-eight pattern to shape the stump into a cylindrical/conical form suitable for prosthetic fitting'),
bullet('Rigid post-operative dressing (RPOD): plaster cast or fibreglass shell applied in theatre - controls oedema, reduces pain, protects wound, facilitates early mobilisation'),
bullet('Pylon (early walking aid): temporary prosthetic device to encourage early weight-bearing'),
spacer(),
h2('6.3 Suture Removal'),
bullet('Typically at 2-3 weeks (longer than standard due to poor vascularity)'),
bullet('Assess for wound dehiscence, signs of infection, or stump necrosis at each dressing change'),
spacer(),
];
// ─── SECTION 7: Complications ─────────────────────────────────────────────────
const section7 = [
h1('7. COMPLICATIONS'),
h2('7.1 Early Complications'),
twoColTable([
['Haematoma', 'Avoid by meticulous haemostasis + closed drain. Risk increases with anticoagulants.'],
['Wound infection', 'Most common early complication. Managed with antibiotics +/- debridement.'],
['Wound dehiscence / flap necrosis', 'Due to ischaemia or tension. May require re-amputation at higher level.'],
['Stump failure / need for re-amputation', 'Occurs in ~15-25% of dysvascular BKA. Conversion to AKA if flap non-viable.'],
['DVT / PE', 'High risk in immobile vascular patients. Prophylactic LMWH mandatory.'],
['Pneumonia / cardiac events', 'Perioperative cardiac mortality significant in PAD patients.'],
], ['Complication', 'Notes']),
spacer(),
h2('7.2 Late Complications'),
twoColTable([
['Phantom limb pain', 'Pain perceived in the amputated limb. Affects 50-80% of amputees. Managed with gabapentin, pregabalin, amitriptyline, mirror therapy, TENS, targeted muscle reinnervation (TMR).'],
['Phantom limb sensation', 'Non-painful awareness of amputated limb. Common and usually benign.'],
['Stump neuroma', 'Painful ball of disorganized nerve fibres at stump end. Prevented by proximal nerve ligation + retraction. Managed with local injection or surgical excision.'],
['Skin breakdown / pressure sores', 'At prosthetic contact points. Requires socket adjustment, padding.'],
['Stump oedema', 'Impairs prosthetic fitting. Managed with compression shrinker, elevation.'],
['Flexion contracture', 'Knee flexion contracture develops if BKA stump is maintained in flexion. Prevented with prone lying + physiotherapy.'],
['Bursa formation', 'At bony prominences under socket. Socket modification + aspiration.'],
['Bone spur / heterotopic ossification', 'Painful bone spurs at cut bone end. Surgical filing if symptomatic.'],
['Re-amputation at higher level', 'Required in ~15-25% due to stump failure or progressive disease.'],
['Depression / psychological morbidity', 'High prevalence. Requires early psychological support and counselling.'],
['Contralateral limb threat', 'Progressive PAD/diabetes may threaten the other leg. Vigilant surveillance mandatory.'],
], ['Complication', 'Management']),
spacer(),
infoBox('Phantom Limb Pain Management', 'First-line: Gabapentin (300-3600 mg/day) or Pregabalin. Second-line: Amitriptyline (low dose). Others: Tramadol, Mirror therapy, TENS, Calcitonin. Emerging: Targeted Muscle Reinnervation (TMR) at time of amputation significantly reduces phantom pain and neuroma formation.'),
spacer(),
];
// ─── SECTION 8: Prosthetics ──────────────────────────────────────────────────
const section8 = [
h1('8. PROSTHETICS FOR BKA'),
h2('8.1 Timeline of Prosthetic Fitting'),
bullet('Early prosthetic fitting: 5-21 days post-op if wound capable of load transfer and patient has adequate physical reserve (IPOP - Immediate Post-Operative Prosthesis)'),
bullet('Temporary / preparatory prosthesis: fitted at 4-6 weeks once stump has matured and swelling resolved'),
bullet('Definitive prosthesis: fitted at 3-6 months when stump shape is stable'),
spacer(),
h2('8.2 Components of a BKA Prosthesis'),
twoColTable([
['Socket', 'Interfaces directly with stump. Must fit precisely. Various liner materials (silicone, urethane, thermoplastic). PTB (patellar tendon bearing) socket most common.'],
['Liner / Suspension system', 'Silicone liner with pin lock, suction, or seal-in suspension. Maintains socket-stump interface.'],
['Pylon / Shank', 'Structural component connecting socket to foot. Endoskeletal (cosmetic cover over metal tube) or exoskeletal.'],
['Prosthetic foot / ankle', 'Multiple types - see below.'],
], ['Component', 'Detail']),
spacer(),
h2('8.3 Types of Prosthetic Feet/Ankles'),
twoColTable([
['SACH (Solid Ankle Cushion Heel)', 'Simplest and cheapest. Rigid keel, cushioned heel. Suitable for low-activity elderly patients. No energy return.'],
['Single-axis foot', 'Allows limited plantar/dorsiflexion. Better for uneven terrain. Low-moderate activity.'],
['Multi-axis foot', 'Allows inversion/eversion + rotation + plantar/dorsiflexion. Best for uneven terrain and active patients.'],
['Energy-Storing and Return (ESAR) / Carbon fibre foot', 'Spring-like carbon fibre keel stores energy during stance and releases it at push-off. Examples: Flex-Foot Vari-Flex, Ossur Cheetah. Best for active patients and athletes. K3-K4 activity level.'],
['Microprocessor-controlled ankle (bionic)', 'Electronic sensors and motor adjust ankle position in real-time. Excellent for highly active patients on varied terrain. Most expensive. K4 activity level.'],
['Dynamic elastic response (DER)', 'Carbon composite stores/returns energy. Used in sports/running prostheses.'],
], ['Type', 'Features / Indication']),
spacer(),
h2('8.4 K-Level Classification (Medicare Functional Classification)'),
twoColTable([
['K0', 'No ability to ambulate or transfer. No prosthetic benefit. Wheelchair-dependent.'],
['K1', 'Limited ability to transfer/ambulate on level surfaces at fixed cadence. SACH foot.'],
['K2', 'Ability to traverse low-level environmental barriers (curbs, stairs, uneven surfaces). Single- or multi-axis foot.'],
['K3', 'Community ambulator. Variable cadence. Can traverse most barriers. ESAR/carbon foot preferred.'],
['K4', 'Exceeds basic ambulation - high activity (sports, running, heavy manual labour). Dynamic carbon foot / microprocessor ankle.'],
], ['K-Level', 'Functional Description']),
spacer(),
h2('8.5 Socket Design for BKA'),
bullet('PTB (Patellar Tendon Bearing): pressure distributed over patellar tendon, medial tibial flare, popliteal fossa. Classic design.'),
bullet('TSB (Total Surface Bearing): pressure distributed evenly over entire residual limb surface with silicone liner. Modern preferred design - better comfort, less skin breakdown.'),
bullet('Osseointegration: direct bone-anchored prosthetic attachment. Emerging technique. Eliminates socket; allows improved sensory feedback and range of motion.'),
spacer(),
];
// ─── SECTION 9: Rehabilitation ───────────────────────────────────────────────
const section9 = [
h1('9. REHABILITATION AFTER BKA'),
h2('9.1 Phases of Rehabilitation'),
h3('Phase 1 - Pre-prosthetic Phase (0-6 weeks)'),
bullet('Wound healing and stump shaping'),
bullet('Rigid dressing/shrinker sock application'),
bullet('Physiotherapy: bed mobility, transfers, non-weight-bearing mobility with walking frame or crutches'),
bullet('Strengthening exercises: upper limbs, contralateral limb, core, hip extensors and abductors of amputated side'),
bullet('Prevent knee flexion contracture: prone positioning, passive extension exercises'),
bullet('Occupational therapy: ADL assessment, home modifications, wheelchair skills if needed'),
bullet('Psychological support: adjustment to amputation, body image, depression screening'),
spacer(),
h3('Phase 2 - Early Prosthetic Phase (6-12 weeks)'),
bullet('Prosthetic fitting and socket assessment'),
bullet('Parallel bars walking: weight-bearing, gait training, balance'),
bullet('Progress to indoor walking with walking aid (frame, crutches)'),
bullet('Prosthetic skin care: inspect stump daily; limit wear to 1 hour initially, increasing gradually'),
bullet('Edema management: shrinker socks when not wearing prosthesis'),
spacer(),
h3('Phase 3 - Community Ambulation Phase (3-6 months)'),
bullet('Outdoor gait training: uneven terrain, ramps, stairs'),
bullet('Energy conservation strategies'),
bullet('Return to driving assessment'),
bullet('Vocational rehabilitation'),
bullet('Sports / advanced activities (for younger/active patients)'),
spacer(),
h2('9.2 Multidisciplinary Team (MDT)'),
bullet('Vascular/Orthopaedic Surgeon'),
bullet('Physiotherapist - gait training, strengthening'),
bullet('Occupational Therapist - ADLs, home modifications'),
bullet('Prosthetist - socket and component fitting'),
bullet('Rehabilitation Physician / Physiatrist'),
bullet('Wound care nurse / stump care specialist'),
bullet('Psychologist / Psychiatrist - phantom pain, depression, PTSD'),
bullet('Dietitian - nutritional optimization'),
bullet('Social worker - community support, benefits, housing'),
spacer(),
h2('9.3 Predictors of Successful Rehabilitation'),
twoColTable([
['Good prognostic factors', 'Young age | Traumatic amputation (vs vascular) | Good contralateral limb | Strong motivation | Good social support | Intact cognition | No severe cardiopulmonary disease'],
['Poor prognostic factors', 'Advanced age | Bilateral amputation | Severe cardiac/respiratory disease | Cognitive impairment | Severe contralateral limb disease | Poor nutrition | Prolonged immobility before amputation'],
], ['Factor', 'Detail']),
spacer(),
];
// ─── SECTION 10: Outcomes ─────────────────────────────────────────────────────
const section10 = [
h1('10. OUTCOMES AND PROGNOSIS'),
h2('10.1 Perioperative Outcomes'),
twoColTable([
['30-day mortality (BKA in PAD)', '~8.9%'],
['30-day mortality (AKA in PAD)', '~27.7%'],
['Primary healing rate (long posterior flap)', 'Highest of all techniques; ~75-80% primary healing in vascular patients'],
['Stump failure / re-amputation rate', '~15-25% in dysvascular patients within 1 year'],
['Hospital stay', 'Mean 7-14 days'],
], ['Outcome', 'Data']),
spacer(),
h2('10.2 Functional Outcomes'),
bullet('Ambulation rate with or without assistance: up to 65% of BKA patients'),
bullet('Community ambulation: achievable in K2-K3 level patients with adequate cardiac reserve'),
bullet('Energy expenditure: walking with BKA prosthesis requires ~25-40% more energy than normal gait (vs ~65% more for AKA)'),
bullet('Return to work: variable; depends on occupation, age, and rehabilitation success'),
spacer(),
h2('10.3 Long-term Outcomes'),
bullet('5-year survival in dysvascular BKA patients: ~50-60% (reflects underlying cardiovascular morbidity)'),
bullet('Contralateral limb amputation risk: ~25-50% at 5 years in diabetic PAD patients - requires vigilant surveillance'),
bullet('Quality of life: significantly impaired but improves with prosthetic rehabilitation; psychological support is key'),
bullet('Re-amputation to above-knee level: ~15-25% within 2 years for vascular cases'),
spacer(),
warningBox('Key Clinical Message for Presentation', 'BKA is NOT a failure of treatment - it is an intervention that can provide good functional outcomes, pain relief, and improved quality of life. The goal is to maximise independence through appropriate level selection, meticulous technique, prompt wound care, and comprehensive rehabilitation with early prosthetic fitting.'),
spacer(),
];
// ─── SECTION 11: Quick Reference Summary ─────────────────────────────────────
const section11 = [
pageBreak(),
h1('11. QUICK REFERENCE SUMMARY - FOR CASE PRESENTATION'),
twoColTable([
['Definition', 'Amputation through tibia & fibula, distal to knee'],
['Most common indication', 'Chronic limb-threatening ischemia (CLTI) + Diabetic foot infection'],
['Vascular investigations', 'ABI, Toe pressure, TcPO2, Doppler USS, CTA/MRA'],
['Lab investigations', 'FBC, RFT, HbA1c, Albumin, Coagulation, Blood cultures, X-ray/MRI foot'],
['Preferred technique', 'Long posterior flap (Burgess) - blood supply from sural arteries'],
['Tibial transection level', '10-15 cm below tibial tuberosity; fibula 2 cm proximal to tibia'],
['Staged approach', 'Guillotine first for grossly infected foot, then formal BKA 1 week later'],
['Contraindication to BKA', 'Fixed knee contracture | Inadequate flap tissue | ABI < 0.5 with no profunda flow'],
['Key intra-op points', 'Bevel anterior tibia 45 deg | No bone wax | Nerves retracted proximally | Myodesis'],
['Early complications', 'Haematoma, wound infection, flap necrosis, re-amputation, DVT/PE'],
['Late complications', 'Phantom pain, neuroma, stump breakdown, flexion contracture, depression'],
['Prosthesis timeline', 'IPOP 5-21 days | Definitive 3-6 months | Based on K-level'],
['Most common BKA foot', 'SACH (elderly/low activity) | ESAR carbon foot (active, K3-K4)'],
['Ambulation rate', '~65% of BKA patients achieve ambulation'],
['30-day mortality', '~8.9% (BKA) vs 27.7% (AKA) - favour BKA whenever possible'],
], ['Parameter', 'Key Point']),
spacer(),
];
// ─── Footer / Header ──────────────────────────────────────────────────────────
const header = new Header({
children: [
new Paragraph({
children: [
new TextRun({ text: 'BKA Surgical Reference Guide', bold: true, size: 20, font: 'Calibri', color: '2E75B6' }),
new TextRun({ text: ' | For Surgical Residents', size: 20, font: 'Calibri', color: '595959' }),
],
alignment: AlignmentType.RIGHT,
border: { bottom: { style: BorderStyle.SINGLE, size: 4, color: 'D9D9D9' } },
}),
],
});
const footer = new Footer({
children: [
new Paragraph({
children: [
new TextRun({ text: 'Sources: Sabiston | Mulholland & Greenfield\'s Surgery | Fischer\'s Mastery of Surgery | Campbell\'s Operative Orthopaedics | Pye\'s Surgical Handicraft Page ', size: 18, font: 'Calibri', color: '7F7F7F' }),
new PageNumber(),
],
alignment: AlignmentType.CENTER,
border: { top: { style: BorderStyle.SINGLE, size: 4, color: 'D9D9D9' } },
}),
],
});
// ─── Assemble Document ────────────────────────────────────────────────────────
const doc = new Document({
numbering: {
config: [
{
reference: 'my-numbering',
levels: [
{
level: 0,
format: LevelFormat ? LevelFormat.DECIMAL : 'decimal',
text: '%1.',
alignment: AlignmentType.LEFT,
style: { paragraph: { indent: { left: 720, hanging: 360 } } },
},
],
},
],
},
styles: {
default: {
document: { run: { font: 'Calibri', size: 22 } },
},
paragraphStyles: [
{
id: 'Heading1',
name: 'Heading 1',
basedOn: 'Normal',
run: { bold: true, size: 32, color: '1F4E79', font: 'Calibri' },
paragraph: {
spacing: { before: 400, after: 120 },
border: { bottom: { style: BorderStyle.SINGLE, size: 6, color: '2E75B6' } },
},
},
{
id: 'Heading2',
name: 'Heading 2',
basedOn: 'Normal',
run: { bold: true, size: 26, color: '2E75B6', font: 'Calibri' },
paragraph: { spacing: { before: 280, after: 80 } },
},
{
id: 'Heading3',
name: 'Heading 3',
basedOn: 'Normal',
run: { bold: true, size: 24, color: '404040', font: 'Calibri', italics: true },
paragraph: { spacing: { before: 180, after: 60 } },
},
],
},
sections: [
{
headers: { default: header },
footers: { default: footer },
properties: { page: { margin: { top: 1000, right: 900, bottom: 1000, left: 900 } } },
children: [
...titlePage,
...section1,
pageBreak(),
...section2,
pageBreak(),
...section3,
pageBreak(),
...section4,
pageBreak(),
...section5,
pageBreak(),
...section6,
pageBreak(),
...section7,
pageBreak(),
...section8,
pageBreak(),
...section9,
pageBreak(),
...section10,
...section11,
],
},
],
});
// ─── Write file ───────────────────────────────────────────────────────────────
Packer.toBuffer(doc).then(buffer => {
fs.writeFileSync('/home/daytona/workspace/bka-reference/BKA_Surgical_Reference_Guide.docx', buffer);
console.log('SUCCESS: File written.');
}).catch(err => {
console.error('ERROR:', err);
process.exit(1);
});
cd /home/daytona/workspace/bka-reference && node generate_bka.js 2>&1
~/bka-reference/generate_bka.js
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/bka-reference/generate_bka.js'
cd /home/daytona/workspace/bka-reference && node generate_bka.js 2>&1
~/bka-reference/generate_bka.js
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/bka-reference/generate_bka.js'
cd /home/daytona/workspace/bka-reference && node generate_bka.js 2>&1
python3 /home/daytona/skills/docx/scripts/office/validate.py /home/daytona/workspace/bka-reference/BKA_Surgical_Reference_Guide.docx 2>&1
ls -lh /home/daytona/workspace/bka-reference/BKA_Surgical_Reference_Guide.docx && python3 -c "import zipfile; z=zipfile.ZipFile('/home/daytona/workspace/bka-reference/BKA_Surgical_Reference_Guide.docx'); print('Valid ZIP. Files:', z.namelist()[:5])"
BKA Surgical Reference Guide
Word Document · DOCX
| Section | Content |
|---|---|
| 1 | Definition and overview with key stats table |
| 2 | Full indications - vascular, infective, traumatic, oncological + contraindications |
| 3 | Pre-op assessment: clinical exam + investigation table (ABI, TcPO2, CTA, MRI, labs) |
| 4 | Pre-op optimization: glycaemic control, nutrition, staged vs single-stage decision |
| 5 | Step-by-step Burgess posterior flap technique (12 numbered steps) + alternative flaps table |
| 6 | Post-op management: rigid dressing, stump shaping, wound care |
| 7 | Complications - early and late, including phantom limb pain management |
| 8 | Prosthetics: timeline, socket types (PTB/TSB), foot types (SACH to carbon fibre to microprocessor), K-level classification |
| 9 | Rehabilitation: 3 phases, MDT roles, predictors of success |
| 10 | Outcomes: perioperative mortality, ambulation rates, 5-year survival |
| 11 | Quick Reference Summary table - ideal for your presentation wrap-up |
Try again