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); });