Hydrocephalus and raised ICP and management of its in MD anesthesia make a ppty

Reading File
Reading File
Reading File
Finding Sources
Finding Sources
Reading File
Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Searching Images

hydrocephalus dilated ventricles CT scan brain

Reading File
Running Command

mkdir -p /home/daytona/workspace/hydrocephalus-icp-pptx && ls /home/daytona/workspace/hydrocephalus-icp-pptx

Writing File

~/hydrocephalus-icp-pptx/build.js

const pptxgen = require("pptxgenjs");

const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Hydrocephalus & Raised ICP - Anesthesia Management";
pres.author = "MD Anesthesia";

// ── COLOUR PALETTE ──────────────────────────────────────────────────────────
const C = {
  dark:    "0D1B2A",   // near-black navy (dominant bg)
  mid:     "1B3A5C",   // deep blue panel bg
  accent:  "00B4D8",   // cyan accent
  accent2: "F4A261",   // warm orange accent
  red:     "E63946",   // alert/danger red
  green:   "2DC653",   // highlight green
  white:   "FFFFFF",
  silver:  "CAD3E0",
  light:   "EFF6FF",
  yellow:  "FFD166",
};

// ── SLIDE HELPERS ────────────────────────────────────────────────────────────
function addTitleBar(slide, title, subtitle = "") {
  // Full-width header bar
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: 1.1, fill: { color: C.mid } });
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.08, h: 1.1, fill: { color: C.accent } });
  slide.addText(title, {
    x: 0.2, y: 0.1, w: 9.4, h: 0.6,
    fontSize: 26, bold: true, color: C.white, fontFace: "Calibri Light", margin: 0,
  });
  if (subtitle) {
    slide.addText(subtitle, {
      x: 0.2, y: 0.72, w: 9.4, h: 0.32,
      fontSize: 13, color: C.accent, fontFace: "Calibri", italic: true, margin: 0,
    });
  }
}

function addFooter(slide, text = "Hydrocephalus & Raised ICP  |  MD Anesthesia") {
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 5.42, w: "100%", h: 0.2, fill: { color: C.accent } });
  slide.addText(text, {
    x: 0.15, y: 5.42, w: 9.7, h: 0.2,
    fontSize: 8, color: C.dark, fontFace: "Calibri", align: "right", margin: 0,
  });
}

function pill(slide, label, x, y, w = 2.2, h = 0.38, bg = C.accent, fg = C.dark) {
  slide.addShape(pres.ShapeType.roundRect, { x, y, w, h, fill: { color: bg }, line: { color: bg }, rectRadius: 0.08 });
  slide.addText(label, { x, y, w, h, fontSize: 10, bold: true, color: fg, align: "center", valign: "middle", margin: 0, fontFace: "Calibri" });
}

function bulletBox(slide, items, x, y, w, h, bg = C.mid, textColor = C.silver, titleText = "", titleColor = C.accent, fontSize = 11) {
  slide.addShape(pres.ShapeType.roundRect, { x, y, w, h, fill: { color: bg }, line: { color: C.accent, width: 1 }, rectRadius: 0.1 });
  if (titleText) {
    slide.addText(titleText, { x: x + 0.12, y: y + 0.08, w: w - 0.24, h: 0.3, fontSize: 12, bold: true, color: titleColor, fontFace: "Calibri", margin: 0 });
  }
  const textItems = items.map((t, i) => ({
    text: t,
    options: { bullet: { type: "bullet", characterCode: "25B8", color: C.accent }, breakLine: i < items.length - 1, color: textColor, fontSize, fontFace: "Calibri" }
  }));
  const ty = titleText ? y + 0.38 : y + 0.12;
  const th = titleText ? h - 0.45 : h - 0.2;
  slide.addText(textItems, { x: x + 0.18, y: ty, w: w - 0.28, h: th, valign: "top", margin: 0 });
}

// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 1 – TITLE SLIDE
// ═══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.dark };

  // Big accent rectangle left
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.22, h: "100%", fill: { color: C.accent } });
  s.addShape(pres.ShapeType.rect, { x: 0.22, y: 0, w: 0.06, h: "100%", fill: { color: C.accent2 } });

  s.addText("HYDROCEPHALUS &", { x: 0.5, y: 0.7, w: 9.2, h: 0.9, fontSize: 38, bold: true, color: C.white, fontFace: "Calibri Light", align: "left" });
  s.addText("RAISED ICP", { x: 0.5, y: 1.55, w: 9.2, h: 0.9, fontSize: 48, bold: true, color: C.accent, fontFace: "Calibri Light", align: "left" });
  s.addText("MANAGEMENT IN ANESTHESIA", { x: 0.5, y: 2.5, w: 9.2, h: 0.5, fontSize: 22, color: C.accent2, fontFace: "Calibri", align: "left" });

  // divider
  s.addShape(pres.ShapeType.rect, { x: 0.5, y: 3.1, w: 5.5, h: 0.04, fill: { color: C.accent } });

  s.addText("MD Anesthesia  ·  Neuroanesthesia Module", { x: 0.5, y: 3.25, w: 9, h: 0.35, fontSize: 14, color: C.silver, fontFace: "Calibri", align: "left" });
  s.addText("Sources: Miller's Anesthesia 10e  ·  Barash Clinical Anesthesia 9e  ·  Morgan & Mikhail 7e  ·  Robbins Pathology", { x: 0.5, y: 3.65, w: 9, h: 0.28, fontSize: 10, color: C.silver, fontFace: "Calibri", italic: true, align: "left" });
}

// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 2 – OUTLINE
// ═══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.dark };
  addTitleBar(s, "SESSION OUTLINE");
  addFooter(s);

  const topics = [
    ["01", "Intracranial Pressure – Basics & Monroe-Kellie Doctrine"],
    ["02", "Hydrocephalus – Classification & Pathophysiology"],
    ["03", "Causes & Clinical Features of Raised ICP"],
    ["04", "Cerebral Edema – Types & Herniation Syndromes"],
    ["05", "Cerebral Blood Flow & Autoregulation"],
    ["06", "Anesthetic Drug Effects on ICP & CBF"],
    ["07", "Pre-operative Assessment & Optimization"],
    ["08", "Induction & Airway Management"],
    ["09", "Intraoperative Management of Raised ICP"],
    ["10", "Pharmacological ICP Reduction"],
    ["11", "Surgical Interventions & Shunts – Anaesthesia"],
    ["12", "Emergence, Extubation & Postoperative Care"],
  ];

  topics.forEach(([num, label], i) => {
    const col = i < 6 ? 0 : 1;
    const row = i % 6;
    const x = col === 0 ? 0.3 : 5.15;
    const y = 1.25 + row * 0.67;
    s.addShape(pres.ShapeType.roundRect, { x, y, w: 4.6, h: 0.55, fill: { color: C.mid }, line: { color: C.accent, width: 0.5 }, rectRadius: 0.07 });
    s.addText(num, { x: x + 0.06, y, w: 0.5, h: 0.55, fontSize: 14, bold: true, color: C.accent, align: "center", valign: "middle", fontFace: "Calibri", margin: 0 });
    s.addShape(pres.ShapeType.rect, { x: x + 0.56, y: y + 0.12, w: 0.03, h: 0.3, fill: { color: C.accent } });
    s.addText(label, { x: x + 0.66, y, w: 3.85, h: 0.55, fontSize: 10.5, color: C.white, valign: "middle", fontFace: "Calibri", margin: 0 });
  });
}

// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 3 – MONROE-KELLIE DOCTRINE / ICP BASICS
// ═══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.dark };
  addTitleBar(s, "INTRACRANIAL PRESSURE – BASICS", "Monroe-Kellie Doctrine");
  addFooter(s);

  // Normal ICP box
  s.addShape(pres.ShapeType.roundRect, { x: 0.3, y: 1.3, w: 4.3, h: 1.1, fill: { color: C.mid }, line: { color: C.green }, rectRadius: 0.1 });
  s.addText("Normal ICP", { x: 0.4, y: 1.32, w: 4.1, h: 0.3, fontSize: 12, bold: true, color: C.green, fontFace: "Calibri", margin: 0 });
  s.addText([
    { text: "Adults: ", options: { bold: true, color: C.yellow } },
    { text: "7–15 mmHg\n" },
    { text: "Children: ", options: { bold: true, color: C.yellow } },
    { text: "3–7 mmHg  |  Neonates: ", options: { color: C.silver } },
    { text: "1.5–6 mmHg" },
  ], { x: 0.4, y: 1.62, w: 4.0, h: 0.7, fontSize: 11, color: C.silver, fontFace: "Calibri", margin: 0 });

  // Monroe-Kellie
  s.addShape(pres.ShapeType.roundRect, { x: 4.9, y: 1.3, w: 4.8, h: 1.1, fill: { color: C.mid }, line: { color: C.accent2 }, rectRadius: 0.1 });
  s.addText("Monroe-Kellie Doctrine", { x: 5.0, y: 1.32, w: 4.6, h: 0.3, fontSize: 12, bold: true, color: C.accent2, fontFace: "Calibri", margin: 0 });
  s.addText("V(Brain) + V(CSF) + V(Blood) = CONSTANT\nIncrease in any → compensated by decrease in others\nOnce compensation exhausted → ICP rises sharply", { x: 5.0, y: 1.62, w: 4.6, h: 0.7, fontSize: 10.5, color: C.silver, fontFace: "Calibri", margin: 0 });

  // ICP compartments
  s.addText("INTRACRANIAL COMPARTMENTS", { x: 0.3, y: 2.6, w: 9.4, h: 0.3, fontSize: 12, bold: true, color: C.accent, fontFace: "Calibri", margin: 0 });
  const comps = [
    ["Brain Parenchyma", "~80%", C.accent],
    ["CSF", "~10%", C.accent2],
    ["Blood", "~10%", C.red],
  ];
  comps.forEach(([name, pct, col], i) => {
    const x = 0.3 + i * 3.2;
    s.addShape(pres.ShapeType.roundRect, { x, y: 2.95, w: 3.0, h: 0.7, fill: { color: col + "33" }, line: { color: col }, rectRadius: 0.1 });
    s.addText(`${name}\n${pct}`, { x, y: 2.95, w: 3.0, h: 0.7, fontSize: 11, bold: true, color: col, align: "center", valign: "middle", fontFace: "Calibri", margin: 0 });
  });

  // ICP grades
  bulletBox(s, [
    "Mild: 20–30 mmHg",
    "Moderate: 30–40 mmHg",
    "Severe: > 40 mmHg  (cerebral herniation risk)",
    "CPP = MAP – ICP   |   Target CPP ≥ 60 mmHg",
  ], 0.3, 3.8, 9.4, 1.35, C.mid, C.silver, "ICP SEVERITY & CPP", C.red);
}

// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 4 – HYDROCEPHALUS CLASSIFICATION
// ═══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.dark };
  addTitleBar(s, "HYDROCEPHALUS", "Classification & Pathophysiology");
  addFooter(s);

  s.addText("Accumulation of excessive CSF within the ventricular system due to impaired flow, resorption, or rarely overproduction. ICP rises when compensatory mechanisms are exhausted.", {
    x: 0.3, y: 1.2, w: 9.4, h: 0.5, fontSize: 11, color: C.silver, fontFace: "Calibri", italic: true, margin: 0,
  });

  // Two columns: Communicating vs Obstructive
  const leftItems = ["Impaired CSF absorption at arachnoid granulations", "CSF pathways are patent", "Causes: SAH, meningitis, trauma, venous sinus thrombosis, idiopathic (NPH)", "Normal Pressure Hydrocephalus (NPH): triad – gait apraxia, dementia, urinary incontinence"];
  const rightItems = ["Blockage within ventricular system", "Obstruction at foramina of Monro, aqueduct of Sylvius, or 4th ventricle outlets", "Causes: Aqueductal stenosis, tumours (posterior fossa), Chiari malformation, intraventricular haemorrhage", "Often presents acutely – surgical emergency"];

  bulletBox(s, leftItems, 0.3, 1.82, 4.6, 2.0, C.mid, C.silver, "COMMUNICATING", C.accent);
  bulletBox(s, rightItems, 5.1, 1.82, 4.6, 2.0, C.mid, C.silver, "NON-COMMUNICATING (OBSTRUCTIVE)", C.red);

  // Ex Vacuo
  s.addShape(pres.ShapeType.roundRect, { x: 0.3, y: 4.0, w: 9.4, h: 0.75, fill: { color: "1A2A1A" }, line: { color: C.green }, rectRadius: 0.1 });
  s.addText([
    { text: "EX VACUO HYDROCEPHALUS: ", options: { bold: true, color: C.green } },
    { text: "Compensatory ventricular enlargement due to brain parenchymal loss (e.g. Alzheimer's, stroke). ICP is NOT raised. NOT a true hydrocephalus requiring treatment.", options: { color: C.silver } },
  ], { x: 0.45, y: 4.0, w: 9.1, h: 0.75, fontSize: 10.5, valign: "middle", fontFace: "Calibri", margin: 0 });
}

// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 5 – CAUSES & CLINICAL FEATURES OF RAISED ICP
// ═══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.dark };
  addTitleBar(s, "RAISED ICP – CAUSES & CLINICAL FEATURES");
  addFooter(s);

  bulletBox(s, [
    "Space-occupying lesions: tumour, abscess, haematoma (EDH, SDH, ICH)",
    "Cerebral oedema: TBI, stroke, hepatic encephalopathy, hypertensive crisis",
    "Hydrocephalus (obstructive or communicating)",
    "Venous sinus thrombosis",
    "Idiopathic intracranial hypertension (pseudotumour cerebri)",
    "CO2 retention / hypoxia → cerebral vasodilation",
  ], 0.3, 1.2, 4.55, 2.6, C.mid, C.silver, "CAUSES", C.accent2);

  bulletBox(s, [
    "Headache (worse on lying down / morning)",
    "Nausea & vomiting (projectile)",
    "Papilledema (raised ICP >20 mmHg sustained)",
    "Altered level of consciousness / GCS decline",
    "Cushing's triad: Hypertension + Bradycardia + Irregular breathing",
    "Cranial nerve palsies (CN III, VI)",
    "Decerebrate / decorticate posturing (severe)",
  ], 5.1, 1.2, 4.6, 2.6, C.mid, C.silver, "CLINICAL FEATURES", C.red);

  // Cushing's triad highlight
  s.addShape(pres.ShapeType.roundRect, { x: 0.3, y: 3.95, w: 9.4, h: 0.8, fill: { color: "2A0A0A" }, line: { color: C.red, width: 1.5 }, rectRadius: 0.1 });
  s.addText("⚠  CUSHING'S TRIAD = Pre-terminal sign of brainstem herniation\nHypertension (widened pulse pressure) + Bradycardia + Irregular respirations", {
    x: 0.5, y: 3.95, w: 9.0, h: 0.8, fontSize: 11, bold: true, color: C.red, valign: "middle", fontFace: "Calibri", margin: 0,
  });
}

// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 6 – CEREBRAL OEDEMA & HERNIATION
// ═══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.dark };
  addTitleBar(s, "CEREBRAL OEDEMA & HERNIATION", "Pathophysiology");
  addFooter(s);

  // Oedema types
  bulletBox(s, [
    "Blood-brain barrier disruption → fluid into interstitial space",
    "Occurs around tumours, abscesses, contusions",
    "White matter predominantly affected",
    "Responds to STEROIDS (dexamethasone)",
  ], 0.3, 1.2, 4.55, 1.8, C.mid, C.silver, "VASOGENIC OEDEMA", C.accent);

  bulletBox(s, [
    "Cell membrane injury → intracellular fluid accumulation",
    "Occurs in ischaemia, hypoxia, metabolic failure",
    "Grey & white matter both affected",
    "Does NOT respond to steroids",
  ], 5.1, 1.2, 4.6, 1.8, C.mid, C.silver, "CYTOTOXIC OEDEMA", C.accent2);

  // Herniation syndromes
  s.addText("HERNIATION SYNDROMES", { x: 0.3, y: 3.1, w: 9.4, h: 0.3, fontSize: 12, bold: true, color: C.red, fontFace: "Calibri", margin: 0 });
  const hern = [
    ["Subfalcine\n(Cingulate)", "Cingulate gyrus under falx cerebri\nContralateral leg weakness", C.accent],
    ["Uncal\n(Transtentorial)", "CN III palsy (dilated pupil)\nContralateral hemiplegia\nMost common surgical emergency", C.red],
    ["Central\n(Downward)", "Bilateral Babinski\nDiencephalon / midbrain compression", C.accent2],
    ["Tonsillar\n(Foramen Magnum)", "Cerebellar tonsils → foramen magnum\nRespiratory arrest – LETHAL", C.yellow],
  ];
  hern.forEach(([name, detail, col], i) => {
    const x = 0.3 + i * 2.42;
    s.addShape(pres.ShapeType.roundRect, { x, y: 3.45, w: 2.22, h: 1.65, fill: { color: col + "22" }, line: { color: col }, rectRadius: 0.1 });
    s.addText(name, { x: x + 0.06, y: 3.5, w: 2.1, h: 0.4, fontSize: 10.5, bold: true, color: col, align: "center", fontFace: "Calibri", margin: 0 });
    s.addText(detail, { x: x + 0.08, y: 3.92, w: 2.06, h: 1.1, fontSize: 9.5, color: C.silver, fontFace: "Calibri", margin: 0 });
  });
}

// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 7 – CBF & AUTOREGULATION
// ═══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.dark };
  addTitleBar(s, "CEREBRAL BLOOD FLOW & AUTOREGULATION", "Key Physiological Concepts");
  addFooter(s);

  bulletBox(s, [
    "Normal CBF: ~50 mL/100g/min (whole brain ~750 mL/min)",
    "Ischaemic threshold: <20 mL/100g/min",
    "Electrical silence: <15 mL/100g/min",
    "Infarction: <10 mL/100g/min",
  ], 0.3, 1.25, 4.55, 1.55, C.mid, C.silver, "NORMAL CBF VALUES", C.green);

  bulletBox(s, [
    "Maintained over MAP 50–150 mmHg in healthy brain",
    "Abolished by: severe TBI, volatile anaesthetics >1 MAC, hypoxia",
    "Impaired autoregulation → pressure-passive CBF",
  ], 5.1, 1.25, 4.6, 1.55, C.mid, C.silver, "AUTOREGULATION", C.accent);

  // CO2 reactivity
  s.addShape(pres.ShapeType.roundRect, { x: 0.3, y: 2.95, w: 9.4, h: 0.9, fill: { color: "0D2040" }, line: { color: C.accent }, rectRadius: 0.1 });
  s.addText("CO₂ REACTIVITY (Most powerful physiological regulator)", { x: 0.45, y: 2.97, w: 9.1, h: 0.28, fontSize: 11.5, bold: true, color: C.accent, fontFace: "Calibri", margin: 0 });
  s.addText("For every 1 mmHg rise in PaCO₂ → CBF increases ~4%  |  PaCO₂ ↑ → vasodilation → ↑CBF → ↑ICP\nHyperventilation: PaCO₂ 30–35 mmHg → vasoconstriction → ↓CBF → ↓ICP (temporary – 30–60 mins)", { x: 0.45, y: 3.26, w: 9.1, h: 0.55, fontSize: 10.5, color: C.silver, fontFace: "Calibri", margin: 0 });

  // Other factors
  const factors = [
    ["PaO₂ < 50 mmHg", "CBF doubles", C.red],
    ["Temperature ↓1°C", "CMR ↓7%", C.accent],
    ["MAP ↑ (impaired AR)", "CBF ↑ → ↑ICP", C.accent2],
    ["Venous obstruction", "↑CBV → ↑ICP", C.yellow],
  ];
  factors.forEach(([cause, effect, col], i) => {
    const x = 0.3 + i * 2.42;
    s.addShape(pres.ShapeType.roundRect, { x, y: 3.98, w: 2.2, h: 0.85, fill: { color: col + "22" }, line: { color: col, width: 0.8 }, rectRadius: 0.08 });
    s.addText(cause, { x: x + 0.06, y: 4.0, w: 2.08, h: 0.35, fontSize: 10, bold: true, color: col, fontFace: "Calibri", margin: 0 });
    s.addText(effect, { x: x + 0.06, y: 4.38, w: 2.08, h: 0.35, fontSize: 10, color: C.silver, fontFace: "Calibri", margin: 0 });
  });
}

// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 8 – ANAESTHETIC DRUG EFFECTS ON ICP
// ═══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.dark };
  addTitleBar(s, "ANAESTHETIC DRUG EFFECTS ON ICP & CBF");
  addFooter(s);

  // Table header
  s.addShape(pres.ShapeType.rect, { x: 0.3, y: 1.2, w: 9.4, h: 0.38, fill: { color: C.accent } });
  ["Drug / Agent", "CBF", "CMR", "ICP", "Autoregulation", "Notes"].forEach((h, i) => {
    const widths = [2.2, 0.9, 0.9, 0.9, 1.7, 2.8];
    const xPos = [0.3, 2.5, 3.4, 4.3, 5.2, 6.9];
    s.addText(h, { x: xPos[i], y: 1.2, w: widths[i], h: 0.38, fontSize: 10, bold: true, color: C.dark, align: "center", valign: "middle", fontFace: "Calibri", margin: 0 });
  });

  const rows = [
    ["Propofol", "↓↓", "↓↓", "↓↓", "Preserved", "Drug of choice for TIVA in neuro; neuroprotective", C.green],
    ["Thiopentone", "↓↓", "↓↓", "↓↓", "Preserved", "Used for rapid ICP reduction; burst suppression", C.green],
    ["Midazolam / BZD", "↓", "↓", "↓", "Preserved", "Adjunct; avoid large doses", C.silver],
    ["Ketamine*", "↑↑", "↑", "↑↑", "Preserved", "*Controversial – avoid in raised ICP (traditional); recent data suggests safe with concurrent sedation", C.red],
    ["Isoflurane (<1MAC)", "↑/−", "↓", "±", "Mild impair.", "Acceptable in balanced technique when ICP controlled", C.yellow],
    ["Sevoflurane (<1MAC)", "↑/−", "↓", "±", "Mild impair.", "Preferred volatile; better cerebrovascular profile", C.yellow],
    ["Desflurane", "↑", "↓", "↑", "Impaired", "Avoid in raised ICP – most vasodilatory", C.accent2],
    ["N₂O", "↑", "↑", "↑", "Preserved", "Avoid in raised ICP; increases CBF; pneumocephalus risk", C.red],
    ["Opioids (fentanyl)", "↓/−", "↓/−", "↓/−", "Preserved", "Good adjuncts; minimise painful stimuli", C.green],
    ["Succinylcholine", "↑ (transiently)", "−", "↑ (mild)", "—", "Transient ICP rise; acceptable for RSI", C.yellow],
  ];

  rows.forEach((row, i) => {
    const bg = i % 2 === 0 ? C.mid : "142236";
    s.addShape(pres.ShapeType.rect, { x: 0.3, y: 1.58 + i * 0.39, w: 9.4, h: 0.39, fill: { color: bg } });
    const widths = [2.2, 0.9, 0.9, 0.9, 1.7, 2.8];
    const xPos = [0.3, 2.5, 3.4, 4.3, 5.2, 6.9];
    const vals = [row[0], row[1], row[2], row[3], row[4], row[5]];
    vals.forEach((v, j) => {
      const color = j === 0 ? row[6] : (j >= 1 && j <= 3 ? (v.includes("↑") ? C.red : v.includes("↓") ? C.green : C.silver) : C.silver);
      s.addText(v, { x: xPos[j], y: 1.58 + i * 0.39, w: widths[j], h: 0.39, fontSize: 9, color, align: j === 0 ? "left" : "center", valign: "middle", fontFace: "Calibri", margin: j === 0 ? 4 : 0, bold: j === 0 });
    });
  });
}

// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 9 – PRE-OPERATIVE ASSESSMENT
// ═══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.dark };
  addTitleBar(s, "PRE-OPERATIVE ASSESSMENT & OPTIMIZATION", "Patient with Raised ICP");
  addFooter(s);

  bulletBox(s, [
    "GCS score, focal neurological deficits, cranial nerve examination",
    "Signs of raised ICP: papilloedema, Cushing's triad",
    "Airway assessment – full stomach risk (vomiting with raised ICP)",
    "Functional status & baseline cognitive function",
  ], 0.3, 1.2, 4.55, 2.0, C.mid, C.silver, "HISTORY & EXAMINATION", C.accent);

  bulletBox(s, [
    "CT head: mass, midline shift, compressed cisterns, ventricle size",
    "MRI: tumour characterisation, oedema extent",
    "Angiography if vascular lesion",
    "Compressed/absent basal cisterns → severely impaired compliance",
  ], 5.1, 1.2, 4.6, 2.0, C.mid, C.silver, "IMAGING REVIEW", C.accent2);

  bulletBox(s, [
    "FBC, RFT, LFT, coagulation profile, blood glucose",
    "Electrolytes (Na⁺ – SIADH vs. DI risk), serum osmolality",
    "ABG if ventilated; ICP monitoring data",
    "Anticonvulsant levels if on treatment",
  ], 0.3, 3.3, 4.55, 1.8, C.mid, C.silver, "INVESTIGATIONS", C.green);

  bulletBox(s, [
    "Optimise ICP before induction: head-up 30°, avoid hypercapnia",
    "Start dexamethasone (4–8 mg 6-hourly) for vasogenic oedema",
    "Ensure adequate IV access (large bore + CVC ± arterial line)",
    "Pre-oxygenate fully; plan RSI if raised ICP",
    "Consent for awake craniotomy / intubation if indicated",
  ], 5.1, 3.3, 4.6, 1.8, C.mid, C.silver, "OPTIMISATION", C.yellow);
}

// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 10 – INDUCTION & AIRWAY MANAGEMENT
// ═══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.dark };
  addTitleBar(s, "INDUCTION & AIRWAY MANAGEMENT", "The Critical Period");
  addFooter(s);

  // RSI box
  s.addShape(pres.ShapeType.roundRect, { x: 0.3, y: 1.2, w: 9.4, h: 0.65, fill: { color: "2A0A0A" }, line: { color: C.red, width: 1.5 }, rectRadius: 0.1 });
  s.addText([
    { text: "GOAL: ", options: { bold: true, color: C.red } },
    { text: "Smooth, rapid induction avoiding haemodynamic surges | Prevent ↑ICP from laryngoscopy | Protect airway from aspiration", options: { color: C.silver } },
  ], { x: 0.5, y: 1.2, w: 9.1, h: 0.65, fontSize: 11, valign: "middle", fontFace: "Calibri", margin: 0 });

  bulletBox(s, [
    "Pre-oxygenation 3–5 min with 100% O₂",
    "Head-up 20–30° (venous drainage + aspiration prevention)",
    "Fentanyl 1–3 mcg/kg IV 3 min before laryngoscopy (blunts pressor response)",
    "Lignocaine 1.5 mg/kg IV (optional, blunts ICP rise to intubation)",
    "Propofol 1.5–2.5 mg/kg OR Thiopentone 3–5 mg/kg",
    "RSI: Succinylcholine 1.5 mg/kg OR Rocuronium 1.2 mg/kg (RSI dose)",
    "Direct laryngoscopy or videolaryngoscopy",
    "Avoid coughing / bucking – maintain deep anaesthesia",
  ], 0.3, 1.95, 5.8, 3.15, C.mid, C.silver, "RAPID SEQUENCE INDUCTION STEPS", C.accent);

  bulletBox(s, [
    "Avoid mask ventilation if possible (risk of gastric distension)",
    "Apnoeic oxygenation during intubation",
    "Confirm ETCO₂ – target 35–40 mmHg (or 30–35 if acute herniation)",
    "Post-intubation: NMB maintenance to prevent coughing",
    "Avoid N₂O (increases CBF, pneumocephalus risk)",
    "Arterial line before induction in haemodynamically unstable patients",
    "Obstructive hydrocephalus: EVD or ventriculostomy FIRST under local anaesthesia",
  ], 6.2, 1.95, 3.5, 3.15, C.mid, C.silver, "KEY PRECAUTIONS", C.yellow);
}

// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 11 – INTRAOPERATIVE ICP MANAGEMENT
// ═══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.dark };
  addTitleBar(s, "INTRAOPERATIVE MANAGEMENT OF RAISED ICP", "The Four Compartment Approach");
  addFooter(s);

  // Four compartment boxes
  const comps = [
    {
      label: "1. CELLULAR",
      color: C.accent,
      items: ["Surgeon evacuates mass, haematoma, or tumour", "Ask about contralateral lesion if brain still tight after evacuation"],
    },
    {
      label: "2. CSF",
      color: C.accent2,
      items: ["Lumbar CSF drain (if no herniation risk)", "Intraoperative ventricular needle drainage by surgeon", "EVD insertion under LA for obstructive hydrocephalus"],
    },
    {
      label: "3. FLUID (OEDEMA)",
      color: C.yellow,
      items: ["Mannitol 0.25–1 g/kg IV over 15–20 min", "Hypertonic saline 3% or 23.4%", "Dexamethasone (tumour/vasogenic oedema)", "Target serum osmolality 310–320 mOsm/L"],
    },
    {
      label: "4. BLOOD VOLUME",
      color: C.red,
      items: ["Venous: Head 20–30° up, avoid venous obstruction, avoid high PEEP", "Arterial: Controlled hypocapnia PaCO₂ 30–35 mmHg", "IV anaesthesia if volatile causing cerebral vasodilation", "Maintain MAP for adequate CPP"],
    },
  ];

  comps.forEach(({ label, color, items }, i) => {
    const col = i % 2;
    const row = Math.floor(i / 2);
    const x = 0.3 + col * 4.85;
    const y = 1.25 + row * 2.1;
    s.addShape(pres.ShapeType.roundRect, { x, y, w: 4.6, h: 1.95, fill: { color: color + "18" }, line: { color }, rectRadius: 0.1 });
    s.addText(label, { x: x + 0.1, y: y + 0.07, w: 4.4, h: 0.3, fontSize: 12, bold: true, color, fontFace: "Calibri", margin: 0 });
    const textItems = items.map((t, idx) => ({
      text: t,
      options: { bullet: { type: "bullet", characterCode: "25B8", color }, breakLine: idx < items.length - 1, color: C.silver, fontSize: 10.5, fontFace: "Calibri" },
    }));
    s.addText(textItems, { x: x + 0.18, y: y + 0.4, w: 4.3, h: 1.5, valign: "top", margin: 0 });
  });
}

// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 12 – PHARMACOLOGICAL ICP REDUCTION
// ═══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.dark };
  addTitleBar(s, "PHARMACOLOGICAL ICP REDUCTION", "Evidence-Based Agents");
  addFooter(s);

  // Mannitol
  s.addShape(pres.ShapeType.roundRect, { x: 0.3, y: 1.2, w: 4.55, h: 1.85, fill: { color: C.mid }, line: { color: C.accent }, rectRadius: 0.1 });
  s.addText("MANNITOL", { x: 0.4, y: 1.22, w: 4.35, h: 0.3, fontSize: 12, bold: true, color: C.accent, fontFace: "Calibri", margin: 0 });
  s.addText([
    { text: "Dose: ", options: { bold: true, color: C.yellow } }, { text: "0.25–1 g/kg IV over 15–20 min\n" },
    { text: "Onset: ", options: { bold: true, color: C.yellow } }, { text: "20–30 min  |  Duration: 2–6 hrs\n" },
    { text: "Mechanism: ", options: { bold: true, color: C.yellow } }, { text: "Osmotic gradient draws water from brain (intact BBB)\n" },
    { text: "⚠ Caution: ", options: { bold: true, color: C.red } }, { text: "Rebound oedema, hypotension, renal failure if osmolality >320 mOsm" },
  ], { x: 0.42, y: 1.55, w: 4.3, h: 1.44, fontSize: 10, color: C.silver, fontFace: "Calibri", margin: 0 });

  // Hypertonic Saline
  s.addShape(pres.ShapeType.roundRect, { x: 5.1, y: 1.2, w: 4.6, h: 1.85, fill: { color: C.mid }, line: { color: C.accent2 }, rectRadius: 0.1 });
  s.addText("HYPERTONIC SALINE", { x: 5.2, y: 1.22, w: 4.4, h: 0.3, fontSize: 12, bold: true, color: C.accent2, fontFace: "Calibri", margin: 0 });
  s.addText([
    { text: "3% NaCl: ", options: { bold: true, color: C.yellow } }, { text: "1–2 mL/kg IV\n" },
    { text: "23.4% NaCl: ", options: { bold: true, color: C.yellow } }, { text: "30–60 mL via central line (bolus)\n" },
    { text: "Advantages: ", options: { bold: true, color: C.green } }, { text: "No hypotension, maintains intravascular volume\n" },
    { text: "⚠ Caution: ", options: { bold: true, color: C.red } }, { text: "Rapid correction of hyponatraemia → central pontine myelinolysis" },
  ], { x: 5.22, y: 1.55, w: 4.36, h: 1.44, fontSize: 10, color: C.silver, fontFace: "Calibri", margin: 0 });

  // Steroids
  s.addShape(pres.ShapeType.roundRect, { x: 0.3, y: 3.15, w: 4.55, h: 1.55, fill: { color: C.mid }, line: { color: C.green }, rectRadius: 0.1 });
  s.addText("DEXAMETHASONE (STEROIDS)", { x: 0.4, y: 3.17, w: 4.35, h: 0.3, fontSize: 12, bold: true, color: C.green, fontFace: "Calibri", margin: 0 });
  s.addText([
    { text: "Dose: ", options: { bold: true, color: C.yellow } }, { text: "4–8 mg IV every 6 hrs\n" },
    { text: "Indication: ", options: { bold: true, color: C.yellow } }, { text: "Vasogenic oedema (tumours, abscesses)\n" },
    { text: "✗ NOT effective: ", options: { bold: true, color: C.red } }, { text: "TBI, stroke, cytotoxic oedema" },
  ], { x: 0.42, y: 3.5, w: 4.3, h: 1.14, fontSize: 10, color: C.silver, fontFace: "Calibri", margin: 0 });

  // Furosemide + Barbiturates
  s.addShape(pres.ShapeType.roundRect, { x: 5.1, y: 3.15, w: 4.6, h: 1.55, fill: { color: C.mid }, line: { color: C.yellow }, rectRadius: 0.1 });
  s.addText("FUROSEMIDE & BARBITURATES", { x: 5.2, y: 3.17, w: 4.4, h: 0.3, fontSize: 12, bold: true, color: C.yellow, fontFace: "Calibri", margin: 0 });
  s.addText([
    { text: "Furosemide: ", options: { bold: true, color: C.yellow } }, { text: "0.5 mg/kg IV (synergistic with mannitol)\n" },
    { text: "Barbiturate coma: ", options: { bold: true, color: C.yellow } }, { text: "Thiopentone/Pentobarbital infusion\nRefractory ICP unresponsive to other measures\n" },
    { text: "⚠ ", options: { color: C.red } }, { text: "Hypotension limits use in haemodynamically unstable" },
  ], { x: 5.22, y: 3.5, w: 4.36, h: 1.14, fontSize: 10, color: C.silver, fontFace: "Calibri", margin: 0 });
}

// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 13 – VENTILATION & PHYSIOLOGICAL TARGETS
// ═══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.dark };
  addTitleBar(s, "VENTILATION & PHYSIOLOGICAL TARGETS", "Intraoperative Goals");
  addFooter(s);

  const targets = [
    ["PaCO₂", "35–40 mmHg\n(30–35 if herniation)", "Hyperventilation is temporary bridge only (30–60 min)", C.accent],
    ["PaO₂", "> 100 mmHg\n(SpO₂ > 98%)", "Hypoxia → cerebral vasodilation → ↑CBF → ↑ICP", C.green],
    ["MAP", "70–90 mmHg\n(CPP ≥ 60 mmHg)", "Avoid hypotension. Vasopressors if needed. Avoid hypertension (↑CBV)", C.accent2],
    ["Temperature", "36–37°C\n(Normothermia)", "Hyperthermia ↑CMR → ↑ICP. Therapeutic hypothermia not routine", C.yellow],
    ["Glucose", "6–10 mmol/L\n(140–180 mg/dL)", "Hyperglycaemia amplifies ischaemic brain injury. Avoid dextrose IVF", C.red],
    ["Haematocrit", "30–35%\nHb > 10 g/dL", "Anaemia reduces O₂ delivery to brain. Avoid excessive haemodilution", C.silver],
  ];

  targets.forEach(([param, value, rationale, col], i) => {
    const col_n = i % 3;
    const row = Math.floor(i / 3);
    const x = 0.3 + col_n * 3.22;
    const y = 1.2 + row * 2.05;
    s.addShape(pres.ShapeType.roundRect, { x, y, w: 3.05, h: 1.9, fill: { color: col + "18" }, line: { color: col }, rectRadius: 0.1 });
    s.addText(param, { x: x + 0.1, y: y + 0.08, w: 2.85, h: 0.32, fontSize: 13, bold: true, color: col, fontFace: "Calibri", margin: 0 });
    s.addText(value, { x: x + 0.1, y: y + 0.42, w: 2.85, h: 0.58, fontSize: 13, bold: true, color: C.white, fontFace: "Calibri Light", margin: 0 });
    s.addText(rationale, { x: x + 0.1, y: y + 1.05, w: 2.85, h: 0.78, fontSize: 9.5, color: C.silver, fontFace: "Calibri", margin: 0 });
  });
}

// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 14 – SURGICAL INTERVENTIONS & SHUNTS
// ═══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.dark };
  addTitleBar(s, "SURGICAL INTERVENTIONS & SHUNTS", "Anaesthesia Considerations");
  addFooter(s);

  const procedures = [
    {
      title: "VP SHUNT (Ventriculoperitoneal)",
      color: C.accent,
      points: [
        "Most common shunt for hydrocephalus",
        "GA – LMA or ETT depending on position",
        "Prone/supine or lateral – confirm airway security",
        "Risk: air embolism on ventricular cannulation",
        "Post-op: monitor for over-drainage (subdural effusion)",
      ],
    },
    {
      title: "VA SHUNT (Ventriculoatrial)",
      color: C.accent2,
      points: [
        "Used when peritoneum unavailable",
        "CVP line in right atrium as guide",
        "Risk: cardiac arrhythmias, bacteraemia, paradoxical embolism",
        "ECG monitoring during atrial catheter placement",
      ],
    },
    {
      title: "ETV (Endoscopic 3rd Ventriculostomy)",
      color: C.green,
      points: [
        "Bypasses CSF obstruction without shunt",
        "For aqueductal stenosis / obstructive hydrocephalus",
        "GA preferred; rigid endoscope in ventricle",
        "Risks: bradycardia, haemorrhage, hypothalamic injury",
        "Avoid N₂O – irrigation fluid distends ventricles",
      ],
    },
    {
      title: "EXTERNAL VENTRICULAR DRAIN (EVD)",
      color: C.red,
      points: [
        "Bedside / emergency procedure",
        "Sedation/LA or GA if uncooperative",
        "Continuous ICP monitoring + CSF drainage",
        "Critical in herniation – immediate decompression",
      ],
    },
  ];

  procedures.forEach(({ title, color, points }, i) => {
    const col = i % 2;
    const row = Math.floor(i / 2);
    const x = 0.3 + col * 4.85;
    const y = 1.2 + row * 2.18;
    bulletBox(s, points, x, y, 4.6, 2.02, C.mid, C.silver, title, color, 10);
  });
}

// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 15 – EMERGENCE & POSTOPERATIVE CARE
// ═══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.dark };
  addTitleBar(s, "EMERGENCE, EXTUBATION & POSTOPERATIVE CARE");
  addFooter(s);

  bulletBox(s, [
    "Smooth emergence – avoid coughing/straining (herniation risk through craniotomy site)",
    "IV lignocaine 1.5 mg/kg or deep extubation technique to suppress cough",
    "Neostigmine + glycopyrrolate for reversal of NMB",
    "Extubate awake when GCS adequate, airway reflexes intact, haemodynamically stable",
    "Delayed awakening: consider opioid overdose, residual volatile, metabolic cause, or new neurological injury",
    "Direct to CT scanner if neurological status not as expected",
  ], 0.3, 1.2, 4.55, 3.0, C.mid, C.silver, "EMERGENCE STRATEGIES", C.accent);

  bulletBox(s, [
    "ICU admission for GCS < 15, continued raised ICP, or complex surgery",
    "Continue ICP monitoring (bolt / EVD)",
    "Maintain head-up 30°, normocapnia, normothermia, normoglycaemia",
    "Pain control: paracetamol ± opioids (titrated, avoid over-sedation)",
    "Anticonvulsants: phenytoin / levetiracetam (post-craniotomy)",
    "Vigilance for: re-bleed, seizures, CSF leak, meningitis, SIADH",
  ], 5.1, 1.2, 4.6, 3.0, C.mid, C.silver, "POST-OPERATIVE ICU CARE", C.yellow);

  // Criteria for extubation
  s.addShape(pres.ShapeType.roundRect, { x: 0.3, y: 4.3, w: 9.4, h: 0.9, fill: { color: "0D2A00" }, line: { color: C.green, width: 1 }, rectRadius: 0.1 });
  s.addText("✓ Extubation Criteria Post-Craniotomy", { x: 0.5, y: 4.32, w: 9.1, h: 0.28, fontSize: 11, bold: true, color: C.green, fontFace: "Calibri", margin: 0 });
  s.addText("Pre-op GCS  |  Haemodynamic stability  |  Adequate ventilation (TV, RR)  |  Protective airway reflexes  |  No new neurological deficit  |  No persistent raised ICP", { x: 0.5, y: 4.6, w: 9.1, h: 0.52, fontSize: 10, color: C.silver, fontFace: "Calibri", margin: 0 });
}

// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 16 – SPECIAL SITUATIONS
// ═══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.dark };
  addTitleBar(s, "SPECIAL SITUATIONS IN NEUROANESTHESIA");
  addFooter(s);

  bulletBox(s, [
    "Obese patients: beware of hypoventilation → ↑PaCO₂",
    "Maintain end-tidal CO₂ 35–40 mmHg",
    "Head position crucial – elevation may impair venous return in obesity",
    "CPAP/NIV post-op to prevent hypercapnic episodes",
  ], 0.3, 1.2, 4.55, 1.8, C.mid, C.silver, "OBESITY", C.accent);

  bulletBox(s, [
    "Physiological changes alter drug dosing and physiology",
    "Avoid prolonged hypotension (placenta, brain)",
    "Positioning: left lateral tilt",
    "Dexamethasone for vasogenic oedema; mannitol with caution",
    "Betamethasone for foetal lung maturity if premature delivery anticipated",
  ], 5.1, 1.2, 4.6, 1.8, C.mid, C.silver, "PREGNANCY", C.accent2);

  bulletBox(s, [
    "Sitting position: venous air embolism (VAE) – most feared complication",
    "Precordial Doppler + end-tidal N₂ monitoring for VAE",
    "CVC with multi-orifice catheter in right atrium for air aspiration",
    "Obstructive hydrocephalus common with posterior fossa masses",
    "Preoperative EVD or ventriculostomy to decompress before GA",
  ], 0.3, 3.1, 4.55, 2.05, C.mid, C.silver, "POSTERIOR FOSSA SURGERY", C.red);

  bulletBox(s, [
    "Open fontanelle = natural ICP relief valve",
    "Inhalational induction acceptable if ICP minimally raised",
    "Avoid ketamine if ICP concerns (traditional approach)",
    "Blood loss relative to small volume = proportionally large",
    "Temperature management critical",
  ], 5.1, 3.1, 4.6, 2.05, C.mid, C.silver, "PAEDIATRIC HYDROCEPHALUS", C.yellow);
}

// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 17 – MONITORING
// ═══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.dark };
  addTitleBar(s, "MONITORING IN NEUROANESTHESIA", "Standard & Advanced");
  addFooter(s);

  const standard = ["ECG (5-lead continuous)", "SpO₂ + Waveform capnography (ETCO₂)", "Non-invasive / Invasive BP (arterial line)", "Foley catheter (osmotherapy monitoring)", "Temperature (core – oesophageal/tympanic)", "Neuromuscular blockade (TOF monitor)"];
  const advanced = ["ICP monitoring: ICP bolt / EVD / Codman probe", "CPP = MAP – ICP (continuous display)", "Transcranial Doppler (CBF velocity)", "Near-infrared spectroscopy (rSO₂) – cerebral oximetry", "BIS / EEG (depth of anaesthesia, burst suppression)", "SSEP / MEP / BAEP (intraoperative neuromonitoring)"];

  bulletBox(s, standard, 0.3, 1.2, 4.55, 3.1, C.mid, C.silver, "STANDARD MONITORING", C.green);
  bulletBox(s, advanced, 5.1, 1.2, 4.6, 3.1, C.mid, C.silver, "ADVANCED / NEURO-SPECIFIC", C.accent);

  // ICP waveform
  s.addShape(pres.ShapeType.roundRect, { x: 0.3, y: 4.4, w: 9.4, h: 0.75, fill: { color: C.mid }, line: { color: C.accent2 }, rectRadius: 0.1 });
  s.addText([
    { text: "ICP WAVEFORM COMPONENTS: ", options: { bold: true, color: C.accent2 } },
    { text: "P1 (percussion – arterial pulsation)  |  P2 (tidal – brain compliance)  |  P3 (dicrotic – aortic valve closure)\n", options: { color: C.silver } },
    { text: "P2 > P1 ", options: { bold: true, color: C.red } },
    { text: "= Poor compliance = Impending ICP crisis", options: { color: C.silver } },
  ], { x: 0.45, y: 4.4, w: 9.1, h: 0.75, fontSize: 10, valign: "middle", fontFace: "Calibri", margin: 0 });
}

// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 18 – QUICK REFERENCE / SUMMARY CARD
// ═══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.dark };
  addTitleBar(s, "QUICK REFERENCE CARD", "Raised ICP Anaesthesia Management");
  addFooter(s);

  // Emergency ICP reduction algorithm
  s.addText("ACUTE ICP CRISIS – STEPWISE MANAGEMENT", { x: 0.3, y: 1.18, w: 9.4, h: 0.3, fontSize: 12, bold: true, color: C.red, fontFace: "Calibri", margin: 0 });

  const steps = [
    ["STEP 1", "Airway/Breathing", "Intubate if GCS ≤ 8 | Target SpO₂ > 98%", C.accent],
    ["STEP 2", "Hyperventilate", "Temporary: PaCO₂ 30–35 mmHg | Max 30–60 min", C.green],
    ["STEP 3", "Head-up 30°", "Optimise venous drainage | Avoid neck compression", C.accent2],
    ["STEP 4", "Osmotherapy", "Mannitol 0.5–1 g/kg IV OR HTS 3% 1–2 mL/kg", C.yellow],
    ["STEP 5", "Sedation/NMB", "Propofol + fentanyl infusion | NMB to prevent coughing", C.accent],
    ["STEP 6", "Surgical", "EVD drainage | Decompressive craniectomy", C.red],
  ];

  steps.forEach(([step, title, detail, col], i) => {
    const row = Math.floor(i / 3);
    const col_n = i % 3;
    const x = 0.3 + col_n * 3.22;
    const y = 1.55 + row * 1.3;
    s.addShape(pres.ShapeType.roundRect, { x, y, w: 3.05, h: 1.2, fill: { color: col + "22" }, line: { color: col }, rectRadius: 0.1 });
    s.addShape(pres.ShapeType.roundRect, { x: x + 0.07, y: y + 0.07, w: 0.75, h: 0.32, fill: { color: col }, line: { color: col }, rectRadius: 0.05 });
    s.addText(step, { x: x + 0.07, y: y + 0.07, w: 0.75, h: 0.32, fontSize: 9, bold: true, color: C.dark, align: "center", valign: "middle", fontFace: "Calibri", margin: 0 });
    s.addText(title, { x: x + 0.9, y: y + 0.07, w: 2.1, h: 0.32, fontSize: 11, bold: true, color: col, fontFace: "Calibri", margin: 0 });
    s.addText(detail, { x: x + 0.12, y: y + 0.46, w: 2.85, h: 0.66, fontSize: 9.5, color: C.silver, fontFace: "Calibri", margin: 0 });
  });

  // DO NOT list
  s.addShape(pres.ShapeType.roundRect, { x: 0.3, y: 4.15, w: 9.4, h: 0.85, fill: { color: "2A0505" }, line: { color: C.red }, rectRadius: 0.1 });
  s.addText("✗  AVOID IN RAISED ICP: ", { x: 0.45, y: 4.17, w: 2.2, h: 0.3, fontSize: 11, bold: true, color: C.red, fontFace: "Calibri", margin: 0 });
  s.addText("N₂O  |  Ketamine (large doses)  |  Desflurane  |  Trendelenburg position  |  Succinylcholine (relative)  |  Excessive PEEP  |  Hypotonic IV fluids  |  Hyperglycaemia (dextrose IVF)  |  Hyperthermia  |  Hypertension/Hypotension swings", { x: 0.45, y: 4.47, w: 9.1, h: 0.5, fontSize: 10, color: C.silver, fontFace: "Calibri", margin: 0 });
}

// ── WRITE FILE ───────────────────────────────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/workspace/hydrocephalus-icp-pptx/Hydrocephalus_Raised_ICP_Anesthesia.pptx" })
  .then(() => console.log("DONE: Hydrocephalus_Raised_ICP_Anesthesia.pptx written successfully"))
  .catch(e => { console.error("ERROR:", e); process.exit(1); });
Running Command

cd /home/daytona/workspace/hydrocephalus-icp-pptx && node build.js 2>&1

You've run out of free credits. Sign up for a free account to continue using Orris.
This is a shared conversation. Sign in to Orris to start your own chat.