Make poster chart of emergency drugs labetolol metaplropromide tramdol avil transmic acid tipetodol phtyion lozarpam ondansteron noradrenaline adrenaline doutamine dopamine atropine dopamine nitroglycerin iv fluids mechanism how to use dilute indications contraindications dose maximum dose shelf life and half life
ls -la /home/daytona/workspace/ 2>/dev/null || mkdir -p /home/daytona/workspace/
mkdir -p /home/daytona/workspace/emergency-drug-poster && node -e "require('pptxgenjs'); console.log('pptxgenjs OK')"
~/emergency-drug-poster/create_poster.js
const pptxgen = require("pptxgenjs");
const pres = new pptxgen();
pres.layout = "LAYOUT_WIDE"; // 13.3" x 7.5"
pres.title = "Emergency Drug Reference Chart";
pres.author = "Emergency Medicine Reference";
// ─── COLOR PALETTE ────────────────────────────────────────────────────────────
const C = {
bg: "0D1B2A", // deep navy
header: "C62828", // urgent red
cat1: "1565C0", // royal blue (catecholamines)
cat2: "2E7D32", // green (antiemetics / GI)
cat3: "6A1B9A", // purple (analgesics)
cat4: "E65100", // deep orange (anticonvulsants / sedation)
cat5: "00838F", // teal (cardiac / vasoactive)
cat6: "558B2F", // olive (haemostatics)
cat7: "4527A0", // indigo (antihistamine)
cat8: "37474F", // slate (IV fluids)
white: "FFFFFF",
lightGray: "E3E8F0",
accent: "FFD600", // yellow accent
text: "FFFFFF",
};
// ─── DRUG DATA ────────────────────────────────────────────────────────────────
// Columns: Drug | Category | Mechanism | Indications | Contraindications | Dose | Max Dose | Dilution/How to Use | Shelf Life | Half-Life
const drugs = [
{
name: "Labetalol",
category: "α/β-Blocker",
catColor: C.cat5,
mechanism: "Blocks α1 + β1/β2 → ↓ HR, ↓ SVR",
indications: "Hypertensive emergency, pre-eclampsia, aortic dissection",
contra: "Asthma, COPD, 2°/3° AV block, severe bradycardia, cardiogenic shock",
dose: "IV: 20 mg slow bolus over 2 min; repeat 40–80 mg q10 min\nInfusion: 1–2 mg/min",
maxDose: "300 mg total bolus | Infusion: 2 mg/min",
dilution: "Infusion: 200 mg in 160 mL NS/D5W → 1 mg/mL. Give at 2 mL/min",
shelfLife: "Vials: 2 yrs (room temp). After dilution: 24 h",
halfLife: "3–8 hours",
},
{
name: "Metoclopramide",
category: "Prokinetic / Antiemetic",
catColor: C.cat2,
mechanism: "D2-antagonist (CTZ) + 5-HT4 agonist → ↑ gastric motility",
indications: "Nausea/vomiting, gastroparesis, GERD, migraine adjunct",
contra: "Parkinson's, phaeochromocytoma, GI obstruction/perforation, prolactinoma",
dose: "IV/IM: 10 mg over ≥3 min | Oral: 10 mg TDS",
maxDose: "30 mg/day IV; 5 days max continuous use",
dilution: "May give undiluted (5 mg/mL) slow IV push; or dilute in 50 mL NS over 15 min",
shelfLife: "3 yrs unopened. After dilution: 48 h at room temp",
halfLife: "4–6 hours",
},
{
name: "Tramadol",
category: "Opioid / Analgesic",
catColor: C.cat3,
mechanism: "Weak μ-opioid agonist + inhibits NE/5-HT reuptake",
indications: "Moderate–severe pain",
contra: "Seizure disorder, SSRIs/MAOIs (serotonin syndrome), respiratory depression, renal failure (severe)",
dose: "IV: 50–100 mg slow (>15 min) q4–6 h | Oral: 50–100 mg q4–6 h",
maxDose: "400 mg/day (oral); 600 mg/day (IV)",
dilution: "Dilute 100 mg in 100 mL NS or D5W; infuse over 15–30 min",
shelfLife: "3–5 yrs. After dilution: 24 h",
halfLife: "5–6 hours (active metabolite O-DTMP ~9 h)",
},
{
name: "Avil (Pheniramine)",
category: "Antihistamine (H1)",
catColor: C.cat7,
mechanism: "Competitive H1-receptor antagonist → blocks histamine-mediated responses",
indications: "Allergic reactions, urticaria, anaphylaxis adjunct, pre-medication",
contra: "Glaucoma, BPH, MAOI use, neonates, severe liver disease",
dose: "IM/IV slow: 22.75 mg (1 ampoule) | Can repeat in 4–6 h",
maxDose: "90 mg/day",
dilution: "Give IV slowly over 2–3 min undiluted OR dilute in 10 mL NS",
shelfLife: "3 yrs. After dilution: 24 h",
halfLife: "16–19 hours",
},
{
name: "Tranexamic Acid",
category: "Antifibrinolytic",
catColor: C.cat6,
mechanism: "Competitive inhibitor of plasminogen activation → prevents fibrin clot dissolution",
indications: "Trauma haemorrhage (within 3 h), PPH, surgical bleeding, haemoptysis",
contra: "Active thromboembolic disease, subarachnoid haemorrhage, hypersensitivity",
dose: "Trauma: 1 g IV over 10 min, then 1 g over 8 h\nPPH: 1 g IV over 10 min (repeat once if bleeding continues)",
maxDose: "2 g per episode (trauma); 4 g/day",
dilution: "1 g in 100 mL NS/D5W/RL; infuse at 1 mL/min. Avoid rapid IV push",
shelfLife: "3–5 yrs. After dilution: 24 h",
halfLife: "2–3 hours",
},
{
name: "Tapentadol",
category: "Opioid / Analgesic",
catColor: C.cat3,
mechanism: "μ-opioid agonist + NE reuptake inhibitor (dual MOA, no serotonergic effect)",
indications: "Moderate–severe acute/chronic pain, diabetic neuropathic pain",
contra: "MAOIs (within 14 days), respiratory depression, severe renal/hepatic impairment, paralytic ileus",
dose: "Oral: 50–100 mg q4–6 h IR | IV: Not routinely available (oral use preferred)",
maxDose: "600 mg/day (IR)",
dilution: "No standard IV formulation. Oral tablets: swallow whole with water",
shelfLife: "3 yrs (oral tablets)",
halfLife: "4–6 hours",
},
{
name: "Phenytoin",
category: "Anticonvulsant",
catColor: C.cat4,
mechanism: "Blocks voltage-gated Na⁺ channels → stabilises neuronal membrane → reduces seizure spread",
indications: "Status epilepticus (2nd line), seizure prophylaxis, trigeminal neuralgia",
contra: "Sinus bradycardia, SA/AV block, Adams-Stokes syndrome, porphyria",
dose: "Loading: 15–20 mg/kg IV at max 50 mg/min (with ECG monitoring)\nMaintenance: 5–7 mg/kg/day",
maxDose: "1500 mg loading dose | Infusion max 50 mg/min",
dilution: "ONLY in NS (precipitates in dextrose). Dilute to ≤5 mg/mL; use filter needle; give through large-bore IV",
shelfLife: "5 yrs. After dilution: use within 1 h (precipitation risk)",
halfLife: "22–36 hours (dose-dependent, non-linear kinetics)",
},
{
name: "Lorazepam",
category: "Benzodiazepine",
catColor: C.cat4,
mechanism: "GABA-A receptor positive allosteric modulator → ↑ Cl⁻ conductance → neuronal inhibition",
indications: "Status epilepticus (1st line), acute anxiety, procedural sedation, alcohol withdrawal",
contra: "Respiratory depression, acute angle-closure glaucoma, severe hepatic impairment, myasthenia gravis",
dose: "SE: 0.1 mg/kg IV (usual 4 mg) over 2–5 min; may repeat after 5–10 min\nAnxiety/sedation: 1–2 mg IV/IM",
maxDose: "8 mg per episode (SE); 10 mg/day",
dilution: "Dilute 1:1 with NS/D5W/WFI for IV use; do NOT dilute IM form",
shelfLife: "2 yrs refrigerated. After dilution: 24 h (refrigerated)",
halfLife: "10–20 hours",
},
{
name: "Ondansetron",
category: "5-HT3 Antagonist",
catColor: C.cat2,
mechanism: "5-HT3 receptor antagonist (CTZ + vagal afferents) → suppresses emesis",
indications: "PONV, chemotherapy-induced N&V, radiation-induced N&V, acute gastroenteritis",
contra: "Congenital long QT, co-administration with apomorphine; caution with QT-prolonging drugs",
dose: "IV: 4–8 mg slow over 15 min or 30 s\nOral: 4–8 mg TDS | IM: 4 mg",
maxDose: "32 mg/day IV (16 mg single IV dose in adults); 24 mg/day oral",
dilution: "Dilute 4–8 mg in 50 mL NS/D5W; infuse over 15 min. Can give 4 mg slow IV push over 30 s",
shelfLife: "3 yrs. After dilution: 48 h at room temp / 7 days refrigerated",
halfLife: "3–5 hours",
},
{
name: "Noradrenaline\n(Norepinephrine)",
category: "Vasopressor",
catColor: C.cat1,
mechanism: "α1 > α2 agonist (potent vasoconstriction) + mild β1 → ↑ MAP, ↑ SVR",
indications: "Septic shock (1st line), distributive shock, cardiogenic shock (adjunct)",
contra: "Hypovolaemic shock (without volume resuscitation); mesenteric/peripheral vascular thrombosis; halothane anaesthesia",
dose: "0.01–3 mcg/kg/min IV infusion (titrate to MAP ≥65 mmHg)\nStart: 0.01–0.1 mcg/kg/min",
maxDose: "3 mcg/kg/min (higher doses used in refractory shock under expert guidance)",
dilution: "4 mg in 250 mL NS/D5W → 16 mcg/mL. CENTRAL LINE preferred. Avoid extravasation",
shelfLife: "2 yrs. After dilution: 24 h protected from light",
halfLife: "1–3 minutes (IV bolus)",
},
{
name: "Adrenaline\n(Epinephrine)",
category: "Catecholamine / Vasopressor",
catColor: C.cat1,
mechanism: "α1/α2 + β1/β2 agonist → ↑ HR, ↑ CO, bronchodilation, vasoconstriction",
indications: "Anaphylaxis (1st line), cardiac arrest (ACLS), severe bronchospasm, croup",
contra: "Narrow-angle glaucoma; relative: ischaemic heart disease, hypertension",
dose: "Anaphylaxis: 0.5 mg (1:1000) IM thigh\nCardiac arrest: 1 mg (1:10,000) IV q3–5 min\nInfusion: 0.1–1 mcg/kg/min",
maxDose: "Repeat IM q5–15 min as needed | Infusion up to 1 mcg/kg/min (higher in refractory shock)",
dilution: "Infusion: 1 mg in 250 mL NS → 4 mcg/mL. Dilute 1:10,000 for IV bolus: 1 mg in 10 mL NS",
shelfLife: "2 yrs (protect from light). After dilution: 24 h",
halfLife: "1–3 minutes (IV)",
},
{
name: "Dobutamine",
category: "Inotrope",
catColor: C.cat1,
mechanism: "β1 > β2 agonist → ↑ CO, ↑ inotropy, mild ↓ SVR (vasodilatory)",
indications: "Cardiogenic shock, acute decompensated HF, stress echocardiography",
contra: "HOCM (outflow tract obstruction), tachyarrhythmias, uncorrected hypovolaemia",
dose: "2.5–20 mcg/kg/min IV infusion; start at 2.5–5 mcg/kg/min",
maxDose: "40 mcg/kg/min",
dilution: "250 mg in 250 mL D5W or NS → 1 mg/mL. Use via infusion pump. Peripheral line acceptable",
shelfLife: "2 yrs. After dilution: 24 h at room temp / 48 h refrigerated",
halfLife: "2 minutes",
},
{
name: "Dopamine",
category: "Catecholamine / Inotrope",
catColor: C.cat1,
mechanism: "Dose-dependent: Low (1–5 mcg/kg/min) D1/D2 → renal; Mid (5–10) β1 → inotrope; High (>10) α1 → vasopressor",
indications: "Cardiogenic shock, symptomatic bradycardia (when atropine fails), haemodynamic instability",
contra: "Phaeochromocytoma, uncorrected tachyarrhythmias, VF; caution: MAOI use",
dose: "2–20 mcg/kg/min IV (titrate to effect)\n• Renal: 2–5 mcg/kg/min\n• Cardiac: 5–10 mcg/kg/min\n• Vasopressor: 10–20 mcg/kg/min",
maxDose: "50 mcg/kg/min (refractory shock)",
dilution: "400 mg in 250 mL D5W/NS → 1.6 mg/mL. Infusion pump mandatory. Central line preferred >10 mcg/kg/min",
shelfLife: "2 yrs. After dilution: 24 h",
halfLife: "~2 minutes",
},
{
name: "Atropine",
category: "Anticholinergic",
catColor: C.cat5,
mechanism: "Competitive muscarinic receptor antagonist → blocks vagal tone → ↑ HR, ↓ secretions",
indications: "Symptomatic bradycardia, organophosphate poisoning, pre-anaesthetic medication, AV block",
contra: "Narrow-angle glaucoma, obstructive uropathy/GI obstruction, tachycardia",
dose: "Bradycardia: 0.5–1 mg IV q3–5 min\nOrganophosphate poisoning: 2–4 mg IV q5–10 min (titrate to secretion drying)\nPre-op: 0.4–0.6 mg IM",
maxDose: "3 mg total IV (bradycardia); No set max for organophosphate poisoning",
dilution: "Can give undiluted IV push (0.5 mg/mL or 1 mg/mL). Dilute in 10 mL NS if preferred",
shelfLife: "3–5 yrs. After dilution: 24 h",
halfLife: "2–3 hours",
},
{
name: "Nitroglycerin (GTN)",
category: "Nitrate / Vasodilator",
catColor: C.cat5,
mechanism: "Metabolised to NO → activates guanylyl cyclase → ↑ cGMP → smooth muscle relaxation → venodilation > arteriodilation",
indications: "Acute coronary syndrome (angina/NSTEMI/STEMI), acute HF with pulmonary oedema, hypertensive emergency",
contra: "Hypotension (SBP <90 mmHg), RV infarction, severe aortic stenosis, PDE5 inhibitor use (sildenafil/tadalafil) within 24–48 h",
dose: "SL: 0.3–0.6 mg q5 min (max 3 doses)\nIV infusion: 5–200 mcg/min (start 5–10 mcg/min, titrate)",
maxDose: "200 mcg/min infusion; 3 SL doses before escalating",
dilution: "25 mg in 250 mL D5W/NS → 100 mcg/mL. Use non-PVC tubing (adsorbs to PVC). Change bottle q24 h",
shelfLife: "2–5 yrs (sealed). After dilution: 24 h (non-PVC, protect from light)",
halfLife: "1–4 minutes (IV); SL onset 1–2 min, duration 30–60 min",
},
];
// ─── IV FLUIDS DATA ───────────────────────────────────────────────────────────
const fluids = [
{
name: "Normal Saline (0.9% NaCl)",
comp: "Na⁺ 154, Cl⁻ 154 mEq/L | Osmolarity 308 mOsm/L",
use: "Volume resuscitation, hyponatraemia, hypochloraemia, drug diluent",
contra: "Hypernatraemia, hyperchloraemic acidosis, oedematous states",
dose: "250–1000 mL bolus; maintenance 1–2 mL/kg/h",
note: "Universal diluent for most IV drugs",
},
{
name: "Ringer's Lactate (RL)",
comp: "Na⁺ 130, K⁺ 4, Ca²⁺ 3, Cl⁻ 109, Lactate 28 mEq/L | 273 mOsm/L",
use: "Trauma, burns, surgical losses, hypovolaemia — more physiological than NS",
contra: "Hepatic failure (lactate metabolism), hyperKalaemia, head injury (mild hypotonicity)",
dose: "1–2 L bolus in haemorrhagic shock; maintenance per fluid balance",
note: "Preferred in trauma/surgery. Do NOT mix with blood products (Ca²⁺ causes clotting)",
},
{
name: "Dextrose 5% (D5W)",
comp: "Dextrose 50 g/L | Osmolarity 252 mOsm/L (hypotonic after metabolism)",
use: "Drug diluent (GTN, dopamine, dobutamine), hypoglycaemia, hypernatraemia, fluid maintenance",
contra: "Cerebral oedema, uncorrected hyponatraemia, hyperglycaemia",
dose: "Maintenance: 1–2 mL/kg/h; hypoglycaemia: 50 mL D50% (25 g glucose)",
note: "Free water distributes evenly; not for volume resuscitation",
},
{
name: "Dextrose-Saline (DNS 5%/0.45%)",
comp: "Dextrose 50 g/L + Na⁺ 77, Cl⁻ 77 mEq/L | 405 mOsm/L",
use: "Maintenance fluids (paeds + adults), post-op fluid replacement",
contra: "Hypernatraemia, hyperglycaemia, SIADH",
dose: "Paeds: 100 mL/kg/day (first 10 kg) + 50 mL/kg/day (next 10 kg) + 20 mL/kg/day (remaining)",
note: "Holliday-Segar formula for paediatric maintenance",
},
{
name: "Colloid – Albumin 4.5%",
comp: "Human albumin 45 g/L | Oncotic pressure ~20 mmHg",
use: "Hypoalbuminaemia (<20 g/L), spontaneous bacterial peritonitis, hepatorenal syndrome, burns (after 24 h)",
contra: "Cardiac failure, severe anaemia, hypervolaemia",
dose: "100–200 mL infused over 4–6 h; SBP: 1.5 g/kg IV",
note: "Expensive; no mortality benefit over crystalloids in most ICU patients",
},
];
// ─── HELPERS ─────────────────────────────────────────────────────────────────
function wrapText(text, fontSize = 6.5) {
return text || "";
}
// ─── SLIDE 1: TITLE / OVERVIEW ───────────────────────────────────────────────
function addTitleSlide(pres) {
const slide = pres.addSlide();
// Background
slide.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 13.3, h: 7.5, fill: { color: C.bg }, line: { color: C.bg } });
// Red accent bar top
slide.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 13.3, h: 0.6, fill: { color: C.header }, line: { color: C.header } });
// Red accent bar bottom
slide.addShape(pres.shapes.RECTANGLE, { x: 0, y: 6.9, w: 13.3, h: 0.6, fill: { color: C.header }, line: { color: C.header } });
// Cross symbol
slide.addShape(pres.shapes.RECTANGLE, { x: 1.0, y: 2.5, w: 0.2, h: 1.0, fill: { color: C.accent }, line: { color: C.accent } });
slide.addShape(pres.shapes.RECTANGLE, { x: 0.75, y: 2.75, w: 0.7, h: 0.5, fill: { color: C.accent }, line: { color: C.accent } });
slide.addText("EMERGENCY DRUG", { x: 1.6, y: 1.9, w: 10, h: 0.9, fontSize: 44, bold: true, color: C.white, fontFace: "Arial" });
slide.addText("REFERENCE CHART", { x: 1.6, y: 2.65, w: 10, h: 0.9, fontSize: 44, bold: true, color: C.accent, fontFace: "Arial" });
slide.addText("Mechanism • Indications • Contraindications • Dosing • Dilution • Shelf Life • Half-Life", {
x: 1.6, y: 3.55, w: 10, h: 0.5, fontSize: 14, color: "AABBCC", fontFace: "Arial", italic: true
});
// Drug list
const drugNames = [
"Labetalol | Metoclopramide | Tramadol | Avil (Pheniramine) | Tranexamic Acid | Tapentadol",
"Phenytoin | Lorazepam | Ondansetron | Noradrenaline | Adrenaline | Dobutamine",
"Dopamine | Atropine | Nitroglycerin (GTN) | IV Fluids"
];
drugNames.forEach((line, i) => {
slide.addText(line, { x: 1.0, y: 4.3 + i * 0.42, w: 11.3, h: 0.4, fontSize: 11, color: "CCDDEE", fontFace: "Arial", align: "center" });
});
slide.addText("Emergency Medicine • Critical Care • ICU / ED Reference • April 2026", {
x: 0, y: 6.95, w: 13.3, h: 0.5, fontSize: 10, color: C.white, fontFace: "Arial", align: "center"
});
slide.addText("⚠ For clinical guidance only. Verify doses per local formulary & patient weight.", {
x: 0, y: 0.07, w: 13.3, h: 0.45, fontSize: 10, color: C.white, fontFace: "Arial", align: "center", bold: true
});
}
// ─── DRUG TABLE SLIDES (batches of 5) ───────────────────────────────────────
function addDrugTableSlides(pres, drugs) {
// Each batch = up to 5 drugs per slide
const batchSize = 5;
const batches = [];
for (let i = 0; i < drugs.length; i += batchSize) {
batches.push(drugs.slice(i, i + batchSize));
}
batches.forEach((batch, bi) => {
const slide = pres.addSlide();
// BG
slide.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 13.3, h: 7.5, fill: { color: C.bg }, line: { color: C.bg } });
// Header bar
slide.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 13.3, h: 0.45, fill: { color: C.header }, line: { color: C.header } });
slide.addText(`EMERGENCY DRUG CHART — Part ${bi + 1}`, {
x: 0.1, y: 0.04, w: 9, h: 0.38, fontSize: 13, bold: true, color: C.white, fontFace: "Arial"
});
slide.addText("⚠ Verify doses per local formulary", {
x: 9.5, y: 0.04, w: 3.7, h: 0.38, fontSize: 9, color: C.accent, fontFace: "Arial", align: "right"
});
// Column headers
const cols = [
{ label: "DRUG / CLASS", x: 0.05, w: 1.30 },
{ label: "MECHANISM", x: 1.40, w: 1.65 },
{ label: "INDICATIONS", x: 3.10, w: 1.70 },
{ label: "CONTRA-\nINDICATIONS",x: 4.85, w: 1.60 },
{ label: "DOSE", x: 6.50, w: 1.90 },
{ label: "MAX DOSE", x: 8.45, w: 1.10 },
{ label: "DILUTION / HOW TO USE",x:9.60, w: 2.00 },
{ label: "SHELF LIFE", x: 11.65, w: 0.82 },
{ label: "½ LIFE", x: 12.50, w: 0.75 },
];
const hdrY = 0.5;
cols.forEach(col => {
slide.addShape(pres.shapes.RECTANGLE, {
x: col.x, y: hdrY, w: col.w, h: 0.42,
fill: { color: "1A2D45" }, line: { color: "2A4A70", pt: 0.5 }
});
slide.addText(col.label, {
x: col.x + 0.02, y: hdrY + 0.01, w: col.w - 0.04, h: 0.40,
fontSize: 6.8, bold: true, color: C.accent, fontFace: "Arial", align: "center", valign: "middle"
});
});
// Row height
const rowH = (7.5 - hdrY - 0.42 - 0.08) / batchSize;
const rowStartY = hdrY + 0.42 + 0.03;
batch.forEach((drug, ri) => {
const ry = rowStartY + ri * rowH;
const rowBg = ri % 2 === 0 ? "0F2233" : "0D1B2A";
// Row bg
slide.addShape(pres.shapes.RECTANGLE, {
x: 0.05, y: ry, w: 13.2, h: rowH - 0.03,
fill: { color: rowBg }, line: { color: "1E3550", pt: 0.3 }
});
// Category accent left bar
slide.addShape(pres.shapes.RECTANGLE, {
x: 0.05, y: ry, w: 0.08, h: rowH - 0.03,
fill: { color: drug.catColor }, line: { color: drug.catColor }
});
const fs = 6.2;
const cellPad = 0.04;
const textProps = { fontSize: fs, color: C.white, fontFace: "Arial", valign: "top", wrap: true };
// Drug name cell
slide.addText([
{ text: drug.name + "\n", options: { bold: true, fontSize: 7.2, color: C.accent, breakLine: true } },
{ text: drug.category, options: { fontSize: 5.8, color: "88AACC", italic: true } }
], { x: cols[0].x + 0.12, y: ry + cellPad, w: cols[0].w - 0.15, h: rowH - 0.08, ...textProps });
// Mechanism
slide.addText(drug.mechanism, {
x: cols[1].x + cellPad, y: ry + cellPad, w: cols[1].w - 0.08, h: rowH - 0.08, ...textProps
});
// Indications
slide.addText(drug.indications, {
x: cols[2].x + cellPad, y: ry + cellPad, w: cols[2].w - 0.08, h: rowH - 0.08, ...textProps, color: "AAFFAA"
});
// Contraindications
slide.addText(drug.contra, {
x: cols[3].x + cellPad, y: ry + cellPad, w: cols[3].w - 0.08, h: rowH - 0.08, ...textProps, color: "FFAAAA"
});
// Dose
slide.addText(drug.dose, {
x: cols[4].x + cellPad, y: ry + cellPad, w: cols[4].w - 0.08, h: rowH - 0.08, ...textProps, color: "FFFFCC"
});
// Max dose
slide.addText(drug.maxDose, {
x: cols[5].x + cellPad, y: ry + cellPad, w: cols[5].w - 0.08, h: rowH - 0.08, ...textProps, color: "FFCCAA"
});
// Dilution
slide.addText(drug.dilution, {
x: cols[6].x + cellPad, y: ry + cellPad, w: cols[6].w - 0.08, h: rowH - 0.08, ...textProps, color: "CCEEFF"
});
// Shelf life
slide.addText(drug.shelfLife, {
x: cols[7].x + cellPad, y: ry + cellPad, w: cols[7].w - 0.08, h: rowH - 0.08, ...textProps, color: "DDDDFF"
});
// Half life
slide.addText(drug.halfLife, {
x: cols[8].x + cellPad, y: ry + cellPad, w: cols[8].w - 0.08, h: rowH - 0.08, ...textProps, color: "FFDDFF"
});
// Vertical dividers
cols.slice(1).forEach(col => {
slide.addShape(pres.shapes.LINE, {
x: col.x, y: ry, w: 0, h: rowH - 0.03,
line: { color: "1E3550", pt: 0.3 }
});
});
});
});
}
// ─── IV FLUIDS SLIDE ─────────────────────────────────────────────────────────
function addIVFluidsSlide(pres, fluids) {
const slide = pres.addSlide();
slide.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 13.3, h: 7.5, fill: { color: C.bg }, line: { color: C.bg } });
slide.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 13.3, h: 0.45, fill: { color: C.cat8 }, line: { color: C.cat8 } });
slide.addText("IV FLUIDS QUICK REFERENCE", {
x: 0.2, y: 0.04, w: 9, h: 0.38, fontSize: 14, bold: true, color: C.white, fontFace: "Arial"
});
slide.addText("⚠ Crystalloids first-line for resuscitation", {
x: 9.5, y: 0.04, w: 3.7, h: 0.38, fontSize: 9, color: C.accent, align: "right", fontFace: "Arial"
});
const fcols = [
{ label: "FLUID", x: 0.05, w: 2.10 },
{ label: "COMPOSITION", x: 2.20, w: 2.20 },
{ label: "INDICATIONS", x: 4.45, w: 2.40 },
{ label: "CONTRAINDICATIONS",x: 6.90, w: 2.10 },
{ label: "DOSE / RATE", x: 9.05, w: 2.00 },
{ label: "NOTES", x: 11.10, w: 2.15 },
];
const hdrY = 0.5;
fcols.forEach(col => {
slide.addShape(pres.shapes.RECTANGLE, {
x: col.x, y: hdrY, w: col.w, h: 0.38,
fill: { color: "1A2D45" }, line: { color: "2A4A70", pt: 0.5 }
});
slide.addText(col.label, {
x: col.x + 0.02, y: hdrY + 0.01, w: col.w - 0.04, h: 0.36,
fontSize: 7.2, bold: true, color: C.accent, fontFace: "Arial", align: "center", valign: "middle"
});
});
const rowH = (7.5 - hdrY - 0.38 - 0.1) / fluids.length;
const rowStartY = hdrY + 0.38 + 0.04;
const fluidColors = [C.cat5, C.cat2, C.cat3, C.cat4, C.cat6];
fluids.forEach((fl, ri) => {
const ry = rowStartY + ri * rowH;
const rowBg = ri % 2 === 0 ? "0F2233" : "0D1B2A";
slide.addShape(pres.shapes.RECTANGLE, {
x: 0.05, y: ry, w: 13.2, h: rowH - 0.03,
fill: { color: rowBg }, line: { color: "1E3550", pt: 0.3 }
});
slide.addShape(pres.shapes.RECTANGLE, {
x: 0.05, y: ry, w: 0.08, h: rowH - 0.03,
fill: { color: fluidColors[ri] || C.cat5 }, line: { color: fluidColors[ri] || C.cat5 }
});
const fs = 6.8;
const cp = 0.04;
const tp = { fontSize: fs, color: C.white, fontFace: "Arial", valign: "top", wrap: true };
slide.addText(fl.name, { x: fcols[0].x + 0.14, y: ry + cp, w: fcols[0].w - 0.18, h: rowH - 0.08, ...tp, bold: true, color: C.accent });
slide.addText(fl.comp, { x: fcols[1].x + cp, y: ry + cp, w: fcols[1].w - 0.08, h: rowH - 0.08, ...tp });
slide.addText(fl.use, { x: fcols[2].x + cp, y: ry + cp, w: fcols[2].w - 0.08, h: rowH - 0.08, ...tp, color: "AAFFAA" });
slide.addText(fl.contra, { x: fcols[3].x + cp, y: ry + cp, w: fcols[3].w - 0.08, h: rowH - 0.08, ...tp, color: "FFAAAA" });
slide.addText(fl.dose, { x: fcols[4].x + cp, y: ry + cp, w: fcols[4].w - 0.08, h: rowH - 0.08, ...tp, color: "FFFFCC" });
slide.addText(fl.note, { x: fcols[5].x + cp, y: ry + cp, w: fcols[5].w - 0.08, h: rowH - 0.08, ...tp, color: "CCEEFF" });
});
}
// ─── QUICK REFERENCE / CHEAT SHEET SLIDE ─────────────────────────────────────
function addCheatSheetSlide(pres) {
const slide = pres.addSlide();
slide.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 13.3, h: 7.5, fill: { color: C.bg }, line: { color: C.bg } });
slide.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 13.3, h: 0.45, fill: { color: "880000" }, line: { color: "880000" } });
slide.addText("EMERGENCY QUICK-PICK GUIDE", {
x: 0.2, y: 0.04, w: 13, h: 0.38, fontSize: 14, bold: true, color: C.white, fontFace: "Arial", align: "center"
});
const cards = [
{ title: "ANAPHYLAXIS", color: C.header, drugs: "1st: Adrenaline 0.5 mg IM (1:1000)\n2nd: Avil 22.75 mg IV slow\n3rd: Ondansetron (N/V)\nMonitor: BP, O₂, ECG" },
{ title: "STATUS EPILEPTICUS", color: C.cat4, drugs: "1st: Lorazepam 0.1 mg/kg IV (max 4 mg)\n2nd: Phenytoin 20 mg/kg IV (max 50 mg/min)\nAirway / O₂ / BGL" },
{ title: "HYPERTENSIVE EMERGENCY", color: C.cat5, drugs: "IV Labetalol 20 mg bolus, then 40–80 mg\nOR GTN infusion 5–200 mcg/min\nTarget: ↓ MAP by 25% in 1st hour" },
{ title: "SEPTIC SHOCK", color: C.cat1, drugs: "Fluid: 30 mL/kg NS/RL bolus\n1st vasopressor: Noradrenaline 0.1–3 mcg/kg/min\n2nd: Vasopressin (if refractory)" },
{ title: "CARDIOGENIC SHOCK", color: C.cat5, drugs: "Dobutamine 5–20 mcg/kg/min (↑ CO)\n+ Noradrenaline if MAP <65\nAvoid: excessive fluids" },
{ title: "NAUSEA / VOMITING", color: C.cat2, drugs: "Ondansetron 4–8 mg IV over 15 min\nMetoclopramide 10 mg IV slow (if motility needed)\nCheck: QTc before ondansetron" },
{ title: "PAIN (MODERATE-SEVERE)", color: C.cat3, drugs: "Tramadol 100 mg IV over 15 min\nTapentadol 50–100 mg oral\nAvoid tramadol with SSRIs" },
{ title: "BLEEDING / HAEMORRHAGE", color: C.cat6, drugs: "Tranexamic acid 1 g IV over 10 min\nGive within 3 h of injury (trauma)\nPPH: repeat 1 g if bleeding continues" },
{ title: "BRADYCARDIA (SYMPTOMATIC)", color: "007700", drugs: "Atropine 0.5–1 mg IV push\nRepeat q3–5 min, max 3 mg\nRefractory: Dopamine infusion 5–10 mcg/kg/min" },
];
const cols = 3;
const rows = Math.ceil(cards.length / cols);
const cw = 4.2;
const ch = (7.5 - 0.45 - 0.15) / rows - 0.06;
const startX = 0.15;
const startY = 0.55;
cards.forEach((card, i) => {
const col = i % cols;
const row = Math.floor(i / cols);
const cx = startX + col * (cw + 0.1);
const cy = startY + row * (ch + 0.06);
slide.addShape(pres.shapes.ROUNDED_RECTANGLE, {
x: cx, y: cy, w: cw, h: ch,
fill: { color: "0F2233" }, line: { color: card.color, pt: 1 }, rectRadius: 0.08
});
slide.addShape(pres.shapes.ROUNDED_RECTANGLE, {
x: cx, y: cy, w: cw, h: 0.28,
fill: { color: card.color }, line: { color: card.color }, rectRadius: 0.08
});
slide.addText(card.title, {
x: cx + 0.08, y: cy + 0.02, w: cw - 0.16, h: 0.25,
fontSize: 8.5, bold: true, color: C.white, fontFace: "Arial", align: "center"
});
slide.addText(card.drugs, {
x: cx + 0.1, y: cy + 0.30, w: cw - 0.2, h: ch - 0.35,
fontSize: 7.2, color: C.white, fontFace: "Arial", valign: "top", wrap: true
});
});
}
// ─── BUILD PRESENTATION ───────────────────────────────────────────────────────
addTitleSlide(pres);
addDrugTableSlides(pres, drugs);
addIVFluidsSlide(pres, fluids);
addCheatSheetSlide(pres);
const outPath = "/home/daytona/workspace/emergency-drug-poster/Emergency_Drug_Reference_Chart.pptx";
pres.writeFile({ fileName: outPath }).then(() => {
console.log("SUCCESS: " + outPath);
}).catch(err => {
console.error("ERROR:", err);
});
cd /home/daytona/workspace/emergency-drug-poster && node create_poster.js 2>&1
ls -lh /home/daytona/workspace/emergency-drug-poster/
Emergency Drug Reference Chart
Presentation · PPTX
| Column | Color |
|---|---|
| Drug Name / Class | Gold |
| Mechanism of Action | White |
| Indications | Green |
| Contraindications | Red |
| Dose | Yellow |
| Maximum Dose | Orange |
| Dilution / How to Use | Cyan |
| Shelf Life | Lavender |
| Half-Life | Pink |
⚠ Disclaimer: This chart is a clinical reference aid. Always verify doses against your local formulary, patient weight, renal/hepatic function, and current guidelines before administration.