~/dm-presentation/create_pptx.js
const pptxgen = require("pptxgenjs");
const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.author = "Medical Education";
pres.title = "Diabetes Mellitus: Management Algorithms & Drug Selection";
// ─────────────────────────────────────────────
// COLOR PALETTE
// Deep medical teal dominant + navy accent + amber highlight
// ─────────────────────────────────────────────
const C = {
navy: "0D2B45", // deep navy – title/section backgrounds
teal: "0E7C7B", // primary teal
tealDk: "085E5D", // darker teal
tealLt: "E0F4F4", // very light teal background
amber: "F4A621", // accent / highlights
amberLt: "FEF3DC", // light amber fill
white: "FFFFFF",
offWht: "F7FAFA",
gray1: "334155", // dark text
gray2: "64748B", // subtitle / secondary text
gray3: "CBD5E1", // divider lines
red: "C0392B", // danger/DKA
green: "1A7A4A", // benefit
purple: "6C3483", // T1DM color
orange: "D35400", // T2DM color
};
// ─────────────────────────────────────────────
// HELPER FUNCTIONS
// ─────────────────────────────────────────────
function addSectionHeader(slide, text, color = C.teal) {
slide.addShape(pres.ShapeType.rect, {
x: 0, y: 0, w: 10, h: 0.55,
fill: { color },
line: { color, width: 0 }
});
slide.addText(text, {
x: 0.3, y: 0, w: 9.4, h: 0.55,
fontSize: 11, bold: true, color: C.white,
valign: "middle", fontFace: "Calibri"
});
}
function addSlideTitle(slide, title, subtitle = "") {
slide.addText(title, {
x: 0.4, y: 0.62, w: 9.2, h: 0.7,
fontSize: 22, bold: true, color: C.navy,
fontFace: "Calibri", margin: 0
});
if (subtitle) {
slide.addShape(pres.ShapeType.rect, {
x: 0.4, y: 1.3, w: 1.0, h: 0.045,
fill: { color: C.amber }, line: { color: C.amber }
});
slide.addText(subtitle, {
x: 0.4, y: 1.35, w: 9.2, h: 0.3,
fontSize: 11, color: C.gray2, italic: true, fontFace: "Calibri"
});
}
}
function card(slide, x, y, w, h, headerText, headerColor, bodyLines, bodyFontSize = 9.5) {
// Card shadow (offset rect)
slide.addShape(pres.ShapeType.rect, {
x: x + 0.04, y: y + 0.04, w, h,
fill: { color: "C8D6D6" }, line: { color: "C8D6D6" },
shadow: { type: "none" }
});
// Card body
slide.addShape(pres.ShapeType.rect, {
x, y, w, h,
fill: { color: C.white },
line: { color: C.gray3, pt: 1 }
});
// Card header
slide.addShape(pres.ShapeType.rect, {
x, y, w, h: 0.3,
fill: { color: headerColor },
line: { color: headerColor }
});
slide.addText(headerText, {
x: x + 0.08, y, w: w - 0.1, h: 0.3,
fontSize: 9.5, bold: true, color: C.white,
valign: "middle", fontFace: "Calibri", margin: 0
});
// Card body text
slide.addText(
bodyLines.map((line, i) => ({
text: line,
options: { bullet: { type: "bullet", indent: 10 }, breakLine: i < bodyLines.length - 1, fontSize: bodyFontSize, color: C.gray1, fontFace: "Calibri" }
})),
{ x: x + 0.1, y: y + 0.32, w: w - 0.2, h: h - 0.38, valign: "top" }
);
}
// ─────────────────────────────────────────────
// SLIDE 1 – TITLE
// ─────────────────────────────────────────────
{
const s = pres.addSlide();
s.background = { color: C.navy };
// Left accent bar
s.addShape(pres.ShapeType.rect, {
x: 0, y: 0, w: 0.18, h: 5.625,
fill: { color: C.teal }, line: { color: C.teal }
});
// Amber accent bar
s.addShape(pres.ShapeType.rect, {
x: 0.18, y: 0, w: 0.06, h: 5.625,
fill: { color: C.amber }, line: { color: C.amber }
});
// Large background text watermark
s.addText("DM", {
x: 5.5, y: 0.2, w: 4.2, h: 4.5,
fontSize: 240, color: "122F46", bold: true, fontFace: "Calibri",
transparency: 70, align: "center"
});
// Main title
s.addText("Diabetes Mellitus", {
x: 0.6, y: 1.0, w: 8.5, h: 0.9,
fontSize: 42, bold: true, color: C.white,
fontFace: "Calibri", margin: 0
});
s.addText("Management Algorithms & Drug Selection Criteria", {
x: 0.6, y: 1.95, w: 8.5, h: 0.55,
fontSize: 20, color: C.amber, fontFace: "Calibri",
bold: false, margin: 0
});
// Divider
s.addShape(pres.ShapeType.rect, {
x: 0.6, y: 2.6, w: 5.5, h: 0.04,
fill: { color: C.teal }, line: { color: C.teal }
});
// Subtitle bullets
s.addText([
{ text: "ADA/EASD 2024 Standards of Care", options: { breakLine: true } },
{ text: "Evidence-based pharmacotherapy by patient profile", options: { breakLine: true } },
{ text: "T1DM • T2DM • Special Populations • Acute Complications", options: {} }
], {
x: 0.6, y: 2.75, w: 8, h: 1.4,
fontSize: 13, color: "A0C4C4", fontFace: "Calibri"
});
// Footer
s.addText("Sources: Harrison's 22e • Goldman-Cecil Medicine • Goodman & Gilman's 13e", {
x: 0.6, y: 5.1, w: 9, h: 0.35,
fontSize: 8, color: "486E7A", fontFace: "Calibri", italic: true
});
}
// ─────────────────────────────────────────────
// SLIDE 2 – AGENDA / OVERVIEW
// ─────────────────────────────────────────────
{
const s = pres.addSlide();
s.background = { color: C.offWht };
addSectionHeader(s, "OVERVIEW", C.navy);
addSlideTitle(s, "What This Presentation Covers", "Evidence-based management of diabetes from diagnosis to advanced therapy");
const items = [
["01", "Diagnostic Thresholds & Glycemic Targets", C.teal],
["02", "T2DM Stepwise Treatment Algorithm", C.orange],
["03", "Drug Class Selection by Patient Profile", C.teal],
["04", "Insulin Therapy – Types & Regimens", C.purple],
["05", "T1DM Management Algorithm", C.purple],
["06", "Cardiovascular & Renal Drug Selection", C.green],
["07", "Special Populations", C.tealDk],
["08", "Acute Complications – DKA & HHS", C.red],
["09", "Monitoring & Treatment Targets", C.navy],
];
items.forEach(([num, label, color], i) => {
const col = i < 5 ? 0 : 1;
const row = i < 5 ? i : i - 5;
const x = 0.4 + col * 4.9;
const y = 1.72 + row * 0.72;
s.addShape(pres.ShapeType.rect, {
x, y, w: 0.42, h: 0.42,
fill: { color }, line: { color }
});
s.addText(num, {
x, y, w: 0.42, h: 0.42,
fontSize: 14, bold: true, color: C.white,
align: "center", valign: "middle", fontFace: "Calibri", margin: 0
});
s.addText(label, {
x: x + 0.5, y: y + 0.03, w: 4.2, h: 0.38,
fontSize: 12, color: C.gray1, fontFace: "Calibri",
valign: "middle"
});
});
}
// ─────────────────────────────────────────────
// SLIDE 3 – DIAGNOSTIC THRESHOLDS & TARGETS
// ─────────────────────────────────────────────
{
const s = pres.addSlide();
s.background = { color: C.offWht };
addSectionHeader(s, "01 DIAGNOSIS & GLYCEMIC TARGETS", C.teal);
addSlideTitle(s, "Diagnostic Criteria & Treatment Targets", "ADA/WHO 2024 — confirmation required by repeat testing in asymptomatic patients");
// Diagnostic table
s.addText("DIAGNOSTIC CRITERIA", {
x: 0.4, y: 1.62, w: 5.5, h: 0.28,
fontSize: 10, bold: true, color: C.teal, fontFace: "Calibri",
charSpacing: 1.5, margin: 0
});
const diagRows = [
[
{ text: "Test", options: { bold: true, color: C.white, fill: { color: C.tealDk } } },
{ text: "Normal", options: { bold: true, color: C.white, fill: { color: C.tealDk } } },
{ text: "Prediabetes", options: { bold: true, color: C.white, fill: { color: C.tealDk } } },
{ text: "Diabetes", options: { bold: true, color: C.white, fill: { color: C.tealDk } } }
],
["Fasting Plasma Glucose", "< 100 mg/dL", "100–125 mg/dL", "≥ 126 mg/dL"],
["2-h OGTT (75 g)", "< 140 mg/dL", "140–199 mg/dL", "≥ 200 mg/dL"],
["HbA1c", "< 5.7%", "5.7–6.4%", "≥ 6.5%"],
["Random Glucose + Symptoms", "—", "—", "≥ 200 mg/dL"],
];
s.addTable(diagRows, {
x: 0.4, y: 1.95, w: 5.5,
colW: [1.8, 1.1, 1.1, 1.1],
border: { pt: 0.5, color: C.gray3 },
rowH: 0.32,
fontFace: "Calibri",
fontSize: 9,
color: C.gray1,
fill: { color: C.white },
autoPage: false,
});
// Alternating row shading — add light rect behind rows 2, 4
[2, 4].forEach(r => {
s.addShape(pres.ShapeType.rect, {
x: 0.4, y: 1.95 + r * 0.32, w: 5.5, h: 0.32,
fill: { color: "EBF5F5" }, line: { color: "EBF5F5" }
});
});
// Re-add table on top (z-order)
// Glycemic targets box
s.addText("GLYCEMIC TARGETS (ADULTS — ADA 2024)", {
x: 6.2, y: 1.62, w: 3.5, h: 0.28,
fontSize: 10, bold: true, color: C.amber, fontFace: "Calibri",
charSpacing: 1, margin: 0
});
const targets = [
["HbA1c", "< 7.0% (most adults)"],
["HbA1c (tight)", "< 6.5% (if safe, no hypoglycemia)"],
["HbA1c (relaxed)", "< 8.0% (elderly/frail/comorbid)"],
["Fasting / preprandial","80–130 mg/dL"],
["Peak postprandial", "< 180 mg/dL"],
["BP target", "< 130/80 mmHg"],
["LDL (high CV risk)", "< 70 mg/dL"],
["Time In Range (TIR)", "> 70% (70–180 mg/dL)"],
["Time Below Range", "< 4% (< 70 mg/dL)"],
];
targets.forEach(([label, val], i) => {
const y = 1.95 + i * 0.34;
s.addShape(pres.ShapeType.rect, {
x: 6.2, y, w: 3.5, h: 0.32,
fill: { color: i % 2 === 0 ? C.amberLt : C.white },
line: { color: C.gray3, pt: 0.5 }
});
s.addText([
{ text: label + ": ", options: { bold: true, color: C.navy } },
{ text: val, options: { color: C.gray1 } }
], {
x: 6.3, y: y + 0.02, w: 3.3, h: 0.28,
fontSize: 9, fontFace: "Calibri", valign: "middle"
});
});
}
// ─────────────────────────────────────────────
// SLIDE 4 – T2DM STEPWISE ALGORITHM
// ─────────────────────────────────────────────
{
const s = pres.addSlide();
s.background = { color: C.offWht };
addSectionHeader(s, "02 T2DM TREATMENT ALGORITHM", C.orange);
addSlideTitle(s, "Stepwise Pharmacotherapy — Type 2 Diabetes", "Individualized approach; reassess every 3 months until HbA1c at target");
// Step boxes with arrows
const steps = [
{ step: "STEP 1", label: "Lifestyle + Metformin", sub: "Unless contraindicated (eGFR < 30)\nDiet • Exercise • Weight loss", color: C.teal },
{ step: "STEP 2", label: "Add 2nd Agent", sub: "Choose by patient profile\n(see Drug Selection slide)", color: C.orange },
{ step: "STEP 3", label: "Add 3rd Agent", sub: "Triple therapy or\nswitch to injectable", color: C.purple },
{ step: "STEP 4", label: "Insulin Therapy", sub: "Basal → Basal-Bolus\nwhen oral agents insufficient", color: C.navy },
];
steps.forEach((step, i) => {
const x = 0.3 + i * 2.38;
// Arrow between boxes
if (i > 0) {
s.addShape(pres.ShapeType.rect, {
x: x - 0.28, y: 2.35, w: 0.28, h: 0.05,
fill: { color: C.gray2 }, line: { color: C.gray2 }
});
s.addText("▶", {
x: x - 0.28, y: 2.24, w: 0.28, h: 0.27,
fontSize: 12, color: C.gray2, align: "right", margin: 0, fontFace: "Calibri"
});
}
// Box
s.addShape(pres.ShapeType.rect, {
x, y: 1.75, w: 2.1, h: 0.35,
fill: { color: step.color }, line: { color: step.color }
});
s.addText(step.step, {
x, y: 1.75, w: 2.1, h: 0.35,
fontSize: 11, bold: true, color: C.white,
align: "center", valign: "middle", fontFace: "Calibri", margin: 0
});
s.addShape(pres.ShapeType.rect, {
x, y: 2.1, w: 2.1, h: 1.3,
fill: { color: C.white }, line: { color: step.color, pt: 1.5 }
});
s.addText(step.label, {
x: x + 0.1, y: 2.14, w: 1.9, h: 0.35,
fontSize: 10, bold: true, color: step.color, fontFace: "Calibri", margin: 0
});
s.addText(step.sub, {
x: x + 0.1, y: 2.5, w: 1.9, h: 0.85,
fontSize: 9, color: C.gray1, fontFace: "Calibri", valign: "top"
});
});
// Key decision factors
s.addText("KEY DECISION FACTORS FOR STEP 2 AGENT SELECTION", {
x: 0.3, y: 3.55, w: 9.4, h: 0.28,
fontSize: 10, bold: true, color: C.teal, fontFace: "Calibri",
charSpacing: 1.5, margin: 0
});
const decisionCards = [
{ label: "CVD / High ASCVD Risk", agents: "GLP-1 RA or SGLT-2i", color: C.red },
{ label: "Heart Failure (HFrEF/HFpEF)", agents: "SGLT-2 inhibitor", color: C.purple },
{ label: "Chronic Kidney Disease", agents: "SGLT-2i + ACE/ARB", color: C.tealDk },
{ label: "Weight Loss Priority", agents: "GLP-1 RA (semaglutide)", color: C.orange },
{ label: "Minimize Hypoglycemia", agents: "DPP-4i / GLP-1 RA / SGLT-2i", color: C.green },
{ label: "Cost-Sensitive Patient", agents: "Sulfonylurea / Pioglitazone", color: C.gray2 },
];
decisionCards.forEach((dc, i) => {
const col = i % 3;
const row = Math.floor(i / 3);
const x = 0.3 + col * 3.2;
const y = 3.9 + row * 0.78;
s.addShape(pres.ShapeType.rect, {
x, y, w: 3.05, h: 0.7,
fill: { color: C.white }, line: { color: dc.color, pt: 1.5 }
});
s.addShape(pres.ShapeType.rect, {
x, y, w: 0.12, h: 0.7,
fill: { color: dc.color }, line: { color: dc.color }
});
s.addText(dc.label, {
x: x + 0.2, y: y + 0.04, w: 2.8, h: 0.3,
fontSize: 9.5, bold: true, color: C.navy, fontFace: "Calibri", margin: 0
});
s.addText("→ " + dc.agents, {
x: x + 0.2, y: y + 0.36, w: 2.8, h: 0.28,
fontSize: 9, color: dc.color, fontFace: "Calibri", bold: true, margin: 0
});
});
}
// ─────────────────────────────────────────────
// SLIDE 5 – DRUG CLASS PROFILES
// ─────────────────────────────────────────────
{
const s = pres.addSlide();
s.background = { color: C.offWht };
addSectionHeader(s, "03 DRUG CLASS SELECTION CRITERIA", C.teal);
addSlideTitle(s, "Non-Insulin Antidiabetic Drug Classes", "Mechanism, benefits, risks, and contraindications at a glance");
// Table header
const headerRow = [
{ text: "Drug Class", options: { bold: true, color: C.white, fill: { color: C.navy } } },
{ text: "Mechanism", options: { bold: true, color: C.white, fill: { color: C.navy } } },
{ text: "Key Benefits", options: { bold: true, color: C.white, fill: { color: C.navy } } },
{ text: "Main Risks", options: { bold: true, color: C.white, fill: { color: C.navy } } },
{ text: "Contraindications", options: { bold: true, color: C.white, fill: { color: C.navy } } },
];
const rows = [
[
{ text: "Metformin\n(Biguanide)", options: { bold: true, color: C.teal } },
"↓ Hepatic gluconeogenesis\n(AMPK activation)",
"✓ No hypoglycemia\n✓ Weight neutral/loss\n✓ Cardioprotective\n✓ Inexpensive",
"GI side effects\nVitamin B12 ↓\nLactic acidosis (rare)",
"eGFR < 30\nContrast/surgery\nSevere hepatic failure"
],
[
{ text: "Sulfonylureas\n(Glipizide, Glimepiride)", options: { bold: true, color: C.orange } },
"KATP channel closure\n→ insulin secretion\n(glucose-independent)",
"✓ Potent ↓ glucose\n✓ Very inexpensive\n✓ Oral, once daily",
"Hypoglycemia ⚠\nWeight gain 1–3 kg\nSecondary failure",
"T1DM, renal/hepatic\nfailure, pregnancy"
],
[
{ text: "GLP-1 RA\n(Semaglutide, Lira)", options: { bold: true, color: C.green } },
"GLP-1 receptor agonist\n→ glucose-dependent insulin\n↑ Satiety, ↓ gastric emptying",
"✓ Weight loss (5–15%)\n✓ CV benefit (LEADER)\n✓ No hypoglycemia\n✓ Weekly dosing",
"Nausea/vomiting\nPancreatitis (rare)\nC-cell thyroid tumors\n(animal data)",
"MEN-2 / medullary\nthyroid carcinoma,\npregnancy"
],
[
{ text: "SGLT-2i\n(Empagliflozin, Dapa)", options: { bold: true, color: C.purple } },
"Inhibit renal glucose\nreabsorption → glycosuria\n(~60–80 g/day)",
"✓ Weight loss\n✓ BP ↓\n✓ CV benefit (EMPA-REG)\n✓ Renoprotective\n✓ HF benefit",
"Genital mycosis\nUTI, volume depletion\nEuglycemic DKA\nFournier's gangrene",
"eGFR < 20–30\nDKA risk in T1DM\nHold perioperatively"
],
[
{ text: "DPP-4i\n(Sitagliptin, Lina)", options: { bold: true, color: C.tealDk } },
"Inhibit DPP-4 enzyme\n→ ↑ endogenous GLP-1\n→ modest insulin ↑",
"✓ Weight neutral\n✓ No hypoglycemia\n✓ Oral, well-tolerated\n✓ Renal-dose adjustable",
"Nasopharyngitis\nUTI\nPancreatitis (rare)\nHF risk (saxagliptin)",
"Pancreatitis history\n(relative)"
],
[
{ text: "TZDs\n(Pioglitazone)", options: { bold: true, color: C.gray2 } },
"PPARγ agonist\n→ adipose insulin sensitivity\n→ ↑ adiponectin",
"✓ No hypoglycemia\n✓ Durable effect\n✓ Modest CV benefit\n(PROACTIVE)",
"Weight gain 2–4 kg\nEdema/CHF ↑\nBone fractures ↑\nBladder cancer (piogl.)",
"CHF (NYHA III/IV)\nActive bladder cancer\nOsteoporosis"
],
];
const tableData = [headerRow, ...rows];
s.addTable(tableData, {
x: 0.2, y: 1.68, w: 9.6,
colW: [1.35, 1.9, 2.0, 1.9, 2.05],
border: { pt: 0.5, color: C.gray3 },
rowH: 0.52,
fontFace: "Calibri",
fontSize: 8.2,
color: C.gray1,
fill: { color: C.white },
autoPage: false,
});
}
// ─────────────────────────────────────────────
// SLIDE 6 – INSULIN TYPES & REGIMENS
// ─────────────────────────────────────────────
{
const s = pres.addSlide();
s.background = { color: C.offWht };
addSectionHeader(s, "04 INSULIN THERAPY", C.purple);
addSlideTitle(s, "Insulin Pharmacokinetics & Clinical Regimens", "Select by patient need: T1DM requires basal-bolus; T2DM often basal-only initially");
// Insulin table
s.addText("INSULIN PREPARATIONS", {
x: 0.3, y: 1.62, w: 5.8, h: 0.25,
fontSize: 9.5, bold: true, color: C.purple, fontFace: "Calibri",
charSpacing: 1.5, margin: 0
});
const insulinHeader = [
{ text: "Type", options: { bold: true, color: C.white, fill: { color: C.purple } } },
{ text: "Onset", options: { bold: true, color: C.white, fill: { color: C.purple } } },
{ text: "Peak", options: { bold: true, color: C.white, fill: { color: C.purple } } },
{ text: "Duration", options: { bold: true, color: C.white, fill: { color: C.purple } } },
{ text: "Examples", options: { bold: true, color: C.white, fill: { color: C.purple } } },
];
const insulinRows = [
["Rapid-acting analog", "10–30 min", "30–90 min", "3–5 h", "Lispro, Aspart, Glulisine"],
["Short-acting (Regular)", "30–60 min", "2–3 h", "6–10 h", "Humulin R, Novolin R"],
["Intermediate (NPH)", "1–2 h", "4–10 h", "14–20 h", "NPH (Humulin N)"],
["Long-acting basal", "1–2 h", "Peakless", "20–26 h", "Glargine (U-100/300), Detemir"],
["Ultra-long-acting", "1–2 h", "Peakless", "> 42 h", "Degludec (Tresiba)"],
["Premixed", "Varies", "Biphasic", "10–20 h", "70/30 NPH/Regular, 75/25"],
];
s.addTable([insulinHeader, ...insulinRows], {
x: 0.3, y: 1.92, w: 5.8,
colW: [1.5, 0.9, 0.9, 0.9, 1.6],
border: { pt: 0.5, color: C.gray3 },
rowH: 0.3,
fontFace: "Calibri", fontSize: 8.5, color: C.gray1,
fill: { color: C.white }, autoPage: false
});
// Regimen cards
s.addText("INSULIN REGIMENS", {
x: 6.4, y: 1.62, w: 3.3, h: 0.25,
fontSize: 9.5, bold: true, color: C.purple, fontFace: "Calibri",
charSpacing: 1.5, margin: 0
});
const regimens = [
{
name: "Basal-Only (T2DM start)",
lines: ["Bedtime long-acting (glargine/degludec)", "Start 10 units; titrate by FPG", "Titrate by 2 u every 3 days to FPG 80–130", "Add prandial if HbA1c still above target"],
color: C.teal
},
{
name: "Basal-Bolus (T1DM / Advanced T2DM)",
lines: ["Long-acting basal once daily", "Rapid-acting with each meal (carb-count)", "TDD: 0.5–1.0 u/kg/day (50% basal / 50% bolus)", "Adjust by pre-meal SMBG or CGM data"],
color: C.purple
},
{
name: "Insulin Pump (CSII)",
lines: ["Continuous SC infusion of rapid-acting insulin", "Programmable basal rates + manual boluses", "Closed-loop (hybrid APS) with CGM: best TIR", "Preferred for T1DM with hypoglycemia unawareness"],
color: C.navy
},
];
regimens.forEach((r, i) => {
const y = 1.92 + i * 1.12;
s.addShape(pres.ShapeType.rect, {
x: 6.4, y, w: 3.35, h: 1.05,
fill: { color: C.white }, line: { color: r.color, pt: 1.5 }
});
s.addShape(pres.ShapeType.rect, {
x: 6.4, y, w: 3.35, h: 0.28,
fill: { color: r.color }, line: { color: r.color }
});
s.addText(r.name, {
x: 6.5, y, w: 3.2, h: 0.28,
fontSize: 9, bold: true, color: C.white,
valign: "middle", fontFace: "Calibri", margin: 0
});
s.addText(
r.lines.map((l, li) => ({
text: l,
options: { bullet: { type: "bullet" }, breakLine: li < r.lines.length - 1, fontSize: 8, color: C.gray1, fontFace: "Calibri" }
})),
{ x: 6.5, y: y + 0.3, w: 3.2, h: 0.72, valign: "top" }
);
});
// Sick-day / correction rule box
s.addShape(pres.ShapeType.rect, {
x: 0.3, y: 4.05, w: 5.8, h: 1.3,
fill: { color: "F3EEF8" }, line: { color: C.purple, pt: 1 }
});
s.addText("⚠ INSULIN SAFETY PEARLS", {
x: 0.4, y: 4.08, w: 5.6, h: 0.28,
fontSize: 9.5, bold: true, color: C.purple, fontFace: "Calibri", margin: 0
});
s.addText([
{ text: "Always check K⁺ before starting insulin infusion in DKA (hold if K⁺ < 3.5) • ", options: { color: C.red } },
{ text: "Never mix glargine/degludec with other insulins • ", options: { color: C.gray1 } },
{ text: "Correction factor = 1800/TDD (regular insulin) or 1700/TDD (analogs) • ", options: { color: C.gray1 } },
{ text: "Weight gain and hypoglycemia are the main adverse effects — individualize targets for elderly/brittle patients", options: { color: C.gray1 } }
], {
x: 0.4, y: 4.38, w: 5.6, h: 0.9,
fontSize: 8.5, fontFace: "Calibri", valign: "top"
});
}
// ─────────────────────────────────────────────
// SLIDE 7 – CV & RENAL DRUG SELECTION
// ─────────────────────────────────────────────
{
const s = pres.addSlide();
s.background = { color: C.offWht };
addSectionHeader(s, "06 CARDIOVASCULAR & RENAL DRUG SELECTION", C.green);
addSlideTitle(s, "Evidence-Based Drug Choice by Comorbidity", "Major CVOT trials drive preferential use of GLP-1 RA and SGLT-2i");
// Two columns: SGLT-2i and GLP-1 RA evidence
// SGLT-2i column
s.addShape(pres.ShapeType.rect, {
x: 0.3, y: 1.68, w: 4.55, h: 3.7,
fill: { color: C.white }, line: { color: C.purple, pt: 1.5 }
});
s.addShape(pres.ShapeType.rect, {
x: 0.3, y: 1.68, w: 4.55, h: 0.38,
fill: { color: C.purple }, line: { color: C.purple }
});
s.addText("SGLT-2 INHIBITORS", {
x: 0.4, y: 1.68, w: 4.3, h: 0.38,
fontSize: 12, bold: true, color: C.white,
valign: "middle", fontFace: "Calibri", margin: 0
});
const sglt2Evidence = [
["EMPA-REG OUTCOME (2015)", "Empagliflozin", "CV death ↓ 38%, HHF ↓ 35%,\nAll-cause mortality ↓ 32%"],
["CANVAS Program (2017)", "Canagliflozin", "MACE ↓ 14%\n(↑ amputation risk noted)"],
["DECLARE-TIMI 58 (2019)", "Dapagliflozin", "HF hospitalization ↓ 27%,\nrenal composite ↓ 24%"],
["CREDENCE (2019)", "Canagliflozin", "Renal failure/ESRD ↓ 34%\n(CKD with albuminuria)"],
["DAPA-CKD (2020)", "Dapagliflozin", "Sustained eGFR decline ↓ 44%\n(CKD, with or without T2DM)"],
["EMPEROR-Reduced (2020)", "Empagliflozin", "CV death + HHF ↓ 25%\n(HFrEF, regardless of DM)"],
];
sglt2Evidence.forEach(([trial, drug, result], i) => {
const y = 2.1 + i * 0.52;
s.addShape(pres.ShapeType.rect, {
x: 0.4, y, w: 4.3, h: 0.48,
fill: { color: i % 2 === 0 ? "F3EEF8" : C.white },
line: { color: C.gray3, pt: 0.5 }
});
s.addText([
{ text: trial + " — ", options: { bold: true, color: C.purple } },
{ text: drug, options: { italic: true, color: C.gray1 } }
], { x: 0.5, y: y + 0.02, w: 4.1, h: 0.2, fontSize: 8.5, fontFace: "Calibri", margin: 0 });
s.addText(result, { x: 0.5, y: y + 0.24, w: 4.1, h: 0.22, fontSize: 8, color: C.green, fontFace: "Calibri", margin: 0 });
});
// GLP-1 RA column
s.addShape(pres.ShapeType.rect, {
x: 5.1, y: 1.68, w: 4.55, h: 3.7,
fill: { color: C.white }, line: { color: C.green, pt: 1.5 }
});
s.addShape(pres.ShapeType.rect, {
x: 5.1, y: 1.68, w: 4.55, h: 0.38,
fill: { color: C.green }, line: { color: C.green }
});
s.addText("GLP-1 RECEPTOR AGONISTS", {
x: 5.2, y: 1.68, w: 4.3, h: 0.38,
fontSize: 12, bold: true, color: C.white,
valign: "middle", fontFace: "Calibri", margin: 0
});
const glp1Evidence = [
["LEADER (2016)", "Liraglutide", "MACE ↓ 13%, CV death ↓ 22%\nAll-cause mortality ↓ 15%"],
["SUSTAIN-6 (2016)", "Semaglutide SC", "MACE ↓ 26%\n(non-fatal stroke ↓ 39%)"],
["EXSCEL (2017)", "Exenatide QW", "Non-inferior for MACE\n(HR 0.91, p=0.06)"],
["HARMONY (2018)", "Albiglutide", "MACE ↓ 22%\n(vs placebo in high CV risk)"],
["REWIND (2019)", "Dulaglutide", "MACE ↓ 12%\n(primary prevention included)"],
["STEP / SURMOUNT", "Semaglutide / Tizepatide", "Weight loss 15–22%\nMACE reduction in SELECT trial"],
];
glp1Evidence.forEach(([trial, drug, result], i) => {
const y = 2.1 + i * 0.52;
s.addShape(pres.ShapeType.rect, {
x: 5.2, y, w: 4.3, h: 0.48,
fill: { color: i % 2 === 0 ? "EAF6ED" : C.white },
line: { color: C.gray3, pt: 0.5 }
});
s.addText([
{ text: trial + " — ", options: { bold: true, color: C.green } },
{ text: drug, options: { italic: true, color: C.gray1 } }
], { x: 5.3, y: y + 0.02, w: 4.1, h: 0.2, fontSize: 8.5, fontFace: "Calibri", margin: 0 });
s.addText(result, { x: 5.3, y: y + 0.24, w: 4.1, h: 0.22, fontSize: 8, color: C.teal, fontFace: "Calibri", margin: 0 });
});
// Bottom note
s.addShape(pres.ShapeType.rect, {
x: 0.3, y: 5.42, w: 9.4, h: 0.15,
fill: { color: C.amberLt }, line: { color: C.amber, pt: 0.5 }
});
s.addText("★ Current ADA 2024 guidance: For T2DM patients with established CVD/HF/CKD — add GLP-1 RA (CV preference) or SGLT-2i (HF/CKD preference) regardless of HbA1c level", {
x: 0.4, y: 5.42, w: 9.2, h: 0.15,
fontSize: 7.5, color: C.navy, fontFace: "Calibri", bold: true, margin: 0, valign: "middle"
});
}
// ─────────────────────────────────────────────
// SLIDE 8 – T1DM MANAGEMENT
// ─────────────────────────────────────────────
{
const s = pres.addSlide();
s.background = { color: C.offWht };
addSectionHeader(s, "05 T1DM MANAGEMENT ALGORITHM", C.purple);
addSlideTitle(s, "Type 1 Diabetes — Insulin-Centric Management", "Lifelong insulin required; goal is basal-bolus or closed-loop system");
// T1DM flow
const flowItems = [
{ label: "DIAGNOSIS\nT1DM Confirmed", sub: "GAD65/IA-2/ZnT8 antibodies\nLow C-peptide\nHyperglycemia ± DKA", color: C.purple },
{ label: "INITIATE\nInsulin Therapy", sub: "Basal-bolus regimen\n(MDI or insulin pump)\nCarb counting education", color: C.teal },
{ label: "OPTIMIZE\nTechnology", sub: "CGM (sensor glucose)\nInsulin pump (CSII)\nHybrid closed-loop APS", color: C.green },
{ label: "MONITOR\n& ADJUST", sub: "HbA1c every 3 months\nTIR > 70%, TBR < 4%\nAnnual complication screen", color: C.navy },
];
flowItems.forEach((item, i) => {
const x = 0.3 + i * 2.38;
s.addShape(pres.ShapeType.rect, {
x, y: 1.75, w: 2.1, h: 1.5,
fill: { color: C.white }, line: { color: item.color, pt: 1.5 }
});
s.addShape(pres.ShapeType.rect, {
x, y: 1.75, w: 2.1, h: 0.35,
fill: { color: item.color }, line: { color: item.color }
});
s.addText(item.label, {
x: x + 0.05, y: 1.75, w: 2.0, h: 0.35,
fontSize: 9, bold: true, color: C.white,
align: "center", valign: "middle", fontFace: "Calibri", margin: 0
});
s.addText(item.sub, {
x: x + 0.1, y: 2.14, w: 1.9, h: 1.05,
fontSize: 8.5, color: C.gray1, fontFace: "Calibri", valign: "top"
});
if (i < flowItems.length - 1) {
s.addText("→", {
x: x + 2.1, y: 2.2, w: 0.28, h: 0.4,
fontSize: 18, color: C.gray2, align: "center", margin: 0, fontFace: "Calibri"
});
}
});
// Associated screenings
s.addText("ASSOCIATED AUTOIMMUNE SCREENINGS IN T1DM", {
x: 0.3, y: 3.4, w: 9.4, h: 0.28,
fontSize: 9.5, bold: true, color: C.purple, charSpacing: 1.5, fontFace: "Calibri", margin: 0
});
const screens = [
["Thyroid Disease\n(Hashimoto/Graves)", "TSH annually", C.teal],
["Celiac Disease", "Anti-tTG IgA\nat diagnosis then if symptomatic", C.orange],
["Addison's Disease\n(Adrenal insufficiency)", "Morning cortisol\n(if clinically suspected)", C.purple],
["Hypogonadism\n(Males)", "Testosterone level\n(if symptomatic)", C.navy],
["Autoimmune Hepatitis", "LFTs, ANA, ASMA\n(if elevated enzymes)", C.green],
];
screens.forEach((sc, i) => {
const x = 0.3 + i * 1.9;
s.addShape(pres.ShapeType.rect, {
x, y: 3.72, w: 1.8, h: 1.65,
fill: { color: C.white }, line: { color: sc[2], pt: 1 }
});
s.addShape(pres.ShapeType.rect, {
x, y: 3.72, w: 1.8, h: 0.3,
fill: { color: sc[2] }, line: { color: sc[2] }
});
s.addText(sc[0], {
x: x + 0.05, y: 3.72, w: 1.7, h: 0.3,
fontSize: 8, bold: true, color: C.white,
align: "center", valign: "middle", fontFace: "Calibri", margin: 0
});
s.addText(sc[1], {
x: x + 0.05, y: 4.06, w: 1.7, h: 1.25,
fontSize: 8.5, color: C.gray1, fontFace: "Calibri", valign: "top", align: "center"
});
});
// Teplizumab note
s.addShape(pres.ShapeType.rect, {
x: 0.3, y: 5.38, w: 9.4, h: 0.2,
fill: { color: "F3EEF8" }, line: { color: C.purple, pt: 0.5 }
});
s.addText("★ Teplizumab (anti-CD3 mAb, FDA-approved 2022): Delays T1DM onset by ~2 years in high-risk individuals with Stage 2 T1DM (2+ autoantibodies + dysglycemia)", {
x: 0.4, y: 5.38, w: 9.2, h: 0.2,
fontSize: 7.5, color: C.purple, fontFace: "Calibri", bold: false, margin: 0, valign: "middle"
});
}
// ─────────────────────────────────────────────
// SLIDE 9 – SPECIAL POPULATIONS
// ─────────────────────────────────────────────
{
const s = pres.addSlide();
s.background = { color: C.offWht };
addSectionHeader(s, "07 SPECIAL POPULATIONS", C.tealDk);
addSlideTitle(s, "Drug Selection in Special Populations", "Safety and dose adjustments for CKD, elderly, pregnancy, and pediatrics");
const populations = [
{
title: "ELDERLY / FRAIL",
color: C.tealDk,
lines: [
"HbA1c target: 7.5–8.5% (individualize)",
"Avoid agents with hypoglycemia risk (SU)",
"Prefer DPP-4i (safe), SGLT-2i (if eGFR allows)",
"Reduce complexity — once-daily regimens",
"Screen for cognitive impairment, falls",
"Deprescribe if polypharmacy or frailty"
]
},
{
title: "CHRONIC KIDNEY DISEASE",
color: C.purple,
lines: [
"eGFR 45–60: Metformin — use with caution",
"eGFR 30–45: Metformin dose ↓ 50%",
"eGFR < 30: Stop metformin",
"SGLT-2i: Use if eGFR ≥ 20–30 (renoprotective)",
"GLP-1 RA: Safe across CKD stages (no renal dose adj.)",
"DPP-4i: Dose-adjust (except linagliptin)",
"SU: Avoid (↑ hypoglycemia in renal failure)"
]
},
{
title: "PREGNANCY / GDM",
color: C.orange,
lines: [
"Metformin/glibenclamide: Used in GDM (off-label)",
"Insulin: Drug of choice in pregnancy",
"GLP-1 RA / SGLT-2i / DPP-4i: AVOID (safety unknown)",
"GDM target: FPG < 95, 1-h post < 140 mg/dL",
"Screen 6–12 wks postpartum and annually",
"Breastfeeding: Insulin safe; metformin limited data"
]
},
{
title: "PEDIATRICS / ADOLESCENTS",
color: C.green,
lines: [
"T1DM: Insulin + CGM (from diagnosis)",
"T2DM ↑ in obese youth — treat aggressively",
"Metformin: FDA-approved ≥ 10 yrs for T2DM",
"Liraglutide: Approved ≥ 10 yrs for T2DM",
"Empagliflozin/dapagliflozin: Approved ≥ 10 yrs",
"Lifestyle: Critical — intensive support program"
]
},
{
title: "HEPATIC IMPAIRMENT",
color: C.navy,
lines: [
"Metformin: Avoid in severe liver disease (lactic acidosis)",
"SU: Avoid (impaired metabolism → hypoglycemia)",
"TZDs: Avoid (hepatotoxicity risk)",
"GLP-1 RA / DPP-4i: Generally safe",
"Insulin: Drug of choice in severe hepatic impairment",
"Monitor for hypoglycemia (↓ glycogen stores)"
]
},
];
populations.forEach((pop, i) => {
const col = i % 3;
const row = Math.floor(i / 3);
const x = 0.3 + col * 3.2;
const y = 1.68 + row * 2.1;
const w = 3.05, h = 2.0;
s.addShape(pres.ShapeType.rect, {
x, y, w, h,
fill: { color: C.white }, line: { color: pop.color, pt: 1.5 }
});
s.addShape(pres.ShapeType.rect, {
x, y, w, h: 0.32,
fill: { color: pop.color }, line: { color: pop.color }
});
s.addText(pop.title, {
x: x + 0.1, y, w: w - 0.15, h: 0.32,
fontSize: 9.5, bold: true, color: C.white,
valign: "middle", fontFace: "Calibri", margin: 0
});
s.addText(
pop.lines.map((l, li) => ({
text: l,
options: { bullet: { type: "bullet", indent: 10 }, breakLine: li < pop.lines.length - 1, fontSize: 8.5, color: C.gray1, fontFace: "Calibri" }
})),
{ x: x + 0.1, y: y + 0.36, w: w - 0.2, h: h - 0.44, valign: "top" }
);
});
}
// ─────────────────────────────────────────────
// SLIDE 10 – DKA & HHS MANAGEMENT
// ─────────────────────────────────────────────
{
const s = pres.addSlide();
s.background = { color: C.offWht };
addSectionHeader(s, "08 ACUTE COMPLICATIONS — DKA & HHS", C.red);
addSlideTitle(s, "Diabetic Ketoacidosis & Hyperosmolar Hyperglycemic State", "Both are medical emergencies requiring immediate hospitalization and IV treatment");
// Comparison table
s.addText("DIAGNOSTIC CRITERIA COMPARISON", {
x: 0.3, y: 1.62, w: 9.4, h: 0.25,
fontSize: 9.5, bold: true, color: C.red, charSpacing: 1.5, fontFace: "Calibri", margin: 0
});
const compHeader = [
{ text: "Parameter", options: { bold: true, color: C.white, fill: { color: C.red } } },
{ text: "Mild DKA", options: { bold: true, color: C.white, fill: { color: C.red } } },
{ text: "Moderate DKA", options: { bold: true, color: C.white, fill: { color: C.red } } },
{ text: "Severe DKA", options: { bold: true, color: C.white, fill: { color: C.red } } },
{ text: "HHS", options: { bold: true, color: C.white, fill: { color: C.navy } } },
];
const compRows = [
["Blood glucose", "> 250 mg/dL", "> 250 mg/dL", "> 250 mg/dL", { text: "> 600 mg/dL", options: { bold: true, color: C.navy } }],
["Arterial pH", "7.25–7.30", "7.00–7.24", "< 7.00", { text: "> 7.30", options: { color: C.navy } }],
["Bicarbonate", "15–18 mEq/L", "10–14 mEq/L", "< 10 mEq/L", { text: "> 18 mEq/L", options: { color: C.navy } }],
["Serum ketones", "Positive", "Positive", "Positive", { text: "Small / none", options: { color: C.navy } }],
["Serum osmolality", "Variable", "Variable", "Variable", { text: "> 320 mOsm/kg", options: { bold: true, color: C.navy } }],
["Anion gap", "> 12", "> 12", "> 12", { text: "Variable", options: { color: C.navy } }],
["Mental status", "Alert", "Alert/drowsy", "Stupor/coma", { text: "Stupor/coma", options: { bold: true, color: C.navy } }],
["Mortality", "< 1%", "~5%", "~10%", { text: "5–20%", options: { bold: true, color: C.navy } }],
];
s.addTable([compHeader, ...compRows], {
x: 0.3, y: 1.92, w: 9.4,
colW: [1.8, 1.7, 1.8, 1.7, 1.8],
border: { pt: 0.5, color: C.gray3 },
rowH: 0.285,
fontFace: "Calibri", fontSize: 8.5, color: C.gray1,
fill: { color: C.white }, autoPage: false
});
// Management steps
s.addText("DKA MANAGEMENT PROTOCOL", {
x: 0.3, y: 4.28, w: 4.5, h: 0.25,
fontSize: 9.5, bold: true, color: C.red, charSpacing: 1.5, fontFace: "Calibri", margin: 0
});
const dkaSteps = [
["1. IV FLUIDS", "0.9% NaCl 1L in first hour; then 250–500 mL/h; switch to 0.45% when Na corrected", C.red],
["2. INSULIN", "Regular insulin 0.1 u/kg bolus then 0.1 u/kg/h infusion. HOLD if K⁺ < 3.5 mEq/L", C.orange],
["3. POTASSIUM", "Replace aggressively: 20–40 mEq/h to maintain K⁺ 3.5–5.0 mEq/L", C.purple],
["4. MONITOR", "Glucose hourly; electrolytes/pH q2–4h; goal: close anion gap, not just normalize glucose", C.teal],
["5. TRANSITION", "When AG < 12, pH > 7.3, glucose < 250: overlap SC insulin 1–2h before stopping drip", C.green],
];
dkaSteps.forEach((step, i) => {
const y = 4.56 + i * 0.2;
s.addShape(pres.ShapeType.rect, {
x: 0.3, y, w: 4.5, h: 0.19,
fill: { color: i % 2 === 0 ? "FFF5F5" : C.white },
line: { color: C.gray3, pt: 0.5 }
});
s.addText([
{ text: step[0] + " ", options: { bold: true, color: step[2] } },
{ text: step[1], options: { color: C.gray1 } }
], { x: 0.35, y: y + 0.01, w: 4.35, h: 0.18, fontSize: 7.5, fontFace: "Calibri", margin: 0, valign: "middle" });
});
// HHS Management
s.addText("HHS MANAGEMENT KEY POINTS", {
x: 5.1, y: 4.28, w: 4.6, h: 0.25,
fontSize: 9.5, bold: true, color: C.navy, charSpacing: 1.5, fontFace: "Calibri", margin: 0
});
const hhsPoints = [
"Aggressive IV fluid resuscitation is the priority (2–3L in first 1–2h)",
"Insulin: start at lower dose (0.05 u/kg/h) after initial fluids",
"Replace free water deficit — osmolality falls ~3 mOsm/kg/h",
"Identify and treat precipitant (infection, stroke, MI, medications)",
"Mortality 5–20% — higher than DKA; mostly elderly with comorbidities",
"Thromboprophylaxis (heparin) — high thrombotic risk"
];
s.addText(
hhsPoints.map((p, pi) => ({
text: p,
options: { bullet: { type: "bullet" }, breakLine: pi < hhsPoints.length - 1, fontSize: 8.5, color: C.gray1, fontFace: "Calibri" }
})),
{ x: 5.1, y: 4.56, w: 4.6, h: 1.0, valign: "top" }
);
}
// ─────────────────────────────────────────────
// SLIDE 11 – MONITORING & TARGETS
// ─────────────────────────────────────────────
{
const s = pres.addSlide();
s.background = { color: C.offWht };
addSectionHeader(s, "09 MONITORING & TREATMENT TARGETS", C.navy);
addSlideTitle(s, "Ongoing Monitoring Schedule & Complication Screening", "Systematic follow-up reduces microvascular complications by 25–76% (DCCT/UKPDS)");
// Monitoring table
const monHeader = [
{ text: "Assessment", options: { bold: true, color: C.white, fill: { color: C.navy } } },
{ text: "Frequency", options: { bold: true, color: C.white, fill: { color: C.navy } } },
{ text: "Target / Action Threshold", options: { bold: true, color: C.white, fill: { color: C.navy } } },
];
const monRows = [
["HbA1c", "Every 3 months (until target); then 6-monthly", "< 7.0% most adults; individualize"],
["Fasting / preprandial glucose", "Daily (SMBG or CGM)", "80–130 mg/dL"],
["Postprandial glucose", "2h post-meal (SMBG)", "< 180 mg/dL"],
["Urine albumin-to-creatinine ratio (UACR)", "Annually", "< 30 mg/g; ≥ 30 = microalbuminuria → ACEi/ARB"],
["eGFR / Serum creatinine", "Annually (or sooner if CKD)", "Adjust drugs if eGFR ↓; refer nephrology if < 30"],
["Retinal exam (dilated fundoscopy)", "Annually (T1DM: 5yr after onset; T2DM: at diagnosis)", "Any retinopathy → ophthalmology + optimize glucose/BP"],
["Foot exam (neuropathy screen)", "At every visit (annually formal)", "10-g monofilament, vibration, ankle reflexes"],
["Lipid panel", "Annually (more if abnormal)", "LDL < 100 (low risk); < 70 mg/dL (CVD/high risk)"],
["Blood pressure", "Every visit", "< 130/80 mmHg → ACEi or ARB first-line"],
["Body weight / BMI", "Every visit", "Weight loss ≥ 5% in overweight T2DM"],
["Thyroid function (TSH)", "Annually in T1DM; as indicated in T2DM", "Correct hypothyroidism (worsens glycemic control)"],
["Dental, mental health, vaccinations", "Annually / as per guidelines", "Influenza, pneumococcal, COVID-19, hepatitis B"],
];
s.addTable([monHeader, ...monRows], {
x: 0.3, y: 1.68, w: 9.4,
colW: [2.5, 2.4, 4.5],
border: { pt: 0.5, color: C.gray3 },
rowH: 0.29,
fontFace: "Calibri", fontSize: 8.2, color: C.gray1,
fill: { color: C.white }, autoPage: false
});
// DCCT/UKPDS note
s.addShape(pres.ShapeType.rect, {
x: 0.3, y: 5.28, w: 9.4, h: 0.25,
fill: { color: C.tealLt }, line: { color: C.teal, pt: 1 }
});
s.addText("★ DCCT (T1DM): Intensive glycemic control ↓ retinopathy 76%, nephropathy 50%, neuropathy 60% • UKPDS (T2DM): Each 1% ↓ in HbA1c → ↓ microvascular complications 35%", {
x: 0.4, y: 5.28, w: 9.2, h: 0.25,
fontSize: 8, color: C.tealDk, bold: true, fontFace: "Calibri", margin: 0, valign: "middle"
});
}
// ─────────────────────────────────────────────
// SLIDE 12 – SUMMARY / CLOSING
// ─────────────────────────────────────────────
{
const s = pres.addSlide();
s.background = { color: C.navy };
s.addShape(pres.ShapeType.rect, {
x: 0, y: 0, w: 0.18, h: 5.625,
fill: { color: C.teal }, line: { color: C.teal }
});
s.addShape(pres.ShapeType.rect, {
x: 0.18, y: 0, w: 0.06, h: 5.625,
fill: { color: C.amber }, line: { color: C.amber }
});
s.addText("Key Takeaways", {
x: 0.5, y: 0.3, w: 9, h: 0.6,
fontSize: 28, bold: true, color: C.white, fontFace: "Calibri"
});
s.addShape(pres.ShapeType.rect, {
x: 0.5, y: 0.92, w: 4, h: 0.04,
fill: { color: C.amber }, line: { color: C.amber }
});
const takeaways = [
["Diagnose early", "Use FPG, HbA1c ≥6.5%, or 2-h OGTT ≥200 — confirm with repeat test in asymptomatic patients"],
["Metformin is foundational", "First-line for T2DM unless eGFR < 30 or contraindicated; cheap, weight-neutral, cardioprotective"],
["Individualize the 2nd agent", "CVD → GLP-1 RA or SGLT-2i; HF/CKD → SGLT-2i; weight priority → GLP-1 RA; cost → SU"],
["SGLT-2i & GLP-1 RA have CV/renal benefits", "Independent of glucose-lowering; use them in high-CV-risk patients regardless of HbA1c"],
["All T1DM need insulin", "Basal-bolus ± CGM ± closed-loop system; teplizumab delays onset in at-risk individuals"],
["DKA management: fluids → insulin → K+", "Never start insulin if K+ < 3.5; close the anion gap, not just normalize glucose"],
["Monitor systematically", "HbA1c q3 months, annual UACR, fundoscopy, foot exam, lipids, BP — screen for complications"],
];
takeaways.forEach(([title, body], i) => {
const y = 1.12 + i * 0.62;
s.addShape(pres.ShapeType.rect, {
x: 0.5, y, w: 0.28, h: 0.28,
fill: { color: C.amber }, line: { color: C.amber }
});
s.addText(String(i + 1), {
x: 0.5, y, w: 0.28, h: 0.28,
fontSize: 12, bold: true, color: C.navy,
align: "center", valign: "middle", fontFace: "Calibri", margin: 0
});
s.addText([
{ text: title + " ", options: { bold: true, color: C.amber } },
{ text: body, options: { color: "C8E6E6" } }
], {
x: 0.9, y: y + 0.01, w: 8.8, h: 0.56,
fontSize: 10, fontFace: "Calibri", valign: "top"
});
});
// Footer
s.addText("References: Harrison's 22e (2025) • Goldman-Cecil Medicine (Int'l Ed.) • Goodman & Gilman's 13e • ADA Standards of Care 2024 • Robbins & Cotran Pathology 10e", {
x: 0.5, y: 5.3, w: 9.2, h: 0.28,
fontSize: 7.5, color: "486E7A", fontFace: "Calibri", italic: true
});
}
// ─────────────────────────────────────────────
// WRITE FILE
// ─────────────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/workspace/dm-presentation/DM_Management_Algorithms.pptx" })
.then(() => console.log("✅ Presentation created successfully!"))
.catch(err => console.error("❌ Error:", err));