Reading File
Running Command

cd /home/daytona/workspace/attachments/813d529e-260e-40b2-8401-b68494e7f54c && p…

Asking for Preferences
Reading File
Reading File
Running Command

python3 -c " import pdfplumber with pdfplumber.open('/home/daytona/workspace/at…

Reading File
Reading File
Reading File
Reading File
Reading File
Running Command

mkdir -p /home/daytona/workspace/ortho-pptx && echo "dir ready"

Writing File

~/ortho-pptx/build.js

const pptxgen = require("pptxgenjs");
const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Orthopedic Emergencies – Chapter 7";
pres.author = "Clinical Orientation Manual";

// ─── PALETTE ──────────────────────────────────────────────────────────────────
const C = {
  navy:     "0D2B4E",   // dominant dark
  teal:     "0E7C7B",   // supporting accent
  amber:    "E8A020",   // sharp accent / highlights
  white:    "FFFFFF",
  lightBg:  "F0F4F8",   // content slide bg
  medGray:  "4A5568",   // body text
  paleBlue: "D6E8F5",   // subtle card fill
  red:      "C0392B",   // danger / emergency
};

// ─── HELPERS ──────────────────────────────────────────────────────────────────
function addDarkSlide(title, sub) {
  const s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.navy } });
  s.addShape(pres.ShapeType.rect, { x: 0, y: 4.4, w: 10, h: 1.225, fill: { color: C.teal } });
  s.addShape(pres.ShapeType.rect, { x: 0.4, y: 2.0, w: 9.2, h: 0.07, fill: { color: C.amber } });
  s.addText(title, {
    x: 0.5, y: 1.0, w: 9, h: 0.9, fontSize: 38, bold: true,
    color: C.white, fontFace: "Calibri", align: "center",
  });
  if (sub) {
    s.addText(sub, {
      x: 0.5, y: 2.3, w: 9, h: 1.0, fontSize: 18,
      color: C.paleBlue, fontFace: "Calibri", align: "center",
    });
  }
  return s;
}

function addSectionSlide(label) {
  const s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.navy } });
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.3, h: 5.625, fill: { color: C.amber } });
  s.addShape(pres.ShapeType.rect, { x: 0.3, y: 2.4, w: 9.7, h: 0.06, fill: { color: C.teal } });
  s.addText(label, {
    x: 0.8, y: 1.5, w: 9, h: 1.5, fontSize: 32, bold: true,
    color: C.white, fontFace: "Calibri", align: "left", valign: "middle",
  });
  return s;
}

function contentSlide(title, bullets, opts = {}) {
  const s = pres.addSlide();
  // background
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.lightBg } });
  // top bar
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.75, fill: { color: C.navy } });
  // accent line
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0.75, w: 10, h: 0.07, fill: { color: C.amber } });
  // title
  s.addText(title, {
    x: 0.3, y: 0.05, w: 9.4, h: 0.65, fontSize: 22, bold: true,
    color: C.white, fontFace: "Calibri", align: "left", valign: "middle",
  });

  // Two-column layout if cols provided
  if (opts.cols) {
    const [left, right] = opts.cols;
    addBulletBox(s, left.title, left.items, { x: 0.3, y: 1.0, w: 4.5, h: 4.2 }, C.teal);
    addBulletBox(s, right.title, right.items, { x: 5.1, y: 1.0, w: 4.5, h: 4.2 }, C.navy);
    return s;
  }

  // Single column bullets
  const items = bullets.map((b, i) => ({
    text: b,
    options: { bullet: true, breakLine: i < bullets.length - 1, color: C.medGray, fontSize: 15, fontFace: "Calibri" },
  }));
  s.addText(items, { x: 0.4, y: 0.95, w: 9.2, h: 4.4, valign: "top" });
  return s;
}

function addBulletBox(slide, boxTitle, items, pos, headerColor) {
  slide.addShape(pres.ShapeType.rect, { ...pos, fill: { color: C.white }, line: { color: headerColor, width: 1 } });
  if (boxTitle) {
    slide.addShape(pres.ShapeType.rect, { x: pos.x, y: pos.y, w: pos.w, h: 0.38, fill: { color: headerColor } });
    slide.addText(boxTitle, {
      x: pos.x + 0.1, y: pos.y, w: pos.w - 0.2, h: 0.38,
      fontSize: 13, bold: true, color: C.white, fontFace: "Calibri", valign: "middle",
    });
  }
  const bulletItems = items.map((b, i) => ({
    text: b,
    options: { bullet: true, breakLine: i < items.length - 1, color: C.medGray, fontSize: 13, fontFace: "Calibri" },
  }));
  slide.addText(bulletItems, {
    x: pos.x + 0.15, y: pos.y + 0.45, w: pos.w - 0.3, h: pos.h - 0.55, valign: "top",
  });
}

