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

Reading File
Finding Sources
Finding Sources
Reading File
Finding Sources
Reading File
Finding Sources
I now have comprehensive content from the textbook. Let me compile a thorough answer.

Management of a 65-Year-Old with Asthma Exacerbation + Type 2 Diabetes


Step 1 — Immediate Assessment

Assess severity of the exacerbation using clinical signs and peak-flow/spirometry:
FeatureMild–ModerateSevereLife-threatening
SpeechFull sentencesPhrases onlySingle words / mute
RR<25/min≥25/min>30/min
HR<110/min≥110/minBradycardia
SpO₂≥92%<92%<90%
PEFR>50% predicted33–50%<33% ("near-fatal")
Also assess:
  • Blood glucose immediately (comorbid T2DM + steroid use = hyperglycemia risk)
  • ABG if SpO₂ <92% or patient fatiguing
  • ECG (65-year-old, rule out cardiac cause of dyspnea)

Step 2 — Acute Pharmacological Treatment

A. Bronchodilators (First-line)

  1. Inhaled Short-Acting β₂-Agonist (SABA) — Salbutamol (Albuterol)
    • 2.5 mg via nebulizer every 20 minutes × 3 doses in the first hour (continuous if severe)
    • Or 4–8 puffs via MDI + spacer
    • This is the cornerstone of acute treatment
  2. Ipratropium bromide (short-acting anticholinergic)
    • Add 0.5 mg nebulized with salbutamol in moderate–severe exacerbations
    • Combination gives better bronchodilation than SABA alone

B. Systemic Corticosteroids ⚠️ (Critical consideration in T2DM)

  • Prednisolone 40–50 mg oral (or IV hydrocortisone 200 mg if unable to swallow)
  • Duration: 5–7 days (no need to taper for short courses)
  • Steroids are NOT withheld in diabetics — the exacerbation risk outweighs glycemic concern
  • However: Corticosteroids cause significant steroid-induced hyperglycemia, which can appear within hours and persist for days
  • ➡️ Monitor blood glucose 4-hourly while on steroids
  • ➡️ Adjust antidiabetic therapy accordingly (see below)

C. Oxygen

  • Target SpO₂ 94–98% (not 100% — hyperoxia not beneficial)
  • Use controlled low-flow O₂ via nasal cannula or mask

D. Magnesium Sulfate (for severe/refractory cases)

  • IV Magnesium Sulfate 2 g over 20 minutes for life-threatening or steroid-unresponsive exacerbations
  • Acts as bronchodilator via smooth muscle relaxation

Step 3 — Diabetes Management During the Exacerbation

This is the most critical comorbidity interaction:
IssueAction
Steroid-induced hyperglycemiaMonitor BG every 4–6 hrs; target <180 mg/dL in-hospital
MetforminHold metformin if patient is hypoxic or unwell (lactic acidosis risk)
InsulinShort-acting insulin sliding scale or correction doses may be needed
Stress hyperglycemiaOccurs even without steroids — monitor regardless
SGLT2 inhibitorsHold if patient is unwell/dehydrated (DKA risk)
SulfonylureasUse cautiously — hypoglycemia risk
The preferred approach in hospital:
  • Basal-bolus insulin if on nothing by mouth or significantly hyperglycemic (BG >250 mg/dL consistently)
  • Resume home antidiabetics once eating normally and steroids weaned

Step 4 — Drugs to AVOID in This Patient

DrugReason to Avoid
Non-selective β-blockers (propranolol, atenolol)Precipitate or worsen bronchospasm — absolutely contraindicated in asthma
NSAIDs / Aspirin~10% of asthmatics are aspirin-sensitive — avoid unless confirmed tolerant
Nebulized atropineMay thicken secretions
High-dose oxygenOver-oxygenation not beneficial; target 94–98%

Step 5 — Monitoring & Response Assessment

  • Reassess after initial 1-hour treatment
  • Check PEFR at 1 hour — improvement >50% predicted suggests good response
  • Repeat SpO₂, HR, RR every 30–60 minutes
  • Blood glucose monitoring every 4–6 hours
Criteria for hospital admission:
  • PEFR <50% after 1 hour of treatment
  • Persistent hypoxia (SpO₂ <92% on air)
  • Failure to respond to initial treatment
  • Prior ICU admission / near-fatal asthma history

Step 6 — Long-Term Management After Stabilization

For the asthma:
  • Step up controller therapy if on inadequate regimen
  • Inhaled Corticosteroid (ICS) + Long-Acting β₂-Agonist (LABA) — preferred for moderate–severe persistent asthma in this age group
  • Review inhaler technique
  • Provide written Asthma Action Plan
For the diabetes (post-discharge):
  • Resume appropriate oral agents or insulin
  • Review HbA1c — steroid use may have worsened glycemic control
  • Consider referral to endocrinology if control is poor
