Great a pot on deformities of shoulder and upper limb

Asking for Preferences
Reading File
Reading File
Reading File
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Reading File
Finding Sources
Searching Images

Sprengel deformity shoulder scapula elevation

Finding Sources
Searching Images

Erb palsy waiter's tip deformity brachial plexus

Searching Images

Madelung deformity wrist forearm radiology

Searching Images

cubitus valgus cubitus varus elbow deformity

Reading File
Running Command

mkdir -p /home/daytona/workspace/shoulder-deformities-ppt && ls /home/daytona/workspace/shoulder-deformities-ppt/

Writing File

~/shoulder-deformities-ppt/create_ppt.js

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

const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Deformities of the Shoulder and Upper Limb";
pres.author = "Orthopaedics Education";

// ── COLOR PALETTE ──────────────────────────────────────────────
const C = {
  navy:    "0D2B4E",   // dominant dark
  teal:    "1E6A7A",   // supporting
  gold:    "D4A017",   // accent
  white:   "FFFFFF",
  lightBg: "EAF3F6",
  slate:   "4A6278",
  offW:    "F4F8FA",
};

// ── HELPER FUNCTIONS ────────────────────────────────────────────
function fetchImagesBase64(urls) {
  try {
    const result = execSync(
      `node /home/daytona/skills/shared/scripts/fetch_images.js ${urls.map(u => `"${u}"`).join(" ")}`,
      { timeout: 30000 }
    ).toString();
    return JSON.parse(result);
  } catch (e) {
    return urls.map(() => ({ base64: null, error: e.message }));
  }
}

function addTitleSlide(pres) {
  const slide = pres.addSlide();
  // Background
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.navy } });
  // Teal accent bar
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 4.2, w: 10, h: 0.08, fill: { color: C.teal } });
  // Gold vertical stripe
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.18, h: 5.625, fill: { color: C.gold } });

  slide.addText("Deformities of the", {
    x: 0.4, y: 1.0, w: 9.2, h: 0.7,
    fontSize: 32, bold: false, color: C.gold,
    fontFace: "Calibri", align: "center",
  });
  slide.addText("Shoulder & Upper Limb", {
    x: 0.4, y: 1.65, w: 9.2, h: 0.9,
    fontSize: 44, bold: true, color: C.white,
    fontFace: "Calibri", align: "center",
  });
  slide.addText("Congenital, Developmental & Acquired", {
    x: 0.4, y: 2.75, w: 9.2, h: 0.5,
    fontSize: 20, color: "A8C8D8",
    fontFace: "Calibri", align: "center", italic: true,
  });
  slide.addText("Orthopaedics  |  Paediatrics  |  Neurology", {
    x: 0.4, y: 4.4, w: 9.2, h: 0.4,
    fontSize: 14, color: "A8C8D8",
    fontFace: "Calibri", align: "center",
  });
}

function sectionDivider(pres, number, title, subtitle) {
  const slide = pres.addSlide();
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.teal } });
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.12, fill: { color: C.gold } });
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 5.5, w: 10, h: 0.12, fill: { color: C.gold } });

  slide.addText(number, {
    x: 0.5, y: 1.2, w: 9, h: 1.1,
    fontSize: 72, bold: true, color: "FFFFFF20",
    fontFace: "Calibri", align: "center",
  });
  slide.addText(title, {
    x: 0.5, y: 1.7, w: 9, h: 1.0,
    fontSize: 40, bold: true, color: C.white,
    fontFace: "Calibri", align: "center",
  });
  if (subtitle) {
    slide.addText(subtitle, {
      x: 0.5, y: 2.85, w: 9, h: 0.6,
      fontSize: 20, color: "D0EBF0",
      fontFace: "Calibri", align: "center", italic: true,
    });
  }
}

function slideHeader(slide, title, pres) {
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.72, fill: { color: C.navy } });
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0.72, w: 10, h: 0.06, fill: { color: C.gold } });
  slide.addText(title, {
    x: 0.3, y: 0, w: 9.4, h: 0.72, margin: 0,
    fontSize: 22, bold: true, color: C.white,
    fontFace: "Calibri", valign: "middle",
  });
}

function bullets(items) {
  return items.map((t, i) => ({
    text: t,
    options: { bullet: { code: "25CF", indent: 15 }, fontSize: 16, color: C.navy, fontFace: "Calibri", breakLine: i < items.length - 1 },
  }));
}

function subBullets(items, color) {
  return items.map((t, i) => ({
    text: t,
    options: { bullet: { code: "2013", indent: 30 }, fontSize: 14, color: color || C.slate, fontFace: "Calibri", breakLine: i < items.length - 1 },
  }));
}

