Make a ppt on asthama management

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

asthma management stepwise treatment algorithm

Running Command

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

Running Command

mkdir -p /home/daytona/workspace/asthma-management-ppt

Writing File

~/asthma-management-ppt/create_ppt.js

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

const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Asthma Management";
pres.author = "Medical Education";

// ─── Color Palette ───────────────────────────────────────────────────────────
const C = {
  deepBlue:   "0D3B66",  // dominant dark
  skyBlue:    "1A78C2",  // supporting mid
  lightBlue:  "D6EAF8",  // soft fill / card bg
  accent:     "F4A261",  // warm amber accent
  white:      "FFFFFF",
  lightGray:  "EAF0FB",
  darkText:   "1C2B3A",
  midText:    "3A5068",
  subtle:     "6B8CAE",
};

// ─── HELPERS ─────────────────────────────────────────────────────────────────

function addHeader(slide, title, subtitle) {
  // Full-width dark header bar
  slide.addShape(pres.ShapeType.rect, {
    x: 0, y: 0, w: "100%", h: 1.1,
    fill: { color: C.deepBlue },
    line: { color: C.deepBlue },
  });
  // Accent stripe
  slide.addShape(pres.ShapeType.rect, {
    x: 0, y: 1.05, w: "100%", h: 0.06,
    fill: { color: C.accent },
    line: { color: C.accent },
  });
  slide.addText(title, {
    x: 0.4, y: 0.1, w: 8.5, h: 0.65,
    fontSize: 26, bold: true, color: C.white,
    fontFace: "Calibri", valign: "middle",
  });
  if (subtitle) {
    slide.addText(subtitle, {
      x: 0.4, y: 0.72, w: 8.5, h: 0.35,
      fontSize: 13, color: C.accent,
      fontFace: "Calibri", valign: "middle",
    });
  }
}

function addFooter(slide, pageNum) {
  slide.addShape(pres.ShapeType.rect, {
    x: 0, y: 5.45, w: "100%", h: 0.18,
    fill: { color: C.deepBlue }, line: { color: C.deepBlue },
  });
  slide.addText("Asthma Management  |  Evidence-Based Clinical Guide", {
    x: 0.3, y: 5.45, w: 8.5, h: 0.18,
    fontSize: 8, color: C.subtle, fontFace: "Calibri",
  });
  slide.addText(`${pageNum}`, {
    x: 9.5, y: 5.45, w: 0.4, h: 0.18,
    fontSize: 8, color: C.white, fontFace: "Calibri", align: "right",
  });
}

function addBullets(slide, items, opts = {}) {
  const { x=0.4, y=1.3, w=9.2, h=3.9, fontSize=15, color=C.darkText } = opts;
  const textArr = items.map((item, i) => ({
    text: item,
    options: {
      bullet: { type: "bullet", characterCode: "25B6", indent: 16 },
      breakLine: i < items.length - 1,
      fontSize, color, fontFace: "Calibri",
      paraSpaceAfter: 6,
    },
  }));
  slide.addText(textArr, { x, y, w, h, valign: "top" });
}

