attachment
attachment

This is the topic prepare a very nice ppt for this topic

analyse_media
Reading File
Reading File
Reading File
Finding Sources
Finding Sources
Finding Sources
Reading File
Running Command

ls /home/daytona/workspace/ 2>/dev/null || echo "workspace empty or not found"

Running Command

mkdir -p /home/daytona/workspace/cva-history-ppt

Writing File

~/cva-history-ppt/create_ppt.js

const pptxgen = require("pptxgenjs");

let pres = new pptxgen();
pres.layout = 'LAYOUT_16x9';
pres.title = 'History Taking in Cerebrovascular Accident (CVA)';
pres.author = 'Clinical Medicine';

// ────────────────────────────────────────────────
// COLOR PALETTE
// Deep navy dominates, accent red/crimson, white text
const C = {
  navy:    "0D1B2A",   // dominant background
  navyMid: "1B3356",   // mid-tone panels
  navyLt:  "1E4D78",   // lighter navy for cards
  red:     "C0392B",   // accent / headers
  crimson: "E74C3C",   // lighter accent
  gold:    "F39C12",   // highlight accent
  white:   "FFFFFF",
  offWhite:"F0F4F8",
  lightGray:"CBD5E0",
  darkText:"0D1B2A",
};

// ────────────────────────────────────────────────
// SLIDE 1 — TITLE
// ────────────────────────────────────────────────
{
  let s = pres.addSlide();

  // Full dark background
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:5.625, fill:{color: C.navy} });

  // Large red accent band on left
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:0.18, h:5.625, fill:{color: C.red} });

  // Red horizontal line under title area
  s.addShape(pres.ShapeType.rect, { x:0.18, y:3.05, w:9.82, h:0.04, fill:{color: C.crimson} });

  // Top right medical cross decoration (four rectangles)
  s.addShape(pres.ShapeType.rect, { x:8.7, y:0.25, w:0.15, h:0.5, fill:{color:C.crimson}, line:{color:C.crimson} });
  s.addShape(pres.ShapeType.rect, { x:8.525, y:0.4, w:0.5, h:0.15, fill:{color:C.crimson}, line:{color:C.crimson} });

  // SGT tag
  s.addShape(pres.ShapeType.roundRect, { x:0.45, y:0.3, w:0.85, h:0.35, fill:{color:C.red}, rectRadius:0.08 });
  s.addText("SGT", { x:0.45, y:0.3, w:0.85, h:0.35, fontSize:13, bold:true, color:C.white, align:"center", valign:"middle", margin:0 });

  // Main title
  s.addText("History Taking in", {
    x:0.45, y:0.85, w:9.1, h:0.65,
    fontSize:28, bold:false, color:C.lightGray, align:"left", valign:"middle"
  });
  s.addText("Cerebrovascular Accident", {
    x:0.45, y:1.45, w:9.1, h:0.85,
    fontSize:42, bold:true, color:C.white, align:"left", valign:"middle"
  });
  s.addText("(CVA / Stroke)", {
    x:0.45, y:2.25, w:9.1, h:0.6,
    fontSize:26, bold:false, color:C.crimson, align:"left", valign:"middle"
  });

  // Subtitle panel
  s.addText([
    { text: "Onset  •  Progression  •  Precipitating Factors  •  Aggravating & Relieving Factors  •  Associated Symptoms", options:{} }
  ], {
    x:0.45, y:3.2, w:9.1, h:0.45,
    fontSize:13, color:C.lightGray, align:"left"
  });

  // Bottom strip
  s.addShape(pres.ShapeType.rect, { x:0, y:5.2, w:10, h:0.425, fill:{color:C.navyMid} });
  s.addText("Clinical Medicine  |  Identifying the Cause of CVA", {
    x:0.3, y:5.2, w:9.4, h:0.425, fontSize:11, color:C.lightGray, align:"left", valign:"middle"
  });
}

// ────────────────────────────────────────────────
// HELPER: slide header bar
function addHeader(s, pres, title, C) {
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:5.625, fill:{color: C.offWhite} });
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:0.72, fill:{color: C.navy} });
  s.addShape(pres.ShapeType.rect, { x:0, y:0.72, w:10, h:0.045, fill:{color: C.red} });
  s.addText(title, {
    x:0.35, y:0, w:9.3, h:0.72,
    fontSize:22, bold:true, color:C.white, valign:"middle", align:"left", margin:0
  });
  // Page accent
  s.addShape(pres.ShapeType.rect, { x:9.7, y:0, w:0.3, h:0.72, fill:{color: C.red} });
}

