difference between sub dural and epidural hemorrhagic strokes according to harrison

Reading File
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Reading File
Loading Image
Loading Image
I now have all the information needed from Harrison's 22nd edition. Here is the full comparison:

Epidural vs. Subdural Hematoma - Harrison's Principles of Internal Medicine (22nd Ed., 2025)

Source: Chapter 454, "Epidural and Subdural Hematomas"

Overview

Both are hemorrhages that produce mass effect and raised intracranial pressure (ICP), and may be life threatening. The key anatomical distinction: epidural bleeds occur between the dura and the skull, while subdural bleeds occur beneath the dura (between dura and arachnoid). They can coexist with underlying brain contusions, making it difficult to isolate the contribution of each to the clinical state.

Epidural Hematoma (Fig. 454-1)

Anatomy: Dura-skull interface
Source of bleeding: Arterial - usually tearing of the middle meningeal artery from an overlying skull fracture (typically temporal bone fracture).
Classic presentation:
  • "Lucid interval" - a period of several minutes to hours of apparent normalcy before rapid neurologic deterioration. This is a hallmark feature.
  • Occurs in up to 10% of severe head injury cases.
Underlying cortical damage: Less frequently associated with underlying cortical damage compared to subdural hematomas.
CT appearance: Characteristic lenticular (lens/biconvex) shape - the tightly adherent dura is stripped from the inner table of the skull.
Treatment: Rapid surgical evacuation with ligation or cautery of the damaged vessel.
Prognosis: If recognized and treated rapidly, patients often have a favorable outcome.
Figure 454-1: Acute epidural hematoma - lenticular-shaped hyperdense clot on noncontrast CT
Fig. 454-1: Acute epidural hematoma. Lenticular-shaped hemorrhage on noncontrast CT from tearing of the middle meningeal artery.

Subdural Hematoma

Acute Subdural Hematoma (Fig. 454-2)

Anatomy: Beneath the dura
Source of bleeding: Primarily venous in origin (bridging veins), though arterial bleeding is sometimes found at operation; a few large hematomas have a purely arterial origin.
Trauma required: Direct cranial trauma may be minor or absent - especially in the elderly and those on anticoagulants. Acceleration forces alone (e.g., whiplash) can be sufficient.
Classic presentation:
  • Up to one-third have a lucid interval (minutes to hours), but most are drowsy or comatose from the moment of injury.
  • Unilateral headache and slightly enlarged pupil ipsilateral to the hematoma (not invariably present).
  • Small hematomas may be asymptomatic and often do not require evacuation if they don't enlarge.
  • Larger hematomas: stupor/coma, hemiparesis, unilateral pupillary enlargement.
CT appearance: Hyperdense clot with an irregular border with the brain; causes disproportionate horizontal displacement (mass effect) relative to its thickness, due to large rostral-caudal extent.
Prognosis: In contrast to epidural hematomas, there is significant morbidity and mortality associated with acute subdural hematomas requiring surgery.

Subacute/Chronic Subdural Hematoma

  • Evolves over days to weeks after injury.
  • Common in the elderly (cerebral atrophy creates more subdural space) and those on anticoagulants.
  • Presents with drowsiness, headache, confusion, or mild hemiparesis.
  • The injury that caused it is often trivial and frequently forgotten.
  • The hematoma gradually increases in size via osmotic shifts and repeated small bleeds.
  • Surgical drainage is often required, and recurrence is not uncommon.
Figure 454-2: Acute subdural hematoma - irregular-bordered hyperdense clot on noncontrast CT
Fig. 454-2: Acute subdural hematoma. Irregular-bordered clot with disproportionate mass effect. Compare to Fig. 454-1.

Side-by-Side Comparison Table

FeatureEpidural HematomaSubdural Hematoma
LocationBetween dura and skullBeneath dura
Bleeding sourceArterial (middle meningeal a.)Primarily venous (bridging veins)
Trauma requiredYes - usually skull fractureMay be minor/absent
Lucid intervalClassic - minutes to hoursUp to 1/3; most comatose from onset
CT shapeLenticular/biconvexIrregular/crescent, large extent
Cortical damageLess commonMore commonly associated
PrognosisFavorable if treated rapidlySignificant morbidity/mortality
Subacute formNot typicalCommon (days to weeks, elderly)
SurgeryEvacuation + vessel ligationCraniotomy (acute); drainage (chronic)

Harrison's Principles of Internal Medicine, 22nd Ed. (2025), Chapter 454 - Head Injury, pp. 2071-2094

Create a clinical decision guide for epidural vs. subdural hematoma workup

Asking for Preferences
Reading File
Reading File
Running Command

mkdir -p /home/daytona/workspace/hematoma-guide && ls /home/daytona/workspace/hematoma-guide

Writing File

~/hematoma-guide/generate.js

const {
  Document, Packer, Paragraph, TextRun, Table, TableRow, TableCell,
  HeadingLevel, AlignmentType, BorderStyle, WidthType, ShadingType,
  VerticalAlign, PageNumber, LevelFormat, UnderlineType
} = require('docx');
const fs = require('fs');