function card(slide, x, y, w, h, title, lines, titleColor=C.deepBlue, bgColor=C.lightGray) {
  slide.addShape(pres.ShapeType.roundRect, {
    x, y, w, h,
    fill: { color: bgColor },
    line: { color: C.skyBlue, pt: 1.2 },
    rectRadius: 0.12,
  });
  slide.addText(title, {
    x: x + 0.12, y: y + 0.07, w: w - 0.24, h: 0.38,
    fontSize: 13, bold: true, color: titleColor,
    fontFace: "Calibri",
  });
  const lineArr = lines.map((l, i) => ({
    text: l,
    options: {
      bullet: { type: "bullet" },
      breakLine: i < lines.length - 1,
      fontSize: 12, color: C.darkText, fontFace: "Calibri",
      paraSpaceAfter: 4,
    },
  }));
  slide.addText(lineArr, {
    x: x + 0.12, y: y + 0.48, w: w - 0.24, h: h - 0.55,
    valign: "top",
  });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 1 β€” TITLE
// ═══════════════════════════════════════════════════════════════════════════════
{
  const sl = pres.addSlide();
  // Background gradient bands
  sl.addShape(pres.ShapeType.rect, {
    x: 0, y: 0, w: "100%", h: "100%",
    fill: { color: C.deepBlue }, line: { color: C.deepBlue },
  });
  sl.addShape(pres.ShapeType.rect, {
    x: 6.5, y: 0, w: 3.5, h: "100%",
    fill: { color: "0E4D8A" }, line: { color: "0E4D8A" },
  });
  // Large accent stripe
  sl.addShape(pres.ShapeType.rect, {
    x: 0, y: 3.8, w: 6.4, h: 0.08,
    fill: { color: C.accent }, line: { color: C.accent },
  });
  // Decorative circle
  sl.addShape(pres.ShapeType.ellipse, {
    x: 7.2, y: 0.6, w: 2.2, h: 2.2,
    fill: { color: "ffffff", transparency: 88 },
    line: { color: "ffffff", transparency: 70, pt: 1.5 },
  });
  sl.addShape(pres.ShapeType.ellipse, {
    x: 7.6, y: 1.0, w: 1.4, h: 1.4,
    fill: { color: C.accent, transparency: 30 },
    line: { color: C.accent },
  });

  sl.addText("ASTHMA", {
    x: 0.5, y: 1.0, w: 6, h: 1.1,
    fontSize: 58, bold: true, color: C.white,
    fontFace: "Calibri", charSpacing: 6,
  });
  sl.addText("MANAGEMENT", {
    x: 0.5, y: 1.95, w: 6, h: 0.9,
    fontSize: 42, bold: true, color: C.accent,
    fontFace: "Calibri", charSpacing: 3,
  });
  sl.addText("A Comprehensive Clinical Guide", {
    x: 0.5, y: 2.95, w: 6, h: 0.5,
    fontSize: 18, color: C.lightBlue, fontFace: "Calibri", italic: true,
  });
  sl.addText("Evidence-Based Approach to Diagnosis, Classification & Treatment", {
    x: 0.5, y: 3.98, w: 6, h: 0.5,
    fontSize: 13, color: "8AAFC8", fontFace: "Calibri",
  });
  sl.addText("Sources: Washington Manual of Medical Therapeutics β€’ Murray & Nadel's Textbook of Respiratory Medicine β€’ Textbook of Family Medicine", {
    x: 0.5, y: 5.15, w: 9.2, h: 0.35,
    fontSize: 8, color: "5D8AAD", fontFace: "Calibri",
  });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 2 β€” OVERVIEW / AGENDA
// ═══════════════════════════════════════════════════════════════════════════════
{
  const sl = pres.addSlide();
  sl.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:"100%", fill:{color:C.white}, line:{color:C.white} });
  addHeader(sl, "Overview", "What we will cover");
  addFooter(sl, 2);

  const topics = [
    ["01", "Definition & Pathophysiology",    "Airway inflammation, bronchospasm, remodeling"],
    ["02", "Diagnosis & Classification",       "Symptoms, spirometry, severity grading"],
    ["03", "Long-Term Management",             "Stepwise pharmacotherapy & controller therapy"],
    ["04", "Acute Exacerbation Management",    "Emergency & hospital-based treatment"],
    ["05", "Monitoring & Special Populations", "Pregnancy, pediatrics, follow-up goals"],
  ];

  topics.forEach(([num, heading, sub], i) => {
    const y = 1.25 + i * 0.83;
    sl.addShape(pres.ShapeType.rect, {
      x: 0.35, y, w: 9.3, h: 0.72,
      fill: { color: i % 2 === 0 ? C.lightGray : "F0F7FF" },
      line: { color: C.skyBlue, pt: 0.5 },
    });
    sl.addShape(pres.ShapeType.rect, {
      x: 0.35, y, w: 0.55, h: 0.72,
      fill: { color: C.skyBlue }, line: { color: C.skyBlue },
    });
    sl.addText(num, {
      x: 0.35, y: y + 0.16, w: 0.55, h: 0.4,
      fontSize: 14, bold: true, color: C.white, align: "center", fontFace: "Calibri",
    });
    sl.addText(heading, {
      x: 1.05, y: y + 0.06, w: 5.5, h: 0.35,
      fontSize: 14, bold: true, color: C.deepBlue, fontFace: "Calibri",
    });
    sl.addText(sub, {
      x: 1.05, y: y + 0.38, w: 8.4, h: 0.28,
      fontSize: 11, color: C.midText, fontFace: "Calibri",
    });
  });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 3 β€” DEFINITION & PATHOPHYSIOLOGY
// ═══════════════════════════════════════════════════════════════════════════════
{
  const sl = pres.addSlide();
  sl.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:"100%", fill:{color:C.white}, line:{color:C.white} });
  addHeader(sl, "Definition & Pathophysiology", "What happens in asthma?");
  addFooter(sl, 3);

  card(sl, 0.3, 1.25, 4.5, 2.1, "Definition",
    ["Chronic inflammatory airway disease", "Reversible airflow obstruction", "Airway hyperresponsiveness to triggers", "Symptoms: wheezing, cough, chest tightness, dyspnea"],
    C.deepBlue, C.lightGray
  );

  card(sl, 5.0, 1.25, 4.7, 2.1, "Pathophysiology",
    ["Mast cell & eosinophil-driven inflammation", "Th2 cytokines (IL-4, IL-5, IL-13)", "Goblet cell hyperplasia β†’ mucus hypersecretion", "Airway smooth muscle hypertrophy & remodeling"],
    C.deepBlue, "F0F7FF"
  );

  card(sl, 0.3, 3.5, 9.4, 1.85, "Key Triggers",
    ["Respiratory viruses (rhinovirus β€” most common exacerbation trigger)", "Allergens: dust mites, pollen, animal dander, mold", "Air pollutants, smoke, exercise, cold air", "NSAIDs/aspirin, Ξ²-blockers (in susceptible individuals)", "Occupational sensitizers, emotional stress"],
    C.accent, C.lightBlue
  );
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 4 β€” DIAGNOSIS
// ═══════════════════════════════════════════════════════════════════════════════
{
  const sl = pres.addSlide();
  sl.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:"100%", fill:{color:C.white}, line:{color:C.white} });
  addHeader(sl, "Diagnosis", "Clinical features & spirometry");
  addFooter(sl, 4);

  // Left column – clinical
  sl.addText("Clinical Features", { x:0.35, y:1.25, w:4.5, h:0.38, fontSize:15, bold:true, color:C.skyBlue, fontFace:"Calibri" });
  addBullets(sl, [
    "Episodic or recurrent wheezing",
    "Dyspnea, chest tightness",
    "Dry cough (especially nocturnal)",
    "Symptoms worse with exercise, cold air, allergens",
    "Symptoms variable and often reversible",
    "Personal/family history of atopy or eczema",
  ], { x:0.35, y:1.65, w:4.5, h:3.5, fontSize:13 });

  // Right column – spirometry
  sl.addShape(pres.ShapeType.rect, { x:5.1, y:1.2, w:4.6, h:4.1, fill:{color:C.lightGray}, line:{color:C.skyBlue, pt:1} });
  sl.addText("Spirometry & Objective Testing", { x:5.2, y:1.28, w:4.3, h:0.4, fontSize:14, bold:true, color:C.deepBlue, fontFace:"Calibri" });
  
  const spiro = [
    ["FEV\u2081/FVC", "< 0.70 confirms obstruction"],
    ["Reversibility", "\u226512% AND \u2265200 mL \u2191FEV\u2081 post-bronchodilator"],
    ["Bronchoprovocation", "Methacholine challenge if baseline normal"],
    ["Peak Flow", "Diurnal variability >10% supports diagnosis"],
    ["FeNO", ">40 ppb suggests eosinophilic airway inflammation"],
  ];
  spiro.forEach(([label, val], i) => {
    const y = 1.78 + i * 0.65;
    sl.addShape(pres.ShapeType.rect, { x:5.2, y, w:1.4, h:0.52, fill:{color:C.skyBlue}, line:{color:C.skyBlue} });
    sl.addText(label, { x:5.2, y: y+0.08, w:1.4, h:0.38, fontSize:11, bold:true, color:C.white, align:"center", fontFace:"Calibri" });
    sl.addText(val, { x:6.7, y: y+0.06, w:2.9, h:0.44, fontSize:11, color:C.darkText, fontFace:"Calibri", valign:"middle" });
  });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 5 β€” CLASSIFICATION