// ────────────────────────────────────────────────
// HELPER: numbered card block
function addCard(s, pres, x, y, w, h, num, title, bullets, C) {
  // Card shadow (dark bg)
  s.addShape(pres.ShapeType.roundRect, { x:x+0.045, y:y+0.045, w:w, h:h, fill:{color:"C8D0DA"}, rectRadius:0.1 });
  // Card white fill
  s.addShape(pres.ShapeType.roundRect, { x, y, w, h, fill:{color:C.white}, line:{color:"D0D8E4",pt:1}, rectRadius:0.1 });
  // Number circle
  s.addShape(pres.ShapeType.ellipse, { x:x+0.12, y:y+0.1, w:0.38, h:0.38, fill:{color:C.red} });
  s.addText(String(num), { x:x+0.12, y:y+0.1, w:0.38, h:0.38, fontSize:13, bold:true, color:C.white, align:"center", valign:"middle", margin:0 });
  // Card title
  s.addText(title, { x:x+0.6, y:y+0.1, w:w-0.7, h:0.38, fontSize:13, bold:true, color:C.navy, valign:"middle", margin:0 });
  // Red divider
  s.addShape(pres.ShapeType.rect, { x:x+0.12, y:y+0.52, w:w-0.24, h:0.025, fill:{color:C.lightGray} });
  // Bullets
  let bulletObjs = bullets.map((b,i) => ({
    text: b,
    options: { bullet:{code:"25B8"}, breakLine: i<bullets.length-1, fontSize:10.5, color: C.darkText, indentLevel:0 }
  }));
  s.addText(bulletObjs, {
    x:x+0.12, y:y+0.58, w:w-0.24, h:h-0.65,
    fontSize:10.5, color:C.darkText, valign:"top"
  });
}

// ────────────────────────────────────────────────
// SLIDE 2 — Overview / What is CVA
// ────────────────────────────────────────────────
{
  let s = pres.addSlide();
  addHeader(s, pres, "What is a Cerebrovascular Accident (CVA)?", C);

  // Definition box
  s.addShape(pres.ShapeType.roundRect, { x:0.35, y:0.92, w:9.3, h:1.0, fill:{color:C.navyMid}, rectRadius:0.1 });
  s.addText("A Cerebrovascular Accident (CVA), or stroke, is a sudden neurological deficit caused by disruption of blood supply to the brain — either through ischemia (blockage) or hemorrhage (bleeding). Rapid and accurate history-taking is essential to identify the etiology and guide management.", {
    x:0.5, y:0.92, w:9.0, h:1.0, fontSize:13, color:C.white, valign:"middle", align:"justify"
  });

  // Two columns: Ischemic vs Hemorrhagic
  // Left
  s.addShape(pres.ShapeType.roundRect, { x:0.35, y:2.05, w:4.5, h:2.85, fill:{color:"FFF5F5"}, line:{color:C.crimson, pt:1.5}, rectRadius:0.1 });
  s.addShape(pres.ShapeType.roundRect, { x:0.35, y:2.05, w:4.5, h:0.48, fill:{color:C.crimson}, rectRadius:0.1 });
  s.addText("🔴  Ischemic Stroke (~85%)", { x:0.45, y:2.05, w:4.3, h:0.48, fontSize:13.5, bold:true, color:C.white, valign:"middle" });
  s.addText([
    {text:"Thrombotic – clot on atherosclerotic plaque", options:{bullet:{code:"25B8"},breakLine:true}},
    {text:"Embolic – clot from heart (AF, valve) or large vessel", options:{bullet:{code:"25B8"},breakLine:true}},
    {text:"Lacunar – small vessel occlusion (hypertension)", options:{bullet:{code:"25B8"},breakLine:true}},
    {text:"Cryptogenic – no clear cause found", options:{bullet:{code:"25B8"},breakLine:true}},
    {text:"Other: vasculitis, dissection, hypercoagulable", options:{bullet:{code:"25B8"}}}
  ], { x:0.5, y:2.62, w:4.1, h:2.2, fontSize:11, color:C.darkText, valign:"top" });

  // Right
  s.addShape(pres.ShapeType.roundRect, { x:5.15, y:2.05, w:4.5, h:2.85, fill:{color:"F0F4FF"}, line:{color:C.navyLt, pt:1.5}, rectRadius:0.1 });
  s.addShape(pres.ShapeType.roundRect, { x:5.15, y:2.05, w:4.5, h:0.48, fill:{color:C.navyLt}, rectRadius:0.1 });
  s.addText("🔵  Hemorrhagic Stroke (~15%)", { x:5.25, y:2.05, w:4.3, h:0.48, fontSize:13.5, bold:true, color:C.white, valign:"middle" });
  s.addText([
    {text:"Intracerebral hemorrhage (ICH) – HTN most common", options:{bullet:{code:"25B8"},breakLine:true}},
    {text:"Subarachnoid hemorrhage (SAH) – ruptured aneurysm", options:{bullet:{code:"25B8"},breakLine:true}},
    {text:"AVM rupture", options:{bullet:{code:"25B8"},breakLine:true}},
    {text:"Anticoagulant-related bleeding", options:{bullet:{code:"25B8"},breakLine:true}},
    {text:"Cerebral amyloid angiopathy", options:{bullet:{code:"25B8"}}}
  ], { x:5.25, y:2.62, w:4.3, h:2.2, fontSize:11, color:C.darkText, valign:"top" });
}

