~/bone-joints-ppt/create_presentation.js
const pptxgen = require("pptxgenjs");
const { execSync } = require("child_process");
// Fetch images helper
function fetchImages(urls) {
try {
const result = execSync(
`node /home/daytona/skills/shared/scripts/fetch_images.js ${urls.map(u => `"${u}"`).join(" ")}`,
{ maxBuffer: 50 * 1024 * 1024 }
).toString();
return JSON.parse(result);
} catch (e) {
console.error("Image fetch error:", e.message);
return urls.map(u => ({ url: u, base64: null, error: e.message }));
}
}
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
// IMAGE URLS from textbooks
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
const IMG_OA_KNEE_XRAY = "https://cdn.orris.care/cdss_images/565858d1e88d71b07ae2a7dbcff9eac8ceec8bfce5e50ecb5e33dabf7b749b05.png"; // KL grades knee OA
const IMG_OA_PATHOLOGY = "https://cdn.orris.care/cdss_images/c570c27d9b3a92fd7075d9e464bc9c47631ef7ff1301e84f69ac7823097b3f76.png"; // OA progression flowchart/pathology
const IMG_OA_HIP_XRAY = "https://cdn.orris.care/cdss_images/f4a2f733a2cc160a0239f2b4f98df1b4fdf41c52151c51a81e785f8b6a52f6a8.png"; // OA hip/DIP xray
const IMG_OSTEOPOROSIS_SPINE = "https://cdn.orris.care/cdss_images/0d1169e464834402c43018a52a74a2b2aa023ffbf0d675ffc838a3c6d41d06d9.png"; // vertebral fractures CT
const IMG_OSTEOPOROSIS_CT = "https://cdn.orris.care/cdss_images/bd33bba5188581d4f352c1b360c760cf8a11e35a0749c17644ceaa49faa6ff7b.png"; // advanced osteoporosis CT
const IMG_CARPAL_TUNNEL_ANATOMY = "https://cdn.orris.care/cdss_images/7fde2ad510505f006b3c2eb9fbf9142afcfc5d58e4e6cf6b466cf16cd707fbef.png"; // carpal tunnel cross-section
const IMG_THENAR_ATROPHY = "https://cdn.orris.care/cdss_images/5490b409b11bd960a0e3ded032535a361c562b6591cfa70cf42da4e10a9b1af6.png"; // thenar muscle atrophy
const IMG_GOWER_SIGN = "https://cdn.orris.care/cdss_images/4fdc7fe2ca7cc38fa418b9f4bdc1e4498486d443c0972788ad9cc00fc263ca60.png"; // Gower sign DMD child
const IMG_OA_INCIDENCE = "https://cdn.orris.care/cdss_images/7926d19d34bcf59f822e9061ec3f156c41ad1c069f9e17dd8bdb5816e0beeedd.png"; // OA incidence graph
const IMG_OSTEOPOROSIS_LATERAL_SPINE = "https://cdn.orris.care/cdss_images/6bb6738270920d2e2734d97694cceb15f8b4468d21fb943466c198c67b337e9a.png"; // osteopenia lateral spine
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
// Fetch all images
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
console.log("Fetching images...");
const allUrls = [
IMG_OA_KNEE_XRAY, IMG_OA_PATHOLOGY, IMG_OA_HIP_XRAY,
IMG_OSTEOPOROSIS_SPINE, IMG_OSTEOPOROSIS_CT,
IMG_CARPAL_TUNNEL_ANATOMY, IMG_THENAR_ATROPHY,
IMG_GOWER_SIGN, IMG_OA_INCIDENCE, IMG_OSTEOPOROSIS_LATERAL_SPINE
];
const fetched = fetchImages(allUrls);
const imgMap = {};
allUrls.forEach((url, i) => { imgMap[url] = fetched[i]; });
function getImg(url) {
const f = imgMap[url];
if (f && f.base64 && !f.error) return { data: f.base64 };
return null;
}
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
// COLOUR PALETTE (medical/academic blue-teal theme)
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
const C = {
dark: "0D2137", // deep navy β title/section bg
mid: "1A4A7A", // medium blue β headers
accent: "1D8A99", // teal β highlight bars
light: "EAF4F7", // pale blue β content bg
white: "FFFFFF",
text: "1A2533",
yellow: "F5C842", // accent for key points
orange: "E87722", // attention colour
green: "2D9E6B", // positive/normal
red: "C0392B", // danger/abnormal
gray: "5A6474",
ltgray: "F0F4F8",
};
let pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.author = "Medical Education";
pres.title = "Diseases of Bone and Joints";
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
// HELPER FUNCTIONS
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
function titleSlide(title, subtitle) {
const sl = pres.addSlide();
sl.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:10, h:5.625, fill:{ color: C.dark } });
sl.addShape(pres.shapes.RECTANGLE, { x:0, y:4.2, w:10, h:0.08, fill:{ color: C.accent } });
sl.addShape(pres.shapes.RECTANGLE, { x:0, y:4.28, w:10, h:1.345, fill:{ color: C.mid } });
sl.addText(title, {
x:0.5, y:1.2, w:9, h:2.2, fontSize:36, bold:true, color:C.white,
fontFace:"Calibri", align:"center", valign:"middle", wrap:true
});
sl.addText(subtitle, {
x:0.5, y:4.3, w:9, h:1.0, fontSize:16, color:"AACFE0",
fontFace:"Calibri", align:"center", valign:"middle"
});
return sl;
}
function sectionSlide(title, color) {
const bgColor = color || C.accent;
const sl = pres.addSlide();
sl.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:10, h:5.625, fill:{ color: bgColor } });
sl.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:0.18, h:5.625, fill:{ color: C.yellow } });
sl.addText(title, {
x:0.5, y:1.5, w:9, h:2.5, fontSize:34, bold:true, color:C.white,
fontFace:"Calibri", align:"center", valign:"middle", wrap:true
});
return sl;
}
function contentSlide(title, bullets, imgObj, note) {
const sl = pres.addSlide();
sl.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:10, h:5.625, fill:{ color: C.ltgray } });
sl.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:10, h:0.65, fill:{ color: C.mid } });
sl.addShape(pres.shapes.RECTANGLE, { x:0, y:0.65, w:10, h:0.06, fill:{ color: C.accent } });
sl.addText(title, {
x:0.2, y:0, w:9.6, h:0.65, fontSize:18, bold:true, color:C.white,
fontFace:"Calibri", valign:"middle", margin:0
});
const hasImg = !!imgObj;
const textW = hasImg ? 5.4 : 9.4;
if (bullets && bullets.length) {
const textItems = bullets.map((b, i) => {
if (b.startsWith("##")) {
return { text: b.replace("##","").trim(), options: { bold:true, color: C.mid, fontSize:13, breakLine: i < bullets.length-1 } };
}
return { text: b, options: { bullet:{ code:"2022" }, color: C.text, fontSize:12, breakLine: i < bullets.length-1 } };
});
sl.addText(textItems, {
x:0.3, y:0.8, w:textW, h:4.6,
fontFace:"Calibri", valign:"top", wrap:true
});
}
if (hasImg) {
sl.addShape(pres.shapes.RECTANGLE, { x:5.85, y:0.8, w:3.9, h:4.5,
fill:{ color: C.white },
shadow:{ type:"outer", color:"000000", blur:6, offset:2, angle:135, opacity:0.12 }
});
sl.addImage(Object.assign({}, imgObj, { x:5.95, y:0.85, w:3.7, h:4.2 }));
if (note) {
sl.addText(note, { x:5.9, y:5.05, w:3.8, h:0.35, fontSize:8, color:C.gray, italic:true, wrap:true });
}
}
return sl;
}
function twoColSlide(title, leftBullets, rightBullets, leftTitle, rightTitle) {
const sl = pres.addSlide();
sl.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:10, h:5.625, fill:{ color: C.ltgray } });
sl.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:10, h:0.65, fill:{ color: C.mid } });
sl.addShape(pres.shapes.RECTANGLE, { x:0, y:0.65, w:10, h:0.06, fill:{ color: C.accent } });
sl.addText(title, {
x:0.2, y:0, w:9.6, h:0.65, fontSize:18, bold:true, color:C.white, fontFace:"Calibri", valign:"middle", margin:0
});
// Left column header
if (leftTitle) {
sl.addShape(pres.shapes.RECTANGLE, { x:0.2, y:0.82, w:4.6, h:0.38, fill:{ color: C.accent }, rectRadius:0 });
sl.addText(leftTitle, { x:0.2, y:0.82, w:4.6, h:0.38, fontSize:12, bold:true, color:C.white, align:"center", valign:"middle", fontFace:"Calibri", margin:0 });
}
// Right column header
if (rightTitle) {
sl.addShape(pres.shapes.RECTANGLE, { x:5.2, y:0.82, w:4.6, h:0.38, fill:{ color: C.orange }, rectRadius:0 });
sl.addText(rightTitle, { x:5.2, y:0.82, w:4.6, h:0.38, fontSize:12, bold:true, color:C.white, align:"center", valign:"middle", fontFace:"Calibri", margin:0 });
}
const makeItems = (arr) => arr.map((b,i) => {
if (b.startsWith("##")) return { text: b.replace("##","").trim(), options:{ bold:true, color:C.mid, fontSize:11.5, breakLine: i<arr.length-1 }};
return { text: b, options:{ bullet:{ code:"2022" }, color:C.text, fontSize:11.5, breakLine: i<arr.length-1 }};
});
sl.addText(makeItems(leftBullets), { x:0.25, y:1.3, w:4.55, h:4.0, fontFace:"Calibri", valign:"top", wrap:true });
sl.addText(makeItems(rightBullets), { x:5.25, y:1.3, w:4.55, h:4.0, fontFace:"Calibri", valign:"top", wrap:true });
// Vertical divider
sl.addShape(pres.shapes.RECTANGLE, { x:4.9, y:0.72, w:0.04, h:4.7, fill:{ color: C.accent } });
return sl;
}
function tableSlide(title, headers, rows, notes) {
const sl = pres.addSlide();
sl.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:10, h:5.625, fill:{ color: C.ltgray } });
sl.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:10, h:0.65, fill:{ color: C.mid } });
sl.addShape(pres.shapes.RECTANGLE, { x:0, y:0.65, w:10, h:0.06, fill:{ color: C.accent } });
sl.addText(title, {
x:0.2, y:0, w:9.6, h:0.65, fontSize:18, bold:true, color:C.white, fontFace:"Calibri", valign:"middle", margin:0
});
const tableH = notes ? 4.1 : 4.7;
const tableRows = [
headers.map(h => ({ text:h, options:{ bold:true, color:C.white, fill:C.mid, align:"center", fontSize:11 } })),
...rows.map((row, ri) => row.map((cell, ci) => ({
text: cell,
options:{ color: C.text, fill: ri%2===0 ? C.white : "E8F4F8", fontSize:10.5, align: ci===0 ? "left":"center" }
})))
];
sl.addTable(tableRows, {
x:0.2, y:0.78, w:9.6, h:tableH,
border:{ type:"solid", color:"C8DDE8", pt:0.5 },
fontFace:"Calibri"
});
if (notes) {
sl.addText(notes, { x:0.2, y:4.95, w:9.6, h:0.5, fontSize:9.5, color:C.gray, italic:true, fontFace:"Calibri" });
}
return sl;
}
function flowSlide(title, steps, color) {
const sl = pres.addSlide();
sl.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:10, h:5.625, fill:{ color: C.ltgray } });
sl.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:10, h:0.65, fill:{ color: C.mid } });
sl.addShape(pres.shapes.RECTANGLE, { x:0, y:0.65, w:10, h:0.06, fill:{ color: C.accent } });
sl.addText(title, {
x:0.2, y:0, w:9.6, h:0.65, fontSize:18, bold:true, color:C.white, fontFace:"Calibri", valign:"middle", margin:0
});
const n = steps.length;
const boxW = 1.55;
const boxH = 1.1;
const startX = 0.25;
const gap = 0.28;
const totalW = n * boxW + (n-1) * gap;
const offX = (10 - totalW) / 2;
const y = 1.9;
const clr = color || C.accent;
steps.forEach((s, i) => {
const x = offX + i * (boxW + gap);
sl.addShape(pres.shapes.ROUNDED_RECTANGLE, {
x, y, w:boxW, h:boxH,
fill:{ color: i%2===0 ? clr : C.mid },
rectRadius:0.08,
shadow:{ type:"outer", color:"000000", blur:5, offset:2, angle:135, opacity:0.15 }
});
sl.addText(s.label, {
x, y, w:boxW, h:0.38, fontSize:10, bold:true, color:C.white,
fontFace:"Calibri", align:"center", valign:"middle", margin:0
});
sl.addText(s.desc, {
x, y:y+0.38, w:boxW, h:0.72, fontSize:9, color:C.white,
fontFace:"Calibri", align:"center", valign:"top", margin:4, wrap:true
});
if (i < n-1) {
const ax = x + boxW + 0.04;
sl.addShape(pres.shapes.CHEVRON, { x:ax, y:y+0.3, w:gap-0.04, h:0.5, fill:{ color: C.yellow } });
}
});
return sl;
}
function keyPointsBox(sl, items, x, y, w, h) {
sl.addShape(pres.shapes.RECTANGLE, { x, y, w, h, fill:{ color:"FFF8E1" },
line:{ color: C.yellow, pt:2 },
shadow:{ type:"outer", color:"000000", blur:4, offset:1, angle:135, opacity:0.1 }
});
sl.addText("β KEY POINTS", { x:x+0.1, y, w:w-0.2, h:0.35, fontSize:10, bold:true, color:C.orange, fontFace:"Calibri", margin:4 });
const textItems = items.map((t,i) => ({ text:t, options:{ bullet:{ code:"2713" }, color:C.text, fontSize:10, breakLine: i<items.length-1 } }));
sl.addText(textItems, { x:x+0.1, y:y+0.35, w:w-0.2, h:h-0.4, fontFace:"Calibri", valign:"top", wrap:true });
}
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
// SLIDE 1 β TITLE
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
titleSlide(
"Diseases of Bone & Joints",
"Osteoarthritis Β· Osteoporosis Β· Frozen Shoulder Β· Plantar Fasciitis Β· Tennis Elbow Β· Carpal Tunnel Syndrome Β· Muscular Dystrophy"
);
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
// SLIDE 2 β INDEX
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
{
const sl = pres.addSlide();
sl.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:10, h:5.625, fill:{ color: C.dark } });
sl.addText("Topics Covered", { x:0.5, y:0.3, w:9, h:0.6, fontSize:24, bold:true, color:C.white, fontFace:"Calibri", align:"center" });
const topics = [
["01", "Osteoarthritis", C.accent],
["02", "Osteoporosis", "#2980B9"],
["03", "Frozen Shoulder", "#8E44AD"],
["04", "Plantar Fasciitis / Calcaneal Spur", C.orange],
["05", "Tennis Elbow (Lateral Epicondylitis)", "#16A085"],
["06", "Carpal Tunnel Syndrome", C.green],
["07", "Muscular Dystrophy", "#C0392B"],
];
topics.forEach(([num, name, color], i) => {
const col = i < 4 ? 0 : 1;
const row = col === 0 ? i : i - 4;
const x = col === 0 ? 0.4 : 5.2;
const y = 1.0 + row * 0.82;
sl.addShape(pres.shapes.ROUNDED_RECTANGLE, { x, y, w:4.5, h:0.68, fill:{ color }, rectRadius:0.1 });
sl.addText(num, { x:x+0.1, y, w:0.55, h:0.68, fontSize:18, bold:true, color:C.white, align:"center", valign:"middle", fontFace:"Calibri", margin:0 });
sl.addShape(pres.shapes.RECTANGLE, { x:x+0.65, y:y+0.06, w:0.04, h:0.56, fill:{ color:"FFFFFF" } });
sl.addText(name, { x:x+0.75, y, w:3.6, h:0.68, fontSize:13, color:C.white, valign:"middle", fontFace:"Calibri", wrap:true, margin:4 });
});
}
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
// βΆ SECTION 1: OSTEOARTHRITIS
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
sectionSlide("01 OSTEOARTHRITIS\n(Degenerative Joint Disease)", C.accent);
// Definition + Epidemiology
{
const sl = contentSlide(
"Osteoarthritis β Definition & Epidemiology",
[
"##Definition",
"Most common form of arthritis; degeneration of articular cartilage with bone changes",
"Failed repair of synovial joint after intra-articular stress β pain, stiffness, disability",
"##Who Gets It?",
"Most common after age 45; more in women after 55",
"Almost all 75-year-olds show OA on X-ray (most asymptomatic)",
"Knee OA: lifetime risk 40% (men), 47% (women)",
"##Types",
"Primary (idiopathic) β no clear cause, genetic component",
"Secondary β previous injury, gout, RA, endocrine (obesity, hemochromatosis)",
"Generalized β 5+ joints involved",
"Erosive OA β inflammatory, DIP + PIP of hands; 15% evolve to RA",
],
getImg(IMG_OA_INCIDENCE),
"OA incidence by age/sex (Goldman-Cecil Medicine)"
);
keyPointsBox(sl, [
"OA β just 'wear and tear' β genetic, metabolic & mechanical factors all play a role",
"OA of knee accounts for ~85% of global OA burden",
], 0.25, 4.6, 5.2, 0.85);
}
// Clinical Features
{
const sl = contentSlide(
"Osteoarthritis β Clinical Features (Symptoms)",
[
"##Pain",
"Gradual onset; worse with activity / end of day; relieved by rest",
"Severe OA: pain even at rest / at night",
"##Stiffness",
"Morning stiffness < 30 minutes (KEY: differentiates from RA > 1 hr)",
"Gel phenomenon β stiffness after inactivity, resolves within minutes",
"##Other Symptoms",
"Crepitus (grating/cracking sound and feel)",
"No fever, no weight loss (no systemic symptoms)",
"Cold/damp weather worsens symptoms (β barometric pressure)",
"Knee OA: buckling on stairs; Hip OA: groin pain to anterior thigh",
"##Joints Affected",
"Knee, hip, spine, hands (DIP β Heberden nodes; PIP β Bouchard nodes)",
"First CMC joint (base of thumb), 1st MTP joint (big toe)",
],
null, null
);
keyPointsBox(sl, [
"Morning stiffness < 30 min in OA vs. > 1 hour in RA",
"Heberden = DIP (Distal); Bouchard = PIP (Proximal) β H before B, D before P",
"Gel phenomenon = stiffness after rest, resolves quickly with movement",
], 0.25, 4.25, 9.5, 1.1);
}
// Physical Examination
twoColSlide(
"Osteoarthritis β Physical Examination",
[
"##General",
"Joint tenderness along joint line",
"Crepitus on movement",
"Bony swelling (hard) β osteophytes",
"Soft tissue swelling β effusion",
"Reduced range of motion (late)",
"Joint deformity (advanced)",
"Muscle wasting (disuse atrophy)",
"##Hands",
"Heberden nodes (DIP joints)",
"Bouchard nodes (PIP joints)",
"First CMC joint squaring",
],
[
"##Knee",
"Varus deformity (bow-leg) β medial compartment OA",
"Fixed flexion deformity",
"Patellofemoral compression test β pain",
"Valgus/varus stress test for instability",
"##Hip",
"Earliest sign: loss of internal rotation with pain at end of range",
"FABER test (flexion, abduction, external rotation) β hip pain",
"##Important",
"Hot, red, very swollen joint = NOT OA β think infection or gout",
"Both active and passive ROM reduced",
],
"Examination Findings", "Joint-Specific Features"
);
// X-ray Slide with image
{
const sl = contentSlide(
"Osteoarthritis β X-ray Features (Kellgren-Lawrence Grading)",
[
"##4 Key X-ray Changes (JOSS)",
"J β Joint space narrowing",
"O β Osteophytes (bone spurs at joint margins)",
"S β Subchondral Sclerosis (denser/whiter bone)",
"S β Subchondral Cysts (holes in bone near joint)",
"##Kellgren-Lawrence (KL) Grading",
"Grade 0 β Normal",
"Grade 1 β Doubtful (small osteophyte, suspected JSN)",
"Grade 2 β Minimal (osteophytes, JSN < 50%)",
"Grade 3 β Moderate (JSN > 50%, tibial sclerosis)",
"Grade 4 β Severe (no joint space, cysts, bone deformity)",
"##MRI",
"Shows cartilage damage, synovitis (not routine)",
"##Lab tests",
"NORMAL β blood tests; Synovial fluid non-inflammatory (<2000 WBC)",
],
getImg(IMG_OA_KNEE_XRAY),
"Kellgren-Lawrence grades 0β4 knee OA (Miller's Orthopaedics)"
);
}
// OA Investigations Table
tableSlide(
"Osteoarthritis β Summary of Investigations",
["Investigation", "Findings", "Purpose"],
[
["X-ray (weight-bearing)", "JOSS: JSN, Osteophytes, Sclerosis, Cysts", "First-line / grading"],
["Blood tests (ESR, CRP, RF)", "NORMAL", "Rule out inflammatory arthritis"],
["Synovial fluid analysis", "Non-inflammatory (<2000 WBC/mmΒ³), clear", "Rule out infection/crystal disease"],
["MRI", "Cartilage loss, bone marrow lesions, synovitis", "Atypical/pre-surgical cases"],
["CT scan", "Bony anatomy detail", "Pre-operative planning"],
],
"β Diagnosis of OA is clinical. Imaging confirms and grades severity. Labs are done mainly to exclude other diagnoses."
);
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
// βΆ SECTION 2: OSTEOPOROSIS
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
sectionSlide("02 OSTEOPOROSIS\n(The Silent Disease)", "#2980B9");
// Definition
contentSlide(
"Osteoporosis β Definition, Types & Risk Factors",
[
"##Definition",
"Bones become weak & fragile because bone strength decreases",
"Result: fractures from MINOR trauma (fragility fractures)",
"WHO: T-score β€ β2.5 on DEXA scan",
"##Types",
"Primary Type 1 β Postmenopausal (estrogen loss)",
"Primary Type 2 β Age-related / Senile (after 70 yrs)",
"Secondary β Due to steroids, hyperthyroidism, malabsorption, RA, etc.",
"##Key Risk Factors",
"Postmenopausal, elderly, low BMI (< 19)",
"Long-term steroid use (most common secondary cause)",
"Smoking, alcohol, sedentary lifestyle",
"Previous fragility fracture, family history",
"Low calcium / Vitamin D intake",
"Rheumatoid arthritis, chronic liver/kidney disease",
],
null, null
);
// Clinical Features + Examination
twoColSlide(
"Osteoporosis β Clinical Features & Examination",
[
"##Symptoms",
"SILENT β no pain until fracture occurs",
"Fracture from minor trauma = first sign",
"##Common Fracture Sites",
"1. Vertebral crush fracture (spine)",
" β Sudden back pain after bending/lifting",
"2. Distal radius (Colles fracture β wrist)",
" β After fall on outstretched hand",
"3. Neck of femur (hip fracture)",
" β After minimal trauma; VERY serious",
" β 20% die within 1 year of hip fracture",
"##Late Features",
"Loss of height (from vertebral fractures)",
"Dowager's hump (thoracic kyphosis)",
"Chronic back pain",
],
[
"##Physical Examination",
"Measure height (compare to stated height)",
"Thoracic kyphosis (Dowager's hump)",
"Tenderness on spinal percussion β fracture",
"Look for signs of secondary causes:",
"Cushing's β moon face, striae, buffalo hump",
"Hyperthyroidism β goitre, exophthalmos",
"##Key Exam Signs",
"Loss of > 4 cm height β suspect vertebral fracture",
"Single level kyphosis β recent fracture",
"FABER, SLR to assess hip/spine pain",
"##WHO T-Score Classification",
"Normal: T β₯ β1.0",
"Osteopenia: T = β1.0 to β2.5",
"Osteoporosis: T β€ β2.5",
],
"Symptoms & Fracture Sites", "Examination & WHO Classification"
);
// Osteoporosis X-ray image
{
contentSlide(
"Osteoporosis β Radiological Features",
[
"##Plain X-ray",
"Decreased bone density (translucent / lighter bones)",
"Only detects > 30β40% bone loss (not for early diagnosis)",
"Vertebral wedge fractures, biconcave 'codfish' vertebrae",
"Vertical striations in vertebral bodies (horizontal trabecular loss)",
"##CT Scan (Spine)",
"Shows severe vertebral fractures with detail",
"Protrusion of dorsal border into spinal canal in severe cases",
"Prominent vertical trabeculae β striated appearance",
"##DEXA Scan",
"GOLD STANDARD β measures bone mineral density (BMD)",
"Sites: Lumbar spine (L1-L4) and femoral neck (hip)",
"T-score compared to young healthy adult reference",
"##Ultrasound (QUS)",
"Portable screening tool; not for definitive diagnosis",
],
getImg(IMG_OSTEOPOROSIS_SPINE),
"Vertebral fractures L1, TH12 on CT β severe osteoporosis (Grainger & Allison)"
);
}
// Osteoporosis Investigations Table
tableSlide(
"Osteoporosis β Summary of Investigations",
["Test", "What it shows", "When to use"],
[
["DEXA scan", "T-score: gold standard for BMD", "All at-risk patients"],
["X-ray spine/hip", "Fractures, decreased density (late finding)", "Symptomatic patients"],
["Serum calcium, phosphate", "Usually normal in primary OP; abnormal in secondary", "All patients"],
["Serum 25-OH Vit D + PTH", "Vitamin D deficiency, hyperparathyroidism", "Routine screening"],
["TFTs (thyroid)", "Hyperthyroidism as secondary cause", "All patients"],
["Serum cortisol / urine free cortisol", "Cushing's syndrome", "If features present"],
["Bone turnover markers (ALP, NTx)", "Assess bone remodelling activity", "Monitoring treatment"],
["Testosterone (men)", "Hypogonadism as secondary cause", "Men with OP"],
],
"β FRAX score (WHO fracture risk assessment tool) uses clinical factors to estimate 10-year fracture probability."
);
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
// βΆ SECTION 3: FROZEN SHOULDER
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
sectionSlide("03 FROZEN SHOULDER\n(Adhesive Capsulitis)", "#8E44AD");
// Clinical Features
twoColSlide(
"Frozen Shoulder β Definition & Clinical Features",
[
"##Definition",
"Pain + global restriction of shoulder movement due to thickening and contraction of the joint capsule",
"##Who Gets It?",
"Age 40β70 years; women > men",
"Non-dominant arm more affected",
"Associated: Diabetes, thyroid disease",
"Also: Immobilisation, trauma, post-surgery",
"##Symptoms",
"Insidious onset of diffuse shoulder pain",
"Progressive restriction of ALL movements",
"External rotation restricted most (first and worst)",
"Cannot comb hair, reach behind back",
"Pain worse at night",
],
[
"##3 Classic Stages",
"Stage 1 β FREEZING (2β9 months)",
" Severe pain, gradual stiffness begins",
"Stage 2 β FROZEN (4β12 months)",
" Less pain but maximum stiffness",
"Stage 3 β THAWING (5β26 months)",
" Stiffness gradually resolves",
"##Total Duration",
"1β3 years; ~90% recover with conservative Rx",
"##Key Differentiator",
"Active ROM = Passive ROM (BOTH reduced equally)",
"In rotator cuff tear: passive ROM preserved",
"In glenohumeral OA: X-ray shows joint changes",
"Posterior shoulder dislocation: X-ray abnormal",
],
"Definition, Causes & Symptoms", "Stages & Key Points"
);
// Frozen Shoulder Examination
contentSlide(
"Frozen Shoulder β Physical Examination",
[
"##Inspection",
"Guarded posture, arm held close to body",
"Scapular hitching on attempted abduction",
"##Palpation",
"Diffuse tenderness over shoulder",
"##Range of Motion (most important)",
"External rotation: 0β10Β° (severely restricted)",
"Abduction: typically < 90Β°",
"Internal rotation: restricted (can't reach back pocket)",
"Flexion: restricted",
"ALL movements restricted β ACTIVE = PASSIVE",
"##Special Tests",
"Rotator cuff tests (Supraspinatus/Hawkins) β negative",
"##Mandatory",
"Always X-ray shoulder to rule out OA, posterior dislocation",
],
null, null
);
// Investigations β Frozen Shoulder
tableSlide(
"Frozen Shoulder β Investigations",
["Investigation", "Finding", "Purpose"],
[
["X-ray shoulder (AP + lateral)", "Usually normal OR slight disuse osteopenia", "Rule out OA, dislocation, fracture β MANDATORY first step"],
["Arthrography (contrast injection)", "Reduced joint capsule volume, loss of axillary recess", "Confirms diagnosis (gold standard imaging)"],
["MRI shoulder", "Capsule thickening, obliteration of subcoracoid fat triangle, rotator interval synovitis", "If doubt about diagnosis"],
["Fasting blood glucose (HbA1c)", "Elevated in undiagnosed diabetes", "Screen for associated diabetes"],
["Thyroid function tests (TFTs)", "Abnormal if thyroid disease related", "Screen for thyroid cause"],
["Ultrasound", "Capsule thickening, rotator interval changes", "Assess rotator cuff"],
],
"β Diagnosis is primarily clinical. X-ray is mandatory to exclude other shoulder pathology."
);
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
// βΆ SECTION 4: PLANTAR FASCIITIS / CALCANEAL SPUR
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
sectionSlide("04 PLANTAR FASCIITIS\nCalcaneal Spur", C.orange);
// Clinical Features
twoColSlide(
"Plantar Fasciitis / Calcaneal Spur β Features",
[
"##Definition",
"Pain and degeneration at the origin of plantar fascia at the medial calcaneal tuberosity",
"Calcaneal spur = bony growth at fascia attachment on heel bone",
"##Mechanism",
"Overuse β microtears at fascia-bone junction",
"NOT primarily inflammatory (degenerative)",
"##Who Gets It?",
"Age 40β60 years",
"Runners, athletes, prolonged standing",
"Obese patients (high foot load)",
"Flat feet (pes planus) or high arch (pes cavus)",
"Inappropriate footwear",
],
[
"##Classic Symptoms",
"Heel pain worst in morning on FIRST STEPS (classic!)",
"Also painful after prolonged sitting then standing",
"Sharp, stabbing, burning pain at heel",
"Pain at medial plantar heel (anteromedial calcaneum)",
"Improves slightly after a few minutes of walking",
"Then worsens with prolonged standing / walking",
"No swelling, numbness, or tingling (uncommon)",
"##Physical Examination",
"Point tenderness: medial calcaneal tubercle",
"Passive dorsiflexion reproduces pain",
"Ankle ROM: normal",
"Look for pes planus / pes cavus",
"Tight Achilles tendon often co-exists",
],
"Definition, Mechanism & Risk Factors", "Symptoms & Clinical Examination"
);
// Plantar Fasciitis Investigations
tableSlide(
"Plantar Fasciitis / Calcaneal Spur β Investigations",
["Investigation", "Finding", "Notes"],
[
["Clinical examination", "Point tenderness at medial calcaneal tubercle", "Usually sufficient to diagnose"],
["X-ray heel (lateral view)", "Calcaneal spur β bony projection on plantar calcaneum", "Spur may exist without pain; pain may exist without spur"],
["Ultrasound foot", "Plantar fascia thickening > 4 mm", "Good for confirming and monitoring"],
["MRI foot", "Fascia thickening, oedema, partial tears", "For refractory/atypical cases"],
["Bone scan", "Increased uptake at calcaneum", "Rarely needed"],
],
"β Diagnosis is clinical. X-ray is done to look for calcaneal spur and rule out stress fractures."
);
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
// βΆ SECTION 5: TENNIS ELBOW
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
sectionSlide("05 TENNIS ELBOW\n(Lateral Epicondylitis)", "#16A085");
// Clinical Features
twoColSlide(
"Tennis Elbow β Clinical Features & Examination",
[
"##Definition",
"Microtears in extensor carpi radialis brevis (ECRB) tendon at the lateral epicondyle",
"##Who Gets It?",
"Peak: early 40sβ50s; women > men",
"Repetitive supination/pronation with elbow extended",
"Plumbers, painters, cooks, carpenters (not just tennis!)",
"Risk: smoking, manual labour, statin use",
"##Symptoms",
"Pain at lateral (outer) side of elbow",
"Radiates down forearm to wrist",
"Weak grip (difficulty lifting kettle, turning door knob)",
"Worsened by gripping and lifting",
"Tender ~5mm distal + anterior to lateral epicondyle midpoint",
],
[
"##Physical Examination",
"Tenderness over lateral epicondyle",
"Cozen's test β MOST IMPORTANT:",
" Patient: fist, extended elbow, pronated forearm",
" Examiner: resists wrist dorsiflexion (extension)",
" Positive: pain at lateral epicondyle",
"Mill's test:",
" Passive wrist flexion with elbow extended β pain",
"Grip strength: reduced",
"Elbow ROM: usually FULL (preserved)",
"##Differentiating Radial Tunnel Syndrome",
"Pain 3β4 cm DISTAL to lateral epicondyle (not at it)",
"Long finger extension against resistance β pain",
"No tenderness at epicondyle",
],
"Definition, Risk Factors & Symptoms", "Clinical Tests & Examination"
);
// Tennis Elbow Investigations
tableSlide(
"Tennis Elbow β Investigations",
["Investigation", "Finding", "Purpose"],
[
["Clinical examination (Cozen's test)", "Positive: pain with resisted wrist extension", "Primary diagnostic tool β clinical diagnosis"],
["X-ray elbow", "Usually normal; occasionally calcification", "Rule out bony pathology / arthritis"],
["MRI elbow", "Increased signal T1/T2 in ECRB tendon; tendon thickening", "Resistant cases / pre-surgical assessment"],
["Nerve conduction studies (NCS)", "Normal in tennis elbow; abnormal in radial tunnel", "If radial tunnel syndrome suspected"],
["Ultrasound elbow", "Tendon thickening, hypoechogenicity at ECRB origin", "Alternative to MRI; guides injection"],
],
"β Tennis elbow = lateral epicondyle. Golfer's elbow = medial epicondyle. MRI shows ECRB tendon changes in resistant cases."
);
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
// βΆ SECTION 6: CARPAL TUNNEL SYNDROME
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
sectionSlide("06 CARPAL TUNNEL SYNDROME\n(Median Nerve Entrapment)", C.green);
// CTS - Clinical Features
{
const sl = contentSlide(
"Carpal Tunnel Syndrome β Definition & Clinical Features",
[
"##Definition",
"Compression of median nerve within the carpal tunnel at the wrist",
"Most common entrapment neuropathy",
"##Who Gets It?",
"Women > men; 3% of adult population",
"Pregnancy (resolves after delivery)",
"Repetitive wrist activities (typing, assembly line)",
"Associated diseases: Diabetes, hypothyroidism, RA, acromegaly, amyloidosis",
"##Symptoms (Median nerve territory = radial 3Β½ fingers)",
"Pain, numbness, tingling in thumb, index, middle, Β½ ring finger",
"WORSE AT NIGHT β wakes patient from sleep",
"Relieved by shaking / elevating the hand ('flick sign')",
"Weak grip in advanced cases",
"May radiate up forearm to shoulder (brachialgia)",
"##KEY: No sensory loss over THENAR EMINENCE",
"(Palmar cutaneous branch leaves ABOVE the tunnel)",
],
getImg(IMG_CARPAL_TUNNEL_ANATOMY),
"Cross-section of carpal tunnel β median nerve + 9 flexor tendons (Family Medicine 9e)"
);
}
// CTS Examination
{
const sl = contentSlide(
"Carpal Tunnel Syndrome β Physical Examination",
[
"##Inspection",
"Thenar atrophy (wasting of fleshy mound at thumb base) β late/severe CTS",
"##Provocative Tests",
"Phalen's test: wrists in max flexion 60 sec β numbness/tingling in median distribution; Sensitivity ~74%",
"Tinel's sign: tap over carpal tunnel β tingling in radial 3Β½ fingers",
"Carpal compression test: direct pressure over tunnel β symptoms; MOST SENSITIVE",
"##Motor Tests",
"Abductor pollicis brevis: abduct thumb against resistance β weakness",
"Opponens pollicis: touch thumb to little finger tip, resist β weakness",
"##Sensory Tests",
"Pin-prick in thumb, index, middle fingers vs. ring/little fingers",
"Decreased in median distribution; thenar eminence SPARED",
],
getImg(IMG_THENAR_ATROPHY),
"Thenar muscle atrophy in chronic CTS (Rheumatology, Elsevier)"
);
}
// CTS Investigations Table
tableSlide(
"Carpal Tunnel Syndrome β Investigations",
["Investigation", "Finding", "Purpose"],
[
["Nerve conduction study (NCS)", "Prolonged distal motor + sensory latency in median nerve", "GOLD STANDARD β confirms diagnosis; mandatory before surgery"],
["EMG (electromyography)", "Polyphasic reinnervation potentials in thenar muscles", "Confirms denervation; done with NCS"],
["Ultrasound wrist", "Median nerve cross-sectional area > 10 mmΒ²", "Non-invasive confirmation; guides injection"],
["X-ray wrist", "Bony abnormalities (OA, fracture)", "If trauma or bony cause suspected"],
["Fasting blood glucose / HbA1c", "Elevated in diabetes", "Screen for secondary causes"],
["TFTs (thyroid)", "Hypothyroidism", "Screen for secondary causes"],
["Serum calcium, uric acid", "Abnormal in specific secondary causes", "Targeted screening"],
],
"β NCS has up to 25% false-negative rate. Clinical diagnosis + NCS together are most accurate. NCS must be done before surgery."
);
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
// βΆ SECTION 7: MUSCULAR DYSTROPHY
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
sectionSlide("07 MUSCULAR DYSTROPHY", "#C0392B");
// Overview Table
tableSlide(
"Muscular Dystrophy β Types Overview",
["Type", "Inheritance", "Gene/Protein", "Onset", "Key Feature"],
[
["Duchenne (DMD)", "X-linked recessive", "Dystrophin ABSENT (Xp21)", "2β5 yrs", "Wheelchair by age 12; calf pseudohypertrophy"],
["Becker (BMD)", "X-linked recessive", "Dystrophin REDUCED/abnormal", "Later, milder", "Ambulant beyond 15 yrs"],
["Emery-Dreifuss", "X-linked recessive", "Emerin protein", "Childhood", "Contractures + cardiomyopathy"],
["Limb-Girdle (LGMD)", "Autosomal recessive", "Various sarcoglycans", "Variable", "Pelvic + shoulder girdle weakness"],
["Facioscapulohumeral (FSH)", "Autosomal dominant", "4q35 deletion", "Teensβadult", "Face + shoulder weakness; normal lifespan"],
["Myotonic (DM1)", "Autosomal dominant", "CTG repeat β DMPK gene", "Any age", "Myotonia + systemic features"],
],
"β Duchenne MD is the most common and severe X-linked type. Females are carriers; only males are typically affected."
);
// DMD Clinical Features
{
const sl = contentSlide(
"Duchenne MD β Clinical Features (Chronological)",
[
"##Neonates / Infancy",
"Normal at birth; hypotonia may be noted",
"##Age 2β5 years",
"Delayed walking, toe walking, frequent falls",
"Waddling gait (hip abductor weakness)",
"GOWER'S SIGN β climbs up own legs to stand",
"##Progression",
"Proximal muscle weakness (hip, shoulder girdle first)",
"Pseudohypertrophy of calf muscles (looks big, is weak)",
"Lumbar lordosis, waddling gait worsens",
"##By Age 12",
"WHEELCHAIR BOUND (non-ambulant)",
"Scoliosis develops after losing ambulation",
"##Late Features",
"Respiratory muscle failure (main cause of death)",
"Dilated cardiomyopathy",
"Mild intellectual disability (some patients)",
"Death usually in late teensβ20s",
],
getImg(IMG_GOWER_SIGN),
"Gower's sign β 7-year-old boy with DMD (Bradley & Daroff's Neurology)"
);
}
// DMD Examination
twoColSlide(
"Duchenne MD β Physical Examination",
[
"##Gait & Posture",
"Waddling gait (Trendelenburg gait pattern)",
"Toe walking (early)",
"Lumbar hyperlordosis (compensation)",
"Waddling / Trendelenburg on hip abduction test",
"##Gower's Sign",
"Ask child to stand from floor",
"Uses hands to 'walk up' own thighs",
"Indicates proximal hip/pelvic muscle weakness",
"##Muscles",
"Pseudohypertrophy of calves (pathognomonic)",
"Shoulder girdle and pelvic girdle weakness",
"Face and eyes spared (unlike FSH)",
"Scapular winging",
],
[
"##Reflexes",
"Reduced/absent deep tendon reflexes (late)",
"##Contractures",
"Heel cord contracture (equinus deformity)",
"Hip flexor contracture",
"ITB contracture",
"##Spine",
"Progressive scoliosis (especially after loss of ambulation)",
"##Cardiac",
"Signs of dilated cardiomyopathy",
"Tachycardia, S3, features of heart failure",
"##Respiratory",
"Reduced chest expansion",
"Weak cough",
"Signs of chronic respiratory insufficiency",
],
"Gait, Posture & Muscle Signs", "Reflexes, Contractures & Systemic"
);
// DMD Investigations
tableSlide(
"Duchenne MD β Investigations",
["Test", "Finding", "Importance"],
[
["Serum Creatine Kinase (CK)", "10β100Γ elevated even before symptoms", "FIRST and MOST SENSITIVE test"],
["Genetic testing (DNA)", "Deletion/duplication at Xp21 (dystrophin gene)", "CONFIRMS diagnosis; preferred over biopsy now"],
["Muscle biopsy", "Absent dystrophin on immunostaining; fibre necrosis, fatty replacement", "Gold standard when genetic test inconclusive"],
["EMG", "Myopathic pattern: small, short, polyphasic potentials", "Confirms muscle (not nerve) disease"],
["ECG", "Tall R waves in V1, deep Q waves in lateral leads", "Cardiomyopathy screening"],
["Echocardiography", "Dilated cardiomyopathy", "Annual cardiac surveillance"],
["Pulmonary function tests (PFTs)", "Restrictive pattern; reduced FVC", "Monitor respiratory muscle strength"],
["LFTs (AST, ALT, ALP)", "Elevated (from muscle, not liver)", "Distinguish from liver disease"],
],
"β Serum CK is elevated 10β100Γ normal even before symptoms. Genetic testing is now first-line over muscle biopsy."
);
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
// MEGA COMPARISON TABLE
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
tableSlide(
"Quick Comparison β All Conditions at a Glance",
["Condition", "Key Symptom", "Key Sign", "Key Investigation"],
[
["Osteoarthritis", "Pain worse at end of day; <30 min morning stiffness", "Heberden/Bouchard nodes, crepitus", "X-ray: JOSS (4 features)"],
["Osteoporosis", "Silent β fracture from minor trauma", "Height loss, Dowager's kyphosis", "DEXA scan: T-score β€ β2.5"],
["Frozen Shoulder", "Global pain + ROM restriction; external rotation worst", "Active = Passive ROM reduced equally", "X-ray to exclude OA; Arthrography confirms"],
["Plantar Fasciitis", "Heel pain worst on first morning steps", "Tenderness at medial calcaneal tubercle", "X-ray: calcaneal spur; U/S: fascia >4mm"],
["Tennis Elbow", "Lateral elbow pain on gripping/wrist extension", "Cozen's test positive", "Clinical; MRI shows ECRB tendon changes"],
["Carpal Tunnel", "Numbness/tingling radial 3Β½ fingers, worse at night, relieved by shaking", "Phalen +ve, Tinel +ve, thenar wasting", "Nerve conduction study (NCS) β gold standard"],
["Muscular Dystrophy", "Progressive proximal weakness, falls, toe walking (child)", "Gower's sign, calf pseudohypertrophy", "Serum CK βββ + genetic testing (Xp21)"],
],
null
);
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
// OA vs RA DIFFERENTIATING SLIDE
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
tableSlide(
"OA vs RA β Key Differences (Exam Favourite)",
["Feature", "Osteoarthritis", "Rheumatoid Arthritis"],
[
["Morning stiffness", "< 30 minutes", "> 1 hour"],
["Pain pattern", "Worse at end of day / with activity", "Worse in morning, improves with use"],
["Systemic features", "ABSENT", "Present (fever, weight loss, fatigue)"],
["Joints affected", "DIP (Heberden), weight-bearing joints", "MCP, PIP (spares DIP), symmetrical"],
["Swelling type", "Bony (osteophytes)", "Soft tissue (synovitis)"],
["Blood tests", "Normal (ESR, CRP, RF)", "Elevated ESR/CRP, RF positive"],
["X-ray", "JOSS β JSN, osteophytes, sclerosis, cysts", "Periarticular osteopenia, erosions, JSN"],
["Treatment", "NSAIDs, physio, joint replacement", "DMARDs (methotrexate), biologics"],
],
null
);
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
// FLOWCHART β APPROACH TO JOINT PAIN
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
flowSlide(
"Approach to a Patient with Joint Pain β Diagnostic Flow",
[
{ label:"History", desc:"Duration, onset, pattern, morning stiffness, systemic symptoms" },
{ label:"Examination", desc:"Single vs. multiple joints; active vs. passive ROM; inflammatory signs" },
{ label:"Investigations", desc:"X-ray, ESR/CRP, RF, FBC, synovial fluid" },
{ label:"Diagnose", desc:"OA vs. RA vs. crystal vs. septic vs. spondyloarthropathy" },
{ label:"Manage", desc:"Analgesia, physio, DMARDs, surgery (joint replacement)" },
],
C.mid
);
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
// MNEMONICS / KEY EXAM POINTS SLIDE
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
{
const sl = pres.addSlide();
sl.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:10, h:5.625, fill:{ color: C.dark } });
sl.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:10, h:0.65, fill:{ color: C.yellow } });
sl.addText("β EXAM MNEMONICS & KEY POINTS", {
x:0.2, y:0, w:9.6, h:0.65, fontSize:18, bold:true, color:C.dark, fontFace:"Calibri", valign:"middle", margin:0
});
const points = [
["JOSS", "OA X-ray: Joint space narrowing, Osteophytes, Subchondral Sclerosis, Subchondral cysts"],
["OA < 30 min", "Morning stiffness in OA < 30 min | RA > 1 hour"],
["H before B, D before P", "Heberden nodes = DIP | Bouchard nodes = PIP"],
["Gower's sign = DMD", "Child uses hands to climb up own thighs (proximal weakness)"],
["CK first", "In DMD, Serum CK is elevated 10-100Γ BEFORE symptoms appear"],
["Radial 3Β½ fingers", "Carpal Tunnel = median nerve = thumb, index, middle, Β½ ring finger"],
["Thenar eminence spared", "Palmar cutaneous branch leaves proximal to tunnel β no sensory loss at thenar"],
["Flick sign", "CTS symptoms relieved by shaking/elevating hand at night"],
["Tennis = lateral, Golf = medial", "Tennis elbow = lateral epicondyle | Golfer's elbow = medial"],
["Morning heel pain", "Plantar fasciitis: worst on FIRST steps of morning"],
["T β€ β2.5", "WHO: T-score β€ β2.5 = Osteoporosis on DEXA"],
["Active = Passive", "Frozen shoulder: BOTH active and passive ROM equally restricted"],
];
const cols = 2;
const rows = Math.ceil(points.length / cols);
points.forEach(([mnem, desc], i) => {
const col = i < rows ? 0 : 1;
const row = col === 0 ? i : i - rows;
const x = col === 0 ? 0.2 : 5.1;
const y = 0.78 + row * 0.62;
sl.addShape(pres.shapes.ROUNDED_RECTANGLE, { x, y, w:4.65, h:0.55, fill:{ color: C.mid }, rectRadius:0.07 });
sl.addText(mnem, { x:x+0.12, y, w:1.6, h:0.55, fontSize:10.5, bold:true, color:C.yellow, fontFace:"Calibri", valign:"middle", margin:4 });
sl.addShape(pres.shapes.RECTANGLE, { x:x+1.72, y:y+0.08, w:0.03, h:0.39, fill:{ color: C.accent } });
sl.addText(desc, { x:x+1.82, y, w:2.72, h:0.55, fontSize:9.5, color:C.white, fontFace:"Calibri", valign:"middle", margin:4, wrap:true });
});
}
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
// END SLIDE
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
{
const sl = pres.addSlide();
sl.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:10, h:5.625, fill:{ color: C.dark } });
sl.addShape(pres.shapes.RECTANGLE, { x:0, y:2.5, w:10, h:0.08, fill:{ color: C.accent } });
sl.addText("Thank You", { x:0.5, y:0.8, w:9, h:1.4, fontSize:42, bold:true, color:C.white, fontFace:"Calibri", align:"center" });
sl.addText("Sources: Goldman-Cecil Medicine Β· Family Medicine 9e Β· Campbell's Operative Orthopaedics 15e\nMiller's Orthopaedics 9e Β· Bailey & Love's Surgery 28e Β· Bradley & Daroff's Neurology Β· Grainger & Allison's Diagnostic Radiology",
{ x:0.5, y:2.7, w:9, h:1.4, fontSize:13, color:"AACFE0", fontFace:"Calibri", align:"center", wrap:true }
);
}
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
// WRITE FILE
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
const outPath = "/home/daytona/workspace/bone-joints-ppt/Bone_and_Joint_Diseases.pptx";
pres.writeFile({ fileName: outPath }).then(() => {
console.log("β
Presentation saved:", outPath);
}).catch(err => {
console.error("β Error saving:", err);
process.exit(1);
});