Create e poster for conference for pg medicine resident topic is DKA triggers and outcomes non compliance infection ,first presentation

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

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

Writing File

~/eposter/dka_poster.js

const pptxgen = require("pptxgenjs");
const pres = new pptxgen();

// A0 poster-like layout: use LAYOUT_WIDE (13.3" x 7.5") in landscape
// For a portrait poster feel, we use a custom tall layout
pres.defineLayout({ name: "POSTER", width: 24, height: 36 });
pres.layout = "POSTER";

// ── Color palette ──────────────────────────────────────────────
const DARK_BG    = "0D1B2A";  // deep navy
const PANEL_BG   = "112233";  // slightly lighter navy
const ACCENT     = "E8402A";  // red-orange accent
const GOLD       = "F5A623";  // amber/gold highlight
const GREEN      = "27AE60";  // outcome green
const LIGHT_TXT  = "F0F4F8";  // near-white
const SUBHEAD    = "A8C7E0";  // muted light blue
const CARD_BG    = "1A2E42";  // card surface
const WHITE      = "FFFFFF";
const DIVIDER    = "2A4A6A";

// ── Background ─────────────────────────────────────────────────
const slide = pres.addSlide();
slide.background = { color: DARK_BG };

// ── Top gradient bar ───────────────────────────────────────────
slide.addShape(pres.ShapeType.rect, {
  x: 0, y: 0, w: 24, h: 2.6,
  fill: { color: "1A3A5C" },
  line: { color: "1A3A5C" }
});
// Accent top stripe
slide.addShape(pres.ShapeType.rect, {
  x: 0, y: 0, w: 24, h: 0.22,
  fill: { color: ACCENT },
  line: { color: ACCENT }
});

// ── TITLE BLOCK ────────────────────────────────────────────────
slide.addText("DIABETIC KETOACIDOSIS", {
  x: 0.6, y: 0.3, w: 22.8, h: 1.0,
  fontSize: 64, bold: true, color: WHITE,
  fontFace: "Calibri", charSpacing: 6, align: "center", margin: 0
});
slide.addText("TRIGGERS & OUTCOMES: Non-Compliance · Infection · First Presentation", {
  x: 0.6, y: 1.28, w: 22.8, h: 0.78,
  fontSize: 30, bold: false, color: GOLD,
  fontFace: "Calibri", align: "center", margin: 0, charSpacing: 2
});

// Conference tag
slide.addShape(pres.ShapeType.rect, {
  x: 0, y: 2.6, w: 24, h: 0.18,
  fill: { color: ACCENT }, line: { color: ACCENT }
});

// Presenter line
slide.addText("PG Medicine Resident Conference  |  Department of Internal Medicine  |  May 2026", {
  x: 0.6, y: 2.82, w: 22.8, h: 0.45,
  fontSize: 18, color: SUBHEAD, fontFace: "Calibri", align: "center", margin: 0
});

// ── SECTION HELPERS ────────────────────────────────────────────
function sectionHeader(slide, x, y, w, label, color) {
  slide.addShape(pres.ShapeType.rect, {
    x, y, w, h: 0.52,
    fill: { color: color || ACCENT },
    line: { color: color || ACCENT }, rounding: 0.04
  });
  slide.addText(label, {
    x: x + 0.12, y: y + 0.06, w: w - 0.24, h: 0.42,
    fontSize: 22, bold: true, color: WHITE,
    fontFace: "Calibri", align: "left", margin: 0
  });
}

function card(slide, x, y, w, h) {
  slide.addShape(pres.ShapeType.rect, {
    x, y, w, h,
    fill: { color: CARD_BG },
    line: { color: DIVIDER, pt: 1 },
    shadow: { type: "outer", blur: 6, offset: 3, angle: 45, color: "000000", opacity: 0.3 }
  });
}