function twoColSlide(title, left, right) {
  return contentSlide(title, [], { cols: [left, right] });
}

function alertSlide(title, bullets) {
  const s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: "FFF5F5" } });
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.75, fill: { color: C.red } });
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0.75, w: 10, h: 0.07, fill: { color: C.amber } });
  s.addText("⚠ " + title, {
    x: 0.3, y: 0.05, w: 9.4, h: 0.65, fontSize: 22, bold: true,
    color: C.white, fontFace: "Calibri", align: "left", valign: "middle",
  });
  const items = bullets.map((b, i) => ({
    text: b,
    options: { bullet: true, breakLine: i < bullets.length - 1, color: C.medGray, fontSize: 15, fontFace: "Calibri" },
  }));
  s.addText(items, { x: 0.4, y: 0.95, w: 9.2, h: 4.4, valign: "top" });
  return s;
}

// ══════════════════════════════════════════════════════════════════════════════
//  SLIDES
// ══════════════════════════════════════════════════════════════════════════════

// 1. Title
addDarkSlide("ORTHOPEDIC EMERGENCIES", "Chapter 7 · Clinical Orientation Manual\nEmergency Medical Services Division, 2018");

// 2. Learning Objectives
contentSlide("Learning Objectives", [
  "Take a relevant history; perform a Focused Physical Examination or Rapid Trauma Examination",
  "Identify orthopedic emergencies and common musculoskeletal injuries in the community",
  "Recognize when urgent/specialized-center referral is needed and make a prompt referral",
  "Plan and interpret relevant investigations, particularly X-rays",
  "Arrive at a logical working diagnosis after examination and investigations",
  "Order relevant laboratory and imaging studies and interpret them",
  "Plan and provide emergency care or initiate appropriate treatment",
]);

// 3. Approach – History & Examination
twoColSlide("Approach to the Orthopedic Patient", {
  title: "HISTORY",
  items: [
    "Chief complaint",
    "Mechanism of injury",
    "OPQRST: Onset, Provoking/alleviating, Quality/Quantity, Radiation, Site, Timing",
    "Constitutional symptoms: fever, night sweats, fatigue, weight loss",
    "Referred symptoms",
    "AMPLE: Allergies, Medications, Past medical history, Last eaten, Events",
  ],
}, {
  title: "PHYSICAL EXAMINATION",
  items: [
    "Look – SEADS: Swelling, Erythema, Atrophy, Deformity, Skin changes",
    "Move – Active then passive ROM for affected joint(s) and joints above & below",
    "Neurovascular tests: Pulse, sensation, reflexes, power (0–5)",
    "X-Ray Rule of 2s: 2 views, 2 joints, 2 sides, 2 times",
    "Blood: CBC, Grouping",
    "Aspiration of joint fluid; Ultrasound where appropriate",
  ],
});

// ─── SECTION: LIFE-THREATENING EMERGENCIES ────────────────────────────────────
addSectionSlide("SECTION 1\nLife-Threatening Orthopedic Emergencies");

// 4. Principles of Emergency Care
contentSlide("Principles of Emergency Care of Musculoskeletal Injuries", [
  "Perform initial patient assessment – ABCDE primary survey first",
  "Apply a cervical collar if spinal injury is suspected during rapid trauma exam",
  "Splint any swollen or deformed extremity after life-threatening conditions are addressed",
  "Unstable patients: 'load and go' – manage ABCs, immobilize whole body on long spine board",
  "Irrigate open wounds with plenty of NS; cover with sterile dressings; start IV antibiotics",
  "DO NOT SUTURE dirty or complex wounds",
  "Carry out appropriate splinting of injured limbs before moving the patient",
]);