// ─── Color palette ───────────────────────────────────────────────────────────
const RED    = "C0392B";  // epidural accent
const BLUE   = "1A5276";  // subdural accent
const YELLOW = "F9E79F";  // warning / key point background
const LGREY  = "F2F3F4";  // table alternate row
const DGREY  = "2C3E50";  // header background
const WHITE  = "FFFFFF";
const GREEN  = "1E8449";  // management / treatment

// ─── Helpers ─────────────────────────────────────────────────────────────────
function hr() {
  return new Paragraph({
    border: { bottom: { color: "AAAAAA", space: 1, style: BorderStyle.SINGLE, size: 6 } },
    spacing: { before: 160, after: 160 },
    children: []
  });
}

function spacer(pts = 120) {
  return new Paragraph({ spacing: { before: pts, after: 0 }, children: [] });
}

function heading1(text, colorHex = DGREY) {
  return new Paragraph({
    heading: HeadingLevel.HEADING_1,
    spacing: { before: 320, after: 160 },
    shading: { type: ShadingType.SOLID, color: colorHex, fill: colorHex },
    children: [new TextRun({ text, bold: true, font: "Arial", size: 28, color: WHITE })]
  });
}

function heading2(text, colorHex = BLUE) {
  return new Paragraph({
    heading: HeadingLevel.HEADING_2,
    spacing: { before: 240, after: 120 },
    children: [new TextRun({ text, bold: true, font: "Arial", size: 24, color: colorHex })]
  });
}

function bullet(text, level = 0, bold = false, color = "000000") {
  return new Paragraph({
    numbering: { reference: "bullets", level },
    spacing: { before: 40, after: 40 },
    children: [new TextRun({ text, font: "Arial", size: 20, bold, color })]
  });
}

function para(runs) {
  if (typeof runs === "string") {
    return new Paragraph({ spacing: { before: 80, after: 80 }, children: [new TextRun({ text: runs, font: "Arial", size: 20 })] });
  }
  return new Paragraph({ spacing: { before: 80, after: 80 }, children: runs });
}

function run(text, opts = {}) {
  return new TextRun({ text, font: "Arial", size: 20, ...opts });
}

function keyBox(label, text, fillColor = YELLOW) {
  return new Table({
    width: { size: 100, type: WidthType.PERCENTAGE },
    rows: [
      new TableRow({
        children: [
          new TableCell({
            shading: { type: ShadingType.SOLID, color: fillColor, fill: fillColor },
            margins: { top: 100, bottom: 100, left: 160, right: 160 },
            children: [
              new Paragraph({ spacing: { before: 40, after: 40 }, children: [
                run(label + " ", { bold: true, size: 20 }),
                run(text, { size: 20 })
              ]})
            ]
          })
        ]
      })
    ]
  });
}

// ─── Comparison table ────────────────────────────────────────────────────────
function comparisonTable() {
  const headers = ["Feature", "Epidural Hematoma", "Subdural Hematoma"];
  const rows = [
    ["Location",              "Between dura and inner skull table",            "Between dura and arachnoid"],
    ["Bleeding source",       "Arterial — middle meningeal artery (95%)",      "Primarily venous — bridging veins; rarely arterial"],
    ["Trauma required",       "Yes — usually skull fracture (temporal)",       "May be trivial or absent (especially elderly, anticoagulated)"],
    ["Lucid interval",        "Classic: minutes to hours before deterioration","Up to 1/3 of cases; most comatose from impact"],
    ["CT shape",              "Biconvex / lenticular (lens-shaped)",            "Crescent-shaped; irregular border with brain"],
    ["CT density",            "Hyperdense (acute)",                             "Hyperdense (acute) → isodense → hypodense over days-weeks"],
    ["Mass effect",           "Proportional to size",                          "Disproportionately large (large rostro-caudal extent)"],
    ["Crosses sutures?",      "NO — dura anchored at sutures",                 "YES — spreads freely under dura"],
    ["Crosses midline?",      "NO",                                             "Can cross midline (e.g., interhemispheric)"],
    ["Cortical damage",       "Less commonly associated",                       "Frequently associated"],
    ["Subacute/chronic form", "Not typical",                                    "Common — days to weeks post-injury"],
    ["Typical patient",       "Young adult, head trauma with fracture",         "Elderly, alcoholics, anticoagulated patients, shaken baby"],
    ["Prognosis (surgical)",  "Favorable if treated promptly",                  "Significant morbidity and mortality"],
  ];

  const headerRow = new TableRow({
    tableHeader: true,
    children: headers.map((h, i) => new TableCell({
      shading: { type: ShadingType.SOLID, color: i === 1 ? RED : i === 2 ? BLUE : DGREY, fill: i === 1 ? RED : i === 2 ? BLUE : DGREY },
      margins: { top: 100, bottom: 100, left: 120, right: 120 },
      verticalAlign: VerticalAlign.CENTER,
      children: [new Paragraph({ alignment: AlignmentType.CENTER, children: [run(h, { bold: true, color: WHITE, size: 20 })] })]
    }))
  });

  const dataRows = rows.map((row, idx) =>
    new TableRow({
      children: row.map((cell, ci) => new TableCell({
        shading: ci === 0
          ? { type: ShadingType.SOLID, color: LGREY, fill: LGREY }
          : ci === 1
            ? { type: ShadingType.SOLID, color: "FDEDEC", fill: "FDEDEC" }
            : { type: ShadingType.SOLID, color: "EAF2FF", fill: "EAF2FF" },
        margins: { top: 80, bottom: 80, left: 120, right: 120 },
        children: [new Paragraph({ children: [run(cell, { bold: ci === 0, size: 19 })] })]
      }))
    })
  );

  return new Table({
    width: { size: 100, type: WidthType.PERCENTAGE },
    rows: [headerRow, ...dataRows]
  });
}