// ── ROW 1: Three columns ───────────────────────────────────────
// Col widths: 7.4" each with 0.4" gutters
// Total: 7.4+7.4+7.4 + 0.4+0.4 = 23.2 — starts at x=0.4
const COL1_X = 0.4;
const COL2_X = 8.2;
const COL3_X = 16.0;
const COL_W  = 7.6;
const ROW1_Y = 3.5;

// ────────────────────────────────────
// COL 1: BACKGROUND & PATHOPHYSIOLOGY
// ────────────────────────────────────
card(slide, COL1_X, ROW1_Y, COL_W, 10.2);
sectionHeader(slide, COL1_X, ROW1_Y, COL_W, "⚗  PATHOPHYSIOLOGY", "1A5276");

slide.addText("DKA is a life-threatening triad of:", {
  x: COL1_X + 0.18, y: ROW1_Y + 0.65, w: COL_W - 0.36, h: 0.38,
  fontSize: 19, bold: true, color: GOLD, fontFace: "Calibri", margin: 0
});

// Triad visual: three horizontal badges
const triadItems = [
  { label: "HYPERGLYCEMIA", sub: "Glucose ≥250 mg/dL" },
  { label: "KETOSIS",        sub: "β-OHB ≥3.0 mmol/L" },
  { label: "ACIDOSIS",       sub: "pH < 7.30" }
];
triadItems.forEach((item, i) => {
  const bx = COL1_X + 0.18;
  const by = ROW1_Y + 1.12 + i * 0.82;
  slide.addShape(pres.ShapeType.rect, {
    x: bx, y: by, w: COL_W - 0.36, h: 0.72,
    fill: { color: "1A3A5C" }, line: { color: GOLD, pt: 1.5 }, rounding: 0.06
  });
  slide.addText([
    { text: item.label + "  ", options: { bold: true, color: GOLD, fontSize: 20 } },
    { text: item.sub, options: { bold: false, color: LIGHT_TXT, fontSize: 16 } }
  ], {
    x: bx + 0.15, y: by + 0.12, w: COL_W - 0.66, h: 0.48,
    fontFace: "Calibri", margin: 0
  });
});

slide.addText("Mechanism:", {
  x: COL1_X + 0.18, y: ROW1_Y + 3.68, w: COL_W - 0.36, h: 0.35,
  fontSize: 18, bold: true, color: SUBHEAD, fontFace: "Calibri", margin: 0
});

const mechText = [
  { text: "↑ Glucagon / ↓ Insulin  →  unrestrained lipolysis", options: { bullet: true, color: LIGHT_TXT, fontSize: 17, breakLine: true } },
  { text: "Free fatty acids → hepatic ketogenesis (β-OHB, acetoacetate)", options: { bullet: true, color: LIGHT_TXT, fontSize: 17, breakLine: true } },
  { text: "Osmotic diuresis → dehydration + electrolyte losses", options: { bullet: true, color: LIGHT_TXT, fontSize: 17, breakLine: true } },
  { text: "Kussmaul breathing = respiratory compensation for acidosis", options: { bullet: true, color: LIGHT_TXT, fontSize: 17, breakLine: true } },
  { text: "Average fluid deficit: 70–120 mL/kg body weight", options: { bullet: true, color: LIGHT_TXT, fontSize: 17, breakLine: true } },
  { text: "K⁺, PO₄, Mg²⁺: total-body depleted despite elevated serum levels", options: { bullet: true, color: LIGHT_TXT, fontSize: 17 } },
];
slide.addText(mechText, {
  x: COL1_X + 0.18, y: ROW1_Y + 4.08, w: COL_W - 0.36, h: 5.5,
  fontFace: "Calibri", margin: 0, paraSpaceAfter: 4
});

// ────────────────────────────────────
// COL 2: TRIGGERS
// ────────────────────────────────────
card(slide, COL2_X, ROW1_Y, COL_W, 10.2);
sectionHeader(slide, COL2_X, ROW1_Y, COL_W, "⚡  TRIGGERS / PRECIPITANTS", ACCENT);