// ────────────────────────────────────────────────
// SLIDE 3 — ONSET
// ────────────────────────────────────────────────
{
  let s = pres.addSlide();
  addHeader(s, pres, "1. History of Onset", C);

  // Intro
  s.addText("The mode of onset is the MOST IMPORTANT clue to distinguish ischemic from hemorrhagic CVA.", {
    x:0.35, y:0.88, w:9.3, h:0.38, fontSize:12.5, color:C.red, bold:true, italic:true
  });

  // Four cards in 2x2 grid
  addCard(s, pres, 0.35, 1.35, 4.4, 1.7, 1, "Time of Onset",
    ["Exact time - critical for thrombolysis window (4.5 hrs)",
     "Wake-up stroke: symptom onset on waking",
     "\"Last known well\" time used if exact unknown",
     "Sudden onset: favors embolic/hemorrhagic"], C);

  addCard(s, pres, 5.0, 1.35, 4.65, 1.7, 2, "Speed of Onset",
    ["Instantaneous (seconds): hemorrhagic, embolic",
     "Gradual (hours-days): thrombotic, lacunar",
     "Stuttering / stepwise: thrombotic progression",
     "Maximal at onset: embolism highly likely"], C);

  addCard(s, pres, 0.35, 3.2, 4.4, 1.75, 3, "Activity at Onset",
    ["During sleep / on waking: thrombotic (low BP, stasis)",
     "During exertion / straining: hemorrhagic",
     "At rest: embolic or thrombotic",
     "After physical trauma: arterial dissection"], C);

  addCard(s, pres, 5.0, 3.2, 4.65, 1.75, 4, "Consciousness at Onset",
    ["Preserved: focal ischemic stroke (most common)",
     "Sudden LOC: massive ischemic or hemorrhagic",
     "\"Worst headache\" + LOC: SAH until proven otherwise",
     "Witnessed vs unwitnessed collapse"], C);
}

// ────────────────────────────────────────────────
// SLIDE 4 — PROGRESSION
// ────────────────────────────────────────────────
{
  let s = pres.addSlide();
  addHeader(s, pres, "2. Progression of Symptoms", C);

  s.addText("The evolution of deficits over time helps identify the stroke subtype and guides urgency of intervention.", {
    x:0.35, y:0.88, w:9.3, h:0.35, fontSize:12, color:C.navyLt, italic:true
  });

  // Timeline graphic
  const items = [
    { label:"Minutes", color:C.crimson, text:"Embolic\n(Maximal & sudden)" },
    { label:"Hours", color:C.red, text:"Thrombotic progression\n(Stepwise worsening)" },
    { label:"Days", color:C.navyLt, text:"Lacunar / watershed\n(Gradual buildup)" },
    { label:"Fluctuating", color: C.gold, text:"TIA precursor\n(Waxing & waning)" },
  ];

  // Timeline bar
  s.addShape(pres.ShapeType.rect, { x:0.5, y:1.58, w:8.9, h:0.1, fill:{color:C.lightGray} });
  items.forEach((item, i) => {
    const xPos = 0.5 + i * 2.3;
    s.addShape(pres.ShapeType.ellipse, { x:xPos+0.8, y:1.42, w:0.42, h:0.42, fill:{color:item.color} });
    s.addText(item.label, { x:xPos+0.4, y:1.9, w:1.2, h:0.3, fontSize:10, bold:true, color:item.color, align:"center" });
    s.addShape(pres.ShapeType.roundRect, { x:xPos+0.1, y:2.28, w:1.9, h:0.88, fill:{color:item.color}, rectRadius:0.1 });
    s.addText(item.text, { x:xPos+0.1, y:2.28, w:1.9, h:0.88, fontSize:10.5, color:C.white, align:"center", valign:"middle" });
  });

  // Key questions box
  s.addShape(pres.ShapeType.roundRect, { x:0.35, y:3.35, w:9.3, h:1.9, fill:{color:C.navy}, rectRadius:0.12 });
  s.addText("Key Questions to Ask About Progression", {
    x:0.5, y:3.42, w:9.0, h:0.38, fontSize:14, bold:true, color:C.gold
  });
  s.addText([
    {text:"\"Did the symptoms come on suddenly or gradually?\"  •  \"Have symptoms stayed the same, gotten worse, or improved?\"", options:{breakLine:true, fontSize:11.5}},
    {text:"\"Were there any episodes of weakness/speech problems before this event?\" (prior TIAs)", options:{breakLine:true, fontSize:11.5}},
    {text:"\"Is there improvement since onset?\" (resolution → TIA; persistent → completed stroke)", options:{fontSize:11.5}},
  ], { x:0.5, y:3.85, w:9.0, h:1.3, color:C.white, valign:"top" });
}

