A 65 year old asthama paitent comes to opd he has also diabeties mellitus type 2 and a exacreabtion of asthama attack how should i manage the paitent Genrare a ppt for managemet

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

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

Running Command

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

Writing File

~/asthma-diabetes-ppt/build.js

const pptxgen = require("pptxgenjs");

const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Asthma Exacerbation Management in T2DM";
pres.author = "Clinical Management Guide";

// Color Palette
const C = {
  navy:    "0D2B55",
  teal:    "1A7A8A",
  accent:  "F5A623",
  white:   "FFFFFF",
  light:   "EDF4F7",
  gray:    "5C6970",
  red:     "C0392B",
  green:   "1E8449",
  darkbg:  "0A1E35",
};

// ─── HELPER: slide header bar ────────────────────────────────────────────────
function addHeader(slide, title) {
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.75, fill: { color: C.navy } });
  slide.addText(title, {
    x: 0.25, y: 0, w: 9.5, h: 0.75,
    fontSize: 22, bold: true, color: C.white, valign: "middle", margin: 0,
  });
}

// ─── HELPER: accent stripe ────────────────────────────────────────────────────
function addAccentStripe(slide) {
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0.75, w: 10, h: 0.06, fill: { color: C.accent } });
}

// ─── HELPER: section box ─────────────────────────────────────────────────────
function sectionBox(slide, label, x, y, w, h, color) {
  slide.addShape(pres.ShapeType.rect, { x, y, w, h, fill: { color }, line: { color, width: 0 } });
  slide.addText(label, { x, y, w, h: 0.35, fontSize: 10, bold: true, color: C.white, valign: "middle", align: "center", margin: 0 });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 1 — TITLE SLIDE
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  // Full dark background
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.darkbg } });
  // Teal accent band left
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.25, h: 5.625, fill: { color: C.teal } });
  // Gold accent band
  s.addShape(pres.ShapeType.rect, { x: 0.25, y: 2.6, w: 9.75, h: 0.06, fill: { color: C.accent } });

  s.addText("ACUTE ASTHMA EXACERBATION", {
    x: 0.5, y: 0.7, w: 9, h: 0.8,
    fontSize: 32, bold: true, color: C.accent, align: "center",
  });
  s.addText("Management in a 65-Year-Old Patient with Type 2 Diabetes", {
    x: 0.5, y: 1.55, w: 9, h: 0.6,
    fontSize: 18, color: C.white, align: "center",
  });
  s.addText("Outpatient Department — Clinical Protocol", {
    x: 0.5, y: 2.2, w: 9, h: 0.4,
    fontSize: 13, color: C.teal, align: "center", italic: true,
  });

  // Patient summary card
  s.addShape(pres.ShapeType.rect, { x: 1.5, y: 2.9, w: 7, h: 1.9, fill: { color: "102840" }, line: { color: C.teal, width: 1.5 } });
  s.addText([
    { text: "Patient Profile\n", options: { bold: true, color: C.accent, fontSize: 13, breakLine: true } },
    { text: "• Age: 65 years  |  Comorbidity: Type 2 Diabetes Mellitus\n", options: { color: C.white, fontSize: 11, breakLine: true } },
    { text: "• Presenting with: Acute Exacerbation of Bronchial Asthma\n", options: { color: C.white, fontSize: 11, breakLine: true } },
    { text: "• Setting: OPD (Outpatient Department)", options: { color: C.white, fontSize: 11 } },
  ], { x: 1.7, y: 2.95, w: 6.6, h: 1.7, valign: "middle" });

  s.addText("Source: Textbook of Family Medicine 9e", {
    x: 0, y: 5.35, w: 10, h: 0.27,
    fontSize: 9, color: "4A6080", align: "center", italic: true,
  });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 2 — INITIAL ASSESSMENT
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.light } });
  addHeader(s, "STEP 1 — Initial Assessment at OPD");
  addAccentStripe(s);

  // Severity Classification
  s.addText("Classify Exacerbation Severity (NAEPP/GINA)", {
    x: 0.3, y: 0.92, w: 9.4, h: 0.35, fontSize: 13, bold: true, color: C.navy,
  });

  const rows = [
    [{ text: "Parameter", options: { bold: true } }, { text: "Mild", options: { bold: true } }, { text: "Moderate", options: { bold: true } }, { text: "Severe", options: { bold: true } }],
    ["Breathlessness", "On exertion", "On talking", "At rest"],
    ["Speech", "Full sentences", "Phrases", "Words only"],
    ["Accessory muscles", "Usually not", "Commonly", "Usually yes"],
    ["SpO₂ (room air)", ">95%", "91–95%", "<91%"],
    ["PEF % predicted", ">70%", "40–69%", "<40%"],
    ["FEV₁ % predicted", ">80%", ">60–<80%", "<60%"],
  ];

  s.addTable(rows, {
    x: 0.3, y: 1.3, w: 9.4,
    fontSize: 10.5,
    rowH: 0.38,
    border: { type: "solid", color: "B0C8D8", pt: 0.5 },
    align: "center",
    fontFace: "Calibri",
    fill: "FFFFFF",
    color: C.navy,
    bold: false,
    autoPage: false,
  });

  s.addText("⚠  In elderly diabetic patients: symptoms may be blunted. Rely on objective measures (SpO₂, PEF, FEV₁).", {
    x: 0.3, y: 4.2, w: 9.4, h: 0.5,
    fontSize: 10.5, color: C.red, bold: true, italic: true,
  });

  s.addShape(pres.ShapeType.rect, { x: 0.3, y: 4.8, w: 9.4, h: 0.55, fill: { color: "D6EAF8" }, line: { color: C.teal, width: 1 } });
  s.addText("Also assess: RR, HR, BP, GCS, blood glucose, current medications, recent SABA use, history of intubation", {
    x: 0.4, y: 4.82, w: 9.2, h: 0.5, fontSize: 10, color: C.navy, valign: "middle",
  });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 3 — IMMEDIATE MANAGEMENT
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.light } });
  addHeader(s, "STEP 2 — Immediate Pharmacological Management");
  addAccentStripe(s);

  // Column headers
  s.addShape(pres.ShapeType.rect, { x: 0.2, y: 0.88, w: 4.6, h: 0.38, fill: { color: C.teal } });
  s.addText("BRONCHODILATORS (First-Line)", { x: 0.2, y: 0.88, w: 4.6, h: 0.38, fontSize: 11, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });

  s.addShape(pres.ShapeType.rect, { x: 5.0, y: 0.88, w: 4.8, h: 0.38, fill: { color: C.navy } });
  s.addText("SYSTEMIC CORTICOSTEROIDS", { x: 5.0, y: 0.88, w: 4.8, h: 0.38, fontSize: 11, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });

  // Bronchodilators box
  s.addShape(pres.ShapeType.rect, { x: 0.2, y: 1.28, w: 4.6, h: 2.55, fill: { color: "FFFFFF" }, line: { color: C.teal, width: 1 } });
  s.addText([
    { text: "Short-Acting β₂-Agonist (SABA)\n", options: { bold: true, color: C.teal, fontSize: 11, breakLine: true } },
    { text: "• Salbutamol (Albuterol) MDI: 4–8 puffs q20 min × 3\n", options: { color: C.navy, fontSize: 10, breakLine: true } },
    { text: "• Nebulization: 2.5–5 mg in 3 mL NS q20 min × 3\n\n", options: { color: C.navy, fontSize: 10, breakLine: true } },
    { text: "Short-Acting Anticholinergic (add-on)\n", options: { bold: true, color: C.teal, fontSize: 11, breakLine: true } },
    { text: "• Ipratropium bromide 0.5 mg nebulized\n", options: { color: C.navy, fontSize: 10, breakLine: true } },
    { text: "• Combined SABA + IPRA improves PEF & reduces hospitalization", options: { color: C.navy, fontSize: 10 } },
  ], { x: 0.3, y: 1.35, w: 4.4, h: 2.4, valign: "top" });

  // Corticosteroids box
  s.addShape(pres.ShapeType.rect, { x: 5.0, y: 1.28, w: 4.8, h: 2.55, fill: { color: "FFFFFF" }, line: { color: C.navy, width: 1 } });
  s.addText([
    { text: "Oral Prednisolone (preferred)\n", options: { bold: true, color: C.navy, fontSize: 11, breakLine: true } },
    { text: "• 40–60 mg/day × 5–7 days\n", options: { color: C.navy, fontSize: 10, breakLine: true } },
    { text: "• Equivalent to IV in mild–moderate cases\n\n", options: { color: C.navy, fontSize: 10, breakLine: true } },
    { text: "IV Methylprednisolone (severe/vomiting)\n", options: { bold: true, color: C.navy, fontSize: 11, breakLine: true } },
    { text: "• 40–80 mg IV q1–2h until improvement\n\n", options: { color: C.navy, fontSize: 10, breakLine: true } },
    { text: "⚠ DIABETES ALERT: Steroids cause hyperglycemia — monitor blood glucose q4–6h; adjust insulin/OHAs accordingly", options: { color: C.red, fontSize: 10, bold: true } },
  ], { x: 5.1, y: 1.35, w: 4.6, h: 2.4, valign: "top" });

  // Oxygen
  s.addShape(pres.ShapeType.rect, { x: 0.2, y: 3.93, w: 4.6, h: 0.6, fill: { color: "E8F8F5" }, line: { color: C.green, width: 1 } });
  s.addText("🫁  OXYGEN: Target SpO₂ 93–95% via nasal cannula or face mask (avoid over-oxygenation)", {
    x: 0.3, y: 3.95, w: 4.4, h: 0.55, fontSize: 10, color: C.green, bold: true, valign: "middle",
  });

  // Magnesium
  s.addShape(pres.ShapeType.rect, { x: 5.0, y: 3.93, w: 4.8, h: 0.6, fill: { color: "FEF9E7" }, line: { color: C.accent, width: 1 } });
  s.addText("IV MgSO₄ 2g over 20 min — for severe exacerbation not responding to initial bronchodilators", {
    x: 5.1, y: 3.95, w: 4.6, h: 0.55, fontSize: 10, color: "7D6608", bold: true, valign: "middle",
  });

  s.addText("Do NOT use β-blockers, NSAIDs, or high-dose aspirin in asthma", {
    x: 0.2, y: 4.62, w: 9.6, h: 0.35, fontSize: 10, color: C.red, bold: true, italic: true,
  });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 4 — DIABETES MANAGEMENT DURING EXACERBATION
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.light } });
  addHeader(s, "CRITICAL CONSIDERATION — Diabetes Management During Exacerbation");
  addAccentStripe(s);

  s.addText("Steroid-Induced Hyperglycemia — A Major Challenge in This Patient", {
    x: 0.3, y: 0.9, w: 9.4, h: 0.4, fontSize: 13, bold: true, color: C.red,
  });

  // Why steroids cause hyperglycemia
  s.addShape(pres.ShapeType.rect, { x: 0.2, y: 1.35, w: 4.6, h: 1.85, fill: { color: "FDEDEC" }, line: { color: C.red, width: 1 } });
  s.addText([
    { text: "Mechanism of Hyperglycemia\n", options: { bold: true, color: C.red, fontSize: 11, breakLine: true } },
    { text: "• Steroids ↑ hepatic gluconeogenesis\n", options: { color: C.navy, fontSize: 10, breakLine: true } },
    { text: "• ↓ peripheral insulin sensitivity\n", options: { color: C.navy, fontSize: 10, breakLine: true } },
    { text: "• ↓ glucose uptake by muscle/fat\n", options: { color: C.navy, fontSize: 10, breakLine: true } },
    { text: "• Predominantly post-prandial hyperglycemia\n", options: { color: C.navy, fontSize: 10, breakLine: true } },
    { text: "• Effect peaks 4–8h after steroid dose", options: { color: C.navy, fontSize: 10 } },
  ], { x: 0.3, y: 1.42, w: 4.4, h: 1.7, valign: "top" });

  // Glucose monitoring
  s.addShape(pres.ShapeType.rect, { x: 5.0, y: 1.35, w: 4.8, h: 1.85, fill: { color: "EBF5FB" }, line: { color: C.teal, width: 1 } });
  s.addText([
    { text: "Blood Glucose Monitoring Protocol\n", options: { bold: true, color: C.teal, fontSize: 11, breakLine: true } },
    { text: "• Monitor CBG every 4–6 hours\n", options: { color: C.navy, fontSize: 10, breakLine: true } },
    { text: "• Target glucose: 7–10 mmol/L (126–180 mg/dL)\n", options: { color: C.navy, fontSize: 10, breakLine: true } },
    { text: "• Avoid hypoglycemia (especially in elderly)\n", options: { color: C.navy, fontSize: 10, breakLine: true } },
    { text: "• Document fasting + post-meal readings\n", options: { color: C.navy, fontSize: 10, breakLine: true } },
    { text: "• HbA1c if not done in last 3 months", options: { color: C.navy, fontSize: 10 } },
  ], { x: 5.1, y: 1.42, w: 4.6, h: 1.7, valign: "top" });

  // Diabetes drug management
  s.addShape(pres.ShapeType.rect, { x: 0.2, y: 3.25, w: 9.6, h: 2.1, fill: { color: "FFFFFF" }, line: { color: C.navy, width: 1 } });
  s.addText("Antidiabetic Drug Adjustments", {
    x: 0.3, y: 3.28, w: 9.4, h: 0.35, fontSize: 12, bold: true, color: C.navy,
  });

  const dmRows = [
    [{ text: "Drug", options: { bold: true } }, { text: "Action During Exacerbation", options: { bold: true } }, { text: "Reason", options: { bold: true } }],
    ["Metformin", "Continue if eating/stable; HOLD if unwell/contrast needed", "Lactic acidosis risk if unwell"],
    ["Sulfonylurea (Glipizide/Glimepiride)", "Reduce dose or HOLD if glucose very high or low", "Unpredictable glucose swings with steroids"],
    ["GLP-1 RA / DPP-4 inhibitors", "Can continue — adjust as needed", "Generally safe; low hypoglycemia risk"],
    ["Insulin (if required)", "Initiate or intensify — correction doses PRN", "Best for acute steroid-induced hyperglycemia"],
  ];

  s.addTable(dmRows, {
    x: 0.25, y: 3.65, w: 9.5,
    fontSize: 9.5,
    rowH: 0.32,
    border: { type: "solid", color: "B0C8D8", pt: 0.5 },
    fontFace: "Calibri",
    fill: "FFFFFF",
    color: C.navy,
    autoPage: false,
  });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 5 — DRUGS TO AVOID / SPECIAL PRECAUTIONS
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.darkbg } });
  addHeader(s, "DRUGS TO AVOID & SPECIAL PRECAUTIONS");
  addAccentStripe(s);

  // Avoid column
  s.addShape(pres.ShapeType.rect, { x: 0.2, y: 0.92, w: 4.6, h: 0.4, fill: { color: C.red } });
  s.addText("⛔  AVOID in Asthma + T2DM", { x: 0.2, y: 0.92, w: 4.6, h: 0.4, fontSize: 12, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });

  const avoid = [
    ["β-Blockers (e.g., Propranolol, Atenolol)", "Cause bronchospasm — even cardioselective ones in severe asthma"],
    ["Non-selective NSAIDs", "Aspirin/Ibuprofen → exacerbate asthma in aspirin-sensitive patients"],
    ["High-dose Theophylline", "Narrow therapeutic window; drug interactions with many T2DM drugs"],
    ["Glucocorticoids (chronic high-dose)", "Worsen T2DM; unavoidable in acute exacerbation — minimise duration"],
    ["Tiotropium as sole bronchodilator in acute", "Only adjunct; not for acute rescue"],
  ];

  avoid.forEach((row, i) => {
    const yBase = 1.4 + i * 0.6;
    s.addShape(pres.ShapeType.rect, { x: 0.2, y: yBase, w: 4.6, h: 0.56, fill: { color: i % 2 === 0 ? "2C1010" : "3D1515" }, line: { color: C.red, width: 0.5 } });
    s.addText([
      { text: row[0] + "\n", options: { bold: true, color: C.accent, fontSize: 10, breakLine: true } },
      { text: row[1], options: { color: "F0D0D0", fontSize: 9 } },
    ], { x: 0.3, y: yBase + 0.03, w: 4.4, h: 0.5, valign: "top" });
  });

  // Caution column
  s.addShape(pres.ShapeType.rect, { x: 5.0, y: 0.92, w: 4.8, h: 0.4, fill: { color: "7D6608" } });
  s.addText("⚠  USE WITH CAUTION", { x: 5.0, y: 0.92, w: 4.8, h: 0.4, fontSize: 12, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });

  const caution = [
    ["Oral Corticosteroids", "Necessary but monitor glucose closely — may need insulin bridging"],
    ["SABA (Salbutamol) high-dose", "Causes hypokalemia and tachycardia; can also raise glucose transiently"],
    ["Nebulized Ipratropium", "Generally safe; watch for urinary retention in elderly males"],
    ["IV Magnesium Sulfate", "Monitor renal function — impaired in some T2DM patients with nephropathy"],
    ["Aminophylline IV", "Last resort only; check drug interactions with fluoroquinolones, macrolides"],
  ];

  caution.forEach((row, i) => {
    const yBase = 1.4 + i * 0.6;
    s.addShape(pres.ShapeType.rect, { x: 5.0, y: yBase, w: 4.8, h: 0.56, fill: { color: i % 2 === 0 ? "282000" : "332A00" }, line: { color: C.accent, width: 0.5 } });
    s.addText([
      { text: row[0] + "\n", options: { bold: true, color: C.accent, fontSize: 10, breakLine: true } },
      { text: row[1], options: { color: "F0E8C0", fontSize: 9 } },
    ], { x: 5.1, y: yBase + 0.03, w: 4.6, h: 0.5, valign: "top" });
  });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 6 — STEPWISE TREATMENT ALGORITHM
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.light } });
  addHeader(s, "STEPWISE TREATMENT ALGORITHM — OPD Setting");
  addAccentStripe(s);

  const steps = [
    { label: "STEP 1", sub: "0–20 min", bg: C.teal, text: "SABA (Salbutamol) 4–8 puffs MDI or nebulization q20 min × 3 doses\n+ Ipratropium 0.5 mg nebulized\n+ O₂ to maintain SpO₂ 93–95%" },
    { label: "STEP 2", sub: "20–60 min", bg: C.navy, text: "Add systemic corticosteroid: Prednisolone 40–60 mg PO\nIV Methylprednisolone if vomiting or severe\nMonitor CBG — adjust antidiabetics" },
    { label: "STEP 3", sub: "60–120 min", bg: "1E5F8A", text: "Reassess: SpO₂, PEF, HR, RR, breath sounds, glucose\nIf poor response → IV MgSO₄ 2g over 20 min\nConsider IV aminophylline (last resort)" },
    { label: "STEP 4", sub: "Decision", bg: C.accent, text: "IMPROVED → Step-down therapy, Discharge planning\nNO RESPONSE → Refer to Emergency/ICU\nSevere hypoxia (SpO₂ <90%) → Immediate escalation" },
  ];

  steps.forEach((st, i) => {
    const x = 0.2 + i * 2.42;
    s.addShape(pres.ShapeType.rect, { x, y: 0.9, w: 2.25, h: 0.5, fill: { color: st.bg } });
    s.addText([
      { text: st.label, options: { bold: true, fontSize: 13, breakLine: false } },
      { text: "  " + st.sub, options: { fontSize: 9, italic: true } },
    ], { x, y: 0.9, w: 2.25, h: 0.5, color: C.white, align: "center", valign: "middle", margin: 0 });

    // Arrow (not for last)
    if (i < 3) {
      s.addShape(pres.ShapeType.rect, { x: x + 2.25, y: 1.1, w: 0.17, h: 0.1, fill: { color: C.gray } });
    }

    s.addShape(pres.ShapeType.rect, { x, y: 1.42, w: 2.25, h: 2.3, fill: { color: "FFFFFF" }, line: { color: st.bg, width: 1.5 } });
    s.addText(st.text, { x: x + 0.07, y: 1.5, w: 2.11, h: 2.15, fontSize: 9.5, color: C.navy, valign: "top", wrap: true });
  });

  // Long-term section
  s.addShape(pres.ShapeType.rect, { x: 0.2, y: 3.84, w: 9.6, h: 1.55, fill: { color: "D1F2EB" }, line: { color: C.green, width: 1 } });
  s.addText("LONG-TERM CONTROLLER THERAPY (Post-Acute Phase)", {
    x: 0.3, y: 3.88, w: 9.4, h: 0.35, fontSize: 12, bold: true, color: C.green,
  });
  s.addText([
    { text: "• ICS (Inhaled Corticosteroid): Budesonide 400–800 mcg/day or Fluticasone 250–500 mcg/day (preferred over systemic steroids — less glucose impact)\n", options: { fontSize: 10, color: C.navy, breakLine: true } },
    { text: "• LABA + ICS combination (Salmeterol/Fluticasone or Formoterol/Budesonide) if step 3–4\n", options: { fontSize: 10, color: C.navy, breakLine: true } },
    { text: "• LAMA (Tiotropium) — add-on in uncontrolled asthma in elderly\n", options: { fontSize: 10, color: C.navy, breakLine: true } },
    { text: "• Trigger avoidance (allergens, smoke, NSAID, cold air, exercise without warm-up)", options: { fontSize: 10, color: C.navy } },
  ], { x: 0.3, y: 4.25, w: 9.4, h: 1.1, valign: "top" });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 7 — MONITORING & WHEN TO REFER
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.light } });
  addHeader(s, "MONITORING PARAMETERS & REFERRAL CRITERIA");
  addAccentStripe(s);

  // Monitoring targets
  s.addShape(pres.ShapeType.rect, { x: 0.2, y: 0.9, w: 4.6, h: 0.4, fill: { color: C.teal } });
  s.addText("Monitoring Targets", { x: 0.2, y: 0.9, w: 4.6, h: 0.4, fontSize: 12, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });
  s.addShape(pres.ShapeType.rect, { x: 0.2, y: 1.32, w: 4.6, h: 2.6, fill: { color: "FFFFFF" }, line: { color: C.teal, width: 1 } });
  s.addText([
    { text: "Respiratory Parameters\n", options: { bold: true, color: C.teal, fontSize: 11, breakLine: true } },
    { text: "• SpO₂: target 93–95%\n", options: { fontSize: 10, color: C.navy, breakLine: true } },
    { text: "• PEF: reassess after each treatment\n", options: { fontSize: 10, color: C.navy, breakLine: true } },
    { text: "• RR, accessory muscle use, wheeze\n", options: { fontSize: 10, color: C.navy, breakLine: true } },
    { text: "• Response after 1 hour: PEF >70% = good\n\n", options: { fontSize: 10, color: C.navy, breakLine: true } },
    { text: "Metabolic Parameters\n", options: { bold: true, color: C.teal, fontSize: 11, breakLine: true } },
    { text: "• Blood glucose: q4–6h; target 7–10 mmol/L\n", options: { fontSize: 10, color: C.navy, breakLine: true } },
    { text: "• Serum potassium (SABA + steroids → hypokalemia)\n", options: { fontSize: 10, color: C.navy, breakLine: true } },
    { text: "• Renal function (if IV MgSO₄ or aminophylline used)\n", options: { fontSize: 10, color: C.navy, breakLine: true } },
    { text: "• ECG if HR >120 or arrhythmia suspected", options: { fontSize: 10, color: C.navy } },
  ], { x: 0.3, y: 1.38, w: 4.4, h: 2.5, valign: "top" });

  // Referral criteria
  s.addShape(pres.ShapeType.rect, { x: 5.0, y: 0.9, w: 4.8, h: 0.4, fill: { color: C.red } });
  s.addText("🚨  Refer to Emergency / Admit", { x: 5.0, y: 0.9, w: 4.8, h: 0.4, fontSize: 12, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });
  s.addShape(pres.ShapeType.rect, { x: 5.0, y: 1.32, w: 4.8, h: 2.6, fill: { color: "FFFFFF" }, line: { color: C.red, width: 1 } });
  s.addText([
    { text: "Immediate Referral if:\n", options: { bold: true, color: C.red, fontSize: 11, breakLine: true } },
    { text: "• SpO₂ <90% despite oxygen therapy\n", options: { fontSize: 10, color: C.navy, breakLine: true } },
    { text: "• PEF <40% after initial treatment\n", options: { fontSize: 10, color: C.navy, breakLine: true } },
    { text: "• Unable to speak full sentences (severe)\n", options: { fontSize: 10, color: C.navy, breakLine: true } },
    { text: "• Altered consciousness / silent chest / cyanosis\n", options: { fontSize: 10, color: C.navy, breakLine: true } },
    { text: "• HR >120 bpm or bradycardia\n", options: { fontSize: 10, color: C.navy, breakLine: true } },
    { text: "• No improvement after 3 SABA treatments\n", options: { fontSize: 10, color: C.navy, breakLine: true } },
    { text: "• Previous ICU admission / intubation for asthma\n", options: { fontSize: 10, color: C.navy, breakLine: true } },
    { text: "• Blood glucose >20 mmol/L unresponsive\n", options: { fontSize: 10, color: C.navy, breakLine: true } },
    { text: "• Signs of DKA or hyperosmolar state", options: { fontSize: 10, color: C.navy } },
  ], { x: 5.1, y: 1.38, w: 4.6, h: 2.5, valign: "top" });

  // Discharge criteria
  s.addShape(pres.ShapeType.rect, { x: 0.2, y: 4.02, w: 9.6, h: 1.35, fill: { color: "D5F5E3" }, line: { color: C.green, width: 1 } });
  s.addText("✅  Discharge Criteria (OPD — safe to go home):", {
    x: 0.3, y: 4.06, w: 9.4, h: 0.35, fontSize: 11, bold: true, color: C.green,
  });
  s.addText([
    { text: "• SpO₂ ≥93% on room air  •  PEF >70% predicted  •  Minimal or no symptoms at rest\n", options: { fontSize: 10, color: C.navy, breakLine: true } },
    { text: "• Blood glucose controlled (7–10 mmol/L)  •  Able to use inhaler correctly  •  Reliable home environment  •  Follow-up within 48h arranged", options: { fontSize: 10, color: C.navy } },
  ], { x: 0.3, y: 4.42, w: 9.4, h: 0.9, valign: "top" });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 8 — DISCHARGE PRESCRIPTION & PATIENT EDUCATION
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.light } });
  addHeader(s, "DISCHARGE PRESCRIPTION & PATIENT EDUCATION");
  addAccentStripe(s);

  s.addShape(pres.ShapeType.rect, { x: 0.2, y: 0.88, w: 4.6, h: 0.38, fill: { color: C.navy } });
  s.addText("Discharge Medications", { x: 0.2, y: 0.88, w: 4.6, h: 0.38, fontSize: 11, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });

  s.addShape(pres.ShapeType.rect, { x: 0.2, y: 1.28, w: 4.6, h: 2.6, fill: { color: "FFFFFF" }, line: { color: C.navy, width: 1 } });
  s.addText([
    { text: "Reliever:\n", options: { bold: true, color: C.teal, fontSize: 11, breakLine: true } },
    { text: "• Salbutamol MDI 100 mcg — 2 puffs PRN q4–6h\n\n", options: { fontSize: 10, color: C.navy, breakLine: true } },
    { text: "Controller:\n", options: { bold: true, color: C.teal, fontSize: 11, breakLine: true } },
    { text: "• ICS (Budesonide 400 mcg BD or Fluticasone 250 mcg BD)\n", options: { fontSize: 10, color: C.navy, breakLine: true } },
    { text: "• ICS/LABA combo if Step 3–4 (Seretide/Symbicort)\n\n", options: { fontSize: 10, color: C.navy, breakLine: true } },
    { text: "Taper Steroid:\n", options: { bold: true, color: C.teal, fontSize: 11, breakLine: true } },
    { text: "• Prednisolone 40 mg/day × 5–7 days (no taper needed <10 days)\n\n", options: { fontSize: 10, color: C.navy, breakLine: true } },
    { text: "Diabetes:\n", options: { bold: true, color: C.teal, fontSize: 11, breakLine: true } },
    { text: "• Resume/adjust antidiabetics; insulin sliding scale if needed\n", options: { fontSize: 10, color: C.navy, breakLine: true } },
    { text: "• Follow-up blood glucose in 48h", options: { fontSize: 10, color: C.navy } },
  ], { x: 0.3, y: 1.35, w: 4.4, h: 2.5, valign: "top" });

  s.addShape(pres.ShapeType.rect, { x: 5.0, y: 0.88, w: 4.8, h: 0.38, fill: { color: C.teal } });
  s.addText("Patient Education", { x: 5.0, y: 0.88, w: 4.8, h: 0.38, fontSize: 11, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });

  s.addShape(pres.ShapeType.rect, { x: 5.0, y: 1.28, w: 4.8, h: 2.6, fill: { color: "FFFFFF" }, line: { color: C.teal, width: 1 } });
  s.addText([
    { text: "Inhaler Technique:\n", options: { bold: true, color: C.teal, fontSize: 11, breakLine: true } },
    { text: "• Demonstrate correct MDI/spacer use before discharge\n", options: { fontSize: 10, color: C.navy, breakLine: true } },
    { text: "• Use spacer device (especially in elderly)\n\n", options: { fontSize: 10, color: C.navy, breakLine: true } },
    { text: "Asthma Action Plan:\n", options: { bold: true, color: C.teal, fontSize: 11, breakLine: true } },
    { text: "• Green zone (PEF >80%): continue controller\n", options: { fontSize: 10, color: C.green, breakLine: true } },
    { text: "• Yellow zone (PEF 50–80%): add SABA, seek review\n", options: { fontSize: 10, color: "B7950B", breakLine: true } },
    { text: "• Red zone (PEF <50%): take SABA, go to ER\n\n", options: { fontSize: 10, color: C.red, breakLine: true } },
    { text: "Diabetes-specific:\n", options: { bold: true, color: C.teal, fontSize: 11, breakLine: true } },
    { text: "• Warn about steroid-induced hyperglycemia\n", options: { fontSize: 10, color: C.navy, breakLine: true } },
    { text: "• Self-monitor glucose 2–3× daily while on steroids", options: { fontSize: 10, color: C.navy } },
  ], { x: 5.1, y: 1.35, w: 4.6, h: 2.5, valign: "top" });

  // Triggers box
  s.addShape(pres.ShapeType.rect, { x: 0.2, y: 3.97, w: 9.6, h: 1.38, fill: { color: "FEF9E7" }, line: { color: C.accent, width: 1 } });
  s.addText("Common Asthma Triggers to Avoid", {
    x: 0.3, y: 4.0, w: 9.4, h: 0.35, fontSize: 11, bold: true, color: "7D6608",
  });
  s.addText("• Allergens (dust mites, pollen, animal dander)   • Tobacco smoke / pollution   • Cold air / exercise without warm-up\n• Respiratory infections (get influenza + pneumococcal vaccines)   • NSAIDs / Aspirin   • Strong emotions / stress",
    { x: 0.3, y: 4.38, w: 9.4, h: 0.9, fontSize: 10, color: C.navy, valign: "top" });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 9 — SUMMARY
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.darkbg } });
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.25, h: 5.625, fill: { color: C.accent } });

  s.addText("CLINICAL SUMMARY", {
    x: 0.5, y: 0.25, w: 9, h: 0.65, fontSize: 26, bold: true, color: C.accent, align: "center",
  });
  s.addText("Asthma Exacerbation + Type 2 Diabetes — Key Take-Aways", {
    x: 0.5, y: 0.9, w: 9, h: 0.4, fontSize: 14, color: C.white, align: "center", italic: true,
  });
  s.addShape(pres.ShapeType.rect, { x: 0.5, y: 1.35, w: 9, h: 0.04, fill: { color: C.teal } });

  const points = [
    ["1", "Assess severity immediately", "SpO₂, PEF, FEV₁, speech, accessory muscles — objective measures are critical in elderly"],
    ["2", "First-line: SABA + O₂", "Salbutamol nebulization q20 min × 3; add ipratropium for moderate–severe cases"],
    ["3", "Systemic corticosteroids are essential", "Oral prednisolone 40–60 mg/day; unavoidable but monitor glucose aggressively"],
    ["4", "Blood glucose is a co-management priority", "Steroids cause hyperglycemia; monitor q4–6h; adjust/initiate insulin as needed"],
    ["5", "Avoid β-blockers & NSAIDs", "Contraindicated — cause bronchospasm or NSAID-exacerbated respiratory disease"],
    ["6", "Discharge with a clear plan", "ICS controller, asthma action plan, inhaler technique check, DM medication review, 48h follow-up"],
  ];

  points.forEach((p, i) => {
    const y = 1.5 + i * 0.66;
    s.addShape(pres.ShapeType.rect, { x: 0.45, y: y, w: 0.42, h: 0.42, fill: { color: C.teal } });
    s.addText(p[0], { x: 0.45, y: y, w: 0.42, h: 0.42, fontSize: 14, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });
    s.addText([
      { text: p[1] + "  ", options: { bold: true, color: C.accent, fontSize: 11 } },
      { text: p[2], options: { color: "D0DDE8", fontSize: 10 } },
    ], { x: 0.96, y: y + 0.03, w: 8.7, h: 0.4, valign: "middle" });
  });

  s.addText("Reference: Textbook of Family Medicine 9e — Management of Asthma Exacerbation, p.465", {
    x: 0, y: 5.35, w: 10, h: 0.27, fontSize: 9, color: "4A6080", align: "center", italic: true,
  });
}

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