// Three main trigger boxes
const triggers = [
  {
    icon: "💊",
    title: "NON-COMPLIANCE",
    color: "C0392B",
    items: [
      "Most common trigger in established T1DM",
      "Deliberate insulin omission (weight control, psychosocial)",
      "Insulin access barriers — cost, supply shortages",
      "Insulin pump failure or site occlusion",
      "Missing doses during illness ('sick-day rules' not followed)",
      "Elderly / low-vision patients: administration errors",
    ]
  },
  {
    icon: "🦠",
    title: "INFECTION",
    color: "873600",
    items: [
      "2nd most common precipitant overall",
      "UTI & pneumonia — most frequent infectious triggers",
      "Stress hormones (cortisol, catecholamines) → counter-regulatory surge",
      "Elevated temperature ≠ DKA itself — always suggests infection",
      "Sepsis / soft-tissue infections in T2DM",
      "COVID-19 associated euglycaemic DKA reported",
    ]
  },
  {
    icon: "🩺",
    title: "FIRST PRESENTATION",
    color: "117A65",
    items: [
      "~25% of all DKA episodes = new-onset diabetes",
      "Common in children & young adults with T1DM",
      "Developing-world setting: higher rate of presentation at DKA",
      "Delayed diagnosis → more severe acidosis at presentation",
      "Classic prodrome: days of polyuria, polydipsia, weight loss",
      "Abdominal pain mimics acute abdomen in 50% of children",
    ]
  }
];

let tyBase = ROW1_Y + 0.62;
triggers.forEach((t, i) => {
  const ty = tyBase + i * 3.12;
  slide.addShape(pres.ShapeType.rect, {
    x: COL2_X + 0.18, y: ty, w: COL_W - 0.36, h: 2.96,
    fill: { color: "1A2E42" }, line: { color: t.color, pt: 2 }, rounding: 0.06
  });
  // Icon + title bar
  slide.addShape(pres.ShapeType.rect, {
    x: COL2_X + 0.18, y: ty, w: COL_W - 0.36, h: 0.5,
    fill: { color: t.color }, line: { color: t.color }, rounding: 0.04
  });
  slide.addText(t.icon + "  " + t.title, {
    x: COL2_X + 0.3, y: ty + 0.05, w: COL_W - 0.6, h: 0.42,
    fontSize: 20, bold: true, color: WHITE, fontFace: "Calibri", margin: 0
  });
  const bulletItems = t.items.map((txt, idx) => ({
    text: txt,
    options: { bullet: true, color: LIGHT_TXT, fontSize: 15.5, breakLine: idx < t.items.length - 1 }
  }));
  slide.addText(bulletItems, {
    x: COL2_X + 0.3, y: ty + 0.56, w: COL_W - 0.48, h: 2.28,
    fontFace: "Calibri", margin: 0, paraSpaceAfter: 3
  });
});

// Additional triggers mini-list
sectionHeader(slide, COL2_X, ROW1_Y + 9.58, COL_W, "OTHER NOTABLE TRIGGERS", "2471AB");
slide.addText([
  { text: "ACS / MI  •  CVA  •  Pancreatitis  •  Pulmonary embolism  •  GI bleeding", options: { color: LIGHT_TXT, fontSize: 14, breakLine: true } },
  { text: "Drugs: corticosteroids, SGLT-2 inhibitors*, clozapine, thiazides, cocaine", options: { color: GOLD, fontSize: 14, breakLine: true } },
  { text: "Endocrinopathy: Cushing's, thyrotoxicosis, acromegaly", options: { color: LIGHT_TXT, fontSize: 14 } },
], {
  x: COL2_X + 0.18, y: ROW1_Y + 10.14, w: COL_W - 0.36, h: 0.68,
  fontFace: "Calibri", margin: 0
});

// ────────────────────────────────────
// COL 3: CLINICAL FEATURES + DIAGNOSIS
// ────────────────────────────────────
card(slide, COL3_X, ROW1_Y, COL_W, 10.2);
sectionHeader(slide, COL3_X, ROW1_Y, COL_W, "🔬  CLINICAL FEATURES & DIAGNOSIS", "6E2FA0");

