~/supracondylar-pptx/generate.js
const pptxgen = require("pptxgenjs");
const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.author = "MS Orthopaedics 2026";
pres.title = "Supracondylar Fracture Humerus - Management Algorithms & Complications";
// ─── COLOUR PALETTE ──────────────────────────────────────────────
const C = {
navy: "0D2137", // dominant dark bg
teal: "0E7C86", // section accent
gold: "F0A500", // highlight accent
white: "FFFFFF",
silver: "DDE3EC",
red: "C0392B",
green: "1A7A4A",
lightBg: "EEF3F8",
midGray: "5A6A7A",
charcoal:"2C3E50",
};
// ─── HELPER: add a standard slide header bar ─────────────────────
function addHeader(slide, title, subtitle) {
// dark top bar
slide.addShape(pres.shapes.RECTANGLE, {
x: 0, y: 0, w: 10, h: 1.05,
fill: { color: C.navy }, line: { color: C.navy }
});
// teal accent strip
slide.addShape(pres.shapes.RECTANGLE, {
x: 0, y: 1.0, w: 10, h: 0.07,
fill: { color: C.teal }, line: { color: C.teal }
});
slide.addText(title, {
x: 0.35, y: 0.08, w: 9.3, h: 0.55,
fontSize: 22, bold: true, color: C.white,
fontFace: "Calibri", margin: 0
});
if (subtitle) {
slide.addText(subtitle, {
x: 0.35, y: 0.62, w: 9.3, h: 0.35,
fontSize: 12, color: C.gold, fontFace: "Calibri",
italic: true, margin: 0
});
}
}
// ─── HELPER: footer ──────────────────────────────────────────────
function addFooter(slide, ref) {
slide.addShape(pres.shapes.RECTANGLE, {
x: 0, y: 5.45, w: 10, h: 0.18,
fill: { color: C.navy }, line: { color: C.navy }
});
slide.addText(ref || "MS Orthopaedics 2026 | Supracondylar Fracture Humerus", {
x: 0.2, y: 5.45, w: 9.6, h: 0.18,
fontSize: 8, color: C.silver, fontFace: "Calibri", margin: 0
});
}
// ─── HELPER: content card ────────────────────────────────────────
function addCard(slide, x, y, w, h, headerText, headerColor) {
slide.addShape(pres.shapes.RECTANGLE, {
x, y, w, h,
fill: { color: C.white },
line: { color: C.silver, pt: 1 },
shadow: { type: "outer", color: "000000", blur: 4, offset: 2, angle: 135, opacity: 0.10 }
});
slide.addShape(pres.shapes.RECTANGLE, {
x, y, w: w, h: 0.32,
fill: { color: headerColor || C.teal },
line: { color: headerColor || C.teal }
});
slide.addText(headerText, {
x: x + 0.12, y: y + 0.02, w: w - 0.2, h: 0.28,
fontSize: 10, bold: true, color: C.white, fontFace: "Calibri", margin: 0
});
}
// ─── SLIDE 1: TITLE ──────────────────────────────────────────────
{
const s = pres.addSlide();
s.addShape(pres.shapes.RECTANGLE, {
x: 0, y: 0, w: 10, h: 5.625,
fill: { color: C.navy }, line: { color: C.navy }
});
// decorative teal left stripe
s.addShape(pres.shapes.RECTANGLE, {
x: 0, y: 0, w: 0.18, h: 5.625,
fill: { color: C.teal }, line: { color: C.teal }
});
// gold bottom stripe
s.addShape(pres.shapes.RECTANGLE, {
x: 0, y: 5.3, w: 10, h: 0.33,
fill: { color: C.gold }, line: { color: C.gold }
});
s.addText("SUPRACONDYLAR FRACTURE\nof the HUMERUS", {
x: 0.5, y: 0.7, w: 9, h: 1.8,
fontSize: 36, bold: true, color: C.white,
fontFace: "Calibri", align: "center",
charSpacing: 1
});
s.addShape(pres.shapes.RECTANGLE, {
x: 3, y: 2.6, w: 4, h: 0.06,
fill: { color: C.gold }, line: { color: C.gold }
});
s.addText("Management Algorithms & Complications", {
x: 0.5, y: 2.75, w: 9, h: 0.55,
fontSize: 18, color: C.gold, fontFace: "Calibri", align: "center"
});
s.addText("2026 MS Orthopaedics Theory Examination", {
x: 0.5, y: 3.4, w: 9, h: 0.45,
fontSize: 15, color: C.silver, fontFace: "Calibri", align: "center", italic: true
});
s.addText([
{ text: "Sources: ", options: { bold: true } },
{ text: "Campbell's Operative Orthopaedics 15th Ed 2026 | Rosen's Emergency Medicine | Tintinalli | Bailey & Love 28th Ed" }
], {
x: 0.5, y: 4.1, w: 9, h: 0.4,
fontSize: 9, color: C.silver, fontFace: "Calibri", align: "center"
});
}
// ─── SLIDE 2: OVERVIEW / HIGH-YIELD FACTS ────────────────────────
{
const s = pres.addSlide();
s.addShape(pres.shapes.RECTANGLE, {
x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.lightBg }, line: { color: C.lightBg }
});
addHeader(s, "High-Yield Overview", "MS Orthopaedics Exam Essentials");
const facts = [
["Most common elbow fracture in children", "60% of all paediatric elbow injuries"],
["Peak incidence", "Ages 5–7 years"],
["Extension type", "97–98% of all cases"],
["Mechanism", "FOOSH — Fall on Outstretched Hand with hyperextension"],
["Key nerve at risk", "Anterior Interosseous Nerve (AIN) → pointing index sign"],
["Key vessel at risk", "Brachial artery (Type III posterolateral)"],
["Classification", "Gartland Types I / IIA / IIB / III / IV"],
["Dreaded complication", "Volkmann Ischaemic Contracture"],
["Most common late complication", "Cubitus Varus (Gunstock Deformity)"],
];
const cols = [[0, 4], [5.1, 4.7]];
const startY = 1.2;
const rowH = 0.46;
facts.forEach((f, i) => {
const col = i < 5 ? 0 : 1;
const row = col === 0 ? i : i - 5;
const x = cols[col][0] + 0.2;
const bx = cols[col][0];
const y = startY + row * rowH;
const w = cols[col][1];
const bg = row % 2 === 0 ? C.white : "F2F6FB";
s.addShape(pres.shapes.RECTANGLE, {
x: bx, y: y - 0.02, w: w + 0.2, h: rowH - 0.04,
fill: { color: bg }, line: { color: C.silver, pt: 0.5 }
});
// teal left indicator
s.addShape(pres.shapes.RECTANGLE, {
x: bx, y: y - 0.02, w: 0.06, h: rowH - 0.04,
fill: { color: C.teal }, line: { color: C.teal }
});
s.addText([
{ text: f[0] + ": ", options: { bold: true, color: C.charcoal } },
{ text: f[1], options: { color: C.midGray } }
], {
x: x + 0.08, y: y + 0.03, w: w - 0.15, h: rowH - 0.12,
fontSize: 10.5, fontFace: "Calibri", margin: 0
});
});
addFooter(s, "Campbell's Operative Orthopaedics 15th Ed 2026 | Rosen's Emergency Medicine");
}
// ─── SLIDE 3: GARTLAND CLASSIFICATION ───────────────────────────
{
const s = pres.addSlide();
s.addShape(pres.shapes.RECTANGLE, {
x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.lightBg }, line: { color: C.lightBg }
});
addHeader(s, "Gartland Classification — Extension Type Supracondylar Fracture",
"Modified Gartland Classification | Campbell's Operative Orthopaedics 15th Ed 2026");
const types = [
{ type: "Type I", color: C.green, desc: "Undisplaced / ≤2 mm displacement\nPosterior fat pad sign may be only finding", rx: "Posterior fat pad sign present", tx: "Long-arm cast 3 weeks\nElbow 90° flexion, forearm neutral" },
{ type: "Type IIA", color: "2471A3", desc: "Angulated, posterior cortex intact\nStable — no rotational deformity", rx: "AHL misses mid-capitellum", tx: "Closed reduction + above-elbow cast" },
{ type: "Type IIB", color: "D68910", desc: "Posterior cortex intact\nUnstable — rotation / coronal angulation", rx: "AHL misses mid-capitellum\nBaumann angle abnormal", tx: "Closed reduction + percutaneous K-wires\n(2–3 lateral pins)" },
{ type: "Type III", color: C.red, desc: "Complete displacement\nNo cortical contact", rx: "Complete fracture through olecranon fossa\nNeurovascular injury risk HIGH", tx: "CRPP — Closed Reduction +\nPercutaneous Pinning (URGENT)" },
{ type: "Type IV", color: "6C3483", desc: "Periosteal hinge disrupted\nUnstable in BOTH flexion & extension", rx: "High-energy trauma\nComplete soft tissue disruption", tx: "CRPP or ORIF\nVascular exploration if pulseless" },
];
const startY = 1.12;
const rowH = 0.82;
// Column headers
["TYPE", "FRACTURE PATTERN", "RADIOLOGICAL FEATURES", "TREATMENT"].forEach((h, i) => {
const xs = [0.08, 1.28, 4.38, 7.28];
const ws = [1.15, 3.0, 2.85, 2.65];
s.addShape(pres.shapes.RECTANGLE, {
x: xs[i], y: startY - 0.36, w: ws[i], h: 0.34,
fill: { color: C.navy }, line: { color: C.navy }
});
s.addText(h, {
x: xs[i] + 0.05, y: startY - 0.36, w: ws[i] - 0.05, h: 0.34,
fontSize: 9, bold: true, color: C.white, fontFace: "Calibri", valign: "middle", margin: 0
});
});
types.forEach((t, i) => {
const y = startY + i * rowH;
const bg = i % 2 === 0 ? C.white : "F0F4F8";
s.addShape(pres.shapes.RECTANGLE, {
x: 0.08, y, w: 9.85, h: rowH - 0.04,
fill: { color: bg }, line: { color: C.silver, pt: 0.5 }
});
s.addShape(pres.shapes.RECTANGLE, {
x: 0.08, y, w: 1.15, h: rowH - 0.04,
fill: { color: t.color }, line: { color: t.color }
});
s.addText(t.type, {
x: 0.1, y: y + 0.02, w: 1.1, h: rowH - 0.08,
fontSize: 12, bold: true, color: C.white, fontFace: "Calibri",
align: "center", valign: "middle", margin: 0
});
s.addText(t.desc, {
x: 1.3, y: y + 0.04, w: 3.0, h: rowH - 0.1,
fontSize: 9, color: C.charcoal, fontFace: "Calibri", valign: "top", margin: 0
});
s.addText(t.rx, {
x: 4.4, y: y + 0.04, w: 2.8, h: rowH - 0.1,
fontSize: 9, color: C.midGray, fontFace: "Calibri", valign: "top", margin: 0
});
s.addText(t.tx, {
x: 7.3, y: y + 0.04, w: 2.6, h: rowH - 0.1,
fontSize: 9, color: C.charcoal, fontFace: "Calibri", valign: "top", bold: false, margin: 0
});
});
addFooter(s, "Gartland Classification | Campbell's Operative Orthopaedics 15th Ed 2026, Table 38.2");
}
// ─── SLIDE 4: RADIOLOGICAL ASSESSMENT ───────────────────────────
{
const s = pres.addSlide();
s.addShape(pres.shapes.RECTANGLE, {
x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.lightBg }, line: { color: C.lightBg }
});
addHeader(s, "Radiological Assessment & Key Signs",
"AP + Lateral + Oblique Views | Critical for Diagnosis and Grading");
const signs = [
{
name: "Anterior Humeral Line (AHL)",
color: C.teal,
points: [
"Draw line along ANTERIOR cortex of humerus on lateral X-ray",
"Normally intersects the MIDDLE THIRD of capitellum",
"In extension supracondylar fracture:",
" → Line passes through anterior 1/3 or ANTERIOR to capitellum",
" → Capitellum is displaced posteriorly",
"Most sensitive sign for subtle Type I/II fractures"
]
},
{
name: "Baumann Angle",
color: C.gold,
points: [
"Measured on AP view",
"Angle between: capitellar physis line ∠ long axis of humerus",
"Normal: 70–75 degrees",
"Used to: detect fractures, assess adequacy of reduction",
"Compare with contralateral side always",
"Asymmetric Baumann angle = malreduction"
]
},
{
name: "Fat Pad Signs (Lateral View)",
color: "9B59B6",
points: [
"POSTERIOR fat pad = ALWAYS pathological",
" → Indicates haemarthrosis / effusion",
" → Suggests occult fracture even if fracture line invisible",
"ANTERIOR fat pad 'SAIL SIGN':",
" → Abnormal when bulging/elevated anterior to coronoid fossa",
"Type I fractures: fat pad sign may be ONLY finding"
]
},
{
name: "CRITOE — Ossification Order",
color: C.navy,
points: [
"C — Capitellum (6–12 months)",
"R — Radial head (4–5 years)",
"I — Internal (medial) epicondyle (5–7 years)",
"T — Trochlea (9–10 years)",
"O — Olecranon (9–10 years)",
"E — External (lateral) epicondyle (10–12 years)"
]
}
];
const positions = [
{ x: 0.15, y: 1.2, w: 4.65, h: 2.0 },
{ x: 5.1, y: 1.2, w: 4.65, h: 2.0 },
{ x: 0.15, y: 3.3, w: 4.65, h: 2.1 },
{ x: 5.1, y: 3.3, w: 4.65, h: 2.1 },
];
signs.forEach((sign, i) => {
const p = positions[i];
addCard(s, p.x, p.y, p.w, p.h, sign.name, sign.color);
const bullets = sign.points.map((pt, j) => ({
text: pt,
options: { bullet: j < sign.points.length - 1 ? { type: "bullet" } : { type: "bullet" }, breakLine: true, fontSize: 9.5, color: C.charcoal, fontFace: "Calibri" }
}));
bullets[bullets.length - 1].options.breakLine = false;
s.addText(bullets, {
x: p.x + 0.15, y: p.y + 0.38, w: p.w - 0.25, h: p.h - 0.44,
fontSize: 9.5, fontFace: "Calibri", color: C.charcoal, valign: "top"
});
});
addFooter(s, "Rosen's Emergency Medicine p. 3304–3305 | Tintinalli's Emergency Medicine");
}
// ─── SLIDE 5: MANAGEMENT ALGORITHM (OVERALL) ────────────────────
{
const s = pres.addSlide();
s.addShape(pres.shapes.RECTANGLE, {
x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.lightBg }, line: { color: C.lightBg }
});
addHeader(s, "Management Algorithm — By Gartland Type",
"Emergency Assessment → Classification → Definitive Treatment");
// ── Algorithm boxes ──
// Top: Emergency Assessment
s.addShape(pres.shapes.RECTANGLE, {
x: 3.2, y: 1.12, w: 3.6, h: 0.65,
fill: { color: C.navy }, line: { color: C.navy },
shadow: { type: "outer", color: "000000", blur: 4, offset: 2, angle: 135, opacity: 0.15 }
});
s.addText("EMERGENCY ASSESSMENT", {
x: 3.2, y: 1.12, w: 3.6, h: 0.65,
fontSize: 11, bold: true, color: C.gold, align: "center", valign: "middle",
fontFace: "Calibri"
});
// arrow down
s.addShape(pres.shapes.RECTANGLE, { x: 4.95, y: 1.77, w: 0.1, h: 0.3, fill: { color: C.teal }, line: { color: C.teal } });
// Neurovascular box
s.addShape(pres.shapes.RECTANGLE, {
x: 3.0, y: 2.07, w: 4.0, h: 0.55,
fill: { color: C.teal }, line: { color: C.teal }
});
s.addText("Neurovascular Exam + X-ray (AP, Lateral, Oblique)", {
x: 3.0, y: 2.07, w: 4.0, h: 0.55,
fontSize: 10, bold: true, color: C.white, align: "center", valign: "middle", fontFace: "Calibri"
});
// arrow down
s.addShape(pres.shapes.RECTANGLE, { x: 4.95, y: 2.62, w: 0.1, h: 0.3, fill: { color: C.teal }, line: { color: C.teal } });
// Gartland Classification node
s.addShape(pres.shapes.RECTANGLE, {
x: 3.3, y: 2.92, w: 3.4, h: 0.52,
fill: { color: C.gold }, line: { color: C.gold }
});
s.addText("Gartland Classification", {
x: 3.3, y: 2.92, w: 3.4, h: 0.52,
fontSize: 12, bold: true, color: C.navy, align: "center", valign: "middle", fontFace: "Calibri"
});
// horizontal line
s.addShape(pres.shapes.RECTANGLE, { x: 0.5, y: 3.5, w: 9.0, h: 0.06, fill: { color: C.teal }, line: { color: C.teal } });
// 4 treatment boxes
const txBoxes = [
{ type: "TYPE I", tx: "Long-arm cast\n3 weeks, 90°\nOutpatient F/U", color: C.green },
{ type: "TYPE IIA", tx: "Closed reduction\n+ Above-elbow\ncast 3–4 wks", color: "2471A3" },
{ type: "TYPE IIB\n& TYPE III", tx: "CRPP\n2–3 lateral K-wires\n+ Above-elbow cast", color: C.red },
{ type: "TYPE IV", tx: "CRPP or ORIF\nVascular assessment\nArtery exploration PRN", color: "6C3483" },
];
txBoxes.forEach((b, i) => {
const x = 0.22 + i * 2.4;
// vertical arrow
s.addShape(pres.shapes.RECTANGLE, {
x: x + 0.92, y: 3.44, w: 0.08, h: 0.36,
fill: { color: b.color }, line: { color: b.color }
});
s.addShape(pres.shapes.RECTANGLE, {
x: x, y: 3.8, w: 2.0, h: 0.45,
fill: { color: b.color }, line: { color: b.color }
});
s.addText(b.type, {
x: x, y: 3.8, w: 2.0, h: 0.45,
fontSize: 10, bold: true, color: C.white, align: "center", valign: "middle", fontFace: "Calibri"
});
s.addShape(pres.shapes.RECTANGLE, {
x: x, y: 4.25, w: 2.0, h: 1.06,
fill: { color: C.white }, line: { color: b.color, pt: 1.2 }
});
s.addText(b.tx, {
x: x + 0.06, y: 4.28, w: 1.88, h: 1.0,
fontSize: 9.5, color: C.charcoal, fontFace: "Calibri", align: "center", valign: "middle"
});
});
addFooter(s, "Campbell's Operative Orthopaedics 15th Ed 2026 | Bailey & Love's Surgery 28th Ed");
}
// ─── SLIDE 6: VASCULAR INJURY ALGORITHM ─────────────────────────
{
const s = pres.addSlide();
s.addShape(pres.shapes.RECTANGLE, {
x: 0, y: 0, w: 10, h: 5.625, fill: { color: "0A1628" }, line: { color: "0A1628" }
});
// header bar teal
s.addShape(pres.shapes.RECTANGLE, {
x: 0, y: 0, w: 10, h: 1.05, fill: { color: "0D2137" }, line: { color: "0D2137" }
});
s.addShape(pres.shapes.RECTANGLE, {
x: 0, y: 1.0, w: 10, h: 0.07, fill: { color: C.gold }, line: { color: C.gold }
});
s.addText("Pulseless Supracondylar Fracture — Vascular Management Algorithm", {
x: 0.35, y: 0.1, w: 9.3, h: 0.55,
fontSize: 20, bold: true, color: C.white, fontFace: "Calibri", margin: 0
});
s.addText("Type III/IV | SURGICAL EMERGENCY — Volkmann Contracture Prevention", {
x: 0.35, y: 0.64, w: 9.3, h: 0.32,
fontSize: 11, color: C.gold, fontFace: "Calibri", italic: true, margin: 0
});
function flowBox(slide, x, y, w, h, text, fill, textColor, fontSize) {
slide.addShape(pres.shapes.RECTANGLE, {
x, y, w, h, fill: { color: fill }, line: { color: fill },
shadow: { type: "outer", color: "000000", blur: 6, offset: 3, angle: 135, opacity: 0.3 }
});
slide.addText(text, {
x: x + 0.05, y, w: w - 0.1, h,
fontSize: fontSize || 10, bold: true, color: textColor || C.white,
fontFace: "Calibri", align: "center", valign: "middle"
});
}
function arrow(slide, x1, y1, x2, y2, color) {
const isVertical = Math.abs(x2 - x1) < 0.05;
if (isVertical) {
slide.addShape(pres.shapes.RECTANGLE, {
x: x1 - 0.04, y: y1, w: 0.08, h: y2 - y1,
fill: { color: color || C.teal }, line: { color: color || C.teal }
});
} else {
slide.addShape(pres.shapes.RECTANGLE, {
x: Math.min(x1, x2), y: y1, w: Math.abs(x2 - x1), h: 0.07,
fill: { color: color || C.teal }, line: { color: color || C.teal }
});
}
}
// Top: Pulseless hand
flowBox(s, 3.5, 1.18, 3.0, 0.55, "DISPLACED SUPRACONDYLAR\nFRACTURE WITH ABSENT PULSE", C.red, C.white, 9.5);
// Arrow down
arrow(s, 5.0, 1.73, 5.0, 2.05);
// Reduce + pin
flowBox(s, 3.3, 2.05, 3.4, 0.52, "Reduce Fracture & Pin (CRPP)\nin Operating Theatre", C.teal, C.white, 9.5);
// Arrow → split left/right
arrow(s, 5.0, 2.57, 5.0, 2.78);
// horizontal
arrow(s, 2.2, 2.82, 7.8, 2.82);
// left vertical down
arrow(s, 2.2, 2.82, 2.2, 3.1);
// right vertical down
arrow(s, 7.8, 2.82, 7.8, 3.1);
// Left branch: ADEQUATE PERFUSION (pink pulseless)
flowBox(s, 0.35, 3.1, 3.65, 0.52, "PINK PULSELESS HAND\n(Adequate perfusion, good capillary refill)", "1A7A4A", C.white, 9);
arrow(s, 2.17, 3.62, 2.17, 3.88);
flowBox(s, 0.35, 3.88, 3.65, 0.72,
"Observe in 45° elbow flexion\nDO NOT hyperflexe\nPulse returns in 24–48 hr in most cases\nMonitor hourly neurovascular obs", "155A35", C.white, 8.5);
// Right branch: DYSVASCULAR
flowBox(s, 5.95, 3.1, 3.6, 0.52, "DYSVASCULAR HAND\n(Absent perfusion, pallor, cold)", C.red, C.white, 9);
arrow(s, 7.75, 3.62, 7.75, 3.88);
flowBox(s, 5.95, 3.88, 3.6, 0.72,
"Explore brachial artery\n(Anterior approach)\nRepair / vein graft\nFasciotomy if compartment syndrome\nPrepare saphenous vein graft", "8B0000", C.white, 8.5);
// Warning box at bottom
s.addShape(pres.shapes.RECTANGLE, {
x: 0.3, y: 4.68, w: 9.4, h: 0.62,
fill: { color: "1A1A2E" }, line: { color: C.gold, pt: 1.5 }
});
s.addText([
{ text: "⚠ KEY EXAM POINT: ", options: { bold: true, color: C.gold } },
{ text: "Arteriography should NEVER delay closed reduction | White pulseless hand = surgical emergency to prevent Volkmann Ischaemic Contracture (compartment syndrome in 0.1–0.3% of cases)", options: { color: C.silver } }
], {
x: 0.45, y: 4.7, w: 9.1, h: 0.58,
fontSize: 9.5, fontFace: "Calibri", valign: "middle"
});
addFooter(s, "Campbell's Operative Orthopaedics 15th Ed 2026, Fig. 38.11 | Bailey & Love 28th Ed p. 462");
}
// ─── SLIDE 7: NERVE INJURY MANAGEMENT ───────────────────────────
{
const s = pres.addSlide();
s.addShape(pres.shapes.RECTANGLE, {
x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.lightBg }, line: { color: C.lightBg }
});
addHeader(s, "Neurological Complications — Assessment & Management",
"Neuropraxia is most common; assessment is MANDATORY before reduction");
const nerves = [
{
nerve: "Anterior Interosseous Nerve (AIN)",
freq: "Most Common",
freqColor: C.red,
assoc: "Type III posterolateral displacement",
test: "Ask patient to make 'OK sign'\nAIN paralysis → cannot flex thumb IP + index DIP\n→ 'Pointing index / pointing finger sign'",
tx: "Neuropraxia in most cases\nObserve after fracture reduction\n90%+ resolve within 3–6 months\nEMG at 3 months if no recovery",
color: C.red
},
{
nerve: "Radial Nerve",
freq: "Second Most Common",
freqColor: "D68910",
assoc: "Posteromedial (Type IIIa) displacement",
test: "Test wrist extension\nFinger (MCP) extension\nSensation dorsal first web space",
tx: "Neuropraxia — observe\nResolves with fracture stabilisation\nExplore only if no recovery at 3 months",
color: "D68910"
},
{
nerve: "Median Nerve",
freq: "Less Common",
freqColor: C.teal,
assoc: "Posterolateral (Type IIIb) displacement",
test: "Sensation — index finger tip / radial palm\nThenar wasting (chronic)\nWeakness thumb opposition",
tx: "Neuropraxia — observe\nResolves after reduction\nRarely requires surgical exploration",
color: C.teal
},
{
nerve: "Ulnar Nerve",
freq: "Iatrogenic Risk",
freqColor: "6C3483",
assoc: "Flexion type fractures OR medial pin placement",
test: "Sensation — little finger / ulnar palm\nIntrinsic hand power\nFroment's sign",
tx: "AVOID medial pin without direct visualization\nIatrogenic injury from medial K-wire\nUse lateral pins ONLY for Type II fractures",
color: "6C3483"
},
];
nerves.forEach((n, i) => {
const col = i % 2;
const row = Math.floor(i / 2);
const x = col === 0 ? 0.15 : 5.1;
const y = 1.2 + row * 2.1;
const w = 4.75;
const h = 2.0;
addCard(s, x, y, w, h, n.nerve, n.color);
s.addShape(pres.shapes.RECTANGLE, {
x: x + 0.12, y: y + 0.36, w: 1.35, h: 0.26,
fill: { color: n.freqColor }, line: { color: n.freqColor }
});
s.addText(n.freq, {
x: x + 0.12, y: y + 0.36, w: 1.35, h: 0.26,
fontSize: 8, bold: true, color: C.white, fontFace: "Calibri",
align: "center", valign: "middle", margin: 0
});
s.addText([
{ text: "Associated with: ", options: { bold: true, color: C.teal } },
{ text: n.assoc, options: { color: C.charcoal } },
], { x: x + 0.15, y: y + 0.67, w: w - 0.25, h: 0.28, fontSize: 9, fontFace: "Calibri", margin: 0 });
s.addText([
{ text: "Test: ", options: { bold: true, color: C.navy } },
{ text: n.test, options: { color: C.charcoal } }
], { x: x + 0.15, y: y + 0.96, w: w - 0.25, h: 0.48, fontSize: 8.5, fontFace: "Calibri", margin: 0 });
s.addText([
{ text: "Management: ", options: { bold: true, color: C.green } },
{ text: n.tx, options: { color: C.charcoal } }
], { x: x + 0.15, y: y + 1.44, w: w - 0.25, h: 0.48, fontSize: 8.5, fontFace: "Calibri", margin: 0 });
});
addFooter(s, "Tintinalli's Emergency Medicine | Campbell's Operative Orthopaedics 15th Ed 2026");
}
// ─── SLIDE 8: COMPLICATIONS — EARLY ─────────────────────────────
{
const s = pres.addSlide();
s.addShape(pres.shapes.RECTANGLE, {
x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.lightBg }, line: { color: C.lightBg }
});
addHeader(s, "Early Complications", "Incidence | Mechanism | Recognition | Management");
const earlyComps = [
{
name: "Vascular Injury", icon: "🩸",
incidence: "~1–2% of displaced fractures",
mechanism: "Brachial artery kinking/laceration by proximal fragment",
recognition: "5 Ps: Pain, Pallor, Pulselessness, Paralysis, Paraesthesias\nWhite hand = emergency; Pink pulseless = observe",
management: "Urgent CRPP → if no pulse returns → brachial artery exploration ± vein graft",
color: C.red
},
{
name: "Nerve Injury", icon: "⚡",
incidence: "~10–16% of fractures",
mechanism: "Traction / compression neuropraxia on reduction\nAIN most common; radial nerve in Type IIIa",
recognition: "Detailed motor-sensory exam pre-op\nPointing index sign (AIN), wrist drop (radial)",
management: "90%+ resolve with fracture stabilisation\nEMG/NCS at 3 months if no recovery",
color: "2471A3"
},
{
name: "Compartment Syndrome", icon: "⚠",
incidence: "0.1–0.3%",
mechanism: "Post-reduction swelling, tight cast, hyperflexion\nMore common with concurrent forearm/wrist fracture",
recognition: "Paediatric 3 As: Agitation, Anxiety, increasing Analgesia\nMeasure compartment pressure if suspected",
management: "Urgent fasciotomy (all 4 forearm compartments)\nNEVER use hyperflexed position if significant swelling",
color: C.gold
},
{
name: "Volkmann's Ischaemic Contracture", icon: "🔴",
incidence: "Rare but DREADED",
mechanism: "Missed compartment syndrome → forearm flexor fibrosis\nResults from prolonged ischaemia > 6–8 hours",
recognition: "Late: Fixed flexion deformity of wrist + fingers\nIntrinsic plus hand deformity in severe cases",
management: "Prevention is key!\nTreatment: physiotherapy (mild), muscle slide / Z-plasty (moderate), free muscle transfer (severe)",
color: "6C3483"
},
];
earlyComps.forEach((c, i) => {
const col = i % 2;
const row = Math.floor(i / 2);
const x = col === 0 ? 0.15 : 5.1;
const y = 1.2 + row * 2.1;
const w = 4.75;
const h = 2.0;
addCard(s, x, y, w, h, `${c.icon} ${c.name}`, c.color);
s.addShape(pres.shapes.RECTANGLE, {
x: x + 0.12, y: y + 0.36, w: 1.8, h: 0.24,
fill: { color: "FEF3E8" }, line: { color: c.color, pt: 0.8 }
});
s.addText(`Incidence: ${c.incidence}`, {
x: x + 0.15, y: y + 0.36, w: 1.75, h: 0.24,
fontSize: 7.5, color: c.color, bold: true, fontFace: "Calibri", margin: 0
});
[["Mechanism:", c.mechanism, 0.65], ["Recognition:", c.recognition, 1.0], ["Management:", c.management, 1.48]].forEach(([label, text, dy]) => {
s.addText([
{ text: label + " ", options: { bold: true, color: C.navy } },
{ text: text, options: { color: C.charcoal } }
], { x: x + 0.15, y: y + dy, w: w - 0.25, h: 0.35, fontSize: 8.5, fontFace: "Calibri", margin: 0 });
});
});
addFooter(s, "Campbell's Operative Orthopaedics 15th Ed 2026 | Bailey & Love 28th Ed p. 462");
}
// ─── SLIDE 9: COMPLICATIONS — LATE ──────────────────────────────
{
const s = pres.addSlide();
s.addShape(pres.shapes.RECTANGLE, {
x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.lightBg }, line: { color: C.lightBg }
});
addHeader(s, "Late Complications", "Most Common: Cubitus Varus (Gunstock Deformity) | Malunion");
// Cubitus varus large feature box
addCard(s, 0.15, 1.18, 5.8, 2.8, "CUBITUS VARUS — Gunstock Deformity (Most Common Late Complication)", C.red);
s.addText([
{ text: "Definition: ", options: { bold: true, color: C.red } },
{ text: "Reversed carrying angle due to medial malunion of distal humerus\n", options: { color: C.charcoal } },
{ text: "Cause: ", options: { bold: true, color: C.navy } },
{ text: "Malunion in varus — failure to restore Baumann angle (most common cause: inadequate reduction of Type II/III)\n", options: { color: C.charcoal } },
{ text: "Clinical features: ", options: { bold: true, color: C.navy } },
{ text: "\"Gunstock\" arm appearance; usually cosmetic deformity; elbow motion usually preserved\n", options: { color: C.charcoal } },
{ text: "Late risks: ", options: { bold: true, color: C.navy } },
{ text: "Posterolateral rotatory instability (PLRI); lateral ulnar collateral ligament laxity; late-onset lateral epicondylalgia\n", options: { color: C.charcoal } },
{ text: "Treatment: ", options: { bold: true, color: C.green } },
{ text: "Corrective supracondylar osteotomy if symptomatic / severe cosmetic concern", options: { color: C.charcoal } },
], {
x: 0.3, y: 1.54, w: 5.55, h: 2.4,
fontSize: 9.5, fontFace: "Calibri", valign: "top", margin: 0
});
// Right column: other late complications
const lateOthers = [
{ name: "Cubitus Valgus", detail: "Increased carrying angle\nCause: malunion in valgus (less common)\nComplication: Tardy Ulnar Nerve Palsy (late onset — may present years later)", color: "2471A3" },
{ name: "Elbow Stiffness", detail: "Usually resolves spontaneously\nAvoid aggressive passive mobilisation\nNO FORCEFUL PHYSIOTHERAPY — risk of myositis ossificans", color: C.teal },
{ name: "Myositis Ossificans", detail: "Heterotopic bone formation post-trauma\nTriggered by aggressive passive mobilisation\nTreatment: excision after maturation", color: "D68910" },
{ name: "Avascular Necrosis / Growth Disturbance", detail: "Rare; risk higher with open reduction\nMonitor with serial X-rays\nCapitellar AVN may cause long-term stiffness", color: "6C3483" },
];
lateOthers.forEach((c, i) => {
const y = 1.18 + i * 1.07;
addCard(s, 6.1, y, 3.7, 1.0, c.name, c.color);
s.addText(c.detail, {
x: 6.25, y: y + 0.36, w: 3.45, h: 0.6,
fontSize: 8.5, color: C.charcoal, fontFace: "Calibri", valign: "top", margin: 0
});
});
addFooter(s, "Bailey & Love's Surgery 28th Ed | Campbell's Operative Orthopaedics 15th Ed 2026");
}
// ─── SLIDE 10: OPERATIVE TECHNIQUE — K-WIRE FIXATION ────────────
{
const s = pres.addSlide();
s.addShape(pres.shapes.RECTANGLE, {
x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.lightBg }, line: { color: C.lightBg }
});
addHeader(s, "Percutaneous K-Wire Fixation — Technique & Principles",
"CRPP — Closed Reduction Percutaneous Pinning | Gold Standard for Type IIB / III / IV");
// Indications box
addCard(s, 0.15, 1.18, 3.5, 1.85, "INDICATIONS for CRPP", C.navy);
const indItems = [
"Type IIB (rotation/instability)",
"Type III (complete displacement)",
"Type IV (periosteal hinge disrupted)",
"Failed closed reduction + cast alone",
"Pink/white pulseless hand",
"Brachialis penetration (pucker sign)"
];
s.addText(indItems.map((t, i) => ({
text: t, options: { bullet: true, breakLine: i < indItems.length - 1, fontSize: 9.5, color: C.charcoal, fontFace: "Calibri" }
})), { x: 0.3, y: 1.54, w: 3.25, h: 1.45, fontSize: 9.5, fontFace: "Calibri" });
// Pin configurations
addCard(s, 0.15, 3.1, 3.5, 2.3, "PIN CONFIGURATIONS", C.teal);
const configs = [
["Lateral pins only (2–3):", "PREFERRED for Type IIB\nAvoids ulnar nerve injury\nSlightly less rotational stability"],
["Crossed pins (lat + med):", "Better for Type III/IV\nHigher ulnar nerve injury risk\nOnly use medial pin under direct vision"],
];
configs.forEach(([label, text], i) => {
s.addText([
{ text: label + "\n", options: { bold: true, color: C.navy } },
{ text: text, options: { color: C.charcoal } }
], { x: 0.3, y: 3.46 + i * 0.95, w: 3.25, h: 0.88, fontSize: 9, fontFace: "Calibri", margin: 0 });
});
// Steps box
addCard(s, 3.8, 1.18, 6.05, 4.22, "SURGICAL STEPS — CRPP", C.gold);
const steps = [
["1. Positioning:", "Supine, arm on radiolucent side table\nImage intensifier (C-arm) available"],
["2. Reduction:", "Traction in line → correct rotation first\nElbow flexion to 90° while maintaining reduction\nPronation of forearm (extension type)"],
["3. Fluoroscopic check:", "AP: Baumann angle restored (70–75°)\nLateral: AHL intersects middle 1/3 capitellum\nOblique: confirm cortical continuity"],
["4. K-wire insertion:", "Enter lateral epicondyle first\n1.6–2.0 mm K-wires x2–3\nDiverge proximally to engage medial cortex\nConfirm stability — no toggling"],
["5. Post-op:", "Above-elbow backslab with elbow at 90°\nK-wire removal at 3–4 weeks in clinic\nEarly physiotherapy after pin removal"],
["6. Failure — convert to ORIF:", "If closed reduction fails (brachialis interposition)\nNeurovascular injury requiring open exploration"],
];
steps.forEach(([label, text], i) => {
const y = 1.58 + i * 0.65;
s.addShape(pres.shapes.RECTANGLE, {
x: 3.92, y: y, w: 0.48, h: 0.32,
fill: { color: C.gold }, line: { color: C.gold }
});
s.addText(`${i + 1}`, {
x: 3.92, y: y, w: 0.48, h: 0.32,
fontSize: 12, bold: true, color: C.navy, align: "center", valign: "middle", fontFace: "Calibri", margin: 0
});
s.addText([
{ text: label + " ", options: { bold: true, color: C.navy } },
{ text: text, options: { color: C.charcoal } }
], { x: 4.48, y: y - 0.02, w: 5.25, h: 0.6, fontSize: 9, fontFace: "Calibri", margin: 0 });
});
addFooter(s, "Campbell's Operative Orthopaedics 15th Ed 2026 | Miller's Review of Orthopaedics 9th Ed");
}
// ─── SLIDE 11: EXAM SUMMARY ──────────────────────────────────────
{
const s = pres.addSlide();
s.addShape(pres.shapes.RECTANGLE, {
x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.navy }, line: { color: C.navy }
});
s.addShape(pres.shapes.RECTANGLE, {
x: 0, y: 0, w: 0.18, h: 5.625, fill: { color: C.gold }, line: { color: C.gold }
});
s.addShape(pres.shapes.RECTANGLE, {
x: 0, y: 5.3, w: 10, h: 0.33, fill: { color: C.teal }, line: { color: C.teal }
});
s.addText("EXAM SUMMARY — High-Yield Points", {
x: 0.5, y: 0.12, w: 9, h: 0.6,
fontSize: 22, bold: true, color: C.gold, fontFace: "Calibri", align: "center"
});
s.addText("2026 MS Orthopaedics Theory Examination", {
x: 0.5, y: 0.72, w: 9, h: 0.3,
fontSize: 11, color: C.silver, fontFace: "Calibri", align: "center", italic: true
});
const col1 = [
"Most common elbow fracture in children (age 5–7 yrs)",
"Extension type = 97–98%; mechanism = FOOSH",
"Gartland classification: I / IIA / IIB / III / IV",
"AHL, Baumann angle (70–75°), posterior fat pad sign",
"CRITOE = order of ossification centre appearance",
"Most common nerve injury = AIN → pointing index sign",
"Type I → Long-arm cast 3 weeks",
"Type IIB/III → CRPP with 2–3 lateral K-wires",
];
const col2 = [
"White pulseless hand = surgical emergency",
"Pink pulseless hand = reduce + observe ± explore",
"Hyperflexion contraindicated if swollen (→ compartment syndrome)",
"3 As in children = Agitation, Anxiety, Analgesia ↑ → compartment syndrome",
"Most common late complication = cubitus varus",
"Dreaded complication = Volkmann's ischaemic contracture",
"Cubitus valgus → tardy ulnar nerve palsy",
"No aggressive passive mobilisation → myositis ossificans",
];
[col1, col2].forEach((items, ci) => {
const x = ci === 0 ? 0.35 : 5.15;
const yStart = 1.12;
items.forEach((item, i) => {
const y = yStart + i * 0.53;
s.addShape(pres.shapes.RECTANGLE, {
x: x, y: y + 0.08, w: 0.28, h: 0.28,
fill: { color: i < 4 ? C.teal : C.gold }, line: { color: i < 4 ? C.teal : C.gold }
});
s.addText(`${i + 1}`, {
x: x, y: y + 0.08, w: 0.28, h: 0.28,
fontSize: 9, bold: true, color: C.navy, align: "center", valign: "middle", fontFace: "Calibri", margin: 0
});
s.addText(item, {
x: x + 0.35, y: y + 0.05, w: 4.55, h: 0.42,
fontSize: 10, color: C.white, fontFace: "Calibri", valign: "middle", margin: 0
});
});
});
s.addText("Sources: Campbell's Operative Orthopaedics 15th Ed 2026 | Rosen's Emergency Medicine | Tintinalli's Emergency Medicine | Bailey & Love 28th Ed | Miller's Review of Orthopaedics 9th Ed", {
x: 0.3, y: 5.3, w: 9.4, h: 0.28,
fontSize: 7.5, color: C.white, fontFace: "Calibri", align: "center", margin: 0
});
}
// ─── WRITE FILE ──────────────────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/workspace/supracondylar-pptx/Supracondylar_Humerus_Fracture_MS_Ortho_2026.pptx" })
.then(() => console.log("SUCCESS: PPTX written."))
.catch(e => { console.error("ERROR:", e); process.exit(1); });