// ═══════════════════════════════════════════════════════════════════════════════
{
  const sl = pres.addSlide();
  sl.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:"100%", fill:{color:C.white}, line:{color:C.white} });
  addHeader(sl, "Classification of Asthma Severity", "NAEPP Guidelines β€” β‰₯12 years of age");
  addFooter(sl, 5);

  const headers = ["Component", "Intermittent", "Mild Persistent", "Moderate Persistent", "Severe Persistent"];
  const rows = [
    ["Symptoms", "≀2 days/week", ">2 d/wk, not daily", "Daily", "Throughout the day"],
    ["Night awakenings", "≀2Γ—/month", "3–4Γ—/month", ">1Γ—/week", "Often nightly"],
    ["SABA use", "≀2 d/wk", ">2 d/wk, not daily", "Daily", "Several times/day"],
    ["Activity limitation", "None", "Minor", "Some", "Extreme"],
    ["FEV\u2081 % predicted", ">80%", ">80%", "60–80%", "<60%"],
    ["Recommended step", "Step 1", "Step 2", "Step 3", "Step 4–5"],
  ];
  const colW = [2.0, 1.85, 1.85, 1.85, 1.85];
  const colX = [0.3, 2.3, 4.15, 6.0, 7.85];
  const headerColors = [C.deepBlue, "1565C0", "1976D2", "1A78C2", "1A8A9B"];

  // Headers
  headers.forEach((h, i) => {
    sl.addShape(pres.ShapeType.rect, { x:colX[i], y:1.2, w:colW[i]-0.04, h:0.5, fill:{color:headerColors[i]}, line:{color:C.deepBlue} });
    sl.addText(h, { x:colX[i], y:1.2, w:colW[i]-0.04, h:0.5, fontSize:11, bold:true, color:C.white, align:"center", fontFace:"Calibri", valign:"middle" });
  });

  // Rows
  rows.forEach((row, ri) => {
    const y = 1.72 + ri * 0.61;
    const bg = ri % 2 === 0 ? C.lightGray : C.white;
    row.forEach((cell, ci) => {
      sl.addShape(pres.ShapeType.rect, { x:colX[ci], y, w:colW[ci]-0.04, h:0.58, fill:{color:ci===0 ? C.lightBlue : bg}, line:{color:"C5D8EB"} });
      sl.addText(cell, { x:colX[ci]+0.05, y, w:colW[ci]-0.09, h:0.58, fontSize: ci===0 ? 11 : 11, bold:ci===0, color:C.darkText, fontFace:"Calibri", valign:"middle", align: ci===0 ? "left" : "center" });
    });
  });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 6 β€” STEPWISE LONG-TERM MANAGEMENT (image slide)