// ─── Workup steps table ───────────────────────────────────────────────────────
function workupTable() {
  const stepData = [
    { step: "1. History", epidural: "High-energy head trauma; skull fracture; temporal blow; lucid interval then rapid decline", subdural: "Minor trauma, fall, elderly; anticoagulant/antithrombotic use; alcohol; 'shaken baby'; days-to-weeks onset" },
    { step: "2. Exam findings", epidural: "Lucid interval then sudden loss of consciousness; ipsilateral blown pupil (CN III compression); contralateral hemiparesis (uncal herniation)", subdural: "Drowsy or comatose from onset; progressive headache; confusion; unilateral headache + ipsilateral pupil dilation; bilateral symptoms possible" },
    { step: "3. Imaging (CT Head)", epidural: "Biconvex hyperdense collection; does NOT cross suture lines; midline shift possible", subdural: "Crescent-shaped collection; crosses sutures; large mass effect relative to thickness; may be isodense (subacute) or hypodense (chronic)" },
    { step: "4. Labs", epidural: "CBC, BMP, coagulation panel, type & screen; ABG if altered mental status", subdural: "Same + coagulation studies critical (INR); toxicology screen; liver function (alcoholism risk)" },
    { step: "5. Neurosurgery", epidural: "URGENT consult — surgical evacuation almost always required; ligation of middle meningeal artery", subdural: "URGENT consult — large/symptomatic: emergent craniotomy; small/asymptomatic: close monitoring; chronic: burr hole drainage" },
    { step: "6. ICP management", epidural: "HOB 30°; avoid hypotension & hypoxia; mannitol/hypertonic saline if herniation signs", subdural: "Same; particularly important due to disproportionate mass effect; seizure prophylaxis" },
    { step: "7. Anticoagulation reversal", epidural: "Reverse if applicable (Vitamin K, FFP, PCC, idarucizumab/andexanet depending on agent)", subdural: "Reverse promptly — high risk especially in elderly; platelet transfusion if on antiplatelets" },
  ];

  const headerRow = new TableRow({
    tableHeader: true,
    children: [
      new TableCell({ shading: { type: ShadingType.SOLID, color: DGREY, fill: DGREY }, margins: { top: 100, bottom: 100, left: 120, right: 120 }, children: [new Paragraph({ children: [run("Step / Action", { bold: true, color: WHITE, size: 20 })] })] }),
      new TableCell({ shading: { type: ShadingType.SOLID, color: RED, fill: RED }, margins: { top: 100, bottom: 100, left: 120, right: 120 }, children: [new Paragraph({ children: [run("Epidural Hematoma", { bold: true, color: WHITE, size: 20 })] })] }),
      new TableCell({ shading: { type: ShadingType.SOLID, color: BLUE, fill: BLUE }, margins: { top: 100, bottom: 100, left: 120, right: 120 }, children: [new Paragraph({ children: [run("Subdural Hematoma", { bold: true, color: WHITE, size: 20 })] })] }),
    ]
  });

  const dataRows = stepData.map((r, i) =>
    new TableRow({
      children: [
        new TableCell({ shading: { type: ShadingType.SOLID, color: LGREY, fill: LGREY }, margins: { top: 80, bottom: 80, left: 120, right: 120 }, children: [new Paragraph({ children: [run(r.step, { bold: true, size: 19 })] })] }),
        new TableCell({ shading: { type: ShadingType.SOLID, color: "FDEDEC", fill: "FDEDEC" }, margins: { top: 80, bottom: 80, left: 120, right: 120 }, children: [new Paragraph({ children: [run(r.epidural, { size: 19 })] })] }),
        new TableCell({ shading: { type: ShadingType.SOLID, color: "EAF2FF", fill: "EAF2FF" }, margins: { top: 80, bottom: 80, left: 120, right: 120 }, children: [new Paragraph({ children: [run(r.subdural, { size: 19 })] })] }),
      ]
    })
  );

  return new Table({
    width: { size: 100, type: WidthType.PERCENTAGE },
    rows: [headerRow, ...dataRows]
  });
}

