Hyperkalemia, indication, symptoms sign and treatment in dialysis patients, create poster
hyperkalemia ECG changes peaked T waves
ls -la /home/daytona/workspace/
mkdir -p /home/daytona/workspace/hyperkalemia-poster
~/hyperkalemia-poster/create_poster.js
const pptxgen = require("pptxgenjs");
const { execSync } = require("child_process");
// Fetch ECG image
const ecgUrl = "https://cdn.orris.care/cdss_images/HARRISON_1763035190062_9442e535-00aa-4301-95a3-fa6fd8faf8bf.png";
let ecgImages = [];
try {
ecgImages = JSON.parse(
execSync(`node /home/daytona/skills/shared/scripts/fetch_images.js "${ecgUrl}"`).toString()
);
} catch (e) {
console.error("Image fetch failed:", e.message);
}
const pres = new pptxgen();
pres.layout = "LAYOUT_4x3"; // 10" × 7.5" — portrait-friendly poster
// ─── COLOR PALETTE ───────────────────────────────────────────────────────────
const C = {
darkNavy: "0D1B2A", // dominant background
teal: "0A8A8A", // accent header
amber: "F4A228", // highlight / caution
red: "C0392B", // danger / critical
white: "FFFFFF",
lightGray: "D8E4EE",
midGray: "8FAABB",
panelBg: "112233", // slightly lighter panel
greenBg: "0E4B3A", // treatment panel
};
// ─── SLIDE ───────────────────────────────────────────────────────────────────
const slide = pres.addSlide();
// Full background
slide.addShape(pres.ShapeType.rect, {
x: 0, y: 0, w: 10, h: 7.5,
fill: { color: C.darkNavy },
line: { type: "none" },
});
// ── TOP HEADER BAR ────────────────────────────────────────────────────────────
slide.addShape(pres.ShapeType.rect, {
x: 0, y: 0, w: 10, h: 0.85,
fill: { color: C.teal },
line: { type: "none" },
});
slide.addText("HYPERKALEMIA IN DIALYSIS PATIENTS", {
x: 0, y: 0, w: 10, h: 0.85,
fontSize: 24, bold: true, color: C.white,
align: "center", valign: "middle", fontFace: "Calibri",
charSpacing: 3,
});
// ── SUBTITLE ─────────────────────────────────────────────────────────────────
slide.addText("Indication for Dialysis • Clinical Presentation • Emergency Treatment", {
x: 0, y: 0.85, w: 10, h: 0.32,
fontSize: 9.5, color: C.lightGray, align: "center", valign: "middle",
fontFace: "Calibri", italic: true,
});
// ── HELPER: panel background ──────────────────────────────────────────────────
function addPanel(slide, x, y, w, h, color) {
slide.addShape(pres.ShapeType.rect, {
x, y, w, h,
fill: { color: color || C.panelBg },
line: { color: C.teal, pt: 1 },
shadow: { type: "outer", color: "000000", opacity: 0.4, blur: 4, offset: 2, angle: 45 },
});
}
// ── HELPER: section heading ───────────────────────────────────────────────────
function addSectionHeading(slide, text, x, y, w, accentColor) {
slide.addShape(pres.ShapeType.rect, {
x, y, w: w, h: 0.28,
fill: { color: accentColor || C.teal },
line: { type: "none" },
});
slide.addText(text, {
x, y, w, h: 0.28,
fontSize: 10.5, bold: true, color: C.white,
align: "center", valign: "middle", fontFace: "Calibri",
margin: 0,
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// COLUMN 1 (x=0.12, w=2.9) — INDICATIONS + EPIDEMIOLOGY
// ═══════════════════════════════════════════════════════════════════════════════
const col1x = 0.12, col1w = 2.9;
let cy = 1.26;
addPanel(slide, col1x, cy, col1w, 2.6, C.panelBg);
addSectionHeading(slide, "⚠ INDICATIONS FOR DIALYSIS", col1x, cy, col1w, "7B3030");
cy += 0.28;
const indications = [
{ h: "Severe hyperkalemia", b: "K⁺ > 6.5 mEq/L or K⁺ > 6.0 with ECG changes, especially when refractory to medical therapy" },
{ h: "Acute kidney injury (AKI)", b: "Hypercatabolic AKI — rapid K⁺ rise, no urinary excretion possible" },
{ h: "Unresponsive to treatment", b: "Persistent hyperkalemia despite insulin, calcium, bicarbonate, and K⁺ binders" },
{ h: "Additional criteria", b: "Volume overload, uremic symptoms, metabolic acidosis" },
];
let iy = cy + 0.08;
indications.forEach(item => {
slide.addText([
{ text: item.h + " — ", options: { bold: true, color: C.amber } },
{ text: item.b, options: { color: C.lightGray } },
], {
x: col1x + 0.12, y: iy, w: col1w - 0.22, h: 0.44,
fontSize: 8, valign: "top", fontFace: "Calibri",
bullet: { code: "25B6", color: C.teal },
});
iy += 0.52;
});
// Dialysis removes K stats box
cy = 1.26 + 2.6 + 0.1;
addPanel(slide, col1x, cy, col1w, 1.05, "102030");
slide.addText([
{ text: "Hemodialysis removes ~25–50 mEq K⁺/session\n", options: { bold: true, color: C.amber, breakLine: true } },
{ text: "Dialysate K⁺ 0–2 mEq/L recommended in severe cases\n", options: { color: C.lightGray, breakLine: true } },
{ text: "Peritoneal dialysis: slower but continuous K⁺ removal", options: { color: C.lightGray } },
], {
x: col1x + 0.1, y: cy + 0.08, w: col1w - 0.18, h: 0.85,
fontSize: 8, fontFace: "Calibri", valign: "top",
});
// Fasting risk box
cy += 1.05 + 0.1;
addPanel(slide, col1x, cy, col1w, 0.9, "1A1030");
slide.addText("FASTING RISK IN DIALYSIS PATIENTS", {
x: col1x, y: cy, w: col1w, h: 0.22,
fontSize: 8.5, bold: true, color: C.amber, align: "center",
fontFace: "Calibri", margin: 0,
});
slide.addText("Fasting >8–12 h → ↓ insulin → K⁺ shifts out of cells → can't be excreted → life-threatening hyperkalemia. Prevent with IV dextrose (± insulin if diabetic).", {
x: col1x + 0.1, y: cy + 0.22, w: col1w - 0.18, h: 0.6,
fontSize: 7.5, color: C.lightGray, fontFace: "Calibri", valign: "top",
});
// ═══════════════════════════════════════════════════════════════════════════════
// COLUMN 2 (x=3.16, w=3.2) — SYMPTOMS & SIGNS + ECG
// ═══════════════════════════════════════════════════════════════════════════════
const col2x = 3.16, col2w = 3.2;
cy = 1.26;
addPanel(slide, col2x, cy, col2w, 1.65, C.panelBg);
addSectionHeading(slide, "🩺 SYMPTOMS & SIGNS", col2x, cy, col2w, "2E5E8A");
cy += 0.28;
const symptoms = [
["Cardiac", "Palpitations, bradycardia, ventricular fibrillation, cardiac arrest"],
["Neuromuscular", "Muscle weakness, flaccid paralysis, respiratory failure"],
["GI", "Nausea, vomiting, ileus, abdominal cramps"],
["Metabolic", "Type IV RTA (impaired H⁺ excretion), endogenous aldosterone ↑"],
];
let sy = cy + 0.06;
symptoms.forEach(([sys, desc]) => {
slide.addText([
{ text: sys + ": ", options: { bold: true, color: C.amber } },
{ text: desc, options: { color: C.lightGray } },
], {
x: col2x + 0.12, y: sy, w: col2w - 0.22, h: 0.33,
fontSize: 8, fontFace: "Calibri", valign: "top",
bullet: { code: "2022", color: C.red },
});
sy += 0.33;
});
// Critical note
cy = 1.26 + 1.65 + 0.06;
slide.addText("⚡ Often CLINICALLY SILENT until life-threatening arrhythmia! Always obtain ECG.", {
x: col2x, y: cy, w: col2w, h: 0.28,
fontSize: 8, bold: true, color: C.white, align: "center",
fill: { color: C.red }, fontFace: "Calibri", margin: [0, 4, 0, 4],
});
// ECG section
cy += 0.28 + 0.06;
addPanel(slide, col2x, cy, col2w, 1.42, C.panelBg);
addSectionHeading(slide, "📈 ECG PROGRESSION", col2x, cy, col2w, "1A5C7A");
const ecgData = [
["Mild (5.5–6.5)", "Peaked / tented T waves"],
["Moderate (6.5–7.5)", "↓ P wave amplitude, widened PR"],
["Severe (> 7.5)", "P wave disappears, wide QRS"],
["Critical", "Sine-wave pattern → VF / asystole"],
];
let ey = cy + 0.32;
ecgData.forEach(([level, finding]) => {
slide.addText([
{ text: level + " mEq/L: ", options: { bold: true, color: C.amber } },
{ text: finding, options: { color: C.lightGray } },
], {
x: col2x + 0.12, y: ey, w: col2w - 0.22, h: 0.24,
fontSize: 8, fontFace: "Calibri",
bullet: { code: "25BA", color: C.teal },
});
ey += 0.24;
});
// ECG image
cy += 1.42 + 0.06;
if (ecgImages.length && !ecgImages[0].error) {
slide.addImage({
data: ecgImages[0].base64,
x: col2x, y: cy, w: col2w, h: 1.62,
});
slide.addText("ECG changes with progressive hyperkalemia (Harrison's, 21e)", {
x: col2x, y: cy + 1.62, w: col2w, h: 0.18,
fontSize: 6.5, italic: true, color: C.midGray, align: "center", fontFace: "Calibri",
});
} else {
addPanel(slide, col2x, cy, col2w, 1.62, "192030");
slide.addText("ECG: Peaked T → P-wave loss → Wide QRS → Sine wave → VF", {
x: col2x + 0.1, y: cy + 0.6, w: col2w - 0.2, h: 0.5,
fontSize: 9, color: C.lightGray, align: "center", fontFace: "Calibri",
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// COLUMN 3 (x=6.5, w=3.38) — TREATMENT
// ═══════════════════════════════════════════════════════════════════════════════
const col3x = 6.5, col3w = 3.38;
cy = 1.26;
addPanel(slide, col3x, cy, col3w, 5.15, C.greenBg);
addSectionHeading(slide, "💊 EMERGENCY TREATMENT", col3x, cy, col3w, "145E3A");
cy += 0.28;
const treatments = [
{
step: "STEP 1",
title: "Membrane Stabilization",
color: C.red,
items: [
"IV Calcium Gluconate 10% — 10 mL over 2–3 min",
"Onset <5 min, duration 30–60 min",
"Repeat if ECG unchanged after 5 min",
"Use Calcium Chloride (3× potency) in cardiac arrest",
],
},
{
step: "STEP 2",
title: "Shift K⁺ Intracellularly",
color: "1A7A3A",
items: [
"Insulin 10 units IV + Dextrose 50% 50 mL",
"↓ K⁺ by 0.6–1.0 mEq/L within 15–30 min",
"Inhaled Salbutamol (Albuterol) 10–20 mg neb",
"NaHCO₃ (if pH <7.2 & residual renal function)",
],
},
{
step: "STEP 3",
title: "Remove K⁺ from Body",
color: "1A5C7A",
items: [
"Hemodialysis — most rapid & definitive method",
"K⁺ binders: Patiromer, SZC (sodium zirconium)",
"Loop diuretics (furosemide) — only if residual RFx",
"Sodium polystyrene sulfonate (limited evidence)",
],
},
];
let ty = cy + 0.06;
treatments.forEach(tx => {
// step badge
slide.addShape(pres.ShapeType.rect, {
x: col3x + 0.12, y: ty, w: 0.55, h: 0.21,
fill: { color: tx.color },
line: { type: "none" },
});
slide.addText(tx.step, {
x: col3x + 0.12, y: ty, w: 0.55, h: 0.21,
fontSize: 7, bold: true, color: C.white, align: "center", valign: "middle",
fontFace: "Calibri", margin: 0,
});
slide.addText(tx.title, {
x: col3x + 0.72, y: ty, w: col3w - 0.84, h: 0.21,
fontSize: 9.5, bold: true, color: C.amber, valign: "middle",
fontFace: "Calibri",
});
ty += 0.24;
tx.items.forEach(item => {
slide.addText(item, {
x: col3x + 0.22, y: ty, w: col3w - 0.34, h: 0.26,
fontSize: 8, color: C.lightGray, fontFace: "Calibri", valign: "top",
bullet: { code: "25B8", color: C.teal },
});
ty += 0.26;
});
ty += 0.1;
});
// Monitoring box
ty += 0.04;
slide.addShape(pres.ShapeType.rect, {
x: col3x + 0.12, y: ty, w: col3w - 0.22, h: 0.6,
fill: { color: "0D2818" },
line: { color: C.amber, pt: 1 },
});
slide.addText([
{ text: "MONITORING: ", options: { bold: true, color: C.amber } },
{ text: "Continuous ECG • Serum K⁺ q1–2h • Blood glucose (insulin Rx) • Watch for hypoglycaemia", options: { color: C.lightGray } },
], {
x: col3x + 0.18, y: ty + 0.06, w: col3w - 0.32, h: 0.48,
fontSize: 7.5, fontFace: "Calibri", valign: "top",
});
// ── K⁺ THRESHOLD BAR ─────────────────────────────────────────────────────────
const barY = 7.08;
slide.addShape(pres.ShapeType.rect, {
x: 0, y: barY, w: 10, h: 0.26,
fill: { color: "0A1A28" },
line: { type: "none" },
});
const thresholds = [
{ label: "Normal 3.5–5.0", x: 0.1, color: "2ECC71" },
{ label: "Mild 5.1–5.9", x: 2.1, color: C.amber },
{ label: "Moderate 6.0–6.5", x: 4.0, color: "E67E22" },
{ label: "Severe >6.5 → Emergent Tx", x: 6.1, color: C.red },
];
thresholds.forEach(t => {
slide.addText(t.label, {
x: t.x, y: barY + 0.01, w: 2.2, h: 0.24,
fontSize: 8.5, bold: true, color: t.color, fontFace: "Calibri",
align: "center", valign: "middle",
});
});
// ── FOOTER ────────────────────────────────────────────────────────────────────
slide.addText("Sources: NKF Primer on Kidney Diseases 8e | Rosen's Emergency Medicine | Harrison's 21e | Brenner & Rector's The Kidney", {
x: 0, y: 7.34, w: 10, h: 0.16,
fontSize: 6, italic: true, color: C.midGray, align: "center",
fontFace: "Calibri",
});
// ─── SAVE ────────────────────────────────────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/workspace/hyperkalemia-poster/Hyperkalemia_Dialysis_Poster.pptx" })
.then(() => console.log("✅ Poster saved!"))
.catch(err => console.error("❌ Error:", err));
cd /home/daytona/workspace/hyperkalemia-poster && node create_poster.js
ls -lh /home/daytona/workspace/hyperkalemia-poster/
Hyperkalemia Dialysis Poster
Presentation · PPTX
| Step | Action |
|---|---|
| Step 1 | IV Calcium Gluconate — membrane stabilization (onset <5 min) |
| Step 2 | Insulin + Dextrose, Salbutamol nebuliser, NaHCO₃ — shift K⁺ into cells |
| Step 3 | Hemodialysis (most rapid/definitive), patiromer/SZC binders, loop diuretics |