// ═══════════════════════════════════════════════════════════════════════════════
{
  const sl = pres.addSlide();
  sl.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:"100%", fill:{color:C.white}, line:{color:C.white} });
  addHeader(sl, "Stepwise Long-Term Management", "2021 Asthma Management Continuum");
  addFooter(sl, 6);

  // Fetch the stepwise image
  const imgUrl = "https://cdn.orris.care/cdss_images/GLGCA_4567551_1766519263906_cef1591b-1cc1-40a2-9a0c-94dd0647fc05_729150ca-35ec-4041-9fdd-a9051cbf609c.png";
  let imgData = null;
  try {
    const result = execSync(`node /home/daytona/skills/shared/scripts/fetch_images.js "${imgUrl}"`).toString();
    const parsed = JSON.parse(result);
    if (parsed[0] && !parsed[0].error) imgData = parsed[0].base64;
  } catch(e) { console.error("Image fetch failed:", e.message); }

  if (imgData) {
    sl.addImage({ data: imgData, x: 0.4, y: 1.18, w: 9.2, h: 4.2 });
  } else {
    sl.addText("Stepwise Management Continuum diagram", { x:0.4, y:1.3, w:9.2, h:4, fontSize:18, color:C.midText, align:"center" });
  }
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 7 β€” PHARMACOTHERAPY STEPS
// ═══════════════════════════════════════════════════════════════════════════════
{
  const sl = pres.addSlide();
  sl.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:"100%", fill:{color:C.white}, line:{color:C.white} });
  addHeader(sl, "Pharmacotherapy β€” Steps 1–6", "Controller & reliever medications");
  addFooter(sl, 7);

  const steps = [
    { step:"Step 1", drug:"PRN SABA",            bg:"EBF5FB", tx:C.deepBlue },
    { step:"Step 2", drug:"Low-dose ICS + PRN SABA",  bg:"D6EAF8", tx:C.deepBlue },
    { step:"Step 3", drug:"Low-dose ICS/LABA",        bg:"AED6F1", tx:C.deepBlue },
    { step:"Step 4", drug:"Med/High ICS/LABA",         bg:"5DADE2", tx:C.white    },
    { step:"Step 5", drug:"High ICS/LABA + Consider biologics", bg:"2E86C1", tx:C.white },
    { step:"Step 6", drug:"Oral corticosteroids (lowest dose)", bg:C.deepBlue, tx:C.white },
  ];

  const boxW = 1.5;
  const startX = 0.3;
  steps.forEach(({step, drug, bg, tx}, i) => {
    const x = startX + i * 1.58;
    // Trapezoid approximation using rect with different heights
    const h = 1.3 + i * 0.35;
    const y = 5.5 - h;
    sl.addShape(pres.ShapeType.rect, {
      x, y, w: boxW, h,
      fill: { color: bg }, line: { color: C.skyBlue, pt: 0.8 },
    });
    sl.addText(step, {
      x, y: y + 0.1, w: boxW, h: 0.35,
      fontSize: 11, bold: true, color: tx, align: "center", fontFace: "Calibri",
    });
    sl.addText(drug, {
      x: x + 0.05, y: y + 0.42, w: boxW - 0.1, h: h - 0.5,
      fontSize: 10, color: tx, align: "center", fontFace: "Calibri", valign: "middle",
    });
  });

  // Arrow showing escalation
  sl.addShape(pres.ShapeType.rect, {
    x: 0.3, y: 5.5, w: 9.2, h: 0.06,
    fill: { color: C.accent }, line: { color: C.accent },
  });
  sl.addText("β–Ά  Escalate if not controlled   |   β—€  Step down when stable for β‰₯3 months   |   Reassess at every visit", {
    x: 0.3, y: 5.58, w: 9.2, h: 0.3,
    fontSize: 10, color: C.midText, align: "center", fontFace: "Calibri",
  });

  // Note row
  sl.addText("ICS = Inhaled Corticosteroid  β€’  LABA = Long-Acting Ξ²β‚‚-Agonist  β€’  SABA = Short-Acting Ξ²β‚‚-Agonist  β€’  All steps: Education + trigger avoidance", {
    x: 0.3, y: 5.15, w: 9.4, h: 0.28,
    fontSize: 9, color: C.subtle, fontFace: "Calibri", italic: true,
  });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 8 β€” CONTROLLER MEDICATIONS
