How to get lateral wall thickness in intertrochanteric femur fracture

Reading File
Finding Sources
Searching the Web

lateral wall thickness measurement intertrochanteric femur fracture technique

Reading File
Reading File
Reading File
Loading Image
Loading Image
I now have all the information needed for a complete, well-illustrated answer. Here it is:

Lateral Wall Thickness in Intertrochanteric Femur Fractures

Definition and Measurement Technique

Lateral wall thickness (LWT) is measured on the AP radiograph of the hip using the following standardized method:
Starting point: Identify the innominate tubercle (vastoadductor tubercle) of the greater trochanter. Move 3 cm distally (caudally) along the lateral cortex from this point.
The measurement: From that reference point, draw a line angled at 135 degrees upward (toward the fracture) and measure the distance "d" from the lateral cortex to the fracture line of the distal fragment.
This is illustrated clearly in the diagram below (from Campbell's Operative Orthopaedics, 15th Ed):
Lateral wall thickness diagram - 3 cm from innominate tubercle, measurement d at 135 degrees to fracture line
FIGURE 60.35 - Lateral wall thickness (d) = distance from a point 3 cm below the innominate tubercle, angled 135 degrees upward to the fracture line, on the AP radiograph.

Step-by-Step Summary

StepAction
1Take a standard AP radiograph of the hip
2Identify the innominate tubercle (bony prominence of the greater trochanter where vastus lateralis inserts)
3Mark a point 3 cm caudal to the innominate tubercle on the lateral femoral cortex
4Draw a line from this point at 135° (directed superomedially, approximating the neck-shaft angle)
5Measure the perpendicular/angular distance from the lateral cortex to where this line intersects the fracture line on the distal fragment = LWT (in mm)

Clinical Significance - The Critical Threshold

LWTSignificance
< 20.5 mmHigh risk of lateral wall fracture (intraoperative or postoperative) - avoid DHS/screw-side plate alone
< 21 mmPredicts lateral wall fracture with 95% sensitivity and 88.2% specificity
>= 20.5 mmLower risk - DHS may be appropriate for AO/OTA 31-A1 and A2.1 fractures
(Campbell's Operative Orthopaedics, 15th Ed, 2026, p. 3453-3454; Miller's Review of Orthopaedics, 9th Ed)

Why It Matters

  • Iatrogenic lateral wall fracture is the most significant predictor of excessive displacement after DHS fixation, even in "stable" A1/A2 fractures
  • 22% of patients with a fractured lateral wall (including iatrogenic) required reoperation within 6 months
  • 31% of A2.2 and A2.3 fractures had intraoperative lateral wall fracture during DHS
  • If LWT < 20.5 mm or iatrogenic comminution is identified intraoperatively, the recommendation is to:
    • Add a Trochanteric Stabilizing Plate (TSP), OR
    • Convert to a cephalomedullary (intramedullary) nail
  • Preoperative CT scan is advocated to better assess lateral wall morphology, as plain radiographs may underestimate comminution in "stable-appearing" fractures

Key Reference

The measurement was originally described by Pradeep AR et al. (Intraoperative lateral wall fractures during DHS fixation for intertrochanteric fractures - Injury, 2018), and has since been incorporated into AO/OTA 2018 classification guidance and validated in multiple studies, with the BMJ Bone & Joint study establishing the 20.5 mm threshold as a reliable predictor of postoperative lateral wall fracture.

How to get 135* angle for lateral wall thickness

Finding Sources
Searching the Web

lateral wall thickness intertrochanteric fracture 135 degree angle how to draw measurement technique

Here is the complete explanation:

How to Draw the 135° Line for Lateral Wall Thickness

The Simple Answer: It's the Neck-Shaft Angle

The 135° angle is not an arbitrary number - it equals the normal femoral neck-shaft angle (NSA). So in practice, you are simply drawing a line parallel to the femoral neck axis starting from your reference point on the lateral cortex.

Practical Step-by-Step Method on AP Radiograph

Step 1 - Identify the femoral shaft axis Draw a vertical line along the long axis of the femoral shaft.
Step 2 - Identify your reference point Mark a point 3 cm below the innominate tubercle (vastus ridge) on the lateral cortex.
Step 3 - Draw the 135° line From that reference point, draw a line directed superomedially at 135° to the femoral shaft axis - this is the same direction as the femoral neck. You can do this in two equivalent ways:
MethodHow to do it
Parallel to neckVisually draw a line parallel to the long axis of the femoral neck - this automatically gives you 135°
Protractor methodMeasure 135° from the femoral shaft axis (or 45° from a horizontal line) going superomedially
Step 4 - Measure 'd' Measure from the lateral cortex to where this line meets the fracture line on the distal fragment. That distance = LWT.

Visual Explanation

Think of it this way on the AP radiograph:
         Femoral head
            /
           /  ← Neck axis = ~135° to shaft
          /
    [3cm]●----d----→ fracture line
         |
         | ← Femoral shaft (vertical)
         |
  • The angle between the shaft (going down) and the neck (going up-medially) = 135°
  • Your measurement line runs parallel to the neck, starting from the 3 cm reference point

Why 135° Specifically?

  • The average normal neck-shaft angle is 126°-135° in adults (commonly quoted as 135° for measurement purposes)
  • Using 135° standardizes the measurement so it is reproducible across patients regardless of individual variation
  • The AO Foundation Surgical Reference recommends taking this measurement on the traction AP view (leg in neutral rotation) - either preoperatively or under fluoroscopy after reduction before implant selection, since the fracture line is best seen in this position

Practical Tip

On a standard AP hip X-ray, the easiest way is:
Just align your ruler parallel to the femoral neck - you don't need a protractor. The femoral neck itself is your 135° guide.
If the neck is very varus (<120°) or valgus (>140°), you should still use 135° as the standard angle for the measurement (not the patient's actual NSA), because the threshold of 20.5 mm was derived using this fixed angle.

Create a step-by-step measurement guide PDF with diagrams

Reading File
Running Command

mkdir -p /home/daytona/workspace/lwt-guide/assets && ls /home/daytona/workspace/…

Generating Image

Medical orthopedic diagram showing AP radiograph of proximal femur with intertrochanteric fracture. The diagram shows: (1) the innominate tubercle (vastus ridge) labeled at the top of the greater trochanter, (2) a vertical double-headed red arrow measuring exactly 3 cm going downward from the innominate tubercle along the lateral cortex to a reference point marked with a bold red dot, (3) from that red dot a diagonal red arrow labeled 'd' pointing superomedially at 135 degrees toward the fracture line, (4) the fracture line itself drawn as a jagged dark red line going through the intertrochanteric region, (5) a small angle arc labeled '135°' at the reference point between the femoral shaft axis and the measurement line d, (6) the femoral shaft shown as a vertical bone structure below, (7) all key anatomical structures clearly labeled: 'Innominate Tubercle', '3 cm reference point', 'Lateral Wall Thickness (d)', '135°', 'Fracture Line'. Clean white background, professional medical illustration style, high contrast labels.

Generating Image

Medical orthopedic educational diagram showing the femoral neck-shaft angle concept. Left panel: AP view of proximal femur showing the femoral shaft going vertically downward and the femoral neck going superomedially, with a large arc and label showing '135° Neck-Shaft Angle (NSA)' between them. A dashed line parallel to the femoral neck is drawn from a point on the lateral cortex labeled '3 cm below innominate tubercle', with the label 'Measurement line runs PARALLEL to femoral neck'. Right panel shows two comparison femurs side by side - one labeled 'Competent lateral wall: d ≥ 20.5 mm → DHS safe' with a thick green arrow for d, and one labeled 'Incompetent lateral wall: d < 20.5 mm → Use IMN or add TSP' with a thin red arrow for d. Clean professional medical illustration, white background, clear labels.

Running Command

curl -s "https://cdn.orris.care/image-gen/e5ed9b09286641cd93f4d5b6ce275a67.png" …

Generating Image

Medical orthopedic summary table diagram for lateral wall thickness in intertrochanteric fractures. Shows a clean clinical decision flowchart: Top box 'Measure Lateral Wall Thickness (LWT) on AP Radiograph'. Arrow down to diamond decision box 'LWT < 20.5 mm?'. Left branch (YES, red): box showing 'Incompetent Lateral Wall' with bullet points: 'Avoid DHS alone', 'Use Cephalomedullary Nail (IMN)', 'Or DHS + Trochanteric Stabilizing Plate (TSP)'. Right branch (NO, green): box showing 'Competent Lateral Wall' with bullet points: 'DHS safe for AO/OTA A1 and A2.1', 'Monitor intraoperatively for iatrogenic fracture'. Bottom note box: 'Key fact: LWT < 21mm → 95% sensitivity, 88.2% specificity for lateral wall fracture (Pradeep et al. 2018)'. Professional medical infographic style, white background, green and red color coding.

Running Command

curl -s "https://cdn.orris.care/image-gen/e0d496d4608445b8a55869cfca88df45.png" …

Running Command

curl -s "https://cdn.orris.care/cdss_images/51ef09d5a677e9905af36adf75aea763d9d7…

Writing File

~/lwt-guide/build_pdf.py

from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.units import mm, cm
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.platypus import (
    SimpleDocTemplate, Paragraph, Spacer, Image, Table, TableStyle,
    HRFlowable, PageBreak, KeepTogether
)
from reportlab.platypus.flowables import HRFlowable
from reportlab.pdfgen import canvas
from reportlab.graphics.shapes import Drawing, Rect, String, Line, Circle, Arc
from reportlab.graphics import renderPDF
import os

OUTPUT = "/home/daytona/workspace/lwt-guide/Lateral_Wall_Thickness_Guide.pdf"
ASSETS = "/home/daytona/workspace/lwt-guide/assets"

# ── Colour palette ──────────────────────────────────────────────────────────
NAVY   = colors.HexColor("#1A3557")
TEAL   = colors.HexColor("#1B7F79")
RED    = colors.HexColor("#C0392B")
GREEN  = colors.HexColor("#1E8449")
AMBER  = colors.HexColor("#D68910")
LGRAY  = colors.HexColor("#F4F6F7")
MGRAY  = colors.HexColor("#D5D8DC")
WHITE  = colors.white
BLACK  = colors.black

W, H = A4   # 595.27 x 841.89 pt
MARGIN = 2*cm

# ── Styles ───────────────────────────────────────────────────────────────────
base = getSampleStyleSheet()

def S(name, **kw):
    s = ParagraphStyle(name, **kw)
    return s

TITLE_S = S("Title", fontName="Helvetica-Bold", fontSize=22, textColor=WHITE,
            alignment=TA_CENTER, leading=28, spaceAfter=4)
SUBTITLE_S = S("Subtitle", fontName="Helvetica", fontSize=13, textColor=WHITE,
               alignment=TA_CENTER, leading=18)
H1 = S("H1", fontName="Helvetica-Bold", fontSize=14, textColor=WHITE,
        alignment=TA_LEFT, leading=18, spaceBefore=2, spaceAfter=2)
H2 = S("H2", fontName="Helvetica-Bold", fontSize=12, textColor=NAVY,
        alignment=TA_LEFT, leading=16, spaceBefore=8, spaceAfter=4)
BODY = S("Body", fontName="Helvetica", fontSize=10, textColor=BLACK,
         leading=15, spaceAfter=4, alignment=TA_JUSTIFY)
BODY_B = S("BodyBold", fontName="Helvetica-Bold", fontSize=10, textColor=NAVY,
           leading=15, spaceAfter=2)
BULLET = S("Bullet", fontName="Helvetica", fontSize=10, textColor=BLACK,
           leading=14, leftIndent=16, bulletIndent=4, spaceAfter=3,
           bulletText="\u2022")
CAPTION = S("Caption", fontName="Helvetica-Oblique", fontSize=8.5,
            textColor=colors.HexColor("#555555"), alignment=TA_CENTER,
            leading=12, spaceAfter=6)
NOTE = S("Note", fontName="Helvetica-Oblique", fontSize=9,
         textColor=colors.HexColor("#444444"), leading=13,
         borderPad=6, backColor=colors.HexColor("#FEF9E7"),
         borderColor=AMBER, borderWidth=0.5, spaceAfter=8)
WARN = S("Warn", fontName="Helvetica-Bold", fontSize=10,
         textColor=RED, leading=14, spaceAfter=4)
GREEN_TXT = S("GreenTxt", fontName="Helvetica-Bold", fontSize=10,
              textColor=GREEN, leading=14, spaceAfter=4)
STEP_NUM = S("StepNum", fontName="Helvetica-Bold", fontSize=18,
             textColor=TEAL, leading=20, alignment=TA_CENTER)
STEP_TITLE = S("StepTitle", fontName="Helvetica-Bold", fontSize=12,
               textColor=NAVY, leading=16)
SMALL = S("Small", fontName="Helvetica", fontSize=8.5,
          textColor=colors.HexColor("#555"), leading=12, alignment=TA_CENTER)

# ── Header / Footer canvas ────────────────────────────────────────────────────
class NumberedCanvas(canvas.Canvas):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self._saved_page_states = []

    def showPage(self):
        self._saved_page_states.append(dict(self.__dict__))
        self._startPage()

    def save(self):
        num_pages = len(self._saved_page_states)
        for state in self._saved_page_states:
            self.__dict__.update(state)
            self.draw_page_number(num_pages)
            super().showPage()
        super().save()

    def draw_page_number(self, page_count):
        page_num = self._saved_page_states.index(
            {k: v for k, v in self.__dict__.items() if k in self._saved_page_states[0]}
        ) + 1 if hasattr(self, '_page_number') else 0
        self.setFont("Helvetica", 8)
        self.setFillColor(colors.HexColor("#888"))
        self.drawCentredString(W / 2, 18, f"Lateral Wall Thickness Measurement Guide  |  Page {self._pageNumber} of {page_count}")

# ── Helper: coloured section header ──────────────────────────────────────────
def section_header(text, bg=NAVY):
    data = [[Paragraph(text, H1)]]
    t = Table(data, colWidths=[W - 2*MARGIN])
    t.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,-1), bg),
        ("TOPPADDING",    (0,0), (-1,-1), 8),
        ("BOTTOMPADDING", (0,0), (-1,-1), 8),
        ("LEFTPADDING",   (0,0), (-1,-1), 12),
        ("RIGHTPADDING",  (0,0), (-1,-1), 12),
        ("ROUNDEDCORNERS", [4,4,4,4]),
    ]))
    return t