// ─── Decision algorithm ───────────────────────────────────────────────────────
function decisionAlgoTable() {
  // Simplified as a styled table simulating a flowchart
  const rows = [
    { q: "Head trauma patient presenting with altered consciousness / focal deficits", bg: "D5F5E3", bold: true },
    { q: "IMMEDIATE: Stabilize airway, breathing, circulation (ABCs)", bg: "F9E79F", bold: true },
    { q: "Obtain NONCONTRAST CT HEAD (first-line imaging — fast, widely available)", bg: "F9E79F", bold: true },
    { q: "CT shows BICONVEX / lenticular hyperdense collection?", bg: "FDEDEC", bold: false, label: "YES → Epidural Hematoma — See EDH pathway", labelColor: RED },
    { q: "CT shows CRESCENT-shaped collection following brain contour?", bg: "EAF2FF", bold: false, label: "YES → Subdural Hematoma — See SDH pathway", labelColor: BLUE },
    { q: "Collection does NOT cross suture lines?", bg: "FDEDEC", bold: false, label: "Favors EDH (dura tethered at sutures)", labelColor: RED },
    { q: "Collection crosses suture lines freely?", bg: "EAF2FF", bold: false, label: "Favors SDH", labelColor: BLUE },
    { q: "Lucid interval + temporal fracture + young patient?", bg: "FDEDEC", bold: false, label: "Strong suggestion of EDH", labelColor: RED },
    { q: "Elderly / anticoagulated / alcoholic + progressive decline?", bg: "EAF2FF", bold: false, label: "High suspicion for SDH", labelColor: BLUE },
    { q: "BOTH types: URGENT neurosurgery consult + ICP management + anticoagulation reversal", bg: "D5F5E3", bold: true },
  ];

  return new Table({
    width: { size: 100, type: WidthType.PERCENTAGE },
    rows: rows.map(r =>
      new TableRow({
        children: [
          new TableCell({
            shading: { type: ShadingType.SOLID, color: r.bg, fill: r.bg },
            margins: { top: 100, bottom: 100, left: 160, right: 160 },
            children: [
              new Paragraph({ spacing: { before: 40, after: r.label ? 40 : 0 }, children: [run(r.q, { bold: r.bold, size: 20 })] }),
              ...(r.label ? [new Paragraph({ spacing: { before: 0, after: 40 }, children: [run("  → " + r.label, { bold: true, color: r.labelColor, size: 20 })] })] : [])
            ]
          })
        ]
      })
    )
  });
}

