What is this condition, explain in detail

Running Command

file /home/daytona/workspace/attachments/fe9de6af-4650-40bb-8e88-87efe8564f14/VID-20260528-WA0000.mp4 && ls -lh /home/daytona/workspace/attachments/fe9de6af-4650-40bb-8e88-87efe8564f14/

Running Command

ffmpeg -i /home/daytona/workspace/attachments/fe9de6af-4650-40bb-8e88-87efe8564f14/VID-20260528-WA0000.mp4 -vf "fps=1" -frames:v 6 /home/daytona/workspace/attachments/fe9de6af-4650-40bb-8e88-87efe8564f14/frame_%02d.jpg 2>&1 | tail -20

Reading File
Reading File
Reading File
Reading File
Finding Sources
Searching PubMed

"neonatal seizures"[MeSH Terms] AND diagnosis AND management

Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Loading Image
Loading Image
Here is a detailed explanation of what is seen in the video:

Neonatal Seizures

The video shows a newborn in a NICU experiencing neonatal seizures - specifically the subtle and tonic motor type. Visible features include:
  • Repetitive, stereotyped limb movements (arms raised, hands brought toward face)
  • Subtle, semi-purposeful-looking but involuntary motor activity
  • The baby is on cardiac/respiratory monitoring, has an NG tube (yellow), IV lines, and a pulse oximeter - all consistent with a critically ill neonate under intensive monitoring

What Are Neonatal Seizures?

A neonatal seizure is a paroxysmal alteration in neurological function (motor, behavioral, or autonomic) accompanied by electrographic (EEG) seizure activity. They occur within the first 28 days of life and are the most common neurological emergency in newborns - more frequent in the neonatal period than at any other time of life.
Unlike older children and adults, neonates almost never have the classic generalized tonic-clonic seizures. This is because:
  • Immature synaptic connections prevent organized, widespread spread of seizure activity
  • Incomplete myelination prevents bihemispheric propagation

Types of Neonatal Seizures (Clinical Semiology)

TypeFeatures
Subtle (most common, ~50%)Lip smacking, eye deviation, bicycling, apnea, chewing
Clonic - focalRhythmic jerking of a limb or face, usually conscious
Clonic - multifocalMigrating clonic jerks across body parts
Tonic - focalSustained posturing of a limb (as seen in the video)
Tonic - generalizedStiffening of entire body, ominous sign
MyoclonicSingle or repetitive rapid jerks; fragmental or massive
The subtle type (seen here) is particularly deceptive - it can be mistaken for normal newborn behavior. EEG confirmation is mandatory.

Why Are Neonates So Prone to Seizures? - The Pathophysiology

The immature brain is inherently more excitable due to a fundamental difference in chloride homeostasis:
  • In adult neurons, GABA-A receptor activation causes chloride influx → membrane hyperpolarization → inhibition
  • In immature neurons, the cotransporter NKCC1 dominates over KCC2, causing high intracellular chloride → GABA activation leads to chloride efflux → membrane depolarizationexcitation
This is why phenobarbital (a GABA-A agonist) often fails to control neonatal seizures - it actually excites the immature brain rather than inhibiting it.
GABA developmental switch - immature vs adult neurons

Causes (Etiology)

Neonatal seizures are almost always acute symptomatic - meaning they result from an identifiable underlying cause. The timing of onset helps predict the etiology:
Common Etiologies of Neonatal Seizures by day of life

Most Common Causes:

  1. Hypoxic-Ischemic Encephalopathy (HIE) - ~50% in term newborns
    • Birth asphyxia, cord accidents, placental abruption
    • Onset within first 24-48 hours of life
    • Carries poor prognosis; about half of survivors severely disabled
  2. Intracranial hemorrhage - ~30% in preterm newborns
    • Intraventricular hemorrhage (IVH) from germinal matrix rupture
    • Subarachnoid or subdural hemorrhage
  3. Ischemic stroke / Perinatal arterial stroke
  4. Metabolic causes (onset days 2-7):
    • Hypoglycemia (most common metabolic cause)
    • Hypocalcemia (now less common)
    • Hypomagnesemia, hypo/hypernatremia
  5. Infections (onset days 3-7):
    • Bacterial meningitis (GBS, E. coli, Listeria)
    • Herpes simplex virus encephalitis (HSV) - potentially fatal if untreated
  6. Inborn errors of metabolism:
    • Pyridoxine (B6) deficiency - treatable with 100 mg IV pyridoxine
    • Biotinidase deficiency
    • Nonketotic hyperglycinemia, maple syrup urine disease, organic acidemias
  7. Structural/Developmental brain abnormalities (5-10%)
    • Cortical dysplasias - particularly refractory
  8. Genetic Channelopathies:
    • KCNQ2, KCNQ3 mutations → Benign familial neonatal epilepsy (autosomal dominant, resolves within first year)
    • SCN2A mutations
    • Ohtahara syndrome (severe epileptic encephalopathy, burst-suppression on EEG)
  9. Drug withdrawal - maternal opioid use, barbiturates

Diagnosis

Key challenge: Up to 80% of electrographic neonatal seizures have NO clinical manifestation ("electroclinical dissociation"). This means clinical observation alone is insufficient.
Workup includes:
  • EEG / amplitude-integrated EEG (aEEG) - gold standard; continuous monitoring preferred
  • Blood glucose and electrolytes (Ca²⁺, Mg²⁺, Na⁺) - immediately correctable causes
  • Blood culture, LP with CSF analysis - rule out infection
  • HSV PCR from CSF - start acyclovir empirically
  • Neuroimaging - cranial ultrasound first; MRI brain preferred for full characterization
  • Metabolic panel: lactate, ammonia, serum amino acids, urine organic acids
  • Genetic testing (next-generation sequencing) if etiology unclear

Management

Treatment addresses both the underlying cause and the seizures themselves.
First-line: Correct reversible causes
  • IV dextrose for hypoglycemia
  • IV calcium gluconate for hypocalcemia
  • IV magnesium sulfate for hypomagnesemia