// 5. Open Fractures
twoColSlide("Open Fractures", {
  title: "DEFINITION & CLASSIFICATION",
  items: [
    "Communication between fracture and skin/environment",
    "Gustillo-Anderson Classification:",
    "Grade I – wound <1 cm, low energy",
    "Grade II – wound 1–10 cm, moderate energy",
    "Grade IIIA – wound >10 cm, adequate soft-tissue cover",
    "Grade IIIB – periosteal stripping, soft-tissue loss",
    "Grade IIIC – vascular injury requiring repair",
  ],
}, {
  title: "MANAGEMENT",
  items: [
    "ABCs – primary survey first",
    "Profuse irrigation with NS",
    "Sterile dressing; DO NOT suture",
    "IV antibiotics (cephalosporin ± aminoglycoside for IIIC)",
    "Tetanus prophylaxis",
    "Splint the fracture",
    "URGENT referral for surgical debridement and fixation",
  ],
});

// 6. Hemorrhagic Shock / Fractures & Blood Loss
contentSlide("Hemorrhagic Shock – Blood Loss from Fractures", [
  "Femur fracture: ~1–2 L of blood loss",
  "Pelvic fracture: ~2–4 L (can be fatal)",
  "Tibia/fibula: ~0.5–1 L",
  "Humerus: ~1–2 L",
  "Manage ABCs: 2 large-bore IVs, crystalloid/blood resuscitation",
  "Pelvic fracture: apply circumferential pelvic sheeting or pelvic binder to control hemorrhage",
  "Urgent referral for definitive surgical management",
]);

// 7. Vascular Injury with Fractures
twoColSlide("Vascular Injuries Associated with Fractures", {
  title: "RECOGNITION",
  items: [
    "Absent or diminished pulse distal to fracture",
    "Cold, pale, pulseless extremity",
    "Brachial artery injury with supracondylar fractures",
    "Popliteal artery injury with knee dislocations",
    "Femoral artery injury with femoral shaft fractures",
    "ABI (Ankle-Brachial Index) <0.9 – suspect vascular injury",
  ],
}, {
  title: "MANAGEMENT",
  items: [
    "Reduce and splint fracture/dislocation first",
    "Reassess pulses after reduction",
    "If pulse absent after reduction → urgent vascular surgery referral",
    "Doppler ultrasound to assess flow",
    "Never delay recognition – ischemia time critical",
    "Risk of irreversible muscle damage after 6 hours",
  ],
});

// ─── SECTION: COMPARTMENT SYNDROME ────────────────────────────────────────────
addSectionSlide("SECTION 2\nCompartment Syndrome");

// 8. Compartment Syndrome
alertSlide("Compartment Syndrome – The 6 P's", [
  "DEFINITION: Increased interstitial pressure in an anatomic compartment exceeding capillary perfusion pressure → muscle necrosis in 4–6 hrs, then nerve necrosis",
  "Pain out of proportion to the injury (MOST IMPORTANT early sign)",
  "Pain not relieved by analgesia",
  "Pain increased with passive stretch of compartment muscles (most specific sign)",
  "Pallor of the limb",
  "Paresthesia (early) and Paralysis (late)",
  "Polar (cold limb) and Pulselessness (late findings)",
  "MANAGEMENT: Remove all constrictive dressings/casts, elevate limb, reassess in 20 min, refer for urgent FASCIOTOMY",
  "COMPLICATIONS: Rhabdomyolysis, renal failure (myoglobinuria), Volkmann's ischemic contracture",
]);

// ─── SECTION: INFECTIONS ──────────────────────────────────────────────────────
addSectionSlide("SECTION 3\nOrthopedic Infections");

// 9. Septic Arthritis & Osteomyelitis
twoColSlide("Septic Arthritis & Osteomyelitis", {
  title: "SEPTIC ARTHRITIS",
  items: [
    "Infection within joint space (direct inoculation or hematogenous spread)",
    "Organisms: Staph, Strep, GC",
    "Signs: localized joint pain, warmth, swelling, restricted ROM",
    "Investigations: CBC, ESR, CRP, blood culture; joint aspirate (frank pus/turbid)",
    "Management: Emergency OR decompression + thorough irrigation + IV antibiotics",
  ],
}, {
  title: "OSTEOMYELITIS",
  items: [
    "Most common organism: S. aureus",
    "Gram-negatives in neonates and immunocompromised",
    "Signs: localized extremity swelling, pain, fever",
    "Investigations: CBC (leukocytosis), ESR, blood culture, aspirate; X-ray changes at 1–2 weeks",
    "Management: Emergency surgical decompression & washout + IV antibiotics + urgent referral",
  ],
});