// ═══════════════════════════════════════════════════════════════════════════════
{
  const sl = pres.addSlide();
  sl.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:"100%", fill:{color:C.white}, line:{color:C.white} });
  addHeader(sl, "Controller Medications", "Long-term pharmacological agents");
  addFooter(sl, 8);

  const meds = [
    { name:"Inhaled Corticosteroids (ICS)", detail:"Cornerstone of therapy. Reduce airway inflammation.\nExamples: fluticasone, budesonide, beclomethasone.\nLow-dose for mild, high-dose for severe persistent asthma.", col:C.deepBlue },
    { name:"Long-Acting Ξ²β‚‚-Agonists (LABA)", detail:"Never use as monotherapy. Add to ICS for Steps 3–5.\nExamples: salmeterol, formoterol.\nImprove FEV\u2081 and reduce exacerbations.", col:C.skyBlue },
    { name:"Leukotriene Receptor Antagonists", detail:"Second-line alternative or add-on.\nExamples: montelukast, zafirlukast.\nUseful in aspirin-sensitive asthma & allergic rhinitis.", col:"1A8A9B" },
    { name:"Biologics (Severe Asthma)", detail:"Step 5 add-on. Target specific inflammatory pathways.\nomalizumab (anti-IgE), mepolizumab/benralizumab (anti-IL-5),\ndupilumab (anti-IL-4/IL-13).", col:"7D3C98" },
    { name:"Tiotropium (LAMA)", detail:"Add-on for β‰₯12 yrs at Step 4–5.\nImproves lung function in severe uncontrolled asthma.", col:C.accent },
  ];

  meds.forEach(({name, detail, col}, i) => {
    const x = i < 3 ? 0.3 : 3.6 + (i-3)*3.5;
    const y = i < 3 ? 1.2 + i * 1.42 : 1.2;
    const w = i < 3 ? 3.1 : 3.3;
    const h = i < 3 ? 1.3 : 3.0;

    if(i < 3) {
      // Left column: 3 stacked cards
      sl.addShape(pres.ShapeType.roundRect, { x, y, w, h, fill:{color:C.lightGray}, line:{color:col, pt:2}, rectRadius:0.1 });
      sl.addShape(pres.ShapeType.rect, { x, y, w:0.12, h, fill:{color:col}, line:{color:col} });
      sl.addText(name, { x:x+0.18, y:y+0.07, w:w-0.24, h:0.35, fontSize:12, bold:true, color:col, fontFace:"Calibri" });
      sl.addText(detail, { x:x+0.18, y:y+0.42, w:w-0.24, h:h-0.5, fontSize:10, color:C.darkText, fontFace:"Calibri" });
    } else {
      // Right column: 2 tall cards
      sl.addShape(pres.ShapeType.roundRect, { x, y, w, h, fill:{color:C.lightGray}, line:{color:col, pt:2}, rectRadius:0.1 });
      sl.addShape(pres.ShapeType.rect, { x, y, w:0.12, h, fill:{color:col}, line:{color:col} });
      sl.addText(name, { x:x+0.18, y:y+0.07, w:w-0.24, h:0.35, fontSize:12, bold:true, color:col, fontFace:"Calibri" });
      sl.addText(detail, { x:x+0.18, y:y+0.42, w:w-0.24, h:h-0.5, fontSize:10, color:C.darkText, fontFace:"Calibri" });
    }
  });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 9 β€” ACUTE EXACERBATION MANAGEMENT