Antiepileptic Drug Ladder (from the Hospital for Sick Children protocol):
Neonatal Seizure Management Algorithm
  1. Lorazepam 0.1 mg/kg IV (repeat once if needed)
  2. Phenobarbital 20 mg/kg IV → additional 10+10 mg/kg if needed
  3. Consider empiric pyridoxal phosphate (PLP 10 mg/kg q8h) + folinic acid (5 mg/kg q24h) if metabolic etiology suspected
  4. Levetiracetam 60 mg/kg IV OR Fosphenytoin 20 mg/kg IV
  5. Midazolam infusion for refractory status epilepticus
  • For genetic channelopathies (KCNQ2/3), sodium channel blockers (phenytoin, carbamazepine) are specifically effective
  • For HSV encephalitis: IV acyclovir started empirically

Prognosis

  • Seizures within 24-48 hours of a difficult birth (HIE): high mortality; ~50% of survivors have severe disability
  • Seizures starting days-weeks later (metabolic causes): better prognosis if identified and treated
  • Benign familial neonatal seizures: excellent prognosis, resolve within 1st year of life
  • Ohtahara syndrome / early epileptic encephalopathy: poor; often evolves into West syndrome or Lennox-Gastaut
  • Early-onset myoclonic jerks with burst-suppression EEG = particularly ominous sign
  • Risk factors for later epilepsy include: status epilepticus, severe HIE, requiring multiple antiepileptics

Sources: Adams and Victor's Principles of Neurology 12th Ed., p. 352; Bradley and Daroff's Neurology in Clinical Practice (Neonatal Seizures chapter, pp. 2023-2027); Tintinalli's Emergency Medicine; Rosen's Emergency Medicine

Put this every detail in one ppt including the video

Reading File
Reading File
Reading File
Reading File
Reading File
Running Command

mkdir -p /home/daytona/workspace/neonatal-seizures-ppt && ls /home/daytona/workspace/neonatal-seizures-ppt/

Running Command

cd /home/daytona/workspace/neonatal-seizures-ppt && node /home/daytona/skills/shared/scripts/fetch_images.js \ "https://cdn.orris.care/cdss_images/d0301b4606c93a651c4147da63dbd6aad26df5d704677b42dde4591a261bcaf5.png" \ "https://cdn.orris.care/cdss_images/e043e2b19068490859d9d52d4eeeb4f10e6cbcfb220f1d327ec34c1b23e19745.png" \ "https://cdn.orris.care/cdss_images/80e87f513c784b1affc34d63d39528a2c4a98e12ae7c746a048abb693840fe05.png" \ > images.json 2>&1 echo "Exit: $?" wc -c images.json

Running Command

ffmpeg -i /home/daytona/workspace/attachments/fe9de6af-4650-40bb-8e88-87efe8564f14/VID-20260528-WA0000.mp4 -ss 00:00:01 -frames:v 1 /home/daytona/workspace/neonatal-seizures-ppt/video_thumb.jpg 2>&1 | tail -5 ls -lh /home/daytona/workspace/neonatal-seizures-ppt/video_thumb.jpg

Writing File

~/neonatal-seizures-ppt/build.js

const pptxgen = require("pptxgenjs");
const fs = require("fs");
const path = require("path");

// Load downloaded images
const images = JSON.parse(fs.readFileSync("images.json", "utf8"));
const mgmtAlgoImg   = images[0].base64; // management algorithm
const etiologyImg   = images[1].base64; // etiology by day
const gabaImg       = images[2].base64; // GABA immature vs adult

// Load video thumbnail
function imgToBase64(filePath) {
  const buf = fs.readFileSync(filePath);
  return "image/jpeg;base64," + buf.toString("base64");
}
const videoThumb = imgToBase64("video_thumb.jpg");

// ── Palette ──────────────────────────────────────────────────────────────────
const C = {
  navy:     "0B2545",   // dominant dark
  teal:     "1B6CA8",   // supporting blue
  accent:   "E63946",   // sharp red accent
  lightBg:  "EDF2F7",   // light slide bg
  white:    "FFFFFF",
  offWhite: "F7F9FC",
  mid:      "4A6FA5",   // mid blue
  gold:     "F4A261",   // warm orange
  darkText: "1A202C",
  mutedText:"64748B",
};

let pres = new pptxgen();
pres.layout = "LAYOUT_WIDE"; // 13.3" × 7.5"
pres.author  = "Orris AI";
pres.title   = "Neonatal Seizures";
pres.subject = "Clinical Presentation & Management";

// ── Helper: dark section header bar ──────────────────────────────────────────
function addSlideHeader(slide, title, subtitle) {
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 0, w: 13.3, h: 1.15,
    fill: { color: C.navy }, line: { color: C.navy }
  });
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 1.1, w: 13.3, h: 0.06,
    fill: { color: C.accent }, line: { color: C.accent }
  });
  slide.addText(title, {
    x: 0.35, y: 0.1, w: 12.6, h: 0.65,
    fontSize: 26, bold: true, color: C.white, fontFace: "Calibri", margin: 0
  });
  if (subtitle) {
    slide.addText(subtitle, {
      x: 0.35, y: 0.72, w: 12.6, h: 0.38,
      fontSize: 14, color: "90B8D8", fontFace: "Calibri", italic: true, margin: 0
    });
  }
  slide.background = { color: C.offWhite };
}

// ── Helper: bullet list box ───────────────────────────────────────────────────
function addBullets(slide, items, x, y, w, h, opts = {}) {
  const textArr = items.map((item, i) => {
    const isLast = i === items.length - 1;
    if (typeof item === "string") {
      return { text: item, options: { bullet: { code: "25CF", indent: 14 }, breakLine: !isLast, fontSize: opts.fontSize || 15, color: opts.color || C.darkText, fontFace: "Calibri" } };
    }
    // { text, sub: true } for sub-bullets
    return { text: item.text, options: { bullet: { code: "25CB", indent: 28 }, breakLine: !isLast, fontSize: opts.subFontSize || 13, color: opts.subColor || C.mutedText, fontFace: "Calibri" } };
  });
  slide.addText(textArr, { x, y, w, h, valign: "top", margin: 6, ...opts });
}