// ─── SECTION: SPINE ───────────────────────────────────────────────────────────
addSectionSlide("SECTION 4\nSpinal Emergencies");

// 10. Cauda Equina Syndrome
alertSlide("Cauda Equina Syndrome", [
  "Compression of lumbosacral nerve roots below conus medullaris",
  "Causes: large central disc herniation (L4-5 or L5-S1), spinal stenosis, tumor, burst fracture",
  "Motor: weakness/paraparesis, reduced knee and ankle reflexes",
  "Sphincter disturbance: urinary retention, fecal incontinence (loss of anal tone)",
  "Sensory: saddle anesthesia (perineum, genitalia, inner thighs)",
  "MANAGEMENT: Urgent MRI; emergency surgical decompression – timing is critical",
  "Delay = permanent neurological deficit; immediate referral is mandatory",
]);

// 11. Cervical Spine Injuries
contentSlide("Cervical Spine Injuries – Key Principles", [
  "Mechanism: diving injuries, high-velocity MVAs, falls from height, axial loading",
  "Always immobilize with cervical collar if spinal injury is suspected",
  "Canadian C-Spine Rule: criteria for imaging vs. no imaging needed",
  "NEXUS criteria: if all 5 criteria absent, no X-ray needed",
  "Obtain AP, lateral, and odontoid views; CT/MRI for equivocal cases",
  "Jefferson fracture (C1 burst), Odontoid fractures, Hangman's fracture (C2)",
  "Neurogenic shock: hypotension + bradycardia (loss of sympathetic tone)",
  "Management: immobilization, methylprednisolone (within 8 hrs in selected cases), urgent neurosurgical referral",
]);

// ─── SECTION: UPPER EXTREMITY ─────────────────────────────────────────────────
addSectionSlide("SECTION 5\nUpper Extremity Injuries");

// 12. Hand Injuries
twoColSlide("Hand Injuries", {
  title: "HAND LACERATIONS & TENDON INJURIES",
  items: [
    "Thorough neurovascular exam mandatory",
    "Test each flexor/extensor tendon individually",
    "Identify digital nerve and artery injuries",
    "DO NOT close contaminated wounds primarily",
    "Irrigate, apply sterile dressing, IV antibiotics",
    "Refer for tendon/NV repair",
  ],
}, {
  title: "HAND DISLOCATIONS",
  items: [
    "PIP joints most common (dorsal dislocation)",
    "Volar plate may be entrapped → closed reduction impossible",
    "Reduction: digital block, distraction, hyperextension, reposition",
    "If unsuccessful → refer for open reduction",
    "Metacarpal fractures:",
    "4th & 5th MC → Ulnar gutter splint",
    "1st–3rd MC → Radial gutter splint",
  ],
});

// 13. Distal Radius & Forearm Fractures
twoColSlide("Distal Radius & Forearm Fractures", {
  title: "COLLES' FRACTURE",
  items: [
    "Transverse distal radius ~2 cm from articular surface",
    "Dorsal displacement → 'dinner fork' deformity",
    "Common: women >40 yrs with osteoporosis",
    "Closed Reduction: hematoma block, traction + dorsal angulation + volar flexion",
    "Apply below-elbow cast × 6 weeks",
    "Unstable → refer for ORIF",
  ],
}, {
  title: "OTHER FOREARM FRACTURES",
  items: [
    "Nightstick fracture: isolated ulna → casting",
    "Both-bone fracture: often displaced, risk of compartment syndrome → long arm splint + refer for ORIF",
    "Galeazzi: distal radial shaft + disruption of DRUJ → long arm splint + ORIF",
    "Monteggia: proximal ulna fracture + radio-capitellar dislocation → long arm splint + ORIF",
  ],
});