# ── Helper: numbered step box ─────────────────────────────────────────────────
def step_box(num, title, body_text, bg=LGRAY):
    num_cell  = Paragraph(str(num), STEP_NUM)
    title_p   = Paragraph(title, STEP_TITLE)
    body_p    = Paragraph(body_text, BODY)
    data = [[num_cell, [title_p, Spacer(1, 4), body_p]]]
    t = Table(data, colWidths=[1.8*cm, W - 2*MARGIN - 1.8*cm - 0.4*cm])
    t.setStyle(TableStyle([
        ("BACKGROUND",    (0,0), (-1,-1), bg),
        ("VALIGN",        (0,0), (-1,-1), "TOP"),
        ("TOPPADDING",    (0,0), (-1,-1), 10),
        ("BOTTOMPADDING", (0,0), (-1,-1), 10),
        ("LEFTPADDING",   (0,0), (0,-1),  8),
        ("LEFTPADDING",   (1,0), (1,-1),  12),
        ("RIGHTPADDING",  (0,0), (-1,-1), 10),
        ("BOX",           (0,0), (-1,-1), 0.8, TEAL),
        ("LINEAFTER",     (0,0), (0,-1),  1.5, TEAL),
    ]))
    return t

# ── Helper: two-col table ─────────────────────────────────────────────────────
def two_col_table(rows, col1_w=5*cm, header_bg=NAVY, stripe_bg=LGRAY):
    style = [
        ("BACKGROUND",    (0,0), (-1,0),  header_bg),
        ("TEXTCOLOR",     (0,0), (-1,0),  WHITE),
        ("FONTNAME",      (0,0), (-1,0),  "Helvetica-Bold"),
        ("FONTSIZE",      (0,0), (-1,-1), 9.5),
        ("LEADING",       (0,0), (-1,-1), 14),
        ("ALIGN",         (0,0), (-1,-1), "LEFT"),
        ("VALIGN",        (0,0), (-1,-1), "MIDDLE"),
        ("TOPPADDING",    (0,0), (-1,-1), 6),
        ("BOTTOMPADDING", (0,0), (-1,-1), 6),
        ("LEFTPADDING",   (0,0), (-1,-1), 8),
        ("RIGHTPADDING",  (0,0), (-1,-1), 8),
        ("GRID",          (0,0), (-1,-1), 0.4, MGRAY),
    ]
    for i in range(1, len(rows)):
        if i % 2 == 0:
            style.append(("BACKGROUND", (0,i), (-1,i), stripe_bg))
    col2_w = W - 2*MARGIN - col1_w - 0.4*cm
    data = [[Paragraph(str(r[0]), base["Normal"]),
             Paragraph(str(r[1]), base["Normal"])] for r in rows]
    t = Table(data, colWidths=[col1_w, col2_w])
    t.setStyle(TableStyle(style))
    return t

# ── Helper: inline image with caption ────────────────────────────────────────
def img_with_caption(path, caption, max_w=None, max_h=None):
    if max_w is None: max_w = W - 2*MARGIN
    if max_h is None: max_h = 9*cm
    try:
        im = Image(path, width=max_w, height=max_h, kind="proportional")
    except Exception:
        im = Paragraph(f"[Image not available: {os.path.basename(path)}]", CAPTION)
    cap = Paragraph(caption, CAPTION)
    return KeepTogether([im, cap])

# ── Build story ───────────────────────────────────────────────────────────────
story = []

# =========================================================================
# PAGE 1 - Cover
# =========================================================================
# Cover banner via a Table
cover_title  = Paragraph("Lateral Wall Thickness", TITLE_S)
cover_sub1   = Paragraph("Intertrochanteric Femur Fracture", SUBTITLE_S)
cover_sub2   = Paragraph("Step-by-Step Measurement Guide", S("S2", fontName="Helvetica-Bold",
               fontSize=15, textColor=colors.HexColor("#AED6F1"),
               alignment=TA_CENTER, leading=20))
cover_date   = Paragraph("Based on Hsu et al. 2013 | AO/OTA 2018 Classification | Campbell's Operative Orthopaedics 15th Ed",
               S("CD", fontName="Helvetica", fontSize=9,
                 textColor=colors.HexColor("#AED6F1"), alignment=TA_CENTER, leading=14))

cover_data = [[cover_title], [cover_sub1], [Spacer(1, 6)], [cover_sub2], [Spacer(1,10)], [cover_date]]
cover_table = Table(cover_data, colWidths=[W - 2*MARGIN])
cover_table.setStyle(TableStyle([
    ("BACKGROUND",    (0,0), (-1,-1), NAVY),
    ("TOPPADDING",    (0,0), (-1,-1), 8),
    ("BOTTOMPADDING", (0,0), (-1,-1), 8),
    ("LEFTPADDING",   (0,0), (-1,-1), 20),
    ("RIGHTPADDING",  (0,0), (-1,-1), 20),
]))
story.append(cover_table)
story.append(Spacer(1, 0.5*cm))