// ── Helper: card box ─────────────────────────────────────────────────────────
function addCard(slide, x, y, w, h, headerText, headerColor, bodyItems, bodyFontSize = 13) {
  slide.addShape(pres.shapes.RECTANGLE, {
    x, y, w, h,
    fill: { color: C.white },
    shadow: { type: "outer", color: "000000", blur: 6, offset: 2, angle: 135, opacity: 0.10 },
    line: { color: "DDE3EC", pt: 0.8 }
  });
  slide.addShape(pres.shapes.RECTANGLE, {
    x, y, w: w, h: 0.38,
    fill: { color: headerColor }, line: { color: headerColor }
  });
  slide.addText(headerText, {
    x: x + 0.12, y: y + 0.02, w: w - 0.24, h: 0.35,
    fontSize: 13, bold: true, color: C.white, fontFace: "Calibri", margin: 0
  });
  if (bodyItems.length) {
    addBullets(slide, bodyItems, x + 0.12, y + 0.44, w - 0.24, h - 0.52, { fontSize: bodyFontSize });
  }
}

// ════════════════════════════════════════════════════════════════════════════
// SLIDE 1 — TITLE
// ════════════════════════════════════════════════════════════════════════════
{
  let sl = pres.addSlide();
  sl.background = { color: C.navy };

  // Full bleed red accent strip at bottom
  sl.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 7.1, w: 13.3, h: 0.4,
    fill: { color: C.accent }, line: { color: C.accent }
  });
  // Left dark panel
  sl.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 0, w: 5.5, h: 7.5,
    fill: { color: "08172E" }, line: { color: "08172E" }
  });

  // Video thumbnail on right side with play icon overlay
  sl.addImage({ data: videoThumb, x: 5.7, y: 0.6, w: 7.3, h: 6.0 });
  sl.addShape(pres.shapes.RECTANGLE, {
    x: 5.7, y: 0.6, w: 7.3, h: 6.0,
    fill: { color: "000000", transparency: 35 }, line: { color: "000000", transparency: 35 }
  });
  // Play button hint
  sl.addShape(pres.shapes.OVAL, {
    x: 8.7, y: 2.8, w: 1.3, h: 1.3,
    fill: { color: C.accent, transparency: 20 }, line: { color: C.white, pt: 2 }
  });
  sl.addText("▶", { x: 8.9, y: 3.02, w: 0.9, h: 0.7, fontSize: 28, color: C.white, align: "center", fontFace: "Calibri", bold: true });

  // Caption on image
  sl.addText("Clinical Video: Neonatal Seizure in NICU", {
    x: 5.7, y: 6.2, w: 7.3, h: 0.4,
    fontSize: 12, color: "CCDCEE", italic: true, align: "center", fontFace: "Calibri"
  });

  // Title text left panel
  sl.addText("NEONATAL\nSEIZURES", {
    x: 0.3, y: 1.2, w: 5.0, h: 2.5,
    fontSize: 46, bold: true, color: C.white, fontFace: "Calibri",
    charSpacing: 2, valign: "top"
  });
  sl.addShape(pres.shapes.RECTANGLE, {
    x: 0.3, y: 3.9, w: 1.6, h: 0.08,
    fill: { color: C.accent }, line: { color: C.accent }
  });
  sl.addText("A Comprehensive Clinical Review", {
    x: 0.3, y: 4.1, w: 5.0, h: 0.5,
    fontSize: 15, color: "90B8D8", fontFace: "Calibri", italic: true
  });
  sl.addText([
    { text: "Topics Covered", options: { bold: true, breakLine: true, fontSize: 13, color: C.gold } },
    { text: "Definition & Pathophysiology", options: { breakLine: true, fontSize: 12, color: "AABFCF" } },
    { text: "Seizure Types & Semiology", options: { breakLine: true, fontSize: 12, color: "AABFCF" } },
    { text: "Causes & Timing", options: { breakLine: true, fontSize: 12, color: "AABFCF" } },
    { text: "Diagnosis & Workup", options: { breakLine: true, fontSize: 12, color: "AABFCF" } },
    { text: "Management Algorithm", options: { breakLine: true, fontSize: 12, color: "AABFCF" } },
    { text: "Prognosis", options: { fontSize: 12, color: "AABFCF" } },
  ], { x: 0.3, y: 4.75, w: 5.0, h: 2.3, valign: "top" });
}

// ════════════════════════════════════════════════════════════════════════════
// SLIDE 2 — CLINICAL VIDEO OBSERVATION
// ════════════════════════════════════════════════════════════════════════════
{
  let sl = pres.addSlide();
  addSlideHeader(sl, "Clinical Video — What We Observe", "NICU recording: Neonate exhibiting subtle/tonic seizure activity");

  // Video thumbnail large
  sl.addImage({ data: videoThumb, x: 0.4, y: 1.35, w: 5.5, h: 5.5 });
  sl.addShape(pres.shapes.RECTANGLE, {
    x: 0.4, y: 1.35, w: 5.5, h: 5.5,
    fill: { color: "000000", transparency: 30 }, line: { color: "000000", transparency: 30 }
  });
  sl.addShape(pres.shapes.OVAL, {
    x: 2.65, y: 3.5, w: 1.0, h: 1.0,
    fill: { color: C.accent, transparency: 10 }, line: { color: C.white, pt: 2 }
  });
  sl.addText("▶", { x: 2.82, y: 3.68, w: 0.65, h: 0.55, fontSize: 22, color: C.white, align: "center", bold: true });
  sl.addText("Video: Neonatal Seizure (NICU)", {
    x: 0.4, y: 6.6, w: 5.5, h: 0.3,
    fontSize: 11, color: C.mutedText, italic: true, align: "center"
  });

  // Observations card right
  addCard(sl, 6.3, 1.35, 6.6, 2.5, "Observable Features in Video", C.teal, [
    "Repetitive, stereotyped limb movements",
    "Arms raised; hands drawn toward face",
    "Semi-purposeful but involuntary motor activity",
    "No generalized tonic-clonic pattern (age-specific)",
    "Baby in distress — monitored in NICU",
  ]);

  addCard(sl, 6.3, 4.0, 6.6, 2.8, "NICU Equipment Visible", C.navy, [
    "Cardiac & respiratory monitor leads",
    "NG tube (yellow) — enteral nutrition/medication",
    "IV lines — medication delivery",
    "Pulse oximeter (foot) — SpO₂ monitoring",
    "ECG patch (chest) — continuous cardiac monitoring",
    "Warmer bed — thermoregulation",
  ]);
}