// 14. Elbow, Arm & Shoulder
contentSlide("Elbow, Arm & Shoulder Injuries", [
  "Nursemaid's Elbow: peak age 1–4 yrs; swung by arm → radial head subluxation; Reduction: supinate forearm + flex elbow",
  "Supracondylar Fracture: most common elbow fracture in children; risk of brachial artery & anterior interosseous nerve injury; urgent referral if NV compromise",
  "Lateral condyle fracture: may displace; needs ORIF if displaced",
  "Olecranon fracture: triceps avulsion; operative repair often needed",
  "Elbow Dislocation: posterior most common; closed reduction with traction-countertraction; check ulnar nerve post-reduction",
  "Shoulder Dislocation: anterior 95%, posterior rare; reduction techniques: Cunningham, Stimson, FARES method",
  "Humeral shaft fracture: radial nerve injury (wrist drop); apply coaptation splint or hanging arm cast",
  "Clavicle fracture: middle 1/3 most common; broad arm sling × 6 weeks",
]);

// ─── SECTION: LOWER EXTREMITY ─────────────────────────────────────────────────
addSectionSlide("SECTION 6\nLower Extremity Injuries");

// 15. Pelvic Fractures
alertSlide("Pelvic Fractures", [
  "Major cause of life-threatening hemorrhage (2–4 L blood loss possible)",
  "Mechanism: high-energy trauma (MVA, fall from height)",
  "Signs: pelvic instability, external rotation, leg length discrepancy",
  "Open pelvic fracture has mortality >50%",
  "MANAGEMENT: ABCs, IV access × 2, aggressive resuscitation",
  "Apply circumferential pelvic sheeting / commercial pelvic binder to reduce pelvic volume",
  "Do NOT compress pelvis manually repeatedly – dislodges clots",
  "Urgent transfer to trauma center for angioembolization or surgical fixation",
]);

// 16. Hip Fractures & Dislocations
twoColSlide("Hip Fractures & Dislocations", {
  title: "HIP FRACTURES",
  items: [
    "Most common in elderly with osteoporosis after low-energy falls",
    "Types: femoral neck (intracapsular), intertrochanteric, subtrochanteric",
    "Signs: shortened, externally rotated lower limb; inability to weight-bear",
    "Risk of AVN with femoral neck fractures",
    "Management: IV access, analgesia, Thomas splint, urgent referral for ORIF or hemiarthroplasty",
  ],
}, {
  title: "HIP DISLOCATIONS",
  items: [
    "Posterior dislocation most common (dashboard injury)",
    "Signs: shortened, internally rotated, adducted limb",
    "Risk: sciatic nerve injury, AVN of femoral head",
    "Reduction under GA/sedation: Allis or Stimson technique",
    "Post-reduction: check sciatic nerve function; X-ray to confirm",
    "TIME CRITICAL – reduce within 6 hours to minimize AVN risk",
  ],
});

// 17. Femur Fractures
contentSlide("Femoral Shaft Fractures", [
  "Most commonly fractured long bone and most common open fracture",
  "Blood loss: 1–2 L; risk of hemorrhagic shock",
  "High incidence of neurovascular injury and compartment syndrome",
  "Apply Thomas splint for immobilization (ring must NOT be at fracture site)",
  "Management:",
  "  – Minimally displaced → long leg cast 6–8 weeks",
  "  – Displaced → ORIF (intramedullary nail)",
  "  – Apply long leg splint and refer",
]);

// 18. Knee, Tibia & Ankle
twoColSlide("Knee, Tibia & Ankle Injuries", {
  title: "KNEE INJURIES",
  items: [
    "Knee dislocation: risk of popliteal artery injury (30%); reduce emergently, ABI after reduction, arteriography if needed",
    "Patellar fracture: transverse most common; operative if displaced",
    "Tibial plateau fracture: usually from axial load; CT for full assessment; ORIF if displaced",
    "Apply long leg splint and refer",
  ],
}, {
  title: "ANKLE INJURIES",
  items: [
    "Maisonneuve: external rotation → medial ligament rupture + proximal fibula fracture; missed on ankle X-ray alone",
    "Posterior ankle dislocation: most common; reduce emergently + U-splint + ORIF",
    "Ankle sprains: lateral ligaments (ATF, CF, PTF); stable → RICE; unstable → below-knee walking cast",
    "Jones fracture (transverse 5th MT): short leg splint; may need ORIF",
  ],
});

// ─── SECTION: OTHER TOPICS ────────────────────────────────────────────────────
addSectionSlide("SECTION 7\nOther Important Topics");