slide.addText("Symptoms & Signs", {
  x: COL3_X + 0.18, y: ROW1_Y + 0.65, w: COL_W - 0.36, h: 0.35,
  fontSize: 18, bold: true, color: SUBHEAD, fontFace: "Calibri", margin: 0
});
const sx = [
  "Polyuria, polydipsia, polyphagia, weight loss",
  "Nausea, vomiting, anorexia, abdominal pain",
  "Kussmaul breathing (deep, rapid respirations)",
  "Fruity/acetone odour on breath",
  "Tachycardia, hypotension, dry mucous membranes",
  "Altered mental status → coma (severe cases)",
  "Elevated temperature → suggests underlying infection",
];
const sxBullets = sx.map((t, i) => ({
  text: t, options: { bullet: true, color: LIGHT_TXT, fontSize: 16, breakLine: i < sx.length - 1 }
}));
slide.addText(sxBullets, {
  x: COL3_X + 0.18, y: ROW1_Y + 1.06, w: COL_W - 0.36, h: 3.2,
  fontFace: "Calibri", margin: 0, paraSpaceAfter: 3
});

// Diagnostic criteria table
slide.addText("Diagnostic Criteria (ADA / ISPAD)", {
  x: COL3_X + 0.18, y: ROW1_Y + 4.35, w: COL_W - 0.36, h: 0.35,
  fontSize: 18, bold: true, color: SUBHEAD, fontFace: "Calibri", margin: 0
});

const tableRows = [
  [{ text: "Parameter", options: { bold: true, color: GOLD } }, { text: "Mild", options: { bold: true, color: GOLD } }, { text: "Moderate", options: { bold: true, color: GOLD } }, { text: "Severe", options: { bold: true, color: GOLD } }],
  [{ text: "pH" }, { text: "7.25–7.30" }, { text: "7.00–7.24" }, { text: "< 7.00" }],
  [{ text: "HCO₃ (mEq/L)" }, { text: "15–18" }, { text: "10–14" }, { text: "< 10" }],
  [{ text: "Anion Gap" }, { text: "> 10" }, { text: "> 12" }, { text: "> 14" }],
  [{ text: "Sensorium" }, { text: "Alert" }, { text: "Alert/drowsy" }, { text: "Stupor/coma" }],
];

slide.addTable(tableRows, {
  x: COL3_X + 0.18, y: ROW1_Y + 4.76,
  w: COL_W - 0.36,
  colW: [2.2, 1.6, 1.8, 1.6],
  rowH: 0.44,
  fontFace: "Calibri",
  fontSize: 15,
  color: LIGHT_TXT,
  fill: { color: CARD_BG },
  border: { pt: 1, color: DIVIDER },
  align: "center"
});

// Key labs
slide.addText("Key Labs to Order", {
  x: COL3_X + 0.18, y: ROW1_Y + 7.22, w: COL_W - 0.36, h: 0.35,
  fontSize: 18, bold: true, color: SUBHEAD, fontFace: "Calibri", margin: 0
});
const labs = [
  "ABG/VBG — pH, pCO₂, HCO₃",
  "BMP: glucose, electrolytes, BUN, creatinine",
  "Serum ketones (β-OHB) or urine ketones",
  "CBC, blood cultures, urine cultures (if febrile)",
  "ECG — detect ACS trigger; K⁺-related changes",
  "HbA1c — establish prior glycaemic control",
];
const labBullets = labs.map((t, i) => ({
  text: t, options: { bullet: true, color: LIGHT_TXT, fontSize: 15.5, breakLine: i < labs.length - 1 }
}));
slide.addText(labBullets, {
  x: COL3_X + 0.18, y: ROW1_Y + 7.62, w: COL_W - 0.36, h: 2.4,
  fontFace: "Calibri", margin: 0, paraSpaceAfter: 3
});

// ── ROW 2: Management + Outcomes ──────────────────────────────
const ROW2_Y = 14.0;