# Quick-summary box on cover
qbox_data = [
    [Paragraph("<b>What is Lateral Wall Thickness (LWT)?</b>", H2)],
    [Paragraph(
        "LWT is a radiographic measurement on the AP hip X-ray that predicts whether the lateral "
        "femoral wall will remain intact during and after fixation of an intertrochanteric fracture. "
        "It is the single most important factor in deciding between a <b>Dynamic Hip Screw (DHS)</b> "
        "and a <b>Cephalomedullary Nail (IMN)</b>.", BODY)],
    [Spacer(1,4)],
    [Paragraph("<b>The critical threshold:  LWT &lt; 20.5 mm = Incompetent lateral wall</b>",
               S("CritT", fontName="Helvetica-Bold", fontSize=11, textColor=RED, leading=16))],
]
qt = Table(qbox_data, colWidths=[W - 2*MARGIN])
qt.setStyle(TableStyle([
    ("BACKGROUND",    (0,0), (-1,-1), LGRAY),
    ("TOPPADDING",    (0,0), (-1,-1), 8),
    ("BOTTOMPADDING", (0,0), (-1,-1), 8),
    ("LEFTPADDING",   (0,0), (-1,-1), 14),
    ("RIGHTPADDING",  (0,0), (-1,-1), 14),
    ("BOX",           (0,0), (-1,-1), 1.2, TEAL),
    ("LINEABOVE",     (0,0), (-1,0),  3, TEAL),
]))
story.append(qt)
story.append(Spacer(1, 0.5*cm))

# Cover diagram (Campbell's original)
story.append(img_with_caption(
    f"{ASSETS}/campbells_diagram.png",
    "Figure 1. Lateral wall thickness (d) — distance from 3 cm below innominate tubercle, "
    "angled 135° upward to the fracture line. (Redrawn from Pradeep et al., Injury 2018; "
    "reproduced in Campbell's Operative Orthopaedics 15th Ed, Fig. 60.35)",
    max_w=8*cm, max_h=8*cm
))

story.append(PageBreak())

# =========================================================================
# PAGE 2 - Anatomy Quick Reference
# =========================================================================
story.append(section_header("  ANATOMY QUICK REFERENCE", NAVY))
story.append(Spacer(1, 0.3*cm))

story.append(Paragraph("Key Landmarks on the AP Radiograph", H2))
story.append(two_col_table([
    ["Landmark", "Description"],
    ["Innominate Tubercle\n(Vastus Ridge)", "Bony prominence on the anterolateral surface of the greater trochanter where vastus lateralis originates. This is the PRIMARY reference point for LWT measurement."],
    ["Lateral Femoral Cortex", "The outer cortex of the proximal femur shaft — the start of the measurement line."],
    ["Femoral Neck Axis", "The long axis of the femoral neck, oriented at ~135° to the shaft. The LWT measurement line runs PARALLEL to this axis."],
    ["Neck-Shaft Angle (NSA)", "Normally 126°–135°. The standard 135° is used for LWT measurement regardless of the patient's actual NSA."],
    ["Fracture Line (Distal Fragment)", "The fracture line on the distal/lateral fragment — the END point of the LWT measurement."],
], col1_w=4.5*cm))

story.append(Spacer(1, 0.5*cm))
story.append(Paragraph("Understanding the 135° Angle", H2))
story.append(Paragraph(
    "The 135° angle is <b>not arbitrary</b> — it represents the normal femoral neck-shaft angle. "
    "This means your measurement line runs <b>parallel to the femoral neck</b>. "
    "In practice, you do not need a protractor: simply align your ruler with the long axis of "
    "the femoral neck and project that direction from the 3 cm reference point.", BODY))
story.append(Spacer(1, 0.3*cm))

# Diagram 2 (neck-shaft angle + decision)
story.append(img_with_caption(
    f"{ASSETS}/diagram2.png",
    "Figure 2. Left: The 135° neck-shaft angle — measurement line runs parallel to the femoral neck. "
    "Right: Clinical decision based on LWT threshold.",
    max_w=W - 2*MARGIN, max_h=7*cm
))

story.append(PageBreak())

# =========================================================================
# PAGE 3 - Step-by-Step Measurement
# =========================================================================
story.append(section_header("  STEP-BY-STEP MEASUREMENT", TEAL))
story.append(Spacer(1, 0.3*cm))

story.append(Paragraph(
    "Perform the measurement on a calibrated AP radiograph of the hip, ideally on the "
    "<b>traction/reduction view</b> with the leg in neutral rotation (as recommended by the "
    "AO Foundation). Fluoroscopic images after closed reduction but before implant selection "
    "are also acceptable.", BODY))
story.append(Spacer(1, 0.3*cm))

steps = [
    (1, "Obtain the correct AP radiograph",
     "Take a standard AP hip radiograph with the leg in <b>neutral rotation and slight traction</b>. "
     "This opens the fracture line and reveals the lateral wall clearly. A frog-leg or internal rotation view will distort the measurement."),
    (2, "Identify the Innominate Tubercle",
     "Locate the <b>innominate tubercle (vastus ridge)</b> on the greater trochanter — it appears as a "
     "small bony prominence on the anterolateral trochanter where vastus lateralis originates. On a standard "
     "AP view it is the most prominent point of the greater trochanter laterally."),
    (3, "Mark the 3 cm reference point",
     "From the innominate tubercle, measure <b>3 cm (30 mm) distally</b> along the lateral cortex of the femoral shaft. "
     "Mark this point clearly. This is your <b>starting point</b> for the LWT measurement. "
     "(Note: on a scaled/calibrated digital PACS system, use the measurement tool to ensure 3 cm is accurate.)"),
    (4, "Draw the 135° measurement line",
     "From the 3 cm reference point, draw a line directed <b>superomedially at 135°</b> to the femoral shaft axis. "
     "The practical shortcut: <b>align your ruler parallel to the long axis of the femoral neck</b> — "
     "this automatically gives the 135° direction. The line should point toward the fracture."),
    (5, "Measure distance 'd' to the fracture line",
     "Measure the straight-line distance from the <b>lateral cortex</b> at the reference point to where "
     "your 135° line intersects the <b>fracture line on the distal fragment</b>. "
     "This distance in millimeters = <b>Lateral Wall Thickness (d)</b>."),
    (6, "Interpret the measurement",
     "<b>d ≥ 20.5 mm</b>: Competent lateral wall — DHS is appropriate for AO/OTA 31-A1 and A2.1 fractures.<br/>"
     "<b>d &lt; 20.5 mm</b>: Incompetent lateral wall — avoid DHS alone; use cephalomedullary nail or add trochanteric stabilizing plate (TSP)."),
]

for num, title, body in steps:
    bg = LGRAY if num % 2 == 0 else colors.HexColor("#EBF5FB")
    story.append(step_box(num, title, body, bg=bg))
    story.append(Spacer(1, 0.25*cm))

# Main measurement diagram
story.append(Spacer(1, 0.2*cm))
story.append(img_with_caption(
    f"{ASSETS}/diagram1.png",
    "Figure 3. Complete LWT measurement diagram — innominate tubercle, 3 cm reference point, "
    "135° line, and measurement 'd' to the fracture line on AP radiograph.",
    max_w=W - 2*MARGIN, max_h=8.5*cm
))

story.append(PageBreak())

# =========================================================================
# PAGE 4 - Clinical Decision + Pitfalls
# =========================================================================
story.append(section_header("  CLINICAL DECISION-MAKING", NAVY))
story.append(Spacer(1, 0.3*cm))

story.append(img_with_caption(
    f"{ASSETS}/diagram3.png",
    "Figure 4. Clinical decision flowchart based on lateral wall thickness.",
    max_w=W - 2*MARGIN, max_h=8*cm
))

story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("AO/OTA Classification Context", H2))
story.append(two_col_table([
    ["AO/OTA Type", "Lateral Wall Status", "Recommended Fixation"],
    ["31-A1.1, A1.2, A1.3\nA2.1", "Intact (LWT typically ≥ 20.5 mm)", "DHS — assess LWT to confirm"],
    ["31-A2.2, A2.3", "At risk — measure LWT carefully\n31% intraoperative fracture rate", "Prefer IMN; if DHS used, add TSP"],
    ["31-A3\n(Reverse obliquity)", "Fractured lateral wall by definition", "Cephalomedullary nail ONLY"],
], col1_w=3.8*cm, header_bg=NAVY))

story.append(Spacer(1, 0.4*cm))
story.append(Paragraph("Common Pitfalls and How to Avoid Them", H2))

pitfalls = [
    ("Measuring on a rotated X-ray", "Internal rotation shortens the apparent LWT; external rotation elongates it. Always use neutral rotation. If unclear, obtain a CT scan."),
    ("Using actual NSA instead of 135°", "The 20.5 mm threshold was derived using a fixed 135° angle. Do not adjust the angle to match the patient's individual NSA."),
    ("Forgetting to calibrate the image", "On digital PACS, always calibrate using a reference marker (e.g., femoral head diameter or calibration ball) before measuring. Uncalibrated images give inaccurate mm values."),
    ("Measuring to the wrong fracture line", "Measure to the fracture line on the DISTAL fragment only. In comminuted fractures, use the most lateral fracture line."),
    ("Ignoring intraoperative fracture", "Even if preoperative LWT is adequate, monitor fluoroscopy during DHS insertion. Iatrogenic fracture is the strongest predictor of fixation failure — convert to IMN immediately if detected."),
    ("Forgetting CT in complex fractures", "CT scan is recommended for 'stable-appearing' fractures where plain X-ray may underestimate comminution and lateral wall involvement."),
]