Vaccinations (elderly asthmatic + diabetic):
  • Annual influenza vaccine
  • Pneumococcal vaccine (PCV13 + PPSV23)
  • COVID-19 booster — both comorbidities are high-risk

Summary Algorithm

Exacerbation → Assess severity → O₂ to SpO₂ 94-98%
                               → SABA nebulizer (salbutamol)
                               → Add ipratropium if moderate/severe
                               → Oral prednisolone 40-50mg
                               → CHECK BLOOD GLUCOSE immediately
                               → Hold metformin if hypoxic
                               → Monitor BG every 4-6 hrs
                               → If no improvement → IV Magnesium
                               → If still no response → ICU/intubation

Sourced from: Family Medicine (Textbook of Family Medicine), 9780323239905 — Management of Asthma Exacerbation; and Goodman & Gilman's Pharmacological Basis of Therapeutics — Asthma/COPD therapeutics

Every drug with dose

Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Excellent — now I have precise doses from authoritative sources. Here is the complete drug-by-drug breakdown:

Complete Drug List with Doses — Asthma Exacerbation in a Diabetic Patient


🔵 ACUTE / EMERGENCY DRUGS


1. Salbutamol (Albuterol) — SABA ⭐ First-line

RouteMild–ModerateSevere
MDI + spacer2–6 puffs (180–540 µg) every 20 min × 3Same, repeat aggressively
Nebulizer2.5 mg every 20 min × 3 doses in 1st hour2.5–5 mg every 20 min via nebulizer
Continuous nebulization10–15 mg over 1 hour (with cardiac monitoring)
Maintenance180 µg (2 puffs) every 4–6 h as needed
⚠️ Adverse effects: tachycardia, palpitations, tremors, hypokalemia — monitor electrolytes especially in diabetics

2. Ipratropium Bromide — Short-Acting Anticholinergic

RouteDoseFrequency
Nebulizer0.5 mgEvery 20 min × 3 doses (first hour), then every 2–4 h
MDI2 puffs (36 µg)3–4 times daily
Add to salbutamol in moderate–severe exacerbation for superior bronchodilation. Stop once patient improves.

3. Prednisone / Prednisolone — Systemic Corticosteroid ⚠️ Hyperglycemia Risk

IndicationDoseDuration
Acute exacerbation (oral)40–60 mg once daily5–14 days
ED discharge40 mg/day5–7 days (no taper needed for short course)
Cannot swallow / severeIV Hydrocortisone 100–500 mg every 6–12 hUntil oral tolerated
Alternative (dexamethasone)12 mg once or twice (equivalent efficacy, shorter course)1–2 doses
⚠️ In T2DM: Steroids will raise blood glucose significantly within hours. Monitor BG every 4–6 hours. Do NOT withhold steroids — the exacerbation takes priority.

4. IV Magnesium Sulfate — Refractory/Severe cases

RouteDoseRate
IV infusion2 g (2000 mg)Over 20 minutes
Use when exacerbation is life-threatening or no response to SABA + steroids after 1 hour. Acts as smooth muscle relaxant (bronchodilator). One dose only in ED.

5. Oxygen

Target SpO₂Delivery
94–98%Nasal cannula 2–4 L/min or Venturi mask
Do NOT aim for 100% — controlled oxygenation is preferred.

🟡 MAINTENANCE DRUGS (Long-term Controller Therapy)


6. Inhaled Corticosteroid (ICS) — Backbone of Long-term Control

DrugDose
Budesonide0.25–0.5 mg via nebulizer once daily or in 2 divided doses
Fluticasone propionate50–250 µg, 2 puffs twice daily (max 1000 µg/day)
Beclomethasone44–88 µg (1–2 puffs) twice daily (max 400 µg twice daily)
Ciclesonide80 µg twice daily
Start or increase ICS dose at discharge — reduces risk of future exacerbations.

7. ICS + LABA Combination (Moderate–Severe Persistent Asthma)

DrugDose
Budesonide/Formoterol (Symbicort)80 µg budesonide + 4.5 µg formoterol, 2 puffs twice daily
Fluticasone/Salmeterol (Seretide/Advair)Starting dose based on severity, DPI twice daily
Fluticasone furoate/Vilanterol (Breo Ellipta)100 µg/25 µg, 1 inhalation once daily
Preferred long-term regimen in a 65-year-old with moderate–severe asthma.

🟠 DIABETES MANAGEMENT DURING STEROID USE


8. Short-Acting Insulin (Sliding Scale / Correction)