// ─── MANAGEMENT (spanning col1 + col2 area)
card(slide, COL1_X, ROW2_Y, 15.2, 11.8);
sectionHeader(slide, COL1_X, ROW2_Y, 15.2, "💉  MANAGEMENT OVERVIEW", "1A5276");

// 4 step boxes
const steps = [
  {
    num: "01",
    title: "FLUID RESUSCITATION",
    color: "1565C0",
    content: [
      "0.9% NaCl: 10–20 mL/kg over first 1–2 hrs (bolus)",
      "Then 250–500 mL/hr; switch to 0.45% NaCl once Na corrected",
      "Add dextrose (D5) when glucose reaches 200–250 mg/dL",
      "Goal: correct dehydration, restore perfusion",
    ]
  },
  {
    num: "02",
    title: "INSULIN THERAPY",
    color: "C0392B",
    content: [
      "Regular insulin IV infusion: 0.1 unit/kg/hr",
      "Do NOT start insulin if K⁺ < 3.5 mEq/L — replace K⁺ first",
      "Target glucose fall: 50–75 mg/dL per hour",
      "Transition to SC insulin only when anion gap closed + patient eating",
    ]
  },
  {
    num: "03",
    title: "ELECTROLYTE REPLACEMENT",
    color: "117A65",
    content: [
      "K⁺ replacement: add 20–40 mEq/L to fluids when K⁺ < 5.5",
      "Phosphate: replace if < 1.0 mg/dL or symptomatic",
      "Bicarbonate: consider only if pH < 6.9 (controversial)",
      "Monitor K⁺, glucose every 1–2 hours",
    ]
  },
  {
    num: "04",
    title: "TREAT THE TRIGGER",
    color: "873600",
    content: [
      "Cultures → empiric broad-spectrum antibiotics if infection suspected",
      "Cardiology consult / ECG if ACS triggered event",
      "Insulin access assessment — social work referral",
      "Sick-day management education before discharge",
    ]
  }
];

steps.forEach((step, i) => {
  const row = Math.floor(i / 2);
  const col = i % 2;
  const bx = COL1_X + 0.25 + col * 7.4;
  const by = ROW2_Y + 0.72 + row * 5.5;

  slide.addShape(pres.ShapeType.rect, {
    x: bx, y: by, w: 7.15, h: 5.18,
    fill: { color: "12253A" }, line: { color: step.color, pt: 2 }, rounding: 0.08
  });
  // Number badge
  slide.addShape(pres.ShapeType.rect, {
    x: bx, y: by, w: 1.2, h: 0.72,
    fill: { color: step.color }, line: { color: step.color }, rounding: 0.04
  });
  slide.addText(step.num, {
    x: bx, y: by + 0.06, w: 1.2, h: 0.6,
    fontSize: 28, bold: true, color: WHITE, fontFace: "Calibri", align: "center", margin: 0
  });
  slide.addText(step.title, {
    x: bx + 1.26, y: by + 0.12, w: 5.7, h: 0.52,
    fontSize: 20, bold: true, color: step.color === "1565C0" ? SUBHEAD : step.color === "117A65" ? "#27AE60" : GOLD,
    fontFace: "Calibri", margin: 0
  });
  const contentBullets = step.content.map((t, idx) => ({
    text: t, options: { bullet: true, color: LIGHT_TXT, fontSize: 16.5, breakLine: idx < step.content.length - 1 }
  }));
  slide.addText(contentBullets, {
    x: bx + 0.2, y: by + 0.82, w: 6.8, h: 4.1,
    fontFace: "Calibri", margin: 0, paraSpaceAfter: 5
  });
});

// Monitoring strip at bottom of management card
slide.addShape(pres.ShapeType.rect, {
  x: COL1_X + 0.25, y: ROW2_Y + 11.1, w: 14.7, h: 0.48,
  fill: { color: "1A3A5C" }, line: { color: DIVIDER }
});
slide.addText("⏱  Monitor: Vitals q1h  |  Glucose q1h  |  BMP q2h  |  Reassess AMS hourly  |  Strict I&O", {
  x: COL1_X + 0.35, y: ROW2_Y + 11.14, w: 14.5, h: 0.38,
  fontSize: 16, color: GOLD, fontFace: "Calibri", align: "center", margin: 0
});