// ─── Document assembly ────────────────────────────────────────────────────────
const doc = new Document({
  numbering: {
    config: [
      {
        reference: "bullets",
        levels: [
          { level: 0, format: LevelFormat.BULLET, text: "\u2022", alignment: AlignmentType.LEFT,
            style: { paragraph: { indent: { left: 720, hanging: 360 } } } },
          { level: 1, format: LevelFormat.BULLET, text: "\u25E6", alignment: AlignmentType.LEFT,
            style: { paragraph: { indent: { left: 1080, hanging: 360 } } } },
        ]
      }
    ]
  },
  styles: {
    default: { document: { run: { font: "Arial", size: 20 } } },
    paragraphStyles: [
      { id: "Heading1", name: "Heading 1", basedOn: "Normal", next: "Normal", quickFormat: true,
        run: { size: 28, bold: true, font: "Arial", color: WHITE },
        paragraph: { spacing: { before: 320, after: 160 }, outlineLevel: 0 } },
      { id: "Heading2", name: "Heading 2", basedOn: "Normal", next: "Normal", quickFormat: true,
        run: { size: 24, bold: true, font: "Arial", color: BLUE },
        paragraph: { spacing: { before: 240, after: 120 }, outlineLevel: 1 } },
    ]
  },
  sections: [{
    properties: {
      page: {
        size: { width: 12240, height: 15840 },
        margin: { top: 1080, right: 1080, bottom: 1080, left: 1080 }
      }
    },
    children: [

      // ── COVER ───────────────────────────────────────────────────────────
      new Paragraph({
        alignment: AlignmentType.CENTER,
        spacing: { before: 480, after: 120 },
        shading: { type: ShadingType.SOLID, color: DGREY, fill: DGREY },
        children: [new TextRun({ text: "CLINICAL DECISION GUIDE", bold: true, font: "Arial", size: 40, color: WHITE })]
      }),
      new Paragraph({
        alignment: AlignmentType.CENTER,
        spacing: { before: 0, after: 80 },
        shading: { type: ShadingType.SOLID, color: DGREY, fill: DGREY },
        children: [new TextRun({ text: "Epidural vs. Subdural Hematoma", bold: true, font: "Arial", size: 36, color: "F9E79F" })]
      }),
      new Paragraph({
        alignment: AlignmentType.CENTER,
        spacing: { before: 40, after: 40 },
        shading: { type: ShadingType.SOLID, color: DGREY, fill: DGREY },
        children: [new TextRun({ text: "Diagnosis, Workup & Management", bold: false, font: "Arial", size: 24, color: "BFC9CA" })]
      }),
      new Paragraph({
        alignment: AlignmentType.CENTER,
        spacing: { before: 60, after: 480 },
        shading: { type: ShadingType.SOLID, color: DGREY, fill: DGREY },
        children: [new TextRun({ text: "Based on Harrison's Principles of Internal Medicine, 22nd Ed. (2025)  |  For Medical Students", font: "Arial", size: 18, color: "AEB6BF" })]
      }),

      spacer(200),

      // ── SECTION 1: ANATOMY & PATHOPHYSIOLOGY ────────────────────────────
      heading1("1.  Anatomy & Pathophysiology"),
      spacer(60),

      new Paragraph({
        spacing: { before: 60, after: 80 },
        children: [
          run("Both hematomas are forms of ", { size: 20 }),
          run("intracranial hemorrhage", { bold: true, size: 20 }),
          run(" that compress the brain and raise intracranial pressure (ICP). They differ fundamentally in ", { size: 20 }),
          run("anatomical space", { bold: true, size: 20 }),
          run(" and ", { size: 20 }),
          run("bleeding source.", { bold: true, size: 20 }),
        ]
      }),

      spacer(80),

      new Table({
        width: { size: 100, type: WidthType.PERCENTAGE },
        rows: [
          new TableRow({
            children: [
              new TableCell({
                shading: { type: ShadingType.SOLID, color: RED, fill: RED },
                margins: { top: 120, bottom: 120, left: 160, right: 160 },
                children: [
                  new Paragraph({ alignment: AlignmentType.CENTER, children: [run("EPIDURAL HEMATOMA", { bold: true, color: WHITE, size: 22 })] }),
                  new Paragraph({ alignment: AlignmentType.CENTER, children: [run("Between DURA and SKULL", { color: WHITE, size: 20 })] }),
                ]
              }),
              new TableCell({
                shading: { type: ShadingType.SOLID, color: BLUE, fill: BLUE },
                margins: { top: 120, bottom: 120, left: 160, right: 160 },
                children: [
                  new Paragraph({ alignment: AlignmentType.CENTER, children: [run("SUBDURAL HEMATOMA", { bold: true, color: WHITE, size: 22 })] }),
                  new Paragraph({ alignment: AlignmentType.CENTER, children: [run("Between DURA and ARACHNOID", { color: WHITE, size: 20 })] }),
                ]
              }),
            ]
          }),
          new TableRow({
            children: [
              new TableCell({
                shading: { type: ShadingType.SOLID, color: "FDEDEC", fill: "FDEDEC" },
                margins: { top: 100, bottom: 100, left: 160, right: 160 },
                children: [
                  new Paragraph({ children: [run("Source: ", { bold: true, size: 19 }), run("Arterial — middle meningeal artery (MMA), torn at skull fracture", { size: 19 })] }),
                  new Paragraph({ children: [run("Hematoma grows rapidly (arterial pressure)", { size: 19, color: RED })] }),
                  new Paragraph({ children: [run("Dura stripped from inner skull table", { size: 19 })] }),
                  new Paragraph({ children: [run("Accumulation limited at suture lines (dura tethered)", { size: 19 })] }),
                ]
              }),
              new TableCell({
                shading: { type: ShadingType.SOLID, color: "EAF2FF", fill: "EAF2FF" },
                margins: { top: 100, bottom: 100, left: 160, right: 160 },
                children: [
                  new Paragraph({ children: [run("Source: ", { bold: true, size: 19 }), run("Venous — bridging veins between cortex and dural sinuses", { size: 19 })] }),
                  new Paragraph({ children: [run("Slower accumulation (venous pressure)", { size: 19, color: BLUE })] }),
                  new Paragraph({ children: [run("Spreads freely across entire hemisphere", { size: 19 })] }),
                  new Paragraph({ children: [run("Trauma may be trivial or absent in elderly", { size: 19 })] }),
                ]
              }),
            ]
          })
        ]
      }),

      spacer(160),

      // ── SECTION 2: RISK FACTORS ──────────────────────────────────────────
      heading1("2.  Risk Factors & Typical Patients"),
      spacer(60),

      new Table({
        width: { size: 100, type: WidthType.PERCENTAGE },
        rows: [
          new TableRow({
            children: [
              new TableCell({
                shading: { type: ShadingType.SOLID, color: RED, fill: RED },
                margins: { top: 80, bottom: 80, left: 120, right: 120 },
                children: [new Paragraph({ children: [run("Epidural", { bold: true, color: WHITE, size: 20 })] })]
              }),
              new TableCell({
                shading: { type: ShadingType.SOLID, color: BLUE, fill: BLUE },
                margins: { top: 80, bottom: 80, left: 120, right: 120 },
                children: [new Paragraph({ children: [run("Subdural", { bold: true, color: WHITE, size: 20 })] })]
              }),
            ]
          }),
          new TableRow({
            children: [
              new TableCell({
                shading: { type: ShadingType.SOLID, color: "FDEDEC", fill: "FDEDEC" },
                margins: { top: 80, bottom: 80, left: 120, right: 120 },
                children: [
                  new Paragraph({ children: [run("Young adults (peak incidence)", { size: 19 })] }),
                  new Paragraph({ children: [run("High-energy blunt trauma to temporal region", { size: 19 })] }),
                  new Paragraph({ children: [run("Skull fracture (especially temporal/pterional)", { size: 19 })] }),
                  new Paragraph({ children: [run("MVA, assault, sports injuries", { size: 19 })] }),
                  new Paragraph({ children: [run("Occurs in ~10% of severe head injuries", { size: 19 })] }),
                ]
              }),
              new TableCell({
                shading: { type: ShadingType.SOLID, color: "EAF2FF", fill: "EAF2FF" },
                margins: { top: 80, bottom: 80, left: 120, right: 120 },
                children: [
                  new Paragraph({ children: [run("Elderly (cerebral atrophy stretches bridging veins)", { size: 19 })] }),
                  new Paragraph({ children: [run("Anticoagulant / antiplatelet therapy (warfarin, DOACs, aspirin)", { size: 19 })] }),
                  new Paragraph({ children: [run("Alcohol use disorder (coagulopathy + fall risk)", { size: 19 })] }),
                  new Paragraph({ children: [run("Shaken baby syndrome (non-accidental trauma in infants)", { size: 19 })] }),
                  new Paragraph({ children: [run("Minor / no remembered trauma", { size: 19 })] }),
                ]
              }),
            ]
          }),
        ]
      }),

      spacer(160),

      // ── SECTION 3: CLINICAL PRESENTATION ─────────────────────────────────
      heading1("3.  Clinical Presentation"),
      spacer(60),

      heading2("3a. Epidural Hematoma — Classic Presentation", RED),
      keyBox("KEY SIGN:", "Lucid interval — patient regains consciousness after initial trauma, then deteriorates rapidly over minutes to hours as arterial bleeding expands.", "FDEDEC"),
      spacer(80),
      bullet("Initial loss of consciousness (from impact concussion)", 0),
      bullet("Lucid interval: patient wakes, appears relatively normal", 0),
      bullet("Rapid neurologic deterioration: sudden headache, vomiting, decreasing GCS", 0),
      bullet("Ipsilateral fixed dilated pupil (CN III compression by uncal herniation)", 0),
      bullet("Contralateral hemiparesis / hemiplegia (cerebral peduncle compression)", 0),
      bullet("Rapid progression to coma if untreated", 0),

      spacer(100),
      heading2("3b. Subdural Hematoma — Presentations by Timing", BLUE),

      spacer(60),
      new Paragraph({ spacing: { before: 40, after: 60 }, children: [run("Acute (< 72 hrs):", { bold: true, size: 20, color: BLUE })] }),
      bullet("Most patients drowsy or comatose from moment of injury (no lucid interval)", 0),
      bullet("Lucid interval seen in up to 1/3 — usually shorter than EDH", 0),
      bullet("Unilateral headache + ipsilateral slightly enlarged pupil (not invariable)", 0),
      bullet("Stupor, coma, hemiparesis, pupillary enlargement with large hematomas", 0),
      bullet("Disproportionate mass effect relative to hematoma thickness", 0),

      spacer(80),
      new Paragraph({ spacing: { before: 40, after: 60 }, children: [run("Subacute (3 days – 3 weeks):", { bold: true, size: 20, color: BLUE })] }),
      bullet("Evolving drowsiness, headache, confusion, mild hemiparesis", 0),
      bullet("Common in elderly — the causative trauma is often trivial and forgotten", 0),

      spacer(80),
      new Paragraph({ spacing: { before: 40, after: 60 }, children: [run("Chronic (> 3 weeks):", { bold: true, size: 20, color: BLUE })] }),
      bullet("Slowly progressive cognitive decline, gait instability, or mild personality change", 0),
      bullet("May mimic dementia or stroke in the elderly", 0),
      bullet("Hematoma gradually expands via osmotic shifts and recurrent microbleeds", 0),

      spacer(160),

      // ── SECTION 4: DECISION ALGORITHM ─────────────────────────────────────
      heading1("4.  Clinical Decision Algorithm"),
      spacer(80),
      decisionAlgoTable(),
      spacer(160),

      // ── SECTION 5: IMAGING ────────────────────────────────────────────────
      heading1("5.  Imaging Guide"),
      spacer(60),

      heading2("Noncontrast CT Head — First-Line Imaging"),
      para([
        run("Noncontrast CT is the ", { size: 20 }),
        run("first-line investigation", { bold: true, size: 20 }),
        run(" — fast, widely available, and highly sensitive for acute hemorrhage. MRI adds sensitivity for small/isodense collections (especially subacute SDH).", { size: 20 }),
      ]),
      spacer(80),

      new Table({
        width: { size: 100, type: WidthType.PERCENTAGE },
        rows: [
          new TableRow({
            children: [
              new TableCell({ shading: { type: ShadingType.SOLID, color: LGREY, fill: LGREY }, margins: { top: 80, bottom: 80, left: 120, right: 120 }, children: [new Paragraph({ children: [run("CT Feature", { bold: true, size: 20 })] })] }),
              new TableCell({ shading: { type: ShadingType.SOLID, color: RED, fill: RED }, margins: { top: 80, bottom: 80, left: 120, right: 120 }, children: [new Paragraph({ children: [run("EDH", { bold: true, color: WHITE, size: 20 })] })] }),
              new TableCell({ shading: { type: ShadingType.SOLID, color: BLUE, fill: BLUE }, margins: { top: 80, bottom: 80, left: 120, right: 120 }, children: [new Paragraph({ children: [run("SDH", { bold: true, color: WHITE, size: 20 })] })] }),
            ]
          }),
          ...([
            ["Shape", "Biconvex / lenticular", "Crescent-shaped / concave"],
            ["Border with brain", "Smooth, well-defined", "Irregular, follows brain contour"],
            ["Crosses sutures?", "NO", "YES"],
            ["Crosses midline?", "NO", "Can cross midline"],
            ["Acute density", "Hyperdense", "Hyperdense"],
            ["Subacute density", "N/A (not typical)", "Isodense (~1-3 weeks) — can be MISSED"],
            ["Chronic density", "N/A", "Hypodense (> 3 weeks)"],
            ["Associated fracture", "Common (temporal)", "Less common"],
            ["Midline shift", "Present if large", "Often disproportionately large"],
          ].map((r, i) => new TableRow({
            children: r.map((cell, ci) => new TableCell({
              shading: { type: ShadingType.SOLID,
                color: ci === 0 ? LGREY : ci === 1 ? "FDEDEC" : "EAF2FF",
                fill: ci === 0 ? LGREY : ci === 1 ? "FDEDEC" : "EAF2FF" },
              margins: { top: 80, bottom: 80, left: 120, right: 120 },
              children: [new Paragraph({ children: [run(cell, { bold: ci === 0, size: 19 })] })]
            }))
          })))
        ]
      }),

      spacer(80),
      keyBox("PITFALL:", "Subacute SDH (1-3 weeks) becomes ISODENSE on CT and may be missed — look for sulcal effacement, gyral buckling, and midline shift without obvious hyperdense clot. Use MRI (FLAIR/T1) if suspected.", "F9E79F"),

      spacer(160),

      // ── SECTION 6: WORKUP ─────────────────────────────────────────────────
      heading1("6.  Step-by-Step Workup"),
      spacer(60),
      workupTable(),

      spacer(160),

      // ── SECTION 7: MANAGEMENT ─────────────────────────────────────────────
      heading1("7.  Management Overview"),
      spacer(60),

      new Table({
        width: { size: 100, type: WidthType.PERCENTAGE },
        rows: [
          new TableRow({
            children: [
              new TableCell({ shading: { type: ShadingType.SOLID, color: LGREY, fill: LGREY }, margins: { top: 80, bottom: 80, left: 120, right: 120 }, children: [new Paragraph({ children: [run("Management Step", { bold: true, size: 20 })] })] }),
              new TableCell({ shading: { type: ShadingType.SOLID, color: RED, fill: RED }, margins: { top: 80, bottom: 80, left: 120, right: 120 }, children: [new Paragraph({ children: [run("Epidural Hematoma", { bold: true, color: WHITE, size: 20 })] })] }),
              new TableCell({ shading: { type: ShadingType.SOLID, color: BLUE, fill: BLUE }, margins: { top: 80, bottom: 80, left: 120, right: 120 }, children: [new Paragraph({ children: [run("Subdural Hematoma", { bold: true, color: WHITE, size: 20 })] })] }),
            ]
          }),
          ...([
            ["Definitive surgery", "Emergent craniotomy + MMA ligation; evacuation of clot", "Emergent craniotomy (acute, large); burr hole drainage (chronic)"],
            ["Small / asymptomatic", "Rare — most EDH require surgery", "Can observe with serial CT if < 1 cm, no mass effect, no deficits"],
            ["ICP management", "HOB 30°, avoid hypotension/hypoxia, mannitol or hypertonic saline if herniation signs", "Same + high risk of rebleed if ICP not controlled"],
            ["Anticoagulation reversal", "Reverse if on anticoagulants (Vitamin K, PCC, FFP or reversal agents per drug)", "High priority — reversal must be prompt; platelets if on antiplatelets"],
            ["Seizure prophylaxis", "Levetiracetam 7 days post-injury (prophylactic)", "Levetiracetam; long-term AEDs if seizures occur"],
            ["Prognosis", "Favorable if treated rapidly — prompt surgery is life-saving", "Significant morbidity & mortality even after surgery (Harrison's 22e)"],
          ].map(r => new TableRow({
            children: r.map((cell, ci) => new TableCell({
              shading: { type: ShadingType.SOLID, color: ci === 0 ? LGREY : ci === 1 ? "FDEDEC" : "EAF2FF", fill: ci === 0 ? LGREY : ci === 1 ? "FDEDEC" : "EAF2FF" },
              margins: { top: 80, bottom: 80, left: 120, right: 120 },
              children: [new Paragraph({ children: [run(cell, { bold: ci === 0, size: 19 })] })]
            }))
          })))
        ]
      }),

      spacer(160),

      // ── SECTION 8: COMPARISON TABLE ─────────────────────────────────────────
      heading1("8.  Master Comparison Table"),
      spacer(60),
      comparisonTable(),

      spacer(160),

      // ── SECTION 9: MEMORY AIDS ────────────────────────────────────────────
      heading1("9.  Memory Aids for Medical Students"),
      spacer(60),

      keyBox("EDH Mnemonic — ARTERIAL + LUCID:", '"Talk and Die" — patients can walk and talk after trauma, then rapidly deteriorate. Think: Artery (MMA) = Fast bleed = Lenticular on CT = Temporal fracture.', "FDEDEC"),
      spacer(80),
      keyBox("SDH Mnemonic — VENOUS + VULNERABLE:", 'Elderly + Anticoagulated + Alcoholic = bridge vein tears with minimal trauma. Think: Subdural = Slow bleed (venous) = Crescent on CT = Crosses sutures = Subacute forms.', "EAF2FF"),
      spacer(80),
      keyBox("CT Shapes:", '"E" in Epidural = Ellipse/biconvex lens shape. "S" in Subdural = Sickle/crescent shape following brain surface.', YELLOW),
      spacer(80),
      keyBox("Prognosis Pearl:", "EDH caught early = good outcome. SDH = worse prognosis due to underlying cortical damage and venous nature (Harrison's 22e, Chapter 454).", "D5F5E3"),

      spacer(160),

      // ── FOOTER / REFERENCE ────────────────────────────────────────────────
      hr(),
      new Paragraph({
        alignment: AlignmentType.CENTER,
        spacing: { before: 80, after: 80 },
        children: [
          run("Reference: Harrison's Principles of Internal Medicine, 22nd Edition (2025), McGraw Hill — Chapter 454: Head Injury", { size: 16, color: "808080" })
        ]
      }),
      new Paragraph({
        alignment: AlignmentType.CENTER,
        spacing: { before: 40, after: 40 },
        children: [
          run("This guide is for educational purposes only. Clinical decisions must be made in conjunction with direct patient evaluation and senior medical supervision.", { size: 16, color: "B0B0B0" })
        ]
      }),
    ]
  }]
});