IndicationDose
BG 180–250 mg/dL4–6 units regular insulin SC
BG 251–350 mg/dL6–8 units regular insulin SC
BG >350 mg/dL8–10 units + reassess, consider basal-bolus
If patient is on oral antidiabetics only at home and develops steroid-induced hyperglycemia, short-acting insulin correction doses are first-line in hospital.

9. Metformin — HOLD during acute exacerbation

Hold metformin if patient is hypoxic (SpO₂ <94%) or unwell — risk of lactic acidosis. Resume once patient is stable, eating normally, and SpO₂ is maintained.

🔴 DRUGS TO AVOID

DrugReason
Non-selective β-blockers (propranolol, carvedilol, atenolol)Cause bronchospasm — absolute contraindication in asthma
NSAIDs / AspirinMay trigger aspirin-exacerbated respiratory disease (~10% of asthmatics)
SGLT2 inhibitors (empagliflozin, dapagliflozin)Hold if unwell/dehydrated — risk of euglycemic DKA
Sulfonylureas (glibenclamide, glipizide)Hypoglycemia risk, especially if patient not eating
TheophyllineNarrow therapeutic window, high toxicity — last resort only

Quick Reference Summary Table

DrugDoseRouteFrequency
Salbutamol2.5–5 mg (acute) / 180 µg (maintenance)Nebulizer / MDIEvery 20 min × 3, then PRN
Ipratropium0.5 mgNebulizerEvery 20 min × 3
Prednisolone40–60 mgOralOnce daily × 5–14 days
Hydrocortisone100–500 mgIVEvery 6–12 h
Dexamethasone12 mgOral/IV1–2 doses
Magnesium Sulfate2 gIV infusionSingle dose over 20 min
Budesonide/Formoterol80/4.5 µgDPI2 puffs twice daily
OxygenMask/CannulaTitrate to SpO₂ 94–98%

Sources: Goodman & Gilman's Pharmacological Basis of Therapeutics (9781264258079); Washington Manual of Medical Therapeutics (9781975190620); Tintinalli's Emergency Medicine (9781260019933)

Genrate a ppt fir me

Reading File
Reading File
Reading File
Running Command

ls -la /home/daytona/workspace/

Running Command

mkdir -p /home/daytona/workspace/asthma-ppt && ls /home/daytona/workspace/

Writing File

~/asthma-ppt/generate.js

const pptxgen = require("pptxgenjs");

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

// ─── COLOR PALETTE ───────────────────────────────────────────────────────────
const C = {
  navy:    "0D2B55",   // dominant background
  teal:    "1A7A8A",   // accent headers
  amber:   "F4A224",   // warning/highlight
  red:     "D94040",   // danger/avoid
  white:   "FFFFFF",
  offWhite:"F0F4F8",
  light:   "B8D4E0",
  green:   "2E8B57",
  cardBg:  "132E4F",   // slightly lighter navy for cards
};

// ─── HELPER: slide header bar ─────────────────────────────────────────────────
function addHeader(slide, title) {
  slide.addShape("rect", { x: 0, y: 0, w: 10, h: 0.72, fill: { color: C.teal } });
  slide.addText(title, {
    x: 0.35, y: 0, w: 9.3, h: 0.72,
    fontSize: 20, bold: true, color: C.white,
    valign: "middle", margin: 0
  });
}

// ─── HELPER: footer ───────────────────────────────────────────────────────────
function addFooter(slide, note) {
  slide.addShape("rect", { x: 0, y: 5.32, w: 10, h: 0.3, fill: { color: C.navy } });
  slide.addText(note || "Clinical Management Guide — Asthma + T2DM", {
    x: 0.3, y: 5.32, w: 9.4, h: 0.3,
    fontSize: 9, color: C.light, italic: true, valign: "middle", margin: 0
  });
}