function addLabelBox(slide, x, y, w, h, label, value, pres) {
  slide.addShape(pres.ShapeType.rect, { x, y, w, h, fill: { color: C.lightBg }, line: { color: C.teal, width: 1.5 } });
  slide.addText([
    { text: label + "\n", options: { bold: true, fontSize: 12, color: C.teal, fontFace: "Calibri" } },
    { text: value, options: { fontSize: 13, color: C.navy, fontFace: "Calibri" } },
  ], { x, y, w, h, margin: 8, valign: "middle" });
}

// ── IMAGE FETCHING ──────────────────────────────────────────────
const imgUrls = [
  "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_fb6f90f724fc346bd0c1d9a8cf427d145eebead2e2481167f4ed680d678194f8.jpg", // Sprengel
  "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_80408838d023a8a3c52b0e346277bf46cbd506df950646b4541c92c462d86dc2.jpg", // Erb waiter's tip
  "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_3329325bb31850a33f60190ff172f8fc9689a091a184e51de809d97f8c38ff1e.jpg", // cubitus varus
  "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_f7be9f89342b4058a005fa3737c00a17ca9a2f9264eaed48e5ac20ec5d2832d0.jpg", // cubitus valgus
  "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_1cda6423c45f7fa80d26fccd68c164aad7581ee4ae128f4e7c3bb16cfb59bd22.jpg", // Madelung clinical
  "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_e4b4eecee9c0c9848f534ade8453747b5bd5a44cf527ccdc5213f9338e26f56c.jpg", // Madelung xray
  "https://cdn.orris.care/cdss_images/9cc397c158f20cf91592b51a52365dca97089ec937233840a52cb4fb2221b3a7.png",  // brachial plexus diagram
];

console.log("Fetching images...");
const imgs = fetchImagesBase64(imgUrls);
const [sprengel_img, erb_img, cubvarus_img, cubvalgus_img, madelungClin_img, madelungXray_img, plexusDiag_img] = imgs;
console.log("Images fetched:", imgs.map(i => i.error ? "ERROR: "+i.error : "OK"));

// ── SLIDE 1: TITLE ──────────────────────────────────────────────
addTitleSlide(pres);

// ── SLIDE 2: OVERVIEW ──────────────────────────────────────────
{
  const slide = pres.addSlide();
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.offW } });
  slideHeader(slide, "Overview — Classification of Upper Limb Deformities", pres);

  const cats = [
    { label: "Shoulder", color: C.navy, items: ["Sprengel deformity", "Brachial plexus palsy", "Shoulder dislocation deformity", "Pseudarthrosis of clavicle", "Fibrotic deltoid"] },
    { label: "Elbow", color: C.teal, items: ["Cubitus valgus", "Cubitus varus (gunstock)", "Pulled elbow", "Traumatic elbow deformities"] },
    { label: "Forearm & Wrist", color: "#B5651D", items: ["Madelung deformity", "Radial club hand", "Radioulnar synostosis"] },
    { label: "Hand", color: "#6A0572", items: ["Syndactyly", "Polydactyly", "Camptodactyly", "Clinodactyly", "Ectrodactyly"] },
  ];

  cats.forEach((cat, i) => {
    const x = 0.25 + i * 2.42;
    slide.addShape(pres.ShapeType.rect, { x, y: 0.95, w: 2.25, h: 0.42, fill: { color: cat.color }, radius: 3 });
    slide.addText(cat.label, { x, y: 0.95, w: 2.25, h: 0.42, fontSize: 15, bold: true, color: C.white, fontFace: "Calibri", align: "center", valign: "middle", margin: 0 });
    slide.addShape(pres.ShapeType.rect, { x, y: 1.4, w: 2.25, h: 3.8, fill: { color: C.white }, line: { color: cat.color, width: 1.5 } });
    const textItems = cat.items.map((t, j) => ({
      text: "• " + t,
      options: { fontSize: 13, color: C.navy, fontFace: "Calibri", breakLine: j < cat.items.length - 1 },
    }));
    slide.addText(textItems, { x: x + 0.1, y: 1.5, w: 2.05, h: 3.6, margin: 4, valign: "top" });
  });
}

// ── SECTION 1 DIVIDER ──────────────────────────────────────────
sectionDivider(pres, "01", "Shoulder Deformities", "Congenital & Developmental");