// ────────────────────────────────────────────────
// SLIDE 5 — PRECIPITATING FACTORS
// ────────────────────────────────────────────────
{
  let s = pres.addSlide();
  addHeader(s, pres, "3. Precipitating Factors", C);

  s.addText("Events or conditions immediately before onset that may have triggered the CVA:", {
    x:0.35, y:0.88, w:9.3, h:0.32, fontSize:12, color:C.navyLt, italic:true
  });

  const cards = [
    { num:1, title:"Cardiovascular Events", bullets:[
      "Recent MI (mural thrombus → cerebral embolism)",
      "Atrial fibrillation (paroxysmal or chronic)",
      "Sudden drop in BP (hypotensive episode, cardiac arrest)",
      "Cardiac surgery / catheterization (atheroemboli)"
    ]},
    { num:2, title:"Triggers for Hemorrhage", bullets:[
      "Heavy physical exertion or Valsalva manoeuvre",
      "Sexual activity or straining (acute BP surge)",
      "Severe emotional stress / anger",
      "Recent anticoagulant use or thrombolytic therapy"
    ]},
    { num:3, title:"Vascular / Systemic Triggers", bullets:[
      "Hypertensive crisis (acute severe HTN)",
      "Neck manipulation → vertebral artery dissection",
      "Trauma to neck/head → carotid dissection",
      "Dehydration → hemoconcentration → thrombosis"
    ]},
    { num:4, title:"Procoagulant States", bullets:[
      "Long-distance travel / immobility (DVT → PFO paradoxical embolism)",
      "Recent surgery or postpartum state",
      "Oral contraceptive pill use (young women)",
      "Systemic illness: cancer, sepsis, antiphospholipid syndrome"
    ]},
    { num:5, title:"Toxins & Substances", bullets:[
      "Cocaine, amphetamine: vasospasm / hemorrhage",
      "Alcohol binge: atrial fibrillation, coagulopathy",
      "Sudden withdrawal of antihypertensives",
      "Overuse of ergotamine / triptans (vasospasm)"
    ]},
    { num:6, title:"Migraine & Vasospasm", bullets:[
      "Complicated migraine with aura preceding deficit",
      "Migraine-induced stroke (migrainous infarction)",
      "History of migraines in young women on OCP",
      "Reversible cerebral vasoconstriction syndrome (RCVS)"
    ]},
  ];

  cards.forEach((c, i) => {
    const col = i % 3;
    const row = Math.floor(i / 3);
    const x = 0.3 + col * 3.2;
    const y = 1.3 + row * 2.1;
    addCard(s, pres, x, y, 3.05, 2.0, c.num, c.title, c.bullets, C);
  });
}

// ────────────────────────────────────────────────
// SLIDE 6 — AGGRAVATING & RELIEVING FACTORS
// ────────────────────────────────────────────────
{
  let s = pres.addSlide();
  addHeader(s, pres, "4. Aggravating & Relieving Factors", C);

  // Aggravating — left half
  s.addShape(pres.ShapeType.roundRect, { x:0.3, y:0.9, w:4.55, h:4.42, fill:{color:"FFF5F5"}, line:{color:C.crimson,pt:1.5}, rectRadius:0.12 });
  s.addShape(pres.ShapeType.roundRect, { x:0.3, y:0.9, w:4.55, h:0.5, fill:{color:C.crimson}, rectRadius:0.12 });
  s.addText("⬆  AGGRAVATING FACTORS", { x:0.4, y:0.9, w:4.35, h:0.5, fontSize:13, bold:true, color:C.white, valign:"middle" });

  const aggravating = [
    ["Positional","Symptoms worse on lying flat → raised ICP (hemorrhage); orthostatic → ischemic (BP drop)"],
    ["Physical Activity","Exertion worsening deficit → hemorrhagic or hemodynamic ischemic"],
    ["Valsalva Manoeuvre","Coughing, straining → raised ICP or venous sinus thrombosis"],
    ["Blood Pressure","Uncontrolled HTN worsens hemorrhagic or lacunar stroke"],
    ["Temperature","Fever worsens neurological deficit (Uhthoff-like effect)"],
    ["Sleep","Worsening on waking suggests thrombotic progression"],
  ];

  aggravating.forEach(([key, val], i) => {
    const y = 1.52 + i * 0.6;
    s.addShape(pres.ShapeType.roundRect, { x:0.42, y, w:4.28, h:0.52, fill:{color:C.white}, line:{color:"E0C0C0",pt:0.8}, rectRadius:0.07 });
    s.addText(key + ":", { x:0.52, y, w:1.3, h:0.52, fontSize:10, bold:true, color:C.crimson, valign:"middle" });
    s.addText(val, { x:1.75, y, w:2.8, h:0.52, fontSize:9.5, color:C.darkText, valign:"middle" });
  });

  // Relieving — right half
  s.addShape(pres.ShapeType.roundRect, { x:5.15, y:0.9, w:4.55, h:4.42, fill:{color:"F0F8FF"}, line:{color:C.navyLt,pt:1.5}, rectRadius:0.12 });
  s.addShape(pres.ShapeType.roundRect, { x:5.15, y:0.9, w:4.55, h:0.5, fill:{color:C.navyLt}, rectRadius:0.12 });
  s.addText("⬇  RELIEVING FACTORS", { x:5.25, y:0.9, w:4.35, h:0.5, fontSize:13, bold:true, color:C.white, valign:"middle" });

  const relieving = [
    ["Rest / Lying Down","Symptoms improve → may suggest hemodynamic TIA"],
    ["Thrombolysis (tPA)","Rapid improvement after IV alteplase → ischemic stroke"],
    ["Thrombectomy","Mechanical reperfusion → dramatic deficit reversal (LVO)"],
    ["Head Elevation","Lowers ICP in hemorrhagic stroke"],
    ["Antihypertensives","Controlled BP reduces hemorrhage expansion"],
    ["Anticoagulation","Improvement in cardioembolic / hypercoagulable strokes"],
  ];

  relieving.forEach(([key, val], i) => {
    const y = 1.52 + i * 0.6;
    s.addShape(pres.ShapeType.roundRect, { x:5.27, y, w:4.28, h:0.52, fill:{color:C.white}, line:{color:"C0D0E0",pt:0.8}, rectRadius:0.07 });
    s.addText(key + ":", { x:5.37, y, w:1.55, h:0.52, fontSize:10, bold:true, color:C.navyLt, valign:"middle" });
    s.addText(val, { x:6.82, y, w:2.55, h:0.52, fontSize:9.5, color:C.darkText, valign:"middle" });
  });
}

