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

Checking Date & Time
Reading File
Asking for Preferences
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Running Command

mkdir -p /home/daytona/workspace/emergency-drugs-poster && ls /home/daytona/workspace/emergency-drugs-poster/

Writing File

~/emergency-drugs-poster/build.js

const pptxgen = require("pptxgenjs");

const pres = new pptxgen();
pres.layout = "LAYOUT_WIDE"; // 13.3" x 7.5"
pres.title = "Emergency Drugs Quick Reference";
pres.author = "Emergency Medicine Reference";

// ============================================================
// COLOUR PALETTE
// Deep navy dominant, teal accent, amber highlight, white text
// ============================================================
const C = {
  navy:      "0B1F3A",
  navyMid:   "122747",
  teal:      "0D8A8A",
  tealLight: "14AAAA",
  amber:     "F5A623",
  amberDark: "D4891E",
  red:       "C0392B",
  green:     "1A9B5F",
  purple:    "6C3FA0",
  gray:      "ECF0F1",
  white:     "FFFFFF",
  textDark:  "1A1A2E",
  badge_ci:  "C0392B",
  badge_ind: "1A9B5F",
  badge_mech:"1565C0",
};

// ============================================================
// DRUG DATA
// ============================================================
const drugs = [
  {
    name: "LABETALOL",
    category: "Antihypertensive",
    color: C.teal,
    mechanism: "Combined α1 + β1/β2 adrenergic blocker → reduces peripheral vascular resistance + heart rate without reflex tachycardia",
    indications: ["Hypertensive emergency", "Hypertension in pregnancy (pre-eclampsia)", "Aortic dissection", "Acute ischemic stroke (BP >185/110)", "Cocaine-induced hypertension"],
    contraindications: ["Asthma/COPD (bronchospasm)", "Decompensated heart failure", "Bradycardia / Heart block (2nd/3rd degree)", "Cardiogenic shock", "Hypotension"],
    dilution: "50 mg in 40 mL NS = 1 mg/mL; OR undiluted bolus 5–10 mg IV push",
    dose: "IV Bolus: 20 mg slow IV over 2 min, repeat 40–80 mg q10min\nInfusion: 1–2 mg/min",
    maxDose: "300 mg total (bolus) or 300 mg cumulative dose",
    halfLife: "5–8 hours",
    shelfLife: "Vial: 3 years; Diluted: 24 h at room temp",
    notes: "Monitor BP every 5 min. Onset 2–5 min IV.",
  },
  {
    name: "METOCLOPRAMIDE",
    category: "Antiemetic / Prokinetic",
    color: C.green,
    mechanism: "D2 dopamine receptor antagonist (central & peripheral) + 5-HT4 agonist → accelerates gastric emptying, blocks CTZ vomiting centre",
    indications: ["Nausea/vomiting (post-op, chemo, migraine)", "Diabetic gastroparesis", "GERD adjunct", "Facilitate small bowel intubation", "Migraine headache (adjunct)"],
    contraindications: ["GI obstruction / perforation", "Pheochromocytoma", "Seizure disorders (lowers threshold)", "Parkinson's disease", "Tardive dyskinesia history", "Methemoglobinemia (G6PD deficiency)"],
    dilution: "10 mg in 50–100 mL NS, infuse over 15–30 min (slow IV reduces akathisia)",
    dose: "10 mg IV/IM q6–8h; 10–15 mg oral TDS",
    maxDose: "40 mg/day (IV); 60 mg/day (oral)",
    halfLife: "5–6 hours",
    shelfLife: "Ampule: 3 years; Diluted: 24–48 h (2–8°C)",
    notes: "Risk of extrapyramidal effects (EPS). Use diphenhydramine prophylaxis in high-risk patients.",
  },
  {
    name: "TRAMADOL",
    category: "Opioid Analgesic",
    color: C.purple,
    mechanism: "Weak μ-opioid receptor agonist + inhibits reuptake of serotonin & norepinephrine → dual analgesic mechanism",
    indications: ["Moderate-to-severe pain", "Post-operative analgesia", "Neuropathic pain", "Chronic pain management", "Musculoskeletal pain"],
    contraindications: ["Epilepsy / seizure disorder", "MAO inhibitor use (risk of serotonin syndrome)", "Severe hepatic/renal impairment", "Acute alcohol intoxication", "Respiratory depression", "Children <12 years"],
    dilution: "50–100 mg in 100 mL NS, infuse over 30–60 min; avoid rapid bolus",
    dose: "50–100 mg IV/IM/oral q4–6h",
    maxDose: "400 mg/day (adults); 300 mg/day (elderly or renal impairment)",
    halfLife: "6 hours (parent); 7–9 hours (active metabolite O-desmethyltramadol)",
    shelfLife: "Ampule: 3 years; Diluted: 24 h",
    notes: "Seizure risk; avoid in serotonin syndrome. Tramadol ≠ Tapentadol (different profiles).",
  },
  {
    name: "TAPENTADOL",
    category: "Opioid Analgesic (Dual MOA)",
    color: "5E3A8C",
    mechanism: "μ-opioid receptor agonist + norepinephrine reuptake inhibitor (NRI) → strong analgesic with less serotonergic activity than tramadol",
    indications: ["Moderate-to-severe acute pain", "Chronic nociceptive & neuropathic pain", "Diabetic peripheral neuropathy", "Post-operative pain"],
    contraindications: ["MAO inhibitors (within 14 days)", "Severe respiratory depression", "Paralytic ileus", "Acute intoxication", "Uncontrolled epilepsy", "Children <18 years"],
    dilution: "Oral tablets only (50, 75, 100 mg); No IV formulation available",
    dose: "50–100 mg oral q4–6h; Day 1 max: second dose 1h after first if needed",
    maxDose: "600 mg/day (Day 1); 500 mg/day (Day 2 onwards)",
    halfLife: "4 hours",
    shelfLife: "Tablets: 2–3 years (room temperature, dry)",
    notes: "Less constipation & nausea than tramadol. Titrate carefully in hepatic impairment.",
  },
  {
    name: "AVIL (PHENIRAMINE)",
    category: "Antihistamine (H1 blocker)",
    color: "2E86AB",
    mechanism: "Competitive H1-receptor antagonist → blocks histamine action on blood vessels, bronchi, GI tract + anticholinergic + mild CNS sedation",
    indications: ["Allergic reactions / Anaphylaxis (adjunct)", "Urticaria & angioedema", "Drug hypersensitivity reactions", "Pruritus", "Transfusion reactions", "Rhinitis", "Insect bite reactions"],
    contraindications: ["Narrow-angle glaucoma", "Prostatic hypertrophy (urinary retention)", "Severe hepatic disease", "MAO inhibitor use", "Neonates/premature infants"],
    dilution: "22.75 mg (1 mL ampule) diluted in 10–20 mL NS, slow IV over 5–10 min; or undiluted IM",
    dose: "22.75–45.5 mg IM/slow IV; 4 mg oral TDS",
    maxDose: "100 mg/day",
    halfLife: "16–19 hours",
    shelfLife: "Ampule: 3 years; Diluted: use immediately",
    notes: "NOT a substitute for epinephrine in anaphylaxis — epinephrine is first-line. Causes drowsiness.",
  },
  {
    name: "TRANEXAMIC ACID (TXA)",
    category: "Antifibrinolytic / Hemostatic",
    color: C.red,
    mechanism: "Synthetic lysine analogue → competitively inhibits plasminogen activation to plasmin → prevents fibrin clot degradation → reduces bleeding",
    indications: ["Trauma with major hemorrhage (within 3 hours)", "Postpartum hemorrhage (PPH)", "Surgical hemorrhage (cardiac, ortho, GI)", "Hemophilia with bleeds", "Epistaxis (topical/IV)", "Heavy menstrual bleeding"],
    contraindications: ["Active thromboembolic disease (DVT, PE, stroke)", "Subarachnoid hemorrhage (risk vasospasm)", "Hematuria from upper urinary tract (clot retention)", "DIC with fibrinolytic state being protective", "Allergy to TXA"],
    dilution: "1 g in 100 mL NS or D5W, infuse over 10 min (loading); then 1 g over 8 hours (maintenance)\nDO NOT mix with blood products",
    dose: "Loading: 1 g IV over 10 min → Maintenance: 1 g IV over 8 h\nPPH: 1 g IV, repeat 30 min later if needed",
    maxDose: "2–3 g/day (most protocols)",
    halfLife: "2–3 hours",
    shelfLife: "Ampule: 5 years; Diluted: 24 h (refrigerated)",
    notes: "CRASH-2 trial: reduces mortality in trauma if given <3h of injury. Ineffective if given >3h.",
  },
  {
    name: "PHENYTOIN",
    category: "Antiepileptic / Antiarrhythmic",
    color: "7F5AF0",
    mechanism: "Blocks voltage-gated Na⁺ channels → stabilizes neuronal membranes → reduces repetitive firing; also class Ib antiarrhythmic action",
    indications: ["Status epilepticus (second-line after benzodiazepines)", "Generalised tonic-clonic seizures (maintenance)", "Trigeminal neuralgia", "Ventricular arrhythmias (digoxin-induced)", "Traumatic brain injury seizure prophylaxis"],
    contraindications: ["Sinus bradycardia / SA/AV block (2nd or 3rd degree)", "Adams-Stokes syndrome", "Porphyria", "Pregnancy (teratogenic – fetal hydantoin syndrome)", "Hypotension"],
    dilution: "Dilute in NS ONLY (precipitates in dextrose). Max 6.7 mg/mL (250 mg in 40 mL NS)\nDO NOT refrigerate diluted solution",
    dose: "Loading: 15–20 mg/kg IV at ≤50 mg/min (≤25 mg/min elderly/cardiac)\nMaintenance: 100 mg IV/oral q8h",
    maxDose: "Loading: 1500 mg total; Maintenance: 600 mg/day",
    halfLife: "22 hours (dose-dependent / non-linear kinetics – zero order at high doses)",
    shelfLife: "Vial: 3–5 years; Diluted in NS: USE WITHIN 4 HOURS (precipitates easily)",
    notes: "Monitor ECG and BP during infusion. Therapeutic range: 10–20 mcg/mL. Purple glove syndrome with peripheral IV extravasation.",
  },
  {
    name: "LORAZEPAM",
    category: "Benzodiazepine / Anxiolytic",
    color: "0F7173",
    mechanism: "Enhances GABA-A receptor Cl⁻ influx → CNS depression → anticonvulsant, anxiolytic, sedative, muscle relaxant, amnesic effects",
    indications: ["Status epilepticus (FIRST-LINE)", "Acute anxiety / panic attacks", "Alcohol withdrawal seizures", "Pre-procedure sedation", "Acute agitation", "Procedural amnesia"],
    contraindications: ["Severe respiratory depression", "Acute angle-closure glaucoma", "Myasthenia gravis", "Alcohol or CNS depressant intoxication (relative)", "Neonates with neonatal jaundice (benzyl alcohol)"],
    dilution: "Undiluted IM; IV: dilute 1:1 with NS, D5W or sterile water; infuse at max 2 mg/min",
    dose: "Status epilepticus: 0.1 mg/kg IV (max 4 mg/dose), repeat once in 5–10 min\nAnxiety/sedation: 1–4 mg IV/IM q4–8h",
    maxDose: "8 mg/episode (seizure); 10 mg/day routine use",
    halfLife: "10–20 hours (no active metabolites – advantage in hepatic disease)",
    shelfLife: "Vial: 2 years (refrigerate 2–8°C); stable 8 weeks at room temp; Diluted: use within 4 h",
    notes: "Unlike diazepam: no active metabolites, shorter duration, less respiratory depression. Keep flumazenil reversal agent available.",
  },
  {
    name: "ONDANSETRON",
    category: "Antiemetic (5-HT3 Antagonist)",
    color: "2D6A4F",
    mechanism: "Selective 5-HT3 (serotonin) receptor antagonist → blocks vagal afferents in GI tract + chemoreceptor trigger zone (CTZ) in brainstem → antiemetic",
    indications: ["Chemotherapy-induced nausea/vomiting (CINV)", "Post-operative nausea/vomiting (PONV)", "Radiation-induced nausea", "Gastroenteritis", "Migraine-associated vomiting", "Nausea in pregnancy (severe)"],
    contraindications: ["QT prolongation / Long QT syndrome", "Congenital QT syndrome", "Hypokalemia/hypomagnesemia (risk of torsades)", "Serotonin syndrome (with serotonergic drugs)", "Concurrent apomorphine use (hypotension)"],
    dilution: "4 mg in 50 mL NS or D5W, infuse over 15–30 min; OR 4 mg undiluted slow IV over ≥30 sec",
    dose: "4–8 mg IV/IM q4–8h; CINV: 8–32 mg IV (depending on emetogenicity)",
    maxDose: "32 mg/day IV (CINV); 16 mg/day (routine antiemesis)",
    halfLife: "3–6 hours",
    shelfLife: "Vial: 3 years; Diluted: 24 h (2–30°C); protect from light",
    notes: "Avoid rapid IV push – risk of QT prolongation. Obtain ECG if QTc >450 ms. Headache is common side effect.",
  },
  {
    name: "NORADRENALINE (NOREPINEPHRINE)",
    category: "Vasopressor / Catecholamine",
    color: "B03A2E",
    mechanism: "Potent α1 agonist (vasoconstriction ↑SVR) + moderate β1 agonist (↑HR/contractility) → raises MAP, minimal β2 effect → vasoconstriction predominates",
    indications: ["Septic shock (FIRST-LINE vasopressor)", "Cardiogenic shock (adjunct)", "Distributive shock", "Vasodilatory shock post-cardiac surgery", "Neurogenic shock"],
    contraindications: ["Hypovolemic shock (without adequate fluid replacement)", "Mesenteric/peripheral vascular thrombosis", "Halothane/cyclopropane anesthesia (arrhythmias)", "Hypersensitivity to bisulfites"],
    dilution: "Standard: 4 mg (4 mL) in 250 mL NS/D5W = 16 mcg/mL\nDouble concentration: 8 mg in 250 mL = 32 mcg/mL\nCentral line STRONGLY preferred",
    dose: "Start: 0.01–0.1 mcg/kg/min IV infusion; Titrate to MAP ≥65 mmHg",
    maxDose: "3.3 mcg/kg/min (doses >0.5 mcg/kg/min signal severe shock)",
    halfLife: "2.5 minutes (eliminated rapidly by COMT/MAO)",
    shelfLife: "Ampule: 3 years; Diluted: 24 h protected from light; Discard if discoloration",
    notes: "USE CENTRAL LINE if possible. Peripheral extravasation causes tissue necrosis – treat with phentolamine. Monitor BP continuously.",
  },
  {
    name: "ADRENALINE (EPINEPHRINE)",
    category: "Vasopressor / Bronchodilator / Cardiac",
    color: "C0392B",
    mechanism: "α1 + α2 + β1 + β2 agonist → vasoconstriction (α), ↑HR/contractility (β1), bronchodilation (β2), mast cell stabilization → reverses anaphylaxis",
    indications: ["Anaphylaxis / Severe allergic reaction (FIRST-LINE)", "Cardiac arrest (VF/pVT/asystole/PEA)", "Severe bronchospasm / Status asthmaticus", "Croup (nebulized)", "Bradycardia (refractory)", "Local anesthetic adjunct"],
    contraindications: ["No absolute contraindication in anaphylaxis or cardiac arrest", "Relative: Hypertrophic cardiomyopathy (outflow obstruction)", "Narrow-angle glaucoma (if topical)", "Cocaine/halogenated anesthetic arrhythmia risk"],
    dilution: "Anaphylaxis IM: undiluted 1:1000 (1 mg/mL) → 0.3–0.5 mg IM thigh\nCardiac arrest IV: 1:10,000 (0.1 mg/mL) = 1 mg in 10 mL NS\nInfusion: 1 mg in 250 mL NS = 4 mcg/mL",
    dose: "Anaphylaxis: 0.3–0.5 mg IM (1:1000), repeat q5–15 min\nCardiac arrest: 1 mg IV q3–5 min\nInfusion: 0.01–1 mcg/kg/min",
    maxDose: "No fixed maximum in arrest; Anaphylaxis: repeat IM as needed",
    halfLife: "2–3 minutes (IV)",
    shelfLife: "Ampule: 3 years; protect from light/heat; discard if brown/precipitate",
    notes: "NEVER give 1:1000 IV directly (cardiac arrest). Concentration confusion is a common error. Autoinjectors (EpiPen): 0.3 mg adult.",
  },
  {
    name: "DOBUTAMINE",
    category: "Inotrope / Catecholamine",
    color: "1565C0",
    mechanism: "Primarily β1 agonist (↑contractility + ↑HR) + mild β2 (slight vasodilation) → ↑cardiac output, ↓afterload, ↓PCWP; minimal α effect → less vasoconstriction than dopamine",
    indications: ["Acute decompensated heart failure", "Cardiogenic shock (with adequate BP)", "Low cardiac output states", "Cardiac stress testing (pharmacological)", "Post-cardiac surgery low output syndrome"],
    contraindications: ["HOCM / Dynamic LVOT obstruction", "Uncorrected hypovolemia", "Idiopathic hypertrophic subaortic stenosis", "Pheochromocytoma", "Atrial fibrillation (may increase ventricular response)"],
    dilution: "250 mg in 250 mL NS/D5W = 1000 mcg/mL\nStandard: 250 mg in 500 mL = 500 mcg/mL\nTitrate by weight (mcg/kg/min)",
    dose: "2.5–10 mcg/kg/min IV infusion; Start low, titrate up",
    maxDose: "40 mcg/kg/min (rarely needed >20 mcg/kg/min)",
    halfLife: "2 minutes",
    shelfLife: "Vial: 3 years; Diluted: 24 h room temp (may turn pink – still potent)",
    notes: "Pink discoloration of diluted solution is acceptable. Tolerance develops within 72 h. Often combined with noradrenaline in cardiogenic shock.",
  },
  {
    name: "DOPAMINE",
    category: "Vasopressor / Inotrope / Catecholamine",
    color: "6C3FA0",
    mechanism: "Dose-dependent receptor action:\n• 1–5 mcg/kg/min: DA1 → renal/mesenteric vasodilation\n• 5–10: β1 → ↑HR, ↑contractility\n• >10: α1 → vasoconstriction (like noradrenaline)",
    indications: ["Cardiogenic shock", "Septic shock (second-line to noradrenaline)", "Hemodynamically significant bradycardia (low-to-mid dose)", "Acute decompensated heart failure", "Neonatal hypotension"],
    contraindications: ["Tachyarrhythmias (VF, VT)", "Uncorrected hypovolemia", "Pheochromocytoma", "Sulfite allergy (formulation contains sodium metabisulfite)", "MAOI therapy (hypertensive crisis)"],
    dilution: "200–400 mg in 250 mL NS/D5W\nStandard 1600 mcg/mL: 400 mg in 250 mL",
    dose: "Start 5 mcg/kg/min; titrate to effect\nLow: 1–5 | Medium: 5–10 | High: >10 mcg/kg/min",
    maxDose: "50 mcg/kg/min",
    halfLife: "2 minutes",
    shelfLife: "Vial: 3 years; Diluted: 24 h; Discard if discolored",
    notes: "'Renal dose' dopamine (1–3 mcg/kg/min) for renal protection is NOT evidence-based. Second-line to noradrenaline in septic shock (more arrhythmias).",
  },
  {
    name: "ATROPINE",
    category: "Anticholinergic / Vagolytic",
    color: "D35400",
    mechanism: "Competitive muscarinic acetylcholine receptor antagonist → blocks parasympathetic (vagal) tone → ↑HR, ↓secretions, bronchodilation, ↓GI motility, mydriasis",
    indications: ["Symptomatic bradycardia (sinus, AVB)", "Cardiac arrest with asystole/PEA bradycardia", "Organophosphate / nerve agent poisoning", "Pre-medication (↓secretions before intubation)", "Reversal of NMB (with neostigmine)", "Beta-blocker/CCB overdose (adjunct)"],
    contraindications: ["Narrow-angle glaucoma", "Tachycardia (>100 bpm)", "Urinary retention / BPH", "Thyrotoxicosis", "Myasthenia gravis", "Acute MI with sinus tachycardia"],
    dilution: "May be given undiluted IV push; for organophosphate: large doses diluted in NS\nIntubation pre-med: 0.01 mg/kg undiluted",
    dose: "Bradycardia: 0.5–1 mg IV q3–5 min\nOrganophosphate: 1–4 mg IV q5–10 min (titrate until secretions dry)\nChildren: 0.02 mg/kg (min 0.1 mg)",
    maxDose: "3 mg (bradycardia); Organophosphate: NO maximum – titrate to effect (may need hundreds of mg)",
    halfLife: "2–5 hours",
    shelfLife: "Ampule: 3–5 years; Diluted: use within 24 h",
    notes: "Doses <0.5 mg may cause paradoxical bradycardia (central vagal stimulation). In organophosphate poisoning, titrate to drying of secretions, NOT to heart rate.",
  },
  {
    name: "NITROGLYCERIN (GTN)",
    category: "Nitrate / Vasodilator",
    color: "0D8A8A",
    mechanism: "Converted to nitric oxide (NO) → activates guanylyl cyclase → ↑cGMP → smooth muscle relaxation → venodilation (↓preload) > arteriodilation (↓afterload) at high doses → ↓myocardial O₂ demand",
    indications: ["Acute coronary syndrome (ACS/NSTEMI/STEMI)", "Unstable angina", "Acute pulmonary edema (↓preload)", "Hypertensive emergency with ACS/LVF", "Esophageal spasm", "Anal fissure (topical)"],
    contraindications: ["Hypotension (SBP <90 mmHg)", "PDE-5 inhibitors (sildenafil, tadalafil – severe hypotension ≥24h)", "Right ventricular infarction / RV failure", "Hypertrophic cardiomyopathy", "Raised ICP", "Severe aortic stenosis"],
    dilution: "Infusion: 50 mg in 250 mL D5W (GLASS bottle) = 200 mcg/mL\nAvoid PVC tubing (adsorption – use polyethylene/glass sets)\nSublingual: 0.3–0.6 mg tablet or spray",
    dose: "Sublingual: 0.3–0.6 mg q5 min × 3 doses\nIV infusion: Start 5–10 mcg/min, titrate by 5–10 mcg/min q3–5 min",
    maxDose: "IV: 400 mcg/min (200–400 mcg/min range)",
    halfLife: "1–4 minutes (IV); ~10 min sublingual",
    shelfLife: "Tablets: 6 months after opening (store in original glass container). IV vials: 2–3 years; Diluted: 24 h in glass",
    notes: "Tolerance develops within 24 h continuous use – use nitrate-free interval 8–12 h. Headache very common (N.O. vasodilation). Adsorbs to PVC – always use non-PVC tubing.",
  },
  {
    name: "IV FLUIDS",
    category: "Volume Expander / Resuscitation",
    color: "3498DB",
    mechanism: "• 0.9% NaCl / Hartmann's: Expand intravascular volume → ↑preload → ↑cardiac output per Frank-Starling\n• Colloids (albumin, gelatin): Higher molecular weight → remain in intravascular compartment longer\n• D5W/D10W: Free water distribution – only 1/12 stays intravascular → NOT for resuscitation",
    indications: [
      "0.9% NaCl: Hypovolemic shock, metabolic alkalosis, hyperkalemia resuscitation, drug dilution, normal saline challenge",
      "Hartmann's/LR: Trauma, surgical losses, burns, general resuscitation (more physiological – less hyperchloremic acidosis)",
      "D5W: Hypernatremia correction, maintenance, drug dilution",
      "D10W / D50W: Hypoglycemia treatment",
      "Albumin 4–5%: Septic shock (after initial crystalloid), cirrhosis SBP",
      "Plasma expanders: Massive blood loss bridging"
    ],
    contraindications: [
      "0.9% NaCl: Large volumes → hyperchloremic metabolic acidosis; avoid in TBI (raises ICP vs isotonic solutions)",
      "Hartmann's/LR: Avoid in hyperkalemia",
      "Dextrose solutions: Avoid in head injury/stroke (hyperglycemia worsens outcomes), pulmonary edema",
      "Colloids (HES/Gelofusin): Avoid in renal failure/coagulopathy"
    ],
    dilution: "Given as packaged; typical rates:\nResuscitation bolus: 500 mL–1 L over 15–30 min\nMaintenance: 1–2 mL/kg/h\nBlood product: follow massive transfusion protocol",
    dose: "Resuscitation: 20 mL/kg bolus (repeat to reassess)\nFluid challenge: 250–500 mL over 10–15 min\nAdult maintenance: 25–30 mL/kg/day",
    maxDose: "No fixed maximum – guided by clinical response, avoid fluid overload",
    halfLife: "Crystalloids: ~20–30 min intravascular retention\nColloids: 3–6 hours\nAlbumin: 12–16 hours",
    shelfLife: "Unopened bags: 2–5 years; Once opened: USE WITHIN 24 h; Discard if turbid/particulate",
    notes: "Reassess after each bolus. RASS/CVP/echocardiography-guided fluid therapy. Avoid excessive fluid – ARDS and AKI risk.",
  },
];