// 19. Nerve Injuries
contentSlide("Nerve Injuries in Orthopedic Emergencies", [
  "Radial nerve (humerus): wrist drop – apply splint, high spontaneous recovery rate",
  "Axillary nerve (shoulder dislocation): deltoid weakness, patch of lateral shoulder numbness",
  "Ulnar nerve (elbow dislocation/medial epicondyle): intrinsic hand weakness, 4th-5th digit numbness",
  "Median nerve (supracondylar, distal radius): AIN injury → loss of thumb-index finger pinch",
  "Sciatic nerve (posterior hip dislocation): foot drop, posterior thigh sensory loss",
  "Common peroneal nerve (knee dislocation/fibular neck): foot drop, dorsal foot numbness",
  "Management: document deficit before and after reduction; most recover spontaneously; EMG at 6 weeks if not recovering",
]);

// 20. Back Pain
twoColSlide("Back Pain – Approach & Red Flags", {
  title: "RED FLAGS",
  items: [
    "History of malignancy",
    "Unexplained weight loss",
    "Radiculopathy with bowel/bladder dysfunction",
    "Cauda equina symptoms (saddle anesthesia)",
    "Numbness or progressive weakness in legs",
    "Night pain that wakes patient",
    "Age >50 or <20 with no clear cause",
  ],
}, {
  title: "APPROACH",
  items: [
    "Most back pain (90%) resolves within weeks",
    "Differential: mechanical, degenerative, neoplastic, infectious",
    "Investigations: Image if trauma or failure to improve in 4–6 weeks; image earlier if elderly",
    "Blood: CBC, ESR if infection or malignancy suspected",
    "Social/psychological factors may prolong pain",
    "Refer for MRI if red flags present",
  ],
});

// 21. Splinting Guide
contentSlide("Common Splints & Indications", [
  "Volar Short Arm Splint: wrist sprain, metacarpal fractures (wrist 20°, MCP 70–90°)",
  "Sugar Tong Splint: forearm fractures, non-displaced distal radius (wrist neutral, elbow 90°)",
  "Long Arm Splint: nightstick ulna fracture, olecranon fracture, midshaft humerus (wrist neutral, elbow 90°)",
  "Thumb Spica Splint: thumb injuries, scaphoid fracture, de Quervain's ('wine glass' position)",
  "Ulnar Gutter Splint: 4th–5th MC fractures, ulnar styloid, 4th–5th digit fractures",
  "Radial Gutter Splint: 2nd–3rd MC fractures, 2nd–3rd digit fractures",
  "Long Leg Posterior Splint: tibia fractures, knee injuries (knee 0–10°, ankle 90°)",
  "Short Leg Posterior Splint: ankle fractures, foot fractures (ankle 90°)",
  "U-Splint (Stirrup): ankle fractures/sprains",
  "Thomas Splint: femoral shaft fractures – ring at groin, NOT at fracture site",
]);

// 22. Dislocation Reduction – General Principles
contentSlide("Reduction of Dislocations – General Principles", [
  "Give adequate analgesia (IV opioid, procedural sedation, hematoma block, or digital block)",
  "Evaluate and rule out concurrent fractures before attempting reduction",
  "Assess neurovascular status BEFORE and AFTER reduction",
  "Apply constant traction to fatigue contracted muscles",
  "Often need to exaggerate the dislocation momentarily to achieve reduction",
  "Splint immediately after successful reduction",
  "Repeat X-ray after reduction to confirm position and identify any associated fractures",
  "Reassess neurovascular status post-reduction",
]);

// 23. Referral Criteria
alertSlide("Situations Requiring Urgent Referral", [
  "Open fractures (all grades) – for operative debridement",
  "Fractures with vascular injury (pulseless limb)",
  "Suspected or confirmed compartment syndrome – fasciotomy",
  "Pelvic fractures with hemodynamic instability",
  "Hip dislocation – reduce within 6 hours",
  "Spinal cord injury / Cauda equina syndrome",
  "Septic arthritis / Osteomyelitis – OR washout",
  "Displaced intra-articular fractures requiring ORIF",
  "Both-bone forearm, Galeazzi, Monteggia fractures",
  "Any unstable fracture or dislocation not reducible by closed means",
]);

// 24. Summary / Closing
addDarkSlide("Key Takeaways", "ABCs always first · Splint before you move · Always check neurovascular status\nOpen fractures: irrigate, dress, antibiotics, REFER · Know when NOT to reduce");