// ── SLIDE 3: SPRENGEL DEFORMITY ────────────────────────────────
{
  const slide = pres.addSlide();
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.offW } });
  slideHeader(slide, "Sprengel Deformity (Congenital Elevation of the Scapula)", pres);

  slide.addText([
    ...bullets(["Most common congenital anomaly of the shoulder in children", "Failure of scapula to descend from mid-cervical → mid-thoracic position (6th–8th week)"]),
  ], { x: 0.3, y: 0.9, w: 5.8, h: 1.4, valign: "top" });

  // Boxes
  addLabelBox(slide, 0.3, 2.3, 2.6, 1.2, "Clinical Features", "Elevated, small, wide scapula\nMedial rotation\nWinging of scapula\nRestricted abduction", pres);
  addLabelBox(slide, 3.05, 2.3, 2.6, 1.2, "Associations", "Klippel-Feil syndrome (1/3)\nScoliosis\nKidney disease\nDiastematomyelia", pres);
  addLabelBox(slide, 0.3, 3.65, 5.35, 1.1, "Treatment", "Woodward procedure (distal muscle advancement)\nSchrock / Green procedures (scapular movement)\nClavicular osteotomy if BPI risk — Best age: 3–8 years", pres);

  if (sprengel_img && !sprengel_img.error) {
    slide.addImage({ data: sprengel_img.base64, x: 5.9, y: 0.9, w: 3.8, h: 4.3, sizing: { type: "contain" } });
  }
  slide.addText("Sprengel deformity: elevated left scapula", {
    x: 5.9, y: 5.1, w: 3.8, h: 0.3, fontSize: 10, italic: true, color: C.slate, align: "center", fontFace: "Calibri",
  });
}

// ── SLIDE 4: BRACHIAL PLEXUS PALSY ─────────────────────────────
{
  const slide = pres.addSlide();
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.offW } });
  slideHeader(slide, "Brachial Plexus Palsy (Obstetric)", pres);

  // Table
  const tableData = [
    [
      { text: "Type", options: { bold: true, color: C.white, fill: C.navy, fontFace: "Calibri", fontSize: 14 } },
      { text: "Roots", options: { bold: true, color: C.white, fill: C.navy, fontFace: "Calibri", fontSize: 14 } },
      { text: "Deficit / Deformity", options: { bold: true, color: C.white, fill: C.navy, fontFace: "Calibri", fontSize: 14 } },
      { text: "Prognosis", options: { bold: true, color: C.white, fill: C.navy, fontFace: "Calibri", fontSize: 14 } },
    ],
    [
      { text: "Erb-Duchenne (most common)", options: { fontFace: "Calibri", fontSize: 13 } },
      { text: "C5, C6", options: { fontFace: "Calibri", fontSize: 13 } },
      { text: "Waiter's tip: shoulder adducted + IR, elbow extended, wrist flexed", options: { fontFace: "Calibri", fontSize: 12 } },
      { text: "Best", options: { color: "1A7A1A", bold: true, fontFace: "Calibri", fontSize: 13 } },
    ],
    [
      { text: "Klumpke", options: { fontFace: "Calibri", fontSize: 13 } },
      { text: "C8, T1", options: { fontFace: "Calibri", fontSize: 13 } },
      { text: "Claw hand, intrinsic weakness; Horner syndrome", options: { fontFace: "Calibri", fontSize: 12 } },
      { text: "Poor", options: { color: "CC3300", bold: true, fontFace: "Calibri", fontSize: 13 } },
    ],
    [
      { text: "Total Plexus Palsy", options: { fontFace: "Calibri", fontSize: 13 } },
      { text: "C5–T1", options: { fontFace: "Calibri", fontSize: 13 } },
      { text: "Flaccid arm, complete sensorimotor loss", options: { fontFace: "Calibri", fontSize: 12 } },
      { text: "Worst", options: { color: "CC3300", bold: true, fontFace: "Calibri", fontSize: 13 } },
    ],
  ];
  slide.addTable(tableData, { x: 0.3, y: 0.9, w: 5.6, h: 2.2, colW: [1.8, 0.7, 2.2, 0.9], border: { color: "CCDDEE", pt: 1 }, fill: "FAFCFF" });

  slide.addText("Causes: shoulder dystocia, large neonate, forceps/breech delivery", {
    x: 0.3, y: 3.18, w: 5.6, h: 0.3, fontSize: 13, color: C.slate, italic: true, fontFace: "Calibri",
  });

  slide.addText("Treatment", { x: 0.3, y: 3.55, w: 5.6, h: 0.3, fontSize: 15, bold: true, color: C.navy, fontFace: "Calibri" });
  slide.addText([
    ...bullets([
      ">90% resolve without intervention — passive ROM therapy key",
      "Lack of biceps at 6 months = poor prognosis",
      "Microsurgical nerve grafting / neurolysis (early)",
      "L'Episcopo procedure (latissimus/teres major transfer) for shoulder ER",
      "Proximal humerus rotational osteotomy (>5 yrs) for IR contracture",
    ])
  ], { x: 0.3, y: 3.9, w: 5.6, h: 1.5, valign: "top" });

  if (erb_img && !erb_img.error) {
    slide.addImage({ data: erb_img.base64, x: 6.1, y: 0.9, w: 3.6, h: 3.5, sizing: { type: "contain" } });
  }
  slide.addText("Erb's palsy: waiter's tip posture", {
    x: 6.1, y: 4.45, w: 3.6, h: 0.3, fontSize: 10, italic: true, color: C.slate, align: "center", fontFace: "Calibri",
  });

  if (plexusDiag_img && !plexusDiag_img.error) {
    slide.addImage({ data: plexusDiag_img.base64, x: 6.1, y: 4.8, w: 3.6, h: 0.7, sizing: { type: "contain" } });
  }
}