// ============================================================
// HELPER: Create individual drug card slide
// ============================================================
function addCoverSlide(pres) {
  const slide = pres.addSlide();
  // Background
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 0, w: 13.3, h: 7.5,
    fill: { color: C.navy }, line: { type: "none" }
  });
  // Red accent bar
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 6.7, w: 13.3, h: 0.8,
    fill: { color: C.red }, line: { type: "none" }
  });
  // Teal accent stripe
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 0, w: 0.12, h: 7.5,
    fill: { color: C.teal }, line: { type: "none" }
  });
  // Title
  slide.addText("EMERGENCY DRUGS", {
    x: 0.5, y: 1.5, w: 12.3, h: 1.2,
    fontSize: 54, fontFace: "Arial", bold: true,
    color: C.white, align: "center", charSpacing: 8, margin: 0
  });
  slide.addText("QUICK REFERENCE CHART", {
    x: 0.5, y: 2.8, w: 12.3, h: 0.7,
    fontSize: 26, fontFace: "Arial", bold: false,
    color: C.tealLight, align: "center", charSpacing: 4, margin: 0
  });
  // Subtitle line
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 4, y: 3.6, w: 5.3, h: 0.04,
    fill: { color: C.amber }, line: { type: "none" }
  });
  slide.addText("Mechanism  •  Indications  •  Contraindications  •  Dose & Dilution\nMax Dose  •  Half-life  •  Shelf Life", {
    x: 0.5, y: 3.8, w: 12.3, h: 1.2,
    fontSize: 16, fontFace: "Arial",
    color: C.gray, align: "center", margin: 0
  });
  slide.addText("16 Essential Emergency Medications", {
    x: 0.5, y: 5.2, w: 12.3, h: 0.5,
    fontSize: 14, fontFace: "Arial", italic: true,
    color: C.amber, align: "center", margin: 0
  });
  slide.addText("For Healthcare Professionals • Clinical Use Reference", {
    x: 0.5, y: 6.8, w: 12.3, h: 0.4,
    fontSize: 11, fontFace: "Arial",
    color: C.white, align: "center", margin: 0
  });
}