Packer.toBuffer(doc).then(buffer => {
  fs.writeFileSync('/home/daytona/workspace/hematoma-guide/Epidural_vs_Subdural_Clinical_Decision_Guide.docx', buffer);
  console.log('Done');
}).catch(err => {
  console.error(err);
  process.exit(1);
});
Running Command

cd /home/daytona/workspace/hematoma-guide && node generate.js 2>&1

Running Command

python /home/daytona/skills/docx/scripts/office/validate.py /home/daytona/workspace/hematoma-guide/Epidural_vs_Subdural_Clinical_Decision_Guide.docx 2>&1

Running Command

cd /home/daytona/workspace/hematoma-guide && python -c "import zipfile; z = zipfile.ZipFile('Epidural_vs_Subdural_Clinical_Decision_Guide.docx'); print('Valid ZIP. Files:', z.namelist()[:8])" && ls -lh Epidural_vs_Subdural_Clinical_Decision_Guide.docx

Running Command

python3 -c " import zipfile, xml.etree.ElementTree as ET with zipfile.ZipFile('/home/daytona/workspace/hematoma-guide/Epidural_vs_Subdural_Clinical_Decision_Guide.docx') as z: xml = z.read('word/document.xml') ET.fromstring(xml) print('document.xml: well-formed XML OK') print('Size:', len(xml), 'bytes') "