// ── SLIDE 5: SHOULDER DISLOCATION DEFORMITIES ──────────────────
{
  const slide = pres.addSlide();
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.offW } });
  slideHeader(slide, "Shoulder Dislocation & Associated Deformities", pres);

  const boxes = [
    { x: 0.3, label: "Anterior Dislocation (95%)", color: C.navy,
      lines: ["Loss of normal deltoid contour ("squared" shoulder)", "Arm held in slight abduction/ER", "Sulcus sign (inferior)", "Bankart lesion (labral tear)", "Hill-Sachs lesion (humeral head compression)"] },
    { x: 3.55, label: "Posterior Dislocation (rare)", color: C.teal,
      lines: ["Often missed — may lack obvious deformity", "Arm fixed in adduction + IR", "Loss of anterior fullness", "\"Reverse\" Hill-Sachs / McLaughlin lesion", "Associated with seizures, electrocution"] },
    { x: 6.8, label: "Chronic/Recurrent", color: "#6B2D8B",
      lines: ["Voluntary/involuntary recurrence", "Anterior labral/capsular laxity", "Rotator cuff tear deformity", "Shoulder asymmetry", "Bankart repair / Latarjet procedure"] },
  ];

  boxes.forEach(b => {
    slide.addShape(pres.ShapeType.rect, { x: b.x, y: 0.9, w: 3.0, h: 0.45, fill: { color: b.color }, radius: 3 });
    slide.addText(b.label, { x: b.x, y: 0.9, w: 3.0, h: 0.45, fontSize: 13, bold: true, color: C.white, fontFace: "Calibri", align: "center", valign: "middle", margin: 0 });
    slide.addShape(pres.ShapeType.rect, { x: b.x, y: 1.38, w: 3.0, h: 3.9, fill: { color: C.white }, line: { color: b.color, width: 1.5 } });
    b.lines.forEach((line, j) => {
      slide.addText([{ text: "• " + line, options: { fontSize: 13, color: C.navy, fontFace: "Calibri" } }],
        { x: b.x + 0.1, y: 1.5 + j * 0.68, w: 2.8, h: 0.6 });
    });
  });

  slide.addText("Always obtain AP + axillary lateral radiographs. CT for occult posterior dislocation.", {
    x: 0.3, y: 5.22, w: 9.4, h: 0.3, fontSize: 12, italic: true, color: C.slate, fontFace: "Calibri",
  });
}

// ── SLIDE 6: OTHER SHOULDER ─────────────────────────────────────
{
  const slide = pres.addSlide();
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.offW } });
  slideHeader(slide, "Other Congenital Shoulder Deformities", pres);

  slide.addText("Congenital Pseudarthrosis of the Clavicle", {
    x: 0.3, y: 0.9, w: 9.4, h: 0.38, fontSize: 17, bold: true, color: C.teal, fontFace: "Calibri",
  });
  slide.addText([
    ...bullets([
      "Failure of union of medial & lateral ossification centres — almost always RIGHT clavicle",
      "Non-painful swelling over mid-clavicle in neonate; no overlying skin discolouration",
      "Distinguish from birth fracture (callus absent, no overlying ecchymosis)",
      "Treatment: surgical stabilisation & bone graft if symptomatic (usually cosmetic indication)",
    ])
  ], { x: 0.3, y: 1.35, w: 9.4, h: 1.5, valign: "top" });

  slide.addShape(pres.ShapeType.line, { x: 0.3, y: 2.95, w: 9.4, h: 0, line: { color: C.teal, width: 1, dashType: "dash" } });

  slide.addText("Fibrotic Deltoid / Deltoid Contracture", {
    x: 0.3, y: 3.05, w: 9.4, h: 0.38, fontSize: 17, bold: true, color: C.teal, fontFace: "Calibri",
  });
  slide.addText([
    ...bullets([
      "Short fibrous bands replace deltoid muscle tissue → abduction contractures at shoulder",
      "Scapular elevation and winging when arms are adducted",
      "Cause: repeated IM injections into deltoid in infancy (commonest cause in developing countries)",
      "Treatment: surgical resection of fibrotic bands",
    ])
  ], { x: 0.3, y: 3.5, w: 9.4, h: 1.5, valign: "top" });
}

// ── SECTION 2 DIVIDER ──────────────────────────────────────────
sectionDivider(pres, "02", "Elbow Deformities", "Cubitus Valgus, Cubitus Varus & More");