cd /home/daytona/workspace/asthma-diabetes-ppt && node build.js 2>&1

Running Command

ls -lh /home/daytona/workspace/asthma-diabetes-ppt/

Your presentation is ready:

Asthma Exacerbation T2DM Management

Presentation · PPTX


What's Inside (9 Slides)

SlideContent
1Title Slide — Patient Profile (65yr, T2DM, acute asthma)
2Initial Assessment — Severity classification table (Mild/Moderate/Severe) with SpO₂, PEF, FEV₁ cutoffs
3Immediate Management — SABA (Salbutamol), Ipratropium, O₂, Corticosteroids, IV MgSO₄; with Diabetes Alert on steroids
4Diabetes Management — Steroid-induced hyperglycemia mechanism, glucose monitoring protocol, drug adjustment table (Metformin, SU, GLP-1, Insulin)
5Drugs to AVOID (β-blockers, NSAIDs, high-dose theophylline) and Use with CAUTION (dark theme, clearly flagged)
6Stepwise Algorithm — 4-step OPD protocol (0–20 min → 20–60 min → 1–2h → Decision), plus long-term controller therapy
7Monitoring Parameters + Referral Criteria (SpO₂ <90%, PEF <40%, silent chest, etc.) + Discharge criteria
8Discharge Prescription + Patient Education (inhaler technique, Asthma Action Plan zones, diabetes self-monitoring)
9Clinical Summary — 6 key take-aways