// ─── OUTCOMES (col3 area)
card(slide, COL3_X, ROW2_Y, COL_W, 11.8);
sectionHeader(slide, COL3_X, ROW2_Y, COL_W, "📊  OUTCOMES & PROGNOSIS", GREEN);

// Mortality badges
const outcomes = [
  { label: "DKA Mortality", value: "~4%", note: "With aggressive Rx", color: "1A5276" },
  { label: "HHS Mortality", value: "~20%", note: "Elderly comorbidities", color: "8E1A0E" },
];
outcomes.forEach((o, i) => {
  const ox = COL3_X + 0.2 + i * 3.65;
  const oy = ROW2_Y + 0.72;
  slide.addShape(pres.ShapeType.rect, {
    x: ox, y: oy, w: 3.4, h: 2.1,
    fill: { color: o.color }, line: { color: DIVIDER }, rounding: 0.1,
    shadow: { type: "outer", blur: 8, offset: 4, angle: 45, color: "000000", opacity: 0.4 }
  });
  slide.addText(o.value, {
    x: ox, y: oy + 0.15, w: 3.4, h: 1.1,
    fontSize: 56, bold: true, color: WHITE, fontFace: "Calibri", align: "center", margin: 0
  });
  slide.addText(o.label, {
    x: ox, y: oy + 1.18, w: 3.4, h: 0.42,
    fontSize: 18, bold: true, color: GOLD, fontFace: "Calibri", align: "center", margin: 0
  });
  slide.addText(o.note, {
    x: ox, y: oy + 1.6, w: 3.4, h: 0.35,
    fontSize: 14, color: SUBHEAD, fontFace: "Calibri", align: "center", margin: 0
  });
});

// Adverse outcomes
slide.addText("Complications & Adverse Outcomes", {
  x: COL3_X + 0.18, y: ROW2_Y + 3.05, w: COL_W - 0.36, h: 0.38,
  fontSize: 19, bold: true, color: SUBHEAD, fontFace: "Calibri", margin: 0
});
const compItems = [
  { txt: "Cerebral oedema", sub: " — most feared in children; monitor Na⁺ closely" },
  { txt: "Hypokalaemia", sub: " — post-insulin; fatal arrhythmias if untreated" },
  { txt: "Hypoglycaemia", sub: " — over-treatment; switch fluids at glucose 200–250" },
  { txt: "Acute kidney injury", sub: " — from dehydration/haemodynamic compromise" },
  { txt: "Aspiration pneumonia", sub: " — obtunded patients; NGT if needed" },
  { txt: "ARDS / pulmonary oedema", sub: " — overly aggressive fluid resuscitation" },
  { txt: "Thromboembolism", sub: " — hyperviscosity + immobility; prophylaxis" },
];
const compBullets = compItems.map((item, idx) => ({
  text: [
    { text: item.txt, options: { bold: true, color: GOLD } },
    { text: item.sub }
  ],
  options: { bullet: true, color: LIGHT_TXT, fontSize: 15.5, breakLine: idx < compItems.length - 1 }
}));
// Flatten for addText rich text
const compFlat = [];
compItems.forEach((item, idx) => {
  compFlat.push({ text: "• ", options: { color: GOLD, fontSize: 15.5 } });
  compFlat.push({ text: item.txt, options: { bold: true, color: GOLD, fontSize: 15.5 } });
  compFlat.push({ text: item.sub + (idx < compItems.length - 1 ? "\n" : ""), options: { color: LIGHT_TXT, fontSize: 15.5 } });
});
slide.addText(compFlat, {
  x: COL3_X + 0.18, y: ROW2_Y + 3.5, w: COL_W - 0.36, h: 4.2,
  fontFace: "Calibri", margin: 0, paraSpaceAfter: 4
});