// ── SLIDE 7: CUBITUS VALGUS & VARUS ────────────────────────────
{
  const slide = pres.addSlide();
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.offW } });
  slideHeader(slide, "Cubitus Valgus vs Cubitus Varus (Gunstock Deformity)", pres);

  // Cubitus Valgus
  slide.addShape(pres.ShapeType.rect, { x: 0.3, y: 0.9, w: 4.4, h: 0.42, fill: { color: C.teal } });
  slide.addText("Cubitus Valgus", { x: 0.3, y: 0.9, w: 4.4, h: 0.42, fontSize: 16, bold: true, color: C.white, fontFace: "Calibri", align: "center", valign: "middle", margin: 0 });
  slide.addShape(pres.ShapeType.rect, { x: 0.3, y: 1.35, w: 4.4, h: 2.5, fill: { color: C.white }, line: { color: C.teal, width: 1.5 } });
  slide.addText([
    ...bullets(["Increased carrying angle (>15° in males, >20° in females)", "Commonest cause: malunited lateral condyle fracture", "Tardy ulnar nerve palsy (late complication)", "Treatment: corrective osteotomy + ulnar nerve transposition if neuropathy"])
  ], { x: 0.45, y: 1.45, w: 4.1, h: 2.3, valign: "top" });

  // Cubitus Varus
  slide.addShape(pres.ShapeType.rect, { x: 5.2, y: 0.9, w: 4.4, h: 0.42, fill: { color: C.navy } });
  slide.addText("Cubitus Varus (Gunstock)", { x: 5.2, y: 0.9, w: 4.4, h: 0.42, fontSize: 16, bold: true, color: C.white, fontFace: "Calibri", align: "center", valign: "middle", margin: 0 });
  slide.addShape(pres.ShapeType.rect, { x: 5.2, y: 1.35, w: 4.4, h: 2.5, fill: { color: C.white }, line: { color: C.navy, width: 1.5 } });
  slide.addText([
    ...bullets(["Decreased/reversed carrying angle (<0°)", "Commonest cause: malunited supracondylar fracture of humerus", "Cosmetic deformity — usually no functional deficit", "Treatment: corrective lateral closing-wedge osteotomy", "Baumann's angle decreased on X-ray"])
  ], { x: 5.35, y: 1.45, w: 4.1, h: 2.3, valign: "top" });

  // Images
  if (cubvalgus_img && !cubvalgus_img.error) {
    slide.addImage({ data: cubvalgus_img.base64, x: 0.3, y: 3.95, w: 4.4, h: 1.45, sizing: { type: "contain" } });
  }
  if (cubvarus_img && !cubvarus_img.error) {
    slide.addImage({ data: cubvarus_img.base64, x: 5.2, y: 3.95, w: 4.4, h: 1.45, sizing: { type: "contain" } });
  }
  slide.addText("Cubitus valgus: increased carrying angle", { x: 0.3, y: 5.35, w: 4.4, h: 0.22, fontSize: 9, italic: true, color: C.slate, align: "center", fontFace: "Calibri" });
  slide.addText("Cubitus varus: gunstock deformity with varus angulation", { x: 5.2, y: 5.35, w: 4.4, h: 0.22, fontSize: 9, italic: true, color: C.slate, align: "center", fontFace: "Calibri" });
}

// ── SECTION 3 DIVIDER ──────────────────────────────────────────
sectionDivider(pres, "03", "Forearm & Wrist Deformities", "Madelung, Radial Club Hand & Synostosis");

// ── SLIDE 8: MADELUNG DEFORMITY ────────────────────────────────
{
  const slide = pres.addSlide();
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.offW } });
  slideHeader(slide, "Madelung Deformity", pres);

  slide.addText([
    ...bullets([
      "Premature fusion of the MEDIAL half of the distal radial physis",
      "Results in short, bowed radius; dorsal subluxation of distal ulna; volar displacement of carpus",
      "Inheritance: Autosomal dominant (Léri-Weill dyschondrosteosis / SHOX gene mutation)",
    ])
  ], { x: 0.3, y: 0.9, w: 5.7, h: 1.3, valign: "top" });

  addLabelBox(slide, 0.3, 2.28, 2.6, 1.3, "Radiological Signs", "↑ Radial inclination\nWedging of carpal bones\nProximal migration of lunate\nBony spur on medial radius (Vickers lig.)", pres);
  addLabelBox(slide, 3.05, 2.28, 2.9, 1.3, "Clinical Features", "Wrist pain & reduced ROM\nDorsal prominence of distal ulna\n\"Bayonet\" / \"dinner-fork\" deformity\nMore common in females, bilateral", pres);
  addLabelBox(slide, 0.3, 3.72, 5.65, 1.2, "Treatment", "Conservative (splinting) for mild cases\nVickers ligament release + physiolysis (skeletally immature)\nCorrective osteotomy of radius ± ulna shortening (mature)\nDistal ulna resection (Darrach) if symptomatic DRUJ instability", pres);

  if (madelungClin_img && !madelungClin_img.error) {
    slide.addImage({ data: madelungClin_img.base64, x: 6.1, y: 0.9, w: 1.8, h: 2.2, sizing: { type: "contain" } });
  }
  if (madelungXray_img && !madelungXray_img.error) {
    slide.addImage({ data: madelungXray_img.base64, x: 8.05, y: 0.9, w: 1.8, h: 2.2, sizing: { type: "contain" } });
  }
  slide.addText("Clinical (bayonet wrist)", { x: 6.1, y: 3.12, w: 1.8, h: 0.25, fontSize: 9, italic: true, color: C.slate, align: "center", fontFace: "Calibri" });
  slide.addText("X-ray (AP wrist)", { x: 8.05, y: 3.12, w: 1.8, h: 0.25, fontSize: 9, italic: true, color: C.slate, align: "center", fontFace: "Calibri" });
}