for pitfall, advice in pitfalls:
    data = [
        [Paragraph(f"⚠ {pitfall}", WARN),
         Paragraph(advice, BODY)]
    ]
    t = Table(data, colWidths=[5*cm, W - 2*MARGIN - 5*cm])
    t.setStyle(TableStyle([
        ("BACKGROUND",    (0,0), (0,-1), colors.HexColor("#FDEDEC")),
        ("BACKGROUND",    (1,0), (1,-1), colors.HexColor("#FDFEFE")),
        ("VALIGN",        (0,0), (-1,-1), "TOP"),
        ("TOPPADDING",    (0,0), (-1,-1), 8),
        ("BOTTOMPADDING", (0,0), (-1,-1), 8),
        ("LEFTPADDING",   (0,0), (-1,-1), 8),
        ("RIGHTPADDING",  (0,0), (-1,-1), 8),
        ("BOX",           (0,0), (-1,-1), 0.5, MGRAY),
        ("LINEAFTER",     (0,0), (0,-1), 1, RED),
    ]))
    story.append(t)
    story.append(Spacer(1, 0.2*cm))

story.append(PageBreak())

# =========================================================================
# PAGE 5 - Quick Reference Card + References
# =========================================================================
story.append(section_header("  QUICK REFERENCE CARD", TEAL))
story.append(Spacer(1, 0.3*cm))

# Quick summary table
summary_data = [
    ["Parameter", "Value / Detail"],
    ["View", "AP radiograph, neutral rotation, slight traction (traction view preferred)"],
    ["Reference point", "3 cm (30 mm) distal to innominate tubercle on lateral cortex"],
    ["Measurement angle", "135° to femoral shaft = parallel to femoral neck axis"],
    ["End point", "Fracture line on distal fragment"],
    ["Competent wall threshold", "LWT ≥ 20.5 mm"],
    ["Incompetent wall threshold", "LWT < 20.5 mm"],
    ["Predictive accuracy\n(LWT < 21 mm)", "Sensitivity 95% | Specificity 88.2%\n(Pradeep et al. 2018)"],
    ["If LWT ≥ 20.5 mm", "DHS acceptable for AO/OTA A1 and A2.1"],
    ["If LWT < 20.5 mm", "Cephalomedullary nail (IMN) preferred\nOR DHS + Trochanteric Stabilizing Plate (TSP)"],
    ["Intraoperative caution", "A2.2 and A2.3: 31% risk of intraoperative lateral wall fracture with DHS"],
    ["If iatrogenic fracture occurs", "Convert to IMN immediately or add TSP"],
]
story.append(two_col_table(summary_data, col1_w=5.5*cm, header_bg=TEAL))

story.append(Spacer(1, 0.5*cm))
story.append(HRFlowable(width=W - 2*MARGIN, thickness=1, color=MGRAY))
story.append(Spacer(1, 0.3*cm))

story.append(Paragraph("Key References", H2))
refs = [
    "1. Hsu CE, Shih CM, Wang CC, Huang KC. Lateral femoral wall thickness: a reliable predictor of post-operative lateral wall fracture in intertrochanteric fractures. <i>Bone Joint J.</i> 2013;95-B(8):1134–1138.",
    "2. Pradeep AR, KiranKumar A, Dheenadhayalan J, et al. Intraoperative lateral wall fractures during Dynamic Hip Screw fixation for intertrochanteric fractures — incidence, causative factors and clinical outcome. <i>Injury.</i> 2018;49:334–338.",
    "3. AO Foundation Surgical Reference. Multifragmentary pertrochanteric fractures with incompetent lateral wall. AO/OTA 2018 Classification. surgeryreference.aofoundation.org.",
    "4. Campbell's Operative Orthopaedics, 15th Ed (2026). Chapter 60: Intertrochanteric Fractures, pp. 3452–3454.",
    "5. Miller's Review of Orthopaedics, 9th Ed. Section 11: Intertrochanteric Fractures.",
    "6. Li Y, et al. The importance of the thickness of femoral lateral wall for treating intertrochanteric fractures: a finite element analysis. <i>Sci Rep.</i> 2023;13:12679.",
]
for ref in refs:
    story.append(Paragraph(ref, S("Ref", fontName="Helvetica", fontSize=8.5,
                                   textColor=colors.HexColor("#333"), leading=13,
                                   leftIndent=12, spaceAfter=5)))

story.append(Spacer(1, 0.5*cm))
story.append(HRFlowable(width=W - 2*MARGIN, thickness=0.5, color=MGRAY))
story.append(Spacer(1, 0.2*cm))
story.append(Paragraph(
    "This guide is intended for educational purposes. Always verify measurements and clinical decisions "
    "against current institutional guidelines and individual patient factors.",
    S("Disc", fontName="Helvetica-Oblique", fontSize=8, textColor=colors.HexColor("#888"),
      alignment=TA_CENTER, leading=12)
))

# ── Build the PDF ─────────────────────────────────────────────────────────────
doc = SimpleDocTemplate(
    OUTPUT,
    pagesize=A4,
    leftMargin=MARGIN, rightMargin=MARGIN,
    topMargin=MARGIN, bottomMargin=2.2*cm,
    title="Lateral Wall Thickness Measurement Guide",
    author="Orris Medical AI",
    subject="Intertrochanteric Femur Fracture",
)
doc.build(story, canvasmaker=NumberedCanvas)
print(f"PDF created: {OUTPUT}")
Running Command

cd /home/daytona/workspace/lwt-guide && python build_pdf.py 2>&1

Editing File

~/lwt-guide/build_pdf.py

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/lwt-guide/build_pdf.py'
Running Command

cd /home/daytona/workspace/lwt-guide && python build_pdf.py 2>&1

Running Command

ls -lh /home/daytona/workspace/lwt-guide/Lateral_Wall_Thickness_Guide.pdf

Your PDF is ready — 2.4 MB, 5 pages:

Lateral Wall Thickness Guide

PDF Document · PDF


What's inside (5 pages):

PageContent
1 - CoverTitle banner, what-is-LWT summary box, Campbell's original diagram (Fig. 60.35)
2 - Anatomy Quick ReferenceLandmark table (innominate tubercle, NSA, lateral cortex, etc.), explanation of the 135° angle with diagram
3 - Step-by-Step Measurement6 numbered, colour-coded steps from "obtain the right X-ray" through "interpret the result", with the full measurement diagram
4 - Clinical Decision-MakingDecision flowchart diagram, AO/OTA classification table with recommended fixation, pitfalls table (6 common errors and how to avoid them)
5 - Quick Reference CardSummary table of all key parameters at a glance, full reference list (Hsu 2013, Pradeep 2018, AO Foundation, Campbell's)

Can you get ppt for trauma of wrist joint

Reading File
Reading File
Reading File
Finding Sources
Reading File
Finding Sources
Reading File
Reading File
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Running Command

mkdir -p /home/daytona/workspace/wrist-trauma-ppt && node /home/daytona/skills/s…

Writing File

~/wrist-trauma-ppt/build.js

const pptxgen = require("pptxgenjs");
const { execSync } = require("child_process");
const path = require("path");

// ── fetch images helper ───────────────────────────────────────────────────────
function fetchImgs(urls) {
  const json = execSync(
    `node /home/daytona/skills/shared/scripts/fetch_images.js ${urls.map(u => `"${u}"`).join(" ")}`
  ).toString();
  return JSON.parse(json);
}

const IMG_URLS = [
  "https://cdn.orris.care/cdss_images/22b2f829274fd8e99c8c51d1baba053f9985cb9dd7640673320ab0e342bd4d9d.png", // perilunate PA+lat
  "https://cdn.orris.care/cdss_images/9383d1f45fdb1b3875e7f21d5ee75ba5f1a6029baa957a103fc88af78a5c9319.png", // transscaphoid perilunate
  "https://cdn.orris.care/cdss_images/bea7df75b2d3941c0479ed310828d374ffe86bf50fa3555c941d2c7e20a5a7ea.png", // lunate dislocation
  "https://cdn.orris.care/cdss_images/d8d04f2c2548503e7a27aee6b2bcbcd5cf75bcbb102a6754766fee67eaf8992c.png", // galeazzi fixation
];

console.log("Fetching images...");
const imgs = fetchImgs(IMG_URLS);
const [imgPerilunate, imgTransscaphoid, imgLunate, imgGaleazzi] = imgs.map(i => i.base64 || null);
console.log("Images ready.");

// ── Palette ───────────────────────────────────────────────────────────────────
const C = {
  navy:    "1A3557",
  teal:    "1B7F79",
  red:     "C0392B",
  green:   "1E8449",
  amber:   "D68910",
  white:   "FFFFFF",
  lgray:   "EBF5FB",
  mgray:   "D5D8DC",
  dgray:   "555555",
  black:   "222222",
  accent:  "2E86C1",
  ltblue:  "AED6F1",
  bg:      "F4F9FC",
};

const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.author  = "Orris Medical AI";
pres.title   = "Trauma of the Wrist Joint";
pres.subject = "Orthopaedic Trauma – Wrist";

// ── Reusable slide helpers ────────────────────────────────────────────────────
function slideBg(slide, color) {
  slide.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: "100%", h: "100%", fill: { color } });
}

function topBar(slide, title, sub, barColor, textColor) {
  barColor = barColor || C.navy;
  textColor = textColor || C.white;
  slide.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: "100%", h: 1.1, fill: { color: barColor }, line: { color: barColor } });
  slide.addText(title, { x: 0.3, y: 0.08, w: 9.4, h: 0.58, fontSize: 22, bold: true, color: textColor, fontFace: "Calibri", valign: "middle" });
  if (sub) slide.addText(sub, { x: 0.3, y: 0.68, w: 9.4, h: 0.36, fontSize: 11, color: C.ltblue, fontFace: "Calibri", valign: "middle" });
  // footer
  slide.addShape(pres.shapes.RECTANGLE, { x: 0, y: 5.3, w: "100%", h: 0.325, fill: { color: barColor }, line: { color: barColor } });
  slide.addText("Wrist Trauma  |  Orris Medical AI  |  Based on Campbell's, Rosen's EM, Tintinalli's & Rockwood-Green's",
    { x: 0.2, y: 5.3, w: 9.6, h: 0.32, fontSize: 7.5, color: C.ltblue, fontFace: "Calibri", valign: "middle" });
}