// Mortality risk factors
slide.addText("Predictors of Poor Outcome", {
  x: COL3_X + 0.18, y: ROW2_Y + 7.82, w: COL_W - 0.36, h: 0.38,
  fontSize: 19, bold: true, color: SUBHEAD, fontFace: "Calibri", margin: 0
});
const poorOutcome = [
  "Extremes of age (very young / elderly)",
  "Severe comorbidities (CKD, HF, malignancy)",
  "Severity of precipitating illness (sepsis, ACS)",
  "Delayed diagnosis / delayed treatment initiation",
  "Initial pH < 7.0 or bicarbonate < 5 mEq/L",
  "Altered mental status / deep coma on presentation",
];
const poorBullets = poorOutcome.map((t, i) => ({
  text: t, options: { bullet: true, color: LIGHT_TXT, fontSize: 15, breakLine: i < poorOutcome.length - 1 }
}));
slide.addText(poorBullets, {
  x: COL3_X + 0.18, y: ROW2_Y + 8.26, w: COL_W - 0.36, h: 2.9,
  fontFace: "Calibri", margin: 0, paraSpaceAfter: 3
});

// Discharge criteria strip
slide.addShape(pres.ShapeType.rect, {
  x: COL3_X + 0.18, y: ROW2_Y + 11.1, w: COL_W - 0.36, h: 0.48,
  fill: { color: "1A3A5C" }, line: { color: DIVIDER }
});
slide.addText("✅  Discharge: pH > 7.3  |  AG closed  |  Tolerating PO  |  SC insulin established", {
  x: COL3_X + 0.28, y: ROW2_Y + 11.14, w: COL_W - 0.56, h: 0.38,
  fontSize: 15, color: GREEN, fontFace: "Calibri", align: "center", margin: 0
});

// ── ROW 3: Prevention & Key Takeaways ─────────────────────────
const ROW3_Y = 26.1;

card(slide, COL1_X, ROW3_Y, COL_W * 1.5 + 0.4, 4.8);
sectionHeader(slide, COL1_X, ROW3_Y, COL_W * 1.5 + 0.4, "🛡  PREVENTION & EDUCATION", "117A65");

const prevItems = [
  ["Sick-day rules", "Continue insulin even when unable to eat; increase monitoring frequency"],
  ["Insulin access", "Address cost/access barriers proactively; pen devices for adherence"],
  ["Early warning signs", "Educate patients: nausea + polyuria + hyperglycaemia = check ketones"],
  ["Technology", "CGM + insulin pumps reduce DKA rates in T1DM; pump occlusion awareness"],
  ["Mental health", "Screen for eating disorders, depression — major drivers of insulin omission"],
  ["Transition care", "Adolescents transitioning to adult services are highest-risk period"],
];
const prevBullets = [];
prevItems.forEach((item, idx) => {
  prevBullets.push({ text: item[0] + ": ", options: { bold: true, color: GOLD, fontSize: 16 } });
  prevBullets.push({ text: item[1] + (idx < prevItems.length - 1 ? "\n" : ""), options: { color: LIGHT_TXT, fontSize: 15.5 } });
});
slide.addText(prevBullets, {
  x: COL1_X + 0.2, y: ROW3_Y + 0.62, w: (COL_W * 1.5 + 0.4) - 0.4, h: 3.9,
  fontFace: "Calibri", margin: 0, paraSpaceAfter: 4
});

// Key takeaways box
card(slide, COL1_X + COL_W * 1.5 + 0.7, ROW3_Y, COL_W * 1.5 + 0.4 - 0.2, 4.8);
sectionHeader(slide, COL1_X + COL_W * 1.5 + 0.7, ROW3_Y, COL_W * 1.5 + 0.4 - 0.2, "💡  KEY TAKEAWAYS", GOLD.slice(0));