// ── SLIDE 9: RADIAL CLUB HAND & SYNOSTOSIS ─────────────────────
{
  const slide = pres.addSlide();
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.offW } });
  slideHeader(slide, "Radial Club Hand & Radioulnar Synostosis", pres);

  slide.addText("Radial Club Hand (Radial Longitudinal Deficiency)", {
    x: 0.3, y: 0.9, w: 9.4, h: 0.36, fontSize: 16, bold: true, color: C.teal, fontFace: "Calibri",
  });
  slide.addText([
    ...bullets([
      "Aplasia / hypoplasia of the radius and/or thumb/first ray",
      "Wrist deviates radially; hand \"clubbed\" at radial side",
      "Associations: VATER/VACTERL, Holt-Oram, Fanconi anaemia, thrombocytopenia syndromes",
      "Also caused by thalidomide, methotrexate, amniotic band disruption",
      "Treatment: serial stretching/casting → centralisation of carpus on ulna → thumb reconstruction",
    ])
  ], { x: 0.3, y: 1.32, w: 9.4, h: 2.0, valign: "top" });

  slide.addShape(pres.ShapeType.line, { x: 0.3, y: 3.4, w: 9.4, h: 0, line: { color: C.teal, width: 1, dashType: "dash" } });

  slide.addText("Congenital Radioulnar Synostosis", {
    x: 0.3, y: 3.5, w: 9.4, h: 0.36, fontSize: 16, bold: true, color: C.navy, fontFace: "Calibri",
  });
  slide.addText([
    ...bullets([
      "Bony fusion of proximal radius and ulna → fixed forearm pronation",
      "Presents as inability to supinate forearm (child cannot turn palm upward)",
      "Usually bilateral; often missed until school age",
      "Treatment: observation if mild; derotational osteotomy if severe functional limitation",
    ])
  ], { x: 0.3, y: 3.92, w: 9.4, h: 1.6, valign: "top" });
}

// ── SECTION 4 DIVIDER ──────────────────────────────────────────
sectionDivider(pres, "04", "Hand Deformities", "Syndactyly, Polydactyly, Camptodactyly & More");

// ── SLIDE 10: HAND DEFORMITIES ─────────────────────────────────
{
  const slide = pres.addSlide();
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.offW } });
  slideHeader(slide, "Congenital Hand Deformities", pres);

  const conditions = [
    { name: "Syndactyly", color: C.navy,
      facts: ["Fusion of soft tissue (simple) ± bone (complex)", "Most common in 3rd web space", "Treatment: surgical separation with Z-plasty / skin grafting", "Complex types treated same as foot syndactyly"] },
    { name: "Polydactyly", color: C.teal,
      facts: ["Extra digit — pre-axial (thumb side) or post-axial (ulnar)", "Post-axial often autosomal dominant", "AP axis controlled by zone of polarizing activity", "Treatment: excision at 9–12 months; rudimentary digits can be ligated in nursery"] },
    { name: "Camptodactyly", color: "#8B4513",
      facts: ["Flexion deformity of PIP joint (usually little finger)", "Can be congenital or adolescent onset", "Due to imbalance of intrinsic/extrinsic tendons", "Treatment: splinting; surgical release if severe"] },
    { name: "Clinodactyly", color: "#6A0572",
      facts: ["Angular deformity in radio-ulnar plane", "Usually radial deviation of little finger", "Delta phalanx (C-shaped physeal plate)", "Treatment: closing-wedge osteotomy of delta phalanx if >35°"] },
  ];

  conditions.forEach((c, i) => {
    const x = 0.22 + i * 2.42;
    slide.addShape(pres.ShapeType.rect, { x, y: 0.9, w: 2.28, h: 0.42, fill: { color: c.color }, radius: 3 });
    slide.addText(c.name, { x, y: 0.9, w: 2.28, h: 0.42, fontSize: 14, bold: true, color: C.white, fontFace: "Calibri", align: "center", valign: "middle", margin: 0 });
    slide.addShape(pres.ShapeType.rect, { x, y: 1.35, w: 2.28, h: 3.9, fill: { color: C.white }, line: { color: c.color, width: 1.5 } });
    const textItems = c.facts.map((f, j) => ({
      text: "• " + f,
      options: { fontSize: 12.5, color: C.navy, fontFace: "Calibri", breakLine: j < c.facts.length - 1 },
    }));
    slide.addText(textItems, { x: x + 0.1, y: 1.45, w: 2.08, h: 3.75, margin: 4, valign: "top" });
  });
}