// ════════════════════════════════════════════════════════════════════════════
// SLIDE 3 — DEFINITION & OVERVIEW
// ════════════════════════════════════════════════════════════════════════════
{
  let sl = pres.addSlide();
  addSlideHeader(sl, "Definition & Overview", "Neonatal seizures — the most common neurological emergency in newborns");

  // Large definition box
  sl.addShape(pres.shapes.RECTANGLE, {
    x: 0.35, y: 1.3, w: 12.6, h: 1.05,
    fill: { color: "EBF4FF" }, line: { color: C.teal, pt: 1.5 }
  });
  sl.addShape(pres.shapes.RECTANGLE, {
    x: 0.35, y: 1.3, w: 0.12, h: 1.05,
    fill: { color: C.accent }, line: { color: C.accent }
  });
  sl.addText([
    { text: "Definition: ", options: { bold: true, fontSize: 16, color: C.navy } },
    { text: "A paroxysmal alteration in neurological function (motor, behavioral, or autonomic) accompanied by electrographic seizure activity on EEG, occurring within the first 28 days of life.", options: { fontSize: 15, color: C.darkText } }
  ], { x: 0.6, y: 1.35, w: 12.2, h: 0.95, valign: "middle", fontFace: "Calibri" });

  // 4 key fact cards
  const facts = [
    { title: "Most Frequent\nNeonatal Neuro Emergency", icon: "⚡", color: C.accent },
    { title: "Higher Incidence than\nAny Other Age", icon: "📈", color: C.teal },
    { title: "80% May Be\nClinically Silent", icon: "⚠️", color: "D97706" },
    { title: "Almost Always\nAcute Symptomatic", icon: "🔍", color: C.mid },
  ];
  facts.forEach((f, i) => {
    const x = 0.35 + i * 3.15;
    sl.addShape(pres.shapes.RECTANGLE, {
      x, y: 2.55, w: 2.95, h: 1.8,
      fill: { color: C.white },
      shadow: { type: "outer", color: "000000", blur: 6, offset: 2, angle: 135, opacity: 0.12 },
      line: { color: "DDE3EC", pt: 0.8 }
    });
    sl.addShape(pres.shapes.RECTANGLE, {
      x, y: 2.55, w: 2.95, h: 0.1,
      fill: { color: f.color }, line: { color: f.color }
    });
    sl.addText(f.icon, { x: x + 0.1, y: 2.68, w: 0.6, h: 0.7, fontSize: 26 });
    sl.addText(f.title, {
      x: x + 0.1, y: 3.35, w: 2.75, h: 0.9,
      fontSize: 13, bold: true, color: C.navy, fontFace: "Calibri", valign: "top"
    });
  });

  // Two column bullets
  addCard(sl, 0.35, 4.55, 6.1, 2.7, "Why Neonates Differ", C.navy, [
    "Immature, incomplete synaptic connections",
    "Incomplete corticocortical myelination prevents bihemispheric spread",
    "No classic generalized tonic-clonic seizures",
    "Electroclinical dissociation common (EEG ≠ clinical signs)",
    "Normal newborn movements can mimic seizures",
  ], 13);

  addCard(sl, 6.65, 4.55, 6.3, 2.7, "Key Clinical Facts", C.teal, [
    "Occur in first 28 days of life",
    "Incidence: ~1–5 per 1,000 live births",
    "EEG confirmation mandatory for diagnosis",
    "Represent common manifestation of neonatal brain injury",
    "Timing of onset informs etiology",
  ], 13);
}

// ════════════════════════════════════════════════════════════════════════════
// SLIDE 4 — PATHOPHYSIOLOGY
// ════════════════════════════════════════════════════════════════════════════
{
  let sl = pres.addSlide();
  addSlideHeader(sl, "Pathophysiology", "Why the immature brain is inherently hyperexcitable");

  // GABA image
  sl.addImage({ data: gabaImg, x: 7.0, y: 1.3, w: 6.0, h: 4.2 });
  sl.addText("Fig: GABA developmental switch — immature vs adult neuron (Bradley & Daroff's Neurology)", {
    x: 7.0, y: 5.55, w: 6.0, h: 0.4,
    fontSize: 10, color: C.mutedText, italic: true, align: "center"
  });

  // Left side content
  sl.addShape(pres.shapes.RECTANGLE, {
    x: 0.3, y: 1.3, w: 6.5, h: 5.9,
    fill: { color: C.white },
    shadow: { type: "outer", color: "000000", blur: 5, offset: 2, angle: 135, opacity: 0.10 },
    line: { color: "DDE3EC", pt: 0.8 }
  });

  sl.addText("The GABA Paradox in Neonates", {
    x: 0.45, y: 1.4, w: 6.2, h: 0.5,
    fontSize: 17, bold: true, color: C.navy, fontFace: "Calibri"
  });

  const rows = [
    ["", "Immature Neuron", "Adult Neuron"],
    ["Dominant transporter", "NKCC1", "KCC2"],
    ["Intracellular [Cl⁻]", "HIGH", "Low"],
    ["GABA-A activation →", "Cl⁻ efflux → depolarization", "Cl⁻ influx → hyperpolarization"],
    ["Net effect of GABA", "EXCITATION ⚠️", "Inhibition ✓"],
    ["Phenobarbital effect", "Often inadequate / paradoxical", "Effective inhibition"],
  ];
  sl.addTable(rows.map((r, ri) => r.map((cell, ci) => ({
    text: cell,
    options: {
      fill: { color: ri === 0 ? C.navy : (ri % 2 === 0 ? "F0F5FF" : C.white) },
      color: ri === 0 ? C.white : (ci === 1 && ri > 0 ? C.accent : C.darkText),
      bold: ri === 0 || ci === 0,
      fontSize: 12,
      fontFace: "Calibri",
      align: ci === 0 ? "left" : "center",
    }
  }))), {
    x: 0.45, y: 1.95, w: 6.0,
    colW: [2.0, 2.0, 2.0],
    border: { pt: 0.5, color: "DDE3EC" },
    rowH: 0.42
  });

  sl.addText("Clinical Consequences", {
    x: 0.45, y: 4.6, w: 6.2, h: 0.4,
    fontSize: 15, bold: true, color: C.navy, fontFace: "Calibri"
  });
  addBullets(sl, [
    "Developing brain prone to excitatory cascades",
    "Seizures impair cerebral energy metabolism → excitotoxicity",
    "Prolonged seizures → neuronal injury, ATP depletion",
    "Subclinical seizures still cause harm → must treat EEG seizures",
    "NKCC1 blocker bumetanide under investigation as adjunct therapy",
  ], 0.45, 5.05, 6.1, 2.0, { fontSize: 13 });
}

