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 Make a ppt

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

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

Writing File

~/asthma-diabetes-ppt/create_ppt.js

const pptxgen = require("pptxgenjs");

let pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Asthma Exacerbation in Elderly Diabetic Patient";

// ─── Colour Palette ───────────────────────────────────────────
const NAVY   = "0B2E5E";   // dominant background
const TEAL   = "1A7FA8";   // accent headers / shapes
const SKY    = "4FC3F7";   // highlight accent
const WHITE  = "FFFFFF";
const LGREY  = "EAF4FC";   // card backgrounds
const ORANGE = "F57C00";   // warning / caution
const RED    = "C0392B";   // danger / severe
const GREEN  = "1B8A5A";   // stable / action
const YELLOW = "F9A825";   // moderate warning

// ─── Reusable helpers ─────────────────────────────────────────
function navySlide(slide) {
  slide.background = { color: NAVY };
}

function sectionHeader(slide, mainTitle, subtitle) {
  navySlide(slide);
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.18, h: 5.625, fill: { color: TEAL }, line: { color: TEAL } });
  slide.addText(mainTitle, {
    x: 0.45, y: 1.8, w: 9.1, h: 1.2, fontSize: 42, bold: true, color: WHITE, fontFace: "Calibri",
    align: "left"
  });
  if (subtitle) {
    slide.addText(subtitle, {
      x: 0.45, y: 3.1, w: 9.1, h: 0.7, fontSize: 20, color: SKY, fontFace: "Calibri", align: "left"
    });
  }
}

function contentSlide(slide, title) {
  slide.background = { color: LGREY };
  // Top bar
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.72, fill: { color: NAVY }, line: { color: NAVY } });
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0.72, w: 10, h: 0.07, fill: { color: TEAL }, line: { color: TEAL } });
  slide.addText(title, {
    x: 0.3, y: 0.08, w: 9.4, h: 0.56, fontSize: 22, bold: true, color: WHITE, fontFace: "Calibri",
    align: "left", valign: "middle", margin: 0
  });
}

function bulletBox(slide, items, x, y, w, h, opts = {}) {
  const bgColor  = opts.bgColor  || WHITE;
  const textColor= opts.textColor|| NAVY;
  const accent   = opts.accent   || TEAL;
  const fontSize = opts.fontSize || 14;
  const header   = opts.header   || null;

  // card background
  slide.addShape(pres.ShapeType.roundRect, {
    x, y, w, h,
    fill: { color: bgColor },
    line: { color: accent, width: 1.5 },
    rectRadius: 0.08,
    shadow: { type: "outer", color: "000000", blur: 4, offset: 2, angle: 135, opacity: 0.1 }
  });

  // optional header
  if (header) {
    slide.addShape(pres.ShapeType.roundRect, {
      x, y, w, h: 0.36,
      fill: { color: accent },
      line: { color: accent },
      rectRadius: 0.08
    });
    slide.addText(header, {
      x: x + 0.1, y: y + 0.03, w: w - 0.2, h: 0.3,
      fontSize: 13, bold: true, color: WHITE, fontFace: "Calibri", margin: 0
    });
  }

  const textY = header ? y + 0.4 : y + 0.1;
  const textH = header ? h - 0.5 : h - 0.2;

  const richItems = items.map((item, i) => {
    const isLast = i === items.length - 1;
    return { text: item, options: { bullet: { code: "2022" }, breakLine: !isLast, fontSize, color: textColor, fontFace: "Calibri" } };
  });

  slide.addText(richItems, {
    x: x + 0.15, y: textY, w: w - 0.3, h: textH,
    valign: "top"
  });
}