// ── SLIDE 11: CEREBRAL PALSY UPPER LIMB DEFORMITIES ────────────
{
  const slide = pres.addSlide();
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.offW } });
  slideHeader(slide, "Upper Limb Deformities in Cerebral Palsy", pres);

  slide.addText("Pattern of Deformities (Spastic Hemiplegia)", {
    x: 0.3, y: 0.88, w: 5.6, h: 0.36, fontSize: 16, bold: true, color: C.teal, fontFace: "Calibri",
  });

  const levels = [
    { joint: "Shoulder", deformity: "Adduction & internal rotation contracture" },
    { joint: "Elbow", deformity: "Flexion contracture" },
    { joint: "Forearm", deformity: "Pronation deformity" },
    { joint: "Wrist", deformity: "Flexion + ulnar deviation" },
    { joint: "Fingers/Thumb", deformity: "Clenched fist; thumb-in-palm deformity" },
  ];

  levels.forEach((l, i) => {
    const y = 1.32 + i * 0.62;
    slide.addShape(pres.ShapeType.rect, { x: 0.3, y, w: 1.7, h: 0.52, fill: { color: C.navy }, radius: 2 });
    slide.addText(l.joint, { x: 0.3, y, w: 1.7, h: 0.52, fontSize: 14, bold: true, color: C.white, fontFace: "Calibri", align: "center", valign: "middle", margin: 0 });
    slide.addShape(pres.ShapeType.rect, { x: 2.1, y, w: 3.7, h: 0.52, fill: { color: C.white }, line: { color: C.teal, width: 1 } });
    slide.addText(l.deformity, { x: 2.15, y, w: 3.6, h: 0.52, fontSize: 13.5, color: C.navy, fontFace: "Calibri", valign: "middle", margin: 4 });
  });

  slide.addText("Treatment Principles", { x: 6.0, y: 0.88, w: 3.7, h: 0.36, fontSize: 16, bold: true, color: C.teal, fontFace: "Calibri" });
  slide.addText([
    ...bullets([
      "Botulinum toxin A — temporary spasticity relief",
      "Serial casting / splinting",
      "Contracture releases (musculotendinous lengthening)",
      "Tendon transfers for functional positioning",
      "Thumb-in-palm: FPL lengthening + EPL transfer",
    ])
  ], { x: 6.0, y: 1.32, w: 3.7, h: 3.5, valign: "top" });
}