// ════════════════════════════════════════════════════════════════════════════
// SLIDE 5 — SEIZURE TYPES
// ════════════════════════════════════════════════════════════════════════════
{
  let sl = pres.addSlide();
  addSlideHeader(sl, "Types of Neonatal Seizures", "Clinical semiology — how they present");

  const types = [
    {
      name: "Subtle (Most Common ~50%)",
      color: C.accent,
      items: ["Lip smacking / chewing / sucking", "Eye deviation / blinking / staring", "Bicycling / rowing movements", "Apnea episodes", "Autonomic changes (BP, HR)"],
    },
    {
      name: "Focal Clonic",
      color: C.teal,
      items: ["Rhythmic jerking of a limb or face", "Usually conscious / aware", "Correlates with focal cortical discharge", "Most often: face, arm, or leg"],
    },
    {
      name: "Multifocal Clonic",
      color: C.mid,
      items: ["Migrating clonic jerks across body parts", "Not synchronous", "Multiple foci on EEG", "Often associated with metabolic causes"],
    },
    {
      name: "Focal Tonic",
      color: "7C3AED",
      items: ["Sustained posturing of a limb", "Seen in the clinical video", "Focal cortical origin", "May mimic decerebrate posturing"],
    },
    {
      name: "Generalized Tonic",
      color: "B91C1C",
      items: ["Stiffening of entire body", "Extension of all limbs", "Ominous sign — often brainstem release", "Associated with severe encephalopathy"],
    },
    {
      name: "Myoclonic",
      color: "D97706",
      items: ["Rapid single or repetitive jerks", "Fragmental or massive", "Early-onset → poor prognosis", "Burst-suppression on EEG → encephalopathy"],
    },
  ];

  types.forEach((t, i) => {
    const col = i % 3;
    const row = Math.floor(i / 3);
    const x = 0.3 + col * 4.3;
    const y = 1.35 + row * 3.0;
    const w = 4.1;
    const h = 2.85;
    addCard(sl, x, y, w, h, t.name, t.color, t.items, 12);
  });

  sl.addText("⚠️  Up to 80% of electrographic neonatal seizures have NO clinical manifestation — EEG confirmation is mandatory", {
    x: 0.3, y: 7.15, w: 12.7, h: 0.33,
    fontSize: 12, color: C.white, bold: true, align: "center",
    fill: { color: C.accent }, fontFace: "Calibri"
  });
}

// ════════════════════════════════════════════════════════════════════════════
// SLIDE 6 — ETIOLOGY
// ════════════════════════════════════════════════════════════════════════════
{
  let sl = pres.addSlide();
  addSlideHeader(sl, "Etiology of Neonatal Seizures", "Timing of onset is key — almost always acute symptomatic");

  // Etiology by day image
  sl.addImage({ data: etiologyImg, x: 0.3, y: 1.35, w: 7.8, h: 3.5 });
  sl.addText("Fig: Common etiologies of neonatal seizures by day of life (Bradley & Daroff's Neurology in Clinical Practice)", {
    x: 0.3, y: 4.9, w: 7.8, h: 0.35,
    fontSize: 10, color: C.mutedText, italic: true, align: "center"
  });

  // Etiology list right
  const etiologies = [
    { cause: "Hypoxic-Ischemic Encephalopathy (HIE)", pct: "~50% in term", color: C.accent },
    { cause: "Intracranial Hemorrhage (IVH)", pct: "~30% in preterm", color: "DC2626" },
    { cause: "Perinatal Arterial Stroke", pct: "5-10%", color: C.teal },
    { cause: "Metabolic (Hypoglycemia, Hypocalcemia)", pct: "Onset Day 2-7", color: C.mid },
    { cause: "CNS Infection (GBS, E.coli, HSV)", pct: "Onset Day 3-7", color: "7C3AED" },
    { cause: "Inborn Errors of Metabolism", pct: "Later onset", color: "D97706" },
    { cause: "Structural/Cortical Dysplasia", pct: "5-10%", color: "059669" },
    { cause: "Genetic Channelopathies (KCNQ2/3)", pct: "Benign or severe", color: C.navy },
  ];

  etiologies.forEach((e, i) => {
    const y = 1.35 + i * 0.75;
    sl.addShape(pres.shapes.RECTANGLE, {
      x: 8.4, y, w: 4.6, h: 0.65,
      fill: { color: C.white },
      shadow: { type: "outer", color: "000000", blur: 3, offset: 1, angle: 135, opacity: 0.08 },
      line: { color: "DDE3EC", pt: 0.5 }
    });
    sl.addShape(pres.shapes.RECTANGLE, {
      x: 8.4, y, w: 0.1, h: 0.65,
      fill: { color: e.color }, line: { color: e.color }
    });
    sl.addText(e.cause, {
      x: 8.6, y: y + 0.04, w: 3.2, h: 0.35,
      fontSize: 12, bold: true, color: C.darkText, fontFace: "Calibri", valign: "top", margin: 0
    });
    sl.addText(e.pct, {
      x: 8.6, y: y + 0.36, w: 3.4, h: 0.22,
      fontSize: 10, color: e.color, fontFace: "Calibri", italic: true, margin: 0
    });
  });

  // Treatable causes callout
  sl.addShape(pres.shapes.RECTANGLE, {
    x: 0.3, y: 5.3, w: 7.8, h: 1.9,
    fill: { color: "FFF7ED" }, line: { color: C.gold, pt: 1.5 }
  });
  sl.addText("⭐  Treatable Metabolic Causes (Must Not Miss)", {
    x: 0.45, y: 5.35, w: 7.5, h: 0.38,
    fontSize: 13, bold: true, color: "92400E", fontFace: "Calibri"
  });
  addBullets(sl, [
    "Pyridoxine (B6) deficiency → 100 mg IV pyridoxine (may stop seizures immediately)",
    "Biotinidase deficiency → biotin supplementation",
    "Hypoglycemia → IV dextrose | Hypocalcemia → IV calcium gluconate",
  ], 0.45, 5.77, 7.6, 1.35, { fontSize: 12, color: "92400E" });
}