function addDrugSlide(pres, drug) {
  const slide = pres.addSlide();
  const W = 13.3, H = 7.5;
  const col = drug.color;

  // --- BACKGROUND ---
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 0, w: W, h: H,
    fill: { color: "F7F9FC" }, line: { type: "none" }
  });

  // --- HEADER BAR ---
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 0, w: W, h: 1.15,
    fill: { color: col }, line: { type: "none" }
  });
  // Dark navy overlay at right side for category badge
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 9.5, y: 0, w: 3.8, h: 1.15,
    fill: { color: C.navy }, line: { type: "none" }
  });

  // Drug name
  slide.addText(drug.name, {
    x: 0.2, y: 0.05, w: 9.2, h: 0.65,
    fontSize: 30, fontFace: "Arial", bold: true,
    color: C.white, margin: 0
  });
  // Category badge
  slide.addText(drug.category, {
    x: 9.5, y: 0.0, w: 3.8, h: 1.15,
    fontSize: 11, fontFace: "Arial", bold: true,
    color: C.amber, align: "center", valign: "middle", margin: 4
  });

  // ---- LAYOUT: 3-column grid below header ----
  // Col widths: 4.3 | 4.3 | 4.3 (with 0.1 gutters), start y=1.25
  const rowTop = 1.25;
  const rowH = 5.9;
  const cW = 4.25;
  const gutter = 0.1;
  const col1x = 0.1, col2x = col1x + cW + gutter, col3x = col2x + cW + gutter;

  // Card backgrounds
  [col1x, col2x, col3x].forEach(cx => {
    slide.addShape(pres.shapes.RECTANGLE, {
      x: cx, y: rowTop, w: cW, h: rowH,
      fill: { color: C.white },
      line: { color: "D0D8E4", pt: 1 },
      shadow: { type: "outer", color: "B0B8C8", blur: 4, offset: 2, angle: 135, opacity: 0.12 }
    });
  });

  // Colored accent top bar on each card
  [col1x, col2x, col3x].forEach(cx => {
    slide.addShape(pres.shapes.RECTANGLE, {
      x: cx, y: rowTop, w: cW, h: 0.07,
      fill: { color: col }, line: { type: "none" }
    });
  });

  const SEC_LABEL_H = 0.28;
  const SEC_LABEL_FS = 9;
  const SEC_BODY_FS = 9.5;
  const padding = 0.12;

  // ========== COLUMN 1: MECHANISM + DOSE + DILUTION ==========
  let y1 = rowTop + 0.15;

  // MECHANISM
  slide.addText("⚙ MECHANISM", {
    x: col1x + padding, y: y1, w: cW - 2*padding, h: SEC_LABEL_H,
    fontSize: SEC_LABEL_FS, fontFace: "Arial", bold: true,
    color: col, margin: 0
  });
  y1 += SEC_LABEL_H + 0.02;
  slide.addText(drug.mechanism, {
    x: col1x + padding, y: y1, w: cW - 2*padding, h: 1.1,
    fontSize: SEC_BODY_FS - 0.5, fontFace: "Arial",
    color: C.textDark, margin: 0, wrap: true
  });
  y1 += 1.15;

  // divider
  slide.addShape(pres.shapes.RECTANGLE, {
    x: col1x + padding, y: y1, w: cW - 2*padding, h: 0.015,
    fill: { color: "D0D8E4" }, line: { type: "none" }
  });
  y1 += 0.07;

  // DOSE
  slide.addText("💊 DOSE", {
    x: col1x + padding, y: y1, w: cW - 2*padding, h: SEC_LABEL_H,
    fontSize: SEC_LABEL_FS, fontFace: "Arial", bold: true,
    color: col, margin: 0
  });
  y1 += SEC_LABEL_H + 0.02;
  slide.addText(drug.dose, {
    x: col1x + padding, y: y1, w: cW - 2*padding, h: 0.85,
    fontSize: SEC_BODY_FS - 0.5, fontFace: "Arial",
    color: C.textDark, margin: 0, wrap: true
  });
  y1 += 0.9;

  // MAX DOSE badge
  slide.addShape(pres.shapes.RECTANGLE, {
    x: col1x + padding, y: y1, w: cW - 2*padding, h: 0.36,
    fill: { color: C.amber }, line: { type: "none" }
  });
  slide.addText("MAX: " + drug.maxDose, {
    x: col1x + padding, y: y1, w: cW - 2*padding, h: 0.36,
    fontSize: 8.5, fontFace: "Arial", bold: true,
    color: C.navy, align: "center", valign: "middle", margin: 0
  });
  y1 += 0.42;

  // divider
  slide.addShape(pres.shapes.RECTANGLE, {
    x: col1x + padding, y: y1, w: cW - 2*padding, h: 0.015,
    fill: { color: "D0D8E4" }, line: { type: "none" }
  });
  y1 += 0.07;

  // DILUTION
  slide.addText("🧪 HOW TO DILUTE", {
    x: col1x + padding, y: y1, w: cW - 2*padding, h: SEC_LABEL_H,
    fontSize: SEC_LABEL_FS, fontFace: "Arial", bold: true,
    color: col, margin: 0
  });
  y1 += SEC_LABEL_H + 0.02;
  const dilutionH = rowTop + rowH - y1 - 0.15;
  slide.addText(drug.dilution, {
    x: col1x + padding, y: y1, w: cW - 2*padding, h: dilutionH,
    fontSize: SEC_BODY_FS - 0.5, fontFace: "Arial",
    color: C.textDark, margin: 0, wrap: true
  });

  // ========== COLUMN 2: INDICATIONS + CONTRAINDICATIONS ==========
  let y2 = rowTop + 0.15;

  // INDICATIONS
  slide.addText("✅ INDICATIONS", {
    x: col2x + padding, y: y2, w: cW - 2*padding, h: SEC_LABEL_H,
    fontSize: SEC_LABEL_FS, fontFace: "Arial", bold: true,
    color: C.green, margin: 0
  });
  y2 += SEC_LABEL_H + 0.04;
  const indItems = Array.isArray(drug.indications) ? drug.indications : [drug.indications];
  const indText = indItems.map(i => ({ text: i, options: { bullet: { code: "2022" }, breakLine: true, fontSize: SEC_BODY_FS - 0.5 } }));
  const indH = Math.min(2.6, indItems.length * 0.38);
  slide.addText(indText, {
    x: col2x + padding, y: y2, w: cW - 2*padding, h: indH,
    fontSize: SEC_BODY_FS - 0.5, fontFace: "Arial",
    color: C.textDark, margin: 0, paraSpaceAfter: 1
  });
  y2 += indH + 0.08;

  // divider
  slide.addShape(pres.shapes.RECTANGLE, {
    x: col2x + padding, y: y2, w: cW - 2*padding, h: 0.015,
    fill: { color: "D0D8E4" }, line: { type: "none" }
  });
  y2 += 0.07;

  // CONTRAINDICATIONS
  slide.addText("🚫 CONTRAINDICATIONS", {
    x: col2x + padding, y: y2, w: cW - 2*padding, h: SEC_LABEL_H,
    fontSize: SEC_LABEL_FS, fontFace: "Arial", bold: true,
    color: C.red, margin: 0
  });
  y2 += SEC_LABEL_H + 0.04;
  const ciItems = Array.isArray(drug.contraindications) ? drug.contraindications : [drug.contraindications];
  const ciText = ciItems.map(i => ({ text: i, options: { bullet: { code: "2022" }, breakLine: true, fontSize: SEC_BODY_FS - 1 } }));
  const ciH = rowTop + rowH - y2 - 0.12;
  slide.addText(ciText, {
    x: col2x + padding, y: y2, w: cW - 2*padding, h: ciH,
    fontSize: SEC_BODY_FS - 1, fontFace: "Arial",
    color: C.textDark, margin: 0, paraSpaceAfter: 1
  });

  // ========== COLUMN 3: HALF-LIFE + SHELF-LIFE + NOTES ==========
  let y3 = rowTop + 0.15;

  // Half-life pill
  slide.addShape(pres.shapes.RECTANGLE, {
    x: col3x + padding, y: y3, w: (cW - 2*padding) / 2 - 0.05, h: 0.7,
    fill: { color: "EEF4FF" }, line: { color: "AABBD4", pt: 1 }
  });
  slide.addText([
    { text: "HALF-LIFE\n", options: { bold: true, fontSize: 7.5, color: C.navy } },
    { text: drug.halfLife, options: { fontSize: 8.5, color: col, bold: true } }
  ], {
    x: col3x + padding, y: y3, w: (cW - 2*padding) / 2 - 0.05, h: 0.7,
    align: "center", valign: "middle", margin: 2
  });

  slide.addShape(pres.shapes.RECTANGLE, {
    x: col3x + (cW)/2 + 0.05, y: y3, w: (cW - 2*padding) / 2 - 0.05, h: 0.7,
    fill: { color: "FFF9EE" }, line: { color: "E8D4A0", pt: 1 }
  });
  slide.addText([
    { text: "SHELF LIFE\n", options: { bold: true, fontSize: 7.5, color: C.navy } },
    { text: drug.shelfLife.split(";")[0], options: { fontSize: 7.5, color: C.amberDark, bold: true } }
  ], {
    x: col3x + (cW)/2 + 0.05, y: y3, w: (cW - 2*padding) / 2 - 0.05, h: 0.7,
    align: "center", valign: "middle", margin: 2
  });

  y3 += 0.8;

  // SHELF LIFE detail
  slide.addText("📦 SHELF / STORAGE", {
    x: col3x + padding, y: y3, w: cW - 2*padding, h: SEC_LABEL_H,
    fontSize: SEC_LABEL_FS, fontFace: "Arial", bold: true,
    color: C.amberDark, margin: 0
  });
  y3 += SEC_LABEL_H + 0.02;
  slide.addText(drug.shelfLife, {
    x: col3x + padding, y: y3, w: cW - 2*padding, h: 0.7,
    fontSize: SEC_BODY_FS - 1.5, fontFace: "Arial",
    color: C.textDark, margin: 0, wrap: true
  });
  y3 += 0.75;

  // divider
  slide.addShape(pres.shapes.RECTANGLE, {
    x: col3x + padding, y: y3, w: cW - 2*padding, h: 0.015,
    fill: { color: "D0D8E4" }, line: { type: "none" }
  });
  y3 += 0.07;

  // CLINICAL NOTES
  slide.addShape(pres.shapes.RECTANGLE, {
    x: col3x + padding, y: y3, w: cW - 2*padding, h: SEC_LABEL_H,
    fill: { color: col }, line: { type: "none" }
  });
  slide.addText("📋 CLINICAL NOTES", {
    x: col3x + padding, y: y3, w: cW - 2*padding, h: SEC_LABEL_H,
    fontSize: SEC_LABEL_FS, fontFace: "Arial", bold: true,
    color: C.white, margin: 3
  });
  y3 += SEC_LABEL_H + 0.06;
  const notesH = rowTop + rowH - y3 - 0.12;
  slide.addText(drug.notes, {
    x: col3x + padding, y: y3, w: cW - 2*padding, h: notesH,
    fontSize: SEC_BODY_FS - 0.5, fontFace: "Arial",
    color: C.textDark, margin: 0, wrap: true
  });

  // ---- FOOTER ----
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: H - 0.22, w: W, h: 0.22,
    fill: { color: C.navy }, line: { type: "none" }
  });
  slide.addText(`Emergency Drugs Reference  •  ${drug.name}  •  For Clinical Use Only  •  Verify doses with current formulary`, {
    x: 0.2, y: H - 0.22, w: W - 0.4, h: 0.22,
    fontSize: 7, fontFace: "Arial",
    color: C.gray, align: "center", margin: 0
  });
}