// ═══════════════════════════════════════════════════════════════
// SLIDE 1 — Title
// ═══════════════════════════════════════════════════════════════
{
  let s = pres.addSlide();
  navySlide(s);

  // left accent stripe
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.22, h: 5.625, fill: { color: TEAL }, line: { color: TEAL } });
  // bottom accent
  s.addShape(pres.ShapeType.rect, { x: 0, y: 5.1, w: 10, h: 0.525, fill: { color: TEAL }, line: { color: TEAL } });

  s.addText("Asthma Exacerbation", {
    x: 0.5, y: 0.6, w: 9, h: 1.0, fontSize: 40, bold: true, color: WHITE, fontFace: "Calibri", align: "left"
  });
  s.addText("in an Elderly Diabetic Patient", {
    x: 0.5, y: 1.55, w: 9, h: 0.75, fontSize: 30, color: SKY, fontFace: "Calibri", align: "left"
  });
  s.addText("Clinical Management at the OPD", {
    x: 0.5, y: 2.4, w: 9, h: 0.55, fontSize: 20, color: LGREY, fontFace: "Calibri", align: "left"
  });

  // pill badges
  const badges = ["65-Year-Old Male", "Asthma + Type 2 DM", "Acute Exacerbation"];
  badges.forEach((b, i) => {
    s.addShape(pres.ShapeType.roundRect, {
      x: 0.5 + i * 3.0, y: 3.3, w: 2.7, h: 0.45,
      fill: { color: TEAL }, line: { color: SKY }, rectRadius: 0.22
    });
    s.addText(b, { x: 0.5 + i * 3.0, y: 3.3, w: 2.7, h: 0.45, fontSize: 13, bold: true, color: WHITE, align: "center", valign: "middle", fontFace: "Calibri", margin: 0 });
  });

  s.addText("Emergency OPD Protocol  •  Respiratory Medicine", {
    x: 0.5, y: 5.1, w: 9, h: 0.5, fontSize: 13, color: WHITE, align: "center", valign: "middle", fontFace: "Calibri", margin: 0
  });
}

// ═══════════════════════════════════════════════════════════════
// SLIDE 2 — Case Presentation
// ═══════════════════════════════════════════════════════════════
{
  let s = pres.addSlide();
  contentSlide(s, "Case Presentation");

  const caseItems = [
    "Age: 65 years  |  Gender: Male  |  Setting: OPD",
    "Known Asthmatic — on maintenance inhalers",
    "Type 2 Diabetes Mellitus — on oral hypoglycaemics / insulin",
    "Presenting with: worsening breathlessness, wheezing, chest tightness",
    "Possible triggers: respiratory infection, allergen exposure, poor inhaler compliance",
  ];

  bulletBox(s, caseItems, 0.3, 0.95, 9.4, 2.0, { header: "Patient Profile", accent: TEAL, fontSize: 15 });

  // Vital signs boxes
  const vitals = [
    { label: "SpO₂", value: "< 92%", color: RED },
    { label: "RR", value: "> 25/min", color: ORANGE },
    { label: "HR", value: "100–120 bpm", color: ORANGE },
    { label: "PEFR", value: "< 50% predicted", color: RED },
    { label: "Blood Glucose", value: "Monitor closely", color: YELLOW },
  ];

  vitals.forEach((v, i) => {
    const xPos = 0.3 + i * 1.88;
    s.addShape(pres.ShapeType.rect, { x: xPos, y: 3.15, w: 1.75, h: 1.05, fill: { color: v.color }, line: { color: v.color } });
    s.addText(v.label, { x: xPos, y: 3.15, w: 1.75, h: 0.42, fontSize: 11, bold: true, color: WHITE, align: "center", valign: "middle", fontFace: "Calibri", margin: 0 });
    s.addText(v.value, { x: xPos, y: 3.57, w: 1.75, h: 0.53, fontSize: 12, color: WHITE, align: "center", valign: "middle", fontFace: "Calibri", margin: 0 });
  });

  s.addText("⚠  Concurrent T2DM complicates steroid use — blood glucose must be monitored every 1–2 hours", {
    x: 0.3, y: 4.35, w: 9.4, h: 0.55,
    fontSize: 13, bold: true, color: ORANGE, fontFace: "Calibri", italic: true
  });
}

