attachment
attachment

Make presentation on this topic

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

respiratory distress ARDS chest X-ray lung

Finding Sources
Running Command

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

Running Command

mkdir -p /home/daytona/workspace/respiratory-distress-ppt

Writing File

~/respiratory-distress-ppt/build.js

const pptxgen = require("pptxgenjs");
const { execSync } = require("child_process");

const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Respiratory Distress";
pres.author = "Medical Intern";

// ── COLOUR PALETTE ──────────────────────────────────────────────────────────
const C = {
  darkBg:    "0B1A2C",   // deep navy  (dominant)
  midBg:     "0E2240",   // mid navy
  panelBg:   "112B50",   // card background
  accent:    "E74C3C",   // red accent (medical urgency)
  accentSoft:"C0392B",   // darker red
  teal:      "1ABC9C",   // teal highlight
  gold:      "F39C12",   // warning amber
  white:     "FFFFFF",
  offWhite:  "ECF0F1",
  lightGray: "BDC3C7",
  textMuted: "7F8C8D",
};

// ── HELPER: slide background ─────────────────────────────────────────────────
function bg(slide, color) {
  slide.background = { color: color || C.darkBg };
}

// ── HELPER: header bar ────────────────────────────────────────────────────────
function headerBar(slide, title, subtitle) {
  // Red top accent strip
  slide.addShape(pres.ShapeType.rect, {
    x: 0, y: 0, w: "100%", h: 0.08, fill: { color: C.accent }, line: { color: C.accent }
  });
  // Navy header band
  slide.addShape(pres.ShapeType.rect, {
    x: 0, y: 0.08, w: "100%", h: 0.9, fill: { color: C.midBg }, line: { color: C.midBg }
  });
  slide.addText(title.toUpperCase(), {
    x: 0.4, y: 0.08, w: 8, h: 0.55,
    fontSize: 22, bold: true, color: C.white, fontFace: "Calibri", margin: 0,
    charSpacing: 1
  });
  if (subtitle) {
    slide.addText(subtitle, {
      x: 0.4, y: 0.6, w: 9, h: 0.35,
      fontSize: 11, color: C.teal, fontFace: "Calibri", margin: 0
    });
  }
  // Bottom gradient strip
  slide.addShape(pres.ShapeType.rect, {
    x: 0, y: 0.98, w: "100%", h: 0.03, fill: { color: C.accent }, line: { color: C.accent }
  });
}

// ── HELPER: footer ────────────────────────────────────────────────────────────
function footer(slide, text) {
  slide.addShape(pres.ShapeType.rect, {
    x: 0, y: 5.5, w: "100%", h: 0.125, fill: { color: C.midBg }, line: { color: C.midBg }
  });
  slide.addText(text || "Respiratory Distress | Medical Internship Presentation", {
    x: 0.3, y: 5.5, w: 9.4, h: 0.125,
    fontSize: 7.5, color: C.textMuted, fontFace: "Calibri", margin: 0
  });
}

// ── HELPER: card ──────────────────────────────────────────────────────────────
function card(slide, x, y, w, h, title, lines, titleColor) {
  slide.addShape(pres.ShapeType.roundRect, {
    x, y, w, h,
    fill: { color: C.panelBg },
    line: { color: C.accent, pt: 1 },
    rectRadius: 0.08
  });
  slide.addText(title, {
    x: x + 0.12, y: y + 0.06, w: w - 0.24, h: 0.32,
    fontSize: 11, bold: true, color: titleColor || C.teal, fontFace: "Calibri", margin: 0
  });
  // divider
  slide.addShape(pres.ShapeType.line, {
    x: x + 0.12, y: y + 0.38, w: w - 0.24, h: 0,
    line: { color: C.accent, pt: 0.8 }
  });
  const items = lines.map((l, i) => ({
    text: l,
    options: { bullet: { type: "bullet", code: "2022" }, breakLine: i < lines.length - 1, color: C.offWhite, fontSize: 9.5, fontFace: "Calibri" }
  }));
  slide.addText(items, {
    x: x + 0.18, y: y + 0.42, w: w - 0.3, h: h - 0.52,
    valign: "top", margin: 0
  });
}

// ── HELPER: numbered badge ────────────────────────────────────────────────────
function badge(slide, num, x, y) {
  slide.addShape(pres.ShapeType.ellipse, {
    x, y, w: 0.32, h: 0.32, fill: { color: C.accent }, line: { color: C.accent }
  });
  slide.addText(String(num), {
    x, y: y + 0.01, w: 0.32, h: 0.3,
    fontSize: 12, bold: true, color: C.white, align: "center", fontFace: "Calibri", margin: 0
  });
}

// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 1 – TITLE
// ═══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  bg(s, C.darkBg);

  // Red vertical accent bar
  s.addShape(pres.ShapeType.rect, {
    x: 0, y: 0, w: 0.12, h: "100%", fill: { color: C.accent }, line: { color: C.accent }
  });

  // Decorative circles
  s.addShape(pres.ShapeType.ellipse, {
    x: 7.8, y: -0.8, w: 3.5, h: 3.5, fill: { color: C.midBg }, line: { color: C.midBg }
  });
  s.addShape(pres.ShapeType.ellipse, {
    x: 8.4, y: 0.3, w: 2, h: 2, fill: { color: C.accent, transparency: 85 }, line: { color: "none" }
  });

  s.addText("RESPIRATORY", {
    x: 0.5, y: 0.9, w: 9, h: 0.9,
    fontSize: 52, bold: true, color: C.white, fontFace: "Calibri", charSpacing: 4, margin: 0
  });
  s.addText("DISTRESS", {
    x: 0.5, y: 1.7, w: 9, h: 0.9,
    fontSize: 52, bold: true, color: C.accent, fontFace: "Calibri", charSpacing: 4, margin: 0
  });

  s.addShape(pres.ShapeType.line, {
    x: 0.5, y: 2.7, w: 6, h: 0, line: { color: C.teal, pt: 2 }
  });

  s.addText("A Comprehensive Clinical Overview for Medical Interns", {
    x: 0.5, y: 2.85, w: 8.5, h: 0.4,
    fontSize: 15, color: C.offWhite, fontFace: "Calibri", italic: true, margin: 0
  });

  // Tags
  const tags = ["Pathophysiology", "Diagnosis", "ARDS", "Treatment", "Real Cases"];
  tags.forEach((t, i) => {
    s.addShape(pres.ShapeType.roundRect, {
      x: 0.5 + i * 1.8, y: 3.45, w: 1.65, h: 0.32,
      fill: { color: C.panelBg }, line: { color: C.teal, pt: 0.8 }, rectRadius: 0.1
    });
    s.addText(t, {
      x: 0.5 + i * 1.8, y: 3.45, w: 1.65, h: 0.32,
      fontSize: 9, color: C.teal, align: "center", fontFace: "Calibri", margin: 0
    });
  });

  s.addText("Department of Internal Medicine  β€’  Medical Internship Programme  β€’  2026", {
    x: 0.5, y: 5.1, w: 9, h: 0.25,
    fontSize: 9, color: C.textMuted, fontFace: "Calibri", margin: 0
  });
}

// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 2 – DEFINITIONS & OVERVIEW
// ═══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  bg(s);
  headerBar(s, "Definitions & Overview", "Understanding the spectrum of respiratory compromise");
  footer(s);

  // Definition box
  s.addShape(pres.ShapeType.roundRect, {
    x: 0.3, y: 1.1, w: 9.4, h: 1.05,
    fill: { color: C.panelBg }, line: { color: C.teal, pt: 1.5 }, rectRadius: 0.1
  });
  s.addText([
    { text: "Respiratory Distress: ", options: { bold: true, color: C.teal, fontSize: 11 } },
    { text: "A clinical term combining the patient's subjective dyspnea with objective signs of difficulty breathing β€” tachypnea, accessory muscle use, cyanosis, altered mentation.", options: { color: C.offWhite, fontSize: 10.5 } }
  ], { x: 0.5, y: 1.12, w: 9, h: 1, valign: "middle", fontFace: "Calibri", margin: 0 });

  // Spectrum cards
  const spectrum = [
    { title: "Dyspnea", body: "Subjective sensation of\ndifficult or uncomfortable\nbreathing ('breathlessness')", col: C.teal },
    { title: "Tachypnea", body: "Objective rapid breathing\n>20 breaths/min in adults;\nobjective sign", col: C.gold },
    { title: "Respiratory Distress", body: "Dyspnea + objective signs\n(retractions, accessory\nmuscle use, cyanosis)", col: C.accent },
    { title: "Respiratory Failure", body: "PaOβ‚‚ <60 mmHg &/or\nPaCOβ‚‚ >50 mmHg;\nrequires intervention", col: "C0392B" },
  ];
  spectrum.forEach((item, i) => {
    const x = 0.3 + i * 2.37;
    s.addShape(pres.ShapeType.roundRect, {
      x, y: 2.3, w: 2.2, h: 2.9,
      fill: { color: C.panelBg }, line: { color: item.col, pt: 1.5 }, rectRadius: 0.1
    });
    // number badge top
    s.addShape(pres.ShapeType.ellipse, {
      x: x + 0.87, y: 2.18, w: 0.44, h: 0.44,
      fill: { color: item.col }, line: { color: item.col }
    });
    s.addText(String(i + 1), {
      x: x + 0.87, y: 2.18, w: 0.44, h: 0.44,
      fontSize: 14, bold: true, color: C.white, align: "center", fontFace: "Calibri", margin: 0
    });
    s.addText(item.title, {
      x: x + 0.1, y: 2.68, w: 2, h: 0.4,
      fontSize: 11, bold: true, color: item.col, align: "center", fontFace: "Calibri", margin: 0
    });
    s.addText(item.body, {
      x: x + 0.1, y: 3.1, w: 2, h: 1.9,
      fontSize: 9.5, color: C.offWhite, align: "center", fontFace: "Calibri", valign: "top", margin: 0
    });
  });
}

// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 3 – CAUSES & AETIOLOGY
// ═══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  bg(s);
  headerBar(s, "Causes & Aetiology", "Common and life-threatening causes in the ED β€” Tintinalli's Emergency Medicine");
  footer(s);

  const cols = [
    {
      title: "🫁  Pulmonary Causes",
      color: C.teal,
      items: [
        "Pneumonia / LRTI",
        "Asthma (acute severe)",
        "COPD exacerbation",
        "Pulmonary embolism",
        "Pneumothorax (tension)",
        "Pleural effusion",
        "ARDS (non-cardiogenic edema)",
        "Interstitial lung disease",
        "Pulmonary fibrosis",
      ]
    },
    {
      title: "❀️  Cardiac Causes",
      color: C.gold,
      items: [
        "Acute decompensated heart failure",
        "Cardiogenic pulmonary edema",
        "Acute MI / unstable angina",
        "Cardiac tamponade",
        "Arrhythmias with low CO",
        "Myocarditis / cardiomyopathy",
      ]
    },
    {
      title: "⚠️  Other Causes",
      color: C.accent,
      items: [
        "Upper airway obstruction (FB, angioedema)",
        "Sepsis / systemic infection",
        "Anaphylaxis",
        "Metabolic acidosis (DKA, lactic)",
        "Neuromuscular: Guillain-BarrΓ©, MG",
        "Anaemia (severe)",
        "Trauma / flail chest",
        "Toxic inhalation / poisoning",
      ]
    }
  ];

  cols.forEach((col, i) => {
    const x = 0.25 + i * 3.25;
    s.addShape(pres.ShapeType.roundRect, {
      x, y: 1.08, w: 3.1, h: 4.3,
      fill: { color: C.panelBg }, line: { color: col.color, pt: 1.2 }, rectRadius: 0.1
    });
    s.addText(col.title, {
      x: x + 0.1, y: 1.12, w: 2.9, h: 0.36,
      fontSize: 10.5, bold: true, color: col.color, fontFace: "Calibri", margin: 0
    });
    s.addShape(pres.ShapeType.line, {
      x: x + 0.1, y: 1.5, w: 2.9, h: 0, line: { color: col.color, pt: 0.7 }
    });
    const bullets = col.items.map((item, idx) => ({
      text: item,
      options: { bullet: true, breakLine: idx < col.items.length - 1, fontSize: 9.5, color: C.offWhite, fontFace: "Calibri" }
    }));
    s.addText(bullets, {
      x: x + 0.18, y: 1.56, w: 2.7, h: 3.7, valign: "top", margin: 0
    });
  });
}

// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 4 – SIGNS & SYMPTOMS
// ═══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  bg(s);
  headerBar(s, "Signs & Symptoms", "Physical examination findings in the distressed patient");
  footer(s);

  // Left: subjective
  card(s, 0.25, 1.08, 4.55, 4.3, "SUBJECTIVE (Symptoms β€” Patient Reports)", [
    "Dyspnea / breathlessness ('can't get enough air')",
    "Orthopnea β€” dyspnea on lying flat",
    "Paroxysmal nocturnal dyspnea (PND)",
    "Chest tightness or pressure",
    "Palpitations, anxiety, restlessness",
    "Inability to speak in full sentences",
    "Sense of impending doom",
    "Wheezing or noisy breathing",
  ], C.gold);

  // Right: objective
  card(s, 5.05, 1.08, 4.7, 4.3, "OBJECTIVE (Signs β€” Clinician Observes)", [
    "Tachypnea (RR >20; severe >30 bpm)",
    "Tachycardia, diaphoresis",
    "Use of accessory muscles (SCM, scalenes)",
    "Nasal flaring, pursed-lip breathing",
    "Intercostal / subcostal retractions",
    "Paradoxical abdominal movement",
    "Central cyanosis (late, severe sign)",
    "Hypoxia on pulse oximetry (SpOβ‚‚ <94%)",
    "Altered consciousness β€” agitation β†’ drowsiness",
  ], C.accent);

  // Alert bar
  s.addShape(pres.ShapeType.rect, {
    x: 0.25, y: 5.28, w: 9.5, h: 0.22,
    fill: { color: "7D1C1C" }, line: { color: C.accent }
  });
  s.addText("🚨  RED FLAGS: Inability to speak, GCS ↓, SpOβ‚‚ <90%, cyanosis, silent chest β†’ immediate intervention", {
    x: 0.35, y: 5.28, w: 9.3, h: 0.22,
    fontSize: 9, bold: true, color: "FFD1D1", fontFace: "Calibri", margin: 0
  });
}

// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 5 – CLINICAL MANIFESTATIONS
// ═══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  bg(s);
  headerBar(s, "Clinical Manifestations", "System-by-system effects of acute respiratory compromise");
  footer(s);

  const boxes = [
    { title: "Respiratory System", color: C.teal, x: 0.25, y: 1.08, items: [
      "Laboured, shallow or deep rapid breaths",
      "Wheezing (bronchospasm) or stridor (upper airway)",
      "Crackles / rales (pulmonary oedema, pneumonia)",
      "Diminished breath sounds (effusion, tension PTX)",
      "Use of accessory muscles β€” intercostal, SCM"
    ]},
    { title: "Cardiovascular System", color: C.gold, x: 5.05, y: 1.08, items: [
      "Compensatory tachycardia (HR >100 bpm)",
      "Hypertension early β†’ hypotension in failure",
      "Pulsus paradoxus (tamponade, severe asthma)",
      "Jugular venous distension (cor pulmonale, HF)",
      "Right heart strain on ECG (PE, severe hypoxia)"
    ]},
    { title: "Neurological System", color: C.accent, x: 0.25, y: 3.1, items: [
      "Restlessness, anxiety β†’ hallmark of hypoxia",
      "Confusion, agitation as hypoxia worsens",
      "Drowsiness / obtundation from hypercapnia",
      "Headache (COβ‚‚ retention β€” 'COβ‚‚ narcosis')",
      "Seizures, coma in extreme hypoxia"
    ]},
    { title: "Skin & Peripheral Signs", color: C.teal, x: 5.05, y: 3.1, items: [
      "Central cyanosis β€” tongue & mucous membranes",
      "Peripheral cyanosis β€” fingernails, extremities",
      "Diaphoresis (sympathetic activation)",
      "Oedema (right HF, cor pulmonale)",
      "Clubbing (chronic lung disease β€” not acute)"
    ]},
  ];

  boxes.forEach(box => {
    card(s, box.x, box.y, 4.55, 2.0, box.title, box.items, box.color);
  });
}

// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 6 – INVESTIGATIONS
// ═══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  bg(s);
  headerBar(s, "Investigations", "Systematic workup for the patient in respiratory distress");
  footer(s);

  // Left column
  card(s, 0.25, 1.08, 4.55, 2.15, "Bedside / First-Line", [
    "Pulse oximetry β€” SpOβ‚‚ (rapid, non-invasive)",
    "12-lead ECG β€” ischaemia, PE strain pattern, arrhythmia",
    "Arterial Blood Gas (ABG) β€” PaOβ‚‚, PaCOβ‚‚, pH, HCO₃",
    "Peak Expiratory Flow (PEF) β€” obstructive disease",
    "Bedside point-of-care ultrasound (POCUS)"
  ], C.teal);

  card(s, 0.25, 3.38, 4.55, 2.0, "Laboratory Tests", [
    "FBC β€” anaemia, infection (neutrophilia/lymphopenia)",
    "BNP / NT-proBNP β€” heart failure (<100 excludes HF)",
    "D-dimer β€” PE screening (high sensitivity)",
    "CRP / Procalcitonin β€” infection/sepsis",
    "Troponin β€” ACS, myocarditis"
  ], C.gold);

  // Right column
  card(s, 5.05, 1.08, 4.7, 2.15, "Imaging", [
    "Chest X-ray β€” bilateral infiltrates, cardiomegaly, PTX",
    "CT Pulmonary Angiography (CTPA) β€” PE diagnosis",
    "High-resolution CT chest (HRCT) β€” ILD, fibrosis",
    "Echocardiography β€” cardiac function, tamponade, PE",
    "V/Q scan β€” PE (if CTPA contraindicated)"
  ], C.teal);

  card(s, 5.05, 3.38, 4.7, 2.0, "ABG Interpretation Key", [
    "Type 1 RF: PaOβ‚‚ <60 mmHg, PaCOβ‚‚ normal/low",
    "Type 2 RF: PaOβ‚‚ <60 + PaCOβ‚‚ >50 mmHg",
    "P/F ratio = PaOβ‚‚ Γ· FiOβ‚‚ (ARDS severity)",
    "Respiratory acidosis β†’ COβ‚‚ retention (hypoventilation)",
    "Metabolic acidosis + ↑RR β†’ Kussmaul breathing (DKA)"
  ], C.accent);
}

// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 7 – ARDS: BERLIN CRITERIA & INVESTIGATING CRITERIA
// ═══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  bg(s);
  headerBar(s, "ARDS: Berlin Definition & Diagnostic Criteria", "Acute Respiratory Distress Syndrome β€” 2012 Berlin Consensus");
  footer(s);

  // Berlin criteria table
  s.addText("Berlin Definition of ARDS (2012)", {
    x: 0.3, y: 1.08, w: 9.4, h: 0.3,
    fontSize: 11, bold: true, color: C.teal, fontFace: "Calibri", margin: 0
  });

  const headers = ["Criterion", "Details"];
  const rows = [
    ["Timing", "Onset within 1 week of a known clinical insult or new/worsening respiratory symptoms"],
    ["Imaging (CXR/CT)", "Bilateral opacities β€” not fully explained by effusions, atelectasis, or nodules"],
    ["Origin of Oedema", "Not fully explained by cardiac failure or fluid overload; if no risk factor β†’ echo needed"],
    ["Oxygenation", "PaOβ‚‚/FiOβ‚‚ ≀300 with PEEP or CPAP β‰₯5 cmHβ‚‚O on mechanical ventilation"],
  ];

  const rowH = 0.52;
  const startY = 1.42;
  const colW = [2.6, 6.8];
  const colX = [0.25, 2.9];

  // Header row
  [0, 1].forEach(ci => {
    s.addShape(pres.ShapeType.rect, {
      x: colX[ci], y: startY, w: colW[ci], h: 0.38,
      fill: { color: C.accent }, line: { color: C.accentSoft }
    });
    s.addText(headers[ci], {
      x: colX[ci] + 0.08, y: startY, w: colW[ci] - 0.1, h: 0.38,
      fontSize: 10, bold: true, color: C.white, fontFace: "Calibri", valign: "middle", margin: 0
    });
  });

  rows.forEach((row, ri) => {
    const y = startY + 0.38 + ri * rowH;
    const bg_color = ri % 2 === 0 ? C.panelBg : C.midBg;
    [0, 1].forEach(ci => {
      s.addShape(pres.ShapeType.rect, {
        x: colX[ci], y, w: colW[ci], h: rowH,
        fill: { color: bg_color }, line: { color: C.accent, pt: 0.5 }
      });
      s.addText(row[ci], {
        x: colX[ci] + 0.1, y, w: colW[ci] - 0.15, h: rowH,
        fontSize: 9.5, color: C.offWhite, fontFace: "Calibri", valign: "middle", wrap: true, margin: 0
      });
    });
  });

  // Severity sub-table
  s.addText("ARDS Severity Classification (P/F Ratio)", {
    x: 0.3, y: 3.64, w: 9.4, h: 0.28,
    fontSize: 10.5, bold: true, color: C.gold, fontFace: "Calibri", margin: 0
  });

  const sev = [
    { label: "MILD ARDS", pf: "PaOβ‚‚/FiOβ‚‚  201–300", mortal: "~27%", color: C.teal },
    { label: "MODERATE ARDS", pf: "PaOβ‚‚/FiOβ‚‚  101–200", mortal: "~32%", color: C.gold },
    { label: "SEVERE ARDS", pf: "PaOβ‚‚/FiOβ‚‚  ≀100", mortal: "~45%", color: C.accent },
  ];
  sev.forEach((item, i) => {
    const x = 0.25 + i * 3.2;
    s.addShape(pres.ShapeType.roundRect, {
      x, y: 3.95, w: 3.0, h: 1.3,
      fill: { color: C.panelBg }, line: { color: item.color, pt: 1.5 }, rectRadius: 0.1
    });
    s.addText(item.label, {
      x: x + 0.1, y: 4.0, w: 2.8, h: 0.32,
      fontSize: 10, bold: true, color: item.color, align: "center", fontFace: "Calibri", margin: 0
    });
    s.addText(item.pf, {
      x: x + 0.1, y: 4.34, w: 2.8, h: 0.32,
      fontSize: 9.5, color: C.offWhite, align: "center", fontFace: "Calibri", margin: 0
    });
    s.addText("Mortality: " + item.mortal, {
      x: x + 0.1, y: 4.68, w: 2.8, h: 0.42,
      fontSize: 10, bold: true, color: item.color, align: "center", fontFace: "Calibri", margin: 0
    });
  });
}

// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 8 – DIAGNOSTIC TOOLS (Imaging)
// ═══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  bg(s);
  headerBar(s, "Diagnostic Tools", "Imaging & monitoring modalities in respiratory distress");
  footer(s);

  const tools = [
    {
      title: "Chest X-Ray (CXR)",
      icon: "πŸ“·",
      color: C.teal,
      x: 0.25, y: 1.1, w: 4.55, h: 2.1,
      items: [
        "First-line imaging in ALL patients",
        "ARDS: Bilateral diffuse opacities ('white-out')",
        "HF: Cardiomegaly, Kerley B lines, bat-wing oedema",
        "Pneumothorax: absent lung markings, tracheal deviation",
        "Pneumonia: lobar/segmental consolidation",
        "PE: Westermark sign, Hampton's hump (rare)"
      ]
    },
    {
      title: "CT Pulmonary Angiography (CTPA)",
      icon: "🩻",
      color: C.gold,
      x: 5.05, y: 1.1, w: 4.7, h: 2.1,
      items: [
        "Gold standard for pulmonary embolism",
        "HRCT: ILD patterns (UIP, NSIP, COP)",
        "CT for ARDS: ground-glass opacities, dependent consolidation",
        "Identifies pneumonia complications (empyema, abscess)",
        "Assess pneumothorax extent; aortic pathology"
      ]
    },
    {
      title: "Echocardiography",
      icon: "πŸ«€",
      color: C.accent,
      x: 0.25, y: 3.35, w: 4.55, h: 1.95,
      items: [
        "Differentiates cardiogenic vs non-cardiogenic oedema",
        "Detects cardiac tamponade, pericardial effusion",
        "Right heart strain in massive PE (McConnell sign)",
        "Ejection fraction β€” systolic HF assessment",
        "POCUS (bedside echo) β€” rapid, highly valuable in ED"
      ]
    },
    {
      title: "Arterial Blood Gas (ABG)",
      icon: "🩸",
      color: C.teal,
      x: 5.05, y: 3.35, w: 4.7, h: 1.95,
      items: [
        "Essential to quantify hypoxia and hypercapnia",
        "P/F ratio determines ARDS severity",
        "Type I vs Type II respiratory failure classification",
        "Acid-base status: acidosis drives compensatory ↑RR",
        "Guides ventilation strategy (PEEP, FiOβ‚‚ titration)"
      ]
    }
  ];

  tools.forEach(t => {
    s.addShape(pres.ShapeType.roundRect, {
      x: t.x, y: t.y, w: t.w, h: t.h,
      fill: { color: C.panelBg }, line: { color: t.color, pt: 1.2 }, rectRadius: 0.1
    });
    s.addText(t.icon + "  " + t.title, {
      x: t.x + 0.1, y: t.y + 0.07, w: t.w - 0.2, h: 0.35,
      fontSize: 10.5, bold: true, color: t.color, fontFace: "Calibri", margin: 0
    });
    s.addShape(pres.ShapeType.line, {
      x: t.x + 0.1, y: t.y + 0.44, w: t.w - 0.2, h: 0,
      line: { color: t.color, pt: 0.7 }
    });
    const bullets = t.items.map((item, idx) => ({
      text: item,
      options: { bullet: true, breakLine: idx < t.items.length - 1, fontSize: 9, color: C.offWhite, fontFace: "Calibri" }
    }));
    s.addText(bullets, {
      x: t.x + 0.18, y: t.y + 0.5, w: t.w - 0.28, h: t.h - 0.58,
      valign: "top", margin: 0
    });
  });
}

// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 9 – TREATMENT
// ═══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  bg(s);
  headerBar(s, "Treatment & Management", "Evidence-based stepwise approach β€” Miller's Anesthesia & Goldman-Cecil Medicine");
  footer(s);

  // ABCDE banner
  s.addShape(pres.ShapeType.rect, {
    x: 0.25, y: 1.08, w: 9.5, h: 0.35,
    fill: { color: "1A2C4A" }, line: { color: C.accent }
  });
  s.addText("IMMEDIATE PRIORITY: Airway β†’ Breathing β†’ Circulation β†’ Disability β†’ Exposure (ABCDE Approach)", {
    x: 0.35, y: 1.08, w: 9.2, h: 0.35,
    fontSize: 9.5, bold: true, color: C.gold, fontFace: "Calibri", margin: 0, align: "center"
  });

  const txBoxes = [
    {
      title: "1. Oxygen Therapy",
      color: C.teal, x: 0.25, y: 1.52, w: 3.0, h: 3.75,
      items: [
        "Target SpOβ‚‚ 94–98% (88–92% in COPD)",
        "Nasal cannula: 1–6 L/min (FiOβ‚‚ 24–44%)",
        "Simple face mask: 5–10 L/min",
        "Non-rebreather mask: 15 L/min (FiOβ‚‚ ~70%)",
        "High-Flow Nasal Cannula (HFNC): up to 60 L/min",
        "CPAP / BiPAP: cardiogenic oedema, COPD, mild ARDS",
        "Intubation + IMV: SpOβ‚‚ <90% despite above or ↓GCS"
      ]
    },
    {
      title: "2. Disease-Specific Rx",
      color: C.gold, x: 3.37, y: 1.52, w: 3.05, h: 3.75,
      items: [
        "Asthma/COPD: Salbutamol nebulisers, ipratropium, IV hydrocortisone, MgSOβ‚„",
        "ARDS: Lung-protective ventilation (TV 6 mL/kg, PEEP β‰₯5), prone positioning",
        "Pulmonary Oedema: IV furosemide, GTN, CPAP",
        "PE: Anticoagulation (LMWH/UFH); thrombolysis if massive",
        "Pneumothorax: Needle decompression β†’ chest tube",
        "Anaphylaxis: IM Adrenaline 0.5 mg (1:1000)",
        "Pneumonia: Empirical antibiotics per local guidelines"
      ]
    },
    {
      title: "3. Ventilation & ICU",
      color: C.accent, x: 6.55, y: 1.52, w: 3.2, h: 3.75,
      items: [
        "Lung-protective ventilation in ARDS (ARDSNet): TV 4–8 mL/kg IBW",
        "PEEP ladder: titrate to oxygenation (target P/F >200)",
        "Plateau pressure <30 cmHβ‚‚O",
        "Prone positioning: improves V/Q in severe ARDS (↓mortality)",
        "Neuromuscular blockade: early 48h in moderate-severe ARDS",
        "ECMO (VV-ECMO): refractory ARDS, bridge to recovery",
        "Daily spontaneous awakening + breathing trials"
      ]
    }
  ];

  txBoxes.forEach(b => {
    s.addShape(pres.ShapeType.roundRect, {
      x: b.x, y: b.y, w: b.w, h: b.h,
      fill: { color: C.panelBg }, line: { color: b.color, pt: 1.5 }, rectRadius: 0.1
    });
    s.addText(b.title, {
      x: b.x + 0.1, y: b.y + 0.07, w: b.w - 0.2, h: 0.34,
      fontSize: 10.5, bold: true, color: b.color, fontFace: "Calibri", margin: 0
    });
    s.addShape(pres.ShapeType.line, {
      x: b.x + 0.1, y: b.y + 0.43, w: b.w - 0.2, h: 0,
      line: { color: b.color, pt: 0.7 }
    });
    const bullets = b.items.map((item, idx) => ({
      text: item,
      options: { bullet: true, breakLine: idx < b.items.length - 1, fontSize: 9, color: C.offWhite, fontFace: "Calibri" }
    }));
    s.addText(bullets, {
      x: b.x + 0.18, y: b.y + 0.5, w: b.w - 0.28, h: b.h - 0.58,
      valign: "top", margin: 0
    });
  });
}

// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 10 – REAL-LIFE CASES
// ═══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  bg(s);
  headerBar(s, "Real-Life Clinical Cases", "Applying the framework β€” how we use it at the bedside");
  footer(s);

  const cases = [
    {
      num: "01",
      title: "Case 1 β€” 68-yr-old Male, Smoker",
      dx: "ARDS secondary to Severe Pneumonia",
      color: C.accent,
      x: 0.25, y: 1.08,
      presentation: "68M, 40 pack-year smoker. 5-day history of fever, productive cough, worsening breathlessness. SpOβ‚‚ 82% on air, RR 32, HR 118, T 39.2Β°C. Unable to speak in full sentences. Bilateral coarse crepitations.",
      workup: "CXR: bilateral diffuse infiltrates. ABG: PaOβ‚‚ 48 mmHg, PaCOβ‚‚ 38, pH 7.44. P/F ratio = 48/0.21 = 229 β†’ Mild ARDS. WBC 18.5, CRP 280. Blood cultures Γ—2.",
      management: "High-flow Oβ‚‚ β†’ CPAP β†’ intubated (SpOβ‚‚ remained <90%). Lung-protective ventilation TV 6 mL/kg, PEEP 10. IV piperacillin-tazobactam + azithromycin. Prone for 16h/day. Day 7: extubated. Discharged day 14."
    },
    {
      num: "02",
      title: "Case 2 β€” 32-yr-old Female, Known Asthmatic",
      dx: "Acute Severe Asthma",
      color: C.gold,
      x: 5.05, y: 1.08,
      presentation: "32F, asthma since age 12. Brought in by ambulance after 2 h of worsening breathlessness, unable to talk. SpOβ‚‚ 89%, RR 34, HR 130. Widespread bilateral expiratory wheeze. No recent preventer inhaler use.",
      workup: "ABG: pH 7.28, PaCOβ‚‚ 52 (COβ‚‚ rising = exhaustion), PaOβ‚‚ 55. PEF: 30% predicted. CXR: hyperinflation, no consolidation. ECG: sinus tachycardia only.",
      management: "Continuous salbutamol nebulisers + ipratropium. IV hydrocortisone 200 mg. IV MgSOβ‚„ 2 g over 20 min. NIV not indicated for asthma. SpOβ‚‚ improved to 96% at 90 min. Admitted to HDU. Discharged on MART regimen with FeNO and spirometry follow-up."
    },
  ];

  cases.forEach(c => {
    const cw = 4.55;
    const h = 4.35;
    s.addShape(pres.ShapeType.roundRect, {
      x: c.x, y: c.y, w: cw, h,
      fill: { color: C.panelBg }, line: { color: c.color, pt: 1.5 }, rectRadius: 0.1
    });
    // Badge
    s.addShape(pres.ShapeType.ellipse, {
      x: c.x + 0.12, y: c.y + 0.08, w: 0.44, h: 0.44,
      fill: { color: c.color }, line: { color: c.color }
    });
    s.addText(c.num, {
      x: c.x + 0.12, y: c.y + 0.08, w: 0.44, h: 0.44,
      fontSize: 11, bold: true, color: C.white, align: "center", fontFace: "Calibri", margin: 0
    });
    s.addText(c.title, {
      x: c.x + 0.65, y: c.y + 0.1, w: cw - 0.75, h: 0.4,
      fontSize: 10, bold: true, color: c.color, fontFace: "Calibri", margin: 0
    });
    s.addText("Dx: " + c.dx, {
      x: c.x + 0.65, y: c.y + 0.48, w: cw - 0.75, h: 0.28,
      fontSize: 9, bold: true, italic: true, color: C.white, fontFace: "Calibri", margin: 0
    });
    s.addShape(pres.ShapeType.line, {
      x: c.x + 0.15, y: c.y + 0.78, w: cw - 0.3, h: 0,
      line: { color: c.color, pt: 0.7 }
    });

    const sections = [
      { label: "Presentation", text: c.presentation, labelColor: C.teal },
      { label: "Investigations", text: c.workup, labelColor: C.gold },
      { label: "Management", text: c.management, labelColor: C.accent },
    ];
    let yOffset = c.y + 0.86;
    sections.forEach(sec => {
      s.addText(sec.label + ":", {
        x: c.x + 0.18, y: yOffset, w: cw - 0.3, h: 0.24,
        fontSize: 9, bold: true, color: sec.labelColor, fontFace: "Calibri", margin: 0
      });
      yOffset += 0.24;
      s.addText(sec.text, {
        x: c.x + 0.18, y: yOffset, w: cw - 0.3, h: 1.0,
        fontSize: 8.5, color: C.offWhite, fontFace: "Calibri", valign: "top", wrap: true, margin: 0
      });
      yOffset += 1.02;
    });
  });
}

// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 11 – SUMMARY / KEY TAKEAWAYS
// ═══════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  bg(s);

  s.addShape(pres.ShapeType.rect, {
    x: 0, y: 0, w: "100%", h: 0.08, fill: { color: C.accent }, line: { color: C.accent }
  });
  s.addShape(pres.ShapeType.rect, {
    x: 0, y: 0.08, w: "100%", h: 0.9, fill: { color: C.midBg }, line: { color: C.midBg }
  });

  s.addText("KEY TAKEAWAYS", {
    x: 0.4, y: 0.1, w: 9, h: 0.55,
    fontSize: 22, bold: true, color: C.white, fontFace: "Calibri", charSpacing: 1, margin: 0
  });
  s.addText("Respiratory Distress β€” What Every Medical Intern Must Know", {
    x: 0.4, y: 0.62, w: 9, h: 0.3,
    fontSize: 11, color: C.teal, fontFace: "Calibri", margin: 0
  });
  s.addShape(pres.ShapeType.rect, {
    x: 0, y: 0.98, w: "100%", h: 0.03, fill: { color: C.accent }, line: { color: C.accent }
  });

  const takeaways = [
    { num: 1, text: "Respiratory distress is a medical emergency β€” assess airway, breathing & oxygenation first (ABCDE)." },
    { num: 2, text: "SpOβ‚‚ < 94% needs supplemental oxygen immediately; SpOβ‚‚ < 90% on oxygen β†’ escalate to NIV / intubation." },
    { num: 3, text: "ABG is indispensable β€” classify Type I vs Type II RF; calculate P/F ratio to grade ARDS severity." },
    { num: 4, text: "ARDS Berlin Criteria: bilateral opacities + PaOβ‚‚/FiOβ‚‚ ≀300 + PEEP β‰₯5 + onset within 1 week." },
    { num: 5, text: "Treat the underlying cause: bronchodilators for asthma/COPD, diuretics for cardiogenic oedema, anticoagulation for PE." },
    { num: 6, text: "Lung-protective ventilation (6 mL/kg TV, PEEP titration, plateau <30 cmHβ‚‚O) reduces ARDS mortality." },
    { num: 7, text: "Prone positioning 16 h/day in moderate-severe ARDS reduces 28-day mortality (PROSEVA trial, NNT 6)." },
  ];

  takeaways.forEach((t, i) => {
    const y = 1.1 + i * 0.63;
    s.addShape(pres.ShapeType.ellipse, {
      x: 0.3, y: y + 0.04, w: 0.36, h: 0.36,
      fill: { color: C.accent }, line: { color: C.accent }
    });
    s.addText(String(t.num), {
      x: 0.3, y: y + 0.04, w: 0.36, h: 0.36,
      fontSize: 12, bold: true, color: C.white, align: "center", fontFace: "Calibri", margin: 0
    });
    s.addText(t.text, {
      x: 0.78, y, w: 9.0, h: 0.55,
      fontSize: 10, color: C.offWhite, fontFace: "Calibri", valign: "middle", margin: 0
    });
    if (i < takeaways.length - 1) {
      s.addShape(pres.ShapeType.line, {
        x: 0.78, y: y + 0.57, w: 9.0, h: 0,
        line: { color: C.panelBg, pt: 0.5 }
      });
    }
  });

  footer(s);
}

// ═══════════════════════════════════════════════════════════════════════════
// WRITE FILE
// ═══════════════════════════════════════════════════════════════════════════
pres.writeFile({ fileName: "/home/daytona/workspace/respiratory-distress-ppt/Respiratory_Distress.pptx" })
  .then(() => console.log("DONE: Respiratory_Distress.pptx"))
  .catch(e => { console.error(e); process.exit(1); });
Running Command

cd /home/daytona/workspace/respiratory-distress-ppt && node build.js 2>&1

Running Command

ls -lh /home/daytona/workspace/respiratory-distress-ppt/Respiratory_Distress.ppt…

Your presentation is ready! πŸŽ‰

Respiratory Distress

Presentation Β· PPTX


Here's what's included across 11 professionally designed slides (deep navy + medical red colour scheme):
SlideContent
1Title Slide β€” styled cover with topic tags
2Definitions & Overview β€” dyspnea β†’ tachypnea β†’ distress β†’ failure spectrum
3Causes & Aetiology β€” Pulmonary / Cardiac / Other (3-column layout)
4Signs & Symptoms β€” Subjective (patient-reported) vs Objective (clinician-observed) + Red Flags bar
5Clinical Manifestations β€” Respiratory, Cardiovascular, Neurological, Skin & Peripheral
6Investigations β€” Bedside, Lab, Imaging, ABG interpretation
7ARDS Berlin Criteria β€” table format + Mild/Moderate/Severe severity with mortality
8Diagnostic Tools β€” CXR, CTPA, Echo, ABG in detail
9Treatment & Management β€” Oβ‚‚ therapy, disease-specific Rx, ventilation/ICU (ARDSNet)
10Real-Life Cases β€” 2 cases (ARDS pneumonia + acute severe asthma) with full workup & management
11Key Takeaways β€” 7 essential intern pearls including PROSEVA trial reference
All content is sourced from Tintinalli's Emergency Medicine, Miller's Anesthesia, Fishman's Pulmonary Diseases, and Goldman-Cecil Medicine.

Respiratory distress in Emergency med Authentic introduction Approach to respiratory emergency (abcde approach) Important condition : respiratory failure 1 and 2 , cyanosis (central n peripheral). Common respiratory emergencies : asthma, COPD , pneumonia , Pulmonary edema - cardiogenic and non cardiogenic, pneumothorax - simple and tension , pulmonary Embolism , ARDS , Upper airway obstruction, include (pathophysiology and mechanism , sign and symptoms, investigation , TREATMENT ) Include ABG , Oxygen delivery devices, non invasive ventilation , chest examination , pulse oximetry , Add chest x ray also Add real life cases (2) also

Your credits are exhausted. Your daily credits reset tomorrow, or you can purchase a top-up for more.

Make presentation

Your credits are exhausted. Your daily credits reset tomorrow, or you can purchase a top-up for more.
This is a shared conversation. Sign in to Orris to start your own chat.