function bullet(text, options) {
  return { text, options: { bullet: { type: "bullet" }, fontSize: 13, color: C.black, fontFace: "Calibri", breakLine: true, ...options } };
}

function subbullet(text, options) {
  return { text, options: { bullet: { type: "bullet", indent: 20 }, fontSize: 11.5, color: C.dgray, fontFace: "Calibri", breakLine: true, indentLevel: 1, ...options } };
}

function sectionLabel(slide, text, x, y, w, color) {
  color = color || C.teal;
  slide.addShape(pres.shapes.ROUNDED_RECTANGLE, { x, y, w, h: 0.32, fill: { color }, line: { color }, rectRadius: 0.05 });
  slide.addText(text, { x: x + 0.1, y: y, w: w - 0.1, h: 0.32, fontSize: 10, bold: true, color: C.white, fontFace: "Calibri", valign: "middle", margin: 0 });
}

function keyBox(slide, text, x, y, w, bg, border) {
  bg = bg || C.lgray; border = border || C.teal;
  slide.addShape(pres.shapes.RECTANGLE, { x, y, w, h: 0.42, fill: { color: bg }, line: { color: border, pt: 1.5 } });
  slide.addText(text, { x: x + 0.1, y, w: w - 0.15, h: 0.42, fontSize: 11, color: C.black, fontFace: "Calibri", valign: "middle" });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 1 — COVER
// ═══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  slideBg(s, C.navy);
  // Top accent strip
  s.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: "100%", h: 0.18, fill: { color: C.teal }, line: { color: C.teal } });
  // Bottom accent strip
  s.addShape(pres.shapes.RECTANGLE, { x: 0, y: 5.45, w: "100%", h: 0.175, fill: { color: C.teal }, line: { color: C.teal } });

  // Main title
  s.addText("TRAUMA OF THE WRIST JOINT", {
    x: 0.5, y: 1.1, w: 9, h: 1.1, fontSize: 36, bold: true, color: C.white,
    fontFace: "Calibri", align: "center", charSpacing: 3
  });
  // Subtitle rule
  s.addShape(pres.shapes.RECTANGLE, { x: 2.5, y: 2.28, w: 5, h: 0.04, fill: { color: C.teal }, line: { color: C.teal } });
  s.addText("A Comprehensive Clinical Overview", {
    x: 0.5, y: 2.38, w: 9, h: 0.55, fontSize: 18, color: C.ltblue,
    fontFace: "Calibri", align: "center", italic: true
  });

  // Topic badges
  const topics = [
    "Anatomy & Biomechanics",
    "Distal Radius Fractures",
    "Carpal Fractures",
    "Carpal Dislocations",
    "Ligament Injuries",
    "Management Principles",
  ];
  const cols = 3;
  topics.forEach((t, i) => {
    const col = i % cols;
    const row = Math.floor(i / cols);
    const x = 0.5 + col * 3.1;
    const y = 3.2 + row * 0.56;
    s.addShape(pres.shapes.ROUNDED_RECTANGLE, { x, y, w: 2.8, h: 0.42, fill: { color: "1E4D7B" }, line: { color: C.teal, pt: 1 }, rectRadius: 0.07 });
    s.addText(t, { x, y, w: 2.8, h: 0.42, fontSize: 11, color: C.ltblue, fontFace: "Calibri", align: "center", valign: "middle" });
  });

  s.addText("Orris Medical AI  •  Based on Campbell's Operative Orthopaedics 15th Ed, Rosen's Emergency Medicine, Tintinalli's EM, Rockwood & Green's Fractures", {
    x: 0.3, y: 5.12, w: 9.4, h: 0.28, fontSize: 8, color: "7FB3D3",
    fontFace: "Calibri", align: "center"
  });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 2 — ANATOMY OF THE WRIST
// ═══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  slideBg(s, C.bg);
  topBar(s, "Anatomy of the Wrist Joint", "Understanding the bony and ligamentous architecture essential for trauma assessment");

  // Left col — bones
  sectionLabel(s, "BONY ANATOMY", 0.3, 1.22, 4.4);
  s.addText([
    bullet("Radiocarpal joint: Radius articulates with scaphoid & lunate"),
    bullet("Distal Radioulnar Joint (DRUJ): Radius articulates with ulnar head"),
    bullet("Proximal carpal row: Scaphoid, Lunate, Triquetrum, Pisiform"),
    bullet("Distal carpal row: Trapezium, Trapezoid, Capitate, Hamate"),
    bullet("Midcarpal joint: between proximal and distal carpal rows"),
    bullet("Key bony landmarks: Radial styloid, Ulnar styloid, Lister's tubercle"),
  ], { x: 0.3, y: 1.6, w: 4.4, h: 2.5 });

  // Right col — ligaments
  sectionLabel(s, "KEY LIGAMENTS & STRUCTURES", 4.9, 1.22, 4.8, C.accent);
  s.addText([
    bullet("Volar extrinsic: Radio-scaphocapitate, Long & Short radiolunate"),
    bullet("Dorsal extrinsic: Dorsal radiocarpal, Dorsal intercarpal"),
    bullet("Intrinsic: Scapholunate (SL) ligament — dorsal portion STRONGEST"),
    bullet("Intrinsic: Lunotriquetral (LT) ligament — volar portion STRONGEST"),
    bullet("TFCC (Triangular Fibrocartilage Complex): primary stabiliser of DRUJ"),
    bullet("Extensor retinaculum: 6 dorsal compartments for tendons"),
  ], { x: 4.9, y: 1.6, w: 4.8, h: 2.5 });

  // Bottom key fact
  s.addShape(pres.shapes.RECTANGLE, { x: 0.3, y: 4.25, w: 9.4, h: 0.82, fill: { color: "FEF9E7" }, line: { color: C.amber, pt: 1.5 } });
  s.addText("⚡ Biomechanical Pearl: The scaphoid bridges both carpal rows — fractures disrupt the kinematic link between them, causing carpal instability (DISI or VISI patterns). The SL angle normally = 30–60°; > 70° = DISI (most common instability pattern).", {
    x: 0.45, y: 4.27, w: 9.1, h: 0.78, fontSize: 11, color: C.black, fontFace: "Calibri", valign: "middle"
  });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 3 — DISTAL RADIUS FRACTURES: OVERVIEW & CLASSIFICATION
// ═══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  slideBg(s, C.bg);
  topBar(s, "Distal Radius Fractures — Classification & Assessment", "Most common fracture in adults; accounts for ~15–20% of all fractures seen in emergency");

  // Named fracture types — table-style boxes
  sectionLabel(s, "NAMED FRACTURE TYPES", 0.3, 1.22, 9.4);

  const fractures = [
    { name: "Colles' Fracture", desc: "Dorsal displacement + dorsal angulation (dinner-fork deformity)\nMOI: FOOSH in older patients. Most common distal radius fracture.", col: C.navy },
    { name: "Smith's Fracture", desc: "Volar (palmar) displacement — 'reverse Colles''\nMOI: Fall on flexed wrist or direct blow to dorsum.", col: C.teal },
    { name: "Barton's Fracture", desc: "Intra-articular fracture-dislocation of radiocarpal joint\nVolar Barton: more common; Dorsal Barton: less common.", col: C.accent },
    { name: "Chauffeur's Fracture", desc: "Isolated radial styloid fracture (avulsion by RSC ligament)\nMOI: Compression/avulsion. Often with ligamentous injury.", col: "7D3C98" },
    { name: "Die-Punch Fracture", desc: "Impaction of lunate into the radial articular surface\nCreates depressed intra-articular fragment; often needs ORIF.", col: C.red },
    { name: "Galeazzi Fracture", desc: "Distal 1/3 radius fracture + DRUJ dislocation\n'Fracture of necessity' — requires ORIF of radius.", col: "117A65" },
  ];

  fractures.forEach((f, i) => {
    const col = i % 3;
    const row = Math.floor(i / 3);
    const x = 0.3 + col * 3.2;
    const y = 1.6 + row * 1.45;
    s.addShape(pres.shapes.ROUNDED_RECTANGLE, { x, y, w: 3.1, h: 1.32, fill: { color: "FDFEFE" }, line: { color: f.col, pt: 2 }, rectRadius: 0.08,
      shadow: { type: "outer", color: "000000", blur: 4, offset: 2, angle: 135, opacity: 0.1 } });
    s.addShape(pres.shapes.RECTANGLE, { x, y, w: 3.1, h: 0.38, fill: { color: f.col }, line: { color: f.col } });
    s.addText(f.name, { x: x + 0.1, y, w: 2.9, h: 0.38, fontSize: 11.5, bold: true, color: C.white, fontFace: "Calibri", valign: "middle", margin: 0 });
    s.addText(f.desc, { x: x + 0.1, y: y + 0.42, w: 2.9, h: 0.85, fontSize: 9.5, color: C.black, fontFace: "Calibri", valign: "top" });
  });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 4 — DISTAL RADIUS: STABILITY ASSESSMENT & TREATMENT