// ════════════════════════════════════════════════════════════════════════════
// SLIDE 7 — GENETIC & EPILEPSY SYNDROMES
// ════════════════════════════════════════════════════════════════════════════
{
  let sl = pres.addSlide();
  addSlideHeader(sl, "Neonatal Epilepsy Syndromes", "Genetic channelopathies & early epileptic encephalopathies");

  const syndromes = [
    {
      name: "Benign Familial Neonatal Epilepsy",
      color: "059669",
      items: [
        "Autosomal dominant — KCNQ2, KCNQ3, SCN2A mutations",
        "Onset: first week of life",
        "Resolves within first year — normal neurodevelopment",
        "Non-familial cases: benign neonatal seizures (onset day 4-6)",
        "Treatment: sodium channel blockers",
      ]
    },
    {
      name: "Ohtahara Syndrome",
      color: C.accent,
      items: [
        "Severe early epileptic encephalopathy",
        "Intractable tonic seizures",
        "Burst-suppression pattern on EEG",
        "Genetic abnormalities (multiple loci)",
        "Poor prognosis — evolves to West / Lennox-Gastaut",
      ]
    },
    {
      name: "Early Myoclonic Encephalopathy",
      color: "B91C1C",
      items: [
        "Erratic focal myoclons shifting around body",
        "Asynchronous pattern",
        "Burst-suppression on EEG",
        "Particularly ominous prognosis",
        "Often caused by metabolic/structural insults",
      ]
    },
    {
      name: "Pyridoxine-Dependent Epilepsy",
      color: C.gold,
      items: [
        "ALDH7A1 (antiquitin) gene mutations",
        "Can cause seizures in utero",
        "Dramatically responds to IV pyridoxine 100 mg",
        "Also: folinic acid-responsive variant",
        "Biomarker: elevated urinary AASA, CSF pipecolic acid",
      ]
    },
  ];

  syndromes.forEach((s, i) => {
    const col = i % 2;
    const row = Math.floor(i / 2);
    addCard(sl, 0.3 + col * 6.5, 1.35 + row * 2.9, 6.25, 2.75, s.name, s.color, s.items, 12);
  });

  sl.addText("Other metabolic encephalopathies: Nonketotic hyperglycinemia · Maple syrup urine disease · Peroxisomal biogenesis defects · Sulfite oxidase deficiency · Menkes disease", {
    x: 0.3, y: 7.1, w: 12.7, h: 0.38,
    fontSize: 11, color: C.white, align: "center",
    fill: { color: C.navy }, fontFace: "Calibri"
  });
}

// ════════════════════════════════════════════════════════════════════════════
// SLIDE 8 — DIAGNOSIS
// ════════════════════════════════════════════════════════════════════════════
{
  let sl = pres.addSlide();
  addSlideHeader(sl, "Diagnosis & Workup", "EEG is the gold standard — clinical observation alone is insufficient");

  // EEG callout
  sl.addShape(pres.shapes.RECTANGLE, {
    x: 0.3, y: 1.35, w: 12.7, h: 0.85,
    fill: { color: "FFF1F2" }, line: { color: C.accent, pt: 1.5 }
  });
  sl.addText([
    { text: "Key Principle: ", options: { bold: true, color: C.accent, fontSize: 15 } },
    { text: "Up to 80% of electrographic neonatal seizures have no clinical manifestation (electroclinical dissociation). Continuous EEG or amplitude-integrated EEG (aEEG) is mandatory for accurate diagnosis and treatment monitoring.", options: { color: C.darkText, fontSize: 14 } }
  ], { x: 0.5, y: 1.4, w: 12.3, h: 0.75, valign: "middle", fontFace: "Calibri" });

  const workup = [
    {
      cat: "Immediate Bedside",
      color: C.accent,
      items: ["Blood glucose (correct hypoglycemia instantly)", "Electrolytes: Na⁺, Ca²⁺, Mg²⁺", "EEG / continuous aEEG monitoring"],
    },
    {
      cat: "Blood Tests",
      color: C.teal,
      items: ["CBC, blood culture", "Lactate, ammonia", "Serum amino acids", "Coagulation profile"],
    },
    {
      cat: "CSF Analysis",
      color: C.mid,
      items: ["Cell count, protein, glucose", "Gram stain & culture", "HSV PCR — start acyclovir empirically", "CSF amino acids (pipecolic acid)"],
    },
    {
      cat: "Neuroimaging",
      color: "7C3AED",
      items: ["Cranial ultrasound — IVH (first-line in preterm)", "MRI brain — best for full characterization", "CT scan — if NAT, hemorrhage, infarct suspected"],
    },
    {
      cat: "Metabolic Screen",
      color: "D97706",
      items: ["Urine organic acids", "Plasma amino acids", "Biotinidase assay", "Urine AASA (pyridoxine deficiency)"],
    },
    {
      cat: "Genetic Testing",
      color: C.navy,
      items: ["Next-generation sequencing panel", "If seizures of unknown etiology", "KCNQ2/3, SCN2A, ALDH7A1 genes", "Chromosomal microarray"],
    },
  ];

  workup.forEach((w, i) => {
    const col = i % 3;
    const row = Math.floor(i / 3);
    addCard(sl, 0.3 + col * 4.25, 2.4 + row * 2.45, 4.05, 2.3, w.cat, w.color, w.items, 12);
  });

  sl.addText("Differential Diagnosis: Jitteriness (stimulus-sensitive, suppressed by holding) · Benign sleep myoclonus · Hyperekplexia · Normal newborn startles", {
    x: 0.3, y: 7.1, w: 12.7, h: 0.38,
    fontSize: 11, color: C.white, align: "center",
    fill: { color: C.teal }, fontFace: "Calibri"
  });
}