// ─── WRITE FILE ───────────────────────────────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/workspace/ortho-pptx/Orthopedic_Emergencies_Chapter7.pptx" })
  .then(() => console.log("PPTX saved successfully."))
  .catch(e => { console.error("Error:", e); process.exit(1); });
Running Command

cd /home/daytona/workspace/ortho-pptx && node build.js 2>&1

Running Command

ls -lh /home/daytona/workspace/ortho-pptx/Orthopedic_Emergencies_Chapter7.pptx

Your presentation is ready! Download it here:

Orthopedic Emergencies Chapter7

Presentation · PPTX


What's inside (24 slides):
#Slide
1Title slide
2Learning Objectives
3Approach to the Patient (History & Exam)
4Principles of Emergency Care
5Open Fractures
6Hemorrhagic Shock & Blood Loss
7Vascular Injuries
8Compartment Syndrome (6 P's)
9Septic Arthritis & Osteomyelitis
10Cauda Equina Syndrome
11Cervical Spine Injuries
12Hand Injuries & Dislocations
13Distal Radius & Forearm Fractures
14Elbow, Arm & Shoulder
15Pelvic Fractures
16Hip Fractures & Dislocations
17Femoral Shaft Fractures
18Knee, Tibia & Ankle
19Nerve Injuries
20Back Pain & Red Flags
21Splints & Indications
22Reduction Principles
23Urgent Referral Criteria
24Key Takeaways
Design features: Navy/teal/amber color scheme, two-column layout slides for comparisons (diagnosis vs. management), red alert-style slides for the most dangerous emergencies (compartment syndrome, pelvic fracture, cauda equina, referral criteria), and section divider slides to organize the flow.

Add images to the slide

Searching the Web

compartment syndrome fasciotomy medical illustration site:wikimedia.org OR site:commons.wikimedia.org

Searching the Web

open fracture classification gustilo anderson orthopedic illustration wikimedia

Searching the Web

colles fracture dinner fork deformity xray wikimedia commons

Searching the Web

site:commons.wikimedia.org hip dislocation posterior fracture xray OR pelvic fracture xray orthopedic

Reading Web Page

https://commons.wikimedia.org/wiki/File:Colles_fracture.JPG

Running Command

# Fetch direct image URLs from Wikimedia API for a batch of images needed for s…

Running Command

# Use curl with a proper user-agent to get Wikimedia direct image URLs via API …

Running Command

# Use Wikimedia Commons API (not Wikipedia) with correct endpoint python3 << 'E…

Running Command

# Use the fetch_images.js helper the skill recommends, with known direct Wikime…

Running Command

mkdir -p /home/daytona/workspace/ortho-pptx/images # Use the skill's recommende…

Running Command

IMG=/home/daytona/workspace/ortho-pptx/images # Download all needed images - us…

Running Command

# Search Wikimedia Commons for correct file names using their search API python…

Running Command

python3 << 'EOF' import subprocess, json, urllib.parse # Confirmed file names …

Running Command

# Check why API is returning empty - debug single call curl -s -A "Mozilla/5.0"…

Running Command

sleep 5 # Build direct Wikimedia upload URLs by computing their MD5-based paths…

Running Command

IMG=/home/daytona/workspace/ortho-pptx/images mkdir -p $IMG # Download all with…

Running Command

# Try the skill's fetch_images.js helper with known-working URLs node /home/day…

Generating Image

Medical diagram showing compartment syndrome in a cross-section of the lower leg, with increased pressure inside fascial compartment, compressed blood vessels and nerves, labeled with "6 P's": Pain, Pallor, Paresthesia, Paralysis, Polar (cold), Pulselessness. Clean clinical illustration style on white background.

Generating Image

Medical illustration of a posterior hip dislocation showing the femoral head displaced posteriorly out of the acetabulum, with the leg in characteristic shortened internally rotated adducted position. Side-by-side: normal hip anatomy vs dislocated hip. Clean labeled medical diagram.

!

429 Too Many Requests. {'message': '{\n "error": {\n "code": 429,\n "message": "Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.",\n "status": "RESOURCE_EXHAUSTED"\n }\n}\n', 'status': 'Too Many Requests'}

We encountered an error while processing your request. Please try again or reach out to us for help.

This is a shared conversation. Sign in to Orris to start your own chat.