// ═══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  slideBg(s, C.bg);
  topBar(s, "Distal Radius Fractures — Stability & Management", "Instability criteria determine operative vs. non-operative treatment pathway");

  // Left: instability criteria
  sectionLabel(s, "INSTABILITY CRITERIA (any = unstable)", 0.3, 1.22, 5.1, C.red);
  s.addText([
    bullet("Initial dorsal angulation > 20° (volar tilt)", { color: C.red }),
    bullet("Dorsal metaphyseal comminution", { color: C.red }),
    bullet("Intra-articular involvement (>2 mm step-off = operative)", { color: C.red }),
    bullet("Associated ulnar fracture", { color: C.red }),
    bullet("Patient age > 60 years (bone quality ↓)", { color: C.red }),
    bullet("Radial shortening > 5 mm", { color: C.red }),
  ], { x: 0.3, y: 1.6, w: 5.1, h: 2.1 });

  sectionLabel(s, "NORMAL RADIOGRAPHIC PARAMETERS", 0.3, 3.78, 5.1, C.green);
  s.addText([
    bullet("Radial inclination: 22° (AP view)"),
    bullet("Radial height: 12–13 mm"),
    bullet("Volar tilt: 11° (lateral view)"),
    bullet("Ulnar variance: 0 mm (neutral)"),
  ], { x: 0.3, y: 4.15, w: 5.1, h: 1.0 });

  // Right: treatment
  sectionLabel(s, "MANAGEMENT PATHWAY", 5.55, 1.22, 4.1, C.teal);
  const txRows = [
    ["Stable fracture", "Closed reduction + below-elbow cast\n(if acceptable alignment)"],
    ["Unstable / failed reduction", "Surgical fixation indicated"],
    ["Percutaneous K-wires", "Simple extra-articular fractures\nAfter closed reduction"],
    ["Volar Locking Plate (ORIF)", "Gold standard for unstable fractures\nAllows early ROM"],
    ["External fixation", "Severely comminuted, open fractures\nTemporary stabilisation"],
    ["Dorsal plate", "Dorsal Barton's, die-punch fragments"],
  ];
  txRows.forEach(([method, detail], i) => {
    const y = 1.6 + i * 0.6;
    const bg = i % 2 === 0 ? "EAF2FF" : C.white;
    s.addShape(pres.shapes.RECTANGLE, { x: 5.55, y, w: 4.1, h: 0.58, fill: { color: bg }, line: { color: C.mgray, pt: 0.5 } });
    s.addText(method, { x: 5.65, y, w: 1.6, h: 0.58, fontSize: 10, bold: true, color: C.navy, fontFace: "Calibri", valign: "middle" });
    s.addText(detail, { x: 7.3, y, w: 2.3, h: 0.58, fontSize: 9, color: C.dgray, fontFace: "Calibri", valign: "middle" });
  });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 5 — SCAPHOID FRACTURES
// ═══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  slideBg(s, C.bg);
  topBar(s, "Scaphoid Fractures", "Most common carpal bone fracture — 60–70% of all carpal injuries");

  // Left content
  sectionLabel(s, "EPIDEMIOLOGY & MECHANISM", 0.3, 1.22, 4.5);
  s.addText([
    bullet("Young males most commonly affected (15–40 yrs)"),
    bullet("MOI: Fall on outstretched hand (FOOSH) — forced dorsiflexion + radial deviation"),
    bullet("Accounts for ~60–70% of all carpal bone fractures"),
    bullet("Waist fractures most common (70%), then proximal pole (20%), distal pole (10%)"),
  ], { x: 0.3, y: 1.58, w: 4.5, h: 1.35 });

  sectionLabel(s, "CLINICAL FEATURES", 0.3, 2.98, 4.5, C.accent);
  s.addText([
    bullet("Anatomical snuffbox tenderness (key sign)"),
    bullet("Scaphoid tubercle tenderness (volar)"),
    bullet("Pain on axial compression of thumb"),
    bullet("Longitudinal compression test positive"),
    bullet("X-ray may be NORMAL in early fractures (10–20% missed on plain films)"),
    subbullet("→ If clinical suspicion: immobilise + repeat X-ray at 10–14 days OR MRI/CT"),
  ], { x: 0.3, y: 3.35, w: 4.5, h: 1.82 });

  // Right content
  sectionLabel(s, "BLOOD SUPPLY & COMPLICATIONS", 5.0, 1.22, 4.65, C.red);
  s.addText([
    bullet("Blood supply enters DISTALLY (dorsal ridge of waist)"),
    bullet("Proximal pole receives RETROGRADE supply only"),
    bullet("Proximal pole fractures → HIGH risk of Avascular Necrosis (AVN)"),
    bullet("Non-union rate 10–15% if untreated"),
    bullet("SNAC wrist (Scaphoid Non-union Advanced Collapse) — late complication"),
  ], { x: 5.0, y: 1.58, w: 4.65, h: 1.5 });

  sectionLabel(s, "MANAGEMENT (Herbert Classification guides treatment)", 5.0, 3.14, 4.65, C.green);
  s.addText([
    bullet("Type A (stable acute): Cast immobilisation 8–12 weeks (thumb spica)"),
    bullet("Type B (unstable): ORIF with Herbert screw (headless compression screw)"),
    bullet("Type C (delayed union): ORIF ± bone graft"),
    bullet("Type D (non-union): ORIF + bone graft ± vascularised graft"),
    bullet("Proximal pole fractures: ORIF recommended even if non-displaced"),
  ], { x: 5.0, y: 3.5, w: 4.65, h: 1.6 });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 6 — OTHER CARPAL FRACTURES
// ═══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  slideBg(s, C.bg);
  topBar(s, "Other Carpal Fractures", "Lunate, Triquetrum, Hamate, Capitate, Pisiform");

  const bones = [
    {
      name: "Lunate Fracture",
      color: C.navy,
      points: [
        "Rare acute fracture — more often associated with perilunate dislocation",
        "Kienböck's disease: AVN of lunate — associated with negative ulnar variance",
        "Kienböck classification: Lichtman stages I–IV (based on MRI/X-ray)",
        "Treatment: Unloading procedures (radial shortening, ulnar lengthening), fusion or replacement in late stages",
      ]
    },
    {
      name: "Triquetrum Fracture",
      color: C.teal,
      points: [
        "2nd most common carpal fracture",
        "Dorsal chip fracture — avulsion of dorsal ligament",
        "Seen on lateral X-ray as small dorsal fragment",
        "Treatment: Short arm cast 4–6 weeks; symptomatic treatment",
      ]
    },
    {
      name: "Hook of Hamate",
      color: C.accent,
      points: [
        "Associated with racket sports, golf, baseball (bat/grip trauma)",
        "Tenderness in hypothenar eminence / carpal tunnel",
        "Diagnosis: Carpal tunnel view X-ray or CT (plain X-ray often misses it)",
        "Treatment: Cast (nonoperative) OR hook excision for symptomatic nonunion",
      ]
    },
    {
      name: "Capitate Fracture",
      color: "7D3C98",
      points: [
        "Rare; often occurs with perilunate dislocation or scaphoid fracture",
        "Scaphocapitate syndrome: scaphoid + capitate neck fractures",
        "Proximal pole at risk of AVN (retrograde blood supply)",
        "Treatment: ORIF if displaced",
      ]
    },
    {
      name: "Pisiform Fracture",
      color: C.red,
      points: [
        "Rare fracture; direct blow to hypothenar eminence",
        "Associated with hamate fracture",
        "Diagnosis may need oblique/supinated views or CT",
        "Treatment: Short arm cast; excision for painful nonunion",
      ]
    },
    {
      name: "Trapezium Fracture",
      color: "117A65",
      points: [
        "Uncommon; associated with thumb CMC dislocation",
        "Vertical split fracture most common pattern",
        "MOI: Axial loading along thumb ray",
        "Treatment: Non-displaced → cast; displaced → ORIF",
      ]
    },
  ];

  bones.forEach((b, i) => {
    const col = i % 3;
    const row = Math.floor(i / 3);
    const x = 0.25 + col * 3.25;
    const y = 1.22 + row * 2.1;
    s.addShape(pres.shapes.ROUNDED_RECTANGLE, { x, y, w: 3.1, h: 1.98, fill: { color: C.white }, line: { color: b.color, pt: 2 }, rectRadius: 0.07 });
    s.addShape(pres.shapes.RECTANGLE, { x, y, w: 3.1, h: 0.38, fill: { color: b.color }, line: { color: b.color } });
    s.addText(b.name, { x: x + 0.1, y, w: 2.9, h: 0.38, fontSize: 11.5, bold: true, color: C.white, fontFace: "Calibri", valign: "middle", margin: 0 });
    const items = b.points.map((p, pi) => ({
      text: "• " + p,
      options: { fontSize: 9.5, color: C.black, fontFace: "Calibri", breakLine: pi < b.points.length - 1 }
    }));
    s.addText(items, { x: x + 0.1, y: y + 0.42, w: 2.9, h: 1.5, valign: "top" });
  });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 7 — PERILUNATE & LUNATE DISLOCATIONS (with images)