// ════════════════════════════════════════════════════════════════════════════
// SLIDE 9 — MANAGEMENT ALGORITHM
// ════════════════════════════════════════════════════════════════════════════
{
  let sl = pres.addSlide();
  addSlideHeader(sl, "Management Algorithm", "Stepwise approach — Hospital for Sick Children (Toronto) Protocol");

  // Algorithm image
  sl.addImage({ data: mgmtAlgoImg, x: 0.3, y: 1.35, w: 5.5, h: 5.8 });
  sl.addText("Fig: Neonatal Seizure Management Algorithm (adapted — Bradley & Daroff's Neurology)", {
    x: 0.3, y: 7.1, w: 5.5, h: 0.35,
    fontSize: 10, color: C.mutedText, italic: true, align: "center"
  });

  // Step-by-step right
  const steps = [
    { step: "Step 1 — Correct Reversible Causes", color: "059669", items: ["IV Dextrose → hypoglycemia", "IV Calcium gluconate → hypocalcemia", "IV Magnesium sulfate → hypomagnesemia", "Check & normalize Na⁺"] },
    { step: "Step 2 — First-Line AED", color: C.teal, items: ["Lorazepam 0.1 mg/kg IV (repeat x1)"] },
    { step: "Step 3 — Second-Line AED", color: C.mid, items: ["Phenobarbital 20 mg/kg IV loading dose", "Additional 10+10 mg/kg if needed", "Continuous EEG monitoring"] },
    { step: "Step 4 — Consider Empiric Vitamins", color: "D97706", items: ["Pyridoxal phosphate (PLP) 10 mg/kg q8h PO", "Folinic acid 5 mg/kg q24h PO", "(If metabolic epilepsy suspected)"] },
    { step: "Step 5 — Third-Line Options", color: "7C3AED", items: ["Levetiracetam 60 mg/kg IV  OR", "Fosphenytoin 20 mg/kg IV (repeat 10 mg/kg)"] },
    { step: "Step 6 — Refractory Status", color: C.accent, items: ["Midazolam 0.15 mg/kg IV bolus", "Infusion: 2 mcg/kg/min, titrate up to 24 mcg/kg/min"] },
  ];

  steps.forEach((s, i) => {
    const y = 1.35 + i * 1.02;
    sl.addShape(pres.shapes.RECTANGLE, {
      x: 6.1, y, w: 7.0, h: 0.95,
      fill: { color: C.white },
      shadow: { type: "outer", color: "000000", blur: 4, offset: 1, angle: 135, opacity: 0.08 },
      line: { color: "DDE3EC", pt: 0.5 }
    });
    sl.addShape(pres.shapes.RECTANGLE, {
      x: 6.1, y, w: 0.12, h: 0.95,
      fill: { color: s.color }, line: { color: s.color }
    });
    sl.addText(s.step, {
      x: 6.3, y: y + 0.02, w: 6.7, h: 0.32,
      fontSize: 12, bold: true, color: s.color, fontFace: "Calibri", margin: 0
    });
    sl.addText(s.items.join("  ·  "), {
      x: 6.3, y: y + 0.34, w: 6.7, h: 0.55,
      fontSize: 11, color: C.darkText, fontFace: "Calibri", margin: 0, valign: "top"
    });
  });

  sl.addText("Note: Phenobarbital may have paradoxical excitatory effect in neonates due to GABA-chloride immaturity", {
    x: 6.1, y: 7.12, w: 7.0, h: 0.33,
    fontSize: 11, color: "92400E", italic: true, fontFace: "Calibri",
    fill: { color: "FFF7ED" }, align: "center"
  });
}

// ════════════════════════════════════════════════════════════════════════════
// SLIDE 10 — PROGNOSIS
// ════════════════════════════════════════════════════════════════════════════
{
  let sl = pres.addSlide();
  addSlideHeader(sl, "Prognosis & Long-Term Outcomes", "Highly dependent on the underlying etiology");

  const prognosisGroups = [
    {
      group: "HIE Seizures\n(within 24-48h of birth asphyxia)",
      color: C.accent,
      icon: "🔴",
      outcome: "POOR",
      items: ["High neonatal mortality", "~50% of survivors severely disabled", "Cerebral palsy, cognitive impairment", "Risk of post-neonatal epilepsy"],
    },
    {
      group: "Metabolic Causes\n(hypoglycemia, hypocalcemia)",
      color: C.gold,
      icon: "🟡",
      outcome: "VARIABLE",
      items: ["Good if rapidly identified & treated", "Persistent hypoglycemia → brain damage", "Normal outcome possible with prompt care", "Inborn errors → worse if untreated"],
    },
    {
      group: "Benign Familial\nNeonatal Epilepsy",
      color: "059669",
      icon: "🟢",
      outcome: "EXCELLENT",
      items: ["Seizures remit within first year of life", "Normal neurodevelopment expected", "Autosomal dominant — family history", "Rare recurrence in later life"],
    },
    {
      group: "Ohtahara Syndrome /\nEarly Epileptic Encephalopathy",
      color: "B91C1C",
      icon: "🔴",
      outcome: "VERY POOR",
      items: ["Intractable, refractory seizures", "Evolves into West or Lennox-Gastaut", "Severe developmental delay", "Often medication-resistant"],
    },
  ];

  prognosisGroups.forEach((g, i) => {
    const x = 0.3 + (i % 2) * 6.5;
    const y = 1.35 + Math.floor(i / 2) * 2.85;
    const w = 6.25;
    const h = 2.7;
    sl.addShape(pres.shapes.RECTANGLE, {
      x, y, w, h,
      fill: { color: C.white },
      shadow: { type: "outer", color: "000000", blur: 6, offset: 2, angle: 135, opacity: 0.12 },
      line: { color: "DDE3EC", pt: 0.8 }
    });
    sl.addShape(pres.shapes.RECTANGLE, {
      x, y, w, h: 0.5,
      fill: { color: g.color }, line: { color: g.color }
    });
    sl.addText(g.group, {
      x: x + 0.12, y: y + 0.05, w: w - 0.9, h: 0.42,
      fontSize: 12, bold: true, color: C.white, fontFace: "Calibri", margin: 0
    });
    sl.addText(g.outcome, {
      x: x + w - 1.2, y: y + 0.06, w: 1.1, h: 0.35,
      fontSize: 10, bold: true, color: g.color, fontFace: "Calibri",
      fill: { color: C.white }, align: "center", valign: "middle"
    });
    addBullets(sl, g.items, x + 0.12, y + 0.58, w - 0.24, h - 0.68, { fontSize: 12 });
  });

  // Risk factors for epilepsy
  sl.addShape(pres.shapes.RECTANGLE, {
    x: 0.3, y: 7.05, w: 12.7, h: 0.43,
    fill: { color: C.navy }, line: { color: C.navy }
  });
  sl.addText("Risk Factors for Later Epilepsy: Status epilepticus  ·  Severe HIE  ·  Multiple antiepileptics required  ·  Structural brain abnormality", {
    x: 0.3, y: 7.06, w: 12.7, h: 0.4,
    fontSize: 12, color: C.white, bold: true, align: "center", fontFace: "Calibri"
  });
}

