Create world best poster on myasthenia gravis
myasthenia gravis neuromuscular junction pathophysiology diagram
ls /home/daytona/workspace/ 2>/dev/null || mkdir -p /home/daytona/workspace/
mkdir -p /home/daytona/workspace/mg-poster && ls /home/daytona/workspace/mg-poster/
~/mg-poster/build_poster.js
const pptxgen = require("pptxgenjs");
const { execSync } = require("child_process");
// ─── Fetch real medical images ───────────────────────────────────────────────
const imgUrls = [
"https://cdn.orris.care/cdss_images/HARRISON_1763033384033_a1f3a029-5aec-44f7-85a4-7cdec696813f.png", // NMJ pathophysiology diagram
"https://cdn.orris.care/cdss_images/pmc_clinical_VQA_557ec37e14754eb5ae0ff9ba12dff47786c88b92607a2b207ee1afc482901b9a.jpg", // clinical triad (ptosis, EMG, CT)
"https://cdn.orris.care/cdss_images/pmc_clinical_VQA_796dce2b573ef3107e64d460af9e1cd1d022687ed10e35c75ebd360382b98185.jpg", // Tensilon test
"https://cdn.orris.care/cdss_images/pmc_clinical_VQA_d4c1452f8c41f2050354e5da39a4809d4e6b6432cd2d87b70cbfdc3418db1d31.jpg", // ice pack test
];
let images = [];
try {
images = JSON.parse(execSync(
`node /home/daytona/skills/shared/scripts/fetch_images.js ${imgUrls.map(u => `"${u}"`).join(" ")}`
).toString());
} catch(e) {
console.error("Image fetch failed:", e.message);
images = imgUrls.map(() => ({ base64: null, error: "failed" }));
}
// ─── Color palette ────────────────────────────────────────────────────────────
const C = {
deepNavy: "0B1F4B", // dominant dark bg
navy: "112466",
midBlue: "1A3A8F",
accent: "2E9CCA", // bright teal-blue
accentLight: "5BC8E8",
gold: "F5A623",
goldLight: "FDEABD",
white: "FFFFFF",
offWhite: "EAF4FB",
lightGray: "D0E6F5",
red: "E8325A",
green: "27AE60",
orange: "E67E22",
textDark: "0B1F4B",
cardBg: "132B70",
cardBorder: "2E9CCA",
};
// ─── Poster setup ─────────────────────────────────────────────────────────────
const pres = new pptxgen();
pres.layout = "LAYOUT_WIDE"; // 13.3" × 7.5" — a single-slide poster
pres.title = "Myasthenia Gravis – Clinical Reference Poster";
const sl = pres.addSlide();
sl.background = { color: C.deepNavy };
// ─── Helper functions ─────────────────────────────────────────────────────────
function rect(x, y, w, h, fillColor, lineColor, lineW) {
const opts = { x, y, w, h, fill: { color: fillColor }, line: { color: lineColor || fillColor, pt: lineW || 0 } };
sl.addShape(pres.ShapeType.rect, opts);
}
function text(txt, x, y, w, h, opts) {
sl.addText(txt, { x, y, w, h, ...opts });
}
function richText(arr, x, y, w, h, opts) {
sl.addText(arr, { x, y, w, h, ...opts });
}
// ═══════════════════════════════════════════════════════════════════════════════
// HEADER BAR
// ═══════════════════════════════════════════════════════════════════════════════
rect(0, 0, 13.3, 1.05, C.midBlue);
// accent stripe
rect(0, 0, 13.3, 0.07, C.accent);
// gold decorative left bar
rect(0, 0, 0.18, 1.05, C.gold);
text("MYASTHENIA GRAVIS", 0.28, 0.03, 9, 0.58, {
fontSize: 38, bold: true, color: C.white, charSpacing: 3,
fontFace: "Calibri", valign: "middle", align: "left", margin: 0
});
text("A Comprehensive Clinical Reference", 0.28, 0.58, 8, 0.38, {
fontSize: 14, bold: false, color: C.accentLight, fontFace: "Calibri",
italic: true, valign: "top", align: "left", margin: 0, charSpacing: 1
});
text("\"Where the immune system silences the signal between nerve and muscle\"", 10.2, 0.12, 2.95, 0.5, {
fontSize: 9, italic: true, color: C.goldLight, fontFace: "Calibri",
valign: "middle", align: "right", margin: 0
});
text("Bradley & Daroff's Neurology | Harrison's | Medical Physiology", 10.2, 0.62, 2.95, 0.38, {
fontSize: 8, color: C.lightGray, fontFace: "Calibri", align: "right", valign: "top", margin: 0
});
// ═══════════════════════════════════════════════════════════════════════════════
// COLUMN LAYOUT (3 cols + footer)
// ═══════════════════════════════════════════════════════════════════════════════
const TOP = 1.12;
const COL_H = 5.85; // content height
const COL1_X = 0.12, COL1_W = 3.8;
const COL2_X = 4.08, COL2_W = 5.0;
const COL3_X = 9.24, COL3_W = 3.88;
// ─── COLUMN 1 — Pathophysiology + Epidemiology ────────────────────────────────
// Section header
rect(COL1_X, TOP, COL1_W, 0.33, C.accent);
text("⚕ PATHOPHYSIOLOGY", COL1_X+0.08, TOP+0.04, COL1_W-0.12, 0.27, {
fontSize: 11, bold: true, color: C.white, fontFace: "Calibri", margin: 0
});
// Card background
rect(COL1_X, TOP+0.33, COL1_W, 2.25, C.cardBg);
richText([
{ text: "Autoimmune Mechanism", options: { bold: true, color: C.gold, breakLine: true } },
{ text: "Antibodies attack postsynaptic acetylcholine receptors (AChR) at the neuromuscular junction (NMJ), reducing the number of functional receptors.", options: { color: C.offWhite, breakLine: true } },
{ text: "\nKey Antibodies", options: { bold: true, color: C.gold, breakLine: true } },
{ text: "• Anti-AChR: 80-90% generalized MG, 50% ocular MG\n• Anti-MuSK: bulbar-predominant, seroneg AChR\n• Anti-LRP4: 1-3%, mild-moderate symptoms", options: { color: C.offWhite, breakLine: false } },
], COL1_X+0.1, TOP+0.38, COL1_W-0.18, 2.15, { fontSize: 9.5, fontFace: "Calibri", valign: "top", margin: 0, paraSpaceAfter: 2 });
// NMJ image
if (images[0] && !images[0].error) {
sl.addImage({ data: images[0].base64, x: COL1_X+0.1, y: TOP+2.65, w: COL1_W-0.2, h: 1.5 });
} else {
rect(COL1_X+0.1, TOP+2.65, COL1_W-0.2, 1.5, C.navy);
text("NMJ Pathophysiology Diagram", COL1_X+0.1, TOP+3.1, COL1_W-0.2, 0.5, {
fontSize: 9, italic: true, color: C.lightGray, fontFace: "Calibri", align: "center"
});
}
// image caption
text("Neuromuscular junction — AChR antibody-mediated destruction (Harrison's, Fig 454-1)",
COL1_X+0.05, TOP+4.18, COL1_W-0.1, 0.22, {
fontSize: 7, italic: true, color: C.lightGray, fontFace: "Calibri", align: "center", margin: 0
});
// Epidemiology card
rect(COL1_X, TOP+4.44, COL1_W, 0.3, C.gold);
text("📊 EPIDEMIOLOGY", COL1_X+0.08, TOP+4.47, COL1_W-0.12, 0.25, {
fontSize: 10, bold: true, color: C.deepNavy, fontFace: "Calibri", margin: 0
});
rect(COL1_X, TOP+4.74, COL1_W, 0.97, C.cardBg);
richText([
{ text: "Prevalence: ", options: { bold: true, color: C.accentLight } },
{ text: "25–125 per million\n", options: { color: C.offWhite } },
{ text: "Bimodal: ", options: { bold: true, color: C.accentLight } },
{ text: "Women 20s / Men 60s\n", options: { color: C.offWhite } },
{ text: "Thymoma: ", options: { bold: true, color: C.accentLight } },
{ text: "10% of MG patients; ⅓ thymoma → MG\n", options: { color: C.offWhite } },
{ text: "Thymus cells carry nicotinic AChRs — site of autoimmune priming.", options: { color: C.lightGray, italic: true } },
], COL1_X+0.1, TOP+4.78, COL1_W-0.18, 0.9, { fontSize: 9, fontFace: "Calibri", valign: "top", margin: 0, paraSpaceAfter: 1 });
// ─── COLUMN 2 — Clinical Features + Diagnosis ─────────────────────────────────
rect(COL2_X, TOP, COL2_W, 0.33, C.red);
text("🩺 CLINICAL FEATURES & DIAGNOSIS", COL2_X+0.08, TOP+0.04, COL2_W-0.12, 0.27, {
fontSize: 11, bold: true, color: C.white, fontFace: "Calibri", margin: 0
});
// Two sub-columns inside col 2
const SC_W = 2.3;
// Symptoms box
rect(COL2_X, TOP+0.33, SC_W+0.05, 1.65, C.cardBg);
text("Cardinal Symptoms", COL2_X+0.1, TOP+0.37, SC_W, 0.28, {
fontSize: 9.5, bold: true, color: C.accentLight, fontFace: "Calibri", margin: 0
});
richText([
{ text: "• Ptosis & diplopia (>90%)\n", options: { color: C.offWhite } },
{ text: "• Fatigable muscle weakness\n", options: { color: C.offWhite } },
{ text: "• Bulbar: dysphagia, dysarthria\n", options: { color: C.offWhite } },
{ text: "• Proximal limb weakness\n", options: { color: C.offWhite } },
{ text: "• Respiratory failure (crisis)\n", options: { color: C.red } },
{ text: "• Worsens end-of-day / exertion\n", options: { color: C.offWhite } },
{ text: "• Normal sensation & reflexes", options: { color: C.offWhite } },
], COL2_X+0.1, TOP+0.68, SC_W, 1.25, { fontSize: 9, fontFace: "Calibri", valign: "top", margin: 0, paraSpaceAfter: 1 });
// MGFA classification
rect(COL2_X+SC_W+0.12, TOP+0.33, SC_W+0.14, 1.65, C.cardBg);
text("MGFA Classification", COL2_X+SC_W+0.2, TOP+0.37, SC_W, 0.28, {
fontSize: 9.5, bold: true, color: C.accentLight, fontFace: "Calibri", margin: 0
});
const mgfaTable = [
[{ text: "Class", options: { bold: true, color: C.white, fill: { color: C.midBlue } } },
{ text: "Features", options: { bold: true, color: C.white, fill: { color: C.midBlue } } }],
["I", "Ocular only"],
["IIa", "Mild generalized"],
["IIb", "Mild bulbar"],
["III", "Moderate gen."],
["IV", "Severe gen."],
["V", "Intubation req."],
];
sl.addTable(mgfaTable, {
x: COL2_X+SC_W+0.12, y: TOP+0.68, w: SC_W+0.14, h: 1.3,
colW: [0.55, SC_W-0.42],
border: { pt: 0.5, color: C.accent },
fill: { color: C.navy },
color: C.offWhite,
fontSize: 8,
fontFace: "Calibri",
valign: "middle",
});
// Clinical images row
const imgY = TOP + 2.05;
if (images[1] && !images[1].error) {
sl.addImage({ data: images[1].base64, x: COL2_X, y: imgY, w: 2.45, h: 1.55 });
}
if (images[2] && !images[2].error) {
sl.addImage({ data: images[2].base64, x: COL2_X+2.55, y: imgY, w: 1.15, h: 1.55 });
}
if (images[3] && !images[3].error) {
sl.addImage({ data: images[3].base64, x: COL2_X+3.78, y: imgY, w: 1.14, h: 1.55 });
}
text("Left: Ptosis + RNS decrement + anterior mediastinal mass (CT) | Centre: Tensilon test | Right: Ice pack test",
COL2_X, imgY+1.58, COL2_W, 0.2, {
fontSize: 7, italic: true, color: C.lightGray, fontFace: "Calibri", align: "center", margin: 0
});
// Diagnosis
rect(COL2_X, TOP+3.86, COL2_W, 0.3, C.orange);
text("🔬 INVESTIGATIONS", COL2_X+0.08, TOP+3.89, COL2_W-0.12, 0.25, {
fontSize: 10, bold: true, color: C.white, fontFace: "Calibri", margin: 0
});
rect(COL2_X, TOP+4.16, COL2_W, 1.55, C.cardBg);
const diagTable = [
[{ text: "Test", options: { bold: true, color: C.white, fill: { color: C.midBlue } } },
{ text: "Finding / Significance", options: { bold: true, color: C.white, fill: { color: C.midBlue } } }],
["Serum AChR Ab", "Positive 80-90% gen. MG; confirms dx"],
["Anti-MuSK Ab", "2-5% seroneg AChR; bulbar predominant"],
["Edrophonium test", "Transient reversal of ptosis/weakness"],
["Ice Pack Test", "Cooling inhibits AChE → ptosis resolves"],
["Repetitive Nerve Stim", "≥10% CMAP amplitude decrement"],
["Single-Fibre EMG", "Jitter ↑; most sensitive (95%+)"],
["CT Chest", "Screen for thymoma (anterior mediastinum)"],
];
sl.addTable(diagTable, {
x: COL2_X, y: TOP+4.19, w: COL2_W, h: 1.48,
colW: [1.6, 3.4],
border: { pt: 0.5, color: C.accent },
fill: { color: C.navy },
color: C.offWhite,
fontSize: 8,
fontFace: "Calibri",
valign: "middle",
});
// ─── COLUMN 3 — Treatment + Myasthenic Crisis ─────────────────────────────────
rect(COL3_X, TOP, COL3_W, 0.33, C.green);
text("💊 TREATMENT", COL3_X+0.08, TOP+0.04, COL3_W-0.12, 0.27, {
fontSize: 11, bold: true, color: C.white, fontFace: "Calibri", margin: 0
});
rect(COL3_X, TOP+0.33, COL3_W, 2.42, C.cardBg);
const txRows = [
[{ text: "Drug / Modality", options: { bold: true, color: C.white, fill: { color: C.midBlue } } },
{ text: "Mechanism / Notes", options: { bold: true, color: C.white, fill: { color: C.midBlue } } }],
["Pyridostigmine", "AChE inhibitor — 1st-line symptomatic Rx"],
["Prednisone", "Immunosuppression; long-term control"],
["Azathioprine", "Steroid-sparing; 6-18 mo onset"],
["Mycophenolate", "Steroid-sparing; less toxicity"],
["Plasma Exchange", "Rapid removal of AChR Ab; crisis/pre-op"],
["IVIG", "Modulates immunity; crisis/exacerbations"],
["Eculizumab", "Anti-C5; complement inhibitor; FDA-approved"],
["Efgartigimod", "FcRn blocker → ↓ IgG including AChR Ab"],
["Thymectomy", "10% thymoma → ↑ remission in AChR+ <60y"],
];
sl.addTable(txRows, {
x: COL3_X, y: TOP+0.36, w: COL3_W, h: 2.36,
colW: [1.48, 2.4],
border: { pt: 0.5, color: C.green },
fill: { color: C.navy },
color: C.offWhite,
fontSize: 8,
fontFace: "Calibri",
valign: "middle",
});
// Myasthenic Crisis card
rect(COL3_X, TOP+2.82, COL3_W, 0.3, C.red);
text("🚨 MYASTHENIC CRISIS", COL3_X+0.08, TOP+2.85, COL3_W-0.12, 0.25, {
fontSize: 10, bold: true, color: C.white, fontFace: "Calibri", margin: 0
});
rect(COL3_X, TOP+3.12, COL3_W, 1.58, C.cardBg);
richText([
{ text: "Definition: ", options: { bold: true, color: C.red } },
{ text: "Respiratory failure requiring mechanical ventilation.\n", options: { color: C.offWhite } },
{ text: "Triggers: ", options: { bold: true, color: C.gold } },
{ text: "Infection, surgery, tapering steroids, medications.\n\n", options: { color: C.offWhite } },
{ text: "Management:\n", options: { bold: true, color: C.accentLight, breakLine: false } },
{ text: "• ICU admission + airway protection\n", options: { color: C.offWhite } },
{ text: "• IV plasma exchange (5 sessions) or IVIG 2g/kg\n", options: { color: C.offWhite } },
{ text: "• Hold AChEI during intubation\n", options: { color: C.offWhite } },
{ text: "• Resume immunosuppression early\n", options: { color: C.offWhite } },
{ text: "• Avoid: aminoglycosides, Mg²⁺, β-blockers", options: { color: C.red } },
], COL3_X+0.1, TOP+3.15, COL3_W-0.18, 1.5, { fontSize: 9, fontFace: "Calibri", valign: "top", margin: 0, paraSpaceAfter: 2 });
// Drugs to avoid
rect(COL3_X, TOP+4.76, COL3_W, 0.28, C.orange);
text("⚠ DRUGS TO AVOID IN MG", COL3_X+0.08, TOP+4.79, COL3_W-0.12, 0.23, {
fontSize: 9.5, bold: true, color: C.white, fontFace: "Calibri", margin: 0
});
rect(COL3_X, TOP+5.04, COL3_W, 0.68, C.cardBg);
text("Aminoglycosides • Fluoroquinolones • Macrolides • Mg²⁺ • β-blockers • Neuromuscular blockers • Chloroquine • D-Penicillamine • Checkpoint inhibitors",
COL3_X+0.1, TOP+5.07, COL3_W-0.18, 0.62, {
fontSize: 8.5, color: C.red, fontFace: "Calibri", valign: "top", margin: 0, wrap: true
});
// ═══════════════════════════════════════════════════════════════════════════════
// FOOTER BAR
// ═══════════════════════════════════════════════════════════════════════════════
rect(0, 7.28, 13.3, 0.22, C.navy);
rect(0, 7.28, 13.3, 0.04, C.accent);
text("Sources: Bradley & Daroff's Neurology in Clinical Practice | Medical Physiology (Boron & Boulpaep) | Harrison's Principles of Internal Medicine 22e | Costanzo Physiology 7e",
0.15, 7.32, 9.0, 0.17, {
fontSize: 6.5, color: C.lightGray, fontFace: "Calibri", margin: 0
});
text(`Created ${new Date().toLocaleDateString("en-GB", { year:"numeric", month:"long", day:"numeric" })}`,
9.2, 7.32, 4.0, 0.17, {
fontSize: 6.5, color: C.lightGray, fontFace: "Calibri", align: "right", margin: 0
});
// ─── Write file ───────────────────────────────────────────────────────────────
const OUT = "/home/daytona/workspace/mg-poster/Myasthenia_Gravis_Poster.pptx";
pres.writeFile({ fileName: OUT }).then(() => {
console.log("SUCCESS:" + OUT);
}).catch(e => {
console.error("FAILED:", e.message);
process.exit(1);
});
cd /home/daytona/workspace/mg-poster && node build_poster.js 2>&1
ls -lh /home/daytona/workspace/mg-poster/Myasthenia_Gravis_Poster.pptx
Myasthenia Gravis Poster
Presentation · PPTX