// ── SLIDE 12: SUMMARY TABLE ─────────────────────────────────────
{
  const slide = pres.addSlide();
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.offW } });
  slideHeader(slide, "Summary — Key Points at a Glance", pres);

  const rows = [
    [
      { text: "Deformity", options: { bold: true, color: C.white, fill: C.navy, fontFace: "Calibri", fontSize: 13 } },
      { text: "Key Feature", options: { bold: true, color: C.white, fill: C.navy, fontFace: "Calibri", fontSize: 13 } },
      { text: "Cause", options: { bold: true, color: C.white, fill: C.navy, fontFace: "Calibri", fontSize: 13 } },
      { text: "Treatment", options: { bold: true, color: C.white, fill: C.navy, fontFace: "Calibri", fontSize: 13 } },
    ],
    [
      { text: "Sprengel Deformity", options: { fontFace: "Calibri", fontSize: 12 } },
      { text: "Elevated scapula", options: { fontFace: "Calibri", fontSize: 12 } },
      { text: "Failure of scapular descent", options: { fontFace: "Calibri", fontSize: 12 } },
      { text: "Woodward / Schrock procedure", options: { fontFace: "Calibri", fontSize: 12 } },
    ],
    [
      { text: "Erb-Duchenne Palsy", options: { fontFace: "Calibri", fontSize: 12 } },
      { text: "Waiter's tip (C5,C6)", options: { fontFace: "Calibri", fontSize: 12 } },
      { text: "Birth trauma / dystocia", options: { fontFace: "Calibri", fontSize: 12 } },
      { text: "Passive ROM → surgery", options: { fontFace: "Calibri", fontSize: 12 } },
    ],
    [
      { text: "Cubitus Varus", options: { fontFace: "Calibri", fontSize: 12 } },
      { text: "Gunstock deformity", options: { fontFace: "Calibri", fontSize: 12 } },
      { text: "Malunited supracondylar #", options: { fontFace: "Calibri", fontSize: 12 } },
      { text: "Lateral closing-wedge osteotomy", options: { fontFace: "Calibri", fontSize: 12 } },
    ],
    [
      { text: "Cubitus Valgus", options: { fontFace: "Calibri", fontSize: 12 } },
      { text: "Tardy ulnar nerve palsy", options: { fontFace: "Calibri", fontSize: 12 } },
      { text: "Malunited lateral condyle #", options: { fontFace: "Calibri", fontSize: 12 } },
      { text: "Osteotomy + ulnar nerve transposition", options: { fontFace: "Calibri", fontSize: 12 } },
    ],
    [
      { text: "Madelung Deformity", options: { fontFace: "Calibri", fontSize: 12 } },
      { text: "Bayonet wrist deformity", options: { fontFace: "Calibri", fontSize: 12 } },
      { text: "Premature medial radial physis fusion (SHOX)", options: { fontFace: "Calibri", fontSize: 12 } },
      { text: "Vickers release / corrective osteotomy", options: { fontFace: "Calibri", fontSize: 12 } },
    ],
    [
      { text: "Radial Club Hand", options: { fontFace: "Calibri", fontSize: 12 } },
      { text: "Radial deviation of hand", options: { fontFace: "Calibri", fontSize: 12 } },
      { text: "Radial aplasia/hypoplasia", options: { fontFace: "Calibri", fontSize: 12 } },
      { text: "Centralisation + thumb reconstruction", options: { fontFace: "Calibri", fontSize: 12 } },
    ],
    [
      { text: "Syndactyly", options: { fontFace: "Calibri", fontSize: 12 } },
      { text: "Fused digits", options: { fontFace: "Calibri", fontSize: 12 } },
      { text: "Failure of apoptosis between digits", options: { fontFace: "Calibri", fontSize: 12 } },
      { text: "Surgical separation + Z-plasty", options: { fontFace: "Calibri", fontSize: 12 } },
    ],
    [
      { text: "Polydactyly", options: { fontFace: "Calibri", fontSize: 12 } },
      { text: "Extra digit", options: { fontFace: "Calibri", fontSize: 12 } },
      { text: "Excess AP axis activity", options: { fontFace: "Calibri", fontSize: 12 } },
      { text: "Excision at 9–12 months", options: { fontFace: "Calibri", fontSize: 12 } },
    ],
  ];

  slide.addTable(rows, {
    x: 0.2, y: 0.88, w: 9.6, h: 4.5,
    colW: [2.2, 2.2, 2.7, 2.5],
    border: { color: "CCDDEE", pt: 0.8 },
    fill: "FAFCFF",
    autoPage: false,
  });
}

// ── SLIDE 13: END ───────────────────────────────────────────────
{
  const slide = pres.addSlide();
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.navy } });
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.18, h: 5.625, fill: { color: C.gold } });
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 4.2, w: 10, h: 0.08, fill: { color: C.teal } });
  slide.addText("Thank You", { x: 0.4, y: 1.4, w: 9.2, h: 1.0, fontSize: 52, bold: true, color: C.white, fontFace: "Calibri", align: "center" });
  slide.addText("Deformities of the Shoulder & Upper Limb", { x: 0.4, y: 2.6, w: 9.2, h: 0.5, fontSize: 20, color: C.gold, fontFace: "Calibri", align: "center", italic: true });
  slide.addText("Sources: Miller's Review of Orthopaedics 9e  |  Grainger & Allison Diagnostic Radiology  |  Mulholland & Greenfield Surgery 7e", {
    x: 0.4, y: 4.5, w: 9.2, h: 0.4, fontSize: 11, color: "A8C8D8", fontFace: "Calibri", align: "center",
  });
}

// ── WRITE FILE ──────────────────────────────────────────────────
const outputPath = "/home/daytona/workspace/shoulder-deformities-ppt/Shoulder_Upper_Limb_Deformities.pptx";
pres.writeFile({ fileName: outputPath }).then(() => {
  console.log("SUCCESS: " + outputPath);
}).catch(err => {
  console.error("ERROR:", err);
  process.exit(1);
});
Running Command

cd /home/daytona/workspace/shoulder-deformities-ppt && node create_ppt.js 2>&1

Editing File

~/shoulder-deformities-ppt/create_ppt.js

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/shoulder-deformities-ppt/create_ppt.js'
You've run out of free credits. Sign up for a free account to continue using Orris.
This is a shared conversation. Sign in to Orris to start your own chat.