// ────────────────────────────────────────────────
// SLIDE 7 — ASSOCIATED SYMPTOMS (Neurological)
// ────────────────────────────────────────────────
{
  let s = pres.addSlide();
  addHeader(s, pres, "5. Associated Symptoms — Neurological Deficits", C);

  s.addText("The pattern of neurological deficits localizes the lesion and helps identify the vascular territory involved:", {
    x:0.35, y:0.88, w:9.3, h:0.32, fontSize:11.5, color:C.navyLt, italic:true
  });

  const territories = [
    {
      name:"Anterior Circulation (MCA/ACA)",
      color: C.crimson,
      bg: "FFF0F0",
      symptoms:[
        "Contralateral hemiplegia / hemiparesis",
        "Contralateral hemisensory loss",
        "Aphasia (dominant hemisphere) — Broca's / Wernicke's",
        "Neglect / hemineglect (non-dominant hemisphere)",
        "Homonymous hemianopia (half visual field loss)",
        "Facial droop (lower face) with arm > leg weakness (MCA)",
        "Leg > arm weakness + abulia (ACA territory)",
      ]
    },
    {
      name:"Posterior Circulation (PICA/AICA/BA/PCA)",
      color: C.navyLt,
      bg: "F0F4FF",
      symptoms:[
        "Diplopia, nystagmus, gaze palsy",
        "Dysphagia and dysarthria (bulbar involvement)",
        "Ipsilateral facial numbness + contralateral body loss (Wallenberg)",
        "Ataxia, dizziness, vertigo",
        "Bilateral limb weakness (basilar artery thrombosis)",
        "Cortical blindness (bilateral PCA) or visual field defects",
        "'Locked-in' syndrome (pontine infarct)",
      ]
    },
    {
      name:"Lacunar Syndromes (Small Vessel)",
      color: C.gold,
      bg: "FFFBF0",
      symptoms:[
        "Pure motor hemiparesis (posterior limb internal capsule)",
        "Pure sensory stroke (thalamus)",
        "Ataxic hemiparesis",
        "Clumsy hand / dysarthria syndrome",
        "Sensorimotor stroke",
        "No cortical signs (no aphasia, no neglect, no hemianopia)",
        "Common in diabetics and hypertensives",
      ]
    },
  ];

  territories.forEach((t, i) => {
    const x = 0.28 + i * 3.2;
    s.addShape(pres.ShapeType.roundRect, { x, y:1.3, w:3.05, h:4.0, fill:{color:t.bg}, line:{color:t.color,pt:1.5}, rectRadius:0.1 });
    s.addShape(pres.ShapeType.roundRect, { x, y:1.3, w:3.05, h:0.52, fill:{color:t.color}, rectRadius:0.1 });
    s.addText(t.name, { x:x+0.08, y:1.3, w:2.9, h:0.52, fontSize:10.5, bold:true, color:C.white, valign:"middle" });
    let bulletObjs = t.symptoms.map((sym, si) => ({
      text: sym,
      options: { bullet:{code:"25B8"}, breakLine: si < t.symptoms.length-1, fontSize:10, color:C.darkText }
    }));
    s.addText(bulletObjs, { x:x+0.1, y:1.9, w:2.85, h:3.3, fontSize:10, color:C.darkText, valign:"top" });
  });
}

// ────────────────────────────────────────────────
// SLIDE 8 — ASSOCIATED SYMPTOMS (Non-Neurological)
// ────────────────────────────────────────────────
{
  let s = pres.addSlide();
  addHeader(s, pres, "5. Associated Symptoms — Non-Neurological Clues", C);

  s.addText("Non-neurological symptoms provide vital clues to the underlying CAUSE of the CVA:", {
    x:0.35, y:0.88, w:9.3, h:0.32, fontSize:11.5, color:C.navyLt, italic:true
  });

  const cards2 = [
    { num:1, title:"Headache", bullets:[
      "Thunderclap (worst of life) → SAH (aneurysm rupture)",
      "Severe occipital headache → cerebellar hemorrhage",
      "Gradual headache + vomiting + papilledema → raised ICP",
      "No headache: more typical of ischemic stroke",
    ]},
    { num:2, title:"Vomiting & Nausea", bullets:[
      "Projectile vomiting → raised ICP (hemorrhagic)",
      "Vomiting + vertigo + ataxia → posterior fossa lesion",
      "Nausea + diplopia + dysphagia → brainstem/cerebellar",
    ]},
    { num:3, title:"Seizures", bullets:[
      "Seizure at onset → hemorrhagic CVA > ischemic",
      "Post-stroke seizures: cortical ischemic infarcts",
      "Status epilepticus in CVST (cerebral venous thrombosis)",
      "Todd's paresis may mimic focal deficit",
    ]},
    { num:4, title:"Fever & Infection", bullets:[
      "Fever preceding CVA → infective endocarditis (septic emboli)",
      "Meningism + fever → bacterial meningitis with vasculitis",
      "Recent viral illness (young): post-viral arteritis",
      "Fever after CVA: aspiration pneumonia (very common)",
    ]},
    { num:5, title:"Cardiac Symptoms", bullets:[
      "Palpitations / irregular rhythm → AF → cardioembolic",
      "Recent chest pain / MI → mural thrombus → embolism",
      "Exertional syncope → low-output cardiac state",
      "Valve disease history → rheumatic mitral stenosis + AF",
    ]},
    { num:6, title:"Visual Symptoms", bullets:[
      "Transient monocular blindness (amaurosis fugax) → carotid TIA",
      "Diplopia: brainstem / CN III / VI palsy",
      "Bilateral visual loss: PCA / basilar territory",
      "Visual field cut: MCA or PCA involvement",
    ]},
  ];

  cards2.forEach((c, i) => {
    const col = i % 3;
    const row = Math.floor(i / 3);
    const x = 0.3 + col * 3.2;
    const y = 1.28 + row * 2.1;
    addCard(s, pres, x, y, 3.05, 2.0, c.num, c.title, c.bullets, C);
  });
}