// ═══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  slideBg(s, C.bg);
  topBar(s, "Perilunate & Lunate Dislocations", "High-energy carpal dislocations — often missed; require emergency treatment");

  // Left content
  sectionLabel(s, "PERILUNATE DISLOCATION", 0.3, 1.22, 4.5);
  s.addText([
    bullet("Capitate (and rest of carpus) dislocates DORSALLY relative to lunate"),
    bullet("Lunate remains in contact with radius"),
    bullet("PA view: overlapping carpal bones, loss of Gilula's arcs"),
    bullet("Lateral view: capitate dorsal to lunate (disrupts '3 C's sign')"),
    bullet("May be associated with scaphoid fracture → Trans-scaphoid perilunate dislocation"),
  ], { x: 0.3, y: 1.58, w: 4.5, h: 1.6 });

  sectionLabel(s, "LUNATE DISLOCATION", 0.3, 3.24, 4.5, C.red);
  s.addText([
    bullet("Lunate dislocates VOLARLY into carpal tunnel", { color: C.red }),
    bullet("'Piece of pie' sign on PA view (lunate appears triangular)", { color: C.red }),
    bullet("'Spilled teacup' sign on lateral view (lunate tilted forward)", { color: C.red }),
    bullet("Median nerve compression / acute CTS — emergency!", { color: C.red }),
    bullet("Mayfield stages: I (SL) → II (midcarpal) → III (LT) → IV (circumferential)", { color: C.red }),
  ], { x: 0.3, y: 3.6, w: 4.5, h: 1.6 });

  // Right: images
  if (imgPerilunate) {
    s.addImage({ data: imgPerilunate, x: 5.0, y: 1.2, w: 4.6, h: 2.6 });
    s.addText("Perilunate dislocation: PA view (loss of Gilula's arcs) + Lateral view (capitate dorsal to lunate)\n[Tintinalli's Emergency Medicine, Fig. 269-8]",
      { x: 5.0, y: 3.82, w: 4.6, h: 0.6, fontSize: 8.5, color: C.dgray, fontFace: "Calibri", italic: true, align: "center" });
  }

  // Management note
  s.addShape(pres.shapes.RECTANGLE, { x: 0.3, y: 5.05, w: 9.35, h: 0.15, fill: { color: C.red }, line: { color: C.red } });
  s.addShape(pres.shapes.RECTANGLE, { x: 0.3, y: 5.2, w: 9.35, h: 0.0, fill: { color: C.red }, line: { color: C.red } });
  // Covered by footer
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 8 — LIGAMENTOUS INJURIES & CARPAL INSTABILITY
// ═══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  slideBg(s, C.bg);
  topBar(s, "Ligamentous Injuries & Carpal Instability", "Scapholunate and lunotriquetral tears — common, frequently missed");

  // Left
  sectionLabel(s, "SCAPHOLUNATE (SL) LIGAMENT TEAR", 0.3, 1.22, 4.55);
  s.addText([
    bullet("Most common carpal ligament injury"),
    bullet("MOI: FOOSH — forced extension + ulnar deviation"),
    bullet("Signs: Radial-sided wrist pain; Watson's (scaphoid shift) test positive"),
    bullet("X-ray: SL gap > 3 mm ('Terry-Thomas sign'); SL angle > 70° (DISI)"),
    bullet("Grade I–II: Arthroscopic debridement / imbrication"),
    bullet("Grade III (complete tear): Open repair or reconstruction + K-wire fixation"),
    bullet("Untreated → SLAC wrist (Scapholunate Advanced Collapse)"),
  ], { x: 0.3, y: 1.58, w: 4.55, h: 2.5 });

  sectionLabel(s, "LUNOTRIQUETRAL (LT) LIGAMENT TEAR", 0.3, 4.16, 4.55, C.accent);
  s.addText([
    bullet("Less common; ulnar-sided wrist pain"),
    bullet("X-ray: VISI pattern (decreased SL angle or increased LT angle)"),
    bullet("Reagan's ballottement test / Kleinman's shear test positive"),
    bullet("Treatment: Similar to SL — arthroscopy, repair, or reconstruction"),
  ], { x: 0.3, y: 4.5, w: 4.55, h: 0.92 });

  // Right
  sectionLabel(s, "CARPAL INSTABILITY CLASSIFICATION", 5.05, 1.22, 4.6, C.teal);
  const instRows = [
    ["CID", "Carpal Instability Dissociative", "Same carpal row (e.g., DISI, VISI)"],
    ["CIND", "Carpal Instability Non-Dissociative", "Different rows (midcarpal, radiocarpal)"],
    ["CIA", "Carpal Instability Adaptive", "Malunited distal radius fracture"],
    ["CIC", "Carpal Instability Complex", "Perilunate dislocation (multi-level)"],
  ];
  instRows.forEach(([abbr, full, example], i) => {
    const y = 1.6 + i * 0.65;
    const bg = i % 2 === 0 ? "EAF2FF" : C.white;
    s.addShape(pres.shapes.RECTANGLE, { x: 5.05, y, w: 4.6, h: 0.62, fill: { color: bg }, line: { color: C.mgray, pt: 0.5 } });
    s.addText(abbr, { x: 5.12, y, w: 0.7, h: 0.62, fontSize: 12, bold: true, color: C.teal, fontFace: "Calibri", valign: "middle" });
    s.addText(full, { x: 5.85, y, w: 2.0, h: 0.62, fontSize: 9.5, bold: true, color: C.navy, fontFace: "Calibri", valign: "middle" });
    s.addText(example, { x: 7.88, y, w: 1.72, h: 0.62, fontSize: 9, color: C.dgray, fontFace: "Calibri", valign: "middle" });
  });

  sectionLabel(s, "TFCC INJURY", 5.05, 4.3, 4.6, C.red);
  s.addText([
    bullet("Triangular fibrocartilage complex — primary DRUJ stabiliser"),
    bullet("MOI: Axial load + rotation / forced ulnar deviation"),
    bullet("Palmer classification: Type 1 (traumatic) most relevant"),
    bullet("Clinical: Ulnar-sided pain, positive ulnar grind test, DRUJ instability"),
    bullet("Treatment: Arthroscopic debridement (partial tears), repair (complete)"),
  ], { x: 5.05, y: 4.65, w: 4.6, h: 0.72 });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 9 — GALEAZZI FRACTURE-DISLOCATION (with image)
// ═══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  slideBg(s, C.bg);
  topBar(s, "Galeazzi Fracture-Dislocation", "'Fracture of Necessity' — operative treatment is mandatory");

  // Left content
  sectionLabel(s, "DEFINITION & MECHANISM", 0.3, 1.22, 4.5);
  s.addText([
    bullet("Fracture of distal 1/3 of radius + disruption of DRUJ"),
    bullet("MOI: Axial loading of forearm in pronation (fall on outstretched hand)"),
    bullet("Direction-based classification (Campbell's):"),
    subbullet("Type I (apex volar): forearm in supination — dorsal ulnar dislocation"),
    subbullet("Type II (apex dorsal): forearm in pronation — volar ulnar dislocation"),
    bullet("DRUJ disruption in ~95% of cases — must be assessed critically"),
  ], { x: 0.3, y: 1.58, w: 4.5, h: 2.0 });

  sectionLabel(s, "DIAGNOSIS", 0.3, 3.65, 4.5, C.accent);
  s.addText([
    bullet("X-ray: Distal radial fracture + ulnar head prominent on lateral"),
    bullet("DRUJ disruption: ulnar styloid fracture at base, DRUJ widening"),
    bullet("Ulnar variance > 5 mm suggests DRUJ disruption"),
    bullet("CT scan useful for complex DRUJ assessment"),
  ], { x: 0.3, y: 4.0, w: 4.5, h: 1.0 });

  // Right: management + image
  sectionLabel(s, "MANAGEMENT", 5.05, 1.22, 4.6, C.teal);
  s.addText([
    bullet("Operative treatment is MANDATORY ('fracture of necessity')"),
    bullet("Step 1: ORIF of radius with 3.5mm DCP/LC-DCP plate"),
    bullet("Step 2: Check DRUJ stability after radius fixation"),
    subbullet("If stable → immobilise in supination 4–6 weeks"),
    subbullet("If unstable → transverse K-wire across DRUJ OR repair TFCC"),
    bullet("Closed treatment → unacceptably high re-displacement rate"),
  ], { x: 5.05, y: 1.58, w: 4.6, h: 1.8 });

  if (imgGaleazzi) {
    s.addImage({ data: imgGaleazzi, x: 5.05, y: 3.45, w: 4.6, h: 1.6 });
    s.addText("Galeazzi fracture-dislocation with ORIF using 3.5mm AO DCP plate [Campbell's Operative Orthopaedics 15th Ed, Fig. 62.88]",
      { x: 5.05, y: 5.05, w: 4.6, h: 0.2, fontSize: 7.5, color: C.dgray, fontFace: "Calibri", italic: true, align: "center" });
  }
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 10 — EMERGENCY ASSESSMENT & MANAGEMENT PRINCIPLES
// ═══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  slideBg(s, C.bg);
  topBar(s, "Emergency Assessment & General Management Principles", "Systematic approach to all wrist trauma presentations");

  // Left
  sectionLabel(s, "INITIAL ASSESSMENT", 0.3, 1.22, 4.55);
  s.addText([
    bullet("History: MOI (FOOSH vs. direct blow), dominant hand, occupation, age"),
    bullet("Neurovascular exam: Median, ulnar, radial nerve; radial artery (Allen's test)"),
    bullet("Inspect for deformity, swelling, bruising, open wounds"),
    bullet("Palpate systematically: Radial styloid → Anatomical snuffbox → SL interval → Ulnar styloid → DRUJ → Carpal bones"),
    bullet("Active/passive ROM: Flexion, extension, RD/UD, supination/pronation"),
    bullet("Special tests: Watson's, Grind, Shear, Piano key (DRUJ instability)"),
  ], { x: 0.3, y: 1.58, w: 4.55, h: 2.35 });

  sectionLabel(s, "IMAGING", 0.3, 4.0, 4.55, C.accent);
  s.addText([
    bullet("Standard: PA (neutral rotation), Lateral, Oblique"),
    bullet("Scaphoid views: PA in ulnar deviation"),
    bullet("CT: Complex intra-articular fractures, suspected carpal fractures"),
    bullet("MRI: Occult fractures, ligament injuries, AVN, TFCC"),
    bullet("Fluoroscopy: Dynamic instability assessment intraoperatively"),
  ], { x: 0.3, y: 4.35, w: 4.55, h: 0.9 });

  // Right
  sectionLabel(s, "MANAGEMENT OVERVIEW", 5.05, 1.22, 4.6, C.teal);
  const mgmt = [
    ["Stable fractures", "Closed reduction + cast immobilisation\nRepeat X-ray at 1, 2 weeks"],
    ["Unstable fractures", "Percutaneous K-wires or ORIF\n(volar locking plate)"],
    ["Scaphoid (non-displaced)", "Thumb spica cast 8–12 wks\nConsider early ORIF (return to sport)"],
    ["Scaphoid (displaced)", "ORIF with headless compression screw"],
    ["Perilunate / Lunate", "Emergency reduction; ORIF + ligament repair"],
    ["Open fractures", "Debridement + antibiotics + fixation"],
    ["Neurovascular compromise", "Emergency reduction + surgical decompression"],
  ];
  mgmt.forEach(([cond, tx], i) => {
    const y = 1.58 + i * 0.52;
    const bg = i % 2 === 0 ? "EAF2FF" : C.white;
    s.addShape(pres.shapes.RECTANGLE, { x: 5.05, y, w: 4.6, h: 0.5, fill: { color: bg }, line: { color: C.mgray, pt: 0.5 } });
    s.addText(cond, { x: 5.12, y, w: 1.8, h: 0.5, fontSize: 9.5, bold: true, color: C.navy, fontFace: "Calibri", valign: "middle" });
    s.addText(tx, { x: 6.95, y, w: 2.65, h: 0.5, fontSize: 9, color: C.dgray, fontFace: "Calibri", valign: "middle" });
  });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 11 — COMPLICATIONS