// ═══════════════════════════════════════════════════════════════
// SLIDE 3 — Initial Assessment
// ═══════════════════════════════════════════════════════════════
{
  let s = pres.addSlide();
  contentSlide(s, "Initial Assessment — Classify Severity");

  const cols = [
    { label: "MILD", color: GREEN, items: ["Speaks full sentences", "Not agitated", "RR < 20/min", "SpO₂ ≥ 95%", "PEFR ≥ 70%"] },
    { label: "MODERATE", color: YELLOW, items: ["Short phrases only", "Agitated", "RR 20–25/min", "SpO₂ 91–94%", "PEFR 40–69%"] },
    { label: "SEVERE", color: ORANGE, items: ["Words only", "Very agitated", "RR > 25/min", "SpO₂ < 91%", "PEFR < 40%"] },
    { label: "LIFE-THREATENING", color: RED, items: ["Silent chest", "Cyanosis/exhaustion", "Bradycardia/hypotension", "Confused / drowsy", "PEFR < 33%"] },
  ];

  cols.forEach((col, i) => {
    const xPos = 0.2 + i * 2.42;
    s.addShape(pres.ShapeType.rect, { x: xPos, y: 0.9, w: 2.3, h: 0.45, fill: { color: col.color }, line: { color: col.color } });
    s.addText(col.label, { x: xPos, y: 0.9, w: 2.3, h: 0.45, fontSize: 13, bold: true, color: WHITE, align: "center", valign: "middle", fontFace: "Calibri", margin: 0 });

    const richItems = col.items.map((item, j) => ({
      text: item,
      options: { bullet: { code: "2022" }, breakLine: j < col.items.length - 1, fontSize: 13, color: NAVY, fontFace: "Calibri" }
    }));
    s.addShape(pres.ShapeType.rect, { x: xPos, y: 1.35, w: 2.3, h: 3.5, fill: { color: WHITE }, line: { color: col.color, width: 1.5 } });
    s.addText(richItems, { x: xPos + 0.1, y: 1.45, w: 2.1, h: 3.3, valign: "top" });
  });

  s.addText("Key investigations: ABG, PEFR, SpO₂, CXR, Blood glucose, CBC, Electrolytes, ECG", {
    x: 0.2, y: 5.1, w: 9.6, h: 0.45, fontSize: 12, color: TEAL, bold: true, fontFace: "Calibri", italic: true
  });
}

// ═══════════════════════════════════════════════════════════════
// SLIDE 4 — Immediate Management (SABA / O2 / Steroids)
// ═══════════════════════════════════════════════════════════════
{
  let s = pres.addSlide();
  contentSlide(s, "Immediate Management — First 30 Minutes");

  bulletBox(s, [
    "Salbutamol (SABA) via nebuliser — 2.5–5 mg every 20 min × 3 doses, then as needed",
    "Ipratropium bromide — 0.5 mg nebulised with SABA for moderate–severe exacerbation",
    "Oxygen — titrate to keep SpO₂ 93–95% (avoid hyperoxia; use controlled O₂ in elderly)",
  ], 0.3, 0.9, 9.4, 1.8, { header: "Bronchodilator Therapy + Oxygen", accent: TEAL });

  bulletBox(s, [
    "Systemic corticosteroids: Prednisolone 40–60 mg oral OR IV Hydrocortisone 100 mg 6-hourly",
    "Duration: 5–7 days (short course, do NOT taper if < 3 weeks)",
    "⚠ DM CAUTION: Steroids will raise blood glucose — check BSL every 1–2 h",
    "Adjust antidiabetic regimen: may need sliding-scale insulin or increased insulin dose",
    "Avoid delaying steroids — their benefit outweighs transient hyperglycaemia",
  ], 0.3, 2.85, 9.4, 2.2, { header: "Corticosteroids — Special Consideration in T2DM", accent: ORANGE, bgColor: "FFF8F0" });

  s.addText("💊  Methylxanthines (IV Aminophylline) — consider only if inadequate response to above therapies", {
    x: 0.3, y: 5.15, w: 9.4, h: 0.4, fontSize: 12, color: TEAL, fontFace: "Calibri", italic: true, bold: true
  });
}

