Make presentation on headache with detail pathophysiology, symptoms signs clinical features diagnosis and treatment according to neurology textbook and Harrison preferences
mkdir -p /home/daytona/workspace/headache-pptx && ls /home/daytona/workspace/headache-pptx/
~/headache-pptx/headache_presentation.js
const pptxgen = require("pptxgenjs");
const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Headache: A Comprehensive Clinical Overview";
pres.author = "Orris - Based on Harrison's 22E & Adams and Victor's Neurology 12E";
// ── COLOR PALETTE ──────────────────────────────────────────────────────────
const C = {
navy: "0A1628", // dominant dark
indigo: "1B3A6B", // secondary
teal: "1A7A8A", // accent
gold: "E8B84B", // highlight/accent
white: "FFFFFF",
offwhite: "F0F4F8",
lightgray: "D8E2EE",
midgray: "7A8FA6",
red: "C0392B",
green: "1A8A4A",
};
// ── MASTER HELPERS ─────────────────────────────────────────────────────────
function addSlideBg(slide, darkOrLight) {
if (darkOrLight === "dark") {
slide.background = { color: C.navy };
} else {
slide.background = { color: C.offwhite };
}
}
function addHeader(slide, text, y = 0.18) {
slide.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 10, h: 0.72, fill: { color: C.indigo }, line: { color: C.indigo } });
slide.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0.72, w: 10, h: 0.06, fill: { color: C.gold }, line: { color: C.gold } });
slide.addText(text, { x: 0.35, y: y, w: 9.3, h: 0.55, fontSize: 22, bold: true, color: C.white, fontFace: "Calibri", valign: "middle", margin: 0 });
}
function addFooter(slide, source = "Harrison's Principles of Internal Medicine 22E | Adams & Victor's Principles of Neurology 12E") {
slide.addShape(pres.shapes.RECTANGLE, { x: 0, y: 5.4, w: 10, h: 0.225, fill: { color: C.indigo }, line: { color: C.indigo } });
slide.addText(source, { x: 0.2, y: 5.41, w: 9.6, h: 0.2, fontSize: 7.5, color: C.lightgray, fontFace: "Calibri", italic: true, valign: "middle", margin: 0 });
}
function bullet(text, opts = {}) {
return { text, options: { bullet: { type: "bullet", indent: 10 }, breakLine: true, fontSize: opts.fontSize || 13, color: opts.color || C.navy, bold: opts.bold || false, fontFace: "Calibri", ...opts } };
}
function subbullet(text, opts = {}) {
return { text: " " + text, options: { bullet: { type: "bullet", indent: 20 }, breakLine: true, fontSize: opts.fontSize || 11.5, color: opts.color || C.indigo, fontFace: "Calibri", ...opts } };
}
function sectionDivider(slide, title, subtitle = "") {
slide.background = { color: C.navy };
// Left accent bar
slide.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 0.18, h: 5.625, fill: { color: C.gold }, line: { color: C.gold } });
slide.addShape(pres.shapes.RECTANGLE, { x: 0.18, y: 0, w: 9.82, h: 5.625, fill: { color: C.navy }, line: { color: C.navy } });
slide.addText(title, { x: 0.5, y: 1.9, w: 9.0, h: 1.0, fontSize: 38, bold: true, color: C.gold, fontFace: "Calibri", align: "center", valign: "middle" });
if (subtitle) {
slide.addText(subtitle, { x: 0.5, y: 2.9, w: 9.0, h: 0.6, fontSize: 18, color: C.lightgray, fontFace: "Calibri", align: "center", italic: true });
}
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 1 – TITLE
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
s.background = { color: C.navy };
// Decorative bar at top
s.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 10, h: 0.12, fill: { color: C.gold }, line: { color: C.gold } });
// Large left accent strip
s.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0.12, w: 0.18, h: 5.5, fill: { color: C.teal }, line: { color: C.teal } });
// Main title
s.addText("HEADACHE", { x: 0.5, y: 1.1, w: 9.2, h: 1.4, fontSize: 60, bold: true, color: C.white, fontFace: "Calibri", align: "center", charSpacing: 8 });
// Subtitle
s.addText("A Comprehensive Clinical Overview", { x: 0.5, y: 2.55, w: 9.2, h: 0.55, fontSize: 22, color: C.gold, fontFace: "Calibri", align: "center", italic: true });
// Divider line
s.addShape(pres.shapes.RECTANGLE, { x: 2.5, y: 3.15, w: 5, h: 0.045, fill: { color: C.teal }, line: { color: C.teal } });
// Sources
s.addText("Based on:", { x: 0.5, y: 3.35, w: 9.2, h: 0.3, fontSize: 13, color: C.midgray, fontFace: "Calibri", align: "center" });
s.addText("Harrison's Principles of Internal Medicine, 22nd Edition (2025, McGraw-Hill)\nAdams and Victor's Principles of Neurology, 12th Edition", {
x: 0.5, y: 3.65, w: 9.2, h: 0.75, fontSize: 14, color: C.lightgray, fontFace: "Calibri", align: "center", italic: true
});
// Bottom bar
s.addShape(pres.shapes.RECTANGLE, { x: 0, y: 5.4, w: 10, h: 0.225, fill: { color: C.indigo }, line: { color: C.indigo } });
s.addText("Neurology & Internal Medicine Reference", { x: 0.2, y: 5.41, w: 9.6, h: 0.2, fontSize: 9, color: C.midgray, fontFace: "Calibri", align: "center", italic: true });
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 2 – OUTLINE / TABLE OF CONTENTS
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
addSlideBg(s, "light");
addHeader(s, "Presentation Outline");
addFooter(s);
const topics = [
["01", "Definition & Epidemiology"],
["02", "Classification (IHS / ICHD-3)"],
["03", "Pathophysiology"],
["04", "Red Flag Signs (SNOOP4)"],
["05", "Clinical Features – Migraine"],
["06", "Clinical Features – Tension-Type & Cluster"],
["07", "Diagnosis & Investigations"],
["08", "Treatment – Acute (Migraine)"],
["09", "Treatment – Preventive (Migraine)"],
["10", "Treatment – Tension-Type & Cluster"],
["11", "Secondary Headaches"],
["12", "Summary"],
];
const cols = [topics.slice(0, 6), topics.slice(6)];
cols.forEach((col, ci) => {
col.forEach(([num, label], ri) => {
const x = ci === 0 ? 0.35 : 5.25;
const y = 0.9 + ri * 0.72;
s.addShape(pres.shapes.ROUNDED_RECTANGLE, { x, y, w: 4.6, h: 0.58, fill: { color: ri % 2 === 0 ? C.indigo : C.teal }, rectRadius: 0.08, line: { color: "none" } });
s.addText([
{ text: num + " ", options: { bold: true, color: C.gold, fontSize: 13 } },
{ text: label, options: { bold: false, color: C.white, fontSize: 13 } }
], { x: x + 0.15, y: y + 0.1, w: 4.3, h: 0.38, fontFace: "Calibri", valign: "middle", margin: 0 });
});
});
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 3 – SECTION DIVIDER: DEFINITION & CLASSIFICATION
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
sectionDivider(s, "Definition & Classification", "Section 01 – 02");
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 4 – DEFINITION & EPIDEMIOLOGY
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
addSlideBg(s, "light");
addHeader(s, "Definition & Epidemiology");
addFooter(s);
// Left column – definition box
s.addShape(pres.shapes.RECTANGLE, { x: 0.3, y: 0.92, w: 4.6, h: 1.1, fill: { color: C.indigo }, line: { color: C.gold, pt: 2 } });
s.addText("Definition", { x: 0.35, y: 0.92, w: 4.5, h: 0.32, fontSize: 13, bold: true, color: C.gold, fontFace: "Calibri", valign: "middle", margin: 4 });
s.addText("Headache is pain or discomfort in the head, scalp, or neck. It ranks among the most common neurological complaints and is caused by activation of pain-sensitive structures in and around the skull and brain.", {
x: 0.35, y: 1.22, w: 4.5, h: 0.75, fontSize: 11, color: C.white, fontFace: "Calibri", valign: "top", margin: 4
});
// Left column – epidemiology
s.addText("Epidemiology", { x: 0.3, y: 2.1, w: 4.6, h: 0.3, fontSize: 14, bold: true, color: C.indigo, fontFace: "Calibri" });
s.addText([
bullet("~50% of adults experience headache in any given year (Global Burden of Disease)"),
bullet("Migraine: ~15% lifetime prevalence; F > M (3:1)"),
bullet("Tension-type headache: most common type (~40% lifetime prevalence)"),
bullet("Cluster headache: rare, M > F (~5:1); 0.1% prevalence"),
bullet("Headache is the 3rd leading cause of disability worldwide (GBD 2019)"),
], { x: 0.3, y: 2.42, w: 4.6, h: 2.8, fontFace: "Calibri", valign: "top" });
// Right column – pain-sensitive structures
s.addShape(pres.shapes.ROUNDED_RECTANGLE, { x: 5.2, y: 0.92, w: 4.5, h: 4.3, fill: { color: C.navy }, rectRadius: 0.1, line: { color: C.teal, pt: 1.5 } });
s.addText("Pain-Sensitive Structures", { x: 5.3, y: 1.0, w: 4.3, h: 0.3, fontSize: 13, bold: true, color: C.gold, fontFace: "Calibri", valign: "middle" });
s.addText([
bullet("Scalp, skin & subcutaneous tissues", { color: C.white, fontSize: 12 }),
bullet("Arteries & veins of the scalp and dura", { color: C.white, fontSize: 12 }),
bullet("Dural sinuses & their tributaries", { color: C.white, fontSize: 12 }),
bullet("Middle meningeal and dural arteries", { color: C.white, fontSize: 12 }),
bullet("Basal meninges", { color: C.white, fontSize: 12 }),
bullet("Cranial nerves V, VII, IX, X & upper cervical nerves C2–C3", { color: C.white, fontSize: 12 }),
{ text: "\n", options: { breakLine: true, fontSize: 6 } },
{ text: "NOT pain-sensitive:", options: { bold: true, color: C.gold, fontSize: 12, breakLine: true } },
bullet("Brain parenchyma itself", { color: C.lightgray, fontSize: 11 }),
bullet("Ependymal lining & choroid plexus", { color: C.lightgray, fontSize: 11 }),
bullet("Most of the pia-arachnoid", { color: C.lightgray, fontSize: 11 }),
], { x: 5.3, y: 1.35, w: 4.2, h: 3.7, fontFace: "Calibri", valign: "top" });
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 5 – CLASSIFICATION (IHS / ICHD-3)
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
addSlideBg(s, "light");
addHeader(s, "Classification of Headache – ICHD-3 (IHS)");
addFooter(s);
// Part 1 – Primary
s.addShape(pres.shapes.ROUNDED_RECTANGLE, { x: 0.25, y: 0.9, w: 3.0, h: 4.35, fill: { color: C.indigo }, rectRadius: 0.1, line: { color: C.gold, pt: 2 } });
s.addText("PRIMARY HEADACHES", { x: 0.3, y: 0.92, w: 2.9, h: 0.38, fontSize: 12, bold: true, color: C.gold, fontFace: "Calibri", align: "center", valign: "middle" });
s.addText([
bullet("Migraine", { color: C.white, fontSize: 11 }),
subbullet("With / without aura", { color: C.lightgray }),
subbullet("Chronic migraine", { color: C.lightgray }),
bullet("Tension-type headache (TTH)", { color: C.white, fontSize: 11 }),
subbullet("Episodic / Chronic TTH", { color: C.lightgray }),
bullet("Trigeminal autonomic cephalalgias (TAC)", { color: C.white, fontSize: 11 }),
subbullet("Cluster headache", { color: C.lightgray }),
subbullet("Paroxysmal hemicrania", { color: C.lightgray }),
subbullet("SUNCT/SUNA", { color: C.lightgray }),
bullet("Other primary headaches", { color: C.white, fontSize: 11 }),
subbullet("Primary cough headache", { color: C.lightgray }),
subbullet("Primary exercise headache", { color: C.lightgray }),
subbullet("Hypnic headache", { color: C.lightgray }),
], { x: 0.3, y: 1.32, w: 2.9, h: 3.8, fontFace: "Calibri", valign: "top" });
// Part 2 – Secondary
s.addShape(pres.shapes.ROUNDED_RECTANGLE, { x: 3.55, y: 0.9, w: 3.0, h: 4.35, fill: { color: C.teal }, rectRadius: 0.1, line: { color: C.white, pt: 1 } });
s.addText("SECONDARY HEADACHES", { x: 3.6, y: 0.92, w: 2.9, h: 0.38, fontSize: 12, bold: true, color: C.white, fontFace: "Calibri", align: "center", valign: "middle" });
s.addText([
bullet("Attributed to head/neck trauma", { color: C.white, fontSize: 11 }),
bullet("Cranial or cervical vascular disorder", { color: C.white, fontSize: 11 }),
subbullet("SAH, CVT, dissection, stroke", { color: C.offwhite }),
bullet("Non-vascular intracranial disorder", { color: C.white, fontSize: 11 }),
subbullet("Raised ICP, CSF hypotension, neoplasm", { color: C.offwhite }),
bullet("Substance use / withdrawal", { color: C.white, fontSize: 11 }),
subbullet("Caffeine, analgesic overuse", { color: C.offwhite }),
bullet("Infection", { color: C.white, fontSize: 11 }),
subbullet("Meningitis, encephalitis", { color: C.offwhite }),
bullet("Homeostasis disorders", { color: C.white, fontSize: 11 }),
subbullet("Hypertension, hypoxia", { color: C.offwhite }),
bullet("Cranial nerve / eye disorders", { color: C.white, fontSize: 11 }),
], { x: 3.6, y: 1.32, w: 2.9, h: 3.8, fontFace: "Calibri", valign: "top" });
// Part 3 – Neuropathies
s.addShape(pres.shapes.ROUNDED_RECTANGLE, { x: 6.85, y: 0.9, w: 2.9, h: 4.35, fill: { color: C.navy }, rectRadius: 0.1, line: { color: C.teal, pt: 1.5 } });
s.addText("CRANIAL NEURALGIAS", { x: 6.9, y: 0.92, w: 2.8, h: 0.38, fontSize: 12, bold: true, color: C.gold, fontFace: "Calibri", align: "center", valign: "middle" });
s.addText([
bullet("Trigeminal neuralgia", { color: C.white, fontSize: 11 }),
bullet("Occipital neuralgia", { color: C.white, fontSize: 11 }),
bullet("Glossopharyngeal neuralgia", { color: C.white, fontSize: 11 }),
bullet("Nervus intermedius neuralgia", { color: C.white, fontSize: 11 }),
{ text: "\nFrequency", options: { bold: true, color: C.gold, fontSize: 12, breakLine: true } },
bullet("TTH: ~40%", { color: C.lightgray, fontSize: 11 }),
bullet("Migraine: ~15%", { color: C.lightgray, fontSize: 11 }),
bullet("Cluster: ~0.1%", { color: C.lightgray, fontSize: 11 }),
bullet("Secondary: ~10%", { color: C.lightgray, fontSize: 11 }),
], { x: 6.9, y: 1.32, w: 2.75, h: 3.8, fontFace: "Calibri", valign: "top" });
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 6 – SECTION DIVIDER: PATHOPHYSIOLOGY
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
sectionDivider(s, "Pathophysiology", "Section 03");
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 7 – PATHOPHYSIOLOGY OF MIGRAINE (1)
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
addSlideBg(s, "light");
addHeader(s, "Pathophysiology of Migraine – Trigeminovascular System");
addFooter(s);
// Central concept box
s.addShape(pres.shapes.ROUNDED_RECTANGLE, { x: 0.25, y: 0.85, w: 9.5, h: 0.65, fill: { color: C.indigo }, rectRadius: 0.08, line: { color: C.gold, pt: 1 } });
s.addText("Core concept: Migraine results from activation of the trigeminovascular system — pain fibres from the trigeminal ganglion innervating dural and pial blood vessels — combined with cortical excitability changes.", {
x: 0.3, y: 0.88, w: 9.3, h: 0.55, fontSize: 11.5, color: C.white, fontFace: "Calibri", italic: true, valign: "middle"
});
// Column 1
s.addShape(pres.shapes.RECTANGLE, { x: 0.25, y: 1.6, w: 0.08, h: 3.65, fill: { color: C.gold }, line: { color: C.gold } });
s.addText("Cortical Spreading Depression (CSD)", { x: 0.45, y: 1.6, w: 4.3, h: 0.3, fontSize: 13, bold: true, color: C.indigo, fontFace: "Calibri" });
s.addText([
bullet("Wave of neuronal and glial depolarisation spreading at 2–3 mm/min across cortex (Leão 1944)"),
bullet("Correlates anatomically and temporally with the visual aura (Lashley calculations)"),
bullet("Oligemia follows CSD: reduced CBF spread from occipital cortex forward (Olesen; PET; MRI)"),
bullet("CSD activates trigeminovascular pain fibres, triggering the headache phase"),
bullet("Does NOT respect arterial territories — distinguishes from ischaemia"),
], { x: 0.45, y: 1.92, w: 4.3, h: 3.3, fontFace: "Calibri", valign: "top" });
// Vertical divider
s.addShape(pres.shapes.RECTANGLE, { x: 4.95, y: 1.58, w: 0.05, h: 3.7, fill: { color: C.lightgray }, line: { color: C.lightgray } });
// Column 2
s.addShape(pres.shapes.RECTANGLE, { x: 5.1, y: 1.6, w: 0.08, h: 3.65, fill: { color: C.teal }, line: { color: C.teal } });
s.addText("Trigeminovascular Activation & CGRP", { x: 5.3, y: 1.6, w: 4.4, h: 0.3, fontSize: 13, bold: true, color: C.teal, fontFace: "Calibri" });
s.addText([
bullet("Trigeminal nerve fibres (Aδ and C fibres) innervate meningeal vessels"),
bullet("Activation → release of CGRP, Substance P, neurokinin A from perivascular fibres"),
bullet("Neurogenic inflammation: plasma extravasation, mast cell degranulation, vasodilation"),
bullet("Signal relayed via trigeminal ganglion → trigeminocervical complex (TCC) → thalamus → cortex"),
bullet("CGRP levels ↑ in jugular blood during attacks; normalised by sumatriptan (Harrison's 22E)"),
bullet("Anti-CGRP monoclonal antibodies highly effective in migraine prevention (mechanism confirmation)"),
], { x: 5.3, y: 1.92, w: 4.4, h: 3.3, fontFace: "Calibri", valign: "top" });
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 8 – PATHOPHYSIOLOGY (2): CENTRAL SENSITISATION & GENETICS
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
addSlideBg(s, "light");
addHeader(s, "Pathophysiology – Central Sensitisation, Brainstem & Genetics");
addFooter(s);
// Top row: 3 boxes
const boxes = [
{ x: 0.25, color: C.indigo, title: "Central Sensitisation", items: [
"Second-order neurons in TCC become sensitised → allodynia (cutaneous allodynia in 70% of migraineurs)",
"Third-order (thalamic) sensitisation → widespread allodynia",
"Explains why triptans are less effective once allodynia starts",
"Drives chronification when attacks are frequent and undertreated",
]},
{ x: 3.55, color: C.teal, title: "Brainstem & Hypothalamus", items: [
"PET: dorsal raphe nucleus, locus coeruleus, nucleus raphe magnus activated during attacks",
"Modulate trigeminovascular input (descending modulation)",
"Hypothalamic activation in the PREMONITORY phase (hours before pain)",
"Explains prodromal symptoms: yawning, food craving, fatigue, mood changes",
'"Migraine generator" — activity persists even after pain resolves',
]},
{ x: 6.85, color: C.navy, title: "Genetics & Triggers", items: [
"~40% familial incidence (with aura); polygenic in most forms",
"~40 susceptibility loci identified; many in vascular smooth muscle genes",
"Familial Hemiplegic Migraine: CACNA1A, ATP1A2, SCN1A — ion channel mutations",
"Triggers: oestrogen withdrawal, sleep changes, fasting, stress let-down, certain foods, weather",
"Overresponsiveness to environmental change, NOT excess stress per se (Harrison's 22E)",
]},
];
boxes.forEach(({ x, color, title, items }) => {
s.addShape(pres.shapes.ROUNDED_RECTANGLE, { x, y: 0.88, w: 2.9, h: 4.37, fill: { color }, rectRadius: 0.1, line: { color: C.gold, pt: 1.5 } });
s.addText(title, { x: x + 0.08, y: 0.9, w: 2.75, h: 0.38, fontSize: 12, bold: true, color: C.gold, fontFace: "Calibri", align: "center", valign: "middle" });
s.addShape(pres.shapes.RECTANGLE, { x: x + 0.3, y: 1.3, w: 2.3, h: 0.04, fill: { color: C.gold }, line: { color: C.gold } });
const bulletItems = items.map((t, i) => ({
text: "• " + t,
options: { breakLine: true, fontSize: 10.5, color: i === 0 ? C.white : C.lightgray, fontFace: "Calibri" }
}));
s.addText(bulletItems, { x: x + 0.1, y: 1.38, w: 2.75, h: 3.75, fontFace: "Calibri", valign: "top" });
});
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 9 – SECTION DIVIDER: RED FLAGS
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
sectionDivider(s, "Red Flag Signs", "Section 04 – SNOOP4 Mnemonic");
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 10 – RED FLAGS (SNOOP4)
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
addSlideBg(s, "dark");
addHeader(s, "Red Flag Signs in Headache – SNOOP4 Mnemonic");
addFooter(s);
const flags = [
{ letter: "S", label: "Systemic symptoms / disease", detail: "Fever, weight loss, malignancy, HIV/immunosuppression, meningism → consider meningitis, SAH, metastases" },
{ letter: "N", label: "Neurological signs/symptoms", detail: "Focal deficits, seizure, altered consciousness, papilloedema → space-occupying lesion, CVT, stroke" },
{ letter: "O", label: "Onset (sudden/thunderclap)", detail: "\"Worst headache of life\" reaching peak within seconds → Subarachnoid Haemorrhage until proven otherwise" },
{ letter: "O", label: "Older age (>50 yrs, new headache)", detail: "New headache >50 yrs → giant cell arteritis, intracranial malignancy; check ESR/CRP, temporal artery biopsy" },
{ letter: "P", label: "Pattern change / Progressive", detail: "Change in established pattern, increasing frequency, severity or refractory headache → raised ICP, tumour" },
{ letter: "P", label: "Positional aggravation", detail: "Worse lying down → raised ICP; worse standing → CSF hypotension (post-LP, spontaneous)" },
{ letter: "P", label: "Precipitated by Valsalva/exertion", detail: "Cough, Valsalva, exertion, sexual activity → posterior fossa lesion, Arnold–Chiari malformation" },
{ letter: "P", label: "Post-traumatic onset", detail: "Following head injury → subdural/extradural haematoma, cerebral contusion" },
];
flags.forEach(({ letter, label, detail }, i) => {
const col = i < 4 ? 0 : 1;
const row = i % 4;
const x = col === 0 ? 0.2 : 5.1;
const y = 0.9 + row * 1.12;
s.addShape(pres.shapes.RECTANGLE, { x, y, w: 0.44, h: 0.88, fill: { color: C.red }, line: { color: C.red } });
s.addText(letter, { x, y: y + 0.08, w: 0.44, h: 0.72, fontSize: 28, bold: true, color: C.white, fontFace: "Calibri", align: "center", valign: "middle" });
s.addShape(pres.shapes.RECTANGLE, { x: x + 0.44, y, w: 4.5, h: 0.88, fill: { color: C.indigo }, line: { color: C.indigo } });
s.addText(label, { x: x + 0.5, y: y + 0.03, w: 4.3, h: 0.27, fontSize: 11.5, bold: true, color: C.gold, fontFace: "Calibri", valign: "middle" });
s.addText(detail, { x: x + 0.5, y: y + 0.3, w: 4.3, h: 0.55, fontSize: 9.5, color: C.lightgray, fontFace: "Calibri", valign: "top" });
});
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 11 – SECTION DIVIDER: CLINICAL FEATURES
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
sectionDivider(s, "Clinical Features", "Section 05–06 – Migraine, TTH, Cluster");
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 12 – MIGRAINE: PHASES & SYMPTOMS
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
addSlideBg(s, "light");
addHeader(s, "Migraine – Clinical Features & Phases");
addFooter(s);
const phases = [
{ name: "PRODROME\n(hrs–days before)", color: C.navy, items: [
"Yawning, food craving",
"Fatigue, mood changes",
"Neck stiffness, polyuria",
"Photophobia, phonophobia",
"Occurs in ~60% of patients",
]},
{ name: "AURA\n(20–60 min)", color: C.indigo, items: [
"Visual (most common): scintillating scotoma, fortification spectra, homonymous hemianopia",
"Sensory: hemisensory pins & needles, numbness",
"Language: dysphasia (rare)",
"Motor: rare (hemiplegic migraine)",
"CSD correlate (2–3 mm/min spread)",
]},
{ name: "HEADACHE\n(4–72 hrs)", color: C.teal, items: [
"Unilateral in 60% (bilateral in ~40%)",
"Pulsatile/throbbing quality",
"Moderate to severe intensity",
"Aggravated by routine activity",
"Nausea ± vomiting",
"Photophobia + phonophobia",
"Prefers quiet, dark room",
]},
{ name: "POSTDROME\n(hrs–day after)", color: C.midgray, items: [
"Fatigue, cognitive fog",
'"Hangover" sensation',
"Scalp tenderness (allodynia)",
"Mood changes",
"Can last up to 48 hours",
]},
];
phases.forEach(({ name, color, items }, i) => {
const x = 0.15 + i * 2.45;
s.addShape(pres.shapes.ROUNDED_RECTANGLE, { x, y: 0.88, w: 2.3, h: 0.52, fill: { color }, rectRadius: 0.08, line: { color: C.gold, pt: 1.5 } });
s.addText(name, { x: x + 0.05, y: 0.9, w: 2.2, h: 0.48, fontSize: 10.5, bold: true, color: C.white, fontFace: "Calibri", align: "center", valign: "middle" });
// Arrow
if (i < 3) {
s.addShape(pres.shapes.RIGHT_ARROW, { x: x + 2.3, y: 1.02, w: 0.15, h: 0.28, fill: { color: C.gold }, line: { color: C.gold } });
}
const bulletItems = items.map((t) => ({ text: "• " + t, options: { breakLine: true, fontSize: 10.5, color: C.navy, fontFace: "Calibri" } }));
s.addText(bulletItems, { x, y: 1.45, w: 2.3, h: 3.75, fontFace: "Calibri", valign: "top" });
});
// ICHD-3 diagnostic criteria box at bottom
s.addShape(pres.shapes.RECTANGLE, { x: 0.15, y: 5.12, w: 9.7, h: 0.28, fill: { color: C.indigo }, line: { color: C.indigo } });
s.addText("ICHD-3 Migraine Without Aura: ≥5 attacks, 4–72h, unilateral + pulsating + moderate/severe + aggravated by activity + nausea/vomiting OR photo/phonophobia", {
x: 0.2, y: 5.13, w: 9.6, h: 0.25, fontSize: 9, color: C.white, fontFace: "Calibri", italic: true, valign: "middle"
});
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 13 – TENSION-TYPE & CLUSTER HEADACHE
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
addSlideBg(s, "light");
addHeader(s, "Tension-Type Headache vs. Cluster Headache");
addFooter(s);
// TTH
s.addShape(pres.shapes.ROUNDED_RECTANGLE, { x: 0.25, y: 0.88, w: 4.55, h: 4.38, fill: { color: C.offwhite }, rectRadius: 0.1, line: { color: C.indigo, pt: 2 } });
s.addShape(pres.shapes.ROUNDED_RECTANGLE, { x: 0.25, y: 0.88, w: 4.55, h: 0.42, fill: { color: C.indigo }, rectRadius: 0.08, line: { color: C.indigo } });
s.addText("TENSION-TYPE HEADACHE", { x: 0.3, y: 0.89, w: 4.45, h: 0.38, fontSize: 13, bold: true, color: C.white, fontFace: "Calibri", align: "center", valign: "middle" });
s.addText([
bullet("Most common headache type (~40% lifetime)"),
bullet("BILATERAL — pressing/tightening (non-pulsatile)"),
bullet("Mild to moderate intensity"),
bullet("NOT aggravated by routine physical activity"),
bullet("No nausea/vomiting (key distinguishing feature)"),
bullet("Photophobia OR phonophobia (not both)"),
bullet("\"Band around the head\" or \"vice-like\" quality"),
bullet("Duration: 30 min to 7 days"),
bullet("Episodic (<15 days/month) vs Chronic (≥15 days/month)"),
bullet("Often persists day-long; present on waking"),
bullet("Associated with anxiety, depression, muscle tenderness"),
{ text: "Pathophysiology: peripheral sensitisation of pericranial myofascial tissue; central sensitisation in chronic TTH (Adams & Victor)", options: { fontSize: 10, color: C.midgray, italic: true, breakLine: true } },
], { x: 0.3, y: 1.35, w: 4.38, h: 3.8, fontFace: "Calibri", valign: "top" });
// Cluster
s.addShape(pres.shapes.ROUNDED_RECTANGLE, { x: 5.2, y: 0.88, w: 4.55, h: 4.38, fill: { color: C.offwhite }, rectRadius: 0.1, line: { color: C.red, pt: 2 } });
s.addShape(pres.shapes.ROUNDED_RECTANGLE, { x: 5.2, y: 0.88, w: 4.55, h: 0.42, fill: { color: C.red }, rectRadius: 0.08, line: { color: C.red } });
s.addText("CLUSTER HEADACHE", { x: 5.25, y: 0.89, w: 4.45, h: 0.38, fontSize: 13, bold: true, color: C.white, fontFace: "Calibri", align: "center", valign: "middle" });
s.addText([
bullet("Rare but extremely severe; M:F = 5:1"),
bullet("UNILATERAL orbital/supraorbital/temporal"),
bullet("Stabbing, boring, excruciating pain"),
bullet("Duration: 15–180 minutes"),
bullet("Frequency: 1 every 2 days up to 8/day"),
bullet("Strictly unilateral autonomic features:"),
subbullet("Ipsilateral lacrimation, conjunctival injection"),
subbullet("Nasal congestion/rhinorrhoea"),
subbullet("Miosis and/or ptosis (partial Horner's)"),
subbullet("Facial sweating, eyelid oedema"),
bullet("Patient is AGITATED (unlike migraine — prefers stillness)"),
bullet("Nocturnal attacks common; alcohol triggers during bout"),
bullet("Cluster periods: weeks to months, then remission"),
{ text: "Hypothalamic (posterior) activation seen on PET/fMRI — hence \"clockwork\" circadian pattern (Harrison's 22E)", options: { fontSize: 10, color: C.midgray, italic: true, breakLine: true } },
], { x: 5.25, y: 1.35, w: 4.38, h: 3.8, fontFace: "Calibri", valign: "top" });
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 14 – SECTION DIVIDER: DIAGNOSIS
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
sectionDivider(s, "Diagnosis & Investigations", "Section 07");
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 15 – DIAGNOSIS
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
addSlideBg(s, "light");
addHeader(s, "Diagnosis – History, Examination & Investigations");
addFooter(s);
// History
s.addShape(pres.shapes.ROUNDED_RECTANGLE, { x: 0.25, y: 0.9, w: 4.6, h: 2.0, fill: { color: C.navy }, rectRadius: 0.08, line: { color: C.gold, pt: 1 } });
s.addText("Key History Points (SOCRATES + Red Flags)", { x: 0.3, y: 0.92, w: 4.5, h: 0.3, fontSize: 12, bold: true, color: C.gold, fontFace: "Calibri" });
s.addText([
bullet("Site, Onset, Character, Radiation, Associations, Timing, Exacerbating/Relieving factors, Severity", { color: C.white, fontSize: 10.5 }),
bullet("Previous headache history, family history, medications (analgesic overuse!)", { color: C.white, fontSize: 10.5 }),
bullet("Aura: visual, sensory, speech changes, duration, march", { color: C.white, fontSize: 10.5 }),
bullet("Systemic symptoms: fever, weight loss, rash, jaw claudication", { color: C.white, fontSize: 10.5 }),
], { x: 0.3, y: 1.22, w: 4.5, h: 1.6, fontFace: "Calibri", valign: "top" });
// Examination
s.addShape(pres.shapes.ROUNDED_RECTANGLE, { x: 5.15, y: 0.9, w: 4.6, h: 2.0, fill: { color: C.navy }, rectRadius: 0.08, line: { color: C.teal, pt: 1 } });
s.addText("Neurological Examination", { x: 5.2, y: 0.92, w: 4.5, h: 0.3, fontSize: 12, bold: true, color: C.gold, fontFace: "Calibri" });
s.addText([
bullet("Vital signs: BP, temperature, heart rate", { color: C.white, fontSize: 10.5 }),
bullet("Fundoscopy: papilloedema → raised ICP", { color: C.white, fontSize: 10.5 }),
bullet("Meningism: neck stiffness, Kernig's, Brudzinski's → meningitis/SAH", { color: C.white, fontSize: 10.5 }),
bullet("Focal neurological deficits, cranial nerves, cerebellar signs", { color: C.white, fontSize: 10.5 }),
bullet("Temporal artery palpation if >50 yrs (GCA)", { color: C.white, fontSize: 10.5 }),
], { x: 5.2, y: 1.22, w: 4.5, h: 1.6, fontFace: "Calibri", valign: "top" });
// Investigations table area
s.addText("Investigations (when indicated by red flags or clinical suspicion)", {
x: 0.25, y: 3.0, w: 9.5, h: 0.3, fontSize: 13, bold: true, color: C.indigo, fontFace: "Calibri"
});
const invRows = [
["CT Head (non-contrast)", "First choice in EMERGENCY: acute thunderclap, trauma, suspected SAH — sens ~98% within 6h (Harrison's 22E)"],
["CT Angiography / MR Angiography", "Cerebral aneurysm, arterial dissection, arteriovenous malformation"],
["MRI Brain (with gadolinium)", "Superior to CT for posterior fossa, venous thrombosis, leptomeningeal disease, chronic conditions"],
["Lumbar Puncture (LP)", "If CT negative and SAH still suspected: xanthochromia up to 2 weeks; also for CSF pressure, meningitis work-up"],
["Blood tests", "FBC, ESR, CRP (GCA), glucose, U&E, LFTs; toxicology if substance-related headache"],
["EEG", "Only if seizure disorder suspected; not routinely indicated in headache"],
];
invRows.forEach(([test, indication], i) => {
const y = 3.38 + i * 0.33;
const fillColor = i % 2 === 0 ? C.lightgray : C.white;
s.addShape(pres.shapes.RECTANGLE, { x: 0.25, y, w: 9.5, h: 0.32, fill: { color: fillColor }, line: { color: C.lightgray } });
s.addText(test, { x: 0.3, y: y + 0.02, w: 3.0, h: 0.28, fontSize: 10, bold: true, color: C.navy, fontFace: "Calibri", valign: "middle" });
s.addText(indication, { x: 3.4, y: y + 0.02, w: 6.2, h: 0.28, fontSize: 10, color: C.indigo, fontFace: "Calibri", valign: "middle" });
});
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 16 – SECTION DIVIDER: TREATMENT
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
sectionDivider(s, "Treatment of Headache", "Section 08–10");
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 17 – ACUTE MIGRAINE TREATMENT
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
addSlideBg(s, "light");
addHeader(s, "Acute/Abortive Treatment of Migraine (Harrison's 22E)");
addFooter(s);
s.addText("General Principle: Treat as early as possible; dose adequately; choose route based on severity", {
x: 0.25, y: 0.88, w: 9.5, h: 0.28, fontSize: 11, color: C.teal, fontFace: "Calibri", italic: true, bold: true
});
const drugRows = [
{ class: "NSAIDs / Analgesics", color: C.indigo, drugs: [
"Ibuprofen 400–600 mg, Aspirin 1000 mg, Naproxen 500 mg — first-line for mild–moderate attacks",
"Aspirin + Acetaminophen + Caffeine combination (FDA-approved for mild–moderate migraine)",
"Ketorolac IM/IV for ED setting",
"Limitation: less effective in severe attacks; overuse risk (MOH if >10–15 days/month)",
]},
{ class: "5-HT₁B/₁D Agonists (Triptans)", color: C.teal, drugs: [
"Sumatriptan: 50–100 mg oral, 6 mg SC (fastest onset), 20 mg nasal spray",
"Zolmitriptan, Rizatriptan, Eletriptan, Naratriptan, Almotriptan, Frovatriptan",
"Mechanism: vasoconstriction of dilated meningeal vessels + inhibit CGRP/SP release",
"Contraindicated: CAD, stroke, uncontrolled HTN, ergot use within 24h, haemiplegic/basilar migraine",
"Effective in 50–70% for pain relief; take at headache onset (not aura)",
]},
{ class: "CGRP Receptor Antagonists (Gepants)", color: C.navy, drugs: [
"Rimegepant 75 mg oral ODT, Ubrogepant 50–100 mg oral",
"No vasoconstriction; safe in cardiovascular disease",
"Effective for acute attacks AND prevention (unlike triptans)",
"Repeat dosing at 2h effective (unlike triptans)",
]},
{ class: "5-HT₁F Agonists (Ditans)", color: C.red, drugs: [
"Lasmiditan 50–200 mg — no vasoconstriction, CNS-penetrant",
"No cardiovascular contraindications; SE: dizziness, sedation",
"Do not drive 8 hours after use",
]},
{ class: "Dopamine Antagonists (antiemetics)", color: C.midgray, drugs: [
"Metoclopramide, Prochlorperazine, Domperidone — treat nausea AND potentiate analgesics",
"IV/IM Prochlorperazine highly effective in ED",
"Chlorpromazine IV: useful in refractory ED migraine",
]},
];
drugRows.forEach(({ class: cls, color, drugs }, i) => {
const y = 1.22 + i * 0.83;
s.addShape(pres.shapes.RECTANGLE, { x: 0.2, y, w: 1.6, h: 0.78, fill: { color }, line: { color } });
s.addText(cls, { x: 0.22, y: y + 0.05, w: 1.55, h: 0.68, fontSize: 9.5, bold: true, color: C.white, fontFace: "Calibri", align: "center", valign: "middle" });
s.addShape(pres.shapes.RECTANGLE, { x: 1.8, y, w: 8.0, h: 0.78, fill: { color: i % 2 === 0 ? C.offwhite : C.white }, line: { color: C.lightgray } });
const bulletItems = drugs.map((t) => ({ text: "• " + t, options: { breakLine: true, fontSize: 9.8, color: C.navy, fontFace: "Calibri" } }));
s.addText(bulletItems, { x: 1.85, y: y + 0.03, w: 7.9, h: 0.72, fontFace: "Calibri", valign: "top" });
});
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 18 – PREVENTIVE TREATMENT OF MIGRAINE
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
addSlideBg(s, "light");
addHeader(s, "Preventive Treatment of Migraine (Harrison's 22E)");
addFooter(s);
// Indication box
s.addShape(pres.shapes.ROUNDED_RECTANGLE, { x: 0.2, y: 0.88, w: 9.6, h: 0.55, fill: { color: C.indigo }, rectRadius: 0.07, line: { color: C.gold, pt: 1 } });
s.addText("Indications: ≥4 migraine days/month (disabling); attacks not controlled by acute therapy; specific syndromes (hemiplegic, brainstem aura); medication overuse; patient preference", {
x: 0.3, y: 0.9, w: 9.4, h: 0.48, fontSize: 11, color: C.white, fontFace: "Calibri", italic: true, valign: "middle"
});
const preventives = [
{ cat: "Beta-Blockers\n(1st line)", color: C.indigo, info: "Propranolol 40–240 mg/day, Metoprolol 50–200 mg/day, Timolol\n✓ Well-studied; CI: asthma, heart block, depression; may worsen fatigue" },
{ cat: "Anticonvulsants\n(1st line)", color: C.teal, info: "Topiramate 25–100 mg/day, Valproate 500–1500 mg/day\n✓ Topiramate: also weight loss; CI in pregnancy (teratogenic). Valproate: teratogenic (avoid women of child-bearing age)" },
{ cat: "Tricyclic\nAntidepressants", color: C.navy, info: "Amitriptyline 25–75 mg nocte — especially for comorbid insomnia, depression, TTH overlap\n✓ Only proven TTH prevention agent; SE: sedation, dry mouth, weight gain" },
{ cat: "SNRIs", color: C.midgray, info: "Venlafaxine 75–150 mg/day\n✓ Useful if comorbid depression/anxiety; less evidence than TCAs" },
{ cat: "Anti-CGRP\nMonoclonal Abs\n(novel)", color: C.red, info: "Erenumab (anti-CGRP receptor) SC monthly\nFremanezumab, Galcanezumab, Eptinezumab (anti-CGRP ligand)\n✓ ~50% reduction in monthly migraine days in clinical trials; excellent tolerability; once-monthly or quarterly dosing" },
{ cat: "Botulinum\nToxin A", color: C.green, info: "OnabotulinumtoxinA 155–195 U every 12 weeks — for CHRONIC MIGRAINE (≥15 days/month) only\n✓ PREEMPT trials: ~50% responder rate; not effective in episodic migraine" },
{ cat: "Calcium Channel\nBlockers", color: C.teal, info: "Verapamil (mainly cluster prevention), Flunarizine (not available in US)\n✓ Flunarizine well-evidenced in many countries" },
{ cat: "Non-pharma", color: C.indigo, info: "Regular sleep, meals, exercise; stress management; trigger identification & avoidance\nBiofeedback, CBT — as effective as propranolol in RCTs; Transcranial magnetic stimulation (licensed)" },
];
preventives.forEach(({ cat, color, info }, i) => {
const col = i % 2;
const row = Math.floor(i / 2);
const x = col === 0 ? 0.2 : 5.1;
const y = 1.5 + row * 0.98;
s.addShape(pres.shapes.RECTANGLE, { x, y, w: 1.3, h: 0.88, fill: { color }, line: { color } });
s.addText(cat, { x: x + 0.02, y: y + 0.05, w: 1.26, h: 0.78, fontSize: 9.5, bold: true, color: C.white, fontFace: "Calibri", align: "center", valign: "middle" });
s.addShape(pres.shapes.RECTANGLE, { x: x + 1.3, y, w: 3.5, h: 0.88, fill: { color: row % 2 === 0 ? C.offwhite : C.white }, line: { color: C.lightgray } });
s.addText(info, { x: x + 1.35, y: y + 0.03, w: 3.4, h: 0.82, fontSize: 9.5, color: C.navy, fontFace: "Calibri", valign: "top" });
});
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 19 – TREATMENT OF TTH & CLUSTER HEADACHE
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
addSlideBg(s, "light");
addHeader(s, "Treatment – Tension-Type & Cluster Headache (Harrison's 22E)");
addFooter(s);
// TTH side
s.addShape(pres.shapes.ROUNDED_RECTANGLE, { x: 0.2, y: 0.88, w: 4.6, h: 4.38, fill: { color: C.offwhite }, rectRadius: 0.1, line: { color: C.indigo, pt: 2 } });
s.addShape(pres.shapes.ROUNDED_RECTANGLE, { x: 0.2, y: 0.88, w: 4.6, h: 0.38, fill: { color: C.indigo }, rectRadius: 0.08, line: { color: C.indigo } });
s.addText("TENSION-TYPE HEADACHE", { x: 0.25, y: 0.89, w: 4.5, h: 0.34, fontSize: 12.5, bold: true, color: C.white, fontFace: "Calibri", align: "center", valign: "middle" });
s.addText("Acute", { x: 0.3, y: 1.32, w: 4.35, h: 0.26, fontSize: 11.5, bold: true, color: C.indigo, fontFace: "Calibri" });
s.addText([
bullet("Simple analgesics: Paracetamol 1g, Aspirin 600–1000 mg, Ibuprofen 400–600 mg"),
bullet("Triptans NOT effective for pure TTH (Harrison's 22E)"),
bullet("Avoid opioids — risk of medication-overuse headache"),
bullet("Treat early with adequate dose"),
], { x: 0.3, y: 1.58, w: 4.35, h: 1.38, fontFace: "Calibri", valign: "top" });
s.addShape(pres.shapes.RECTANGLE, { x: 0.5, y: 3.0, w: 4.0, h: 0.04, fill: { color: C.lightgray }, line: { color: C.lightgray } });
s.addText("Prevention (Chronic TTH)", { x: 0.3, y: 3.08, w: 4.35, h: 0.26, fontSize: 11.5, bold: true, color: C.indigo, fontFace: "Calibri" });
s.addText([
bullet("Amitriptyline 25–75 mg nocte: ONLY proven preventive for chronic TTH"),
bullet("Other TCAs, SSRIs, benzodiazepines: NOT proven effective"),
bullet("Acupuncture: insufficient evidence"),
bullet("OnabotulinumtoxinA: NEGATIVE in chronic TTH trials"),
bullet("Non-pharmacological: relaxation, biofeedback, stress management — effective adjuncts"),
bullet("Physiotherapy, regular sleep, pericranial muscle therapy"),
], { x: 0.3, y: 3.35, w: 4.35, h: 1.8, fontFace: "Calibri", valign: "top" });
// Cluster side
s.addShape(pres.shapes.ROUNDED_RECTANGLE, { x: 5.15, y: 0.88, w: 4.6, h: 4.38, fill: { color: C.offwhite }, rectRadius: 0.1, line: { color: C.red, pt: 2 } });
s.addShape(pres.shapes.ROUNDED_RECTANGLE, { x: 5.15, y: 0.88, w: 4.6, h: 0.38, fill: { color: C.red }, rectRadius: 0.08, line: { color: C.red } });
s.addText("CLUSTER HEADACHE", { x: 5.2, y: 0.89, w: 4.5, h: 0.34, fontSize: 12.5, bold: true, color: C.white, fontFace: "Calibri", align: "center", valign: "middle" });
s.addText("Acute Abortive", { x: 5.25, y: 1.32, w: 4.35, h: 0.26, fontSize: 11.5, bold: true, color: C.red, fontFace: "Calibri" });
s.addText([
bullet("100% O₂ inhalation 10–15 L/min via non-rebreather mask for 15–20 min (highly effective)"),
bullet("Sumatriptan 6 mg SC or 20 mg nasal spray — fastest onset"),
bullet("Zolmitriptan 5 mg nasal spray"),
bullet("Intranasal lidocaine (4%)"),
bullet("Ergotamine 2 mg (bedtime anticipatory dosing for nocturnal attacks)"),
], { x: 5.25, y: 1.58, w: 4.35, h: 1.4, fontFace: "Calibri", valign: "top" });
s.addShape(pres.shapes.RECTANGLE, { x: 5.5, y: 3.0, w: 4.0, h: 0.04, fill: { color: C.lightgray }, line: { color: C.lightgray } });
s.addText("Prevention & Bridging", { x: 5.25, y: 3.08, w: 4.35, h: 0.26, fontSize: 11.5, bold: true, color: C.red, fontFace: "Calibri" });
s.addText([
bullet("Verapamil 240–480 mg/day: preferred preventive (ECG monitoring required)"),
bullet("Lithium 600–900 mg/day: effective in chronic cluster; toxicity risk"),
bullet("Prednisone (bridging): 75 mg/day tapering — rapid onset, short-term use"),
bullet("Greater occipital nerve (GON) block: effective bridging therapy"),
bullet("Galcanezumab (anti-CGRP): reduces cluster frequency by ~50% (Harrison's 22E)"),
bullet("Surgery: partial trigeminal nerve section for refractory cases (last resort)"),
bullet("Hypothalamic DBS: for intractable chronic cluster"),
], { x: 5.25, y: 3.35, w: 4.35, h: 1.8, fontFace: "Calibri", valign: "top" });
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 20 – SECONDARY HEADACHES
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
addSlideBg(s, "dark");
addHeader(s, "Secondary Headaches – Causes & Key Features");
addFooter(s);
const secondaries = [
{ name: "Subarachnoid\nHaemorrhage", color: C.red, pts: ["Thunderclap onset (peak <1 min)", "\"Worst headache of life\"", "Meningism, LOC, sentinel bleed", "CT → LP (xanthochromia ≤2 wks)", "Emergency: neurosurgical referral"] },
{ name: "Meningitis /\nEncephalitis", color: "#8E3A59", pts: ["Progressive severe headache + fever", "Neck stiffness, photophobia", "Kernig's / Brudzinski's positive", "Petechial rash (meningococcal)", "LP: cells, protein, glucose, Gram stain"] },
{ name: "Raised Intracranial\nPressure", color: C.indigo, pts: ["Worse on lying/bending/morning", "Papilloedema on fundoscopy", "Vomiting (projectile)", "CN VI palsy (false localising sign)", "Causes: tumour, CVT, idiopathic IH"] },
{ name: "Giant Cell\nArteritis", color: "#8B4513", pts: ["Age >50 (mean 70 yrs)", "Temporal artery tenderness", "Jaw claudication, amaurosis", "ESR >50, CRP elevated", "Temporal artery biopsy; URGENT steroids (sight-saving)"] },
{ name: "CSF Hypotension\n(Low Pressure)", color: C.teal, pts: ["Orthostatic: ↑ upright, ↓ lying", "Post-LP (days after procedure)", "Spontaneous CSF leak", "MRI: meningeal enhancement, brain sag", "Treat: bed rest, caffeine, blood patch"] },
{ name: "Cervicogenic\nHeadache", color: C.midgray, pts: ["Unilateral head pain from neck", "Restricted cervical range of motion", "Confirmed by diagnostic nerve block", "C2/C3 nerve roots implicated", "Treatment: physiotherapy, nerve blocks"] },
];
secondaries.forEach(({ name, color, pts }, i) => {
const col = i % 3;
const row = Math.floor(i / 3);
const x = 0.2 + col * 3.27;
const y = 0.92 + row * 2.32;
s.addShape(pres.shapes.ROUNDED_RECTANGLE, { x, y, w: 3.1, h: 2.18, fill: { color: C.indigo }, rectRadius: 0.08, line: { color, pt: 2 } });
s.addShape(pres.shapes.RECTANGLE, { x, y, w: 3.1, h: 0.38, fill: { color }, line: { color } });
s.addText(name, { x: x + 0.05, y: y + 0.02, w: 3.0, h: 0.34, fontSize: 10.5, bold: true, color: C.white, fontFace: "Calibri", align: "center", valign: "middle" });
const bulletItems = pts.map((t) => ({ text: "• " + t, options: { breakLine: true, fontSize: 10, color: C.lightgray, fontFace: "Calibri" } }));
s.addText(bulletItems, { x: x + 0.08, y: y + 0.42, w: 2.95, h: 1.7, fontFace: "Calibri", valign: "top" });
});
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 21 – SUMMARY TABLE: HEADACHE COMPARISON
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
addSlideBg(s, "light");
addHeader(s, "Summary – Comparison of Primary Headache Types");
addFooter(s);
const headers = ["Feature", "Migraine", "Tension-Type", "Cluster"];
const rows = [
["Prevalence", "~15% (F > M 3:1)", "~40% (M = F)", "~0.1% (M >> F)"],
["Location", "Unilateral (60%) or bilateral", "Bilateral", "Strictly unilateral"],
["Quality", "Pulsating/throbbing", "Pressing/tightening (non-pulsatile)", "Stabbing/boring (excruciating)"],
["Severity", "Moderate–severe", "Mild–moderate", "Very severe/excruciating"],
["Duration", "4–72 hours", "30 min – 7 days", "15–180 minutes"],
["Nausea/Vomiting", "Yes (defining feature)", "No", "Rare"],
["Photo/Phonophobia", "Both", "One or neither", "Rare"],
["Autonomic features", "Absent (typically)", "Absent", "Prominent (ipsilateral)"],
["Patient behaviour", "Prefers stillness, quiet, dark", "Can continue activities", "Agitated, restless"],
["Acute treatment", "Triptans, NSAIDs, Gepants", "Paracetamol, NSAIDs", "O₂ 100%, SC sumatriptan"],
["Prevention", "Beta-blockers, topiramate, anti-CGRP Abs", "Amitriptyline (only)", "Verapamil, lithium"],
];
const colW = [2.05, 2.62, 2.62, 2.42];
const colX = [0.2, 2.28, 4.93, 7.58];
const headerColors = [C.navy, C.indigo, C.teal, C.red];
// Header row
headers.forEach((h, ci) => {
s.addShape(pres.shapes.RECTANGLE, { x: colX[ci], y: 0.92, w: colW[ci], h: 0.32, fill: { color: headerColors[ci] }, line: { color: headerColors[ci] } });
s.addText(h, { x: colX[ci] + 0.04, y: 0.93, w: colW[ci] - 0.08, h: 0.28, fontSize: 10.5, bold: true, color: C.white, fontFace: "Calibri", align: "center", valign: "middle" });
});
rows.forEach((row, ri) => {
const y = 1.26 + ri * 0.38;
const bg = ri % 2 === 0 ? C.offwhite : C.white;
row.forEach((cell, ci) => {
s.addShape(pres.shapes.RECTANGLE, { x: colX[ci], y, w: colW[ci], h: 0.36, fill: { color: ci === 0 ? C.lightgray : bg }, line: { color: C.lightgray } });
s.addText(cell, { x: colX[ci] + 0.04, y: y + 0.02, w: colW[ci] - 0.08, h: 0.32, fontSize: 9.5, bold: ci === 0, color: ci === 0 ? C.navy : C.indigo, fontFace: "Calibri", valign: "middle" });
});
});
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 22 – FINAL SUMMARY / TAKE-HOME MESSAGES
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
s.background = { color: C.navy };
s.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 10, h: 0.12, fill: { color: C.gold }, line: { color: C.gold } });
s.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0.12, w: 0.18, h: 5.5, fill: { color: C.teal }, line: { color: C.teal } });
s.addText("Key Take-Home Messages", { x: 0.5, y: 0.2, w: 9.2, h: 0.55, fontSize: 26, bold: true, color: C.white, fontFace: "Calibri", align: "center", charSpacing: 3 });
s.addShape(pres.shapes.RECTANGLE, { x: 2.5, y: 0.78, w: 5, h: 0.045, fill: { color: C.gold }, line: { color: C.gold } });
const takeHome = [
["1", "Migraine is a neurological disorder — trigeminovascular activation + CSD + central sensitisation underlie all phases"],
["2", "Always screen for RED FLAGS (SNOOP4): thunderclap, fever, focal deficit, papilloedema, age >50, progressive pattern, worst ever"],
["3", "ICHD-3 criteria are the diagnostic standard: primary headaches are diagnoses of inclusion, NOT exclusion"],
["4", "Acute migraine: triptans ± NSAIDs for moderate–severe; gepants for CV disease; treat early for best efficacy"],
["5", "Prevention (≥4 migraine days/month): beta-blockers, topiramate, amitriptyline, anti-CGRP monoclonal antibodies (novel)"],
["6", "Cluster headache: 100% O₂ + SC sumatriptan acutely; verapamil for prevention; agitated patient is a hallmark"],
["7", "Chronic TTH: amitriptyline is the only proven preventive; triptans do NOT work for pure TTH"],
["8", "SAH until proven otherwise in thunderclap headache: CT first, then LP if CT negative (xanthochromia up to 2 weeks)"],
];
takeHome.forEach(([num, msg], i) => {
const y = 0.92 + i * 0.57;
s.addShape(pres.shapes.ROUNDED_RECTANGLE, { x: 0.35, y, w: 0.38, h: 0.44, fill: { color: C.gold }, rectRadius: 0.05, line: { color: C.gold } });
s.addText(num, { x: 0.35, y: y + 0.02, w: 0.38, h: 0.4, fontSize: 14, bold: true, color: C.navy, fontFace: "Calibri", align: "center", valign: "middle" });
s.addText(msg, { x: 0.82, y: y + 0.05, w: 8.85, h: 0.38, fontSize: 11.5, color: C.white, fontFace: "Calibri", valign: "middle" });
});
s.addShape(pres.shapes.RECTANGLE, { x: 0, y: 5.4, w: 10, h: 0.225, fill: { color: C.indigo }, line: { color: C.indigo } });
s.addText("Sources: Harrison's Principles of Internal Medicine 22E (2025) | Adams and Victor's Principles of Neurology 12E | ICHD-3 Classification", {
x: 0.2, y: 5.41, w: 9.6, h: 0.2, fontSize: 7.5, color: C.midgray, fontFace: "Calibri", align: "center", italic: true, valign: "middle"
});
}
// ══════════════════════════════════════════════════════════════════════════════
// WRITE FILE
// ══════════════════════════════════════════════════════════════════════════════
pres.writeFile({ fileName: "/home/daytona/workspace/headache-pptx/Headache_Neurology_Harrison.pptx" })
.then(() => console.log("DONE: /home/daytona/workspace/headache-pptx/Headache_Neurology_Harrison.pptx"))
.catch(e => { console.error("ERROR:", e); process.exit(1); });
cd /home/daytona/workspace/headache-pptx && node headache_presentation.js 2>&1
ls -lh /home/daytona/workspace/headache-pptx/Headache_Neurology_Harrison.pptx
Headache Neurology Harrison
Presentation · PPTX
| Slide | Content |
|---|---|
| 1 | Title slide |
| 2 | Outline / Table of Contents |
| 3 | Section divider: Definition & Classification |
| 4 | Definition, Epidemiology & Pain-Sensitive Structures |
| 5 | ICHD-3 Classification (Primary, Secondary, Neuralgias) |
| 6 | Section divider: Pathophysiology |
| 7 | Pathophysiology 1 – Cortical Spreading Depression, Trigeminovascular activation, CGRP |
| 8 | Pathophysiology 2 – Central sensitisation, Brainstem/Hypothalamus, Genetics & triggers |
| 9 | Section divider: Red Flags |
| 10 | SNOOP4 Red Flag Signs (full detail + consequences) |
| 11 | Section divider: Clinical Features |
| 12 | Migraine Phases – Prodrome, Aura, Headache, Postdrome + ICHD-3 criteria |
| 13 | TTH vs Cluster Headache – side-by-side comparison |
| 14 | Section divider: Diagnosis |
| 15 | Diagnosis – History, Exam, Investigations table (CT/MRI/LP/blood tests) |
| 16 | Section divider: Treatment |
| 17 | Acute Migraine Treatment – NSAIDs, Triptans, Gepants, Ditans, Dopamine antagonists |
| 18 | Preventive Migraine Treatment – Beta-blockers, anticonvulsants, TCAs, anti-CGRP mAbs, Botox |
| 19 | TTH & Cluster Treatment – acute + preventive for both |
| 20 | Secondary Headaches – SAH, Meningitis, Raised ICP, GCA, CSF hypotension |
| 21 | Comparison Table – all 3 primary headache types across 11 features |
| 22 | Take-Home Messages (8 key points) |
Make presentation on headache with 15 sildes according of refrencw of Harrison neurology and add some real pictures
headache neurology real clinical photos migraine brain scan CT MRI free medical images
node /home/daytona/skills/shared/scripts/fetch_images.js \ "https://cdn.orris.care/cdss_images/d79ad64919bbe2ea795ad5ac016dd5773e6dfee05124af733fdb3c1c617c6b44.png" \ "https://cdn.orris.care/cdss_images/2368f7d8c41bc8125ec2646b2f3ad36134124003937b29563f6359eb7d1a486d.png" \ "https://cdn.orris.care/cdss_images/58474695b1dd120a63533ae3bf934d4da98095a45ec1c2b9c8bb527e3907dc0c.png" \ "https://neurosciencenews.com/files/2022/11/migraine-brain-changes-neurosicnes.jpg" \ "https://unmhealth.org/stories/_files/images/thumb-migraine-headache.jpg" 2>&1 | head -5
An error occurred (ValidationException) when calling the ConverseStream operation: The model returned the following errors: prompt is too long: 213711 tokens > 200000 maximum
We encountered an error while processing your request. Please try again or reach out to us for help.
Make presentation on headache with 15 sildes according of refrencw of Harrison neurology and add some real pictures
headache medical images migraine tension cluster free use clinical photos
migraine pathophysiology trigeminal vascular mechanism diagram medical illustration wikimedia commons
cluster headache clinical photo red eye tearing unilateral face medical wikimedia
migraine aura visual scotoma fortification spectrum clinical photo site:commons.wikimedia.org OR site:medlineplus.gov
ls /home/daytona/workspace/ 2>/dev/null && echo "OK"
~/headache-pptx/build.js
const pptxgen = require("pptxgenjs");
const { execSync } = require("child_process");
// ─── Fetch images as base64 ─────────────────────────────────────────────────
const imageUrls = [
"https://neurotorium.org/cdn-cgi/image/format=auto,quality=85,metadata=none/wp-content/uploads/fig-3-trigeminovascular-system-and-migraine-1360x961.jpg",
"https://upload.wikimedia.org/wikipedia/commons/3/37/ScintillatingScotoma3.jpg",
"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b0/Migraine_aura.jpg/1280px-Migraine_aura.jpg",
"https://www.mayoclinic.org/-/media/kcms/gbs/patient-consumer/images/2019/03/14/20/11/cluster-headache-8col-3802786-007-0.jpg",
"https://medlineplus.gov/ency/images/ency/fullsize/19241.jpg",
"https://neurotorium.org/wp-content/uploads/a-model-of-migraine-pathophysiology-2.png",
];
let images = [];
try {
const raw = execSync(
`node /home/daytona/skills/shared/scripts/fetch_images.js ${imageUrls.map(u => `"${u}"`).join(" ")}`,
{ maxBuffer: 50 * 1024 * 1024 }
).toString();
images = JSON.parse(raw);
} catch (e) {
console.error("Image fetch error:", e.message);
images = imageUrls.map(url => ({ url, base64: null, error: e.message }));
}
function img(idx) {
return images[idx] && !images[idx].error ? images[idx].base64 : null;
}
// ─── Color palette ─────────────────────────────────────────────────────────
const DARK = "0D1B2A"; // Deep navy
const MID = "1B4F72"; // Steel blue
const ACCENT = "E74C3C"; // Red accent
const LIGHT = "D6EAF8"; // Pale blue
const WHITE = "FFFFFF";
const GRAY = "BDC3C7";
const GOLD = "F39C12"; // Amber highlight
// ─── Helpers ────────────────────────────────────────────────────────────────
function addDarkSlide(pres, title) {
const slide = pres.addSlide();
slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: "100%", fill: { color: DARK } });
return slide;
}
function addLightSlide(pres) {
const slide = pres.addSlide();
slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: "100%", fill: { color: "F0F4F8" } });
return slide;
}
function sideBar(slide, color) {
slide.addShape(slide._slideObject ? null : "rect", { x: 0, y: 0, w: 0.15, h: "100%", fill: { color: color || ACCENT } });
}
function slideTitle(slide, text, opts) {
slide.addText(text, {
x: 0.3, y: 0.15, w: 9.4, h: 0.7,
fontSize: 28, bold: true, color: WHITE,
fontFace: "Calibri", margin: 0,
...(opts || {})
});
}
function bodyBullets(slide, items, opts) {
const bullets = items.map((t, i) => ({
text: t,
options: { bullet: true, breakLine: i < items.length - 1, fontSize: 17, color: DARK, fontFace: "Calibri" }
}));
slide.addText(bullets, {
x: 0.4, y: 1.0, w: 9.2, h: 4.3,
valign: "top",
...(opts || {})
});
}
// ═══════════════════════════════════════════════════════════════════════════
const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Headache: A Clinical Overview";
pres.author = "Based on Harrison's Principles & Bradley-Daroff Neurology";
// ─── SLIDE 1: Title ─────────────────────────────────────────────────────────
{
const sl = pres.addSlide();
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: "100%", fill: { color: DARK } });
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: 0.08, fill: { color: ACCENT } });
sl.addShape(pres.ShapeType.rect, { x: 0, y: 5.545, w: "100%", h: 0.08, fill: { color: ACCENT } });
sl.addText("HEADACHE", {
x: 0.5, y: 1.1, w: 9, h: 1.4,
fontSize: 60, bold: true, color: WHITE,
fontFace: "Calibri", align: "center", charSpacing: 8
});
sl.addText("A Comprehensive Clinical Overview", {
x: 0.5, y: 2.55, w: 9, h: 0.6,
fontSize: 22, color: GOLD, fontFace: "Calibri", align: "center", italic: true
});
sl.addShape(pres.ShapeType.rect, { x: 2.5, y: 3.3, w: 5, h: 0.04, fill: { color: ACCENT } });
sl.addText("Reference: Harrison's Principles of Internal Medicine\n& Bradley and Daroff's Neurology in Clinical Practice", {
x: 0.5, y: 3.5, w: 9, h: 0.8,
fontSize: 14, color: GRAY, fontFace: "Calibri", align: "center"
});
}
// ─── SLIDE 2: Definition & Classification ───────────────────────────────────
{
const sl = pres.addSlide();
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: "100%", fill: { color: "F0F4F8" } });
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: 0.9, fill: { color: MID } });
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.15, h: "100%", fill: { color: ACCENT } });
sl.addText("Definition & Classification", {
x: 0.3, y: 0.1, w: 9.4, h: 0.65,
fontSize: 26, bold: true, color: WHITE, fontFace: "Calibri", margin: 0
});
// Two boxes
const box = (x, y, w, h, title, color, textItems) => {
sl.addShape(pres.ShapeType.rect, { x, y, w, h, fill: { color }, line: { color: "CCCCCC", pt: 0 }, shadow: { type: "outer", blur: 4, offset: 2, angle: 45, color: "AAAAAA", opacity: 0.2 } });
sl.addText(title, { x: x + 0.1, y: y + 0.08, w: w - 0.2, h: 0.4, fontSize: 15, bold: true, color: DARK, fontFace: "Calibri", margin: 0 });
const items = textItems.map((t, i) => ({ text: t, options: { bullet: true, breakLine: i < textItems.length - 1, fontSize: 13, color: DARK, fontFace: "Calibri" } }));
sl.addText(items, { x: x + 0.1, y: y + 0.5, w: w - 0.2, h: h - 0.6, valign: "top" });
};
box(0.25, 1.05, 4.5, 2.2, "PRIMARY HEADACHES (ICHD-3)", LIGHT, [
"Migraine (with & without aura)",
"Tension-type headache",
"Cluster headache & TACs",
"Other primary headaches"
]);
box(5.0, 1.05, 4.5, 2.2, "SECONDARY HEADACHES", LIGHT, [
"Attributed to trauma/injury",
"Attributed to vascular disorders",
"Attributed to infection",
"Attributed to substance/withdrawal"
]);
box(0.25, 3.4, 9.25, 1.8, "Red Flag Symptoms (SNOOP4)", "FFF3CD", [
"Systemic symptoms (fever, weight loss) | Neurologic signs | Onset sudden (thunderclap)",
"Older onset (>50 yrs) | Pattern change | Postural worsening | Papilledema",
"Precipitated by Valsalva | Progressive worsening"
]);
}
// ─── SLIDE 3: Epidemiology ───────────────────────────────────────────────────
{
const sl = pres.addSlide();
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: "100%", fill: { color: DARK } });
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: 0.9, fill: { color: MID } });
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.15, h: "100%", fill: { color: ACCENT } });
sl.addText("Epidemiology", {
x: 0.3, y: 0.1, w: 9.4, h: 0.65,
fontSize: 26, bold: true, color: WHITE, fontFace: "Calibri", margin: 0
});
const stat = (x, y, value, label, color) => {
sl.addShape(pres.ShapeType.rect, { x, y, w: 2.8, h: 1.7, fill: { color }, roundedCorners: true });
sl.addText(value, { x, y: y + 0.15, w: 2.8, h: 0.9, fontSize: 38, bold: true, color: WHITE, fontFace: "Calibri", align: "center" });
sl.addText(label, { x, y: y + 1.0, w: 2.8, h: 0.55, fontSize: 12, color: WHITE, fontFace: "Calibri", align: "center" });
};
stat(0.25, 1.05, "~15%", "1-year migraine prevalence (Global Burden of Disease)", MID);
stat(3.4, 1.05, "3:1", "Female:Male ratio for migraine", "1A5276");
stat(6.6, 1.05, "~40%", "Familial occurrence in migraine with aura", "7B241C");
sl.addText("Key Epidemiological Facts", {
x: 0.25, y: 2.95, w: 9.25, h: 0.4,
fontSize: 16, bold: true, color: GOLD, fontFace: "Calibri"
});
const bullets = [
"Migraine: onset predominantly before age 30; most common in women aged 25–55",
"Tension-type headache: most common headache type; higher in women; arises in middle age",
"Cluster headache: prevalence ~1/500; male predominance (3:1); onset 3rd decade of life",
"1/3 of migraineurs have >3 attacks/month if untreated; significant disability and healthcare burden"
].map((t, i) => ({ text: t, options: { bullet: true, breakLine: i < 3, fontSize: 14, color: WHITE, fontFace: "Calibri" } }));
sl.addText(bullets, { x: 0.3, y: 3.35, w: 9.2, h: 2.0, valign: "top" });
}
// ─── SLIDE 4: Migraine – Clinical Features ──────────────────────────────────
{
const sl = pres.addSlide();
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: "100%", fill: { color: "F0F4F8" } });
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: 0.9, fill: { color: MID } });
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.15, h: "100%", fill: { color: ACCENT } });
sl.addText("Migraine: Clinical Features", {
x: 0.3, y: 0.1, w: 9.4, h: 0.65,
fontSize: 26, bold: true, color: WHITE, fontFace: "Calibri", margin: 0
});
const leftBullets = [
"Periodic, unilateral (or bilateral) pulsatile headache",
"Often begins in childhood/adolescence; onset <30 yrs in >80%",
"Nausea ± vomiting; photophobia; phonophobia; osmophobia",
"Pain intensified by movement; prefers dark, quiet room",
"Migraine WITHOUT aura (common): unheralded onset over minutes",
"Migraine WITH aura (classic): preceded by visual/sensory/speech disturbance"
].map((t, i, arr) => ({ text: t, options: { bullet: true, breakLine: i < arr.length - 1, fontSize: 14, color: DARK, fontFace: "Calibri" } }));
sl.addText(leftBullets, { x: 0.3, y: 1.0, w: 5.2, h: 3.8, valign: "top" });
// Aura image
const auraImg = img(2); // migraine_aura.jpg
if (auraImg) {
sl.addImage({ data: auraImg, x: 5.7, y: 1.0, w: 3.9, h: 2.4 });
sl.addText("Migraine aura – scintillating scotoma\n(Source: Wikimedia Commons)", {
x: 5.7, y: 3.4, w: 3.9, h: 0.5,
fontSize: 9, color: "666666", fontFace: "Calibri", italic: true, align: "center"
});
} else {
sl.addShape(pres.ShapeType.rect, { x: 5.7, y: 1.0, w: 3.9, h: 2.4, fill: { color: LIGHT } });
sl.addText("Migraine Aura\n(Visual Disturbance)", { x: 5.7, y: 1.9, w: 3.9, h: 0.6, fontSize: 13, color: MID, align: "center", fontFace: "Calibri", italic: true });
}
// Phases bar
const phases = ["Prodrome\n(hrs-days)", "Aura\n(20-30 min)", "Headache\n(4-72 hrs)", "Postdrome\n(hrs-days)"];
const phaseColors = ["1A5276", MID, ACCENT, "7D6608"];
phases.forEach((p, i) => {
sl.addShape(pres.ShapeType.rect, { x: 0.3 + i * 2.35, y: 4.9, w: 2.2, h: 0.6, fill: { color: phaseColors[i] } });
sl.addText(p, { x: 0.3 + i * 2.35, y: 4.9, w: 2.2, h: 0.6, fontSize: 11, color: WHITE, fontFace: "Calibri", align: "center", valign: "middle" });
});
sl.addText("Phases of a Migraine Attack", { x: 0.3, y: 4.72, w: 9.4, h: 0.25, fontSize: 11, bold: true, color: DARK, fontFace: "Calibri" });
}
// ─── SLIDE 5: Migraine Aura ──────────────────────────────────────────────────
{
const sl = pres.addSlide();
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: "100%", fill: { color: DARK } });
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: 0.9, fill: { color: "7B241C" } });
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.15, h: "100%", fill: { color: GOLD } });
sl.addText("Migraine Aura & Visual Phenomena", {
x: 0.3, y: 0.1, w: 9.4, h: 0.65,
fontSize: 26, bold: true, color: WHITE, fontFace: "Calibri", margin: 0
});
const scotImg = img(1); // ScintillatingScotoma
if (scotImg) {
sl.addImage({ data: scotImg, x: 0.3, y: 1.0, w: 4.5, h: 3.2 });
sl.addText("Scintillating scotoma – typical migraine aura\n(Source: Wikimedia Commons)", {
x: 0.3, y: 4.2, w: 4.5, h: 0.5,
fontSize: 9, color: GRAY, fontFace: "Calibri", italic: true, align: "center"
});
}
const bullets = [
"Aura precedes headache by minutes; resolves before or as headache begins",
"Most common: visual – scintillating scotoma, fortification spectra, photopsia",
"Sensory aura: unilateral paresthesias spreading over minutes (cheiro-oral pattern)",
"Motor aura: dysphasia or hemiparesis (hemiplegic migraine)",
"Spreads at 2-3 mm/min – correlates with cortical spreading depression (CSD)",
"CSD: wave of neuronal/glial depolarization described by Leão; moves ~3 mm/min",
"Aura:Headache ratio approximately 1:5 (with:without aura)"
].map((t, i, arr) => ({ text: t, options: { bullet: true, breakLine: i < arr.length - 1, fontSize: 13.5, color: WHITE, fontFace: "Calibri" } }));
sl.addText(bullets, { x: 5.0, y: 1.0, w: 4.8, h: 4.4, valign: "top" });
}
// ─── SLIDE 6: Pathogenesis of Migraine ──────────────────────────────────────
{
const sl = pres.addSlide();
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: "100%", fill: { color: "F0F4F8" } });
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: 0.9, fill: { color: MID } });
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.15, h: "100%", fill: { color: GOLD } });
sl.addText("Pathogenesis of Migraine", {
x: 0.3, y: 0.1, w: 9.4, h: 0.65,
fontSize: 26, bold: true, color: WHITE, fontFace: "Calibri", margin: 0
});
const tvImg = img(5); // trigeminovascular
if (tvImg) {
sl.addImage({ data: tvImg, x: 5.5, y: 1.0, w: 4.2, h: 3.0 });
sl.addText("Trigeminovascular pathway & migraine mechanisms\n(Source: neurotorium.org)", {
x: 5.5, y: 4.0, w: 4.2, h: 0.5,
fontSize: 9, color: "666666", fontFace: "Calibri", italic: true, align: "center"
});
}
const bullets = [
"Genetic basis: polygenic risk; ~40 susceptibility loci; ion channel genes",
"Cortical Spreading Depression (CSD): wave of depolarization at 2-3 mm/min → aura",
"Trigeminovascular hypothesis (Moskowitz): activation of trigeminal afferents innervating dura/meningeal vessels",
"Release of CGRP, substance P from trigeminal endings → neurogenic inflammation",
"Central sensitization: sensitization of 2nd-order neurons → allodynia",
"Serotonin (5-HT) dysregulation: triptans are 5-HT1B/1D agonists → vasoconstriction + inhibit CGRP release",
"Wolff's original vascular hypothesis (extracranial artery dilation) now largely revised"
].map((t, i, arr) => ({ text: t, options: { bullet: true, breakLine: i < arr.length - 1, fontSize: 13, color: DARK, fontFace: "Calibri" } }));
sl.addText(bullets, { x: 0.3, y: 1.0, w: 5.0, h: 4.4, valign: "top" });
}
// ─── SLIDE 7: Tension-Type Headache ─────────────────────────────────────────
{
const sl = pres.addSlide();
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: "100%", fill: { color: DARK } });
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: 0.9, fill: { color: "1D6A96" } });
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.15, h: "100%", fill: { color: ACCENT } });
sl.addText("Tension-Type Headache", {
x: 0.3, y: 0.1, w: 9.4, h: 0.65,
fontSize: 26, bold: true, color: WHITE, fontFace: "Calibri", margin: 0
});
// Compare table
const headers = ["Feature", "Tension-Type", "Migraine"];
const rows = [
["Location", "Bilateral (band-like)", "Unilateral (or bilateral)"],
["Quality", "Dull, pressing/tightening", "Pulsating/throbbing"],
["Severity", "Mild to moderate", "Moderate to severe"],
["Nausea/Vomiting", "Absent", "Common"],
["Photo/Phonophobia", "Absent (or 1 only)", "Both present"],
["Activity effect", "Not aggravated", "Worsened by activity"],
["Duration", "30 min – 7 days (hours to years)", "4 – 72 hours"],
];
const colW = [2.2, 3.4, 3.4];
const colX = [0.25, 2.55, 6.05];
const hColors = [DARK, "1A5276", "7B241C"];
headers.forEach((h, c) => {
sl.addShape(pres.ShapeType.rect, { x: colX[c], y: 1.0, w: colW[c], h: 0.45, fill: { color: hColors[c] } });
sl.addText(h, { x: colX[c], y: 1.0, w: colW[c], h: 0.45, fontSize: 13, bold: true, color: WHITE, fontFace: "Calibri", align: "center", valign: "middle" });
});
rows.forEach((row, r) => {
const bg = r % 2 === 0 ? "1B2A38" : "162330";
row.forEach((cell, c) => {
sl.addShape(pres.ShapeType.rect, { x: colX[c], y: 1.5 + r * 0.5, w: colW[c], h: 0.48, fill: { color: bg } });
sl.addText(cell, { x: colX[c] + 0.05, y: 1.5 + r * 0.5, w: colW[c] - 0.1, h: 0.48, fontSize: 12, color: r === 0 ? GOLD : WHITE, fontFace: "Calibri", valign: "middle" });
});
});
sl.addText("Note: Chronic tension-type headache can persist for years; anxiety and depression are present in most patients (Bradley-Daroff Neurology)", {
x: 0.25, y: 5.0, w: 9.5, h: 0.5,
fontSize: 11, color: GRAY, fontFace: "Calibri", italic: true
});
}
// ─── SLIDE 8: Cluster Headache ──────────────────────────────────────────────
{
const sl = pres.addSlide();
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: "100%", fill: { color: "F0F4F8" } });
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: 0.9, fill: { color: "7B241C" } });
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.15, h: "100%", fill: { color: MID } });
sl.addText("Cluster Headache", {
x: 0.3, y: 0.1, w: 9.4, h: 0.65,
fontSize: 26, bold: true, color: WHITE, fontFace: "Calibri", margin: 0
});
const clImg = img(3); // cluster-headache mayo
if (clImg) {
sl.addImage({ data: clImg, x: 6.0, y: 1.0, w: 3.65, h: 2.6 });
sl.addText("Cluster headache – unilateral periorbital pain\n(Source: Mayo Clinic)", {
x: 6.0, y: 3.6, w: 3.65, h: 0.5,
fontSize: 9, color: "666666", fontFace: "Calibri", italic: true, align: "center"
});
}
const bullets = [
"Most painful recurrent headache known",
"Episodic: clusters 7 days–1 year; remission ≥3 months",
"Chronic: >1 year without remission (10% of cases)",
"Attacks: 1-3/day, 15 min–3 hrs; nocturnal onset common",
"Onset: 3rd decade; male:female ~3:1; prevalence ~1/500",
"Ipsilateral autonomic: lacrimation, ptosis, miosis, rhinorrhea, conjunctival injection",
"Periodicity is cardinal feature – striking circadian regularity",
"Familial risk: 18× in 1st-degree relatives (autosomal dominant, variable penetrance)"
].map((t, i, arr) => ({ text: t, options: { bullet: true, breakLine: i < arr.length - 1, fontSize: 13, color: DARK, fontFace: "Calibri" } }));
sl.addText(bullets, { x: 0.3, y: 1.0, w: 5.5, h: 4.6, valign: "top" });
}
// ─── SLIDE 9: Other Primary Headaches ───────────────────────────────────────
{
const sl = pres.addSlide();
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: "100%", fill: { color: DARK } });
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: 0.9, fill: { color: MID } });
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.15, h: "100%", fill: { color: GOLD } });
sl.addText("Other Primary Headache Disorders", {
x: 0.3, y: 0.1, w: 9.4, h: 0.65,
fontSize: 26, bold: true, color: WHITE, fontFace: "Calibri", margin: 0
});
const boxes = [
{ t: "Thunderclap Headache", x: 0.25, y: 1.0, c: "1B2A38", desc: "Severe headache reaching maximum within 1 min; exclude SAH (LP, CT); majority are primary (reversible cerebral vasoconstriction syndrome, RCVS)" },
{ t: "Hypnic Headache", x: 5.0, y: 1.0, c: "1B2A38", desc: "Dull headache awakening from sleep, usually >50 yrs; 15–30 min duration; responds to caffeine or lithium" },
{ t: "Primary Cough Headache", x: 0.25, y: 2.8, c: "1B2A38", desc: "Sudden bilateral head pain on coughing/straining; <1 min; exclude Chiari malformation (50% have secondary cause)" },
{ t: "Primary Exercise Headache", x: 5.0, y: 2.8, c: "1B2A38", desc: "Pulsatile headache during/after physical exertion; 5 min–48 hrs; exclude SAH, arterial dissection" },
{ t: "Primary Stabbing Headache", x: 0.25, y: 4.5, c: "1B2A38", desc: "Transient stabs/jabs, seconds duration; extratrigeminal location; no autonomic features; indomethacin-responsive" },
{ t: "Cold-Stimulus Headache", x: 5.0, y: 4.5, c: "1B2A38", desc: "'Brain freeze'; frontal headache after cold stimulus to palate/pharynx or cold environment; resolves within 30 min" },
];
boxes.forEach(b => {
sl.addShape(pres.ShapeType.rect, { x: b.x, y: b.y, w: 4.5, h: 1.65, fill: { color: b.c } });
sl.addText(b.t, { x: b.x + 0.1, y: b.y + 0.08, w: 4.3, h: 0.35, fontSize: 13, bold: true, color: GOLD, fontFace: "Calibri", margin: 0 });
sl.addText(b.desc, { x: b.x + 0.1, y: b.y + 0.43, w: 4.3, h: 1.1, fontSize: 11, color: WHITE, fontFace: "Calibri" });
});
}
// ─── SLIDE 10: Medication Overuse Headache ───────────────────────────────────
{
const sl = pres.addSlide();
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: "100%", fill: { color: "F0F4F8" } });
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: 0.9, fill: { color: ACCENT } });
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.15, h: "100%", fill: { color: MID } });
sl.addText("Medication Overuse Headache (MOH)", {
x: 0.3, y: 0.1, w: 9.4, h: 0.65,
fontSize: 26, bold: true, color: WHITE, fontFace: "Calibri", margin: 0
});
const bullets = [
"Overuse of acute medications → chronic daily headache syndrome (≥15 days/month)",
"Previously: 'rebound headache'; now classified as MOH (ICHD-3)",
"Risk (highest→lowest): Opioids/butalbital > Triptans > NSAIDs",
"Latency: Triptans ~1.7 yrs; Ergots ~2.7 yrs; Analgesics ~4.8 yrs",
"Pathogenesis: central trigeminal sensitization via impaired descending inhibition (RVM/NRD imbalance)",
"Population prevalence of CDH with MOH: ~1.4%",
"Treatment: taper/withdraw offending medication; bridge therapy; preventive agents",
"Prevention: limit acute treatment to <10–15 days/month (ICHD-3 threshold)"
].map((t, i, arr) => ({ text: t, options: { bullet: true, breakLine: i < arr.length - 1, fontSize: 14, color: DARK, fontFace: "Calibri" } }));
sl.addText(bullets, { x: 0.3, y: 1.0, w: 9.2, h: 4.4, valign: "top" });
sl.addText("Reference: Bradley and Daroff's Neurology in Clinical Practice, MOH section", {
x: 0.3, y: 5.1, w: 9.4, h: 0.35,
fontSize: 10, color: "888888", fontFace: "Calibri", italic: true
});
}
// ─── SLIDE 11: Secondary Headaches & Red Flags ───────────────────────────────
{
const sl = pres.addSlide();
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: "100%", fill: { color: DARK } });
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: 0.9, fill: { color: ACCENT } });
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.15, h: "100%", fill: { color: GOLD } });
sl.addText("Secondary Headaches & Red Flags", {
x: 0.3, y: 0.1, w: 9.4, h: 0.65,
fontSize: 26, bold: true, color: WHITE, fontFace: "Calibri", margin: 0
});
const categories = [
{ title: "Subarachnoid Hemorrhage", items: ["'Worst headache of life' / thunderclap onset", "Meningism, photophobia, vomiting", "Sentinel leak may precede major bleed", "CT then LP if CT negative"] },
{ title: "Meningitis / Encephalitis", items: ["Fever + headache + meningism = emergency", "Photophobia, altered consciousness", "Kernig/Brudzinski signs", "LP after CT (if no papilledema)"] },
{ title: "Space-Occupying Lesion", items: ["Progressive, positional, morning headache", "Associated neurologic deficits", "Papilledema on fundoscopy", "MRI with contrast required"] },
{ title: "Giant Cell Arteritis", items: ["Age >50; ESR elevated", "Temporal artery tenderness/nodularity", "Jaw claudication, visual loss risk", "Urgent steroids; temporal artery biopsy"] },
];
categories.forEach((cat, i) => {
const x = (i % 2) * 4.8 + 0.25;
const y = Math.floor(i / 2) * 2.2 + 1.0;
sl.addShape(pres.ShapeType.rect, { x, y, w: 4.5, h: 2.0, fill: { color: "1B2A38" } });
sl.addText(cat.title, { x: x + 0.1, y: y + 0.05, w: 4.3, h: 0.38, fontSize: 13, bold: true, color: GOLD, fontFace: "Calibri", margin: 0 });
const items = cat.items.map((t, j) => ({ text: t, options: { bullet: true, breakLine: j < cat.items.length - 1, fontSize: 11.5, color: WHITE, fontFace: "Calibri" } }));
sl.addText(items, { x: x + 0.1, y: y + 0.43, w: 4.3, h: 1.4, valign: "top" });
});
}
// ─── SLIDE 12: Diagnosis & Workup ───────────────────────────────────────────
{
const sl = pres.addSlide();
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: "100%", fill: { color: "F0F4F8" } });
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: 0.9, fill: { color: MID } });
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.15, h: "100%", fill: { color: ACCENT } });
sl.addText("Diagnosis & Investigations", {
x: 0.3, y: 0.1, w: 9.4, h: 0.65,
fontSize: 26, bold: true, color: WHITE, fontFace: "Calibri", margin: 0
});
// Flow diagram
const step = (x, y, w, h, text, color, tColor) => {
sl.addShape(pres.ShapeType.rect, { x, y, w, h, fill: { color }, roundedCorners: true });
sl.addText(text, { x, y, w, h, fontSize: 12, bold: true, color: tColor || WHITE, fontFace: "Calibri", align: "center", valign: "middle" });
};
const arrow = (x, y) => sl.addShape(pres.ShapeType.triangle, { x, y, w: 0.25, h: 0.2, fill: { color: DARK }, rotate: 180 });
step(0.25, 1.0, 9.2, 0.55, "Detailed History: character, onset, location, duration, associated symptoms, triggers, family history", MID);
arrow(4.88, 1.58);
step(0.25, 1.8, 9.2, 0.55, "Physical Exam: vital signs, fundoscopy, cranial nerve exam, meningeal signs, neurological status", "1A5276");
arrow(4.88, 2.38);
// Two paths
sl.addShape(pres.ShapeType.rect, { x: 0.25, y: 2.6, w: 4.4, h: 1.5, fill: { color: "D5F5E3" }, line: { color: "27AE60", pt: 2 } });
sl.addText("No Red Flags Present", { x: 0.25, y: 2.6, w: 4.4, h: 0.35, fontSize: 13, bold: true, color: "27AE60", fontFace: "Calibri", align: "center" });
sl.addText([
{ text: "Clinical diagnosis (migraine/TTH/cluster)", options: { bullet: true, breakLine: true, fontSize: 12, color: DARK, fontFace: "Calibri" } },
{ text: "Neuroimaging NOT routinely required", options: { bullet: true, breakLine: true, fontSize: 12, color: DARK, fontFace: "Calibri" } },
{ text: "Consider headache diary; ICHD-3 criteria", options: { bullet: true, fontSize: 12, color: DARK, fontFace: "Calibri" } }
], { x: 0.35, y: 2.95, w: 4.2, h: 1.1, valign: "top" });
sl.addShape(pres.ShapeType.rect, { x: 5.1, y: 2.6, w: 4.4, h: 1.5, fill: { color: "FADBD8" }, line: { color: ACCENT, pt: 2 } });
sl.addText("Red Flags Present", { x: 5.1, y: 2.6, w: 4.4, h: 0.35, fontSize: 13, bold: true, color: ACCENT, fontFace: "Calibri", align: "center" });
sl.addText([
{ text: "MRI brain ± gadolinium (preferred)", options: { bullet: true, breakLine: true, fontSize: 12, color: DARK, fontFace: "Calibri" } },
{ text: "CT for acute SAH (thunderclap)", options: { bullet: true, breakLine: true, fontSize: 12, color: DARK, fontFace: "Calibri" } },
{ text: "LP if CT negative + SAH suspected", options: { bullet: true, fontSize: 12, color: DARK, fontFace: "Calibri" } }
], { x: 5.2, y: 2.95, w: 4.2, h: 1.1, valign: "top" });
sl.addText("Bradley-Daroff: 'Headaches with sudden onset, progressive frequency/severity, worst ever, focal deficit, or fever require imaging'", {
x: 0.25, y: 4.2, w: 9.4, h: 0.55,
fontSize: 11, color: "555555", fontFace: "Calibri", italic: true
});
// Labs box
sl.addShape(pres.ShapeType.rect, { x: 0.25, y: 4.8, w: 9.2, h: 0.65, fill: { color: LIGHT } });
sl.addText("Additional Labs (if secondary cause suspected): ESR/CRP (GCA), CBC, metabolic panel, coagulation, CSF analysis, toxicology screen", {
x: 0.35, y: 4.85, w: 9.0, h: 0.55, fontSize: 12, color: DARK, fontFace: "Calibri"
});
}
// ─── SLIDE 13: Treatment of Migraine ────────────────────────────────────────
{
const sl = pres.addSlide();
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: "100%", fill: { color: DARK } });
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: 0.9, fill: { color: "1A5276" } });
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.15, h: "100%", fill: { color: ACCENT } });
sl.addText("Treatment of Migraine", {
x: 0.3, y: 0.1, w: 9.4, h: 0.65,
fontSize: 26, bold: true, color: WHITE, fontFace: "Calibri", margin: 0
});
// Acute treatment box
sl.addShape(pres.ShapeType.rect, { x: 0.25, y: 0.98, w: 4.5, h: 2.6, fill: { color: "1B2A38" } });
sl.addText("ACUTE / ABORTIVE", { x: 0.25, y: 0.98, w: 4.5, h: 0.4, fontSize: 14, bold: true, color: GOLD, fontFace: "Calibri", align: "center", valign: "middle" });
const acute = [
"Mild-moderate: NSAIDs (aspirin, ibuprofen, naproxen)",
"Acetaminophen ± antiemetic (metoclopramide)",
"Severe: Triptans (5-HT1B/1D agonists) — sumatriptan, zolmitriptan, rizatriptan",
"SC route fastest; nasal/oral for early use during aura",
"DHE (dihydroergotamine): effective, but vasoconstriction risk",
"Antiemetics: prochlorperazine, ondansetron (IV for ED)"
].map((t, i, arr) => ({ text: t, options: { bullet: true, breakLine: i < arr.length - 1, fontSize: 11.5, color: WHITE, fontFace: "Calibri" } }));
sl.addText(acute, { x: 0.35, y: 1.4, w: 4.3, h: 2.1, valign: "top" });
// Preventive box
sl.addShape(pres.ShapeType.rect, { x: 5.0, y: 0.98, w: 4.7, h: 2.6, fill: { color: "1B2A38" } });
sl.addText("PREVENTIVE (Prophylactic)", { x: 5.0, y: 0.98, w: 4.7, h: 0.4, fontSize: 14, bold: true, color: GOLD, fontFace: "Calibri", align: "center", valign: "middle" });
const prev = [
"Indicated: ≥4 attacks/month or significant disability",
"Beta-blockers: propranolol, metoprolol (1st line)",
"TCAs: amitriptyline (benefit even without depression)",
"Anti-epileptics: valproate, topiramate",
"CGRP monoclonal antibodies: erenumab, fremanezumab (newer; highly effective)",
"Botulinum toxin A (for chronic migraine ≥15 days/month)"
].map((t, i, arr) => ({ text: t, options: { bullet: true, breakLine: i < arr.length - 1, fontSize: 11.5, color: WHITE, fontFace: "Calibri" } }));
sl.addText(prev, { x: 5.1, y: 1.4, w: 4.5, h: 2.1, valign: "top" });
// Lifestyle
sl.addShape(pres.ShapeType.rect, { x: 0.25, y: 3.7, w: 9.5, h: 1.65, fill: { color: "162230" } });
sl.addText("NON-PHARMACOLOGICAL", { x: 0.25, y: 3.7, w: 9.5, h: 0.35, fontSize: 13, bold: true, color: GOLD, fontFace: "Calibri", align: "center", valign: "middle" });
const nonpharm = [
"Identify and avoid triggers (sleep irregularity, stress, hormonal changes, dietary factors, bright lights)",
"Regular sleep schedule; stress management; biofeedback; cognitive-behavioral therapy (CBT)",
"Headache diary to track patterns; limit caffeine; adequate hydration; regular meals"
].map((t, i, arr) => ({ text: t, options: { bullet: true, breakLine: i < arr.length - 1, fontSize: 12, color: WHITE, fontFace: "Calibri" } }));
sl.addText(nonpharm, { x: 0.35, y: 4.08, w: 9.3, h: 1.2, valign: "top" });
}
// ─── SLIDE 14: Treatment of Cluster & Tension Headaches ─────────────────────
{
const sl = pres.addSlide();
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: "100%", fill: { color: "F0F4F8" } });
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: 0.9, fill: { color: "7B241C" } });
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.15, h: "100%", fill: { color: MID } });
sl.addText("Treatment: Cluster & Tension-Type Headaches", {
x: 0.3, y: 0.1, w: 9.4, h: 0.65,
fontSize: 24, bold: true, color: WHITE, fontFace: "Calibri", margin: 0
});
// Cluster - Acute
sl.addShape(pres.ShapeType.rect, { x: 0.25, y: 0.98, w: 4.5, h: 1.9, fill: { color: "FADBD8" }, line: { color: ACCENT, pt: 1 } });
sl.addText("CLUSTER – Acute Attack", { x: 0.25, y: 0.98, w: 4.5, h: 0.38, fontSize: 13, bold: true, color: ACCENT, fontFace: "Calibri", align: "center", valign: "middle" });
const clAcute = [
"100% O₂ inhalation (7-15 L/min × 15 min) – first line",
"SC sumatriptan 6 mg – rapid and highly effective",
"Intranasal zolmitriptan / lidocaine",
"DHE IV/IM for refractory attacks"
].map((t, i, arr) => ({ text: t, options: { bullet: true, breakLine: i < arr.length - 1, fontSize: 12, color: DARK, fontFace: "Calibri" } }));
sl.addText(clAcute, { x: 0.35, y: 1.38, w: 4.3, h: 1.45, valign: "top" });
// Cluster - Preventive
sl.addShape(pres.ShapeType.rect, { x: 5.0, y: 0.98, w: 4.7, h: 1.9, fill: { color: "FADBD8" }, line: { color: ACCENT, pt: 1 } });
sl.addText("CLUSTER – Preventive", { x: 5.0, y: 0.98, w: 4.7, h: 0.38, fontSize: 13, bold: true, color: ACCENT, fontFace: "Calibri", align: "center", valign: "middle" });
const clPrev = [
"Verapamil: drug of choice for prevention",
"Short-course corticosteroids to break clusters",
"Lithium carbonate for chronic cluster",
"CGRP mAbs: ~50% reduction in weekly attacks (galcanezumab)"
].map((t, i, arr) => ({ text: t, options: { bullet: true, breakLine: i < arr.length - 1, fontSize: 12, color: DARK, fontFace: "Calibri" } }));
sl.addText(clPrev, { x: 5.1, y: 1.38, w: 4.5, h: 1.45, valign: "top" });
// Tension divider
sl.addShape(pres.ShapeType.rect, { x: 0.25, y: 3.0, w: 9.5, h: 0.35, fill: { color: MID } });
sl.addText("TENSION-TYPE HEADACHE", { x: 0.25, y: 3.0, w: 9.5, h: 0.35, fontSize: 13, bold: true, color: WHITE, fontFace: "Calibri", align: "center", valign: "middle" });
const tensionAcute = [
"Simple analgesics: aspirin, paracetamol, ibuprofen",
"Avoid opioids / butalbital (risk of MOH)",
"Caffeine combination may improve efficacy"
].map((t, i, arr) => ({ text: t, options: { bullet: true, breakLine: i < arr.length - 1, fontSize: 12, color: DARK, fontFace: "Calibri" } }));
sl.addShape(pres.ShapeType.rect, { x: 0.25, y: 3.4, w: 4.5, h: 1.5, fill: { color: LIGHT }, line: { color: MID, pt: 1 } });
sl.addText("Acute", { x: 0.25, y: 3.4, w: 4.5, h: 0.3, fontSize: 12, bold: true, color: MID, fontFace: "Calibri", align: "center" });
sl.addText(tensionAcute, { x: 0.35, y: 3.72, w: 4.3, h: 1.1, valign: "top" });
const tensionPrev = [
"Amitriptyline (TCA) – effective even without depression",
"Stress management, biofeedback, CBT",
"Regular sleep schedule; physical therapy; relaxation techniques"
].map((t, i, arr) => ({ text: t, options: { bullet: true, breakLine: i < arr.length - 1, fontSize: 12, color: DARK, fontFace: "Calibri" } }));
sl.addShape(pres.ShapeType.rect, { x: 5.0, y: 3.4, w: 4.7, h: 1.5, fill: { color: LIGHT }, line: { color: MID, pt: 1 } });
sl.addText("Preventive", { x: 5.0, y: 3.4, w: 4.7, h: 0.3, fontSize: 12, bold: true, color: MID, fontFace: "Calibri", align: "center" });
sl.addText(tensionPrev, { x: 5.1, y: 3.72, w: 4.5, h: 1.1, valign: "top" });
}
// ─── SLIDE 15: Summary & Key Takeaways ──────────────────────────────────────
{
const sl = pres.addSlide();
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: "100%", fill: { color: DARK } });
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: 0.08, fill: { color: ACCENT } });
sl.addShape(pres.ShapeType.rect, { x: 0, y: 5.545, w: "100%", h: 0.08, fill: { color: ACCENT } });
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.15, h: "100%", fill: { color: GOLD } });
sl.addText("Key Takeaways", {
x: 0.3, y: 0.2, w: 9.4, h: 0.7,
fontSize: 30, bold: true, color: WHITE, fontFace: "Calibri", charSpacing: 2
});
const takeaways = [
["1", "ICHD-3 classifies headaches into primary (migraine, TTH, cluster) and secondary; red flags mandate urgent workup"],
["2", "Migraine affects ~15% globally; trigeminovascular activation + CGRP release + cortical spreading depression are central mechanisms"],
["3", "Triptans (5-HT1B/1D agonists) remain cornerstone for acute migraine; CGRP mAbs are transforming prevention"],
["4", "Cluster headache = most painful recurrent headache; 100% O₂ + SC sumatriptan for acute attacks; verapamil for prevention"],
["5", "MOH is underdiagnosed; limit acute analgesic use; opioids and butalbital carry highest rebound risk"],
["6", "Thunderclap headache demands immediate SAH exclusion; CT then LP; imaging for all headache red flags"],
];
takeaways.forEach(([num, text], i) => {
const y = 1.05 + i * 0.73;
sl.addShape(pres.ShapeType.ellipse, { x: 0.3, y: y, w: 0.45, h: 0.45, fill: { color: ACCENT } });
sl.addText(num, { x: 0.3, y: y, w: 0.45, h: 0.45, fontSize: 14, bold: true, color: WHITE, fontFace: "Calibri", align: "center", valign: "middle" });
sl.addText(text, { x: 0.9, y: y, w: 8.7, h: 0.55, fontSize: 13, color: WHITE, fontFace: "Calibri", valign: "middle" });
});
sl.addText("Sources: Bradley and Daroff's Neurology in Clinical Practice (9780323642613) • Adams & Victor's Principles of Neurology (9781264264520)", {
x: 0.3, y: 5.25, w: 9.4, h: 0.28,
fontSize: 9, color: GRAY, fontFace: "Calibri", italic: true, align: "center"
});
}
// ─── Write File ─────────────────────────────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/workspace/headache-pptx/Headache_Clinical_Overview.pptx" })
.then(() => console.log("DONE"))
.catch(e => { console.error("ERROR:", e); process.exit(1); });
cd /home/daytona/workspace/headache-pptx && node build.js 2>&1
ls -lh /home/daytona/workspace/headache-pptx/Headache_Clinical_Overview.pptx
Headache Clinical Overview
Presentation · PPTX
| # | Slide Title |
|---|---|
| 1 | Title Slide - Bold navy/red design |
| 2 | Definition & Classification - Primary vs Secondary (ICHD-3), Red Flags (SNOOP4) |
| 3 | Epidemiology - Stats on migraine prevalence (~15%), sex ratios, cluster prevalence |
| 4 | Migraine: Clinical Features - Phases diagram + real migraine aura photo (Wikimedia) |
| 5 | Migraine Aura & Visual Phenomena - Scintillating scotoma photo + CSD explanation |
| 6 | Pathogenesis of Migraine - Trigeminovascular pathway diagram + CGRP/CSD mechanisms |
| 7 | Tension-Type Headache - Side-by-side comparison table vs Migraine |
| 8 | Cluster Headache - Real clinical photo (Mayo Clinic) + epidemiology & features |
| 9 | Other Primary Headaches - Thunderclap, hypnic, cough, exercise, stabbing, cold-stimulus |
| 10 | Medication Overuse Headache - Risk ranking, latency, pathogenesis, treatment |
| 11 | Secondary Headaches & Red Flags - SAH, meningitis, SOL, Giant Cell Arteritis |
| 12 | Diagnosis & Investigations - Flowchart: no red flags vs red flags pathway |
| 13 | Treatment of Migraine - Acute (triptans, NSAIDs, DHE) + Preventive (CGRP mAbs, beta-blockers) |
| 14 | Treatment: Cluster & Tension - O₂, verapamil, amitriptyline |
| 15 | Key Takeaways - 6 numbered summary points |
Make presentation on headache without error plzzz
cd /home/daytona/workspace/headache-pptx && python3 -m markitdown Headache_Clinical_Overview.pptx 2>&1 | head -50
cd /home/daytona/workspace/headache-pptx && node -e " const pptxgen = require('pptxgenjs'); const p = new pptxgen(); const s = p.addSlide(); s.addText('Test', {x:1,y:1,w:8,h:1,fontSize:24,color:'FFFFFF'}); p.writeFile({fileName:'test.pptx'}).then(()=>console.log('OK')).catch(e=>console.error(e)); " 2>&1
cd /home/daytona/workspace/headache-pptx && node build.js 2>&1
cd /home/daytona/workspace/headache-pptx && python3 -c " import zipfile, os path = 'Headache_Clinical_Overview.pptx' print('File size:', os.path.getsize(path), 'bytes') try: with zipfile.ZipFile(path, 'r') as z: names = z.namelist() slides = [n for n in names if n.startswith('ppt/slides/slide') and n.endswith('.xml') and '/rels/' not in n] print('Valid OOXML zip: YES') print('Slide count:', len(slides)) print('Slides:', sorted(slides)) except Exception as e: print('ERROR:', e) " 2>&1
cd /home/daytona/workspace/headache-pptx && python3 -c " import zipfile, xml.etree.ElementTree as ET errors = [] with zipfile.ZipFile('Headache_Clinical_Overview.pptx','r') as z: for name in z.namelist(): if name.endswith('.xml') or name.endswith('.rels'): try: ET.fromstring(z.read(name)) except ET.ParseError as e: errors.append((name, str(e))) if errors: for n,e in errors: print('XML ERROR in', n, ':', e) else: print('All XML valid - no errors found') " 2>&1
Headache Clinical Overview
Presentation · PPTX
| # | Topic |
|---|---|
| 1 | Title slide |
| 2 | Definition & Classification (ICHD-3 / Red Flags SNOOP4) |
| 3 | Epidemiology (stats & figures) |
| 4 | Migraine - Clinical Features + real aura photo |
| 5 | Migraine Aura & Visual Phenomena + scintillating scotoma photo |
| 6 | Pathogenesis of Migraine (trigeminovascular / CGRP / CSD) + diagram |
| 7 | Tension-Type Headache - comparison table vs Migraine |
| 8 | Cluster Headache + real clinical photo |
| 9 | Other Primary Headaches (thunderclap, hypnic, cough, exercise, stabbing) |
| 10 | Medication Overuse Headache |
| 11 | Secondary Headaches & Red Flags (SAH, meningitis, SOL, GCA) |
| 12 | Diagnosis & Investigations - flowchart |
| 13 | Treatment of Migraine (acute + preventive) |
| 14 | Treatment of Cluster & Tension Headaches |
| 15 | Key Takeaways |
Please give me only defination slide of headaches
~/headache-pptx/definition_slide.js
const pptxgen = require("pptxgenjs");
const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Headache - Definition";
// ── Palette ──────────────────────────────────────────────────────────────────
const DARK = "0D1B2A";
const NAVY = "1B4F72";
const STEEL = "1A5276";
const ACCENT = "E74C3C";
const GOLD = "F39C12";
const LIGHT = "D6EAF8";
const WHITE = "FFFFFF";
const GRAY = "BDC3C7";
// ── Helper: make a definition card ──────────────────────────────────────────
function card(sl, x, y, w, h, icon, title, titleColor, bgColor, borderColor, textItems) {
// Card background
sl.addShape(pres.ShapeType.rect, {
x, y, w, h,
fill: { color: bgColor },
line: { color: borderColor, pt: 1.5 },
});
// Accent top bar
sl.addShape(pres.ShapeType.rect, {
x, y, w, h: 0.05,
fill: { color: borderColor },
});
// Icon circle
sl.addShape(pres.ShapeType.ellipse, {
x: x + 0.12, y: y + 0.12, w: 0.38, h: 0.38,
fill: { color: borderColor },
});
sl.addText(icon, {
x: x + 0.12, y: y + 0.12, w: 0.38, h: 0.38,
fontSize: 14, color: WHITE, fontFace: "Segoe UI Emoji",
align: "center", valign: "middle",
});
// Title
sl.addText(title, {
x: x + 0.6, y: y + 0.14, w: w - 0.72, h: 0.35,
fontSize: 13, bold: true, color: titleColor,
fontFace: "Calibri", margin: 0,
});
// Bullet text
const richText = textItems.map((t, i) => ({
text: t,
options: {
bullet: { code: "25B6", color: borderColor },
breakLine: i < textItems.length - 1,
fontSize: 11.2,
color: DARK,
fontFace: "Calibri",
},
}));
sl.addText(richText, {
x: x + 0.15, y: y + 0.54, w: w - 0.28, h: h - 0.64,
valign: "top",
});
}
// ════════════════════════════════════════════════════════════════════════════
const sl = pres.addSlide();
// ── Full background ──────────────────────────────────────────────────────────
sl.addShape(pres.ShapeType.rect, {
x: 0, y: 0, w: "100%", h: "100%",
fill: { color: "EAF2FB" },
});
// ── Left sidebar accent ──────────────────────────────────────────────────────
sl.addShape(pres.ShapeType.rect, {
x: 0, y: 0, w: 0.12, h: "100%",
fill: { color: NAVY },
});
// ── Header band ─────────────────────────────────────────────────────────────
sl.addShape(pres.ShapeType.rect, {
x: 0, y: 0, w: "100%", h: 1.05,
fill: { color: DARK },
});
sl.addShape(pres.ShapeType.rect, {
x: 0, y: 1.0, w: "100%", h: 0.06,
fill: { color: ACCENT },
});
// ── Slide title ──────────────────────────────────────────────────────────────
sl.addText("HEADACHE", {
x: 0.22, y: 0.05, w: 5.5, h: 0.55,
fontSize: 34, bold: true, color: WHITE,
fontFace: "Calibri", charSpacing: 6, margin: 0,
});
sl.addText("Definition & Classification", {
x: 0.22, y: 0.58, w: 5.5, h: 0.38,
fontSize: 16, color: GOLD, fontFace: "Calibri", italic: true, margin: 0,
});
// ── Reference badge ──────────────────────────────────────────────────────────
sl.addShape(pres.ShapeType.rect, {
x: 7.1, y: 0.18, w: 2.7, h: 0.65,
fill: { color: NAVY },
line: { color: GOLD, pt: 1 },
});
sl.addText("Reference:\nGoldman-Cecil Medicine\nAdams & Victor's Neurology\nBradley-Daroff Neurology", {
x: 7.15, y: 0.18, w: 2.6, h: 0.65,
fontSize: 8, color: GOLD, fontFace: "Calibri",
align: "center", valign: "middle",
});
// ── MASTER DEFINITION BOX ────────────────────────────────────────────────────
sl.addShape(pres.ShapeType.rect, {
x: 0.18, y: 1.1, w: 9.64, h: 0.78,
fill: { color: DARK },
line: { color: ACCENT, pt: 1.5 },
});
sl.addText([
{ text: "DEFINITION: ", options: { bold: true, color: GOLD, fontSize: 13.5, fontFace: "Calibri" } },
{ text: "Headache (cephalalgia) is defined as pain arising from activation of pain-sensitive intracranial and extracranial structures. It arises when trauma, inflammation, traction, compression, or distortion of these structures transmits nociceptive signals — predominantly via cranial nerves V, VII, IX, X and cervical roots C1–C3 — to the central nervous system.", options: { color: WHITE, fontSize: 12.5, fontFace: "Calibri" } },
], {
x: 0.28, y: 1.12, w: 9.42, h: 0.72,
valign: "middle",
});
// ── 4 definition cards (2×2 grid) ───────────────────────────────────────────
// Card 1 – Migraine
card(
sl,
0.18, 1.96, 4.72, 1.63,
"M",
"MIGRAINE HEADACHE",
STEEL, WHITE, STEEL,
[
"Inherited disorder; typically unilateral, pulsatile, moderate–severe",
"Worsened by routine activity; lasts 4–72 hours",
"Associated with nausea/vomiting, photophobia, phonophobia",
"May occur with aura (visual, sensory, motor, language) or without",
"Aura: focal neurologic symptom; visual auras = 90% of cases",
]
);
// Card 2 – Tension-Type
card(
sl,
5.1, 1.96, 4.72, 1.63,
"T",
"TENSION-TYPE HEADACHE",
"27AE60", WHITE, "27AE60",
[
"Mild-to-moderate bilateral ('holocranial') pressing/tightening pain",
"No nausea or vomiting; NOT worsened by activity",
"Photophobia OR phonophobia — but not both simultaneously",
"Most common headache type; more prevalent in women",
"Episodic (<15 days/month) or chronic (≥15 days/month)",
]
);
// Card 3 – Cluster / TACs
card(
sl,
0.18, 3.67, 4.72, 1.58,
"C",
"CLUSTER HEADACHE & TACs",
"7D3C98", WHITE, "7D3C98",
[
"Trigeminal autonomic cephalalgias (TACs): unilateral + ipsilateral autonomic features",
"Cluster: most painful recurrent headache; strictly unilateral; behind/around the eye",
"Ipsilateral lacrimation, conjunctival injection, rhinorrhea, ptosis, miosis",
"Prevalence 56–401/100,000; male predominance (3:1); onset 20–30 yrs",
"Paroxysmal hemicrania & SUNCT are rarer TAC subtypes",
]
);
// Card 4 – Primary vs Secondary
card(
sl,
5.1, 3.67, 4.72, 1.58,
"P",
"PRIMARY vs SECONDARY (ICHD-3)",
ACCENT, WHITE, ACCENT,
[
"PRIMARY: headache IS the disorder — no underlying structural disease (migraine, TTH, cluster)",
"SECONDARY: headache is a SYMPTOM of an identifiable underlying cause (SAH, infection, SOL, GCA)",
"ICHD-3 (2018): 3 main groups + appendix; guides diagnosis worldwide",
"Pain-sensitive structures: circle of Willis branches, dural arteries, venous sinuses, CN V/VII/IX/X",
"Cranial nerves & C1–C3 roots transmit pain from intracranial & extracranial structures",
]
);
// ── Footer ───────────────────────────────────────────────────────────────────
sl.addShape(pres.ShapeType.rect, {
x: 0, y: 5.38, w: "100%", h: 0.245,
fill: { color: DARK },
});
sl.addText(
"Goldman-Cecil Medicine, 26th Ed. (ISBN 9780323930345) | Adams & Victor's Principles of Neurology, 12th Ed. (ISBN 9781264264520) | Bradley-Daroff's Neurology in Clinical Practice (ISBN 9780323642613) | ICHD-3, 2018",
{
x: 0.18, y: 5.38, w: 9.6, h: 0.245,
fontSize: 8, color: GRAY, fontFace: "Calibri",
align: "center", valign: "middle",
}
);
// ════════════════════════════════════════════════════════════════════════════
pres
.writeFile({ fileName: "/home/daytona/workspace/headache-pptx/Headache_Definition_Slide.pptx" })
.then(() => console.log("DONE"))
.catch((e) => { console.error("ERROR:", e); process.exit(1); });
cd /home/daytona/workspace/headache-pptx && node definition_slide.js 2>&1
python3 -c " import zipfile, xml.etree.ElementTree as ET, os path = '/home/daytona/workspace/headache-pptx/Headache_Definition_Slide.pptx' print('Size:', os.path.getsize(path), 'bytes') errors = [] with zipfile.ZipFile(path,'r') as z: slides = [n for n in z.namelist() if n.startswith('ppt/slides/slide') and n.endswith('.xml') and '/rels/' not in n] print('Slides:', len(slides)) for name in z.namelist(): if name.endswith('.xml') or name.endswith('.rels'): try: ET.fromstring(z.read(name)) except ET.ParseError as e: errors.append((name, str(e))) print('XML errors:', errors if errors else 'None - all valid') "
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.
Add one more slide of secondary headache treatment