const ktkx = COL1_X + COL_W * 1.5 + 0.7;
const keyTakes = [
  "Non-compliance is the #1 modifiable trigger — address social determinants",
  "Infection raises counter-regulatory hormones → always search for source",
  "25% of DKA = first presentation of diabetes — educate + ensure follow-up",
  "Never delay K⁺ replacement; do NOT start insulin if K⁺ < 3.5",
  "DKA mortality ~4% — worsens with age, comorbidities, severe acidosis",
  "Discharge only when anion gap closed + SC insulin established + eating",
];
const ktBullets = keyTakes.map((t, i) => ({
  text: t, options: { bullet: true, color: LIGHT_TXT, fontSize: 16, breakLine: i < keyTakes.length - 1 }
}));
slide.addText(ktBullets, {
  x: ktkx + 0.2, y: ROW3_Y + 0.62, w: (COL_W * 1.5 + 0.4 - 0.2) - 0.4, h: 3.9,
  fontFace: "Calibri", margin: 0, paraSpaceAfter: 4
});

// ── BOTTOM FOOTER ──────────────────────────────────────────────
slide.addShape(pres.ShapeType.rect, {
  x: 0, y: 35.4, w: 24, h: 0.6,
  fill: { color: "0A1628" }, line: { color: "0A1628" }
});
slide.addShape(pres.ShapeType.rect, {
  x: 0, y: 35.78, w: 24, h: 0.22,
  fill: { color: ACCENT }, line: { color: ACCENT }
});
slide.addText(
  "Sources: Goldman-Cecil Medicine 26e (Table 210-11, pp.2483-2485)  |  Rosen's Emergency Medicine 10e (pp.2542-2548)  |  ADA DKA Guidelines  |  ISPAD Clinical Practice Consensus Guidelines",
  {
    x: 0.4, y: 35.42, w: 23.2, h: 0.34,
    fontSize: 12, color: SUBHEAD, fontFace: "Calibri", align: "center", margin: 0
  }
);

// ── Save ───────────────────────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/workspace/eposter/DKA_Triggers_Outcomes_Poster.pptx" })
  .then(() => console.log("Poster saved."))
  .catch(e => console.error(e));
Running Command

cd /home/daytona/workspace/eposter && node dka_poster.js 2>&1

Running Command

ls -lh /home/daytona/workspace/eposter/

Your poster is ready! Here is the download link:

DKA Triggers Outcomes Poster

Presentation · PPTX


What's in the poster

The file is a portrait A0-sized slide (24" × 36") built for conference printing or digital display. Here is the layout:
Design:
  • Deep navy background with red-orange accent stripe, gold highlights, and colour-coded section headers
  • Structured in 3 columns across 3 rows for easy reading flow
Content sections:
SectionContent
PathophysiologyTriad (hyperglycaemia/ketosis/acidosis), mechanism — lipolysis → ketogenesis → osmotic diuresis, average fluid/electrolyte deficits
Triggers / PrecipitantsThree dedicated cards: Non-Compliance (insulin omission, cost barriers, pump failure), Infection (UTI/pneumonia, counter-regulatory surge, COVID-DKA), First Presentation (~25% of DKA episodes); plus a secondary strip for drugs, ACS, PE, pancreatitis, SGLT-2i
Clinical Features & DiagnosisSymptoms and signs, ADA severity classification table (mild/moderate/severe by pH, HCO₃, sensorium), key labs checklist
Management4 step-cards: Fluids → Insulin → Electrolytes → Treat the trigger; monitoring strip at bottom
Outcomes & PrognosisDKA mortality ~4% vs HHS ~20%, complications (cerebral oedema, hypokalaemia, AKI, ARDS), predictors of poor outcome, discharge criteria
PreventionSick-day rules, insulin access, CGM/pump technology, mental health screening, transition-care risk
Key Takeaways6 high-yield clinical pearls
Sources cited: Goldman-Cecil Medicine 26e, Rosen's Emergency Medicine 10e, ADA/ISPAD guidelines.
This is a shared conversation. Sign in to Orris to start your own chat.