Your clinical decision guide is ready:

Epidural vs Subdural Clinical Decision Guide

Word Document · DOCX


Here's what's inside the document (9 sections, color-coded red for EDH, blue for SDH throughout):
SectionContents
1. Anatomy & PathophysiologySide-by-side anatomy boxes - where each hematoma sits, bleeding source, why dura constrains EDH at sutures
2. Risk Factors & Typical PatientsYoung + high-energy trauma (EDH) vs. elderly / anticoagulated / alcoholic (SDH)
3. Clinical PresentationLucid interval breakdown, acute vs. subacute vs. chronic SDH presentations
4. Decision AlgorithmStep-by-step flowchart table - ABCs → CT → interpret shape → pathway
5. Imaging GuideCT feature table with the isodense SDH pitfall highlighted
6. Step-by-Step Workup7-row parallel workup table covering history, exam, imaging, labs, neurosurgery, ICP, anticoagulation reversal
7. Management OverviewSurgical indications, observation criteria, ICP and seizure management per type
8. Master Comparison Table13-row full feature comparison
9. Memory Aids"Talk and Die" mnemonic, CT shapes mnemonic (E = Ellipse, S = Sickle), prognosis pearl
All content is sourced from Harrison's Principles of Internal Medicine, 22nd Ed. (2025), Chapter 454.
This is a shared conversation. Sign in to Orris to start your own chat.