// ═══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  slideBg(s, C.bg);
  topBar(s, "Complications of Wrist Trauma", "Early recognition and treatment prevents long-term disability");

  const comps = [
    { title: "Malunion", color: C.red,
      points: ["Distal radius: Dorsal angulation, radial shortening, altered kinematics", "SNAC/SLAC wrist from chronic instability", "Corrective osteotomy if symptomatic"] },
    { title: "Non-union", color: "8E44AD",
      points: ["Scaphoid: High risk in proximal pole fractures (AVN)", "Hamate hook: Tenderness; treated by excision", "Bone graft ± vascularised graft for scaphoid"] },
    { title: "Avascular Necrosis", color: "C0392B",
      points: ["Scaphoid proximal pole: Most common", "Lunate: Kienböck's disease (stages I–IV)", "Capitate: Associated with scaphocapitate syndrome"] },
    { title: "Carpal Instability", color: C.navy,
      points: ["SLAC wrist: Chronic SL tear → arthritis", "SNAC wrist: Scaphoid nonunion → arthritis", "Perilunate instability → early OA if untreated"] },
    { title: "Nerve Injury", color: C.teal,
      points: ["Acute CTS: Lunate dislocation compresses median nerve", "Ulnar nerve: Hook of hamate fracture", "Radial nerve: Rare; iatrogenic during surgery"] },
    { title: "Tendon & Stiffness", color: "117A65",
      points: ["EPL rupture: Occurs after undisplaced distal radius fractures", "Complex regional pain syndrome (CRPS Type I)", "Joint stiffness: Prolonged immobilisation → aggressive PT"] },
  ];

  comps.forEach((c, i) => {
    const col = i % 3;
    const row = Math.floor(i / 3);
    const x = 0.25 + col * 3.25;
    const y = 1.22 + row * 2.05;
    s.addShape(pres.shapes.ROUNDED_RECTANGLE, { x, y, w: 3.1, h: 1.92, fill: { color: C.white }, line: { color: c.color, pt: 1.8 }, rectRadius: 0.07 });
    s.addShape(pres.shapes.RECTANGLE, { x, y, w: 3.1, h: 0.36, fill: { color: c.color }, line: { color: c.color } });
    s.addText(c.title, { x: x + 0.1, y, w: 2.9, h: 0.36, fontSize: 11.5, bold: true, color: C.white, fontFace: "Calibri", valign: "middle", margin: 0 });
    const items = c.points.map((p, pi) => ({
      text: "• " + p,
      options: { fontSize: 9.5, color: C.black, fontFace: "Calibri", breakLine: pi < c.points.length - 1 }
    }));
    s.addText(items, { x: x + 0.1, y: y + 0.4, w: 2.9, h: 1.45, valign: "top" });
  });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 12 — SUMMARY & REFERENCES
// ═══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  slideBg(s, C.navy);
  s.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: "100%", h: 0.18, fill: { color: C.teal }, line: { color: C.teal } });
  s.addShape(pres.shapes.RECTANGLE, { x: 0, y: 5.45, w: "100%", h: 0.175, fill: { color: C.teal }, line: { color: C.teal } });

  s.addText("SUMMARY & KEY TAKEAWAYS", {
    x: 0.5, y: 0.22, w: 9, h: 0.7, fontSize: 22, bold: true, color: C.white,
    fontFace: "Calibri", align: "center", charSpacing: 2
  });
  s.addShape(pres.shapes.RECTANGLE, { x: 2.5, y: 0.95, w: 5, h: 0.04, fill: { color: C.teal }, line: { color: C.teal } });

  const takeaways = [
    ["Distal radius fractures", "Most common wrist fracture. Assess for instability (angulation >20°, comminution, intra-articular, age >60). Volar locking plate is gold standard for unstable fractures."],
    ["Scaphoid fractures", "Tenderness in anatomical snuffbox = scaphoid fracture until proven otherwise. MRI if X-ray negative. ORIF even for non-displaced proximal pole fractures."],
    ["Perilunate / Lunate dislocations", "High-energy injury — often missed. 'Spilled teacup' = lunate dislocation (emergency!). Open ORIF + ligament repair in most cases."],
    ["Carpal instability", "DISI most common (SL tear). Mayfield stages describe progressive carpal disruption. SL gap >3mm + SL angle >70° diagnostic."],
    ["Galeazzi fracture", "'Fracture of necessity' — ORIF is mandatory. Always assess DRUJ stability after radius fixation."],
    ["Complications", "AVN (scaphoid, lunate), non-union, SLAC/SNAC wrist, acute CTS (lunate dislocation), EPL rupture, CRPS."],
  ];

  takeaways.forEach(([heading, text], i) => {
    const y = 1.1 + i * 0.7;
    s.addShape(pres.shapes.ROUNDED_RECTANGLE, { x: 0.3, y, w: 9.4, h: 0.65, fill: { color: "1E3F6E" }, line: { color: C.teal, pt: 1 }, rectRadius: 0.06 });
    s.addText(heading + ": ", { x: 0.45, y, w: 2.2, h: 0.65, fontSize: 10.5, bold: true, color: C.ltblue, fontFace: "Calibri", valign: "middle" });
    s.addText(text, { x: 2.6, y, w: 7.0, h: 0.65, fontSize: 10, color: C.white, fontFace: "Calibri", valign: "middle" });
  });

  s.addText("References: Campbell's Operative Orthopaedics 15th Ed (2026) · Rosen's Emergency Medicine 9th Ed · Tintinalli's Emergency Medicine · Rockwood & Green's Fractures in Adults 10th Ed (2025) · Miller's Review of Orthopaedics 9th Ed",
    { x: 0.3, y: 5.12, w: 9.4, h: 0.28, fontSize: 7.5, color: "7FB3D3", fontFace: "Calibri", align: "center" });
}

// ── Write file ────────────────────────────────────────────────────────────────
const OUTPUT = "/home/daytona/workspace/wrist-trauma-ppt/Wrist_Trauma.pptx";
pres.writeFile({ fileName: OUTPUT })
  .then(() => console.log("PPT created: " + OUTPUT))
  .catch(e => { console.error(e); process.exit(1); });
Running Command

cd /home/daytona/workspace/wrist-trauma-ppt && node build.js 2>&1

Running Command

mkdir -p /home/daytona/workspace/wrist-trauma-ppt/imgs && \ curl -s "https://cdn…

Editing File

~/wrist-trauma-ppt/build.js

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/wrist-trauma-ppt/build.js'
Editing File

~/wrist-trauma-ppt/build.js

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/wrist-trauma-ppt/build.js'
Editing File

~/wrist-trauma-ppt/build.js

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/wrist-trauma-ppt/build.js'
Editing File

~/wrist-trauma-ppt/build.js

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/wrist-trauma-ppt/build.js'
Running Command

cd /home/daytona/workspace/wrist-trauma-ppt && node build.js 2>&1

Running Command

ls -lh /home/daytona/workspace/wrist-trauma-ppt/Wrist_Trauma.pptx

Your presentation is ready — 2.4 MB, 12 slides:

Wrist Trauma

Presentation · PPTX


Slide-by-Slide Breakdown

#SlideContent
1CoverTitle, subtitle, 6 topic badges (navy/teal theme)
2AnatomyBony anatomy, key ligaments (SL, LT, TFCC), biomechanical pearl about scaphoid bridging
3Distal Radius — Classification6 named fracture types: Colles', Smith's, Barton's, Chauffeur's, Die-Punch, Galeazzi — each in a colour-coded card
4Distal Radius — Stability & Management5 instability criteria, normal radiographic parameters, management pathway table
5Scaphoid FracturesEpidemiology, clinical features (snuffbox test), blood supply & AVN risk, Herbert classification + treatment
6Other Carpal FracturesLunate (Kienböck's), Triquetrum, Hook of Hamate, Capitate, Pisiform, Trapezium
7Perilunate & Lunate DislocationsMayfield stages, "piece of pie" sign, "spilled teacup" sign — with textbook X-ray image
8Ligamentous Injuries & Carpal InstabilitySL/LT ligament tears, Watson's test, SLAC/SNAC wrist, CID/CIND/CIA/CIC classification, TFCC injury
9Galeazzi Fracture-Dislocation"Fracture of necessity", Type I/II, ORIF mandatory — with post-fixation X-ray image
10Emergency Assessment & ManagementSystematic palpation, imaging algorithm (X-ray/CT/MRI), management table for all fracture types
11ComplicationsAVN, non-union, SLAC/SNAC, carpal instability, nerve injury, EPL rupture, CRPS
12Summary & References6 key takeaways on dark background, full reference list
This is a shared conversation. Sign in to Orris to start your own chat.