// ═══════════════════════════════════════════════════════════════
// SLIDE 5 — Diabetes Management during Exacerbation
// ═══════════════════════════════════════════════════════════════
{
  let s = pres.addSlide();
  contentSlide(s, "Managing Type 2 Diabetes During Acute Asthma");

  bulletBox(s, [
    "Corticosteroids cause dose-dependent hyperglycaemia — effect maximal 4–8 h after dose",
    "Beta-agonists (salbutamol) can also cause transient hyperglycaemia via glycogenolysis",
    "Stress response itself raises cortisol → worsens insulin resistance",
    "Risk of diabetic ketoacidosis (DKA) if patient is on SGLT-2 inhibitors — withhold if possible",
  ], 0.3, 0.9, 9.4, 2.0, { header: "Why Blood Sugar Rises in Acute Asthma", accent: RED, bgColor: "FFF0F0" });

  bulletBox(s, [
    "Monitor blood glucose every 1–2 hours during acute phase",
    "Target blood glucose: 7.8–10 mmol/L (140–180 mg/dL) in acute setting",
    "If on oral hypoglycaemics: withhold Metformin if contrast/hypoxia risk; use with caution",
    "Initiate or escalate insulin therapy (basal-bolus or sliding scale) as required",
    "Review antidiabetic therapy daily — de-escalate once steroids are tapered",
    "Liaise with endocrinology/diabetology for inpatient glucose management if admitted",
  ], 0.3, 3.05, 9.4, 2.35, { header: "Blood Glucose Management Protocol", accent: GREEN, bgColor: "F0FFF6" });
}

// ═══════════════════════════════════════════════════════════════
// SLIDE 6 — Drug Cautions in Elderly + DM + Asthma
// ═══════════════════════════════════════════════════════════════
{
  let s = pres.addSlide();
  contentSlide(s, "Drug Cautions — Asthma + T2DM + Elderly");

  const drugs = [
    { drug: "Beta-blockers", concern: "Contraindicated in asthma — cause bronchoconstriction; often used for DM-related CVD — use cardioselective only with extreme caution", color: RED },
    { drug: "NSAIDs / Aspirin", concern: "Aspirin-exacerbated respiratory disease (AERD) in some asthmatics — use with caution; also affects renal function in elderly", color: ORANGE },
    { drug: "Metformin", concern: "Hold if contrast dye planned, hypoxia (SpO₂ < 92%) or dehydration — lactic acidosis risk", color: ORANGE },
    { drug: "SGLT-2 Inhibitors", concern: "Risk of euglycaemic DKA during acute illness / stress — withhold during exacerbation", color: RED },
    { drug: "ACE Inhibitors", concern: "May cause cough (can mimic asthma) — consider switching to ARB if cough worsens asthma control", color: YELLOW },
    { drug: "Theophylline", concern: "Narrow therapeutic index; interacts with many drugs; use cautiously in elderly — monitor levels", color: YELLOW },
  ];

  drugs.forEach((d, i) => {
    const row = Math.floor(i / 2);
    const col = i % 2;
    const xPos = 0.3 + col * 4.85;
    const yPos = 0.9 + row * 1.28;

    s.addShape(pres.ShapeType.rect, { x: xPos, y: yPos, w: 4.6, h: 0.38, fill: { color: d.color }, line: { color: d.color } });
    s.addText(d.drug, { x: xPos, y: yPos, w: 4.6, h: 0.38, fontSize: 13, bold: true, color: WHITE, align: "center", valign: "middle", fontFace: "Calibri", margin: 0 });
    s.addShape(pres.ShapeType.rect, { x: xPos, y: yPos + 0.38, w: 4.6, h: 0.82, fill: { color: WHITE }, line: { color: d.color, width: 1.5 } });
    s.addText(d.concern, { x: xPos + 0.1, y: yPos + 0.42, w: 4.4, h: 0.72, fontSize: 11.5, color: NAVY, fontFace: "Calibri", valign: "top" });
  });
}