// ═══════════════════════════════════════════════════════════════════════════════
{
  const sl = pres.addSlide();
  sl.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:"100%", fill:{color:C.white}, line:{color:C.white} });
  addHeader(sl, "Management of Acute Exacerbations", "Emergency & hospital-based approach");
  addFooter(sl, 9);

  // Severity assessment box
  sl.addShape(pres.ShapeType.roundRect, { x:0.3, y:1.2, w:4.4, h:4.0, fill:{color:C.lightGray}, line:{color:C.skyBlue, pt:1}, rectRadius:0.12 });
  sl.addText("Initial Assessment", { x:0.4, y:1.27, w:4.2, h:0.38, fontSize:14, bold:true, color:C.deepBlue, fontFace:"Calibri" });
  const assess = [
    "Severity: mild/moderate/severe/near-fatal",
    "Oximetry, SpOβ‚‚, peak expiratory flow (PEF)",
    "Use of accessory muscles, ability to speak",
    "ABG if PCOβ‚‚ normalizes without improvement β†’ impending respiratory failure",
    "Chest X-ray if pneumothorax suspected",
    "High-risk features: prior ICU admission, recent OCS use, poor adherence",
  ];
  addBullets(sl, assess, { x:0.4, y:1.67, w:4.2, h:3.4, fontSize:12 });

  // Treatment
  sl.addShape(pres.ShapeType.roundRect, { x:5.0, y:1.2, w:4.7, h:4.0, fill:{color:"F0F7FF"}, line:{color:C.accent, pt:1.5}, rectRadius:0.12 });
  sl.addText("Treatment Protocol", { x:5.1, y:1.27, w:4.4, h:0.38, fontSize:14, bold:true, color:C.accent, fontFace:"Calibri" });

  const treatments = [
    ["Mild–Moderate", "Albuterol 2–6 puffs MDI q20min Γ— 3, or 2.5 mg nebulized"],
    ["Severe",        "Albuterol 2.5–5 mg + Ipratropium 0.5 mg q20min via nebulizer"],
    ["Systemic CS",   "Prednisone 40–60 mg/day (oral = IV if equivalent dose). Prompt administration is key."],
    ["Refractory",    "IV Magnesium 2 g over 20 min. Heliox-driven nebulization (70:30 He:Oβ‚‚)."],
    ["Admission",     "Fails SABA after 30–60 min, PEF <70% baseline, SpOβ‚‚ <90%"],
    ["Discharge",     "Prednisone 40 mg/day Γ— 5–7 days + Initiate/increase ICS"],
  ];
  treatments.forEach(([label, val], i) => {
    const y = 1.7 + i * 0.57;
    sl.addShape(pres.ShapeType.rect, { x:5.1, y, w:1.4, h:0.5, fill:{color:C.accent}, line:{color:C.accent} });
    sl.addText(label, { x:5.1, y, w:1.4, h:0.5, fontSize:10, bold:true, color:C.white, align:"center", fontFace:"Calibri", valign:"middle" });
    sl.addText(val, { x:6.6, y: y+0.02, w:3.0, h:0.48, fontSize:9.5, color:C.darkText, fontFace:"Calibri", valign:"middle" });
  });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 10 β€” MONITORING & SPECIAL POPULATIONS