// ────────────────────────────────────────────────
// SLIDE 9 — RISK FACTOR HISTORY
// ────────────────────────────────────────────────
{
  let s = pres.addSlide();
  addHeader(s, pres, "6. Past Medical & Risk Factor History", C);

  s.addText("A thorough past medical history identifies modifiable risk factors and underlying etiology:", {
    x:0.35, y:0.88, w:9.3, h:0.32, fontSize:11.5, color:C.navyLt, italic:true
  });

  // Two column layout
  const leftRFs = [
    ["Hypertension", "Most common risk factor for all stroke types; especially lacunar & ICH"],
    ["Diabetes Mellitus", "Accelerates atherosclerosis; increases ischemic stroke risk 2-3×"],
    ["Atrial Fibrillation", "Leading cause of cardioembolic stroke; CHA2DS2-VASc score"],
    ["Hyperlipidemia", "Large-vessel atherosclerosis; carotid and intracranial disease"],
    ["Previous TIA/Stroke", "ABCD2 score; high risk of early recurrent stroke"],
    ["Ischemic Heart Disease", "Coronary atherosclerosis = cerebrovascular atherosclerosis"],
    ["Valvular Heart Disease", "Rheumatic mitral stenosis + AF; prosthetic valves"],
  ];

  const rightRFs = [
    ["Smoking", "Independent major risk factor; 2× increased ischemic stroke risk"],
    ["Obesity / Metabolic Syndrome", "Compound risk via HTN, DM, dyslipidemia"],
    ["Oral Contraceptives", "Venous sinus thrombosis in young women; migraine + OCP"],
    ["Family History", "Genetic causes: CADASIL, sickle cell, MELAS"],
    ["Alcohol Excess", "AF, cardiomyopathy, coagulopathy, HTN"],
    ["Drugs (Cocaine)", "Vasospasm, accelerated HTN, hemorrhagic stroke"],
    ["Antiphospholipid Syndrome", "Hypercoagulable state; young patient with recurrent strokes"],
  ];

  leftRFs.forEach(([key, val], i) => {
    const y = 1.32 + i * 0.56;
    s.addShape(pres.ShapeType.rect, { x:0.3, y, w:4.6, h:0.5, fill:{color: i%2===0 ? C.white : "F4F7FC"}, line:{color:"D8E4F0",pt:0.6} });
    s.addText(key, { x:0.4, y, w:1.55, h:0.5, fontSize:10.5, bold:true, color:C.navy, valign:"middle" });
    s.addText(val, { x:1.92, y, w:2.85, h:0.5, fontSize:10, color:C.darkText, valign:"middle" });
  });

  rightRFs.forEach(([key, val], i) => {
    const y = 1.32 + i * 0.56;
    s.addShape(pres.ShapeType.rect, { x:5.1, y, w:4.6, h:0.5, fill:{color: i%2===0 ? C.white : "F4F7FC"}, line:{color:"D8E4F0",pt:0.6} });
    s.addText(key, { x:5.2, y, w:1.7, h:0.5, fontSize:10.5, bold:true, color:C.navy, valign:"middle" });
    s.addText(val, { x:6.82, y, w:2.75, h:0.5, fontSize:10, color:C.darkText, valign:"middle" });
  });

  // Column headers
  s.addShape(pres.ShapeType.rect, { x:0.3, y:1.25, w:4.6, h:0.0 });
  s.addShape(pres.ShapeType.rect, { x:5.1, y:1.25, w:4.6, h:0.0 });
}