// ═══════════════════════════════════════════════════════════════
// SLIDE 7 — Response Assessment & Step-Up
// ═══════════════════════════════════════════════════════════════
{
  let s = pres.addSlide();
  contentSlide(s, "Response Assessment at 1 Hour");

  // Good response box
  s.addShape(pres.ShapeType.rect, { x: 0.3, y: 0.9, w: 4.5, h: 2.1, fill: { color: WHITE }, line: { color: GREEN, width: 2 } });
  s.addShape(pres.ShapeType.rect, { x: 0.3, y: 0.9, w: 4.5, h: 0.42, fill: { color: GREEN }, line: { color: GREEN } });
  s.addText("GOOD RESPONSE", { x: 0.3, y: 0.9, w: 4.5, h: 0.42, fontSize: 14, bold: true, color: WHITE, align: "center", valign: "middle", fontFace: "Calibri", margin: 0 });
  const goodItems = [
    "SpO₂ ≥ 94%, PEFR ≥ 70% predicted",
    "Symptoms resolved / improving",
    "No distress, speaking full sentences",
    "→ Discharge with oral steroids + inhaler plan",
  ];
  s.addText(goodItems.map((t, i) => ({ text: t, options: { bullet: { code: "2022" }, breakLine: i < goodItems.length - 1, fontSize: 13, color: NAVY, fontFace: "Calibri" } })),
    { x: 0.45, y: 1.38, w: 4.2, h: 1.55, valign: "top" });

  // Poor response box
  s.addShape(pres.ShapeType.rect, { x: 5.2, y: 0.9, w: 4.5, h: 2.1, fill: { color: WHITE }, line: { color: RED, width: 2 } });
  s.addShape(pres.ShapeType.rect, { x: 5.2, y: 0.9, w: 4.5, h: 0.42, fill: { color: RED }, line: { color: RED } });
  s.addText("POOR RESPONSE", { x: 5.2, y: 0.9, w: 4.5, h: 0.42, fontSize: 14, bold: true, color: WHITE, align: "center", valign: "middle", fontFace: "Calibri", margin: 0 });
  const poorItems = [
    "SpO₂ < 92% despite O₂, PEFR < 40%",
    "Worsening symptoms / silent chest",
    "Consider IV Magnesium Sulphate 2g over 20 min",
    "→ Admit to hospital / ICU if life-threatening",
  ];
  s.addText(poorItems.map((t, i) => ({ text: t, options: { bullet: { code: "2022" }, breakLine: i < poorItems.length - 1, fontSize: 13, color: NAVY, fontFace: "Calibri" } })),
    { x: 5.35, y: 1.38, w: 4.2, h: 1.55, valign: "top" });

  bulletBox(s, [
    "Add-on IV Magnesium Sulphate 2g over 20 min — evidence-based for severe acute asthma (NNT ~8)",
    "Heliox (helium-oxygen mixture) — reduces airflow resistance in refractory cases",
    "IV Aminophylline — consider if no response to nebulisers; monitor for toxicity in elderly",
    "Non-invasive ventilation (NIV/BiPAP) — before intubation if respiratory failure",
    "Intubation + mechanical ventilation — last resort; higher risk in asthmatics (breath-stacking)",
  ], 0.3, 3.15, 9.4, 2.1, { header: "Escalation Therapies (Moderate–Severe / No Response)", accent: ORANGE, bgColor: "FFF8F0" });
}

// ═══════════════════════════════════════════════════════════════
// SLIDE 8 — Maintenance Therapy & Stepwise Approach
// ═══════════════════════════════════════════════════════════════
{
  let s = pres.addSlide();
  contentSlide(s, "Long-Term Management — GINA Stepwise Approach");

  const steps = [
    { n: "1", label: "SABA PRN", detail: "Mild intermittent — salbutamol as needed" },
    { n: "2", label: "Low-dose ICS", detail: "Add inhaled corticosteroid (e.g. Budesonide 200 mcg BD)" },
    { n: "3", label: "ICS + LABA", detail: "Add long-acting β₂-agonist (e.g. Formoterol); consider LTRA" },
    { n: "4", label: "Med/high ICS+LABA", detail: "Increase ICS dose; add tiotropium; refer to specialist" },
    { n: "5", label: "Add-on biologics", detail: "Anti-IgE (omalizumab) / anti-IL5 — specialist-initiated" },
  ];

  steps.forEach((step, i) => {
    const xPos = 0.25 + i * 1.9;
    const highlight = i === 2; // step 3 — likely target
    const col = highlight ? TEAL : NAVY;
    s.addShape(pres.ShapeType.rect, { x: xPos, y: 0.9, w: 1.78, h: 0.45, fill: { color: col }, line: { color: col } });
    s.addText(`Step ${step.n}`, { x: xPos, y: 0.9, w: 1.78, h: 0.45, fontSize: 13, bold: true, color: WHITE, align: "center", valign: "middle", fontFace: "Calibri", margin: 0 });
    s.addShape(pres.ShapeType.rect, { x: xPos, y: 1.35, w: 1.78, h: 1.3, fill: { color: highlight ? "E8F7FF" : WHITE }, line: { color: col, width: 1.5 } });
    s.addText(step.label, { x: xPos + 0.05, y: 1.4, w: 1.68, h: 0.45, fontSize: 12, bold: true, color: col, fontFace: "Calibri" });
    s.addText(step.detail, { x: xPos + 0.05, y: 1.85, w: 1.68, h: 0.72, fontSize: 10.5, color: NAVY, fontFace: "Calibri" });
  });

  bulletBox(s, [
    "Preferred device in elderly: pressurised MDI + spacer (easier to coordinate vs DPI)",
    "Review inhaler technique at every visit — poor technique is a major cause of poor control",
    "Reassess blood glucose control at every visit — glycaemic goals may need adjustment",
    "Annual influenza vaccine + pneumococcal vaccine — prevent infective exacerbation triggers",
    "Avoid NSAIDs, beta-blockers, smoking, dust, allergens",
  ], 0.3, 2.85, 9.4, 2.05, { header: "Special Considerations in Elderly Diabetic Patient", accent: TEAL });

  s.addText("GINA 2023: In adults ≥65 y, consider written Asthma Action Plan & regular self-monitoring PEFR", {
    x: 0.3, y: 5.12, w: 9.4, h: 0.4, fontSize: 12, color: TEAL, italic: true, fontFace: "Calibri", bold: true
  });
}