// ═══════════════════════════════════════════════════════════════════════════════
{
  const sl = pres.addSlide();
  sl.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:"100%", fill:{color:C.white}, line:{color:C.white} });
  addHeader(sl, "Monitoring & Special Populations", "Follow-up, control goals, pregnancy & children");
  addFooter(sl, 10);

  card(sl, 0.3, 1.2, 4.4, 2.1, "Monitoring Goals",
    ["Reassess control at every visit", "Spirometry or PEF monitoring", "Check inhaler technique & adherence", "Review trigger avoidance & action plan", "Sputum eosinophils in severe asthma", "Step down if well-controlled β‰₯3 months"],
    C.deepBlue
  );
  card(sl, 5.05, 1.2, 4.65, 2.1, "Well-Controlled Asthma Criteria",
    ["Symptoms ≀2 days/week", "Nighttime awakenings ≀2Γ—/month", "No limitation of normal activity", "SABA use ≀2 days/week", "FEV\u2081 or PEF β‰₯80% predicted", "No exacerbations in past year"],
    C.skyBlue, "F0F7FF"
  );
  card(sl, 0.3, 3.45, 4.4, 2.1, "Pregnancy",
    ["Uncontrolled asthma β†’ greater risk than medications", "Continue ICS β€” budesonide preferred (most data)", "SABA safe for acute relief", "Maintain SpO\u2082 β‰₯95%", "Monitor lung function each trimester"],
    "7D3C98", C.lightGray
  );
  card(sl, 5.05, 3.45, 4.65, 2.1, "Pediatrics",
    ["Children 0–4 yrs: intermittent ICS or daily low-dose ICS", "Children 5–11 yrs: same stepwise approach, lower ICS doses", "LABAs can be added at Step 3 (β‰₯5 yrs)", "Spacers/VHCs recommended for all inhaled therapies", "Regular assessment of growth with ICS use"],
    C.accent, C.lightBlue
  );
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 11 β€” KEY TAKEAWAYS
// ═══════════════════════════════════════════════════════════════════════════════
{
  const sl = pres.addSlide();
  sl.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:"100%", fill:{color:C.deepBlue}, line:{color:C.deepBlue} });
  sl.addShape(pres.ShapeType.rect, { x:0, y:4.9, w:"100%", h:0.08, fill:{color:C.accent}, line:{color:C.accent} });

  sl.addText("Key Takeaways", {
    x:0.5, y:0.15, w:9, h:0.7,
    fontSize:30, bold:true, color:C.white, fontFace:"Calibri", charSpacing:2,
  });

  const points = [
    ["ICS is the cornerstone",    "Every persistent asthma patient should be on inhaled corticosteroids."],
    ["Stepwise approach",         "Escalate therapy based on severity; step down when stable for 3+ months."],
    ["Treat exacerbations early", "Prompt bronchodilators + systemic steroids limit morbidity."],
    ["Patient education",         "Trigger avoidance, inhaler technique, and written action plans are essential."],
    ["Biologics for refractory",  "Anti-IgE, anti-IL-5, anti-IL-4/13 agents for Step 5 severe asthma."],
    ["Monitor & reassess",        "Spirometry, control scores, adherence review at every visit."],
  ];

  points.forEach(([title, desc], i) => {
    const col = i < 3 ? 0 : 1;
    const row = i % 3;
    const x = 0.35 + col * 4.85;
    const y = 1.05 + row * 1.25;
    sl.addShape(pres.ShapeType.roundRect, { x, y, w:4.6, h:1.1, fill:{color:"ffffff", transparency:88}, line:{color:C.accent, pt:1}, rectRadius:0.1 });
    sl.addShape(pres.ShapeType.rect, { x, y, w:0.1, h:1.1, fill:{color:C.accent}, line:{color:C.accent} });
    sl.addText(title, { x:x+0.18, y:y+0.1, w:4.3, h:0.35, fontSize:13, bold:true, color:C.accent, fontFace:"Calibri" });
    sl.addText(desc,  { x:x+0.18, y:y+0.48, w:4.3, h:0.55, fontSize:11, color:"D6EAF8", fontFace:"Calibri" });
  });

  sl.addText("Sources: Washington Manual of Medical Therapeutics β€’ Murray & Nadel's Respiratory Medicine β€’ Textbook of Family Medicine (Rakel)", {
    x:0.4, y:5.02, w:9.2, h:0.28,
    fontSize:8, color:"5D8AAD", fontFace:"Calibri",
  });
}

