How to diagnose bronchopneumonia from xray with its diffwrential and clinical sign and symptoms of other emergencies while reading xrays
bronchopneumonia chest xray diagnosis features differential diagnosis radiological
chest xray emergency signs tension pneumothorax aortic dissection pulmonary edema diagnosis radiology
https://radiologyassistant.nl/chest/chest-x-ray/lung-disease
| Feature | Description |
|---|---|
| Multifocal patchy opacities | Ill-defined, non-homogeneous densities scattered across one or both lungs - the hallmark |
| Bilateral involvement | Common; approximately 40% of S. aureus bronchopneumonia is bilateral |
| Lower lobe predominance | Most common in lower lobes, but any lobe can be involved |
| Segmental distribution | Follows bronchopulmonary segments; does NOT cross fissures |
| Air bronchogram | Present when larger airways are patent within consolidated segments |
| No lobar consolidation | Consolidation is patchy, not homogeneous lobar white-out (unless disease is severe/confluent) |
| Peribronchial thickening | Increased bronchovascular markings (thickened bronchial walls) |
| Possible pleural effusion | Especially in S. aureus (30-50% of cases) |
| Possible cavitation | Especially S. aureus and Pseudomonas - abscess formation in 15-30% |


| System | Findings |
|---|---|
| Fever | High fever, chills, rigors |
| Cough | Productive cough - purulent or mucopurulent sputum |
| Respiratory | Dyspnoea, tachypnoea |
| Pleuritic | Pleuritic chest pain (variable) |
| Auscultation | Crepitations (crackles), reduced breath sounds, bronchial breathing over consolidation |
| Percussion | Dullness to percussion over consolidated areas |
| General | Tachycardia, malaise, dehydration; may be septic if severe |
| Organism | Key X-Ray Clues |
|---|---|
| Staphylococcus aureus | Bilateral bronchopneumonia; cavitation, pneumatoceles, pleural effusion (30-50%), abscess (15-30%) |
| Escherichia coli | Multilobar, predominantly lower lobes, bilateral peripheral consolidations |
| Pseudomonas aeruginosa | Confluent bronchopneumonia, frequently cavitates; multifocal upper lobe consolidation, tree-in-bud, pleural effusion |
| Haemophilus influenzae | Bilateral areas with ill-defined margins; lower lobes |
| Mycoplasma pneumoniae | Focal reticulonodular opacification in single lobe; patchy segmental/lobular ground-glass opacity or consolidation; centrilobular nodules |
| Klebsiella pneumoniae | Dense lobar or patchy bronchopneumonia; volume expansion with fissure bulging; rapid cavitation |
| Viral (Influenza A) | Bilateral ground-glass opacities; rapid progression can resemble pulmonary oedema |
| Condition | Distinguishing X-Ray Feature | Clinical Clue |
|---|---|---|
| Lobar pneumonia | Homogeneous lobar consolidation, air-bronchogram, respects fissures | Fever, productive cough; pneumococcal most common |
| Pulmonary oedema (cardiogenic) | Bilateral perihilar bat-wing opacification; Kerley B lines; upper lobe venous diversion; cardiomegaly; bilateral pleural effusions | Orthopnoea, PND, raised JVP, cardiac history |
| Pulmonary haemorrhage | Bilateral alveolar consolidation/ground-glass; may clear rapidly (24-48 hrs) | Haemoptysis, anaemia; associated with vasculitis |
| ARDS | Diffuse bilateral airspace consolidation; no cardiomegaly; no Kerley lines | Recent sepsis/trauma/aspiration; low PaO2/FiO2 ratio |
| Aspiration pneumonitis | Dependent lobe consolidation (posterior upper lobes if supine; lower lobes if upright); right side more common | Aspiration event, reduced consciousness, swallowing disorder |
| Bronchoalveolar carcinoma (adenocarcinoma in situ) | Persistent or progressive consolidation; may show air-bronchogram; fails to resolve with antibiotics | Chronic non-productive cough; no fever improvement |
| Cryptogenic Organizing Pneumonia (COP/BOOP) | Migratory peripheral consolidations; does not resolve with antibiotics | Subacute course; responds to steroids |
| Pulmonary infarction (PE) | Wedge-shaped peripheral opacity (Hampton's hump); raised hemidiaphragm; pleural effusion | Pleuritic chest pain, haemoptysis, DVT risk factors; prominent vascular signs |
| Sarcoidosis (alveolar form) | Multiple small ill-defined opacities; hilar lymphadenopathy | Often younger patients; systemic symptoms |
| Tuberculosis | Upper lobe consolidation with cavitation; satellite nodules; lymphadenopathy | PPD positive; contact history; slow course |
| Letter | What to Check |
|---|---|
| A - Airway | Trachea - midline or deviated? |
| B - Bones | Ribs, clavicles, scapulae - fractures? |
| C - Cardiac | Cardiac size, shape, mediastinal width |
| D - Diaphragm | Level, shape, free air under it? |
| E - Everything else | Lung fields, hila, pleural spaces, soft tissues, lines/tubes |
| Feature | Bronchopneumonia | Lobar Pneumonia | Pulmonary Oedema | TB | ARDS |
|---|---|---|---|---|---|
| Distribution | Multifocal, patchy, bilateral | Single lobe/segment, homogeneous | Bilateral perihilar/basal | Upper lobe | Diffuse bilateral |
| Borders | Ill-defined | Lobar margin | Perihilar "butterfly" | Ill-defined with cavities | Diffuse |
| Air bronchogram | Possible | Classic | Absent (usually) | Absent | Present |
| Cavitation | Yes (Staph, Pseudomonas) | Rare | No | Common | Rare |
| Pleural effusion | Possible | Possible (parapneumonic) | Yes (bilateral) | Possible | Uncommon |
| Cardiomegaly | No | No | Yes | No | No |
| Kerley B lines | No | No | Yes | No | No |
| Clinical course | Acute, fever, productive cough | Acute, fever, single-lobe symptoms | Acute dyspnoea, orthopnoea | Subacute/chronic, weight loss, night sweats | Post-insult; no cardiac history |
How to diagnose bronchopneumonia from xray with its diffwrential and clinical sign and symptoms of other emergencies while reading xrays
| Emergency | Key X-Ray Sign | Key Clinical Sign |
|---|---|---|
| Tension pneumothorax | Tracheal deviation away, lung collapse | Absent breath sounds, JVD, hypotension |
| Massive pleural effusion | White-out, mediastinal shift away | Dullness, absent breath sounds |
| Acute pulmonary oedema | Bat-wing shadowing, Kerley B, cardiomegaly | Orthopnoea, frothy sputum, S3 |
| Aortic dissection | Wide mediastinum (>8 cm) | Tearing back pain, unequal BP arms |
| Pneumomediastinum | Air along mediastinal borders | Hamman's crunch, subcutaneous emphysema |
| Necrotizing/septic pneumonia | Bilateral multilobar consolidation + cavitation | Septic shock, confusion |
Make a presentation on chest X-ray interpretation (bronchopneumonia & emergencies)
mkdir -p /home/daytona/workspace/chest-xray-pptx && ls /home/daytona/workspace/chest-xray-pptx
node /home/daytona/skills/shared/scripts/fetch_images.js \ "https://cdn.orris.care/cdss_images/3cbc4636bf5eab3b8a5ba1bd65db2ed1e1e1ff08138b9a178cb1d5f9ec6cd70d.png" \ "https://cdn.orris.care/cdss_images/10da1b7fd41ebfc0d092754cbd55c84ca41f93229dd401fb2eae77d575bfdc5d.png" \ "https://cdn.orris.care/cdss_images/49da3cf81ecd2aceeaf66aa4136991bef125b21d49fcb46b5db151f3dc42225c.png" \ 2>/dev/null | node -e "const d=require('fs').readFileSync('/dev/stdin','utf8'); const arr=JSON.parse(d); arr.forEach((x,i)=>console.log(i, x.error ? 'ERROR:'+x.error : 'OK len='+x.base64.length));"
~/chest-xray-pptx/build.js
const pptxgen = require("pptxgenjs");
const { execSync } = require("child_process");
// ── FETCH IMAGES ──────────────────────────────────────────────────────────────
const imgUrls = [
"https://cdn.orris.care/cdss_images/3cbc4636bf5eab3b8a5ba1bd65db2ed1e1e1ff08138b9a178cb1d5f9ec6cd70d.png", // CT E.coli bronchopneumonia
"https://cdn.orris.care/cdss_images/10da1b7fd41ebfc0d092754cbd55c84ca41f93229dd401fb2eae77d575bfdc5d.png", // CXR H.influenzae
"https://cdn.orris.care/cdss_images/49da3cf81ecd2aceeaf66aa4136991bef125b21d49fcb46b5db151f3dc42225c.png", // CT Pseudomonas abscess
];
const imgs = JSON.parse(
execSync(`node /home/daytona/skills/shared/scripts/fetch_images.js ${imgUrls.map(u => `"${u}"`).join(" ")}`).toString()
);
// ── PALETTE ───────────────────────────────────────────────────────────────────
const C = {
navy: "0B1F3A", // dominant dark bg
teal: "1B8A8F", // accent
amber: "E8A020", // warning / emergency accent
red: "C0392B", // emergency red
white: "FFFFFF",
offWhite:"F0F4F8",
silver: "BDC9D7",
darkCard:"112940", // slightly lighter than navy for cards
midCard: "163352", // card surface
};
// ── HELPERS ───────────────────────────────────────────────────────────────────
function navyBg(slide) {
slide.addShape("rect", { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.navy }, line: { color: C.navy } });
}
function tealBar(slide, x, y, w, h) {
slide.addShape("rect", { x, y, w, h, fill: { color: C.teal }, line: { color: C.teal } });
}
function amberBar(slide, x, y, w, h) {
slide.addShape("rect", { x, y, w, h, fill: { color: C.amber }, line: { color: C.amber } });
}
function redBar(slide, x, y, w, h) {
slide.addShape("rect", { x, y, w, h, fill: { color: C.red }, line: { color: C.red } });
}
function card(slide, x, y, w, h, color) {
slide.addShape("rect", {
x, y, w, h,
fill: { color: color || C.midCard },
line: { color: color || C.midCard },
shadow: { type: "outer", color: "000000", blur: 8, offset: 3, angle: 135, opacity: 0.25 }
});
}
function sectionLabel(slide, text, color) {
slide.addText(text, {
x: 0, y: 0, w: 10, h: 0.38,
fill: { color: color || C.teal },
fontSize: 11, bold: true, color: C.white,
align: "center", valign: "middle", margin: 0,
charSpacing: 3
});
}
function slideTitle(slide, text, color) {
slide.addText(text, {
x: 0.45, y: 0.45, w: 9.1, h: 0.7,
fontSize: 26, bold: true, color: color || C.white,
fontFace: "Calibri", margin: 0
});
}
function accentLine(slide, color) {
tealBar(slide, 0.45, 1.18, 1.0, 0.05);
// override color if needed
}
// ══════════════════════════════════════════════════════════════════════════════
// BUILD PRESENTATION
// ══════════════════════════════════════════════════════════════════════════════
const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Chest X-Ray Interpretation: Bronchopneumonia & Emergencies";
pres.author = "Orris Medical";
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 1 — TITLE
// ══════════════════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
navyBg(sl);
// large teal left strip
sl.addShape("rect", { x: 0, y: 0, w: 0.18, h: 5.625, fill: { color: C.teal }, line: { color: C.teal } });
// amber accent strip
sl.addShape("rect", { x: 0.18, y: 0, w: 0.07, h: 5.625, fill: { color: C.amber }, line: { color: C.amber } });
sl.addText("CHEST X-RAY\nINTERPRETATION", {
x: 0.55, y: 0.9, w: 9.1, h: 2.0,
fontSize: 46, bold: true, color: C.white,
fontFace: "Calibri", charSpacing: 2,
align: "left", valign: "top"
});
sl.addText("Bronchopneumonia Diagnosis · Differential Diagnosis · Radiological Emergencies", {
x: 0.55, y: 2.95, w: 9.1, h: 0.55,
fontSize: 16, color: C.silver, fontFace: "Calibri", align: "left"
});
// bottom bar
sl.addShape("rect", { x: 0, y: 5.1, w: 10, h: 0.525, fill: { color: C.teal }, line: { color: C.teal } });
sl.addText("Based on Grainger & Allison's Diagnostic Radiology · Fishman's Pulmonary Diseases", {
x: 0.3, y: 5.1, w: 9.4, h: 0.525,
fontSize: 11, color: C.white, italic: true, align: "center", valign: "middle", margin: 0
});
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 2 — AGENDA / OUTLINE
// ══════════════════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
navyBg(sl);
sectionLabel(sl, "OVERVIEW", C.teal);
slideTitle(sl, "What We Will Cover");
sl.addShape("rect", { x: 0.45, y: 1.22, w: 1.0, h: 0.05, fill: { color: C.teal }, line: { color: C.teal } });
const topics = [
["01", "Systematic CXR Reading — ABCDE Approach"],
["02", "Bronchopneumonia: Pathophysiology & X-Ray Pattern"],
["03", "Bronchopneumonia: Clinical Signs & Symptoms"],
["04", "Organism-Specific Radiological Clues"],
["05", "Differential Diagnosis of Consolidation"],
["06", "X-Ray Emergencies & Their Clinical Alarms"],
["07", "Summary Comparison Table"],
];
topics.forEach(([num, title], i) => {
const row = Math.floor(i / 2);
const col = i % 2;
const x = col === 0 ? 0.45 : 5.3;
const y = 1.45 + row * 0.95;
card(sl, x, y, 4.6, 0.78, C.midCard);
sl.addText(num, { x: x + 0.12, y: y + 0.08, w: 0.55, h: 0.62, fontSize: 22, bold: true, color: C.teal, valign: "middle", margin: 0 });
sl.addText(title, { x: x + 0.7, y: y + 0.08, w: 3.75, h: 0.62, fontSize: 13, color: C.white, valign: "middle", fontFace: "Calibri", margin: 0 });
// If last item (odd count), center it
if (i === topics.length - 1 && topics.length % 2 !== 0) {
// already placed at col=0; just leave it
}
});
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 3 — ABCDE SYSTEMATIC APPROACH
// ══════════════════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
navyBg(sl);
sectionLabel(sl, "SYSTEMATIC APPROACH", C.teal);
slideTitle(sl, "ABCDE Method for Reading Chest X-Rays");
sl.addShape("rect", { x: 0.45, y: 1.22, w: 1.0, h: 0.05, fill: { color: C.teal }, line: { color: C.teal } });
const rows = [
{ letter: "A", label: "AIRWAY", desc: "Trachea — midline or deviated? Carina angle (<70°)?", color: C.teal },
{ letter: "B", label: "BONES & SOFT TISSUE", desc: "Ribs, clavicles, scapulae — fractures? Subcutaneous emphysema?", color: "1A7A6E" },
{ letter: "C", label: "CARDIAC & MEDIASTINUM", desc: "Heart size (CTR <50%), mediastinal width (<8 cm on PA), aortic knuckle clarity", color: C.amber },
{ letter: "D", label: "DIAPHRAGM", desc: "Level (R higher than L), contour, free subdiaphragmatic air?", color: "7B5EA7" },
{ letter: "E", label: "EVERYTHING ELSE", desc: "Lung fields, hila, pleural spaces, costophrenic angles, lines & tubes", color: C.teal },
];
rows.forEach((r, i) => {
const y = 1.4 + i * 0.79;
card(sl, 0.4, y, 9.2, 0.72, C.midCard);
sl.addShape("rect", { x: 0.4, y, w: 0.6, h: 0.72, fill: { color: r.color }, line: { color: r.color } });
sl.addText(r.letter, { x: 0.4, y: y + 0.04, w: 0.6, h: 0.64, fontSize: 26, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });
sl.addText(r.label, { x: 1.1, y: y + 0.06, w: 2.5, h: 0.28, fontSize: 12, bold: true, color: C.amber, margin: 0 });
sl.addText(r.desc, { x: 1.1, y: y + 0.35, w: 8.3, h: 0.3, fontSize: 11.5, color: C.silver, margin: 0, fontFace: "Calibri" });
});
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 4 — BRONCHOPNEUMONIA PATHOPHYSIOLOGY
// ══════════════════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
navyBg(sl);
sectionLabel(sl, "BRONCHOPNEUMONIA", C.teal);
slideTitle(sl, "Pathophysiology: Why It Looks Patchy");
sl.addShape("rect", { x: 0.45, y: 1.22, w: 1.0, h: 0.05, fill: { color: C.teal }, line: { color: C.teal } });
// Left: flow diagram
const steps = [
{ label: "Acute Bronchitis", sub: "Infection starts in bronchi/bronchioles" },
{ label: "Peribronchial Spread", sub: "Inflammatory exudate fills surrounding alveoli" },
{ label: "Multifocal Consolidation", sub: "Multiple patchy opacities in same/multiple lobes" },
{ label: "Confluent Disease", sub: "Segments coalesce → diffuse consolidation (severe)" },
];
steps.forEach((s, i) => {
const y = 1.38 + i * 0.96;
card(sl, 0.4, y, 5.2, 0.78, C.midCard);
sl.addShape("rect", { x: 0.4, y, w: 0.45, h: 0.78, fill: { color: C.teal }, line: { color: C.teal } });
sl.addText(`${i + 1}`, { x: 0.4, y: y + 0.1, w: 0.45, h: 0.58, fontSize: 20, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });
sl.addText(s.label, { x: 0.95, y: y + 0.06, w: 4.5, h: 0.28, fontSize: 13, bold: true, color: C.amber, margin: 0 });
sl.addText(s.sub, { x: 0.95, y: y + 0.36, w: 4.5, h: 0.3, fontSize: 11.5, color: C.silver, margin: 0 });
// Arrow between steps
if (i < steps.length - 1) {
sl.addText("▼", { x: 2.5, y: y + 0.78, w: 0.6, h: 0.18, fontSize: 11, color: C.teal, align: "center", margin: 0 });
}
});
// Right: vs lobar pneumonia
card(sl, 5.9, 1.38, 3.75, 3.82, C.darkCard);
sl.addText("vs. LOBAR PNEUMONIA", { x: 6.0, y: 1.48, w: 3.5, h: 0.35, fontSize: 12, bold: true, color: C.amber, align: "center", margin: 0 });
sl.addShape("rect", { x: 6.2, y: 1.85, w: 3.1, h: 0.04, fill: { color: C.teal }, line: { color: C.teal } });
const compare = [
["Feature", "Bronchopneumonia", "Lobar Pneumonia"],
["Origin", "Airways (bronchi)", "Alveoli directly"],
["Pattern", "Patchy / multifocal", "Homogeneous lobar"],
["Fissures", "Does NOT cross", "Bounded by fissures"],
["Air-bronchogram", "Variable", "Classic feature"],
["Organism", "Staph, Pseudomonas, H.flu", "Pneumococcus"],
];
compare.forEach(([f, b, l], i) => {
const y = 1.95 + i * 0.5;
const hdr = i === 0;
sl.addText(f, { x: 5.95, y, w: 1.15, h: 0.42, fontSize: hdr ? 10 : 10.5, bold: hdr, color: hdr ? C.amber : C.silver, valign: "middle", margin: 0 });
sl.addText(b, { x: 7.12, y, w: 1.25, h: 0.42, fontSize: hdr ? 10 : 10, bold: hdr, color: hdr ? C.amber : C.white, valign: "middle", margin: 0 });
sl.addText(l, { x: 8.38, y, w: 1.22, h: 0.42, fontSize: hdr ? 10 : 10, bold: hdr, color: hdr ? C.amber : C.white, valign: "middle", margin: 0 });
if (!hdr) sl.addShape("rect", { x: 5.95, y: y + 0.42, w: 3.65, h: 0.02, fill: { color: "1D3F5E" }, line: { color: "1D3F5E" } });
});
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 5 — CXR FEATURES WITH IMAGE
// ══════════════════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
navyBg(sl);
sectionLabel(sl, "BRONCHOPNEUMONIA — RADIOLOGY", C.teal);
slideTitle(sl, "Classic X-Ray & CT Features");
sl.addShape("rect", { x: 0.45, y: 1.22, w: 1.0, h: 0.05, fill: { color: C.teal }, line: { color: C.teal } });
// Left: feature list
const features = [
{ icon: "●", text: "Multifocal patchy, ill-defined opacities — the hallmark" },
{ icon: "●", text: "Bilateral involvement (~40% of S. aureus cases)" },
{ icon: "●", text: "Lower lobe predominance (though any lobe can be affected)" },
{ icon: "●", text: "Segmental distribution — does NOT cross fissures" },
{ icon: "●", text: "Air bronchogram may be present" },
{ icon: "●", text: "Possible cavitation (Staph, Pseudomonas, Klebsiella)" },
{ icon: "●", text: "Pleural effusion 30–50% (Staph aureus)" },
{ icon: "CT", text: "Tree-in-bud pattern, centrilobular nodules (CT finding)" },
];
features.forEach((f, i) => {
const y = 1.38 + i * 0.47;
const isCT = f.icon === "CT";
sl.addShape("rect", { x: 0.4, y: y + 0.05, w: 0.38, h: 0.32,
fill: { color: isCT ? C.amber : C.teal }, line: { color: isCT ? C.amber : C.teal } });
sl.addText(isCT ? "CT" : "●", { x: 0.4, y: y + 0.05, w: 0.38, h: 0.32, fontSize: isCT ? 9 : 14, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });
sl.addText(f.text, { x: 0.85, y: y + 0.06, w: 4.4, h: 0.33, fontSize: 12, color: C.white, valign: "middle", fontFace: "Calibri", margin: 0 });
});
// Right: actual CT image
card(sl, 5.55, 1.33, 4.1, 3.82, C.darkCard);
if (imgs[0] && !imgs[0].error) {
sl.addImage({ data: imgs[0].base64, x: 5.65, y: 1.43, w: 3.9, h: 3.3 });
}
sl.addText("CT: E. coli Bronchopneumonia — bilateral peripheral consolidations (arrows)", {
x: 5.55, y: 4.78, w: 4.1, h: 0.38,
fontSize: 9, color: C.silver, italic: true, align: "center", valign: "middle", margin: 0
});
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 6 — CLINICAL SIGNS & SYMPTOMS
// ══════════════════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
navyBg(sl);
sectionLabel(sl, "BRONCHOPNEUMONIA — CLINICAL", C.teal);
slideTitle(sl, "Clinical Signs & Symptoms");
sl.addShape("rect", { x: 0.45, y: 1.22, w: 1.0, h: 0.05, fill: { color: C.teal }, line: { color: C.teal } });
const categories = [
{
title: "CONSTITUTIONAL", color: C.teal,
items: ["High fever & rigors", "Malaise, fatigue", "Tachycardia", "Dehydration signs"]
},
{
title: "RESPIRATORY", color: C.amber,
items: ["Productive cough (purulent/mucopurulent sputum)", "Dyspnoea & tachypnoea", "Pleuritic chest pain (variable)", "Reduced chest expansion"]
},
{
title: "AUSCULTATION", color: "1A7A6E",
items: ["Crepitations (coarse crackles)", "Bronchial breathing over consolidation", "Reduced breath sounds", "Pleural rub (if effusion)"]
},
{
title: "PERCUSSION & OTHER", color: "7B5EA7",
items: ["Dullness to percussion over consolidation", "Tachypnoea (RR >20)", "SpO2 drop", "CURB-65 score for severity (ICU if ≥3)"]
},
];
categories.forEach((cat, i) => {
const col = i % 2;
const row = Math.floor(i / 2);
const x = col === 0 ? 0.4 : 5.15;
const y = 1.38 + row * 2.1;
card(sl, x, y, 4.5, 1.95, C.midCard);
sl.addShape("rect", { x, y, w: 4.5, h: 0.38, fill: { color: cat.color }, line: { color: cat.color } });
sl.addText(cat.title, { x: x + 0.12, y: y + 0.04, w: 4.26, h: 0.3, fontSize: 11, bold: true, color: C.white, charSpacing: 2, margin: 0 });
sl.addText(cat.items.map(it => `• ${it}`).join("\n"), {
x: x + 0.12, y: y + 0.45, w: 4.26, h: 1.4,
fontSize: 11, color: C.white, fontFace: "Calibri", valign: "top", margin: 0
});
});
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 7 — ORGANISM-SPECIFIC CXR CLUES WITH CXR IMAGE
// ══════════════════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
navyBg(sl);
sectionLabel(sl, "ORGANISM-SPECIFIC PATTERNS", C.teal);
slideTitle(sl, "Radiological Clues by Pathogen");
sl.addShape("rect", { x: 0.45, y: 1.22, w: 1.0, h: 0.05, fill: { color: C.teal }, line: { color: C.teal } });
const orgs = [
{ name: "S. aureus", clue: "Bilateral; cavitation, pneumatoceles, pleural effusion (30–50%)", color: C.red },
{ name: "E. coli", clue: "Multilobar lower lobe consolidations; bilateral peripheral pattern", color: C.amber },
{ name: "Pseudomonas", clue: "Confluent + cavitating; upper lobe predominance; tree-in-bud", color: "C06A15" },
{ name: "H. influenzae", clue: "Bilateral ill-defined lower lobe consolidations", color: C.teal },
{ name: "Klebsiella", clue: "Dense lobar consolidation; fissure bulging; rapid cavitation", color: "7B5EA7" },
{ name: "Mycoplasma", clue: "Focal reticulonodular in one lobe; segmental/lobular GGO", color: "1A7A6E" },
{ name: "Viral (Influenza)", clue: "Bilateral GGO; rapid progression resembling pulmonary oedema", color: "2A6699" },
];
orgs.forEach((o, i) => {
const y = 1.38 + i * 0.56;
card(sl, 0.4, y, 5.65, 0.48, C.midCard);
sl.addShape("rect", { x: 0.4, y, w: 1.6, h: 0.48, fill: { color: o.color }, line: { color: o.color } });
sl.addText(o.name, { x: 0.4, y: y + 0.04, w: 1.6, h: 0.4, fontSize: 12, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });
sl.addText(o.clue, { x: 2.1, y: y + 0.06, w: 3.85, h: 0.36, fontSize: 11.5, color: C.white, valign: "middle", fontFace: "Calibri", margin: 0 });
});
// Right: CXR image
card(sl, 6.3, 1.33, 3.35, 3.82, C.darkCard);
if (imgs[1] && !imgs[1].error) {
sl.addImage({ data: imgs[1].base64, x: 6.4, y: 1.43, w: 3.15, h: 3.3 });
}
sl.addText("CXR: H. influenzae bronchopneumonia — bilateral ill-defined consolidations (arrows)", {
x: 6.3, y: 4.78, w: 3.35, h: 0.38,
fontSize: 9, color: C.silver, italic: true, align: "center", valign: "middle", margin: 0
});
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 8 — DIFFERENTIAL DIAGNOSIS OF CONSOLIDATION
// ══════════════════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
navyBg(sl);
sectionLabel(sl, "DIFFERENTIAL DIAGNOSIS", C.teal);
slideTitle(sl, "Differential Diagnosis of Consolidation on CXR");
sl.addShape("rect", { x: 0.45, y: 1.22, w: 1.0, h: 0.05, fill: { color: C.teal }, line: { color: C.teal } });
// Rule at top
card(sl, 0.4, 1.3, 9.2, 0.52, "0E3352");
sl.addText("⚠ KEY RULE: First ask — Is this ACUTE or CHRONIC? Chronic (>6 weeks) shifts DDx toward malignancy, organizing pneumonia, or TB/fungal.", {
x: 0.55, y: 1.35, w: 8.9, h: 0.4, fontSize: 11.5, color: C.amber, bold: true, valign: "middle", margin: 0
});
const diffs = [
{ cond: "Lobar Pneumonia", xray: "Homogeneous lobar consolidation; air-bronchogram; respects fissures", clue: "Fever, productive cough; pneumococcal", color: C.teal },
{ cond: "Pulmonary Oedema", xray: "Bat-wing perihilar shadowing; Kerley B lines; upper lobe diversion; cardiomegaly", clue: "Orthopnoea, PND, raised JVP; cardiac history", color: C.amber },
{ cond: "ARDS", xray: "Diffuse bilateral consolidation; no cardiomegaly; no Kerley lines", clue: "Post-sepsis/trauma; PaO2/FiO2 <300", color: C.red },
{ cond: "Aspiration Pneumonitis", xray: "Dependent lobe consolidation (posterior upper / lower lobes); right-sided", clue: "Aspiration event, reduced consciousness, swallowing disorder", color: "C06A15" },
{ cond: "TB", xray: "Upper lobe consolidation + cavitation; satellite nodules; lymphadenopathy", clue: "Subacute course, weight loss, night sweats; contact history", color: "7B5EA7" },
{ cond: "Bronchoalveolar Ca / COP", xray: "Persistent consolidation failing to resolve with antibiotics; may migrate (COP)", clue: "Chronic non-productive cough; steroid-responsive (COP)", color: "1A7A6E" },
{ cond: "Pulmonary Infarction (PE)", xray: "Hampton's hump (wedge peripheral opacity); raised hemidiaphragm; effusion", clue: "Pleuritic pain, haemoptysis, DVT risk factors", color: "2A6699" },
];
diffs.forEach((d, i) => {
const y = 1.9 + i * 0.5;
card(sl, 0.4, y, 9.2, 0.44, C.midCard);
sl.addShape("rect", { x: 0.4, y, w: 1.8, h: 0.44, fill: { color: d.color }, line: { color: d.color } });
sl.addText(d.cond, { x: 0.45, y: y + 0.04, w: 1.7, h: 0.36, fontSize: 10.5, bold: true, color: C.white, valign: "middle", align: "center", margin: 0 });
sl.addText(d.xray, { x: 2.28, y: y + 0.04, w: 4.15, h: 0.36, fontSize: 10, color: C.white, valign: "middle", margin: 0 });
sl.addShape("rect", { x: 6.45, y: y + 0.04, w: 0.03, h: 0.36, fill: { color: C.silver }, line: { color: C.silver } });
sl.addText(d.clue, { x: 6.52, y: y + 0.04, w: 3.0, h: 0.36, fontSize: 10, color: C.silver, valign: "middle", italic: true, margin: 0 });
});
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 9 — EMERGENCY 1: Tension Pneumothorax
// ══════════════════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
navyBg(sl);
sectionLabel(sl, "RADIOLOGICAL EMERGENCIES", C.red);
// Red alert banner
sl.addShape("rect", { x: 0, y: 0.38, w: 10, h: 0.75, fill: { color: C.red }, line: { color: C.red } });
sl.addText("⚡ TENSION PNEUMOTHORAX", {
x: 0.3, y: 0.38, w: 9.4, h: 0.75,
fontSize: 26, bold: true, color: C.white, valign: "middle", fontFace: "Calibri", charSpacing: 1, margin: 0
});
// Warning note
card(sl, 0.4, 1.25, 9.2, 0.5, "3B0A0A");
sl.addText("⚠ DO NOT WAIT FOR CXR — Diagnose clinically. Immediate needle decompression at 2nd ICS, mid-clavicular line.", {
x: 0.55, y: 1.3, w: 8.9, h: 0.4, fontSize: 11.5, color: C.amber, bold: true, valign: "middle", margin: 0
});
// Two columns
card(sl, 0.4, 1.85, 4.4, 3.4, C.midCard);
sl.addShape("rect", { x: 0.4, y: 1.85, w: 4.4, h: 0.38, fill: { color: C.red }, line: { color: C.red } });
sl.addText("CXR SIGNS", { x: 0.52, y: 1.88, w: 4.15, h: 0.32, fontSize: 12, bold: true, color: C.white, charSpacing: 2, margin: 0 });
const xraySigns = [
"Complete lung collapse (ipsilateral)",
"Tracheal deviation AWAY from affected side",
"Mediastinal shift away from affected side",
"Depression/inversion of ipsilateral hemidiaphragm",
"Widening of ipsilateral intercostal spaces",
"Absent lung markings on affected side",
];
sl.addText(xraySigns.map(s => `• ${s}`).join("\n"), {
x: 0.55, y: 2.3, w: 4.1, h: 2.8, fontSize: 12, color: C.white, fontFace: "Calibri", valign: "top", margin: 0
});
card(sl, 5.2, 1.85, 4.4, 3.4, C.midCard);
sl.addShape("rect", { x: 5.2, y: 1.85, w: 4.4, h: 0.38, fill: { color: "7B1818" }, line: { color: "7B1818" } });
sl.addText("CLINICAL SIGNS", { x: 5.32, y: 1.88, w: 4.15, h: 0.32, fontSize: 12, bold: true, color: C.white, charSpacing: 2, margin: 0 });
const clinSigns = [
"Sudden severe dyspnoea & tachycardia",
"Hypotension — obstructive shock",
"Absent breath sounds on affected side",
"Tracheal deviation (away from lesion)",
"Distended neck veins (JVD)",
"Cyanosis & cardiovascular collapse",
];
sl.addText(clinSigns.map(s => `• ${s}`).join("\n"), {
x: 5.35, y: 2.3, w: 4.1, h: 2.8, fontSize: 12, color: C.white, fontFace: "Calibri", valign: "top", margin: 0
});
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 10 — EMERGENCY 2: Acute Pulmonary Oedema
// ══════════════════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
navyBg(sl);
sectionLabel(sl, "RADIOLOGICAL EMERGENCIES", C.red);
sl.addShape("rect", { x: 0, y: 0.38, w: 10, h: 0.75, fill: { color: "1B5E9A" }, line: { color: "1B5E9A" } });
sl.addText("⚡ ACUTE PULMONARY OEDEMA (LVF)", {
x: 0.3, y: 0.38, w: 9.4, h: 0.75,
fontSize: 24, bold: true, color: C.white, valign: "middle", fontFace: "Calibri", charSpacing: 1, margin: 0
});
card(sl, 0.4, 1.25, 4.55, 4.0, C.midCard);
sl.addShape("rect", { x: 0.4, y: 1.25, w: 4.55, h: 0.38, fill: { color: "1B5E9A" }, line: { color: "1B5E9A" } });
sl.addText("CXR SIGNS", { x: 0.52, y: 1.28, w: 4.28, h: 0.32, fontSize: 12, bold: true, color: C.white, charSpacing: 2, margin: 0 });
const oedXray = [
"Cardiomegaly (CTR >50%)",
"Bilateral perihilar 'bat-wing' / butterfly shadowing",
"Upper lobe blood diversion (prominent upper lobe vessels)",
"Kerley B lines (short horizontal peripheral lines)",
"Bilateral pleural effusions (usually)",
"Fluid in horizontal (minor) fissure",
"Patchy bilateral airspace opacification",
];
sl.addText(oedXray.map(s => `• ${s}`).join("\n"), {
x: 0.55, y: 1.7, w: 4.25, h: 3.4, fontSize: 11.5, color: C.white, fontFace: "Calibri", valign: "top", margin: 0
});
card(sl, 5.2, 1.25, 4.45, 4.0, C.midCard);
sl.addShape("rect", { x: 5.2, y: 1.25, w: 4.45, h: 0.38, fill: { color: "0D3F6E" }, line: { color: "0D3F6E" } });
sl.addText("CLINICAL SIGNS", { x: 5.32, y: 1.28, w: 4.18, h: 0.32, fontSize: 12, bold: true, color: C.white, charSpacing: 2, margin: 0 });
const oedClin = [
"Acute onset dyspnoea & orthopnoea",
"Paroxysmal nocturnal dyspnoea (PND)",
"Pink frothy sputum",
"Bilateral fine crepitations (basal → apical)",
"Raised JVP",
"S3 gallop rhythm",
"History of cardiac disease / hypertension",
"Cold peripheries, diaphoresis",
];
sl.addText(oedClin.map(s => `• ${s}`).join("\n"), {
x: 5.35, y: 1.7, w: 4.15, h: 3.4, fontSize: 11.5, color: C.white, fontFace: "Calibri", valign: "top", margin: 0
});
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 11 — EMERGENCY 3: Aortic Dissection + Pneumomediastinum
// ══════════════════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
navyBg(sl);
sectionLabel(sl, "RADIOLOGICAL EMERGENCIES", C.red);
// Top half: Aortic dissection
sl.addShape("rect", { x: 0, y: 0.38, w: 10, h: 0.65, fill: { color: "6B1010" }, line: { color: "6B1010" } });
sl.addText("⚡ AORTIC DISSECTION", { x: 0.3, y: 0.38, w: 9.4, h: 0.65, fontSize: 22, bold: true, color: C.white, valign: "middle", margin: 0 });
card(sl, 0.4, 1.1, 4.4, 2.05, C.midCard);
sl.addShape("rect", { x: 0.4, y: 1.1, w: 4.4, h: 0.35, fill: { color: "6B1010" }, line: { color: "6B1010" } });
sl.addText("CXR SIGNS", { x: 0.52, y: 1.13, w: 4.15, h: 0.28, fontSize: 11, bold: true, color: C.white, charSpacing: 2, margin: 0 });
sl.addText([
{ text: "• Widened mediastinum ", options: { breakLine: true } },
{ text: " (>8 cm on PA — KEY sign)\n", options: { bold: true, color: C.amber, breakLine: true } },
{ text: "• Loss of aortic knuckle clarity\n", options: { breakLine: true } },
{ text: "• Left pleural effusion\n", options: { breakLine: true } },
{ text: "• Trachea/NGT deviation to right\n", options: { breakLine: true } },
{ text: "• 'Double density' aortic wall", options: {} },
], { x: 0.55, y: 1.5, w: 4.1, h: 1.55, fontSize: 11, color: C.white, fontFace: "Calibri", valign: "top", margin: 0 });
card(sl, 5.2, 1.1, 4.4, 2.05, C.midCard);
sl.addShape("rect", { x: 5.2, y: 1.1, w: 4.4, h: 0.35, fill: { color: "4A0808" }, line: { color: "4A0808" } });
sl.addText("CLINICAL SIGNS", { x: 5.32, y: 1.13, w: 4.15, h: 0.28, fontSize: 11, bold: true, color: C.white, charSpacing: 2, margin: 0 });
sl.addText([
{ text: "• Sudden TEARING pain → back (hallmark)\n", options: { bold: true, color: C.amber, breakLine: true } },
{ text: "• Unequal BP both arms (>20 mmHg)\n", options: { breakLine: true } },
{ text: "• Pulse deficits\n", options: { breakLine: true } },
{ text: "• Syncope, neurological deficits\n", options: { breakLine: true } },
{ text: "• Escalate immediately — CT angiography", options: { bold: true, color: C.amber } },
], { x: 5.35, y: 1.5, w: 4.1, h: 1.55, fontSize: 11, color: C.white, fontFace: "Calibri", valign: "top", margin: 0 });
// Divider
sl.addShape("rect", { x: 0.4, y: 3.22, w: 9.2, h: 0.04, fill: { color: C.teal }, line: { color: C.teal } });
// Bottom half: Pneumomediastinum
sl.addText("⚡ PNEUMOMEDIASTINUM / BOERHAAVE SYNDROME", { x: 0.4, y: 3.3, w: 9.2, h: 0.45, fontSize: 18, bold: true, color: C.amber, valign: "middle", margin: 0 });
card(sl, 0.4, 3.82, 4.4, 1.48, C.midCard);
sl.addText("CXR: Air along mediastinal borders • Continuous diaphragm sign • Air around heart", {
x: 0.55, y: 3.92, w: 4.1, h: 1.25, fontSize: 11, color: C.white, fontFace: "Calibri", valign: "top", margin: 0
});
card(sl, 5.2, 3.82, 4.4, 1.48, C.midCard);
sl.addText("Clinical: Subcutaneous emphysema (neck crepitus) • Hamman's sign (mediastinal crunch) • Severe chest pain after forceful vomiting → SURGICAL EMERGENCY", {
x: 5.35, y: 3.92, w: 4.1, h: 1.25, fontSize: 11, color: C.white, fontFace: "Calibri", valign: "top", margin: 0
});
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 12 — EMERGENCY 4: Massive Effusion + Necrotizing Pneumonia
// ══════════════════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
navyBg(sl);
sectionLabel(sl, "RADIOLOGICAL EMERGENCIES", C.red);
// Top: Massive Pleural Effusion/Haemothorax
sl.addShape("rect", { x: 0, y: 0.38, w: 10, h: 0.65, fill: { color: "3A2700" }, line: { color: "3A2700" } });
sl.addText("⚡ MASSIVE PLEURAL EFFUSION / HAEMOTHORAX", { x: 0.3, y: 0.38, w: 9.4, h: 0.65, fontSize: 20, bold: true, color: C.amber, valign: "middle", margin: 0 });
card(sl, 0.4, 1.1, 4.4, 1.9, C.midCard);
sl.addShape("rect", { x: 0.4, y: 1.1, w: 4.4, h: 0.35, fill: { color: "3A2700" }, line: { color: "3A2700" } });
sl.addText("CXR SIGNS", { x: 0.52, y: 1.13, w: 4.15, h: 0.28, fontSize: 11, bold: true, color: C.white, charSpacing: 2, margin: 0 });
sl.addText("• Uniform white-out of one hemithorax\n• Trachea & mediastinum deviated AWAY from effusion (if massive)\n• Loss of diaphragm & costophrenic angle\n• Meniscus sign (smaller effusions)", {
x: 0.55, y: 1.5, w: 4.1, h: 1.4, fontSize: 11, color: C.white, fontFace: "Calibri", valign: "top", margin: 0
});
card(sl, 5.2, 1.1, 4.4, 1.9, C.midCard);
sl.addShape("rect", { x: 5.2, y: 1.1, w: 4.4, h: 0.35, fill: { color: "2A1A00" }, line: { color: "2A1A00" } });
sl.addText("CLINICAL SIGNS", { x: 5.32, y: 1.13, w: 4.15, h: 0.28, fontSize: 11, bold: true, color: C.white, charSpacing: 2, margin: 0 });
sl.addText("• Stony dullness to percussion\n• Absent breath sounds at base\n• Reduced chest expansion\n• Dyspnoea, tachycardia, hypoxia\n• Trauma history (haemothorax)", {
x: 5.35, y: 1.5, w: 4.1, h: 1.4, fontSize: 11, color: C.white, fontFace: "Calibri", valign: "top", margin: 0
});
sl.addShape("rect", { x: 0.4, y: 3.08, w: 9.2, h: 0.04, fill: { color: C.teal }, line: { color: C.teal } });
// Bottom: Necrotizing/Septic Pneumonia
sl.addText("⚡ NECROTIZING PNEUMONIA / SEPTIC SHOCK", { x: 0.4, y: 3.17, w: 9.2, h: 0.45, fontSize: 18, bold: true, color: C.red, valign: "middle", margin: 0 });
card(sl, 0.4, 3.68, 4.4, 1.65, C.midCard);
sl.addShape("rect", { x: 0.4, y: 3.68, w: 4.4, h: 0.35, fill: { color: C.red }, line: { color: C.red } });
sl.addText("CXR SIGNS", { x: 0.52, y: 3.71, w: 4.15, h: 0.28, fontSize: 11, bold: true, color: C.white, charSpacing: 2, margin: 0 });
sl.addText("• Bilateral multilobar consolidation\n• Bilateral pleural effusions (high-mortality sign)\n• Cavitation within consolidation → abscess\n• Rapid progression on serial films", {
x: 0.55, y: 4.08, w: 4.1, h: 1.2, fontSize: 11, color: C.white, fontFace: "Calibri", valign: "top", margin: 0
});
card(sl, 5.2, 3.68, 4.4, 1.65, C.midCard);
sl.addShape("rect", { x: 5.2, y: 3.68, w: 4.4, h: 0.35, fill: { color: "7B1010" }, line: { color: "7B1010" } });
sl.addText("CLINICAL SIGNS", { x: 5.32, y: 3.71, w: 4.15, h: 0.28, fontSize: 11, bold: true, color: C.white, charSpacing: 2, margin: 0 });
sl.addText("• High fever, rigors, tachycardia\n• Hypotension (septic shock)\n• Confusion / altered mental status\n• CURB-65 ≥3 → ICU admission\n• SpO2 dropping despite O2", {
x: 5.35, y: 4.08, w: 4.1, h: 1.2, fontSize: 11, color: C.white, fontFace: "Calibri", valign: "top", margin: 0
});
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 13 — SUMMARY COMPARISON TABLE
// ══════════════════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
navyBg(sl);
sectionLabel(sl, "SUMMARY", C.teal);
slideTitle(sl, "Bronchopneumonia vs. Key Differentials — At a Glance");
sl.addShape("rect", { x: 0.45, y: 1.22, w: 1.0, h: 0.05, fill: { color: C.teal }, line: { color: C.teal } });
// Table header
const headers = ["Feature", "Bronchopneumonia", "Lobar Pneumonia", "Pulm. Oedema", "TB", "ARDS"];
const colW = [1.7, 1.64, 1.64, 1.64, 1.64, 1.64];
const startX = [0.15, 1.85, 3.49, 5.13, 6.77, 8.41];
const headerY = 1.38;
headers.forEach((h, i) => {
sl.addShape("rect", { x: startX[i], y: headerY, w: colW[i], h: 0.42, fill: { color: i === 0 ? C.teal : C.midCard }, line: { color: C.navy } });
sl.addText(h, { x: startX[i] + 0.05, y: headerY + 0.04, w: colW[i] - 0.1, h: 0.34, fontSize: 10.5, bold: true, color: i === 0 ? C.white : C.amber, valign: "middle", align: "center", margin: 0 });
});
const rows = [
["Distribution", "Multifocal patchy bilateral", "Single lobe homogeneous", "Bilateral perihilar/basal", "Upper lobe", "Diffuse bilateral"],
["Borders", "Ill-defined", "Lobar margin", "Bat-wing perihilar", "Cavities/nodules", "Diffuse"],
["Air bronchogram", "Variable", "Classic (YES)", "Absent (usually)", "Absent", "Present"],
["Cavitation", "YES (Staph/Pseudomonas)", "Rare", "No", "Common", "Rare"],
["Pleural effusion", "Possible (Staph 30–50%)", "Parapneumonic possible", "Bilateral", "Possible", "Uncommon"],
["Cardiomegaly", "No", "No", "YES", "No", "No"],
["Kerley B lines", "No", "No", "YES", "No", "No"],
["Clinical key", "Fever + productive cough", "Fever + single-lobe sx", "Orthopnoea + JVD", "Wt loss + night sweats", "Post-insult + no cardiac"],
];
const rowColors = ["0E2440", C.midCard, "0E2440", C.midCard, "0E2440", C.midCard, "0E2440", C.midCard];
rows.forEach((row, ri) => {
const y = 1.8 + ri * 0.455;
row.forEach((cell, ci) => {
sl.addShape("rect", { x: startX[ci], y, w: colW[ci], h: 0.44, fill: { color: rowColors[ri] }, line: { color: C.navy } });
const highlight = (cell.toUpperCase().includes("YES") || cell.includes("Classic")) ? C.amber : C.white;
sl.addText(cell, {
x: startX[ci] + 0.04, y: y + 0.03, w: colW[ci] - 0.08, h: 0.38,
fontSize: ci === 0 ? 10 : 9.5,
bold: ci === 0,
color: ci === 0 ? C.amber : highlight,
valign: "middle", align: ci === 0 ? "left" : "center", margin: 0
});
});
});
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 14 — CT IMAGE SLIDE: Pseudomonas Abscess
// ══════════════════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
navyBg(sl);
sectionLabel(sl, "RADIOLOGY IN FOCUS", C.teal);
slideTitle(sl, "Cavitation & Abscess Formation in Bronchopneumonia");
sl.addShape("rect", { x: 0.45, y: 1.22, w: 1.0, h: 0.05, fill: { color: C.amber }, line: { color: C.amber } });
// Image
card(sl, 0.4, 1.35, 5.5, 3.9, C.darkCard);
if (imgs[2] && !imgs[2].error) {
sl.addImage({ data: imgs[2].base64, x: 0.5, y: 1.45, w: 5.3, h: 3.5 });
}
sl.addText("CT: Pseudomonas aeruginosa Pneumonia — extensive right upper lobe consolidation with necrosis and abscess formation (arrows). Vascular structures visible within consolidated lung (arrowheads).", {
x: 0.4, y: 5.28, w: 5.5, h: 0.32, fontSize: 9, color: C.silver, italic: true, align: "center", margin: 0
});
// Key points
card(sl, 6.15, 1.35, 3.5, 3.9, C.midCard);
sl.addShape("rect", { x: 6.15, y: 1.35, w: 3.5, h: 0.38, fill: { color: C.amber }, line: { color: C.amber } });
sl.addText("CAVITATION — CAUSES", { x: 6.27, y: 1.38, w: 3.25, h: 0.3, fontSize: 11, bold: true, color: C.navy, charSpacing: 2, margin: 0 });
const cavItems = [
{ org: "S. aureus", note: "Pneumatoceles in children; abscesses in adults (15–30%)" },
{ org: "Pseudomonas", note: "Confluent; frequently cavitates; upper lobe" },
{ org: "Klebsiella", note: "Rapid cavitation; fissure bulging; lung gangrene" },
{ org: "Anaerobes", note: "Aspiration-related; foul-smelling sputum" },
{ org: "TB", note: "Upper lobe; thick-walled; satellite nodules" },
];
cavItems.forEach((item, i) => {
const y = 1.85 + i * 0.66;
sl.addText(item.org, { x: 6.27, y, w: 1.1, h: 0.28, fontSize: 11, bold: true, color: C.amber, margin: 0 });
sl.addText(item.note, { x: 6.27, y: y + 0.28, w: 3.25, h: 0.32, fontSize: 10.5, color: C.silver, fontFace: "Calibri", margin: 0 });
});
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 15 — CONCLUSION / KEY TAKEAWAYS
// ══════════════════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
navyBg(sl);
sl.addShape("rect", { x: 0, y: 0, w: 0.18, h: 5.625, fill: { color: C.teal }, line: { color: C.teal } });
sl.addShape("rect", { x: 0.18, y: 0, w: 0.07, h: 5.625, fill: { color: C.amber }, line: { color: C.amber } });
sl.addText("KEY TAKEAWAYS", {
x: 0.55, y: 0.3, w: 9.1, h: 0.6,
fontSize: 28, bold: true, color: C.teal, charSpacing: 3, margin: 0
});
const takeaways = [
{ n: "1", t: "Bronchopneumonia = patchy, multifocal, airway-first spread. Does NOT cross fissures.", c: C.teal },
{ n: "2", t: "Always correlate CXR with clinical context — consolidation has many causes (infection, oedema, ARDS, cancer, PE).", c: C.amber },
{ n: "3", t: "Cavitation on CXR → think S. aureus, Pseudomonas, Klebsiella, TB, anaerobes.", c: "1A7A6E" },
{ n: "4", t: "Emergency #1: Tension pneumothorax — diagnose and treat CLINICALLY. Do not wait for CXR.", c: C.red },
{ n: "5", t: "Emergency #2: Wide mediastinum (>8 cm) → Aortic dissection until proven otherwise. Escalate immediately.", c: "7B1818" },
{ n: "6", t: "Bat-wing shadowing + Kerley B + cardiomegaly → pulmonary oedema, NOT pneumonia.", c: "1B5E9A" },
{ n: "7", t: "Use ABCDE systematically — missing an emergency on CXR can be fatal.", c: "7B5EA7" },
];
takeaways.forEach((t, i) => {
const y = 1.0 + i * 0.63;
sl.addShape("rect", { x: 0.55, y: y + 0.06, w: 0.35, h: 0.44, fill: { color: t.c }, line: { color: t.c } });
sl.addText(t.n, { x: 0.55, y: y + 0.06, w: 0.35, h: 0.44, fontSize: 16, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });
sl.addText(t.t, { x: 1.0, y: y + 0.08, w: 8.5, h: 0.44, fontSize: 12.5, color: C.white, valign: "middle", fontFace: "Calibri", margin: 0 });
});
sl.addShape("rect", { x: 0, y: 5.2, w: 10, h: 0.425, fill: { color: C.teal }, line: { color: C.teal } });
sl.addText("Sources: Grainger & Allison's Diagnostic Radiology · Fishman's Pulmonary Diseases · Radiology Assistant · Radiology Masterclass", {
x: 0.3, y: 5.2, w: 9.4, h: 0.425, fontSize: 9.5, color: C.white, italic: true, align: "center", valign: "middle", margin: 0
});
}
// ── WRITE FILE ─────────────────────────────────────────────────────────────
const outPath = "/home/daytona/workspace/chest-xray-pptx/ChestXray_Bronchopneumonia_Emergencies.pptx";
pres.writeFile({ fileName: outPath }).then(() => {
console.log("SUCCESS:", outPath);
}).catch(err => {
console.error("ERROR:", err);
});
cd /home/daytona/workspace/chest-xray-pptx && node build.js
cd /home/daytona/workspace/chest-xray-pptx && \ node /home/daytona/skills/shared/scripts/fetch_images.js \ "https://cdn.orris.care/cdss_images/3cbc4636bf5eab3b8a5ba1bd65db2ed1e1e1ff08138b9a178cb1d5f9ec6cd70d.png" \ > img0.json && \ node /home/daytona/skills/shared/scripts/fetch_images.js \ "https://cdn.orris.care/cdss_images/10da1b7fd41ebfc0d092754cbd55c84ca41f93229dd401fb2eae77d575bfdc5d.png" \ > img1.json && \ node /home/daytona/skills/shared/scripts/fetch_images.js \ "https://cdn.orris.care/cdss_images/49da3cf81ecd2aceeaf66aa4136991bef125b21d49fcb46b5db151f3dc42225c.png" \ > img2.json && \ echo "Done saving image JSONs"
~/chest-xray-pptx/build.js
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/chest-xray-pptx/build.js'
cd /home/daytona/workspace/chest-xray-pptx && node build.js
ls -lh /home/daytona/workspace/chest-xray-pptx/ChestXray_Bronchopneumonia_Emergencies.pptx
ChestXray Bronchopneumonia Emergencies
Presentation · PPTX
| # | Slide | Content |
|---|---|---|
| 1 | Title Slide | Dark navy design with teal/amber accents |
| 2 | Agenda | 7-topic overview with numbered cards |
| 3 | ABCDE Approach | Systematic CXR reading — Airway → Everything else |
| 4 | Pathophysiology | Bronchopneumonia vs Lobar pneumonia comparison table |
| 5 | CXR & CT Features | All X-ray signs + real CT image (E. coli bronchopneumonia) |
| 6 | Clinical Signs | 4-category grid: constitutional, respiratory, auscultation, percussion |
| 7 | Organism Patterns | 7 organisms with X-ray clues + real CXR image (H. influenzae) |
| 8 | Differential Diagnosis | 7 differentials with X-ray + clinical distinguishing features |
| 9 | Emergency: Tension Pneumothorax | Red alert slide; CXR signs vs clinical signs |
| 10 | Emergency: Pulmonary Oedema | Bat-wing, Kerley B, cardiomegaly vs clinical |
| 11 | Emergency: Aortic Dissection + Pneumomediastinum | Wide mediastinum, tearing pain; Hamman's sign |
| 12 | Emergency: Massive Effusion + Necrotizing Pneumonia | White-out, haemothorax, septic shock signs |
| 13 | Summary Table | Bronchopneumonia vs 4 key differentials across 7 features |
| 14 | CT Focus: Cavitation | Real CT of Pseudomonas abscess + cavitation causes by organism |
| 15 | Key Takeaways | 7 bold clinical pearls with color-coded cards |
Give me a list of different triads of symptoms for different disorder that help me in diagnosis
classic diagnostic triads symptoms medicine list neurology cardiology gastroenterology
https://en.wikipedia.org/wiki/List_of_medical_triads,_tetrad…
| Triad Name | Three Components | Diagnosis |
|---|---|---|
| Beck's Triad | Muffled/distant heart sounds + Distended neck veins (raised JVP) + Hypotension | Cardiac Tamponade |
| Cushing's Triad | Hypertension + Bradycardia + Irregular respirations | Raised Intracranial Pressure (impending herniation) |
| Lethal Triad / Trauma Triad of Death | Hypothermia + Coagulopathy + Metabolic acidosis | Trauma - imminent death |
| Ruptured AAA Triad | Severe abdominal/back pain + Hypotension + Pulsatile abdominal mass | Ruptured Abdominal Aortic Aneurysm |
| Opioid Overdose Triad | Pinpoint pupils (miosis) + CNS depression/unconsciousness + Respiratory depression | Opioid Toxicity |
| Bergman's Triad | Mental status change + Petechiae (axilla/thorax) + Dyspnoea | Fat Embolism Syndrome |
| Abdominal Compartment Syndrome | Oliguria + Elevated peak airway pressure + Elevated intra-abdominal pressure | Abdominal Compartment Syndrome |
Beck's triad confirmed in Rosen's Emergency Medicine and Schwartz's Principles of Surgery. Cushing's triad confirmed in Neuroanatomy through Clinical Cases 3rd Ed, Bailey & Love's Surgery.
| Triad Name | Three Components | Diagnosis |
|---|---|---|
| Beck's Triad | Muffled heart sounds + JVD + Hypotension | Cardiac Tamponade |
| Triad of Aortic Stenosis | Angina (chest pain) + Syncope + Heart failure (dyspnoea) | Aortic Stenosis |
| Congestive Heart Failure Triad | Tachycardia + Tachypnoea + Tender hepatomegaly | CHF (Paediatric) |
| Pheochromocytoma Triad | Headache + Diaphoresis (profuse sweating) + Palpitations | Phaeochromocytoma |
| Carcinoid Triad | Flushing + Diarrhoea + Right-sided heart failure | Carcinoid Syndrome |
| Triad Name | Three Components | Diagnosis |
|---|---|---|
| Charcot's Neurological Triad | Scanning/staccato speech + Intention tremor + Nystagmus | Multiple Sclerosis |
| Wernicke's Encephalopathy Triad | Confusion (delirium) + Ophthalmoplegia + Ataxia | Wernicke's Encephalopathy (Thiamine deficiency) |
| Hakim's Triad / NPH Triad | Gait disturbance (wet) + Urinary incontinence (wobbly) + Dementia/cognitive decline (wacky) | Normal Pressure Hydrocephalus |
| Horner's Syndrome Triad | Ptosis + Miosis + Anhidrosis | Horner's Syndrome (sympathetic chain interruption) |
| Botulism Triad | No fever + Clear sensorium + Symmetric descending flaccid paralysis with cranial nerve involvement | Botulism |
| Cushing's Triad | Hypertension + Bradycardia + Irregular breathing | Raised ICP / Impending herniation |
Wernicke's, NPH, and botulism triads confirmed in Washington Manual of Medical Therapeutics.
| Triad Name | Three Components | Diagnosis |
|---|---|---|
| Charcot's Cholangitis Triad | Right upper quadrant pain + Fever with rigors + Jaundice | Ascending Cholangitis |
| Reynolds' Pentad (extension of Charcot's) | Above 3 + Confusion + Hypotension | Severe/Suppurative Cholangitis |
| Budd-Chiari Syndrome Triad | Abdominal pain + Ascites + Hepatomegaly | Budd-Chiari Syndrome |
| Acute Liver Failure Triad | Jaundice + Coagulopathy + Encephalopathy | Acute Liver Failure |
| Rigler's Triad | Gallstones + Pneumobilia (air in bile ducts) + Small bowel obstruction | Gallstone Ileus |
| Whipple's Triad | Hypoglycaemic symptoms during fasting/exercise + Low blood glucose (<3 mmol/L) + Relief of symptoms with glucose administration | Insulinoma |
| Achalasia Triad | Dysphagia + Regurgitation + Weight loss | Achalasia |
| Borchardt's Triad | Severe epigastric pain + Retching without vomiting + Inability to pass NG tube | Acute Gastric Volvulus |
| Saint's Triad | Gallstones + Diverticulosis + Hiatus hernia | Saint's Triad (coincident conditions) |
| Acute Diverticulitis | Left lower quadrant pain + Fever + Leukocytosis | Sigmoid Diverticulitis |
Charcot's triad confirmed in Bailey & Love's, Sleisenger & Fordtran's, Schwartz's Surgery, Rosen's Emergency Medicine.
| Triad Name | Three Components | Diagnosis |
|---|---|---|
| Samter's Triad (Aspirin Triad) | Aspirin/NSAID sensitivity + Nasal polyps + Asthma | Aspirin-Exacerbated Respiratory Disease (AERD) |
| Allergic/Atopic Triad | Eczema (atopic dermatitis) + Allergic rhinitis + Asthma | Atopy |
| Mackler's Triad / Boerhaave Syndrome | Vomiting + Lower thoracic pain + Subcutaneous emphysema | Oesophageal Perforation (Boerhaave Syndrome) |
| Triad Name | Three Components | Diagnosis |
|---|---|---|
| Weil's Disease Triad (Leptospirosis) | Meningitis + Liver damage (jaundice) + Renal dysfunction | Weil Disease (severe leptospirosis) |
| Austrian Syndrome Triad | Pneumonia + Endocarditis + Meningitis (all from S. pneumoniae) | Austrian Syndrome |
| Rocky Mountain Spotted Fever | Fever + Headache + Petechial rash (centripetal spread, distal → central) | RMSF (Rickettsia rickettsii) |
| Congenital Toxoplasmosis Triad | Chorioretinitis + Hydrocephalus + Intracranial calcifications | Congenital Toxoplasmosis |
| Congenital Rubella Triad (Gregg's Triad) | Cataracts + Patent ductus arteriosus + Sensorineural hearing loss | Congenital Rubella Syndrome |
RMSF triad confirmed in Washington Manual of Medical Therapeutics. Leptospirosis triad confirmed in Quick Compendium of Clinical Pathology 5th Ed.
| Triad Name | Three Components | Diagnosis |
|---|---|---|
| Reiter's Syndrome / Reactive Arthritis Triad | "Can't see" (conjunctivitis/uveitis) + "Can't pee" (urethritis) + "Can't climb a tree" (arthritis) | Reactive Arthritis |
| Behcet's Disease Triad | Recurrent oral aphthous ulcers + Genital ulcers + Iridocyclitis (uveitis) | Behcet's Disease |
| Triad Name | Three Components | Diagnosis |
|---|---|---|
| Acute Interstitial Nephritis (AIN) Triad | Fever + Maculopapular rash + Peripheral eosinophilia | Acute Interstitial Nephritis |
| Fanconi Syndrome Triad | Aminoaciduria + Proteinuria + Phosphaturia | Fanconi Syndrome |
| Alport Syndrome Triad | Sensorineural deafness + Progressive renal failure + Ocular anomalies | Alport Syndrome |
| Dietl's Crisis | Renal colic + Loin swelling (disappears after urination) + Nausea/vomiting | Hydronephrosis |
AIN triad confirmed in Frameworks for Internal Medicine.
| Triad Name | Three Components | Diagnosis |
|---|---|---|
| MEN 1 (Wermer's Syndrome) | Pituitary adenoma + Parathyroid hyperplasia + Pancreatic tumour (3 P's) | MEN Type 1 |
| MEN 2A Triad | Medullary thyroid carcinoma + Phaeochromocytoma + Parathyroid hyperplasia | MEN Type 2A |
| Cushing's Syndrome Triad | Central obesity + Striae + Hypertension | Cushing's Syndrome |
| Pellagra Triad (3 D's) | Dermatitis + Diarrhoea + Dementia | Pellagra (Niacin/B3 deficiency) |
| Acute Intermittent Porphyria Triad | Severe abdominal pain + Red/port-wine urine + Neuropsychiatric symptoms | AIP |
| Biotin Deficiency Triad | Alopecia + Glossitis + Dermatitis | Biotin (B7) deficiency |
| Triad Name | Three Components | Diagnosis |
|---|---|---|
| Pre-eclampsia Triad | Hypertension + Proteinuria + Oedema | Pre-eclampsia |
| Ectopic Pregnancy Triad | Amenorrhoea + Abdominal pain + Vaginal bleeding | Ectopic Pregnancy |
| Female Athlete Triad | Eating disorder/low energy availability + Amenorrhoea + Decreased bone mineral density | Relative Energy Deficiency in Sport |
| Triad Name | Three Components | Diagnosis |
|---|---|---|
| Unhappy Triad (O'Donoghue's) | ACL tear + MCL tear + Medial/lateral meniscus tear | Knee Injury ("Blown Knee") |
| Osteomyelitis Triad | Fever + Swelling + Tenderness/pain over bone | Acute Osteomyelitis |
| Leriche Syndrome Triad | Buttock claudication + Erectile dysfunction (impotence) + Symmetrical lower limb atrophy | Leriche Syndrome (Aortoiliac occlusion) |
Osteomyelitis triad confirmed in Campbell's Operative Orthopaedics 15th Ed.
| Triad Name | Three Components | Diagnosis |
|---|---|---|
| Meniere's Disease Triad | Episodic vertigo + Tinnitus + Sensorineural hearing loss | Meniere's Disease |
| Trotter's Triad | Conductive deafness + Immobility of homolateral soft palate + Trigeminal neuralgia | Nasopharyngeal Carcinoma |
| Pierre Robin Triad | Micrognathia (small jaw) + Glossoptosis (tongue falling back) + Airway compromise | Pierre Robin Sequence |
| Plummer-Vinson Syndrome Triad | Dysphagia + Iron-deficiency anaemia + Oesophageal web | Plummer-Vinson Syndrome |
| Triad Name | Three Components | Diagnosis |
|---|---|---|
| Horner's Syndrome | Ptosis + Miosis + Anhidrosis | Sympathetic chain interruption |
| Congenital Toxoplasmosis | Chorioretinitis + Hydrocephalus + Intracranial calcifications | Congenital Toxoplasmosis |
| Triad Name | Three Components | Diagnosis |
|---|---|---|
| Virchow's Triad | Stasis (slow blood flow) + Hypercoagulability + Endothelial/vessel wall injury | Venous Thromboembolism (DVT/PE) |
| Alkaptonuria Triad | Ochronotic arthritis + Ochronotic pigmentation + Urine darkens on standing | Alkaptonuria |
| Triad Name | Three Components | Diagnosis |
|---|---|---|
| Congenital Rubella (Gregg's) | Cataracts + PDA + Sensorineural deafness | Congenital Rubella |
| Congenital Toxoplasmosis | Chorioretinitis + Hydrocephalus + Intracranial calcifications | Congenital Toxoplasmosis |
| Tetany in Children | Stridor + Carpopedal spasm + Convulsions | Hypocalcaemic Tetany |
| Down Syndrome Screening (Triple Test) | hCG + Oestriol (uE3) + AFP | Down Syndrome (prenatal screening) |
| Mnemonic / Keyword | Triad | Diagnosis |
|---|---|---|
| Beck's = Bag (muffled) + Bulging (JVD) + BP down | Muffled sounds + JVD + Hypotension | Cardiac Tamponade |
| Charcot's (biliary) = Pain + Fever + Yellow | RUQ pain + Fever + Jaundice | Ascending Cholangitis |
| Charcot's (neuro) = SIN | Speech + Intention tremor + Nystagmus | Multiple Sclerosis |
| Cushing's = HBO | Hypertension + Bradycardia + (ir)regular breathing | Raised ICP |
| Wernicke's = COA | Confusion + Ophthalmoplegia + Ataxia | Thiamine deficiency |
| NPH / Hakim's = 3 W's | Wet + Wobbly + Wacky | Normal Pressure Hydrocephalus |
| Virchow's = SHE | Stasis + Hypercoagulability + Endothelial injury | DVT/PE |
| Reactive Arthritis = 3 C's | Can't see + Can't pee + Can't climb | Reiter's/Reactive Arthritis |
| Pellagra = 3 D's | Dermatitis + Diarrhoea + Dementia | Niacin deficiency |
| Opioid OD = PPR | Pinpoint pupils + CNS depression + Respiratory depression | Opioid toxicity |
| Meniere's = VTH | Vertigo + Tinnitus + Hearing loss | Meniere's disease |
| Boerhaave = VPS | Vomiting + Pain (thoracic) + Subcutaneous emphysema | Oesophageal perforation |
| Lethal Triad = HAC | Hypothermia + Acidosis + Coagulopathy | Trauma death |
Create comparison tables for similar triads with a cheat sheet design include maxm symptoms
mkdir -p /home/daytona/workspace/triads-cheatsheet && ls /home/daytona/workspace/triads-cheatsheet
~/triads-cheatsheet/build.js
const pptxgen = require("pptxgenjs");
const pres = new pptxgen();
pres.layout = "LAYOUT_WIDE"; // 13.3 x 7.5 — wide format for cheat sheet density
pres.title = "Medical Triads Cheat Sheet";
// ── PALETTE ───────────────────────────────────────────────────────────────────
const C = {
bg: "0D1B2A", // deep navy bg
panel: "112236", // slightly lighter panel
card: "162C46", // card bg
border: "1A3A5C", // subtle border
white: "FFFFFF",
silver: "B8C8D8",
gold: "F0A500", // accent headings
teal: "17B8BE", // neuro
red: "E8354A", // emergency
orange: "E87525", // cardio
green: "27AE60", // GI
purple: "8E44AD", // neuro2
blue: "2980B9", // infective
pink: "E91E8C", // OB/GYN
lime: "7CB518", // ortho
cyan: "00BCD4", // ENT
maroon: "C0392B", // heme
};
// ── HELPERS ───────────────────────────────────────────────────────────────────
function bg(sl) {
sl.addShape("rect", { x:0, y:0, w:13.3, h:7.5, fill:{color:C.bg}, line:{color:C.bg} });
}
function hdr(sl, text, color, x, y, w, h) {
sl.addShape("rect", { x, y, w, h, fill:{color:color}, line:{color:color} });
sl.addText(text, { x:x+0.06, y:y+0.02, w:w-0.12, h:h-0.04,
fontSize:9, bold:true, color:C.white, valign:"middle", align:"center", margin:0, charSpacing:1 });
}
function cell(sl, text, x, y, w, h, opts={}) {
const bgColor = opts.bg || C.card;
const fColor = opts.fc || C.white;
const fSize = opts.fs || 8.5;
sl.addShape("rect", { x, y, w, h, fill:{color:bgColor}, line:{color:C.border} });
sl.addText(text, { x:x+0.05, y:y+0.02, w:w-0.1, h:h-0.04,
fontSize:fSize, color:fColor, valign:"middle", align:opts.align||"left",
bold:!!opts.bold, italic:!!opts.italic, margin:0, fontFace:"Calibri",
wrap: true });
}
function sectionTitle(sl, text, color, x, y, w) {
sl.addShape("rect", { x, y, w, h:0.28, fill:{color:color}, line:{color:color} });
sl.addShape("rect", { x, y:y+0.28, w, h:0.03, fill:{color:C.gold}, line:{color:C.gold} });
sl.addText(text, { x:x+0.08, y:y, w:w-0.16, h:0.28,
fontSize:9.5, bold:true, color:C.white, valign:"middle", charSpacing:2, margin:0 });
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 1 — TITLE / COVER
// ═══════════════════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
bg(sl);
// Decorative stripes
const stripes = [C.red,C.orange,C.green,C.teal,C.purple,C.blue,C.pink,C.lime,C.cyan,C.gold];
stripes.forEach((c,i) => {
sl.addShape("rect",{x:0,y:i*0.75,w:0.22,h:0.75,fill:{color:c},line:{color:c}});
});
sl.addShape("rect",{x:0.22,y:0,w:0.06,h:7.5,fill:{color:C.gold},line:{color:C.gold}});
sl.addText("MEDICAL TRIADS", {
x:0.55, y:1.2, w:12.5, h:1.6,
fontSize:72, bold:true, color:C.white, fontFace:"Calibri",
charSpacing:8, align:"left", margin:0
});
sl.addText("DIAGNOSTIC CHEAT SHEET", {
x:0.55, y:2.9, w:12.5, h:0.65,
fontSize:28, bold:false, color:C.gold, fontFace:"Calibri",
charSpacing:5, align:"left", margin:0
});
sl.addText("Comparison Tables by Specialty · Maximum Symptoms per Triad · Emergency Flags", {
x:0.55, y:3.65, w:12.5, h:0.45,
fontSize:15, color:C.silver, align:"left", margin:0
});
// Specialty pills at bottom
const specs = [
{t:"EMERGENCY", c:C.red}, {t:"CARDIOLOGY", c:C.orange}, {t:"NEUROLOGY", c:C.teal},
{t:"GI/HEPATOLOGY", c:C.green}, {t:"INFECTIOUS", c:C.blue}, {t:"RHEUMATOLOGY", c:C.purple},
{t:"NEPHROLOGY", c:"1A8A9A"}, {t:"ENDOCRINE", c:C.gold}, {t:"OB/GYN", c:C.pink},
{t:"ORTHOPAEDICS", c:C.lime}, {t:"ENT", c:C.cyan}, {t:"HAEMATOLOGY", c:C.maroon},
];
specs.forEach((s,i) => {
const x = 0.55 + (i % 6) * 2.1;
const y = 4.35 + Math.floor(i/6) * 0.52;
sl.addShape("rect",{x,y,w:1.95,h:0.38,fill:{color:s.c},line:{color:s.c},
shadow:{type:"outer",color:"000000",blur:4,offset:2,angle:135,opacity:0.2}});
sl.addText(s.t,{x:x+0.05,y:y+0.03,w:1.85,h:0.32,fontSize:9,bold:true,color:C.white,
align:"center",valign:"middle",margin:0,charSpacing:1});
});
sl.addShape("rect",{x:0,y:7.1,w:13.3,h:0.4,fill:{color:C.gold},line:{color:C.gold}});
sl.addText("Sources: Bailey & Love's Surgery · Rosen's Emergency Medicine · Washington Manual · Frameworks for Internal Medicine · Sleisenger & Fordtran's GI · Schwartz's Surgery",{
x:0.2,y:7.1,w:12.9,h:0.4,fontSize:8,color:C.bg,align:"center",valign:"middle",margin:0});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 2 — EMERGENCY & CARDIOVASCULAR TRIADS
// ═══════════════════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
bg(sl);
// Title bar
sl.addShape("rect",{x:0,y:0,w:13.3,h:0.38,fill:{color:C.red},line:{color:C.red}});
sl.addText("⚡ EMERGENCY & CARDIOVASCULAR TRIADS — Comparison Table",{
x:0.15,y:0,w:13,h:0.38,fontSize:13,bold:true,color:C.white,valign:"middle",charSpacing:1,margin:0});
// ── TABLE HEADERS ──────────────────────────────────────────────────────────
const cols = { name:0.12, dx:3.2, s1:5.1, s2:7.1, s3:9.1, extra:11.1 };
const cw = { name:3.06, dx:1.88, s1:1.98, s2:1.98, s3:1.98, extra:2.18 };
const hy = 0.42;
hdr(sl,"TRIAD NAME", cols.name, hy, cw.name, 0.3, C.red);
hdr(sl,"DIAGNOSIS", cols.dx, hy, cw.dx, 0.3, "8B1A1A");
hdr(sl,"SYMPTOM 1", cols.s1, hy, cw.s1, 0.3, "1A3A6B");
hdr(sl,"SYMPTOM 2", cols.s2, hy, cw.s2, 0.3, "1A3A6B");
hdr(sl,"SYMPTOM 3", cols.s3, hy, cw.s3, 0.3, "1A3A6B");
hdr(sl,"ADDITIONAL SIGNS", cols.extra,hy, cw.extra, 0.3, "0D2B4A");
const rows = [
{
name:"Beck's Triad", dx:"CARDIAC TAMPONADE",
s1:"Muffled / distant heart sounds",
s2:"Distended neck veins (raised JVP)",
s3:"Hypotension (↓BP)",
extra:"Pulsus paradoxus >10 mmHg · Tachycardia · Dyspnoea · Chest pain · Kussmaul sign · Friction rub (early) · Echocardiography confirms",
nc:C.red, flag:"🚨 EMERGENCY"
},
{
name:"Cushing's Triad", dx:"RAISED ICP (Impending Herniation)",
s1:"Hypertension (widened pulse pressure)",
s2:"Bradycardia (reflex vagal)",
s3:"Irregular respirations (Cheyne-Stokes)",
extra:"Papilloedema · Fixed dilated pupil · Altered GCS · Vomiting (projectile) · Headache (worse AM) · Decerebrate posturing · Impending tonsillar herniation",
nc:C.red, flag:"🚨 EMERGENCY"
},
{
name:"Triad of Aortic Stenosis", dx:"AORTIC STENOSIS",
s1:"Angina (exertional chest pain)",
s2:"Syncope (exertional)",
s3:"Heart failure (dyspnoea)",
extra:"Harsh ejection systolic murmur · Slow-rising pulse · Narrow pulse pressure · Heaving apex · Ejection click · Calcified valve on echo · Mean survival: angina 5yr, syncope 3yr, HF 2yr",
nc:C.orange, flag:""
},
{
name:"Pheochromocytoma Triad", dx:"PHAEOCHROMOCYTOMA",
s1:"Headache (severe, pulsating)",
s2:"Diaphoresis (profuse sweating)",
s3:"Palpitations / tachycardia",
extra:"Hypertensive crisis · Pallor · Anxiety/panic · Hyperglycaemia · Weight loss · Elevated urinary catecholamines · VMA/metanephrines in urine · Adrenal mass on CT",
nc:C.orange, flag:""
},
{
name:"Carcinoid Triad", dx:"CARCINOID SYNDROME",
s1:"Episodic flushing (skin redness)",
s2:"Secretory diarrhoea",
s3:"Right-sided heart failure (tricuspid/pulmonary valve lesions)",
extra:"Bronchospasm · Wheezing · Hepatomegaly (liver mets) · Elevated 5-HIAA urine · Serotonin responsible · Carcinoid crisis risk during surgery · Octreotide for treatment",
nc:C.orange, flag:""
},
{
name:"Lethal Triad (Trauma)", dx:"TRAUMA — IMMINENT DEATH",
s1:"Hypothermia (<35°C)",
s2:"Coagulopathy (↑PT/aPTT, ↓platelets)",
s3:"Metabolic acidosis (↓pH, ↑lactate)",
extra:"Each element worsens the others (vicious cycle) · Treat with damage control resuscitation · Massive transfusion protocol · Warm blood products · 1:1:1 pRBC:FFP:Plt · Target pH >7.35",
nc:C.red, flag:"🚨 EMERGENCY"
},
{
name:"Ruptured AAA Triad", dx:"RUPTURED AORTIC ANEURYSM",
s1:"Severe abdominal / back pain (tearing)",
s2:"Hypotension / shock",
s3:"Pulsatile abdominal mass",
extra:"Pain may radiate to groin/flank · May mimic renal colic · Haematuria possible · Retroperitoneal haematoma · CT angiography if stable · Emergency repair if unstable · High mortality without surgery",
nc:C.red, flag:"🚨 EMERGENCY"
},
];
rows.forEach((r, i) => {
const y = 0.76 + i * 0.91;
const rh = 0.88;
const alt = i%2===0 ? C.card : C.panel;
// Name cell with color tag
sl.addShape("rect",{x:cols.name,y,w:cw.name,h:rh,fill:{color:alt},line:{color:C.border}});
sl.addShape("rect",{x:cols.name,y,w:0.18,h:rh,fill:{color:r.nc},line:{color:r.nc}});
sl.addText(r.name,{x:cols.name+0.22,y:y+0.02,w:cw.name-0.28,h:0.28,
fontSize:9,bold:true,color:C.gold,margin:0});
if(r.flag) sl.addText(r.flag,{x:cols.name+0.22,y:y+0.3,w:cw.name-0.28,h:0.2,
fontSize:7.5,bold:true,color:C.red,margin:0});
cell(sl, r.dx, cols.dx, y, cw.dx, rh, {bg:alt, fc:C.silver, fs:8, bold:true});
cell(sl, r.s1, cols.s1, y, cw.s1, rh, {bg:alt, fc:C.white, fs:8.5});
cell(sl, r.s2, cols.s2, y, cw.s2, rh, {bg:alt, fc:C.white, fs:8.5});
cell(sl, r.s3, cols.s3, y, cw.s3, rh, {bg:alt, fc:C.white, fs:8.5});
cell(sl, r.extra, cols.extra, y, cw.extra, rh, {bg:alt, fc:C.silver, fs:7.5, italic:true});
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 3 — NEUROLOGY TRIADS
// ═══════════════════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
bg(sl);
sl.addShape("rect",{x:0,y:0,w:13.3,h:0.38,fill:{color:C.teal},line:{color:C.teal}});
sl.addText("🧠 NEUROLOGY TRIADS — Comparison Table",{
x:0.15,y:0,w:13,h:0.38,fontSize:13,bold:true,color:C.white,valign:"middle",charSpacing:1,margin:0});
const cols = { name:0.12, dx:3.2, s1:5.1, s2:7.1, s3:9.1, extra:11.1 };
const cw = { name:3.06, dx:1.88, s1:1.98, s2:1.98, s3:1.98, extra:2.18 };
const hy = 0.42;
hdr(sl,"TRIAD NAME", cols.name, hy, cw.name, 0.3, C.teal);
hdr(sl,"DIAGNOSIS", cols.dx, hy, cw.dx, 0.3, "0D5F62");
hdr(sl,"SYMPTOM 1", cols.s1, hy, cw.s1, 0.3, "1A3A6B");
hdr(sl,"SYMPTOM 2", cols.s2, hy, cw.s2, 0.3, "1A3A6B");
hdr(sl,"SYMPTOM 3", cols.s3, hy, cw.s3, 0.3, "1A3A6B");
hdr(sl,"ADDITIONAL SIGNS", cols.extra,hy, cw.extra, 0.3, "0D2B4A");
const rows = [
{
name:"Charcot's Neurological Triad", dx:"MULTIPLE SCLEROSIS",
s1:"Scanning/staccato speech (dysarthria)",
s2:"Intention tremor (cerebellar)",
s3:"Nystagmus (horizontal)",
extra:"Optic neuritis (↓visual acuity, Marcus Gunn pupil) · Uhthoff's phenomenon (worsens with heat) · Internuclear ophthalmoplegia · Lhermitte's sign · Fatigue · MRI: periventricular plaques · CSF: oligoclonal bands",
nc:C.teal
},
{
name:"Wernicke's Encephalopathy Triad", dx:"THIAMINE (B1) DEFICIENCY",
s1:"Confusion / delirium (global confusion)",
s2:"Ophthalmoplegia (bilateral lateral rectus palsy, conjugate gaze palsy)",
s3:"Ataxia (gait — wide-based, cerebellar)",
extra:"Seen in alcoholics, malnourished, hyperemesis gravidarum · If untreated → Korsakoff syndrome (anterograde amnesia + confabulation) · Treat URGENTLY: IV thiamine before glucose · Full triad in only 10-16%",
nc:C.teal
},
{
name:"Hakim's Triad (NPH)", dx:"NORMAL PRESSURE HYDROCEPHALUS",
s1:"Gait disturbance (magnetic gait — 'Wet, Wobbly')",
s2:"Urinary incontinence ('Wet')",
s3:"Dementia / cognitive decline ('Wacky')",
extra:"Gait disturbance appears FIRST · CT/MRI: dilated ventricles disproportionate to cortical atrophy · LP test: improvement after CSF drainage · Treatment: VP shunt · Normal opening CSF pressure on LP · Treatable cause of dementia",
nc:C.teal
},
{
name:"Horner's Syndrome Triad", dx:"SYMPATHETIC CHAIN INTERRUPTION",
s1:"Ptosis (drooping upper eyelid — partial)",
s2:"Miosis (constricted pupil — anisocoria)",
s3:"Anhidrosis (loss of sweating — ipsilateral face)",
extra:"Also: enophthalmos (apparent) · Causes: Pancoast tumour, carotid dissection, brainstem stroke, syringomyelia, neuroblastoma · Cocaine test: pupil doesn't dilate in Horner's · Hydroxyamphetamine test localises lesion",
nc:C.purple
},
{
name:"Botulism Triad", dx:"CLOSTRIDIUM BOTULINUM TOXIN",
s1:"Absence of fever (afebrile)",
s2:"Clear sensorium (alert, orientated)",
s3:"Symmetric DESCENDING flaccid paralysis starting with cranial nerves (ptosis, diplopia, dysarthria, dysphagia → respiratory failure)",
extra:"Autonomic features: dry mouth, blurred vision, constipation, urinary retention · Nausea/vomiting (food-borne) · Anti-toxin administration · ICU + ventilatory support · Differentials: GBS (ascending), myasthenia gravis",
nc:C.blue
},
{
name:"Opioid Overdose Triad", dx:"OPIOID TOXICITY",
s1:"Pinpoint pupils (bilateral miosis)",
s2:"CNS depression / unconsciousness",
s3:"Respiratory depression (↓RR, shallow breathing)",
extra:"Cyanosis · Bradycardia · Hypothermia · Bradypnoea (<12 breaths/min) · Naloxone (IV/IM/intranasal) reverses all features · Short half-life of naloxone → repeat dosing needed · Pulmonary oedema in severe cases",
nc:C.red
},
];
rows.forEach((r,i) => {
const y = 0.76 + i * 0.92;
const rh = 0.89;
const alt = i%2===0 ? C.card : C.panel;
sl.addShape("rect",{x:cols.name,y,w:cw.name,h:rh,fill:{color:alt},line:{color:C.border}});
sl.addShape("rect",{x:cols.name,y,w:0.18,h:rh,fill:{color:r.nc},line:{color:r.nc}});
sl.addText(r.name,{x:cols.name+0.22,y:y+0.02,w:cw.name-0.28,h:0.28,fontSize:9,bold:true,color:C.gold,margin:0});
cell(sl, r.dx, cols.dx, y, cw.dx, rh, {bg:alt,fc:C.silver,fs:8,bold:true});
cell(sl, r.s1, cols.s1, y, cw.s1, rh, {bg:alt,fc:C.white, fs:8.5});
cell(sl, r.s2, cols.s2, y, cw.s2, rh, {bg:alt,fc:C.white, fs:8.5});
cell(sl, r.s3, cols.s3, y, cw.s3, rh, {bg:alt,fc:C.white, fs:8.5});
cell(sl, r.extra, cols.extra, y, cw.extra, rh, {bg:alt,fc:C.silver,fs:7.5,italic:true});
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 4 — GASTROENTEROLOGY / HEPATOLOGY TRIADS
// ═══════════════════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
bg(sl);
sl.addShape("rect",{x:0,y:0,w:13.3,h:0.38,fill:{color:C.green},line:{color:C.green}});
sl.addText("🫀 GASTROENTEROLOGY & HEPATOLOGY TRIADS — Comparison Table",{
x:0.15,y:0,w:13,h:0.38,fontSize:13,bold:true,color:C.white,valign:"middle",charSpacing:1,margin:0});
const cols = {name:0.12,dx:3.2,s1:5.1,s2:7.1,s3:9.1,extra:11.1};
const cw = {name:3.06,dx:1.88,s1:1.98,s2:1.98,s3:1.98,extra:2.18};
const hy=0.42;
hdr(sl,"TRIAD NAME", cols.name,hy,cw.name,0.3,C.green);
hdr(sl,"DIAGNOSIS", cols.dx, hy,cw.dx, 0.3,"145A2E");
hdr(sl,"SYMPTOM 1", cols.s1, hy,cw.s1, 0.3,"1A3A6B");
hdr(sl,"SYMPTOM 2", cols.s2, hy,cw.s2, 0.3,"1A3A6B");
hdr(sl,"SYMPTOM 3", cols.s3, hy,cw.s3, 0.3,"1A3A6B");
hdr(sl,"ADDITIONAL SIGNS", cols.extra,hy,cw.extra,0.3,"0D2B4A");
const rows = [
{
name:"Charcot's Cholangitis Triad", dx:"ASCENDING CHOLANGITIS",
s1:"Right upper quadrant pain (biliary colic)",
s2:"Fever with rigors / chills",
s3:"Jaundice (obstructive — pale stools, dark urine)",
extra:"Present in ~70% · Reynolds' Pentad adds: confusion + hypotension (septic shock) → immediate intervention · Blood cultures · IV antibiotics · ERCP for decompression · LFTs: raised ALP/GGT/bilirubin · Gallstone most common cause",
nc:C.green, flag:"🚨 EMERGENCY"
},
{
name:"Budd-Chiari Syndrome Triad", dx:"HEPATIC VEIN THROMBOSIS",
s1:"Abdominal pain (acute, RUQ/diffuse)",
s2:"Ascites (massive, rapid-onset)",
s3:"Hepatomegaly (tender)",
extra:"Splenomegaly · Jaundice · Varices · Liver biopsy: centrilobular necrosis, congestion · US Doppler: absent/reversed hepatic vein flow · Associated with hypercoagulable states, OCP, polycythaemia vera · Treatment: anticoagulation, TIPS, transplant",
nc:C.green
},
{
name:"Acute Liver Failure Triad", dx:"ACUTE LIVER FAILURE",
s1:"Jaundice (rapidly deepening)",
s2:"Coagulopathy (↑PT/INR, bleeding)",
s3:"Hepatic encephalopathy (confusion → coma)",
extra:"Cerebral oedema · Hypoglycaemia · Renal failure · Infections · Coagulopathy: PT/INR > 1.5 · Causes: paracetamol OD (#1), viral hepatitis, Wilson's disease, Amanita phalloides · N-acetylcysteine for paracetamol · Transplant assessment",
nc:C.green
},
{
name:"Whipple's Triad", dx:"INSULINOMA",
s1:"Hypoglycaemic symptoms during fasting/exercise (sweating, tremor, confusion)",
s2:"Documented low blood glucose (<2.2 mmol/L during attack)",
s3:"Complete relief of symptoms with glucose administration",
extra:"Sympathetic: sweating, palpitations, tremor, hunger · Neuroglycopenic: confusion, seizures, coma · 72-hour fast test for diagnosis · CT/MRI: pancreatic mass · Elevated insulin:glucose ratio · Elevated C-peptide · Surgery is curative",
nc:C.gold
},
{
name:"Rigler's Triad", dx:"GALLSTONE ILEUS",
s1:"Gallstones (history of cholelithiasis)",
s2:"Pneumobilia (air in bile ducts on X-ray/CT)",
s3:"Small bowel obstruction (dilated loops, air-fluid levels)",
extra:"Large gallstone erodes through cholecystoduodenal fistula · Ectopic gallstone in terminal ileum (commonest site) · Ectopic stone at Bouveret's level (duodenum) · CT is investigation of choice · Treatment: enterolithotomy · Older female patients",
nc:C.green
},
{
name:"Achalasia Triad", dx:"ACHALASIA (OESOPHAGEAL)",
s1:"Dysphagia (progressive — both solids AND liquids)",
s2:"Regurgitation (undigested food)",
s3:"Weight loss (progressive)",
extra:"Nocturnal regurgitation · Aspiration pneumonia · Retrosternal chest pain (early) · Manometry: ↑LES pressure + absent peristalsis (GOLD STANDARD) · Barium swallow: 'bird-beak' sign · Heller's myotomy or pneumatic dilation",
nc:C.green
},
{
name:"Borchardt's Triad", dx:"ACUTE GASTRIC VOLVULUS",
s1:"Severe epigastric pain (sudden onset)",
s2:"Retching without vomiting (unproductive vomiting)",
s3:"Inability to pass nasogastric tube",
extra:"Associated with diaphragmatic hernia · Gaseous distension of stomach · CXR: gas-filled viscus in chest · Often elderly females · Prone to strangulation and infarction · Gastroscopy often impossible · Emergency surgery required",
nc:C.red, flag:"🚨 EMERGENCY"
},
];
rows.forEach((r,i) => {
const y = 0.76 + i * 0.91;
const rh = 0.88;
const alt = i%2===0 ? C.card : C.panel;
sl.addShape("rect",{x:cols.name,y,w:cw.name,h:rh,fill:{color:alt},line:{color:C.border}});
sl.addShape("rect",{x:cols.name,y,w:0.18,h:rh,fill:{color:r.nc},line:{color:r.nc}});
sl.addText(r.name,{x:cols.name+0.22,y:y+0.02,w:cw.name-0.28,h:0.28,fontSize:9,bold:true,color:C.gold,margin:0});
if(r.flag) sl.addText(r.flag,{x:cols.name+0.22,y:y+0.3,w:cw.name-0.28,h:0.2,fontSize:7.5,bold:true,color:C.red,margin:0});
cell(sl,r.dx, cols.dx, y,cw.dx, rh,{bg:alt,fc:C.silver,fs:8,bold:true});
cell(sl,r.s1, cols.s1, y,cw.s1, rh,{bg:alt,fc:C.white, fs:8.5});
cell(sl,r.s2, cols.s2, y,cw.s2, rh,{bg:alt,fc:C.white, fs:8.5});
cell(sl,r.s3, cols.s3, y,cw.s3, rh,{bg:alt,fc:C.white, fs:8.5});
cell(sl,r.extra, cols.extra, y,cw.extra, rh,{bg:alt,fc:C.silver,fs:7.5,italic:true});
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 5 — INFECTIOUS, RHEUMATOLOGY & NEPHROLOGY TRIADS
// ═══════════════════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
bg(sl);
sl.addShape("rect",{x:0,y:0,w:13.3,h:0.38,fill:{color:C.blue},line:{color:C.blue}});
sl.addText("🦠 INFECTIOUS DISEASE · RHEUMATOLOGY · NEPHROLOGY TRIADS",{
x:0.15,y:0,w:13,h:0.38,fontSize:13,bold:true,color:C.white,valign:"middle",charSpacing:1,margin:0});
const cols={name:0.12,dx:3.2,s1:5.1,s2:7.1,s3:9.1,extra:11.1};
const cw ={name:3.06,dx:1.88,s1:1.98,s2:1.98,s3:1.98,extra:2.18};
const hy=0.42;
hdr(sl,"TRIAD NAME", cols.name,hy,cw.name,0.3,C.blue);
hdr(sl,"DIAGNOSIS", cols.dx, hy,cw.dx, 0.3,"0D3B6E");
hdr(sl,"SYMPTOM 1", cols.s1, hy,cw.s1, 0.3,"1A3A6B");
hdr(sl,"SYMPTOM 2", cols.s2, hy,cw.s2, 0.3,"1A3A6B");
hdr(sl,"SYMPTOM 3", cols.s3, hy,cw.s3, 0.3,"1A3A6B");
hdr(sl,"ADDITIONAL SIGNS", cols.extra,hy,cw.extra,0.3,"0D2B4A");
const rows = [
{
name:"Weil's Disease Triad (Leptospirosis)", dx:"LEPTOSPIROSIS (Weil disease)",
s1:"Meningitis (severe headache, neck stiffness, photophobia)",
s2:"Liver damage (jaundice, elevated LFTs, haemorrhage)",
s3:"Renal dysfunction (AKI, oliguria, uraemia)",
extra:"Biphasic illness: 1st phase — flu-like (4-7 days) → 2nd phase (immune): Weil triad · Conjunctival suffusion (hallmark) · Leptospiraemia → serology/PCR diagnosis · Penicillin/doxycycline · Rodent urine exposure",
nc:C.blue
},
{
name:"Reactive Arthritis Triad (Reiter's)", dx:"REACTIVE ARTHRITIS",
s1:"Conjunctivitis / uveitis ('Can't SEE')",
s2:"Urethritis / cervicitis ('Can't PEE')",
s3:"Arthritis — asymmetric, large joints ('Can't climb a TREE')",
extra:"Also: mouth ulcers · Keratoderma blennorrhagica (soles) · Circinate balanitis · Triggered by Chlamydia (STI) or enteric infection (Salmonella/Shigella/Campylobacter) · HLA-B27 positive · NSAIDs + physiotherapy",
nc:C.purple
},
{
name:"Behcet's Disease Triad", dx:"BEHCET'S DISEASE",
s1:"Recurrent oral aphthous ulcers (painful, multiple, ≥3×/year)",
s2:"Genital ulcers (painful, scarring)",
s3:"Iridocyclitis / uveitis (anterior or posterior)",
extra:"Pathergy test positive · Skin lesions (pseudofolliculitis, erythema nodosum) · Large vessel vasculitis (DVT, Budd-Chiari) · Neurological involvement · Common in 'Silk Road' countries · Colchicine for mucocutaneous disease · Immunosuppressants for eye/CNS",
nc:C.purple
},
{
name:"AIN Triad (Acute Interstitial Nephritis)", dx:"ACUTE INTERSTITIAL NEPHRITIS",
s1:"Fever",
s2:"Maculopapular rash",
s3:"Peripheral eosinophilia",
extra:"All 3 present in only 10% of cases · AKI (↑creatinine) · Eosinophiluria on urine dipstick · Drugs: NSAIDs, PPIs, beta-lactam antibiotics, sulfonamides · Sterile pyuria · White cell casts · Renal biopsy confirms · Steroids if drug-related",
nc:"1A8A9A"
},
{
name:"Austrian Syndrome Triad", dx:"AUSTRIAN SYNDROME (S. pneumoniae)",
s1:"Pneumonia (lobar consolidation)",
s2:"Endocarditis (new murmur, vegetations)",
s3:"Meningitis (neck stiffness, photophobia, altered GCS)",
extra:"All three from S. pneumoniae · Blood cultures + Echo + LP · Penicillin G treatment · High mortality · Associated alcoholism/asplenia · Aortic valve most commonly affected · Simultaneous seeding via bacteraemia",
nc:C.blue
},
{
name:"Congenital Rubella Triad (Gregg's)", dx:"CONGENITAL RUBELLA SYNDROME",
s1:"Cataracts (bilateral nuclear cataracts)",
s2:"Patent ductus arteriosus (continuous machinery murmur)",
s3:"Sensorineural hearing loss (bilateral)",
extra:"Also: microcephaly · Microphthalmia · 'Blueberry muffin' rash (dermal haematopoiesis) · Cardiac defects: PDA, VSD, pulmonary artery stenosis · Rubella IgM titre · Prevention: MMR vaccine pre-pregnancy",
nc:C.blue
},
{
name:"Congenital Toxoplasmosis Triad (Sabin's)", dx:"CONGENITAL TOXOPLASMOSIS",
s1:"Chorioretinitis (retinochoroiditis — visual impairment, squint)",
s2:"Hydrocephalus (large head circumference, bulging fontanelle)",
s3:"Intracranial calcifications (periventricular, on CT skull)",
extra:"Also: psychomotor retardation · Seizures · Microcephaly · Toxoplasma gondii (cat faeces) · Maternal infection in 3rd trimester → worst fetal outcome · IgG avidity + PCR of amniotic fluid · Pyrimethamine + sulphadiazine",
nc:C.blue
},
];
rows.forEach((r,i) => {
const y = 0.76 + i * 0.91;
const rh = 0.88;
const alt = i%2===0 ? C.card : C.panel;
sl.addShape("rect",{x:cols.name,y,w:cw.name,h:rh,fill:{color:alt},line:{color:C.border}});
sl.addShape("rect",{x:cols.name,y,w:0.18,h:rh,fill:{color:r.nc},line:{color:r.nc}});
sl.addText(r.name,{x:cols.name+0.22,y:y+0.02,w:cw.name-0.28,h:0.28,fontSize:9,bold:true,color:C.gold,margin:0});
cell(sl,r.dx, cols.dx, y,cw.dx, rh,{bg:alt,fc:C.silver,fs:8,bold:true});
cell(sl,r.s1, cols.s1, y,cw.s1, rh,{bg:alt,fc:C.white, fs:8.5});
cell(sl,r.s2, cols.s2, y,cw.s2, rh,{bg:alt,fc:C.white, fs:8.5});
cell(sl,r.s3, cols.s3, y,cw.s3, rh,{bg:alt,fc:C.white, fs:8.5});
cell(sl,r.extra, cols.extra, y,cw.extra, rh,{bg:alt,fc:C.silver,fs:7.5,italic:true});
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 6 — ENDOCRINE · OB/GYN · ORTHO · ENT · MISC
// ═══════════════════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
bg(sl);
sl.addShape("rect",{x:0,y:0,w:13.3,h:0.38,fill:{color:C.gold},line:{color:C.gold}});
sl.addText("💊 ENDOCRINE · OB/GYN · ORTHOPAEDICS · ENT · RESPIRATORY — Comparison Table",{
x:0.15,y:0,w:13,h:0.38,fontSize:13,bold:true,color:C.bg,valign:"middle",charSpacing:1,margin:0});
const cols={name:0.12,dx:3.2,s1:5.1,s2:7.1,s3:9.1,extra:11.1};
const cw ={name:3.06,dx:1.88,s1:1.98,s2:1.98,s3:1.98,extra:2.18};
const hy=0.42;
hdr(sl,"TRIAD NAME", cols.name,hy,cw.name,0.3,"8A6800");
hdr(sl,"DIAGNOSIS", cols.dx, hy,cw.dx, 0.3,"5A4200");
hdr(sl,"SYMPTOM 1", cols.s1, hy,cw.s1, 0.3,"1A3A6B");
hdr(sl,"SYMPTOM 2", cols.s2, hy,cw.s2, 0.3,"1A3A6B");
hdr(sl,"SYMPTOM 3", cols.s3, hy,cw.s3, 0.3,"1A3A6B");
hdr(sl,"ADDITIONAL SIGNS", cols.extra,hy,cw.extra,0.3,"0D2B4A");
const rows = [
{
name:"Pellagra Triad (3 D's)", dx:"PELLAGRA — NIACIN (B3) DEFICIENCY",
s1:"Dermatitis (Casal's necklace — sun-exposed photosensitive rash)",
s2:"Diarrhoea (watery, bloody — GI mucosal damage)",
s3:"Dementia / neuropsychiatric symptoms (depression, psychosis, confusion)",
extra:"4th D = Death (if untreated) · Also: glossitis, stomatitis, hyperpigmentation · Common in maize-eating populations, alcoholics, isoniazid use · Nicotinamide treatment · Hartnup disease (tryptophan malabsorption) as cause",
nc:"D4A017"
},
{
name:"Pre-eclampsia Triad", dx:"PRE-ECLAMPSIA",
s1:"Hypertension (≥140/90 mmHg after 20 weeks)",
s2:"Proteinuria (≥300 mg/24h, or dipstick ≥++)",
s3:"Oedema (especially face, hands — sudden pitting)",
extra:"Headache · Visual disturbances (scotomata) · Epigastric pain (liver capsule stretch) · ↑Uric acid · ↑Creatinine · HELLP syndrome (Haemolysis + Elevated LFTs + Low Platelets) · Delivery is definitive treatment · MgSO4 for seizure prophylaxis",
nc:C.pink
},
{
name:"Ectopic Pregnancy Triad", dx:"ECTOPIC PREGNANCY",
s1:"Amenorrhoea (missed period — 6-8 weeks LMP)",
s2:"Abdominal pain (unilateral, lower quadrant — may be sudden/severe if ruptured)",
s3:"Vaginal bleeding (dark brown, irregular spotting)",
extra:"Shoulder-tip pain (if ruptured — diaphragmatic irritation by blood) · Cervical excitation on PV exam · ↑βhCG but below expected for dates · TV USS: no IUP, adnexal mass · Risk factors: PID, previous ectopic, IUD, IVF · Methotrexate or salpingectomy",
nc:C.pink, flag:"🚨 EMERGENCY if ruptured"
},
{
name:"Unhappy Triad (O'Donoghue's)", dx:"KNEE INJURY (Blown Knee)",
s1:"ACL tear (anterior cruciate — Lachman test positive)",
s2:"MCL tear (medial collateral — valgus stress test positive)",
s3:"Medial/lateral meniscus tear (McMurray test positive)",
extra:"Mechanism: valgus + rotation force (contact sports) · Haemarthrosis (rapid swelling within hours) · MRI is investigation of choice · Reconstruction: ACL graft + meniscal repair · Associated with high-level sport · Medial meniscus more common in classic description",
nc:C.lime
},
{
name:"Samter's Triad (Aspirin Triad)", dx:"ASPIRIN-EXACERBATED RESPIRATORY DISEASE",
s1:"Aspirin / NSAID sensitivity (bronchospasm within 30-60 min of ingestion)",
s2:"Nasal polyps (bilateral, eosinophilic)",
s3:"Asthma (often severe, steroid-dependent)",
extra:"Also: chronic rhinosinusitis · Eosinophilic airway inflammation · Arachidonic acid pathway: ↑LTC4/D4/E4 leukotrienes · COX-1 inhibitors all trigger · Avoid aspirin/NSAIDs · Leukotriene receptor antagonists helpful · Aspirin desensitisation possible",
nc:C.teal
},
{
name:"Meniere's Disease Triad", dx:"MENIERE'S DISEASE",
s1:"Episodic vertigo (rotational, severe, spontaneous — 20 min to 12 hrs)",
s2:"Tinnitus (low-frequency roaring, worsens during attacks)",
s3:"Sensorineural hearing loss (unilateral, fluctuating, low-frequency early)",
extra:"Aural fullness (4th hallmark) · Endolymphatic hydrops on MRI (gadolinium) · Caloric testing: reduced vestibular response · Audiogram: low-frequency notch · Low-salt diet + betahistine · Intratympanic gentamicin or steroids · Endolymphatic sac surgery",
nc:C.cyan
},
{
name:"Leriche Syndrome Triad", dx:"AORTOILIAC OCCLUSIVE DISEASE",
s1:"Buttock/thigh claudication (bilateral, exertional)",
s2:"Erectile dysfunction (impotence — loss of pelvic blood flow)",
s3:"Symmetrical atrophy of both lower extremities",
extra:"Cool, pale limbs · Absent femoral pulses bilaterally · ABI <0.9 · CT angiography confirms occlusion at aortic bifurcation · Risk factors: smoking (#1), diabetes, dyslipidaemia · Aortobifemoral bypass or endovascular stenting",
nc:C.orange
},
];
rows.forEach((r,i) => {
const y = 0.76 + i * 0.91;
const rh = 0.88;
const alt = i%2===0 ? C.card : C.panel;
sl.addShape("rect",{x:cols.name,y,w:cw.name,h:rh,fill:{color:alt},line:{color:C.border}});
sl.addShape("rect",{x:cols.name,y,w:0.18,h:rh,fill:{color:r.nc},line:{color:r.nc}});
sl.addText(r.name,{x:cols.name+0.22,y:y+0.02,w:cw.name-0.28,h:0.28,fontSize:9,bold:true,color:C.gold,margin:0});
if(r.flag) sl.addText(r.flag,{x:cols.name+0.22,y:y+0.3,w:cw.name-0.28,h:0.2,fontSize:7,bold:true,color:C.red,margin:0});
cell(sl,r.dx, cols.dx, y,cw.dx, rh,{bg:alt,fc:C.silver,fs:8,bold:true});
cell(sl,r.s1, cols.s1, y,cw.s1, rh,{bg:alt,fc:C.white, fs:8.5});
cell(sl,r.s2, cols.s2, y,cw.s2, rh,{bg:alt,fc:C.white, fs:8.5});
cell(sl,r.s3, cols.s3, y,cw.s3, rh,{bg:alt,fc:C.white, fs:8.5});
cell(sl,r.extra, cols.extra, y,cw.extra, rh,{bg:alt,fc:C.silver,fs:7.5,italic:true});
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 7 — QUICK-FIRE CHEAT SHEET (MNEMONICS + FLASHCARD GRID)
// ═══════════════════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
bg(sl);
sl.addShape("rect",{x:0,y:0,w:13.3,h:0.42,fill:{color:"1A1A2E"},line:{color:"1A1A2E"}});
sl.addText("⚡ QUICK-FIRE MNEMONICS & CHEAT SHEET — All Key Triads at a Glance",{
x:0.15,y:0,w:13,h:0.42,fontSize:13,bold:true,color:C.gold,valign:"middle",charSpacing:2,margin:0});
const cards = [
// Row 1
{name:"Beck's", diag:"Cardiac Tamponade", s:"Muffled hearts\nJVD / Neck veins up\nHypotension", mnem:"BBB: Bag + Bulge + BP↓", c:C.red},
{name:"Cushing's", diag:"Raised ICP", s:"Hypertension\nBradycardia\nIrregular respiration", mnem:"HBO: HBP + Bradycardia + O2↓", c:C.red},
{name:"Charcot's (biliary)",diag:"Ascending Cholangitis", s:"RUQ Pain\nFever + Rigors\nJaundice", mnem:"PFJ: Pain-Fever-Jaundice", c:C.green},
{name:"Charcot's (neuro)", diag:"Multiple Sclerosis", s:"Scanning speech\nIntention tremor\nNystagmus", mnem:"SIN: Speech-Intention-Nystagmus", c:C.teal},
{name:"Wernicke's", diag:"Thiamine Deficiency", s:"Confusion\nOphthalmoplegia\nAtaxia", mnem:"COA: Confusion-Ophthalm-Ataxia", c:C.teal},
// Row 2
{name:"NPH / Hakim's", diag:"Normal Pressure Hydrocephalus",s:"Gait disturbance\nUrinary incontinence\nDementia", mnem:"3 W's: Wobbly-Wet-Wacky", c:C.purple},
{name:"Virchow's", diag:"Venous Thrombosis (DVT/PE)", s:"Stasis\nHypercoagulability\nEndothelial injury", mnem:"SHE: Stasis-Hyper-Endothelial", c:C.maroon},
{name:"Reactive Arthritis", diag:"Reiter's Syndrome", s:"Conjunctivitis\nUrethritis\nArthritis", mnem:"Can't SEE, PEE, climb a TREE", c:C.purple},
{name:"Opioid OD", diag:"Opioid Toxicity", s:"Pinpoint pupils\nCNS depression\nRespiratory↓", mnem:"PPR: Pupils-Peristalsis-Respiration", c:C.red},
{name:"Pellagra (3 D's)", diag:"Niacin (B3) Deficiency", s:"Dermatitis\nDiarrhoea\nDementia", mnem:"3 D's + Death = 4 D's", c:"D4A017"},
// Row 3
{name:"Pheochromocytoma", diag:"Phaeochromocytoma", s:"Headache\nDiaphoresis\nPalpitations", mnem:"HDP: Head-Diaphoresis-Palp", c:C.orange},
{name:"Horner's Syndrome", diag:"Sympathetic interruption", s:"Ptosis\nMiosis\nAnhidrosis", mnem:"PMA: Ptosis-Miosis-Anhidrosis", c:C.purple},
{name:"Meniere's", diag:"Meniere's Disease", s:"Vertigo\nTinnitus\nHearing loss", mnem:"VTH: Vertigo-Tinnitus-Hearing", c:C.cyan},
{name:"Ruptured AAA", diag:"AAA Rupture", s:"Abdominal pain\nHypotension/shock\nPulsatile mass", mnem:"APP: Abdo-Pressure↓-Pulsatile", c:C.red},
{name:"Lethal Triad", diag:"Trauma Death", s:"Hypothermia\nCoagulopathy\nAcidosis", mnem:"HCA: Hypo-Coagulo-Acidosis", c:C.red},
// Row 4
{name:"Boerhaave (Mackler)", diag:"Oesophageal Perforation", s:"Vomiting\nThoracic pain\nSubcut. emphysema", mnem:"VPS: Vomit-Pain-SubcutEmphysema", c:"C06A15"},
{name:"Rigler's", diag:"Gallstone Ileus", s:"Gallstones\nPneumobilia\nSmall bowel obstruction", mnem:"GPS: Gallstones-Pneumo-SBO", c:C.green},
{name:"Samter's Triad", diag:"NSAID-exacerbated Asthma", s:"Aspirin sensitivity\nNasal polyps\nAsthma", mnem:"ANA: Aspirin-Nasal-Asthma", c:C.teal},
{name:"Congenital Rubella", diag:"Rubella Syndrome", s:"Cataracts\nPDA\nDeafness", mnem:"CPD: Cataract-PDA-Deaf", c:C.blue},
{name:"Aortic Stenosis", diag:"Aortic Stenosis", s:"Angina\nSyncope\nHeart failure", mnem:"ASH: Angina-Syncope-HF", c:C.orange},
];
const cardsPerRow = 5;
const cardW = 2.53;
const cardH = 1.55;
const startX = 0.12;
const startY = 0.52;
const gapX = 0.06;
const gapY = 0.06;
cards.forEach((card, i) => {
const row = Math.floor(i / cardsPerRow);
const col = i % cardsPerRow;
const x = startX + col * (cardW + gapX);
const y = startY + row * (cardH + gapY);
// Card bg
sl.addShape("rect",{x,y,w:cardW,h:cardH,fill:{color:C.card},line:{color:C.border},
shadow:{type:"outer",color:"000000",blur:5,offset:2,angle:135,opacity:0.2}});
// Color top bar
sl.addShape("rect",{x,y,w:cardW,h:0.22,fill:{color:card.c},line:{color:card.c}});
// Triad name
sl.addText(card.name,{x:x+0.06,y:y+0.01,w:cardW-0.12,h:0.2,fontSize:8.5,bold:true,color:C.white,valign:"middle",margin:0});
// Diagnosis
sl.addText(card.diag,{x:x+0.06,y:y+0.22,w:cardW-0.12,h:0.22,fontSize:7.5,bold:true,color:C.gold,valign:"middle",margin:0,italic:true});
// Symptoms
sl.addText(card.s,{x:x+0.06,y:y+0.44,w:cardW-0.12,h:0.62,fontSize:8,color:C.white,valign:"top",margin:0,fontFace:"Calibri"});
// Mnemonic
sl.addShape("rect",{x:x+0.05,y:y+cardH-0.35,w:cardW-0.1,h:0.3,fill:{color:"0D1B2A"},line:{color:card.c}});
sl.addText(card.mnem,{x:x+0.08,y:y+cardH-0.34,w:cardW-0.16,h:0.28,fontSize:7,color:card.c,bold:true,valign:"middle",margin:0,italic:true});
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 8 — COMPARISON: TRIADS WITH OVERLAPPING SYMPTOMS
// ═══════════════════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
bg(sl);
sl.addShape("rect",{x:0,y:0,w:13.3,h:0.42,fill:{color:C.purple},line:{color:C.purple}});
sl.addText("🔍 TRIADS WITH SIMILAR SYMPTOMS — How to Tell Them Apart",{
x:0.15,y:0,w:13,h:0.42,fontSize:13,bold:true,color:C.white,valign:"middle",charSpacing:1,margin:0});
// ── GROUP 1: Triads with Jaundice ──────────────────────────────────────────
sectionTitle(sl,"GROUP 1: TRIADS INVOLVING JAUNDICE",C.green,0.12,0.5,5.5);
const jCols = {name:0.12,s1:2.1,s2:3.85,s3:5.7,key:7.5};
const jW = {name:1.96,s1:1.73,s2:1.83,s3:1.78,key:1.8};
hdr(sl,"CONDITION",jCols.name,0.82,jW.name,0.25,C.green);
hdr(sl,"SYMPTOM 1", jCols.s1, 0.82,jW.s1, 0.25,"1A5A3A");
hdr(sl,"SYMPTOM 2", jCols.s2, 0.82,jW.s2, 0.25,"1A5A3A");
hdr(sl,"SYMPTOM 3", jCols.s3, 0.82,jW.s3, 0.25,"1A5A3A");
hdr(sl,"KEY DIFF", jCols.key, 0.82,jW.key, 0.25,"0B3B22");
const jRows = [
{name:"Charcot's Triad", s1:"RUQ pain", s2:"Fever + rigors", s3:"Jaundice", key:"Acute onset, gallstones, ↑ALP",c:C.green},
{name:"Budd-Chiari", s1:"Abdominal pain", s2:"Ascites (massive)", s3:"Hepatomegaly", key:"Slow onset, no fever, Doppler↓",c:C.green},
{name:"Acute Liver Fail", s1:"Jaundice", s2:"Coagulopathy (↑INR)", s3:"Encephalopathy", key:"No pain, ↑↑PT, paracetamol Hx",c:C.green},
{name:"Weil's Disease", s1:"Meningitis signs", s2:"Jaundice", s3:"Renal failure (AKI)",key:"Rodent/water exposure, biphasic",c:C.blue},
{name:"Austrian Synd.", s1:"Pneumonia", s2:"Endocarditis", s3:"Meningitis", key:"All from S. pneumoniae, no jaundice",c:C.blue},
];
jRows.forEach((r,i)=>{
const y=1.1+i*0.44;const rh=0.42;const alt=i%2===0?C.card:C.panel;
cell(sl,r.name,jCols.name,y,jW.name,rh,{bg:alt,fc:C.gold,fs:8.5,bold:true});
cell(sl,r.s1, jCols.s1, y,jW.s1, rh,{bg:alt,fc:C.white,fs:8});
cell(sl,r.s2, jCols.s2, y,jW.s2, rh,{bg:alt,fc:C.white,fs:8});
cell(sl,r.s3, jCols.s3, y,jW.s3, rh,{bg:alt,fc:C.white,fs:8});
cell(sl,r.key, jCols.key, y,jW.key, rh,{bg:alt,fc:C.gold, fs:7.5,italic:true});
});
// ── GROUP 2: Triads with Hypotension ─────────────────────────────────────
sectionTitle(sl,"GROUP 2: TRIADS INVOLVING HYPOTENSION / SHOCK",C.red,0.12,3.3,5.5);
const hRows = [
{name:"Beck's Triad", s1:"Muffled heart sounds",s2:"JVD / ↑JVP", s3:"Hypotension", key:"Pulsus paradoxus, after trauma/pericarditis"},
{name:"Ruptured AAA", s1:"Abdominal pain", s2:"Hypotension", s3:"Pulsatile mass", key:"Elderly, smoker, absent femoral pulses"},
{name:"Lethal Triad", s1:"Hypothermia", s2:"Coagulopathy", s3:"Acidosis", key:"Trauma context, serial ABGs/labs"},
{name:"Botulism", s1:"No fever (afebrile)", s2:"Clear sensorium", s3:"Descending paralysis",key:"Food source, autonomic signs, no sensory loss"},
{name:"Opioid OD", s1:"Pinpoint pupils", s2:"CNS depression", s3:"Resp. depression",key:"Naloxone reversal, drug context"},
];
hRows.forEach((r,i)=>{
const y=3.58+i*0.44;const rh=0.42;const alt=i%2===0?C.card:C.panel;
cell(sl,r.name,jCols.name,y,jW.name,rh,{bg:alt,fc:C.gold,fs:8.5,bold:true});
cell(sl,r.s1, jCols.s1, y,jW.s1, rh,{bg:alt,fc:C.white,fs:8});
cell(sl,r.s2, jCols.s2, y,jW.s2, rh,{bg:alt,fc:C.white,fs:8});
cell(sl,r.s3, jCols.s3, y,jW.s3, rh,{bg:alt,fc:C.white,fs:8});
cell(sl,r.key, jCols.key, y,jW.key, rh,{bg:alt,fc:C.gold, fs:7.5,italic:true});
});
// ── GROUP 3: NEUROLOGICAL ─────────────────────────────────────────────────
sectionTitle(sl,"GROUP 3: NEUROLOGICAL TRIADS",C.teal,7.1,0.5,6.1);
const nCols={name:7.1,s1:8.9,s2:10.55,s3:12.15};
const nW ={name:1.78,s1:1.63,s2:1.58,s3:1.15};
hdr(sl,"CONDITION",nCols.name,0.82,nW.name,0.25,C.teal);
hdr(sl,"SYMPTOM 1", nCols.s1, 0.82,nW.s1, 0.25,"0D5F62");
hdr(sl,"SYMPTOM 2", nCols.s2, 0.82,nW.s2, 0.25,"0D5F62");
hdr(sl,"SYMPTOM 3", nCols.s3, 0.82,nW.s3, 0.25,"0D5F62");
const nRows = [
{name:"Charcot (neuro)",s1:"Scanning speech", s2:"Intention tremor", s3:"Nystagmus", c:C.teal},
{name:"Wernicke's", s1:"Confusion", s2:"Ophthalmoplegia", s3:"Ataxia", c:C.teal},
{name:"NPH / Hakim's", s1:"Gait disturbance", s2:"Incontinence", s3:"Dementia", c:C.teal},
{name:"Horner's", s1:"Ptosis (partial)", s2:"Miosis (anisocoria)",s3:"Anhidrosis (face)", c:C.purple},
{name:"Cushing's", s1:"Hypertension", s2:"Bradycardia", s3:"Irreg. respiration",c:C.red},
{name:"Botulism", s1:"No fever", s2:"Clear sensorium", s3:"Descend. paralysis",c:C.blue},
{name:"Opioid OD", s1:"Pinpoint pupils", s2:"CNS depression", s3:"Resp. depression", c:C.red},
];
nRows.forEach((r,i)=>{
const y=1.1+i*0.44;const rh=0.42;const alt=i%2===0?C.card:C.panel;
sl.addShape("rect",{x:nCols.name,y,w:nW.name,h:rh,fill:{color:alt},line:{color:C.border}});
sl.addShape("rect",{x:nCols.name,y,w:0.14,h:rh,fill:{color:r.c},line:{color:r.c}});
sl.addText(r.name,{x:nCols.name+0.17,y:y+0.06,w:nW.name-0.2,h:0.3,fontSize:8.5,bold:true,color:C.gold,margin:0});
cell(sl,r.s1,nCols.s1,y,nW.s1,rh,{bg:alt,fc:C.white,fs:8});
cell(sl,r.s2,nCols.s2,y,nW.s2,rh,{bg:alt,fc:C.white,fs:8});
cell(sl,r.s3,nCols.s3,y,nW.s3,rh,{bg:alt,fc:C.white,fs:8});
});
// ── GROUP 4: Congenital ────────────────────────────────────────────────────
sectionTitle(sl,"GROUP 4: CONGENITAL TRIADS",C.blue,7.1,4.22,6.1);
const conRows = [
{name:"Congenital Rubella", s1:"Cataracts", s2:"PDA", s3:"Sensorineural deafness"},
{name:"Congenital Toxoplasma", s1:"Chorioretinitis", s2:"Hydrocephalus", s3:"Intracranial calcifications"},
{name:"Congenital Syphilis", s1:"Interstitial keratitis",s2:"Hutchinson's teeth", s3:"8th nerve deafness (Hutchinson's Triad)"},
];
conRows.forEach((r,i)=>{
const y=4.5+i*0.44;const rh=0.42;const alt=i%2===0?C.card:C.panel;
sl.addShape("rect",{x:nCols.name,y,w:nW.name,h:rh,fill:{color:alt},line:{color:C.border}});
sl.addShape("rect",{x:nCols.name,y,w:0.14,h:rh,fill:{color:C.blue},line:{color:C.blue}});
sl.addText(r.name,{x:nCols.name+0.17,y:y+0.06,w:nW.name-0.2,h:0.3,fontSize:8.5,bold:true,color:C.gold,margin:0});
cell(sl,r.s1,nCols.s1,y,nW.s1,rh,{bg:alt,fc:C.white,fs:8});
cell(sl,r.s2,nCols.s2,y,nW.s2,rh,{bg:alt,fc:C.white,fs:8});
cell(sl,r.s3,nCols.s3,y,nW.s3,rh,{bg:alt,fc:C.white,fs:8});
});
}
// ── WRITE ──────────────────────────────────────────────────────────────────────
const outPath = "/home/daytona/workspace/triads-cheatsheet/Medical_Triads_CheatSheet.pptx";
pres.writeFile({fileName:outPath}).then(()=>{
console.log("SUCCESS:", outPath);
}).catch(err=>console.error("ERROR:",err));
cd /home/daytona/workspace/triads-cheatsheet && node build.js 2>&1
cd /home/daytona/workspace/triads-cheatsheet && node -e " const pptxgen = require('pptxgenjs'); const p = new pptxgen(); const sl = p.addSlide(); // test shadow sl.addShape('rect',{x:0,y:0,w:2,h:1,fill:{color:'FF0000'},line:{color:'FF0000'},shadow:{type:'outer',color:'000000',blur:5,offset:2,angle:135,opacity:0.2}}); p.writeFile({fileName:'/tmp/test.pptx'}).then(()=>console.log('OK')).catch(e=>console.error('ERR',e.message)); " 2>&1
cd /home/daytona/workspace/triads-cheatsheet && node -e " const pptxgen = require('pptxgenjs'); const p = new pptxgen(); p.layout='LAYOUT_WIDE'; const C={bg:'0D1B2A',gold:'F0A500',teal:'17B8BE',red:'E8354A'}; const sl=p.addSlide(); // test the hdr function function hdr(sl,text,color,x,y,w,h) { sl.addShape('rect',{x,y,w,h,fill:{color:color},line:{color:color}}); sl.addText(text,{x:x+0.06,y:y+0.02,w:w-0.12,h:h-0.04,fontSize:9,bold:true,color:'FFFFFF',valign:'middle',align:'center',margin:0,charSpacing:1}); } hdr(sl,'TEST',C.red,0,0,2,0.3); p.writeFile({fileName:'/tmp/test2.pptx'}).then(()=>console.log('OK')).catch(e=>console.error('ERR',e.message)); " 2>&1
cd /home/daytona/workspace/triads-cheatsheet && node -e " // Test the card function from slide 7 - specifically the line border around mnemonic box const pptxgen = require('pptxgenjs'); const p = new pptxgen(); p.layout='LAYOUT_WIDE'; const C={bg:'0D1B2A',card:'162C46',border:'1A3A5C',white:'FFFFFF',gold:'F0A500',red:'E8354A',orange:'E87525',teal:'17B8BE'}; const sl=p.addSlide(); // Simulate the flashcard from slide 7 const cardColor='E8354A'; const x=0.12,y=0.52,cardW=2.53,cardH=1.55; sl.addShape('rect',{x,y,w:cardW,h:cardH,fill:{color:C.card},line:{color:C.border},shadow:{type:'outer',color:'000000',blur:5,offset:2,angle:135,opacity:0.2}}); sl.addShape('rect',{x,y,w:cardW,h:0.22,fill:{color:cardColor},line:{color:cardColor}}); sl.addText('Name',{x:x+0.06,y:y+0.01,w:cardW-0.12,h:0.2,fontSize:8.5,bold:true,color:C.white,valign:'middle',margin:0}); sl.addText('Diag',{x:x+0.06,y:y+0.22,w:cardW-0.12,h:0.22,fontSize:7.5,bold:true,color:C.gold,valign:'middle',margin:0,italic:true}); sl.addText('s1\ns2\ns3',{x:x+0.06,y:y+0.44,w:cardW-0.12,h:0.62,fontSize:8,color:C.white,valign:'top',margin:0}); // The mnemonic line with card.c as border color sl.addShape('rect',{x:x+0.05,y:y+cardH-0.35,w:cardW-0.1,h:0.3,fill:{color:'0D1B2A'},line:{color:cardColor}}); sl.addText('mnem',{x:x+0.08,y:y+cardH-0.34,w:cardW-0.16,h:0.28,fontSize:7,color:cardColor,bold:true,valign:'middle',margin:0,italic:true}); p.writeFile({fileName:'/tmp/test3.pptx'}).then(()=>console.log('OK')).catch(e=>console.error('ERR',e.message)); " 2>&1
cd /home/daytona/workspace/triads-cheatsheet && node build.js 2>&1 | head -5 # Let me add slide-by-slide error isolation node -e " process.on('unhandledRejection',(r)=>console.error('UNHANDLED',r)); " 2>&1 # Check if the issue is the rich text array with bold/color options node -e " const pptxgen=require('pptxgenjs'); const p=new pptxgen();p.layout='LAYOUT_WIDE'; const sl=p.addSlide(); sl.addShape('rect',{x:0,y:0,w:13.3,h:7.5,fill:{color:'0D1B2A'},line:{color:'0D1B2A'}}); sl.addText([ {text:'• Widened mediastinum ', options:{breakLine:true}}, {text:' test\n', options:{bold:true,color:'F0A500',breakLine:true}}, {text:'• Other signs', options:{}}, ],{x:0.5,y:0.5,w:4,h:1.5,fontSize:11,color:'FFFFFF',fontFace:'Calibri',valign:'top',margin:0}); p.writeFile({fileName:'/tmp/test4.pptx'}).then(()=>console.log('OK')).catch(e=>console.error('ERR',e.message)); " 2>&1
grep -n "breakLine.*color\|color.*breakLine" /home/daytona/workspace/triads-cheatsheet/build.js | head -20
grep -n "addText\(\[" /home/daytona/workspace/triads-cheatsheet/build.js
node -e " const fs=require('fs'); const code=fs.readFileSync('/home/daytona/workspace/triads-cheatsheet/build.js','utf8'); // Find all lines with 'options' in rich text that have both 'color' and might be problematic const lines=code.split('\n'); lines.forEach((l,i)=>{if(l.includes('options:') && (l.includes('color:C') || l.includes('color:')) ) console.log(i+1,l.trim().slice(0,100));}); " 2>&1 | head -30
# Narrow down which slide causes the error by running slides one at a time node -e " const pptxgen=require('pptxgenjs'); const fs=require('fs'); // Run just slides 1-4 by checking if the error comes from the wrap:true in cell function // The cell function uses wrap:true - check if that's the issue const p=new pptxgen();p.layout='LAYOUT_WIDE'; const sl=p.addSlide(); sl.addShape('rect',{x:0,y:0,w:2,h:1,fill:{color:'162C46'},line:{color:'1A3A5C'}}); sl.addText('Test wrap',{x:0.05,y:0.02,w:1.9,h:0.96,fontSize:8.5,color:'FFFFFF',valign:'middle',align:'left',bold:false,italic:false,margin:0,fontFace:'Calibri',wrap:true}); p.writeFile({fileName:'/tmp/t5.pptx'}).then(()=>console.log('OK')).catch(e=>console.error('ERR wrap',e.message)); " 2>&1
# Try writing just slide 1 from the actual build file to isolate node -e " const pptxgen=require('pptxgenjs'); const p=new pptxgen();p.layout='LAYOUT_WIDE'; const C={bg:'0D1B2A',panel:'112236',card:'162C46',border:'1A3A5C',white:'FFFFFF',silver:'B8C8D8',gold:'F0A500',teal:'17B8BE',red:'E8354A',orange:'E87525',green:'27AE60',purple:'8E44AD',blue:'2980B9',pink:'E91E8C',lime:'7CB518',cyan:'00BCD4',maroon:'C0392B'}; function bg(sl){sl.addShape('rect',{x:0,y:0,w:13.3,h:7.5,fill:{color:C.bg},line:{color:C.bg}});} const sl=p.addSlide();bg(sl); const stripes=[C.red,C.orange,C.green,C.teal,C.purple,C.blue,C.pink,C.lime,C.cyan,C.gold]; stripes.forEach((c,i)=>{sl.addShape('rect',{x:0,y:i*0.75,w:0.22,h:0.75,fill:{color:c},line:{color:c}});}); sl.addShape('rect',{x:0.22,y:0,w:0.06,h:7.5,fill:{color:C.gold},line:{color:C.gold}}); sl.addText('MEDICAL TRIADS',{x:0.55,y:1.2,w:12.5,h:1.6,fontSize:72,bold:true,color:C.white,fontFace:'Calibri',charSpacing:8,align:'left',margin:0}); const specs=[{t:'EMERGENCY',c:C.red},{t:'CARDIOLOGY',c:C.orange},{t:'NEUROLOGY',c:C.teal}]; specs.forEach((s,i)=>{const x=0.55+(i%6)*2.1;const y=4.35+Math.floor(i/6)*0.52;sl.addShape('rect',{x,y,w:1.95,h:0.38,fill:{color:s.c},line:{color:s.c},shadow:{type:'outer',color:'000000',blur:4,offset:2,angle:135,opacity:0.2}});sl.addText(s.t,{x:x+0.05,y:y+0.03,w:1.85,h:0.32,fontSize:9,bold:true,color:C.white,align:'center',valign:'middle',margin:0,charSpacing:1});}); p.writeFile({fileName:'/tmp/s1.pptx'}).then(()=>console.log('Slide1 OK')).catch(e=>console.error('Slide1 ERR',e.message)); " 2>&1
# The error says line 5481 - "at slideObjectToXml" - this is text color in run. # Check if the problem is that 'color' in the text options for the card (nc:'D4A017') # is being passed where pptxgenjs expects a global color option but the run-level color conflicts. # The nc for pellagra is "D4A017" as a LITERAL hex string - this is fine. # Let me check if there are any color values that might not be strings in the data: node -e " const C={bg:'0D1B2A',gold:'F0A500'}; // Check what '\"D4A017\"' is as a value console.log(typeof 'D4A017', 'D4A017'.replace); // should be function // The issue is more subtle - let me check the cell function // which has 'fc' being passed as color, and some nc values // In slide 6 row pellagra: nc:'D4A017' - this is a bare hex, fine // But in the card in slide 7, c:'D4A017' is used as card.c // and passed as line:{color:card.c} and fill:{color:card.c} // Let me check the exact card colors in slide 7 const cards=[ {c:'E8354A'},{c:'E87525'},{c:'27AE60'},{c:'17B8BE'},{c:'8E44AD'}, {c:'8E44AD'},{c:'C0392B'},{c:'8E44AD'},{c:'E8354A'},{c:'D4A017'}, {c:'E87525'},{c:'8E44AD'},{c:'00BCD4'},{c:'E8354A'},{c:'E8354A'}, {c:'C06A15'},{c:'27AE60'},{c:'17B8BE'},{c:'2980B9'},{c:'E87525'}, ]; cards.forEach((c,i)=>{ if(typeof c.c !== 'string') console.log('NON-STRING at index',i,c.c); else if(!/^[0-9A-Fa-f]{6}$/.test(c.c)) console.log('INVALID HEX at',i,c.c); }); console.log('All card colors valid'); " 2>&1
# The error is at line 5481 in slideObjectToXml which processes text runs. # Check if the issue is the 'italic' option in addText - when italic is passed as a # boolean, some versions have issues. Let me check the `cell` function: # cell uses: italic:!!opts.italic - this would be false if undefined # But in addText the italic property should be boolean. # Actually - the issue could be that the `nc` field used as 'D4A017' in slide 6 # might end up getting passed in the row color check. # Let me run the build.js with a try/catch per slide to find WHICH slide fails: node -e " // Write a modified version that catches per-section const fs = require('fs'); let code = fs.readFileSync('/home/daytona/workspace/triads-cheatsheet/build.js','utf8'); // Replace writeFile to see if we even get there code = code.replace('pres.writeFile', 'console.log(\"Reached writeFile\"); pres.writeFile'); // Wrap entire script execution try { eval(code); } catch(e) { console.error('SYNC ERROR:', e.message, e.stack.split('\n')[1]); } " 2>&1 | head -10
~/triads-cheatsheet/build.js
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/triads-cheatsheet/build.js'
cd /home/daytona/workspace/triads-cheatsheet && node build.js 2>&1