// ═══════════════════════════════════════════════════════════════
// SLIDE 9 — Discharge Criteria & Patient Education
// ═══════════════════════════════════════════════════════════════
{
  let s = pres.addSlide();
  contentSlide(s, "Discharge Criteria & Patient Education");

  bulletBox(s, [
    "SpO₂ ≥ 94% on room air",
    "PEFR ≥ 70% of personal best or predicted",
    "Symptoms adequately controlled; no nocturnal symptoms",
    "On oral steroids and able to self-administer inhalers correctly",
    "Blood glucose under reasonable control before discharge",
  ], 0.3, 0.9, 4.6, 2.3, { header: "Discharge Criteria", accent: GREEN });

  bulletBox(s, [
    "Counsel on correct inhaler technique with spacer demonstration",
    "Provide written Asthma Action Plan (AAP)",
    "Educate on early warning signs of exacerbation",
    "Blood glucose self-monitoring — explain steroid effect",
    "Follow-up within 48 h (GP) and 4 weeks (specialist)",
    "Smoking cessation / allergen avoidance counselling",
  ], 5.1, 0.9, 4.6, 2.3, { header: "Patient Education", accent: TEAL });

  bulletBox(s, [
    "Review and optimise maintenance asthma medications (step-up if needed)",
    "Reassess diabetic medications — restart or adjust once steroids tapered",
    "Screen for comorbidities: GORD, OSA, allergic rhinitis, anxiety / depression",
    "Referral to respiratory specialist if ≥ 2 exacerbations/year requiring oral steroids",
    "Consider referral to diabetes nurse educator for self-management support",
  ], 0.3, 3.4, 9.4, 1.95, { header: "Follow-Up & Optimisation Plan", accent: NAVY });
}