// ─── WRITE FILE ───────────────────────────────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/workspace/asthma-management-ppt/Asthma_Management.pptx" })
  .then(() => console.log("SUCCESS: /home/daytona/workspace/asthma-management-ppt/Asthma_Management.pptx"))
  .catch(e => { console.error("FAILED:", e); process.exit(1); });
Running Command

cd /home/daytona/workspace/asthma-management-ppt && node create_ppt.js 2>&1

Running Command

ls -lh /home/daytona/workspace/asthma-management-ppt/Asthma_Management.pptx

Your presentation is ready! πŸŽ‰

Asthma Management

Presentation Β· PPTX


What's inside β€” 11 slides:
#Slide
1Title slide β€” bold dark-blue design
2Overview / Agenda β€” numbered topic list
3Definition & Pathophysiology β€” inflammation, triggers, remodeling
4Diagnosis β€” clinical features + spirometry table (FEV₁, reversibility, FeNO)
5Classification of Severity β€” NAEPP table: Intermittent β†’ Severe Persistent
6Stepwise Long-Term Management β€” embedded 2021 continuum diagram (ICS dosing by age)
7Pharmacotherapy Steps 1–6 β€” escalating bar chart layout
8Controller Medications β€” ICS, LABA, LTRA, biologics (omalizumab, mepolizumab, dupilumab), tiotropium
9Acute Exacerbation Management β€” assessment checklist + treatment protocol (albuterol, steroids, Mg, heliox)
10Monitoring & Special Populations β€” control goals, pregnancy, pediatrics
11Key Takeaways β€” 6 summary cards on dark background
Content is sourced from the Washington Manual of Medical Therapeutics, Murray & Nadel's Textbook of Respiratory Medicine, and Textbook of Family Medicine (Rakel).
This is a shared conversation. Sign in to Orris to start your own chat.