Key Management Points for This Patient

  1. SABA first — Salbutamol 2.5–5 mg nebulized q20 min × 3 doses + Ipratropium 0.5 mg
  2. Steroids are mandatory — Prednisolone 40–60 mg PO (unavoidable even in diabetics)
  3. Glucose monitoring is critical — Steroids cause hyperglycemia peaking 4–8h post-dose; check CBG q4–6h; target 7–10 mmol/L
  4. Adjust antidiabetics — May need to initiate/intensify insulin while on systemic steroids
  5. Never use β-blockers — Even cardioselective ones risk bronchospasm in asthma
  6. Discharge with ICS controller + written action plan + 48h follow-up
Source: Textbook of Family Medicine 9e, Management of Asthma Exacerbation, p.465

Make appr

It looks like your message got cut off. Could you complete your request?
Did you mean:
  • Make it more appealing (better design/visuals)?
  • Make an appropriate prescription for the patient?
  • Make an appropriate referral letter?
  • Something else?

Ppt more appealing

Reading File
Running Command

ls -la /home/daytona/workspace/ && ls -la /home/daytona/workspace/asthma-diabetes-ppt/ && cp /home/daytona/workspace/asthma-diabetes-ppt/build.js /home/daytona/workspace/asthma-diabetes-ppt/build_v1_backup.js && sed -n '1,120p' /home/daytona/workspace/asthma-diabetes-ppt/build.js

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.