// ═══════════════════════════════════════════════════════════════
// SLIDE 10 — Summary Flowchart
// ═══════════════════════════════════════════════════════════════
{
  let s = pres.addSlide();
  contentSlide(s, "Summary Management Algorithm");

  const boxes = [
    { x: 3.5, y: 0.85, w: 3.0, h: 0.55, color: NAVY, text: "PATIENT ARRIVES OPD", textColor: WHITE },
    { x: 3.5, y: 1.55, w: 3.0, h: 0.55, color: TEAL, text: "ASSESS SEVERITY + BSL", textColor: WHITE },
    { x: 0.3, y: 2.3,  w: 2.8, h: 0.55, color: GREEN,  text: "MILD → SABA + ICS", textColor: WHITE },
    { x: 3.5, y: 2.3,  w: 3.0, h: 0.55, color: YELLOW, text: "MODERATE → SABA + Ipratropium + Steroids", textColor: NAVY },
    { x: 6.9, y: 2.3,  w: 2.8, h: 0.55, color: RED,    text: "SEVERE → All + O₂ + IV Steroids + MgSO₄", textColor: WHITE },
    { x: 3.5, y: 3.1,  w: 3.0, h: 0.55, color: ORANGE, text: "MONITOR BSL q1–2h", textColor: WHITE },
    { x: 3.5, y: 3.85, w: 3.0, h: 0.55, color: NAVY,   text: "REASSESS AT 1 HOUR", textColor: WHITE },
    { x: 0.8, y: 4.6,  w: 3.5, h: 0.55, color: GREEN,  text: "GOOD → Discharge + Action Plan", textColor: WHITE },
    { x: 5.7, y: 4.6,  w: 3.5, h: 0.55, color: RED,    text: "POOR → Admit / Escalate / ICU", textColor: WHITE },
  ];

  boxes.forEach(b => {
    s.addShape(pres.ShapeType.roundRect, { x: b.x, y: b.y, w: b.w, h: b.h, fill: { color: b.color }, line: { color: b.color }, rectRadius: 0.1 });
    s.addText(b.text, { x: b.x, y: b.y, w: b.w, h: b.h, fontSize: 12, bold: true, color: b.textColor, align: "center", valign: "middle", fontFace: "Calibri", margin: 0 });
  });

  // Arrows (lines)
  const arrows = [
    { x: 5.0, y: 1.4, w: 0, h: 0.15 },
    { x: 5.0, y: 2.1, w: 0, h: 0.2 },
    { x: 5.0, y: 2.85, w: 0, h: 0.25 },
    { x: 5.0, y: 3.65, w: 0, h: 0.2 },
    { x: 5.0, y: 4.4, w: 0, h: 0.2 },
  ];
  arrows.forEach(a => {
    s.addShape(pres.ShapeType.line, { x: a.x, y: a.y, w: a.w, h: a.h, line: { color: NAVY, width: 1.5 } });
  });
}

// ═══════════════════════════════════════════════════════════════
// SLIDE 11 — Key Takeaways
// ═══════════════════════════════════════════════════════════════
{
  let s = pres.addSlide();
  navySlide(s);

  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.22, h: 5.625, fill: { color: TEAL }, line: { color: TEAL } });
  s.addShape(pres.ShapeType.rect, { x: 0, y: 5.1, w: 10, h: 0.525, fill: { color: TEAL }, line: { color: TEAL } });

  s.addText("Key Takeaways", { x: 0.5, y: 0.25, w: 9, h: 0.65, fontSize: 30, bold: true, color: WHITE, fontFace: "Calibri" });

  const takeaways = [
    { icon: "①", text: "Treat exacerbation urgently — SABA + O₂ + systemic steroids are first-line regardless of diabetes" },
    { icon: "②", text: "Steroids are essential and must NOT be withheld — manage steroid-induced hyperglycaemia proactively" },
    { icon: "③", text: "Monitor blood glucose every 1–2 hours; initiate sliding-scale insulin if BSL > 10 mmol/L" },
    { icon: "④", text: "Avoid beta-blockers, NSAIDs, and SGLT-2 inhibitors during acute illness" },
    { icon: "⑤", text: "Reassess at 1 hour — escalate to IV MgSO₄ / hospital admission if insufficient response" },
    { icon: "⑥", text: "On discharge: inhaler technique education, written action plan, and 48-hour follow-up" },
  ];

  takeaways.forEach((t, i) => {
    const yPos = 1.05 + i * 0.72;
    s.addShape(pres.ShapeType.roundRect, { x: 0.45, y: yPos, w: 9.2, h: 0.6, fill: { color: "102B52" }, line: { color: TEAL, width: 1 }, rectRadius: 0.08 });
    s.addText(t.icon, { x: 0.55, y: yPos, w: 0.55, h: 0.6, fontSize: 18, bold: true, color: SKY, align: "center", valign: "middle", fontFace: "Calibri", margin: 0 });
    s.addText(t.text, { x: 1.15, y: yPos, w: 8.2, h: 0.6, fontSize: 13.5, color: WHITE, fontFace: "Calibri", valign: "middle" });
  });

  s.addText("References: GINA 2023 | British Thoracic Society | ADA Standards of Care | Textbook of Family Medicine 9e", {
    x: 0.5, y: 5.1, w: 9, h: 0.5, fontSize: 11, color: WHITE, align: "center", valign: "middle", fontFace: "Calibri", margin: 0
  });
}

// ─── Write file ───────────────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/workspace/asthma-diabetes-ppt/Asthma_Exacerbation_DM_Management.pptx" })
  .then(() => console.log("✅  PPT created successfully"))
  .catch(e => { console.error("❌  Error:", e); process.exit(1); });
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.