// ============================================================
// BUILD PRESENTATION
// ============================================================
addCoverSlide(pres);
drugs.forEach(drug => addDrugSlide(pres, drug));

const outPath = "/home/daytona/workspace/emergency-drugs-poster/Emergency_Drugs_Poster_Chart.pptx";
pres.writeFile({ fileName: outPath }).then(() => {
  console.log("SUCCESS: " + outPath);
}).catch(err => {
  console.error("ERROR:", err);
  process.exit(1);
});
Running Command

cd /home/daytona/workspace/emergency-drugs-poster && node build.js 2>&1

Running Command

ls -lh /home/daytona/workspace/emergency-drugs-poster/

Your emergency drugs poster chart is ready!

Emergency Drugs Poster Chart

Presentation · PPTX


What's Inside (17 slides total)

1 Cover Slide + 16 Individual Drug Slides
Each drug slide is a 3-column poster card (widescreen 13.3" × 7.5") with:
Column 1Column 2Column 3
⚙ Mechanism✅ IndicationsHalf-life pill
💊 Dose & Dosing schedule🚫 Contraindications📦 Shelf/Storage
MAX DOSE badge (amber)📋 Clinical Notes
🧪 How to Dilute

Drugs Covered

DrugCategoryCorrected Name
LabetalolAntihypertensive
MetoclopramideAntiemetic/Prokinetic(metaplromide → metoclopramide)
TramadolOpioid Analgesic
TapentadolDual-MOA Opioid(tipetodol → tapentadol)
Avil (Pheniramine)H1 Antihistamine
Tranexamic Acid (TXA)Antifibrinolytic(transmic acid → tranexamic acid)
PhenytoinAntiepileptic(phtyion → phenytoin)
LorazepamBenzodiazepine(lozarpam → lorazepam)
Ondansetron5-HT3 Antiemetic
NoradrenalineVasopressor
Adrenaline (Epinephrine)Vasopressor/Cardiac
DobutamineInotrope(doutamine → dobutamine)
DopamineVasopressor/Inotrope
AtropineAnticholinergic
Nitroglycerin (GTN)Nitrate/Vasodilator
IV FluidsVolume ExpanderNS, LR, D5W, Colloids
Note: I corrected 6 drug name spellings from your request and included all content accordingly. All doses are standard adult doses — always verify against your local formulary and current guidelines.
This is a shared conversation. Sign in to Orris to start your own chat.