// ─── HELPER: section card ─────────────────────────────────────────────────────
function addCard(slide, x, y, w, h, title, titleColor, bgColor) {
  slide.addShape("rect", {
    x, y, w, h,
    fill: { color: bgColor || C.cardBg },
    shadow: { type: "outer", color: "000000", blur: 8, offset: 2, angle: 135, opacity: 0.2 }
  });
  if (title) {
    slide.addShape("rect", { x, y, w, h: 0.35, fill: { color: titleColor || C.teal } });
    slide.addText(title, {
      x: x + 0.1, y, w: w - 0.1, h: 0.35,
      fontSize: 11, bold: true, color: C.white, valign: "middle", margin: 0
    });
  }
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 1 — TITLE
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.navy };

  // top accent bar
  s.addShape("rect", { x: 0, y: 0, w: 10, h: 0.08, fill: { color: C.teal } });
  // bottom accent bar
  s.addShape("rect", { x: 0, y: 5.54, w: 10, h: 0.08, fill: { color: C.amber } });

  // decorative vertical stripe
  s.addShape("rect", { x: 0, y: 0.08, w: 0.12, h: 5.46, fill: { color: C.teal } });

  s.addText("ASTHMA EXACERBATION", {
    x: 0.5, y: 0.9, w: 9, h: 0.9,
    fontSize: 38, bold: true, color: C.white, align: "center", charSpacing: 4
  });
  s.addText("Management in a Patient with Type 2 Diabetes", {
    x: 0.5, y: 1.85, w: 9, h: 0.6,
    fontSize: 20, color: C.light, align: "center", italic: true
  });

  // divider
  s.addShape("rect", { x: 3, y: 2.6, w: 4, h: 0.05, fill: { color: C.amber } });

  s.addText("65-Year-Old Patient • OPD Presentation", {
    x: 0.5, y: 2.75, w: 9, h: 0.5,
    fontSize: 16, color: C.amber, align: "center", bold: true
  });

  s.addText([
    { text: "Topics Covered: ", options: { bold: true, color: C.amber } },
    { text: "Assessment  •  Bronchodilators  •  Corticosteroids  •  Diabetes Management  •  Drugs to Avoid  •  Discharge Plan", options: { color: C.light } }
  ], {
    x: 0.5, y: 3.4, w: 9, h: 0.7,
    fontSize: 12, align: "center"
  });

  s.addText("Sources: Goodman & Gilman's | Washington Manual | Tintinalli's Emergency Medicine", {
    x: 0.5, y: 4.9, w: 9, h: 0.35,
    fontSize: 9, color: "4A7A9B", italic: true, align: "center"
  });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 2 — INITIAL ASSESSMENT
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.navy };
  addHeader(s, "Step 1 — Initial Assessment");
  addFooter(s);

  // severity table header
  const cols = ["Feature", "Mild–Moderate", "Severe", "Life-Threatening"];
  const colW = [2.2, 2.2, 2.2, 3.2];
  const rows = [
    ["Speech",        "Full sentences",   "Phrases only",    "Single words / mute"],
    ["RR",            "< 25/min",         "≥ 25/min",        "> 30/min"],
    ["HR",            "< 110/min",        "≥ 110/min",       "Bradycardia"],
    ["SpO₂",          "≥ 92%",            "< 92%",           "< 90%"],
    ["PEFR",          "> 50% predicted",  "33–50%",          "< 33% (near-fatal)"],
  ];

  const tableX = 0.25;
  let rowY = 0.85;
  const rowH = 0.48;

  // header row
  let cx = tableX;
  cols.forEach((col, i) => {
    s.addShape("rect", { x: cx, y: rowY, w: colW[i], h: rowH, fill: { color: C.teal } });
    s.addText(col, { x: cx + 0.05, y: rowY, w: colW[i] - 0.05, h: rowH, fontSize: 11, bold: true, color: C.white, valign: "middle", margin: 0 });
    cx += colW[i];
  });

  rows.forEach((row, ri) => {
    rowY += rowH;
    let cx2 = tableX;
    row.forEach((cell, ci) => {
      const bg = ri % 2 === 0 ? C.cardBg : "0F2645";
      const textColor = ci === 3 ? C.amber : (ci === 2 ? C.light : C.white);
      s.addShape("rect", { x: cx2, y: rowY, w: colW[ci], h: rowH, fill: { color: bg } });
      s.addText(cell, { x: cx2 + 0.08, y: rowY, w: colW[ci] - 0.08, h: rowH, fontSize: 10, color: textColor, valign: "middle", margin: 0 });
      cx2 += colW[ci];
    });
  });

  // checklist bottom
  s.addText("Also check immediately:", { x: 0.3, y: 4.0, w: 5, h: 0.3, fontSize: 11, bold: true, color: C.amber });
  const checks = [
    "Blood Glucose (steroid-induced hyperglycemia risk)",
    "ABG if SpO₂ < 92% or patient fatiguing",
    "ECG — rule out cardiac cause of dyspnea",
    "Peak Flow / FEV₁ to grade exacerbation severity"
  ];
  s.addText(checks.map((c, i) => ({ text: c, options: { bullet: { code: "2714", color: C.teal }, breakLine: i < checks.length - 1, color: C.white, fontSize: 10 } })),
    { x: 0.3, y: 4.32, w: 9.4, h: 0.85 });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 3 — BRONCHODILATORS
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.navy };
  addHeader(s, "Step 2 — Bronchodilators (First-Line)");
  addFooter(s);

  // Drug 1 — Salbutamol
  addCard(s, 0.25, 0.85, 4.6, 2.1, "SALBUTAMOL (Albuterol) — SABA ⭐", C.teal);
  s.addText([
    { text: "MDI + Spacer: ", options: { bold: true, color: C.amber } },
    { text: "2–6 puffs (180–540 µg) every 20 min × 3", options: { color: C.white } },
    { text: "\nNebulizer (Mild–Mod): ", options: { bold: true, color: C.amber } },
    { text: "2.5 mg every 20 min × 3 doses", options: { color: C.white } },
    { text: "\nNebulizer (Severe): ", options: { bold: true, color: C.amber } },
    { text: "2.5–5 mg every 20 min", options: { color: C.white } },
    { text: "\nContinuous (Life-threatening): ", options: { bold: true, color: C.red } },
    { text: "10–15 mg over 1 hr (ECG monitoring)", options: { color: C.white } },
    { text: "\nMaintenance: ", options: { bold: true, color: C.light } },
    { text: "180 µg (2 puffs) every 4–6 h PRN", options: { color: C.light } },
  ], { x: 0.35, y: 1.25, w: 4.4, h: 1.65, fontSize: 9.5, valign: "top" });

  // Drug 2 — Ipratropium
  addCard(s, 5.1, 0.85, 4.6, 2.1, "IPRATROPIUM BROMIDE — SAMA", C.teal);
  s.addText([
    { text: "Nebulizer: ", options: { bold: true, color: C.amber } },
    { text: "0.5 mg every 20 min × 3 (first hour)\nthen every 2–4 h", options: { color: C.white } },
    { text: "\nMDI: ", options: { bold: true, color: C.amber } },
    { text: "2 puffs (36 µg) 3–4 times daily", options: { color: C.white } },
    { text: "\n\nIndication: ", options: { bold: true, color: C.light } },
    { text: "Add to salbutamol in moderate–severe exacerbation for superior bronchodilation", options: { color: C.light } },
  ], { x: 5.2, y: 1.25, w: 4.4, h: 1.65, fontSize: 9.5, valign: "top" });

  // IV Magnesium
  addCard(s, 0.25, 3.1, 4.6, 1.85, "IV MAGNESIUM SULFATE — Refractory/Severe", C.red);
  s.addText([
    { text: "Dose: ", options: { bold: true, color: C.amber } },
    { text: "2 g (2000 mg) IV", options: { color: C.white } },
    { text: "\nRate: ", options: { bold: true, color: C.amber } },
    { text: "Infuse over 20 minutes", options: { color: C.white } },
    { text: "\nIndication: ", options: { bold: true, color: C.light } },
    { text: "Life-threatening or no response to SABA + steroids after 1 hour. Single dose only.", options: { color: C.light } },
  ], { x: 0.35, y: 3.5, w: 4.4, h: 1.4, fontSize: 9.5, valign: "top" });

  // Oxygen
  addCard(s, 5.1, 3.1, 4.6, 1.85, "OXYGEN THERAPY", C.green);
  s.addText([
    { text: "Target SpO₂: ", options: { bold: true, color: C.amber } },
    { text: "94–98%", options: { bold: true, color: C.white } },
    { text: "\nDelivery: ", options: { bold: true, color: C.amber } },
    { text: "Nasal cannula 2–4 L/min or Venturi mask", options: { color: C.white } },
    { text: "\n\n⚠️ ", options: { bold: true, color: C.red } },
    { text: "Do NOT aim for 100% — controlled, titrated oxygenation is preferred", options: { color: C.light, italic: true } },
  ], { x: 5.2, y: 3.5, w: 4.4, h: 1.4, fontSize: 9.5, valign: "top" });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 4 — CORTICOSTEROIDS
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.navy };
  addHeader(s, "Step 3 — Systemic Corticosteroids ⚠️ (Hyperglycemia Risk in T2DM)");
  addFooter(s);

  // Table
  const headers = ["Drug", "Dose", "Route", "Duration"];
  const hW = [2.2, 3.0, 1.6, 3.0];
  const drugRows = [
    ["Prednisolone / Prednisone", "40–60 mg once daily", "Oral", "5–14 days"],
    ["Hydrocortisone succinate", "100–500 mg every 6–12 h", "IV/IM", "Until oral tolerated"],
    ["Dexamethasone", "12 mg once or twice", "Oral / IV", "1–2 doses (equivalent efficacy)"],
  ];

  let ry = 0.85;
  let cx = 0.25;
  headers.forEach((h, i) => {
    s.addShape("rect", { x: cx, y: ry, w: hW[i], h: 0.42, fill: { color: C.teal } });
    s.addText(h, { x: cx + 0.05, y: ry, w: hW[i] - 0.05, h: 0.42, fontSize: 11, bold: true, color: C.white, valign: "middle", margin: 0 });
    cx += hW[i];
  });

  drugRows.forEach((row, ri) => {
    ry += 0.42;
    let cx2 = 0.25;
    const bg = ri % 2 === 0 ? C.cardBg : "0F2645";
    row.forEach((cell, ci) => {
      s.addShape("rect", { x: cx2, y: ry, w: hW[ci], h: 0.5, fill: { color: bg } });
      s.addText(cell, { x: cx2 + 0.08, y: ry, w: hW[ci] - 0.08, h: 0.5, fontSize: 10, color: C.white, valign: "middle", margin: 0 });
      cx2 += hW[ci];
    });
  });

  // Warning box
  s.addShape("rect", { x: 0.25, y: 2.6, w: 9.5, h: 0.5, fill: { color: "4A1010" } });
  s.addText("⚠️  Steroids are NOT withheld in diabetics — the exacerbation risk outweighs glycemic concern. But monitor closely!", {
    x: 0.4, y: 2.6, w: 9.2, h: 0.5, fontSize: 11, bold: true, color: C.amber, valign: "middle", margin: 0
  });

  // Tips
  const tips = [
    "Monitor Blood Glucose every 4–6 hours during steroid therapy",
    "Oral prednisolone is as effective as IV if patient can swallow",
    "No taper needed for short courses (5–7 days)",
    "Dexamethasone is a valid alternative — shorter course, equivalent efficacy",
    "Initiate or increase Inhaled Corticosteroid (ICS) on discharge"
  ];
  s.addText("Key Points:", { x: 0.3, y: 3.2, w: 3, h: 0.35, fontSize: 11, bold: true, color: C.amber });
  s.addText(tips.map((t, i) => ({ text: t, options: { bullet: { code: "25CF", color: C.teal }, breakLine: i < tips.length - 1, fontSize: 10, color: C.white } })),
    { x: 0.3, y: 3.55, w: 9.4, h: 1.55 });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 5 — DIABETES MANAGEMENT
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.navy };
  addHeader(s, "Step 4 — Diabetes Management During Exacerbation");
  addFooter(s);

  // Left column — insulin sliding scale
  addCard(s, 0.25, 0.85, 4.6, 2.55, "INSULIN SLIDING SCALE (Steroid-Induced Hyperglycemia)", C.teal);
  const insulinRows = [
    ["BG 180–250 mg/dL",  "4–6 units regular insulin SC"],
    ["BG 251–350 mg/dL",  "6–8 units regular insulin SC"],
    ["BG > 350 mg/dL",    "8–10 units + reassess; consider basal-bolus"],
  ];
  insulinRows.forEach(([bg, dose], i) => {
    const iy = 1.25 + i * 0.55;
    s.addShape("rect", { x: 0.3, y: iy, w: 4.45, h: 0.48, fill: { color: i % 2 === 0 ? "1A3A6A" : "0F2D55" } });
    s.addText(bg,   { x: 0.38, y: iy, w: 1.95, h: 0.48, fontSize: 9.5, color: C.amber, bold: true, valign: "middle", margin: 0 });
    s.addText(dose, { x: 2.35, y: iy, w: 2.4, h: 0.48, fontSize: 9.5, color: C.white, valign: "middle", margin: 0 });
  });
  s.addText("Target: BG < 180 mg/dL in hospital", { x: 0.35, y: 2.92, w: 4.4, h: 0.35, fontSize: 9.5, color: C.light, italic: true, valign: "middle" });

  // Right column — drug adjustments
  addCard(s, 5.1, 0.85, 4.6, 2.55, "ANTIDIABETIC DRUG ADJUSTMENTS", C.teal);
  const drugAdj = [
    ["Metformin", "HOLD if hypoxic (SpO₂<94%) — lactic acidosis risk"],
    ["SGLT2 inhibitors", "HOLD if unwell/dehydrated — euglycemic DKA risk"],
    ["Sulfonylureas", "Use cautiously — hypoglycemia risk if not eating"],
    ["Insulin", "Preferred in hospital; basal-bolus if BG persistently high"],
  ];
  drugAdj.forEach(([drug, note], i) => {
    const dy = 1.25 + i * 0.52;
    s.addText([
      { text: drug + ": ", options: { bold: true, color: C.amber } },
      { text: note, options: { color: C.white } }
    ], { x: 5.2, y: dy, w: 4.4, h: 0.48, fontSize: 9.5, valign: "middle" });
  });

  // Bottom monitoring box
  s.addShape("rect", { x: 0.25, y: 3.55, w: 9.5, h: 1.55, fill: { color: C.cardBg } });
  s.addText("Monitoring Protocol", { x: 0.4, y: 3.6, w: 4, h: 0.35, fontSize: 11, bold: true, color: C.amber });
  const monitoring = [
    "Blood glucose every 4–6 hours during steroid therapy",
    "Resume home oral antidiabetics once patient is eating normally and steroids are weaned",
    "Review HbA1c at discharge — steroid use may have worsened long-term glycemic control",
    "Consider endocrinology referral if glucose control is persistently poor"
  ];
  s.addText(monitoring.map((m, i) => ({ text: m, options: { bullet: { code: "25B6", color: C.teal }, breakLine: i < monitoring.length - 1, fontSize: 10, color: C.white } })),
    { x: 0.4, y: 3.98, w: 9.2, h: 1.05 });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 6 — DRUGS TO AVOID
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.navy };
  addHeader(s, "Drugs to AVOID in This Patient");
  addFooter(s);

  const dangers = [
    {
      drug: "Non-Selective β-Blockers",
      examples: "Propranolol, Carvedilol, Atenolol",
      reason: "Cause bronchospasm — ABSOLUTE CONTRAINDICATION in asthma",
      level: "red"
    },
    {
      drug: "NSAIDs / Aspirin",
      examples: "Ibuprofen, Naproxen, Aspirin",
      reason: "May trigger aspirin-exacerbated respiratory disease (~10% of asthmatics)",
      level: "red"
    },
    {
      drug: "SGLT2 Inhibitors",
      examples: "Empagliflozin, Dapagliflozin, Canagliflozin",
      reason: "Hold if unwell or dehydrated — risk of euglycemic DKA",
      level: "amber"
    },
    {
      drug: "Sulfonylureas",
      examples: "Glibenclamide, Glipizide, Gliclazide",
      reason: "Significant hypoglycemia risk, especially if patient is not eating",
      level: "amber"
    },
    {
      drug: "Theophylline",
      examples: "Aminophylline",
      reason: "Narrow therapeutic window, high toxicity — last resort option only",
      level: "amber"
    },
  ];

  dangers.forEach((d, i) => {
    const y = 0.88 + i * 0.9;
    const barColor = d.level === "red" ? C.red : C.amber;
    s.addShape("rect", { x: 0.25, y, w: 9.5, h: 0.78, fill: { color: C.cardBg } });
    s.addShape("rect", { x: 0.25, y, w: 0.1, h: 0.78, fill: { color: barColor } });
    s.addText("🚫", { x: 0.4, y, w: 0.5, h: 0.78, fontSize: 16, valign: "middle", align: "center" });
    s.addText(d.drug, { x: 0.9, y: y + 0.04, w: 2.5, h: 0.35, fontSize: 11, bold: true, color: barColor, valign: "middle", margin: 0 });
    s.addText(d.examples, { x: 0.9, y: y + 0.42, w: 2.5, h: 0.3, fontSize: 9, color: C.light, italic: true, valign: "middle", margin: 0 });
    s.addText(d.reason, { x: 3.5, y, w: 6.1, h: 0.78, fontSize: 10, color: C.white, valign: "middle" });
  });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 7 — COMPLETE DRUG REFERENCE TABLE
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.navy };
  addHeader(s, "Complete Drug Reference — Doses at a Glance");
  addFooter(s);

  const cols2 = ["Drug", "Dose", "Route", "Frequency", "Category"];
  const w2    = [2.2,   2.8,   1.2,    2.5,         1.2];
  const tableRows = [
    ["Salbutamol", "2.5–5 mg (acute) / 180 µg (maint)", "Neb/MDI", "Every 20 min × 3, then PRN", "SABA"],
    ["Ipratropium", "0.5 mg (neb) / 36 µg (MDI)", "Neb/MDI", "Every 20 min × 3", "SAMA"],
    ["Prednisolone", "40–60 mg once daily", "Oral", "5–14 days", "Steroid"],
    ["Hydrocortisone", "100–500 mg", "IV/IM", "Every 6–12 h", "Steroid"],
    ["Dexamethasone", "12 mg", "Oral/IV", "1–2 doses", "Steroid"],
    ["Magnesium Sulfate", "2 g (2000 mg)", "IV infusion", "Single dose over 20 min", "Adjunct"],
    ["Oxygen", "Target SpO₂ 94–98%", "Mask/Cannula", "Continuous, titrated", "Supportive"],
    ["Budesonide/Formoterol", "80/4.5 µg, 2 puffs BD", "DPI", "Twice daily (maintenance)", "ICS/LABA"],
    ["Regular Insulin", "4–10 units SC (sliding scale)", "SC", "Per BG level (4–6 hrly check)", "Antidiabetic"],
  ];

  const categoryColors = {
    "SABA": "1A7A8A", "SAMA": "1A7A8A",
    "Steroid": "8B4513", "Adjunct": "2E5E8A",
    "Supportive": "2E8B57", "ICS/LABA": "1A6070",
    "Antidiabetic": "5A2D82"
  };

  let ry = 0.85;
  let cx = 0.1;
  cols2.forEach((h, i) => {
    s.addShape("rect", { x: cx, y: ry, w: w2[i], h: 0.38, fill: { color: C.teal } });
    s.addText(h, { x: cx + 0.04, y: ry, w: w2[i] - 0.04, h: 0.38, fontSize: 10, bold: true, color: C.white, valign: "middle", margin: 0 });
    cx += w2[i];
  });

  tableRows.forEach((row, ri) => {
    ry += 0.38;
    let cx2 = 0.1;
    const bg = ri % 2 === 0 ? C.cardBg : "0F2645";
    row.forEach((cell, ci) => {
      if (ci === 4) {
        // Category badge
        const catColor = categoryColors[cell] || C.teal;
        s.addShape("rect", { x: cx2, y: ry, w: w2[ci], h: 0.38, fill: { color: bg } });
        s.addShape("rect", { x: cx2 + 0.08, y: ry + 0.08, w: w2[ci] - 0.16, h: 0.22, fill: { color: catColor } });
        s.addText(cell, { x: cx2 + 0.08, y: ry + 0.08, w: w2[ci] - 0.16, h: 0.22, fontSize: 8, color: C.white, bold: true, align: "center", valign: "middle", margin: 0 });
      } else {
        s.addShape("rect", { x: cx2, y: ry, w: w2[ci], h: 0.38, fill: { color: bg } });
        s.addText(cell, { x: cx2 + 0.06, y: ry, w: w2[ci] - 0.06, h: 0.38, fontSize: 9, color: C.white, valign: "middle", margin: 0 });
      }
      cx2 += w2[ci];
    });
  });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 8 — DISCHARGE & LONG-TERM PLAN
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.navy };
  addHeader(s, "Discharge Plan & Long-Term Management");
  addFooter(s);

  // Asthma column
  addCard(s, 0.25, 0.85, 4.6, 3.6, "ASTHMA", C.teal);
  const asthmaItems = [
    "Step up controller therapy if inadequate",
    "ICS + LABA (preferred for moderate–severe persistent asthma)",
    "Provide written Asthma Action Plan",
    "Review inhaler technique",
    "Annual influenza vaccine",
    "Pneumococcal vaccine (PCV13 + PPSV23)",
    "Avoid triggers (allergens, NSAIDs, smoke)",
    "Schedule follow-up spirometry in 6 weeks"
  ];
  s.addText(asthmaItems.map((t, i) => ({ text: t, options: { bullet: { code: "25CF", color: C.amber }, breakLine: i < asthmaItems.length - 1, fontSize: 9.5, color: C.white } })),
    { x: 0.38, y: 1.28, w: 4.35, h: 3.1 });

  // Diabetes column
  addCard(s, 5.1, 0.85, 4.6, 3.6, "DIABETES (T2DM)", C.teal);
  const dmItems = [
    "Resume appropriate oral agents once eating normally",
    "Review HbA1c — steroid use may have elevated it",
    "Avoid sulfonylureas if meals unreliable",
    "SGLT2 inhibitors: restart only when fully recovered",
    "Consider endocrinology referral if control is poor",
    "Monitor renal function before restarting metformin",
    "Lifestyle: diet, physical activity counseling",
    "Self-monitoring blood glucose education"
  ];
  s.addText(dmItems.map((t, i) => ({ text: t, options: { bullet: { code: "25CF", color: C.amber }, breakLine: i < dmItems.length - 1, fontSize: 9.5, color: C.white } })),
    { x: 5.22, y: 1.28, w: 4.35, h: 3.1 });

  // Admission criteria strip at bottom
  s.addShape("rect", { x: 0.25, y: 4.58, w: 9.5, h: 0.62, fill: { color: "4A1010" } });
  s.addText("Admit if: ", { x: 0.4, y: 4.58, w: 1.3, h: 0.62, fontSize: 10, bold: true, color: C.amber, valign: "middle", margin: 0 });
  s.addText("PEFR < 50% after 1 hr  |  SpO₂ < 92% on air  |  Failure to respond to initial treatment  |  Prior ICU / near-fatal asthma history",
    { x: 1.65, y: 4.58, w: 8.0, h: 0.62, fontSize: 9.5, color: C.white, valign: "middle", margin: 0 });
}

// ══════════════════════════════════════════════════════════════════════════════
// WRITE FILE
// ══════════════════════════════════════════════════════════════════════════════
pres.writeFile({ fileName: "/home/daytona/workspace/asthma-ppt/Asthma_Exacerbation_T2DM_Management.pptx" })
  .then(() => console.log("✅ PPT generated successfully"))
  .catch(err => { console.error("❌ Error:", err); process.exit(1); });
Running Command

cd /home/daytona/workspace/asthma-ppt && node generate.js

You've run out of free credits. Sign up for a free account to continue using Orris.
This is a shared conversation. Sign in to Orris to start your own chat.