~/aws-presentation/build.js
const pptxgen = require("pptxgenjs");
const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Alcohol Withdrawal Management";
pres.author = "Clinical Pharmacology Teaching";
// ── COLOUR PALETTE ──────────────────────────────────────────────
const NAVY = "0D1B2A"; // dominant background
const TEAL = "1B7F79"; // accent bars / section headers
const AMBER = "E8A838"; // highlight / key facts
const WHITE = "FFFFFF";
const LGRAY = "E8EDF2"; // card fill
const DGRAY = "2C3E50"; // body text on light bg
const RED = "C0392B"; // danger / warning
const GREEN = "1E8449"; // safe / mild
// ── HELPERS ─────────────────────────────────────────────────────
function addBg(slide, color) {
slide.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 10, h: 5.625, fill: { color } });
}
function addAccentBar(slide, color = TEAL) {
slide.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 10, h: 0.08, fill: { color } });
slide.addShape(pres.shapes.RECTANGLE, { x: 0, y: 5.545, w: 10, h: 0.08, fill: { color } });
}
function sectionTitle(slide, text, sub) {
addBg(slide, NAVY);
// centre accent line
slide.addShape(pres.shapes.RECTANGLE, { x: 3.5, y: 2.65, w: 3, h: 0.06, fill: { color: AMBER } });
slide.addText(text, {
x: 0.5, y: 1.9, w: 9, h: 1,
fontSize: 40, bold: true, color: WHITE, align: "center", fontFace: "Calibri"
});
if (sub) slide.addText(sub, {
x: 1, y: 2.9, w: 8, h: 0.6,
fontSize: 18, color: TEAL, align: "center", fontFace: "Calibri", italic: true
});
}
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 1 — TITLE
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
const s = pres.addSlide();
addBg(s, NAVY);
// bold teal sidebar
s.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 0.18, h: 5.625, fill: { color: TEAL } });
// amber accent
s.addShape(pres.shapes.RECTANGLE, { x: 0.5, y: 3.5, w: 5.5, h: 0.07, fill: { color: AMBER } });
s.addText("ALCOHOL WITHDRAWAL", {
x: 0.5, y: 0.8, w: 9, h: 1,
fontSize: 44, bold: true, color: WHITE, fontFace: "Calibri", charSpacing: 2
});
s.addText("MANAGEMENT", {
x: 0.5, y: 1.75, w: 9, h: 0.9,
fontSize: 44, bold: true, color: AMBER, fontFace: "Calibri", charSpacing: 2
});
s.addText("A Comprehensive Clinical Teaching Module", {
x: 0.5, y: 2.85, w: 8, h: 0.55,
fontSize: 17, color: LGRAY, fontFace: "Calibri", italic: true
});
s.addText([
{ text: "Pathophysiology • ", options: {} },
{ text: "CIWA-Ar Assessment • ", options: {} },
{ text: "Pharmacotherapy • ", options: {} },
{ text: "Complications • ", options: {} },
{ text: "Pharmacist Role", options: {} }
], {
x: 0.5, y: 3.75, w: 9, h: 0.5,
fontSize: 12, color: "8ABFD4", fontFace: "Calibri"
});
s.addText("Maudsley Prescribing Guidelines, 15e | ROSEN's Emergency Medicine | Goldman-Cecil Medicine", {
x: 0.5, y: 5.2, w: 9, h: 0.3,
fontSize: 9, color: "5A7A8A", fontFace: "Calibri"
});
}
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 2 — OVERVIEW / AGENDA
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
const s = pres.addSlide();
addBg(s, LGRAY);
addAccentBar(s);
s.addText("What We Will Cover", {
x: 0.5, y: 0.15, w: 9, h: 0.55,
fontSize: 26, bold: true, color: NAVY, fontFace: "Calibri"
});
const topics = [
["01", "Epidemiology & Overview", "Who gets AWS and why it matters"],
["02", "Pathophysiology", "GABA / NMDA imbalance explained"],
["03", "Clinical Features & Timeline", "What you will see and when"],
["04", "CIWA-Ar Scoring", "Quantifying severity objectively"],
["05", "Pharmacotherapy", "Benzodiazepines, thiamine, adjuncts"],
["06", "Delirium Tremens", "The most dangerous complication"],
["07", "Wernicke-Korsakoff", "Thiamine deficiency spectrum"],
["08", "Drug Therapy Problems", "Pharmacist interventions"],
["09", "Discharge & Counseling", "Preventing relapse & complications"],
];
const cols = [[0], [1,2,3,4], [5,6,7,8]];
const positions = [
{ x: 0.3, y: 0.85 },
{ x: 0.3, y: 0.85 },
{ x: 3.5, y: 0.85 },
{ x: 6.7, y: 0.85 },
];
let col = 0;
const xStarts = [0.3, 3.45, 6.6];
const yStart = 0.85;
topics.forEach((t, i) => {
const c = i < 3 ? 0 : i < 6 ? 1 : 2;
const row = i % 3;
const x = xStarts[c];
const y = yStart + row * 1.45;
s.addShape(pres.shapes.RECTANGLE, {
x, y, w: 3.0, h: 1.3,
fill: { color: WHITE },
shadow: { type: "outer", color: "AAAAAA", blur: 5, offset: 2, angle: 135, opacity: 0.18 }
});
s.addShape(pres.shapes.RECTANGLE, { x, y, w: 0.55, h: 1.3, fill: { color: TEAL } });
s.addText(t[0], {
x, y: y + 0.38, w: 0.55, h: 0.55,
fontSize: 16, bold: true, color: WHITE, align: "center", fontFace: "Calibri"
});
s.addText(t[1], {
x: x + 0.62, y: y + 0.12, w: 2.3, h: 0.5,
fontSize: 11, bold: true, color: NAVY, fontFace: "Calibri"
});
s.addText(t[2], {
x: x + 0.62, y: y + 0.6, w: 2.3, h: 0.55,
fontSize: 9.5, color: "556070", fontFace: "Calibri", italic: true
});
});
}
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 3 — SECTION DIVIDER: PATHOPHYSIOLOGY
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
const s = pres.addSlide();
sectionTitle(s, "PATHOPHYSIOLOGY", "Why does alcohol withdrawal cause seizures?");
}
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 4 — GABA/NMDA MECHANISM
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
const s = pres.addSlide();
addBg(s, WHITE);
s.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 10, h: 0.55, fill: { color: NAVY } });
s.addText("Mechanism of Alcohol Withdrawal", {
x: 0.3, y: 0.05, w: 9.4, h: 0.45,
fontSize: 20, bold: true, color: WHITE, fontFace: "Calibri"
});
// Three state boxes
const states = [
{
title: "CHRONIC ALCOHOL USE",
color: "1A5276",
items: [
"↑ GABA-A receptor activity (inhibition)",
"Alcohol potentiates GABA → brain adapts",
"Down-regulates GABA-A receptors",
"↓ NMDA receptor sensitivity (excitation suppressed)",
"Brain compensates: UP-regulates NMDA receptors",
]
},
{
title: "ABRUPT CESSATION",
color: RED,
items: [
"GABA inhibition suddenly drops",
"Down-regulated GABA-A can't compensate",
"NMDA excitatory receptors now unmasked",
"Net result: BRAIN HYPEREXCITABILITY",
"Unopposed sympathetic drive",
]
},
{
title: "CLINICAL RESULT",
color: TEAL,
items: [
"Tremors (earliest — 6-8h)",
"Seizures (peak 12-24h)",
"Hallucinations (12-36h)",
"Autonomic instability",
"Delirium Tremens (48-72h+)",
]
}
];
states.forEach((st, i) => {
const x = 0.18 + i * 3.28;
s.addShape(pres.shapes.RECTANGLE, { x, y: 0.7, w: 3.1, h: 0.42, fill: { color: st.color } });
s.addText(st.title, {
x, y: 0.72, w: 3.1, h: 0.38,
fontSize: 11, bold: true, color: WHITE, align: "center", fontFace: "Calibri"
});
st.items.forEach((item, j) => {
s.addText([
{ text: "▸ ", options: { color: st.color, bold: true } },
{ text: item, options: { color: DGRAY } }
], {
x: x + 0.1, y: 1.2 + j * 0.75, w: 2.95, h: 0.65,
fontSize: 11, fontFace: "Calibri"
});
});
// Arrow between boxes
if (i < 2) {
s.addText("→", {
x: x + 3.08, y: 1.5, w: 0.25, h: 0.5,
fontSize: 22, bold: true, color: AMBER, align: "center"
});
}
});
s.addShape(pres.shapes.RECTANGLE, { x: 0.18, y: 5.15, w: 9.64, h: 0.35, fill: { color: LGRAY } });
s.addText("Key principle: Benzodiazepines restore GABA-ergic tone → suppress the hyperexcitable state", {
x: 0.3, y: 5.18, w: 9.4, h: 0.28,
fontSize: 10.5, italic: true, color: NAVY, fontFace: "Calibri"
});
}
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 5 — CLINICAL TIMELINE
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
const s = pres.addSlide();
addBg(s, NAVY);
s.addText("Clinical Timeline of Alcohol Withdrawal", {
x: 0.4, y: 0.12, w: 9.2, h: 0.52,
fontSize: 22, bold: true, color: WHITE, fontFace: "Calibri"
});
s.addShape(pres.shapes.RECTANGLE, { x: 0.4, y: 0.66, w: 9.2, h: 0.05, fill: { color: AMBER } });
// Timeline axis
s.addShape(pres.shapes.RECTANGLE, { x: 0.5, y: 3.1, w: 9, h: 0.06, fill: { color: AMBER } });
s.addText("LAST DRINK →", { x: 0.5, y: 3.22, w: 2, h: 0.3, fontSize: 9, color: AMBER, fontFace: "Calibri" });
s.addText("TIME", { x: 8.5, y: 3.22, w: 1, h: 0.3, fontSize: 9, color: AMBER, fontFace: "Calibri" });
const events = [
{ h: "6-8h", label: "Tremor\nAnxiety\nDiaphoresis", x: 1.0, color: GREEN, danger: false },
{ h: "12-24h", label: "SEIZURES\n(Tonic-Clonic)\nPeak risk", x: 3.0, color: AMBER, danger: true },
{ h: "12-36h", label: "Hallucinations\n(Visual/Auditory)", x: 5.1, color: "E67E22", danger: false },
{ h: "48-72h+",label: "DELIRIUM\nTREMENS", x: 7.2, color: RED, danger: true },
];
events.forEach(ev => {
// pole
s.addShape(pres.shapes.RECTANGLE, { x: ev.x + 0.55, y: 1.0, w: 0.05, h: 2.1, fill: { color: ev.color } });
// top flag
s.addShape(pres.shapes.RECTANGLE, {
x: ev.x, y: ev.danger ? 0.75 : 0.75, w: 1.2, h: 1.0,
fill: { color: ev.color }, shadow: { type: "outer", color: "000000", blur: 4, offset: 2, angle: 135, opacity: 0.25 }
});
s.addText(ev.h, {
x: ev.x + 0.03, y: 0.78, w: 1.14, h: 0.26,
fontSize: 10, bold: true, color: WHITE, align: "center", fontFace: "Calibri"
});
s.addText(ev.label, {
x: ev.x + 0.03, y: 1.04, w: 1.14, h: 0.66,
fontSize: 8.5, color: WHITE, align: "center", fontFace: "Calibri"
});
// dot on axis
s.addShape(pres.shapes.OVAL, {
x: ev.x + 0.48, y: 3.03, w: 0.19, h: 0.19, fill: { color: ev.color }
});
});
// Bottom key facts
const facts = [
"90% of patients have 1-6 GTC seizures",
"60% of seizures cluster within 6 hours",
"~30% of AWS patients progress to delirium tremens",
"Delirium tremens mortality: 1-5% (untreated: up to 15%)",
];
facts.forEach((f, i) => {
s.addText([
{ text: "◆ ", options: { color: AMBER, bold: true } },
{ text: f, options: { color: WHITE } }
], {
x: 0.5 + (i % 2) * 4.7,
y: 3.6 + Math.floor(i / 2) * 0.5,
w: 4.5, h: 0.42,
fontSize: 11, fontFace: "Calibri"
});
});
}
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 6 — CIWA-Ar SCORING
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
const s = pres.addSlide();
addBg(s, WHITE);
s.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 10, h: 0.55, fill: { color: TEAL } });
s.addText("CIWA-Ar: Clinical Institute Withdrawal Assessment for Alcohol (Revised)", {
x: 0.3, y: 0.05, w: 9.4, h: 0.45,
fontSize: 16, bold: true, color: WHITE, fontFace: "Calibri"
});
// Left: 10 items
s.addText("10 Assessed Parameters", {
x: 0.3, y: 0.65, w: 4.5, h: 0.38,
fontSize: 14, bold: true, color: NAVY, fontFace: "Calibri"
});
const items = [
"1. Nausea / Vomiting",
"2. Tremor",
"3. Paroxysmal Sweats",
"4. Anxiety",
"5. Agitation",
"6. Tactile Disturbances",
"7. Auditory Disturbances",
"8. Visual Disturbances",
"9. Headache / Fullness in Head",
"10. Orientation / Clouding of Sensorium",
];
items.forEach((item, i) => {
s.addText(item, {
x: 0.3, y: 1.1 + i * 0.41,
w: 4.4, h: 0.37,
fontSize: 11, color: DGRAY, fontFace: "Calibri",
bullet: { type: "number" }
});
});
// Right: severity table
s.addText("Severity & Action", {
x: 5.2, y: 0.65, w: 4.5, h: 0.38,
fontSize: 14, bold: true, color: NAVY, fontFace: "Calibri"
});
const rows = [
{ score: "≤ 8", sev: "Mild", action: "Monitor; no BZD needed", col: GREEN },
{ score: "9-14", sev: "Moderate", action: "Symptomatic BZD; close monitoring", col: AMBER },
{ score: "15-19", sev: "Severe", action: "Chlordiazepoxide taper; hospitalise", col: "E67E22" },
{ score: "≥ 20", sev: "Critical", action: "IV BZD; consider ICU; monitor DT risk", col: RED },
];
rows.forEach((r, i) => {
const y = 1.12 + i * 1.02;
s.addShape(pres.shapes.RECTANGLE, { x: 5.15, y, w: 4.6, h: 0.92, fill: { color: LGRAY } });
s.addShape(pres.shapes.RECTANGLE, { x: 5.15, y, w: 0.85, h: 0.92, fill: { color: r.col } });
s.addText(r.score, { x: 5.15, y: y + 0.14, w: 0.85, h: 0.6, fontSize: 14, bold: true, color: WHITE, align: "center", fontFace: "Calibri" });
s.addText(r.sev, { x: 6.08, y: y + 0.06, w: 3.6, h: 0.34, fontSize: 12, bold: true, color: DGRAY, fontFace: "Calibri" });
s.addText(r.action, { x: 6.08, y: y + 0.44, w: 3.6, h: 0.38, fontSize: 9.5, color: "55667A", fontFace: "Calibri" });
});
s.addText("Max score = 67 | Each item scored 0-7 | Complete in ~5 minutes | Score every 4-8h during detox", {
x: 0.3, y: 5.25, w: 9.4, h: 0.3,
fontSize: 9.5, color: TEAL, italic: true, fontFace: "Calibri"
});
}
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 7 — SECTION DIVIDER: PHARMACOTHERAPY
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
const s = pres.addSlide();
sectionTitle(s, "PHARMACOTHERAPY", "Benzodiazepines, Thiamine & Adjuncts");
}
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 8 — BENZODIAZEPINES (First-Line)
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
const s = pres.addSlide();
addBg(s, WHITE);
s.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 10, h: 0.55, fill: { color: NAVY } });
s.addText("Benzodiazepines — First-Line Treatment for AWS", {
x: 0.3, y: 0.07, w: 9.4, h: 0.42,
fontSize: 18, bold: true, color: WHITE, fontFace: "Calibri"
});
// Why BZDs?
s.addShape(pres.shapes.RECTANGLE, { x: 0.25, y: 0.65, w: 9.5, h: 0.34, fill: { color: LGRAY } });
s.addText("Why Benzodiazepines? Cross-tolerance with alcohol → restore GABA-A inhibition → suppress neuronal hyperexcitability & raise seizure threshold", {
x: 0.35, y: 0.67, w: 9.3, h: 0.3, fontSize: 10.5, color: DGRAY, italic: true, fontFace: "Calibri"
});
const drugs = [
{
name: "Chlordiazepoxide",
type: "Long-acting (gold standard for detox)",
dose: "Starting dose = alcohol units/day (mg QID)\ne.g. 20 units → 20mg QID, then taper over 5-7 days",
pros: ["Low dependence potential", "Self-tapering via active metabolites", "Preferred in most centres (NICE)"],
cons: ["Avoid in liver failure (use oxazepam/lorazepam)", "Long half-life risk in elderly"],
color: TEAL,
},
{
name: "Diazepam",
type: "Long-acting (used for acute seizures / step-down)",
dose: "5-10mg orally TID-QID, tapering\nIV 5-10mg for acute seizure control",
pros: ["Rapid onset IV", "Effective for acute control", "Step-down from chlordiazepoxide"],
cons: ["Higher abuse potential", "Accumulates in liver disease"],
color: "1A5276",
},
{
name: "Lorazepam",
type: "Short-acting (acute seizure use only)",
dose: "IV 2mg SOS for active seizure\nRepeat q5-10min if needed",
pros: ["Only BZD proven to ↓ seizure recurrence (NNT=5)", "Safe in liver disease", "Predictable IM absorption"],
cons: ["Does not self-taper", "Not suitable for full detox course"],
color: AMBER,
},
];
drugs.forEach((d, i) => {
const x = 0.22 + i * 3.26;
s.addShape(pres.shapes.RECTANGLE, { x, y: 1.1, w: 3.1, h: 4.35, fill: { color: LGRAY } });
s.addShape(pres.shapes.RECTANGLE, { x, y: 1.1, w: 3.1, h: 0.52, fill: { color: d.color } });
s.addText(d.name, { x: x + 0.1, y: 1.13, w: 2.9, h: 0.28, fontSize: 12, bold: true, color: WHITE, fontFace: "Calibri" });
s.addText(d.type, { x: x + 0.1, y: 1.38, w: 2.9, h: 0.22, fontSize: 8.5, color: WHITE, fontFace: "Calibri", italic: true });
s.addText("DOSE:", { x: x + 0.1, y: 1.72, w: 0.6, h: 0.22, fontSize: 9, bold: true, color: d.color, fontFace: "Calibri" });
s.addText(d.dose, { x: x + 0.1, y: 1.93, w: 2.9, h: 0.7, fontSize: 9, color: DGRAY, fontFace: "Calibri" });
s.addText("✓ Advantages:", { x: x + 0.1, y: 2.72, w: 2.9, h: 0.25, fontSize: 9.5, bold: true, color: GREEN, fontFace: "Calibri" });
d.pros.forEach((p, j) => {
s.addText("• " + p, { x: x + 0.1, y: 2.98 + j * 0.3, w: 2.9, h: 0.28, fontSize: 8.5, color: DGRAY, fontFace: "Calibri" });
});
s.addText("⚠ Cautions:", { x: x + 0.1, y: 3.95, w: 2.9, h: 0.25, fontSize: 9.5, bold: true, color: RED, fontFace: "Calibri" });
d.cons.forEach((c, j) => {
s.addText("• " + c, { x: x + 0.1, y: 4.2 + j * 0.3, w: 2.9, h: 0.28, fontSize: 8.5, color: DGRAY, fontFace: "Calibri" });
});
});
}
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 9 — THIAMINE & ADJUNCT THERAPY
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
const s = pres.addSlide();
addBg(s, WHITE);
s.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 10, h: 0.55, fill: { color: TEAL } });
s.addText("Thiamine & Adjunct Pharmacotherapy", {
x: 0.3, y: 0.08, w: 9.4, h: 0.42,
fontSize: 20, bold: true, color: WHITE, fontFace: "Calibri"
});
// THIAMINE BOX (big)
s.addShape(pres.shapes.RECTANGLE, { x: 0.25, y: 0.68, w: 5.8, h: 3.0, fill: { color: LGRAY } });
s.addShape(pres.shapes.RECTANGLE, { x: 0.25, y: 0.68, w: 5.8, h: 0.45, fill: { color: "8B4513" } });
s.addText("⭐ THIAMINE (Vitamin B1) — MANDATORY IN ALL CASES", {
x: 0.35, y: 0.71, w: 5.6, h: 0.38,
fontSize: 11, bold: true, color: WHITE, fontFace: "Calibri"
});
const thi = [
["Why?", "Alcoholics are thiamine-deficient: poor diet + impaired GI absorption + hepatic storage depletion"],
["Critical rule:", "Give thiamine BEFORE or WITH glucose/dextrose — glucose load in deficient patient precipitates Wernicke's Encephalopathy"],
["Inpatient dose:", "100-200mg IV/IM OD (Pabrinex or thiamine injection); 200mg IV used in this case"],
["Discharge:", "100mg oral BD x 14 days minimum; longer if malnourished"],
["Prevents:", "Wernicke's Encephalopathy → Korsakoff Syndrome (irreversible amnesia)"],
];
thi.forEach((row, i) => {
s.addText(row[0], {
x: 0.35, y: 1.2 + i * 0.47, w: 1.1, h: 0.38,
fontSize: 9.5, bold: true, color: "8B4513", fontFace: "Calibri"
});
s.addText(row[1], {
x: 1.5, y: 1.2 + i * 0.47, w: 4.4, h: 0.38,
fontSize: 9.5, color: DGRAY, fontFace: "Calibri"
});
});
// Right column: adjuncts
const adjuncts = [
{
drug: "Sodium Valproate",
use: "Seizure prophylaxis (esp. if pre-existing epilepsy)",
dose: "200mg BD-TID",
note: "Not first-line for AWS alone but useful for comorbid epilepsy"
},
{
drug: "Levetiracetam",
use: "Add-on anticonvulsant in complex cases",
dose: "500mg IV/oral BD",
note: "Used when seizure risk is high; taper once withdrawal phase passes"
},
{
drug: "Pantoprazole",
use: "Gastric protection (alcohol erosions, GERD)",
dose: "40mg IV/oral OD",
note: "Step down to oral once tolerating food"
},
{
drug: "B-Complex",
use: "Replenish B2, B6, B12, folate — all depleted",
dose: "1-0-1 orally",
note: "Continue for weeks; supports neurological recovery"
},
];
adjuncts.forEach((a, i) => {
const y = 0.68 + i * 1.15;
s.addShape(pres.shapes.RECTANGLE, { x: 6.25, y, w: 3.5, h: 1.05, fill: { color: LGRAY } });
s.addShape(pres.shapes.RECTANGLE, { x: 6.25, y, w: 0.1, h: 1.05, fill: { color: TEAL } });
s.addText(a.drug, { x: 6.42, y: y + 0.04, w: 3.2, h: 0.3, fontSize: 11, bold: true, color: NAVY, fontFace: "Calibri" });
s.addText(a.use + " — " + a.dose, { x: 6.42, y: y + 0.33, w: 3.2, h: 0.3, fontSize: 9, color: DGRAY, fontFace: "Calibri" });
s.addText(a.note, { x: 6.42, y: y + 0.66, w: 3.2, h: 0.3, fontSize: 8.5, color: "667788", fontFace: "Calibri", italic: true });
});
s.addShape(pres.shapes.RECTANGLE, { x: 0.25, y: 3.77, w: 5.8, h: 0.55, fill: { color: "FFF3CD" } });
s.addText("⚠ CARDINAL RULE: Thiamine → THEN glucose. Never glucose before thiamine in a suspected deficient patient.", {
x: 0.35, y: 3.79, w: 5.6, h: 0.44,
fontSize: 10, bold: true, color: RED, fontFace: "Calibri"
});
// Electrolytes reminder
s.addShape(pres.shapes.RECTANGLE, { x: 0.25, y: 4.4, w: 9.5, h: 0.96, fill: { color: LGRAY } });
s.addText("Electrolyte Correction (Do Not Forget):", {
x: 0.4, y: 4.44, w: 4, h: 0.28, fontSize: 11, bold: true, color: NAVY, fontFace: "Calibri"
});
const electros = [
"Potassium (K⁺): Hypokalemia (common; lowers seizure threshold) → Oral/IV KCl",
"Magnesium: Deficiency causes refractory hypokalemia → IV MgSO₄",
"Glucose: Monitor for hypoglycemia (especially in liver disease)",
"Sodium: Hyponatremia can mimic/precipitate seizures",
];
electros.forEach((e, i) => {
s.addText("• " + e, {
x: 0.4 + (i % 2) * 4.7,
y: 4.75 + Math.floor(i / 2) * 0.28,
w: 4.55, h: 0.26,
fontSize: 9, color: DGRAY, fontFace: "Calibri"
});
});
}
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 10 — DELIRIUM TREMENS
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
const s = pres.addSlide();
addBg(s, NAVY);
s.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 10, h: 0.55, fill: { color: RED } });
s.addText("⚠ DELIRIUM TREMENS — The Most Dangerous Complication", {
x: 0.3, y: 0.07, w: 9.4, h: 0.42,
fontSize: 17, bold: true, color: WHITE, fontFace: "Calibri"
});
// Key facts banner
s.addShape(pres.shapes.RECTANGLE, { x: 0.25, y: 0.68, w: 9.5, h: 0.5, fill: { color: "1A1A2E" } });
s.addText("Onset: 48-72h after last drink | Occurs in ~30% of AWS | Untreated mortality: up to 15% | Treated mortality: 1-5%", {
x: 0.35, y: 0.72, w: 9.3, h: 0.38,
fontSize: 11, color: AMBER, align: "center", fontFace: "Calibri", bold: true
});
// Features + Management side by side
// Features
s.addShape(pres.shapes.RECTANGLE, { x: 0.25, y: 1.28, w: 4.5, h: 0.36, fill: { color: RED } });
s.addText("Clinical Features", { x: 0.35, y: 1.3, w: 4.3, h: 0.3, fontSize: 13, bold: true, color: WHITE, fontFace: "Calibri" });
const features = [
"Disorientation and confusion",
"Agitation / combativeness",
"Fever (>38.5°C)",
"Profuse diaphoresis",
"Tachycardia (HR >100)",
"Hypertension",
"Vivid visual hallucinations",
"Autonomic instability",
"Risk of status epilepticus",
];
features.forEach((f, i) => {
s.addText([
{ text: "✕ ", options: { color: RED, bold: true } },
{ text: f, options: { color: WHITE } }
], { x: 0.35, y: 1.72 + i * 0.37, w: 4.3, h: 0.34, fontSize: 10.5, fontFace: "Calibri" });
});
// Management
s.addShape(pres.shapes.RECTANGLE, { x: 5.0, y: 1.28, w: 4.75, h: 0.36, fill: { color: TEAL } });
s.addText("Management", { x: 5.1, y: 1.3, w: 4.5, h: 0.3, fontSize: 13, bold: true, color: WHITE, fontFace: "Calibri" });
const mgmt = [
["ICU Admission", "Continuous monitoring essential"],
["IV BZD loading", "Diazepam 10mg IV q10min until calm; or lorazepam 2-4mg IV"],
["Thiamine IV", "200mg IV BEFORE any glucose — non-negotiable"],
["IV Fluids", "Rehydration + electrolyte correction (K⁺, Mg²⁺)"],
["Phenobarbital", "BZD-refractory cases — adjunct anticonvulsant"],
["Antipsychotics", "Haloperidol for agitation (not for seizures)"],
["Airway", "Intubation if repeated IV boluses needed or GCS falls"],
["Treat triggers", "Infection, pain, metabolic — common precipitants"],
];
mgmt.forEach((m, i) => {
s.addText(m[0] + ":", { x: 5.1, y: 1.72 + i * 0.37, w: 1.5, h: 0.34, fontSize: 9.5, bold: true, color: AMBER, fontFace: "Calibri" });
s.addText(m[1], { x: 6.65, y: 1.72 + i * 0.37, w: 3.0, h: 0.34, fontSize: 9.5, color: WHITE, fontFace: "Calibri" });
});
}
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 11 — WERNICKE-KORSAKOFF
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
const s = pres.addSlide();
addBg(s, WHITE);
s.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 10, h: 0.55, fill: { color: "8B4513" } });
s.addText("Wernicke-Korsakoff Syndrome — Thiamine Deficiency Spectrum", {
x: 0.3, y: 0.07, w: 9.4, h: 0.42,
fontSize: 17, bold: true, color: WHITE, fontFace: "Calibri"
});
// Two columns: Wernicke | Korsakoff
const sides = [
{
title: "WERNICKE'S ENCEPHALOPATHY",
subtitle: "Acute — Reversible if treated early",
color: AMBER,
items: [
"Classic triad (present in <20%!):",
" → Ophthalmoplegia / Nystagmus",
" → Ataxia",
" → Confusion / Altered consciousness",
"",
"Broader symptoms to watch for:",
" → Hypothermia, Hypotension",
" → Memory disturbance",
" → Peripheral neuropathy",
"",
"Treatment: 200-500mg thiamine IV TID x 3 days",
"Reversible with prompt treatment",
]
},
{
title: "KORSAKOFF SYNDROME",
subtitle: "Chronic — Often irreversible",
color: RED,
items: [
"Develops from untreated Wernicke's",
"Classic features:",
" → Severe anterograde amnesia",
" → Retrograde amnesia",
" → Confabulation (fabricated memories)",
" → Personality change",
" → Relatively preserved intelligence",
"",
"Damage: mammillary bodies + thalamus",
"80% have persistent deficits",
"Prevention is the ONLY effective strategy",
]
}
];
sides.forEach((side, i) => {
const x = 0.25 + i * 4.9;
s.addShape(pres.shapes.RECTANGLE, { x, y: 0.65, w: 4.6, h: 4.75, fill: { color: LGRAY } });
s.addShape(pres.shapes.RECTANGLE, { x, y: 0.65, w: 4.6, h: 0.75, fill: { color: side.color } });
s.addText(side.title, { x: x + 0.1, y: 0.68, w: 4.4, h: 0.38, fontSize: 12, bold: true, color: WHITE, fontFace: "Calibri" });
s.addText(side.subtitle, { x: x + 0.1, y: 1.02, w: 4.4, h: 0.3, fontSize: 9.5, color: WHITE, italic: true, fontFace: "Calibri" });
side.items.forEach((item, j) => {
if (item === "") return;
s.addText(item, {
x: x + 0.12, y: 1.5 + j * 0.32, w: 4.35, h: 0.3,
fontSize: 10, color: DGRAY, fontFace: "Calibri",
bold: item.endsWith(":") || item.startsWith("Treatment")
});
});
});
// Bottom prevention rule
s.addShape(pres.shapes.RECTANGLE, { x: 0.25, y: 5.22, w: 9.5, h: 0.3, fill: { color: "FFF3CD" } });
s.addText("Prevention = Prophylactic IV/IM Thiamine in ALL hospitalised alcohol-dependent patients before any glucose administration", {
x: 0.35, y: 5.24, w: 9.3, h: 0.24,
fontSize: 9.5, bold: true, color: RED, fontFace: "Calibri"
});
}
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 12 — DRUG THERAPY PROBLEMS (Pharmacist Interventions)
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
const s = pres.addSlide();
addBg(s, WHITE);
s.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 10, h: 0.55, fill: { color: NAVY } });
s.addText("Drug Therapy Problems — Pharmacist Interventions", {
x: 0.3, y: 0.07, w: 9.4, h: 0.42,
fontSize: 18, bold: true, color: WHITE, fontFace: "Calibri"
});
const dtps = [
{ no: "1", type: "ADR Prevention", prob: "Thiamine–glucose sequencing", action: "Confirm thiamine given BEFORE dextrose; educate nurses on MAR", col: TEAL },
{ no: "2", type: "Needs Drug Therapy", prob: "Hypokalemia untreated (K 3.13)", action: "Recommend KCl supplementation; add MgSO₄ to prevent refractory hypokalemia", col: RED },
{ no: "3", type: "ADR / Monitoring", prob: "Elevated lipase (188 U/L)", action: "Alert physician re: pancreatitis; monitor trend; counsel on alcohol", col: AMBER },
{ no: "4", type: "Dosing / Monitoring", prob: "No CIWA-Ar score documented", action: "Recommend CIWA-Ar q4-8h; adjust BZD dose to objective score", col: "1A5276" },
{ no: "5", type: "Unnecessary Drug?", prob: "Levetiracetam role unclear", action: "Clarify if pre-existing epilepsy separate from AWS; formalize epilepsy plan", col: "6C3483" },
{ no: "6", type: "Route / Omission", prob: "IV PPI not stepped to oral; not on discharge Rx", action: "Step down to oral pantoprazole by Day 2-3; verify discharge omission intentional", col: "117A65" },
];
dtps.forEach((d, i) => {
const x = 0.18 + (i % 2) * 4.92;
const y = 0.68 + Math.floor(i / 2) * 1.6;
s.addShape(pres.shapes.RECTANGLE, {
x, y, w: 4.7, h: 1.48,
fill: { color: WHITE },
shadow: { type: "outer", color: "AAAAAA", blur: 4, offset: 1, angle: 135, opacity: 0.15 }
});
s.addShape(pres.shapes.RECTANGLE, { x, y, w: 0.52, h: 1.48, fill: { color: d.col } });
s.addText(d.no, { x, y: y + 0.48, w: 0.52, h: 0.5, fontSize: 18, bold: true, color: WHITE, align: "center", fontFace: "Calibri" });
s.addText(d.type, { x: x + 0.6, y: y + 0.08, w: 4.0, h: 0.28, fontSize: 10, bold: true, color: d.col, fontFace: "Calibri" });
s.addText("Problem: " + d.prob, { x: x + 0.6, y: y + 0.38, w: 4.0, h: 0.38, fontSize: 9.5, color: DGRAY, fontFace: "Calibri" });
s.addText("Action: " + d.action, { x: x + 0.6, y: y + 0.76, w: 4.0, h: 0.58, fontSize: 9, color: "445566", fontFace: "Calibri", italic: true });
});
}
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 13 — DISCHARGE & COUNSELING
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
const s = pres.addSlide();
addBg(s, WHITE);
s.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 10, h: 0.55, fill: { color: TEAL } });
s.addText("Discharge Medications & Patient Counseling", {
x: 0.3, y: 0.07, w: 9.4, h: 0.42,
fontSize: 20, bold: true, color: WHITE, fontFace: "Calibri"
});
// Discharge meds table
s.addText("Discharge Prescription (x14 days)", {
x: 0.3, y: 0.65, w: 5.5, h: 0.32,
fontSize: 13, bold: true, color: NAVY, fontFace: "Calibri"
});
const meds = [
["Drug", "Dose", "Schedule", "Purpose"],
["T. Thiamine", "100mg", "1–0–1", "Rebuild B1 stores; prevent WE recurrence"],
["T. Diazepam", "5mg", "0–0–2", "Continued gradual detox / nocte seizure prophylaxis"],
["T. Sodium Valproate", "200mg", "2–0–2", "Anticonvulsant maintenance (epilepsy + AWS)"],
["B-Complex Tablet", "—", "1–0–1", "Replenish B2, B6, B12, folate"],
];
const colW = [1.9, 0.7, 0.8, 2.3];
const colX = [0.3, 2.22, 2.95, 3.78];
meds.forEach((row, ri) => {
const y = 1.02 + ri * 0.45;
const bg = ri === 0 ? NAVY : ri % 2 === 0 ? LGRAY : WHITE;
s.addShape(pres.shapes.RECTANGLE, { x: 0.3, y, w: 5.78, h: 0.43, fill: { color: bg } });
row.forEach((cell, ci) => {
s.addText(cell, {
x: colX[ci] + 0.05, y: y + 0.05, w: colW[ci] - 0.1, h: 0.34,
fontSize: ri === 0 ? 10 : 9.5,
bold: ri === 0 || ci === 0,
color: ri === 0 ? WHITE : DGRAY,
fontFace: "Calibri"
});
});
});
// Counseling points
s.addText("Key Patient Counseling Points", {
x: 6.35, y: 0.65, w: 3.4, h: 0.32,
fontSize: 13, bold: true, color: NAVY, fontFace: "Calibri"
});
const counsel = [
["🚫", "No alcohol", "Even one drink can restart the cycle — relapse triggers seizures"],
["💊", "Adherence", "Complete full 14-day course; do not stop valproate suddenly"],
["🍳", "With food", "Take valproate with meals to reduce nausea"],
["⚠", "Diazepam", "Nocte only; no extra doses; extremely dangerous with alcohol"],
["🔁", "Follow-up", "Repeat LFTs, serum K, lipase in 2 weeks"],
["🏥", "Return if:", "Shaking, confusion, hallucinations, severe abdominal pain"],
["🧠", "Referral", "De-addiction psychiatry; structured support program"],
];
counsel.forEach((c, i) => {
s.addShape(pres.shapes.RECTANGLE, { x: 6.3, y: 1.02 + i * 0.61, w: 3.45, h: 0.55, fill: { color: i % 2 === 0 ? LGRAY : WHITE } });
s.addText(c[0], { x: 6.33, y: 1.07 + i * 0.61, w: 0.35, h: 0.4, fontSize: 14, align: "center" });
s.addText(c[1] + ": ", { x: 6.72, y: 1.07 + i * 0.61, w: 0.75, h: 0.2, fontSize: 9, bold: true, color: NAVY, fontFace: "Calibri" });
s.addText(c[2], { x: 6.72, y: 1.27 + i * 0.61, w: 2.9, h: 0.26, fontSize: 8.5, color: DGRAY, fontFace: "Calibri" });
});
// Warning signs row
s.addShape(pres.shapes.RECTANGLE, { x: 0.3, y: 5.0, w: 9.4, h: 0.5, fill: { color: "FFF3CD" } });
s.addText("⚠ Warn patient: Stopping alcohol suddenly at home WITHOUT medical supervision is dangerous — advise supervised detox program", {
x: 0.4, y: 5.03, w: 9.2, h: 0.42,
fontSize: 10, bold: true, color: RED, fontFace: "Calibri"
});
}
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 14 — SUMMARY / KEY TAKEAWAYS
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
const s = pres.addSlide();
addBg(s, NAVY);
s.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 10, h: 0.08, fill: { color: AMBER } });
s.addShape(pres.shapes.RECTANGLE, { x: 0, y: 5.545, w: 10, h: 0.08, fill: { color: AMBER } });
s.addText("10 KEY TAKEAWAYS", {
x: 0.5, y: 0.18, w: 9, h: 0.52,
fontSize: 28, bold: true, color: WHITE, align: "center", fontFace: "Calibri", charSpacing: 3
});
s.addShape(pres.shapes.RECTANGLE, { x: 3.0, y: 0.72, w: 4, h: 0.06, fill: { color: AMBER } });
const takes = [
["01", "AWS seizures peak 12-24h after last drink (up to 48h)"],
["02", "Mechanism: GABA-A down-regulation + NMDA up-regulation → hyperexcitability"],
["03", "CIWA-Ar score every 4-8h guides benzodiazepine dosing — use it"],
["04", "Chlordiazepoxide = gold standard for detox; Lorazepam IV for acute seizures (NNT=5)"],
["05", "THIAMINE BEFORE GLUCOSE — non-negotiable rule; prevents Wernicke's"],
["06", "Hypokalemia + Hypomagnesemia → lower seizure threshold — correct both"],
["07", "Delirium tremens onset 48-72h; mortality up to 15% untreated — escalate early"],
["08", "GGT is the most sensitive enzyme marker for chronic alcohol use"],
["09", "Pharmacist: identify DTPs (untreated hypokalemia, CIWA-Ar omission, sequencing)"],
["10", "Discharge counseling + de-addiction referral = essential to prevent relapse"],
];
takes.forEach((t, i) => {
const col = i < 5 ? 0 : 1;
const row = i % 5;
const x = 0.3 + col * 4.9;
const y = 0.88 + row * 0.88;
s.addShape(pres.shapes.RECTANGLE, { x, y, w: 4.6, h: 0.78, fill: { color: "0A2540" } });
s.addShape(pres.shapes.RECTANGLE, { x, y, w: 0.48, h: 0.78, fill: { color: AMBER } });
s.addText(t[0], { x, y: y + 0.17, w: 0.48, h: 0.44, fontSize: 14, bold: true, color: NAVY, align: "center", fontFace: "Calibri" });
s.addText(t[1], { x: x + 0.55, y: y + 0.1, w: 3.97, h: 0.58, fontSize: 10, color: WHITE, fontFace: "Calibri" });
});
}
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// WRITE FILE
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
pres.writeFile({ fileName: "/home/daytona/workspace/aws-presentation/Alcohol_Withdrawal_Management.pptx" })
.then(() => console.log("DONE"))
.catch(e => { console.error("ERROR", e); process.exit(1); });