// ════════════════════════════════════════════════════════════════════════════
// SLIDE 11 — SUMMARY / CLOSING
// ════════════════════════════════════════════════════════════════════════════
{
  let sl = pres.addSlide();
  sl.background = { color: C.navy };

  sl.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 0, w: 13.3, h: 0.12,
    fill: { color: C.accent }, line: { color: C.accent }
  });
  sl.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 7.38, w: 13.3, h: 0.12,
    fill: { color: C.accent }, line: { color: C.accent }
  });

  sl.addText("KEY TAKEAWAYS", {
    x: 0.5, y: 0.25, w: 12.3, h: 0.7,
    fontSize: 32, bold: true, color: C.white, fontFace: "Calibri", charSpacing: 4, align: "center"
  });
  sl.addShape(pres.shapes.RECTANGLE, {
    x: 5.5, y: 0.95, w: 2.3, h: 0.06,
    fill: { color: C.accent }, line: { color: C.accent }
  });

  const takeaways = [
    { num: "1", text: "Neonatal seizures are the most common neonatal neurological emergency — highest incidence of any age group" },
    { num: "2", text: "Up to 80% are electrographically silent — clinical observation alone misses most seizures; continuous EEG is essential" },
    { num: "3", text: "The immature brain is paradoxically excitable — GABA is excitatory in neonates, making phenobarbital partially ineffective" },
    { num: "4", text: "HIE is the #1 cause (~50% in term neonates); always check correctable metabolic causes first (glucose, calcium, magnesium)" },
    { num: "5", text: "Do not miss treatable causes: pyridoxine deficiency, biotinidase deficiency — give empiric vitamins if unknown etiology" },
    { num: "6", text: "Prognosis depends on etiology — benign familial seizures resolve completely; HIE and encephalopathies carry severe disability risk" },
  ];

  takeaways.forEach((t, i) => {
    const col = i % 2;
    const row = Math.floor(i / 2);
    const x = 0.4 + col * 6.45;
    const y = 1.15 + row * 2.0;
    sl.addShape(pres.shapes.RECTANGLE, {
      x, y, w: 6.25, h: 1.85,
      fill: { color: "0F2E4F" }, line: { color: C.teal, pt: 0.8 }
    });
    sl.addShape(pres.shapes.OVAL, {
      x: x + 0.15, y: y + 0.6, w: 0.55, h: 0.55,
      fill: { color: C.accent }, line: { color: C.accent }
    });
    sl.addText(t.num, {
      x: x + 0.15, y: y + 0.62, w: 0.55, h: 0.5,
      fontSize: 16, bold: true, color: C.white, align: "center", fontFace: "Calibri"
    });
    sl.addText(t.text, {
      x: x + 0.85, y: y + 0.3, w: 5.25, h: 1.25,
      fontSize: 13, color: "D1E4F5", fontFace: "Calibri", valign: "middle"
    });
  });

  sl.addText("Sources: Adams & Victor's Principles of Neurology 12th Ed. · Bradley & Daroff's Neurology in Clinical Practice · Tintinalli's Emergency Medicine · Rosen's Emergency Medicine", {
    x: 0.4, y: 7.1, w: 12.5, h: 0.28,
    fontSize: 9, color: "4A6FA5", italic: true, align: "center", fontFace: "Calibri"
  });
}

// ── Write file ────────────────────────────────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/workspace/neonatal-seizures-ppt/Neonatal_Seizures.pptx" })
  .then(() => console.log("✅ Presentation saved: Neonatal_Seizures.pptx"))
  .catch(err => { console.error("❌ Error:", err); process.exit(1); });
Running Command

cd /home/daytona/workspace/neonatal-seizures-ppt && node build.js 2>&1

Running Command

ls -lh /home/daytona/workspace/neonatal-seizures-ppt/Neonatal_Seizures.pptx

Your presentation is ready! Here's a summary of what's included:

Neonatal Seizures

Presentation · PPTX

11 slides | Wide 16:9 format | Navy/Teal/Red medical palette
SlideContent
1Title Slide — Video thumbnail with play overlay, topic overview
2Clinical Video Observation — Video still + annotated NICU equipment + observed seizure features
3Definition & Overview — Key facts, why neonates differ, key clinical points
4Pathophysiology — GABA paradox table (immature vs adult neuron), NKCC1/KCC2 diagram, consequences
5Types of Neonatal Seizures — 6 seizure type cards (Subtle, Focal Clonic, Multifocal, Tonic, Generalized, Myoclonic)
6Etiology — Etiology-by-day-of-life diagram + 8 causes with timing, treatable causes callout
7Genetic & Epilepsy Syndromes — BFNE, Ohtahara, EME, Pyridoxine-dependent epilepsy
8Diagnosis & Workup — 6-category workup cards, differential diagnosis footer
9Management Algorithm — Full algorithm image + 6-step drug ladder with doses
10Prognosis — 4 outcome groups (HIE, metabolic, benign familial, encephalopathy), risk factors
11Key Takeaways — 6 summary points on dark background
Note on the video: PowerPoint does not support embedded MP4 video playback via this method, but the clinical video thumbnail is shown on slides 1 and 2 with a play button overlay. For live video playback, open the PPTX in PowerPoint, go to slide 2, and use Insert → Video → Video on My PC to embed the .mp4 file directly.

How to reduce the dose of betahistine 16 mg for BPPV pateint

Your credits are exhausted. You can purchase a top-up or subscribe to a plan to continue using Orris. If you're already subscribed, your daily credits will reset tomorrow.

Retry

Your credits are exhausted. You can purchase a top-up or subscribe to a plan to continue using Orris. If you're already subscribed, your daily credits will reset tomorrow.
This is a shared conversation. Sign in to Orris to start your own chat.