// ────────────────────────────────────────────────
// SLIDE 10 — DRUG / SOCIAL / FAMILY HISTORY
// ────────────────────────────────────────────────
{
  let s = pres.addSlide();
  addHeader(s, pres, "7. Drug, Social & Family History", C);

  const sections = [
    {
      title:"Drug History",
      color: C.crimson,
      bg: "FFF5F5",
      icon: "💊",
      items:[
        "Anticoagulants (warfarin, NOACs) → hemorrhagic risk if supratherapeutic",
        "Antiplatelets (aspirin, clopidogrel) → protective or hemorrhagic (overdose)",
        "Antihypertensives → non-compliance → hypertensive CVA",
        "OCP / HRT → venous sinus thrombosis, ischemic stroke risk",
        "Thrombolytics (recent use) → hemorrhagic transformation",
        "Herbal medications → interaction with anticoagulants",
        "Statins → protective role (pleiotropic + lipid-lowering)"
      ]
    },
    {
      title:"Social History",
      color: C.navyLt,
      bg: "F0F4FF",
      icon: "👤",
      items:[
        "Smoking: pack-years, current or ex-smoker",
        "Alcohol: units/week, binge drinking pattern",
        "Recreational drugs: cocaine, amphetamines, MDMA",
        "Occupation: prolonged sitting (DVT), high-stress roles",
        "Physical activity level: sedentary lifestyle risk",
        "Diet: high sodium, fat — cardiovascular risk",
        "Functional status before event (baseline for recovery)"
      ]
    },
    {
      title:"Family History",
      color: C.gold,
      bg: "FFFBF0",
      icon: "🧬",
      items:[
        "CADASIL (NOTCH3 mutation): young strokes, dementia, migraine",
        "MELAS: mitochondrial — strokes in young with lactic acidosis",
        "Sickle cell disease: childhood strokes, large vessel occlusion",
        "Hereditary thrombophilia: Factor V Leiden, prothrombin mutation",
        "Familial hypercholesterolemia: premature atherosclerosis",
        "Cardiac channelopathies / arrhythmias: AF, sudden cardiac death",
        "Hypertension and DM: polygenic clustering in families"
      ]
    }
  ];

  sections.forEach((sec, i) => {
    const x = 0.25 + i * 3.2;
    s.addShape(pres.ShapeType.roundRect, { x, y:0.88, w:3.05, h:4.5, fill:{color:sec.bg}, line:{color:sec.color,pt:1.5}, rectRadius:0.1 });
    s.addShape(pres.ShapeType.roundRect, { x, y:0.88, w:3.05, h:0.52, fill:{color:sec.color}, rectRadius:0.1 });
    s.addText(sec.icon + "  " + sec.title, { x:x+0.08, y:0.88, w:2.9, h:0.52, fontSize:12.5, bold:true, color:C.white, valign:"middle" });
    let bulletObjs = sec.items.map((item, ii) => ({
      text: item,
      options:{ bullet:{code:"25B8"}, breakLine: ii < sec.items.length-1, fontSize:10, color:C.darkText }
    }));
    s.addText(bulletObjs, { x:x+0.1, y:1.48, w:2.85, h:3.8, fontSize:10, color:C.darkText, valign:"top" });
  });
}

// ────────────────────────────────────────────────
// SLIDE 11 — CLINICAL SUMMARY TABLE
// ────────────────────────────────────────────────
{
  let s = pres.addSlide();
  addHeader(s, pres, "8. History Clues to Identify CVA Subtype", C);

  s.addText("Summary: Distinguishing CVA subtypes from history alone", {
    x:0.35, y:0.88, w:9.3, h:0.3, fontSize:12, color:C.navyLt, italic:true
  });

  // Table
  const headers = ["Feature", "Ischemic (Thrombotic)", "Ischemic (Embolic)", "Hemorrhagic", "Lacunar"];
  const rows = [
    ["Onset speed", "Gradual / stuttering", "Sudden (maximal)", "Sudden", "Gradual / stuttering"],
    ["Activity", "Rest / sleep / morning", "Any time", "Exertion / straining", "Any"],
    ["Headache", "Absent / mild", "Absent / mild", "Severe / thunderclap", "Absent"],
    ["LOC", "Usually preserved", "Brief LOC possible", "Common / prolonged", "Preserved"],
    ["Progression", "May worsen stepwise", "Maximal at onset", "May worsen rapidly", "Usually stable"],
    ["Vomiting", "Uncommon", "Uncommon", "Common (raised ICP)", "Uncommon"],
    ["BP at onset", "Normal/high", "Variable", "Very high", "High (HTN)"],
    ["Prior TIA", "Common", "Less common", "Uncommon", "Rare"],
    ["AF / cardiac", "Less likely", "Very likely", "Unlikely", "Unlikely"],
  ];

  const colW = [1.9, 1.9, 1.9, 1.9, 1.9];
  const colX = [0.25, 2.15, 4.05, 5.95, 7.85];
  const rowH = 0.38;
  const startY = 1.28;

  // Header row
  headers.forEach((h, ci) => {
    s.addShape(pres.ShapeType.rect, { x:colX[ci], y:startY, w:colW[ci], h:rowH+0.05, fill:{color:C.navy}, line:{color:C.navyLt, pt:0.8} });
    s.addText(h, { x:colX[ci]+0.05, y:startY, w:colW[ci]-0.1, h:rowH+0.05, fontSize:10.5, bold:true, color:C.white, align:"center", valign:"middle" });
  });

  rows.forEach((row, ri) => {
    const y = startY + (ri+1)*(rowH+0.01);
    const bg = ri%2===0 ? C.white : "EEF3FA";
    row.forEach((cell, ci) => {
      s.addShape(pres.ShapeType.rect, { x:colX[ci], y, w:colW[ci], h:rowH, fill:{color: ci===0 ? "E8EEF8" : bg}, line:{color:"D0D8EA", pt:0.6} });
      s.addText(cell, { x:colX[ci]+0.06, y, w:colW[ci]-0.12, h:rowH, fontSize:9.5, color:C.darkText, valign:"middle", align: ci===0 ? "left":"center", bold: ci===0 });
    });
  });
}

// ────────────────────────────────────────────────
// SLIDE 12 — SUMMARY / CLOSING
// ────────────────────────────────────────────────
{
  let s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:5.625, fill:{color:C.navy} });
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:0.18, h:5.625, fill:{color:C.red} });
  s.addShape(pres.ShapeType.rect, { x:0.18, y:1.42, w:9.82, h:0.04, fill:{color:C.crimson} });

  s.addText("Clinical Pearls", {
    x:0.45, y:0.28, w:9.1, h:0.55, fontSize:14, bold:false, color:C.lightGray
  });
  s.addText("Key Takeaways in CVA History", {
    x:0.45, y:0.75, w:9.1, h:0.55, fontSize:30, bold:true, color:C.white
  });

  const pearls = [
    ["1", C.crimson, "Time is brain — establish EXACT onset time; every minute = ~2 million neurons lost"],
    ["2", C.navyLt, "Thunderclap headache + sudden LOC = SAH until proven otherwise (CT head STAT)"],
    ["3", C.gold, "Irregular pulse (AF) + sudden maximal deficit = cardioembolic stroke (anticoagulate)"],
    ["4", C.crimson, "Pure motor / sensory without cortical signs = lacunar; look for HTN + DM"],
    ["5", C.navyLt, "Diplopia + dysphagia + vertigo + crossed signs = posterior circulation (basilar artery)"],
    ["6", C.gold, "Young woman + OCP + headache + focal deficit = cerebral venous sinus thrombosis"],
  ];

  pearls.forEach((p, i) => {
    const row = Math.floor(i/2);
    const col = i%2;
    const x = 0.45 + col*4.85;
    const y = 1.65 + row*1.15;
    s.addShape(pres.ShapeType.roundRect, { x, y, w:4.55, h:1.0, fill:{color:"162540"}, line:{color:p[1],pt:1.2}, rectRadius:0.1 });
    s.addShape(pres.ShapeType.ellipse, { x:x+0.12, y:y+0.28, w:0.42, h:0.42, fill:{color:p[1]} });
    s.addText(p[0], { x:x+0.12, y:y+0.28, w:0.42, h:0.42, fontSize:13, bold:true, color:C.white, align:"center", valign:"middle", margin:0 });
    s.addText(p[2], { x:x+0.65, y:y+0.12, w:3.78, h:0.78, fontSize:10.5, color:C.white, valign:"middle" });
  });

  // Bottom
  s.addShape(pres.ShapeType.rect, { x:0, y:5.2, w:10, h:0.425, fill:{color:C.navyMid} });
  s.addText("\"Assess onset, progression, precipitants, aggravating/relieving factors, and associated symptoms — together they tell the story of the stroke.\"", {
    x:0.3, y:5.2, w:9.4, h:0.425, fontSize:10, color:C.lightGray, align:"center", valign:"middle", italic:true
  });
}

// ────────────────────────────────────────────────
// WRITE FILE
// ────────────────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/workspace/cva-history-ppt/CVA_History_Taking.pptx" })
  .then(() => console.log("✅ PPT created successfully!"))
  .catch(err => console.error("❌ Error:", err));
Running Command

cd /home/daytona/workspace/cva-history-ppt && node create_ppt.js 2>&1

Running Command

ls -lh /home/daytona/workspace/cva-history-ppt/CVA_History_Taking.pptx

Your presentation is ready! Download it here:

CVA History Taking

Presentation · PPTX


Here is what the 12-slide deck covers, in a deep navy + crimson + gold professional design:
SlideContent
1Title slide — SGT topic tag, full title, subtitle
2What is a CVA? — Ischemic (85%) vs Hemorrhagic (15%) types + causes
3History of Onset — Time, speed, activity at onset, consciousness
4Progression of Symptoms — Timeline graphic (minutes → hours → days → fluctuating) + key questions
5Precipitating Factors — 6 cards: cardiac events, hemorrhage triggers, vascular triggers, procoagulant states, toxins, migraine
6Aggravating & Relieving Factors — Two-column layout with positional, activity, BP, treatment factors
7Associated Neurological Symptoms — MCA/ACA, posterior circulation, lacunar syndromes
8Associated Non-Neurological Symptoms — Headache, vomiting, seizures, fever, cardiac, visual symptoms
9Risk Factor History — Hypertension, DM, AF, hyperlipidemia, smoking, drugs, etc.
10Drug, Social & Family History — Anticoagulants, OCP, CADASIL, sickle cell, thrombophilias
11CVA Subtype Summary Table — Thrombotic vs Embolic vs Hemorrhagic vs Lacunar comparison
12Clinical Pearls — 6 high-yield takeaways for the SGT/exam
This is a shared conversation. Sign in to Orris to start your own chat.