Here is the complete pptxgenjs script. Save it as oha_presentation.js and run with node oha_presentation.js.
// ============================================================
// Oral Hypoglycemic Agents - Postgraduate Internal Medicine
// PptxGenJS v3.x | Run: node oha_presentation.js
// ============================================================
const pptxgen = require("pptxgenjs");
const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Oral Hypoglycemic Agents";
pres.author = "Internal Medicine Education";
// ─── PALETTE ────────────────────────────────────────────────
const C = {
navy: "0A1628", // dominant dark
teal: "0D7377", // primary accent
tealLight: "14A097", // lighter teal
gold: "F5A623", // highlight / callout
red: "C0392B", // warnings / contraindications
white: "FFFFFF",
offWhite: "F4F6F9",
slate: "4A5568",
slateLight:"718096",
cardBg: "EBF4F4",
darkCard: "112240",
};
// ─── HELPERS ─────────────────────────────────────────────────
function addSlideHeader(slide, title, subtitle = "") {
// Top teal bar
slide.addShape(pres.shapes.RECTANGLE, {
x: 0, y: 0, w: 10, h: 0.75,
fill: { color: C.teal }, line: { color: C.teal }
});
// Accent left stripe
slide.addShape(pres.shapes.RECTANGLE, {
x: 0, y: 0, w: 0.08, h: 5.625,
fill: { color: C.gold }, line: { color: C.gold }
});
slide.addText(title.toUpperCase(), {
x: 0.18, y: 0, w: 9.5, h: 0.75,
fontSize: 18, bold: true, color: C.white,
fontFace: "Calibri", valign: "middle", margin: 0,
charSpacing: 1.5
});
if (subtitle) {
slide.addText(subtitle, {
x: 0.18, y: 0.75, w: 9.5, h: 0.38,
fontSize: 11, color: C.slateLight, italic: true,
fontFace: "Calibri", valign: "middle", margin: 0
});
}
}
function addFooter(slide, pageNum) {
slide.addShape(pres.shapes.RECTANGLE, {
x: 0, y: 5.4, w: 10, h: 0.225,
fill: { color: C.navy }, line: { color: C.navy }
});
slide.addText("Oral Hypoglycemic Agents | Postgraduate Internal Medicine", {
x: 0.18, y: 5.4, w: 8.5, h: 0.225,
fontSize: 7.5, color: C.slateLight, fontFace: "Calibri",
valign: "middle", margin: 0
});
slide.addText(`${pageNum}`, {
x: 9.2, y: 5.4, w: 0.7, h: 0.225,
fontSize: 7.5, color: C.gold, fontFace: "Calibri",
align: "right", valign: "middle", margin: 0, bold: true
});
}
function card(slide, x, y, w, h, title, lines, titleColor = C.teal) {
slide.addShape(pres.shapes.ROUNDED_RECTANGLE, {
x, y, w, h,
fill: { color: C.white },
line: { color: titleColor, pt: 1.5 },
rectRadius: 0.08,
shadow: { type: "outer", color: "000000", blur: 8, offset: 2, angle: 135, opacity: 0.10 }
});
// card title bar
slide.addShape(pres.shapes.RECTANGLE, {
x, y, w, h: 0.3,
fill: { color: titleColor }, line: { color: titleColor }
});
slide.addText(title, {
x: x + 0.1, y, w: w - 0.2, h: 0.3,
fontSize: 9, bold: true, color: C.white,
fontFace: "Calibri", valign: "middle", margin: 0
});
const items = lines.map((l, i) => ({
text: l,
options: { bullet: { code: "25B8" }, breakLine: i < lines.length - 1 }
}));
slide.addText(items, {
x: x + 0.1, y: y + 0.32, w: w - 0.2, h: h - 0.38,
fontSize: 8.5, color: C.navy, fontFace: "Calibri",
valign: "top"
});
}
function warningBox(slide, x, y, w, h, text) {
slide.addShape(pres.shapes.ROUNDED_RECTANGLE, {
x, y, w, h,
fill: { color: "FFF5F5" },
line: { color: C.red, pt: 1.5 },
rectRadius: 0.06
});
slide.addText([
{ text: "⚠ ", options: { bold: true, color: C.red, fontSize: 9 } },
{ text, options: { color: C.red, fontSize: 8.5 } }
], {
x: x + 0.1, y, w: w - 0.2, h,
fontFace: "Calibri", valign: "middle"
});
}
function infoBox(slide, x, y, w, h, text) {
slide.addShape(pres.shapes.ROUNDED_RECTANGLE, {
x, y, w, h,
fill: { color: "EBF8FF" },
line: { color: C.teal, pt: 1.5 },
rectRadius: 0.06
});
slide.addText([
{ text: "ℹ ", options: { bold: true, color: C.teal, fontSize: 9 } },
{ text, options: { color: C.navy, fontSize: 8.5 } }
], {
x: x + 0.1, y, w: w - 0.2, h,
fontFace: "Calibri", valign: "middle"
});
}
// ════════════════════════════════════════════════════════════
// SLIDE 1 — TITLE SLIDE
// ════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
s.background = { color: C.navy };
// Large geometric accent shapes
s.addShape(pres.shapes.RECTANGLE, {
x: 7.2, y: 0, w: 2.8, h: 5.625,
fill: { color: C.teal, transparency: 85 }, line: { color: C.teal, transparency: 85 }
});
s.addShape(pres.shapes.RECTANGLE, {
x: 7.8, y: 0, w: 2.2, h: 5.625,
fill: { color: C.tealLight, transparency: 90 }, line: { color: C.tealLight, transparency: 90 }
});
s.addShape(pres.shapes.RECTANGLE, {
x: 0, y: 4.8, w: 10, h: 0.825,
fill: { color: C.teal }, line: { color: C.teal }
});
s.addShape(pres.shapes.RECTANGLE, {
x: 0, y: 4.8, w: 2.2, h: 0.825,
fill: { color: C.gold }, line: { color: C.gold }
});
// Pill icon shape (decorative circle)
s.addShape(pres.shapes.OVAL, {
x: 7.5, y: 1.0, w: 1.8, h: 1.8,
fill: { color: C.gold, transparency: 80 }, line: { color: C.gold, transparency: 60 }
});
s.addShape(pres.shapes.OVAL, {
x: 7.8, y: 1.3, w: 1.2, h: 1.2,
fill: { color: C.gold, transparency: 60 }, line: { color: C.gold, transparency: 40 }
});
s.addText("ORAL", {
x: 0.5, y: 0.9, w: 7, h: 0.9,
fontSize: 54, bold: true, color: C.white,
fontFace: "Calibri", charSpacing: 8
});
s.addText("HYPOGLYCEMIC", {
x: 0.5, y: 1.7, w: 7, h: 0.9,
fontSize: 54, bold: true, color: C.gold,
fontFace: "Calibri", charSpacing: 4
});
s.addText("AGENTS", {
x: 0.5, y: 2.55, w: 7, h: 0.9,
fontSize: 54, bold: true, color: C.white,
fontFace: "Calibri", charSpacing: 8
});
s.addText("Mechanisms · Escalation · Individualization · Clinical Caveats", {
x: 0.5, y: 3.55, w: 7, h: 0.4,
fontSize: 13, color: C.tealLight, fontFace: "Calibri",
italic: true, charSpacing: 0.5
});
s.addText("Postgraduate Internal Medicine | Pharmacotherapy Series", {
x: 0.18, y: 4.85, w: 6, h: 0.72,
fontSize: 10, color: C.white, fontFace: "Calibri", valign: "middle"
});
s.addText("2026", {
x: 2.4, y: 4.85, w: 1.5, h: 0.72,
fontSize: 10, color: C.white, fontFace: "Calibri",
bold: true, valign: "middle"
});
}
// ════════════════════════════════════════════════════════════
// SLIDE 2 — OVERVIEW / DRUG CLASS MAP
// ════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
s.background = { color: C.offWhite };
addSlideHeader(s, "Drug Class Overview", "9 classes targeting distinct pathophysiologic defects in T2DM");
addFooter(s, 2);
const classes = [
{ name: "Biguanides", eg: "Metformin", color: C.teal },
{ name: "Sulfonylureas", eg: "Glipizide, Glyburide, Glimepiride", color: "1A6B8A" },
{ name: "Meglitinides", eg: "Repaglinide, Nateglinide", color: "2E86AB" },
{ name: "Thiazolidinediones", eg: "Pioglitazone", color: "457B9D" },
{ name: "DPP-4 Inhibitors", eg: "Sitagliptin, Linagliptin", color: "1D6A47" },
{ name: "SGLT2 Inhibitors", eg: "Empagliflozin, Dapagliflozin",color: "0D7377" },
{ name: "GLP-1 RA", eg: "Semaglutide, Liraglutide", color: "5C6BC0" },
{ name: "α-Glucosidase Inh.", eg: "Acarbose, Miglitol", color: "7B6FA0" },
{ name: "Other", eg: "Colesevelam, Bromocriptine", color: "8D6E63" },
];
const cols = 3, rows = 3;
const cW = 3.0, cH = 1.18, startX = 0.18, startY = 1.18, gapX = 0.12, gapY = 0.1;
classes.forEach((cls, i) => {
const col = i % cols;
const row = Math.floor(i / cols);
const x = startX + col * (cW + gapX);
const y = startY + row * (cH + gapY);
s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
x, y, w: cW, h: cH,
fill: { color: cls.color }, line: { color: cls.color },
rectRadius: 0.1,
shadow: { type: "outer", color: "000000", blur: 6, offset: 2, angle: 135, opacity: 0.12 }
});
// Number badge
s.addShape(pres.shapes.OVAL, {
x: x + cW - 0.38, y: y + 0.08, w: 0.28, h: 0.28,
fill: { color: C.white, transparency: 70 }, line: { color: C.white, transparency: 50 }
});
s.addText(`${i + 1}`, {
x: x + cW - 0.38, y: y + 0.08, w: 0.28, h: 0.28,
fontSize: 7, bold: true, color: C.white,
fontFace: "Calibri", align: "center", valign: "middle", margin: 0
});
s.addText(cls.name, {
x: x + 0.12, y: y + 0.1, w: cW - 0.55, h: 0.42,
fontSize: 11, bold: true, color: C.white,
fontFace: "Calibri", valign: "middle", margin: 0
});
s.addText(cls.eg, {
x: x + 0.12, y: y + 0.55, w: cW - 0.22, h: 0.52,
fontSize: 8.5, color: C.white, fontFace: "Calibri",
valign: "top", italic: true, margin: 0
});
});
}
// ════════════════════════════════════════════════════════════
// SLIDE 3 — METFORMIN
// ════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
s.background = { color: C.offWhite };
addSlideHeader(s, "Metformin — The Cornerstone", "First-line therapy for T2DM unless contraindicated");
addFooter(s, 3);
// MOA box
card(s, 0.18, 1.15, 4.5, 1.55, "MECHANISM OF ACTION", [
"Activates hepatic AMPK → suppresses gluconeogenesis & glycogenolysis",
"Improves peripheral insulin sensitivity",
"Reduces intestinal glucose absorption",
"Does NOT stimulate insulin secretion → no hypoglycemia risk"
], C.teal);
// Dosing box
card(s, 4.82, 1.15, 4.98, 1.55, "DOSING", [
"Start: 500 mg once or twice daily with meals",
"Titrate every 1–2 weeks to tolerance",
"Max effective dose: 2000–2550 mg/day",
"XR formulation improves GI tolerability"
], "1A6B8A");
// Advantages
card(s, 0.18, 2.85, 3.0, 2.0, "ADVANTAGES", [
"Weight neutral / modest weight loss",
"No hypoglycemia monotherapy",
"Cardioprotective (UKPDS legacy)",
"Low cost",
"Possible cancer risk reduction"
], "1D6A47");
// Renal / CI
card(s, 3.32, 2.85, 3.0, 2.0, "RENAL DOSING", [
"eGFR 45–60: use with caution",
"eGFR 30–44: reduce dose, monitor",
"eGFR <30: CONTRAINDICATED",
"Hold 48 h before/after iodinated contrast if eGFR <60"
], C.red);
// Monitoring
card(s, 6.46, 2.85, 3.32, 2.0, "MONITORING & CAVEATS", [
"eGFR at baseline then annually",
"Vitamin B12 annually (long-term use depletes B12)",
"LFTs at baseline",
"GI side effects in ~30% — dose-dependent, improve with titration"
], "7B6FA0");
}
// ════════════════════════════════════════════════════════════
// SLIDE 4 — SULFONYLUREAS & MEGLITINIDES
// ════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
s.background = { color: C.offWhite };
addSlideHeader(s, "Sulfonylureas & Meglitinides", "Insulin secretagogues — require functional beta cells");
addFooter(s, 4);
// MOA diagram area
s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
x: 0.18, y: 1.15, w: 9.62, h: 0.72,
fill: { color: C.navy }, line: { color: C.navy }, rectRadius: 0.06
});
s.addText([
{ text: "Mechanism: ", options: { bold: true, color: C.gold } },
{ text: "Bind SUR1 on pancreatic β-cell K", options: { color: C.white } },
{ text: "ATP", options: { color: C.white, subscript: true } },
{ text: " channels → channel closure → membrane depolarisation → Ca²⁺ influx → insulin secretion", options: { color: C.white } }
], {
x: 0.32, y: 1.15, w: 9.34, h: 0.72,
fontSize: 10.5, fontFace: "Calibri", valign: "middle"
});
// SU table
const suHeaders = [
[{ text: "Drug", options: { bold: true, color: C.white, fill: { color: C.teal } } },
{ text: "Start Dose", options: { bold: true, color: C.white, fill: { color: C.teal } } },
{ text: "Max Dose", options: { bold: true, color: C.white, fill: { color: C.teal } } },
{ text: "Duration", options: { bold: true, color: C.white, fill: { color: C.teal } } },
{ text: "Note", options: { bold: true, color: C.white, fill: { color: C.teal } } }]
];
const suRows = [
["Glipizide", "5 mg daily", "40 mg/day", "12–24 h", "Preferred in CKD; take 30 min before meal"],
["Glyburide", "2.5–5 mg daily", "20 mg/day", "16–24 h", "AVOID in elderly & CKD — long active metabolite"],
["Glimepiride", "1–2 mg daily", "8 mg/day", "24 h", "Once daily; safest in mild CKD of the SUs"],
];
const tableData = [
...suHeaders,
...suRows.map((r, i) => r.map(cell => ({
text: cell,
options: { fill: { color: i % 2 === 0 ? "F0FAFA" : C.white }, color: C.navy, fontSize: 8.5 }
})))
];
s.addTable(tableData, {
x: 0.18, y: 1.98, w: 9.62, h: 1.1,
fontFace: "Calibri",
border: { type: "solid", pt: 0.5, color: "CCDDDD" },
colW: [1.5, 1.4, 1.3, 1.1, 4.32]
});
// Key concerns
warningBox(s, 0.18, 3.2, 4.65, 0.58,
"Hypoglycemia risk (especially glyburide) — weight gain 2–5 kg — secondary failure ~5–10%/yr as β-cell mass declines");
// Meglitinides card
card(s, 5.0, 3.2, 4.8, 2.0, "MEGLITINIDES", [
"Same SUR1 target as SUs — different binding site",
"Shorter action → cover postprandial spikes only",
"Repaglinide: 0.5–4 mg before each meal (skip if skipping meal)",
"Nateglinide: 60–120 mg before meals",
"Safer in CKD than SUs (biliary excretion of repaglinide)",
"Hypoglycemia if meal is skipped — adhere to meal timing"
], "2E86AB");
infoBox(s, 0.18, 3.88, 4.65, 0.58,
"β-blockers mask hypoglycemia symptoms (tachycardia, tremor) — sweating is preserved and is the key warning sign.");
}
// ════════════════════════════════════════════════════════════
// SLIDE 5 — THIAZOLIDINEDIONES
// ════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
s.background = { color: C.offWhite };
addSlideHeader(s, "Thiazolidinediones (TZDs / Glitazones)", "PPARγ agonists — insulin sensitizers with delayed onset");
addFooter(s, 5);
card(s, 0.18, 1.15, 4.6, 1.55, "MECHANISM OF ACTION", [
"PPARγ (nuclear receptor) agonists → transcriptional activation",
"↑ insulin sensitivity in adipose tissue, muscle & liver",
"↓ hepatic glucose output, ↑ peripheral glucose uptake",
"Full effect delayed: weeks to months (not days)"
], "457B9D");
card(s, 4.92, 1.15, 4.88, 1.55, "DOSING", [
"Pioglitazone: 15–45 mg once daily",
"Rosiglitazone: 2–8 mg/day (restricted — FDA REMS)",
"May be combined with metformin, SUs, or insulin (caution with insulin — ↑ fluid retention)",
"No dose adjustment required for renal impairment"
], "457B9D");
card(s, 0.18, 2.85, 3.1, 2.0, "ADVANTAGES", [
"Durable HbA1c reduction",
"No hypoglycemia (monotherapy)",
"Pioglitazone: ↑ HDL, ↓ TG",
"PROactive trial: ↓ recurrent CV events (pioglitazone)",
"Useful in NASH/NAFLD"
], "1D6A47");
// Contraindications — red themed
s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
x: 3.42, y: 2.85, w: 6.38, h: 2.0,
fill: { color: "FFF8F8" }, line: { color: C.red, pt: 1.5 }, rectRadius: 0.08,
shadow: { type: "outer", color: "000000", blur: 6, offset: 2, angle: 135, opacity: 0.08 }
});
s.addShape(pres.shapes.RECTANGLE, {
x: 3.42, y: 2.85, w: 6.38, h: 0.3,
fill: { color: C.red }, line: { color: C.red }
});
s.addText("⚠ MAJOR CONCERNS & CONTRAINDICATIONS", {
x: 3.52, y: 2.85, w: 6.18, h: 0.3,
fontSize: 9, bold: true, color: C.white, fontFace: "Calibri",
valign: "middle", margin: 0
});
const contraItems = [
{ label: "Heart Failure (NYHA III–IV):", detail: "ABSOLUTELY CONTRAINDICATED — causes fluid retention & worsens HF" },
{ label: "Bladder Cancer (Pioglitazone):", detail: "Avoid in active or prior bladder cancer" },
{ label: "Bone Fractures:", detail: "Reduced bone density — especially postmenopausal women" },
{ label: "Rosiglitazone:", detail: "Associated with ↑ MI risk — FDA REMS restricted access" },
{ label: "Hepatotoxicity:", detail: "Check LFTs at baseline; avoid in significant liver disease" },
];
const contraTextArr = contraItems.flatMap((ci, i) => [
{ text: `${ci.label} `, options: { bold: true, color: C.red, fontSize: 8.5 } },
{ text: ci.detail, options: { color: C.navy, fontSize: 8.5 } },
...(i < contraItems.length - 1 ? [{ text: "\n", options: { fontSize: 6 } }] : [])
]);
s.addText(contraTextArr, {
x: 3.55, y: 3.2, w: 6.12, h: 1.55,
fontFace: "Calibri", valign: "top"
});
}
// ════════════════════════════════════════════════════════════
// SLIDE 6 — DPP-4 INHIBITORS
// ════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
s.background = { color: C.offWhite };
addSlideHeader(s, "DPP-4 Inhibitors (Gliptins)", "Incretin enhancers — glucose-dependent insulin secretion");
addFooter(s, 6);
// Mechanism visual
s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
x: 0.18, y: 1.15, w: 9.62, h: 0.62,
fill: { color: C.darkCard }, line: { color: C.darkCard }, rectRadius: 0.06
});
s.addText([
{ text: "DPP-4 inhibition → ↑ endogenous GLP-1 & GIP → ", options: { color: C.white } },
{ text: "glucose-dependent", options: { bold: true, color: C.gold, italic: true } },
{ text: " insulin secretion from β-cells + ↓ glucagon from α-cells", options: { color: C.white } }
], {
x: 0.32, y: 1.15, w: 9.34, h: 0.62,
fontSize: 10.5, fontFace: "Calibri", valign: "middle"
});
// Drug table
const dppHeaders = [
[{ text: "Drug", options: { bold: true, color: C.white, fill: { color: "1D6A47" } } },
{ text: "Brand", options: { bold: true, color: C.white, fill: { color: "1D6A47" } } },
{ text: "Standard Dose", options: { bold: true, color: C.white, fill: { color: "1D6A47" } } },
{ text: "Renal Adjustment", options: { bold: true, color: C.white, fill: { color: "1D6A47" } } }]
];
const dppRows = [
["Sitagliptin", "Januvia", "100 mg once daily", "50 mg if eGFR 30–45; 25 mg if eGFR <30"],
["Saxagliptin", "Onglyza", "5 mg once daily", "2.5 mg if eGFR ≤45"],
["Linagliptin", "Tradjenta", "5 mg once daily", "NO adjustment needed (biliary excretion) ✓"],
["Alogliptin", "Nesina", "25 mg once daily", "Reduce in renal impairment"],
];
const dppData = [
...dppHeaders,
...dppRows.map((r, i) => r.map(cell => ({
text: cell,
options: { fill: { color: i % 2 === 0 ? "EBF8F0" : C.white }, color: C.navy, fontSize: 8.5 }
})))
];
s.addTable(dppData, {
x: 0.18, y: 1.88, w: 9.62, h: 1.3,
fontFace: "Calibri",
border: { type: "solid", pt: 0.5, color: "BDD8CC" },
colW: [1.6, 1.4, 2.2, 4.42]
});
card(s, 0.18, 3.3, 4.6, 1.55, "ADVANTAGES", [
"Weight neutral",
"Low hypoglycemia risk (monotherapy)",
"Well tolerated — once daily",
"Safe in elderly patients",
"Suitable in mild–moderate CKD with dose adjustment"
], "1D6A47");
card(s, 4.92, 3.3, 4.88, 1.55, "CLINICAL CAVEATS", [
"Saxagliptin: ↑ heart failure hospitalisation (SAVOR-TIMI) — avoid in HF",
"Do NOT combine with GLP-1 RA (same incretin pathway — no additive benefit)",
"Pancreatitis risk — not definitively proven; monitor",
"Bullous pemphigoid — rare class-wide skin reaction",
"Nasopharyngitis, URTI common"
], C.red);
}
// ════════════════════════════════════════════════════════════
// SLIDE 7 — SGLT2 INHIBITORS
// ════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
s.background = { color: C.offWhite };
addSlideHeader(s, "SGLT2 Inhibitors (Gliflozins)", "Insulin-independent glucosuria + compelling cardiorenal outcomes");
addFooter(s, 7);
s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
x: 0.18, y: 1.15, w: 9.62, h: 0.58,
fill: { color: C.navy }, line: { color: C.navy }, rectRadius: 0.06
});
s.addText([
{ text: "Block SGLT2 in proximal renal tubule → glucosuria (~70–80 g/day) → ↓ blood glucose. ", options: { color: C.white } },
{ text: "Mechanism is insulin-independent.", options: { bold: true, color: C.gold } }
], {
x: 0.32, y: 1.15, w: 9.34, h: 0.58,
fontSize: 10, fontFace: "Calibri", valign: "middle"
});
// Drug table
const sgltHeaders = [
[{ text: "Drug", options: { bold: true, color: C.white, fill: { color: C.teal } } },
{ text: "Brand", options: { bold: true, color: C.white, fill: { color: C.teal } } },
{ text: "Dose", options: { bold: true, color: C.white, fill: { color: C.teal } } },
{ text: "Key Outcomes Evidence", options: { bold: true, color: C.white, fill: { color: C.teal } } }]
];
const sgltRows = [
["Empagliflozin", "Jardiance", "10–25 mg od", "EMPA-REG: ↓ MACE, ↓ CV death, ↓ HF hospitalisation, ↓ CKD progression"],
["Canagliflozin", "Invokana", "100–300 mg od", "CANVAS: ↓ MACE; CREDENCE: ↓ renal progression (caution: ↑ amputation)"],
["Dapagliflozin", "Farxiga", "5–10 mg od", "DAPA-HF: ↓ HF events regardless of DM; DAPA-CKD: ↓ CKD progression"],
["Ertugliflozin", "Steglatro", "5–15 mg od", "Less outcomes data than above three"],
];
const sgltData = [
...sgltHeaders,
...sgltRows.map((r, i) => r.map(cell => ({
text: cell,
options: { fill: { color: i % 2 === 0 ? "EBF6F6" : C.white }, color: C.navy, fontSize: 8 }
})))
];
s.addTable(sgltData, {
x: 0.18, y: 1.83, w: 9.62, h: 1.2,
fontFace: "Calibri",
border: { type: "solid", pt: 0.5, color: "BBDDDD" },
colW: [1.6, 1.3, 1.3, 5.42]
});
card(s, 0.18, 3.15, 4.55, 2.1, "ADVERSE EFFECTS", [
"Genital mycotic infections (candidiasis) — very common, especially ♀",
"Euglycemic DKA — occurs at near-normal glucose; highest risk with fasting, surgery, T1DM use",
"Volume depletion / hypotension — especially with diuretics",
"Canagliflozin: ↑ amputations (peripheral artery disease), bone fractures",
"Fournier's gangrene — rare but class-wide serious warning",
"UTI — modest increased risk"
], C.red);
card(s, 4.87, 3.15, 4.93, 2.1, "CRITICAL CAVEATS", [
"Glycaemic efficacy requires eGFR ≥45; cardiorenal benefit extends to lower eGFR",
"HOLD perioperatively (≥48 h before surgery) — euglycemic DKA risk",
"HOLD during sick-day illness (vomiting/diarrhoea) — 'SADMAN' rule",
"Check ketones (not just glucose) if patient presents unwell on SGLT2i",
"Do NOT use in T1DM without specialist supervision"
], C.teal);
}
// ════════════════════════════════════════════════════════════
// SLIDE 8 — GLP-1 RA & OTHER AGENTS
// ════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
s.background = { color: C.offWhite };
addSlideHeader(s, "GLP-1 Receptor Agonists & Other Agents", "Incretin mimetics + alpha-glucosidase inhibitors + miscellaneous");
addFooter(s, 8);
card(s, 0.18, 1.15, 6.0, 2.35, "GLP-1 RECEPTOR AGONISTS", [
"Mechanism: Mimic endogenous GLP-1 → glucose-dependent insulin secretion, ↓ glucagon, ↓ gastric emptying, ↑ satiety → weight loss",
"Agents: Semaglutide (once-weekly SC or daily oral), Dulaglutide (weekly SC), Liraglutide (daily SC), Exenatide (BD or weekly)",
"HbA1c reduction 1.0–2.0% + weight loss 2–5 kg (higher doses approved for obesity management)",
"CVOT evidence: Liraglutide (LEADER), Semaglutide (SUSTAIN-6), Dulaglutide (REWIND) — all ↓ MACE",
"Contraindicated: Personal/family history of MTC or MEN2 syndrome",
"Adverse: GI (nausea, vomiting, diarrhoea) — worst on initiation; pancreatitis risk (avoid in chronic pancreatitis)"
], "5C6BC0");
card(s, 6.32, 1.15, 3.48, 2.35, "INCRETIN INTERACTION NOTE", [
"GLP-1 RA + DPP-4 inhibitor: NO additive benefit — same pathway; avoid combination",
"GLP-1 RA + SGLT2 inhibitor: ADDITIVE benefits — complementary mechanisms",
"Oral semaglutide: must be taken fasting with small sip of water; no food/drug for 30 min after"
], "5C6BC0");
card(s, 0.18, 3.62, 3.1, 1.68, "α-GLUCOSIDASE INHIBITORS", [
"Acarbose, Miglitol",
"Competitively inhibit intestinal brush-border enzymes → delayed carbohydrate digestion → blunt postprandial glucose",
"No systemic absorption (acarbose) — no hypoglycaemia alone",
"CRITICAL: Hypoglycaemia on acarbose + SU/insulin → treat with pure GLUCOSE (not sucrose — acarbose blocks sucrose hydrolysis!)",
"GI side effects (flatulence, bloating) limit use — 50–70%"
], "7B6FA0");
card(s, 3.42, 3.62, 3.0, 1.68, "COLESEVELAM", [
"Bile acid sequestrant",
"Mechanism in DM: unclear — modestly ↓ HbA1c ~0.5%",
"Bonus: ↓ LDL-C (dual glycaemic + lipid benefit)",
"GI side effects; reduces absorption of fat-soluble vitamins & co-prescribed drugs",
"Take other medications ≥4 h before colesevelam"
], "8D6E63");
card(s, 6.56, 3.62, 3.22, 1.68, "BROMOCRIPTINE (CYCLOSET)", [
"Dopamine D2 agonist",
"Resets hypothalamic circadian rhythm → improves insulin sensitivity",
"Modest HbA1c ↓ ~0.5–0.7%",
"Can be continued when insulin is initiated",
"Adverse: nausea, orthostatic hypotension, dizziness",
"Take within 2 h of waking in the morning"
], "8D6E63");
}
// ════════════════════════════════════════════════════════════
// SLIDE 9 — TREATMENT ESCALATION ALGORITHM
// ════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
s.background = { color: C.offWhite };
addSlideHeader(s, "Treatment Escalation Algorithm", "ADA/EASD consensus approach — reassess every 3 months");
addFooter(s, 9);
// Step boxes with arrows
const steps = [
{ label: "STEP 1", title: "Lifestyle + Metformin", detail: "All patients unless contraindicated\nA1C ≥9% or symptomatic → consider dual therapy at start", color: C.teal },
{ label: "STEP 2", title: "Add 2nd Agent (3 months)", detail: "Choose based on comorbidities:\n• CVD/ASCVD → GLP-1 RA\n• HFrEF/CKD → SGLT2 inhibitor\n• Weight → GLP-1 RA or SGLT2i\n• Cost → SU or TZD", color: "1A6B8A" },
{ label: "STEP 3", title: "Add 3rd Agent (3 months)", detail: "Triple therapy with complementary mechanisms\nConsider injectable GLP-1 RA if not already used", color: "2E86AB" },
{ label: "STEP 4", title: "Basal Insulin ± GLP-1 RA", detail: "Start basal insulin 10 U/night\nContinue: metformin, SGLT2i, DPP-4i\nDiscontinue: SU/meglitinide when prandial insulin added", color: "457B9D" },
{ label: "STEP 5", title: "Full Basal-Bolus Insulin", detail: "A1C >10% or DKA/HHS:\nconsider insulin from the start\nCombine with insulin sensitisers as tolerated", color: C.navy },
];
steps.forEach((step, i) => {
const x = 0.18 + i * 1.94;
const y = 1.15;
const w = 1.84;
const h = 4.1;
s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
x, y, w, h,
fill: { color: step.color }, line: { color: step.color },
rectRadius: 0.1,
shadow: { type: "outer", color: "000000", blur: 6, offset: 2, angle: 135, opacity: 0.15 }
});
s.addShape(pres.shapes.OVAL, {
x: x + w / 2 - 0.35, y: y + 0.12, w: 0.7, h: 0.7,
fill: { color: C.white, transparency: 15 }, line: { color: C.white, transparency: 15 }
});
s.addText(step.label.replace("STEP ", ""), {
x: x + w / 2 - 0.35, y: y + 0.12, w: 0.7, h: 0.7,
fontSize: 18, bold: true, color: step.color,
fontFace: "Calibri", align: "center", valign: "middle", margin: 0
});
s.addText(step.title, {
x: x + 0.1, y: y + 0.92, w: w - 0.2, h: 0.55,
fontSize: 9, bold: true, color: C.white,
fontFace: "Calibri", align: "center", valign: "middle"
});
s.addShape(pres.shapes.RECTANGLE, {
x: x + 0.15, y: y + 1.52, w: w - 0.3, h: 0.02,
fill: { color: C.white, transparency: 60 }, line: { color: C.white, transparency: 60 }
});
s.addText(step.detail, {
x: x + 0.1, y: y + 1.62, w: w - 0.2, h: h - 1.75,
fontSize: 7.8, color: C.white, fontFace: "Calibri",
valign: "top"
});
// Arrow between steps
if (i < steps.length - 1) {
s.addShape(pres.shapes.CHEVRON, {
x: x + w + 0.01, y: y + 1.9, w: 0.06, h: 0.35,
fill: { color: C.gold }, line: { color: C.gold }
});
}
});
}
// ════════════════════════════════════════════════════════════
// SLIDE 10 — INDIVIDUALIZATION OF THERAPY
// ════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
s.background = { color: C.offWhite };
addSlideHeader(s, "Individualization of Therapy", "Match drug to patient — comorbidities, eGFR, age, weight, cost");
addFooter(s, 10);
const rows = [
["Clinical Context", "Preferred Agent(s)", "Agents to Avoid"],
["Established ASCVD / High CV risk", "GLP-1 RA (liraglutide, semaglutide, dulaglutide)", "—"],
["Heart Failure (HFrEF)", "SGLT2 inhibitor (empagliflozin, dapagliflozin)", "TZDs; saxagliptin"],
["CKD (eGFR 25–60, albuminuria)", "SGLT2 inhibitor; linagliptin (no renal dose adjust)", "Metformin <30; glyburide; exenatide"],
["Obesity / weight loss priority", "GLP-1 RA (most weight loss), SGLT2 inhibitor", "TZDs, SUs (weight gain)"],
["Hypoglycaemia risk / elderly", "DPP-4i, GLP-1 RA, SGLT2i, TZD — all low hypo risk", "Glyburide (longest action = worst hypo)"],
["Liver disease", "DPP-4 inhibitors generally safe; metformin in mild disease only", "TZDs, metformin (severe hepatic disease)"],
["Cost-sensitive patient", "Metformin, generic SU, pioglitazone", "SGLT2i, GLP-1 RA (expensive)"],
["Pregnancy", "Insulin is preferred agent", "SGLT2i, DPP-4i, GLP-1 RA (avoid all)"],
];
const tableData = rows.map((r, i) => {
if (i === 0) {
return r.map(cell => ({
text: cell,
options: { bold: true, color: C.white, fill: { color: C.teal }, fontSize: 9 }
}));
}
return r.map((cell, j) => ({
text: cell,
options: {
fill: { color: j === 2 ? "FFF5F5" : (i % 2 === 0 ? "F0FAFA" : C.white) },
color: j === 2 ? C.red : C.navy,
fontSize: 8.2
}
}));
});
s.addTable(tableData, {
x: 0.18, y: 1.15, w: 9.62, h: 4.15,
fontFace: "Calibri",
border: { type: "solid", pt: 0.5, color: "BBDDDD" },
colW: [2.4, 4.1, 3.12]
});
}
// ════════════════════════════════════════════════════════════
// SLIDE 11 — HbA1c TARGETS & MONITORING
// ════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
s.background = { color: C.offWhite };
addSlideHeader(s, "HbA1c Targets & Monitoring", "Individualised targets — benefits of tight control vs. hypoglycaemia risk");
addFooter(s, 11);
// HbA1c target cards
const targets = [
{ pop: "Most non-elderly adults", target: "<7.0%", color: C.teal },
{ pop: "Short disease duration, no CVD, long life expectancy", target: "<6.5%", color: "1D6A47" },
{ pop: "Elderly, frail, limited life expectancy, multiple comorbidities", target: "7.5–8.5%", color: "8D6E63" },
{ pop: "Pregnancy (2nd–3rd trimester)", target: "<6.0–6.5%", color: "5C6BC0" },
{ pop: "Hypoglycaemia unawareness / advanced CKD", target: "<8.0–9.0%", color: C.red },
];
targets.forEach((t, i) => {
const x = 0.18 + (i % 3) * 3.25;
const y = i < 3 ? 1.15 : 2.65;
s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
x, y, w: 3.05, h: 1.3,
fill: { color: t.color }, line: { color: t.color }, rectRadius: 0.1,
shadow: { type: "outer", color: "000000", blur: 5, offset: 2, angle: 135, opacity: 0.12 }
});
s.addText(t.target, {
x, y: y + 0.08, w: 3.05, h: 0.65,
fontSize: 32, bold: true, color: C.white,
fontFace: "Calibri", align: "center", valign: "middle"
});
s.addText(t.pop, {
x: x + 0.1, y: y + 0.72, w: 2.85, h: 0.5,
fontSize: 7.5, color: C.white, fontFace: "Calibri",
align: "center", italic: true
});
});
// Monitoring table
const monRows = [
[{ text: "Parameter", options: { bold: true, color: C.white, fill: { color: C.navy } } },
{ text: "Frequency", options: { bold: true, color: C.white, fill: { color: C.navy } } },
{ text: "Notes", options: { bold: true, color: C.white, fill: { color: C.navy } } }],
[{ text: "HbA1c", options: { color: C.navy, fill: { color: "F0FAFA" } } },
{ text: "Every 3 months until at goal; then 6-monthly", options: { color: C.navy, fill: { color: "F0FAFA" } } },
{ text: "Reflects ~3-month average glucose", options: { color: C.navy, fill: { color: "F0FAFA" } } }],
[{ text: "eGFR / Creatinine", options: { color: C.navy, fill: { color: C.white } } },
{ text: "Baseline, then annually (more if declining)", options: { color: C.navy, fill: { color: C.white } } },
{ text: "Drives dose adjustment of multiple agents", options: { color: C.navy, fill: { color: C.white } } }],
[{ text: "Urine ACR", options: { color: C.navy, fill: { color: "F0FAFA" } } },
{ text: "Annually", options: { color: C.navy, fill: { color: "F0FAFA" } } },
{ text: "Albuminuria triggers SGLT2i / ACEi consideration", options: { color: C.navy, fill: { color: "F0FAFA" } } }],
[{ text: "Vitamin B12", options: { color: C.navy, fill: { color: C.white } } },
{ text: "Annually (if on metformin)", options: { color: C.navy, fill: { color: C.white } } },
{ text: "Long-term metformin depletes B12 → peripheral neuropathy", options: { color: C.navy, fill: { color: C.white } } }],
[{ text: "Foot examination", options: { color: C.navy, fill: { color: "F0FAFA" } } },
{ text: "Annually", options: { color: C.navy, fill: { color: "F0FAFA" } } },
{ text: "Monofilament + pulse assessment", options: { color: C.navy, fill: { color: "F0FAFA" } } }],
];
s.addTable(monRows, {
x: 0.18, y: 4.08, w: 9.62, h: 1.22,
fontFace: "Calibri", fontSize: 8,
border: { type: "solid", pt: 0.5, color: "BBDDDD" },
colW: [1.8, 3.0, 4.82]
});
}
// ════════════════════════════════════════════════════════════
// SLIDE 12 — KEY CLINICAL CAVEATS
// ════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
s.background = { color: C.offWhite };
addSlideHeader(s, "Key Clinical Caveats", "High-yield pearls for the wards, clinics & examinations");
addFooter(s, 12);
const caveats = [
{
n: "1", title: "Contrast + Metformin",
text: "Hold metformin 48 h before and after iodinated contrast if eGFR <60. Risk: contrast nephropathy → metformin accumulation → lactic acidosis.",
color: C.teal
},
{
n: "2", title: "Euglycaemic DKA (SGLT2i)",
text: "Glucose may be only mildly elevated (150–200 mg/dL). Check beta-hydroxybutyrate if patient on SGLT2i presents unwell. Hold perioperatively ≥48 h before surgery.",
color: C.red
},
{
n: "3", title: "SADMAN Sick-Day Rule",
text: "Stop Sulfonylureas, ACEi/ARB, Diuretics, Metformin, And NSAIDs during vomiting/diarrhoea illness. Add SGLT2 inhibitors to this list.",
color: C.red
},
{
n: "4", title: "Acarbose Hypoglycaemia",
text: "If hypoglycaemia occurs while on acarbose + SU/insulin, treat with PURE GLUCOSE (dextrose tablets/IV). Sucrose and fruit juice will not work — acarbose blocks sucrose hydrolysis.",
color: "7B6FA0"
},
{
n: "5", title: "GLP-1 RA + DPP-4i",
text: "Never combine — both target the incretin axis. DPP-4i has no additive benefit when a GLP-1 RA is present.",
color: "5C6BC0"
},
{
n: "6", title: "CV Outcomes Summary",
text: "DPP-4i = CV safe (no benefit). GLP-1 RA = ↓ MACE (atherosclerosis-driven). SGLT2i = ↓ HF hospitalisation + ↓ CKD progression (haemodynamic + renal tubular mechanism).",
color: C.navy
},
];
caveats.forEach((cv, i) => {
const col = i % 2;
const row = Math.floor(i / 2);
const x = 0.18 + col * 4.9;
const y = 1.15 + row * 1.4;
const w = 4.7;
const h = 1.28;
s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
x, y, w, h,
fill: { color: C.white },
line: { color: cv.color, pt: 1.5 },
rectRadius: 0.08,
shadow: { type: "outer", color: "000000", blur: 6, offset: 2, angle: 135, opacity: 0.09 }
});
// Number badge left
s.addShape(pres.shapes.OVAL, {
x: x + 0.1, y: y + 0.1, w: 0.38, h: 0.38,
fill: { color: cv.color }, line: { color: cv.color }
});
s.addText(cv.n, {
x: x + 0.1, y: y + 0.1, w: 0.38, h: 0.38,
fontSize: 11, bold: true, color: C.white,
fontFace: "Calibri", align: "center", valign: "middle", margin: 0
});
s.addText(cv.title, {
x: x + 0.58, y: y + 0.1, w: w - 0.68, h: 0.35,
fontSize: 9.5, bold: true, color: cv.color,
fontFace: "Calibri", valign: "middle", margin: 0
});
s.addText(cv.text, {
x: x + 0.15, y: y + 0.5, w: w - 0.25, h: h - 0.56,
fontSize: 8, color: C.slate, fontFace: "Calibri", valign: "top"
});
});
}
// ════════════════════════════════════════════════════════════
// SLIDE 13 — RENAL DOSING QUICK REFERENCE
// ════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
s.background = { color: C.offWhite };
addSlideHeader(s, "Renal Dosing Quick Reference", "As eGFR declines, the pharmacological toolkit narrows");
addFooter(s, 13);
const renalData = [
[
{ text: "Drug Class", options: { bold: true, color: C.white, fill: { color: C.navy } } },
{ text: "eGFR ≥60", options: { bold: true, color: C.white, fill: { color: C.navy } } },
{ text: "eGFR 45–59", options: { bold: true, color: C.white, fill: { color: C.navy } } },
{ text: "eGFR 30–44", options: { bold: true, color: C.white, fill: { color: C.navy } } },
{ text: "eGFR 15–29", options: { bold: true, color: C.white, fill: { color: C.navy } } },
{ text: "eGFR <15 / ESRD", options: { bold: true, color: C.white, fill: { color: C.navy } } },
],
["Metformin",
{ text: "✓ Full dose", options: { fill: { color: "E6F9EE" }, color: "1D6A47" } },
{ text: "✓ Full dose", options: { fill: { color: "E6F9EE" }, color: "1D6A47" } },
{ text: "⚠ Reduce / caution", options: { fill: { color: "FFF8E6" }, color: "C07000" } },
{ text: "✗ Avoid", options: { fill: { color: "FFE8E8" }, color: C.red } },
{ text: "✗ Avoid", options: { fill: { color: "FFE8E8" }, color: C.red } },
],
["Sulfonylureas (Glipizide, Glimepiride)",
{ text: "✓ Full dose", options: { fill: { color: "E6F9EE" }, color: "1D6A47" } },
{ text: "✓ Low dose, caution", options: { fill: { color: "FFF8E6" }, color: "C07000" } },
{ text: "⚠ Low dose only", options: { fill: { color: "FFF8E6" }, color: "C07000" } },
{ text: "✗ Avoid glyburide; glipizide low dose only", options: { fill: { color: "FFE8E8" }, color: C.red } },
{ text: "✗ Avoid all SUs", options: { fill: { color: "FFE8E8" }, color: C.red } },
],
["DPP-4i — Linagliptin",
{ text: "✓ 5 mg od", options: { fill: { color: "E6F9EE" }, color: "1D6A47" } },
{ text: "✓ 5 mg od", options: { fill: { color: "E6F9EE" }, color: "1D6A47" } },
{ text: "✓ 5 mg od", options: { fill: { color: "E6F9EE" }, color: "1D6A47" } },
{ text: "✓ 5 mg od", options: { fill: { color: "E6F9EE" }, color: "1D6A47" } },
{ text: "✓ 5 mg od (no adjustment)", options: { fill: { color: "E6F9EE" }, color: "1D6A47" } },
],
["DPP-4i — Sitagliptin",
{ text: "✓ 100 mg od", options: { fill: { color: "E6F9EE" }, color: "1D6A47" } },
{ text: "✓ 100 mg od", options: { fill: { color: "E6F9EE" }, color: "1D6A47" } },
{ text: "⚠ 50 mg od", options: { fill: { color: "FFF8E6" }, color: "C07000" } },
{ text: "⚠ 25 mg od", options: { fill: { color: "FFF8E6" }, color: "C07000" } },
{ text: "⚠ 25 mg od", options: { fill: { color: "FFF8E6" }, color: "C07000" } },
],
["SGLT2 Inhibitors",
{ text: "✓ Full dose", options: { fill: { color: "E6F9EE" }, color: "1D6A47" } },
{ text: "✓ Full dose (glycaemic + CV benefit)", options: { fill: { color: "E6F9EE" }, color: "1D6A47" } },
{ text: "⚠ Glycaemic efficacy ↓; CV/renal benefit continues", options: { fill: { color: "FFF8E6" }, color: "C07000" } },
{ text: "⚠ No glycaemic effect; CV/renal benefit (empagliflozin, dapagliflozin)", options: { fill: { color: "FFF8E6" }, color: "C07000" } },
{ text: "✗ No use at ESRD for glycaemia; discontinue", options: { fill: { color: "FFE8E8" }, color: C.red } },
],
["GLP-1 RA",
{ text: "✓ Full dose", options: { fill: { color: "E6F9EE" }, color: "1D6A47" } },
{ text: "✓ Full dose", options: { fill: { color: "E6F9EE" }, color: "1D6A47" } },
{ text: "✓ Most — full dose (avoid exenatide)", options: { fill: { color: "E6F9EE" }, color: "1D6A47" } },
{ text: "⚠ Semaglutide, dulaglutide — use with caution; avoid exenatide", options: { fill: { color: "FFF8E6" }, color: "C07000" } },
{ text: "✗ Limited data; generally avoid", options: { fill: { color: "FFE8E8" }, color: C.red } },
],
["Insulin",
{ text: "✓ Standard dosing", options: { fill: { color: "E6F9EE" }, color: "1D6A47" } },
{ text: "✓ Standard dosing", options: { fill: { color: "E6F9EE" }, color: "1D6A47" } },
{ text: "✓ Monitor — ↑ hypoglycaemia risk", options: { fill: { color: "E6F9EE" }, color: "1D6A47" } },
{ text: "✓ Reduce dose — kidneys clear less insulin", options: { fill: { color: "FFF8E6" }, color: "C07000" } },
{ text: "✓ Use but reduce dose; highest hypo risk", options: { fill: { color: "FFF8E6" }, color: "C07000" } },
],
].map((r, i) => {
if (i === 0) return r;
return r.map((cell, j) => {
if (j === 0) {
return { text: cell, options: { bold: true, color: C.navy, fill: { color: i % 2 === 0 ? "F0F8FF" : C.white }, fontSize: 8 } };
}
if (typeof cell === "string") {
return { text: cell, options: { color: C.navy, fill: { color: C.white }, fontSize: 7.5 } };
}
return { text: cell.text, options: { ...cell.options, fontSize: 7.5 } };
});
});
s.addTable(renalData, {
x: 0.18, y: 1.15, w: 9.62, h: 4.15,
fontFace: "Calibri",
border: { type: "solid", pt: 0.5, color: "BBCCDD" },
colW: [2.0, 1.2, 1.3, 1.6, 1.9, 1.62]
});
}
// ════════════════════════════════════════════════════════════
// SLIDE 14 — SUMMARY / TAKE-HOME
// ════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
s.background = { color: C.navy };
// Background decorative shapes
s.addShape(pres.shapes.RECTANGLE, {
x: 0, y: 0, w: 10, h: 1.1,
fill: { color: C.teal }, line: { color: C.teal }
});
s.addShape(pres.shapes.RECTANGLE, {
x: 0, y: 4.5, w: 10, h: 1.125,
fill: { color: C.teal, transparency: 80 }, line: { color: C.teal, transparency: 80 }
});
s.addShape(pres.shapes.RECTANGLE, {
x: 8.5, y: 0, w: 1.5, h: 5.625,
fill: { color: C.gold, transparency: 92 }, line: { color: C.gold, transparency: 92 }
});
s.addText("SUMMARY & TAKE-HOME POINTS", {
x: 0.3, y: 0.1, w: 9.4, h: 0.9,
fontSize: 22, bold: true, color: C.white,
fontFace: "Calibri", charSpacing: 2, valign: "middle"
});
const points = [
{ icon: "▶", text: "Metformin remains first-line unless eGFR <30, contrast exposure, or significant hepatic disease." },
{ icon: "▶", text: "For ASCVD/high CV risk → add GLP-1 RA with proven CVOT benefit early (liraglutide, semaglutide, dulaglutide)." },
{ icon: "▶", text: "For Heart Failure or CKD with albuminuria → SGLT2 inhibitor is the priority second agent (benefits are insulin-independent)." },
{ icon: "▶", text: "DPP-4 inhibitors are CV safe but offer no CV benefit; avoid saxagliptin in HF." },
{ icon: "▶", text: "Euglycaemic DKA on SGLT2i: check ketones, not just glucose. HOLD perioperatively." },
{ icon: "▶", text: "Individualize HbA1c targets — tight control prevents microvascular disease; lax targets acceptable in elderly/frail." },
{ icon: "▶", text: "Never combine GLP-1 RA + DPP-4i. Always re-evaluate every 3 months and escalate without delay." },
];
points.forEach((p, i) => {
s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
x: 0.22, y: 1.2 + i * 0.47, w: 8.3, h: 0.4,
fill: { color: C.white, transparency: 93 },
line: { color: C.tealLight, pt: 0.5, transparency: 60 },
rectRadius: 0.05
});
s.addText([
{ text: `${p.icon} `, options: { color: C.gold, bold: true } },
{ text: p.text, options: { color: C.white } }
], {
x: 0.35, y: 1.2 + i * 0.47, w: 8.1, h: 0.4,
fontSize: 9, fontFace: "Calibri", valign: "middle"
});
});
s.addText("Sources: Lippincott Pharmacology 7e · Washington Manual of Medical Therapeutics · Goldman-Cecil Medicine · Textbook of Family Medicine 9e · Comprehensive Clinical Nephrology 7e", {
x: 0.3, y: 4.62, w: 9.4, h: 0.4,
fontSize: 6.5, color: C.tealLight, fontFace: "Calibri",
italic: true, valign: "middle"
});
}
// ════════════════════════════════════════════════════════════
// WRITE FILE
// ════════════════════════════════════════════════════════════
pres.writeFile({ fileName: "Oral_Hypoglycemic_Agents_PG_IM.pptx" })
.then(() => console.log("✅ Oral_Hypoglycemic_Agents_PG_IM.pptx created successfully"))
.catch(err => console.error("❌ Error:", err));
How to run
# 1. Install dependency (only needed once)
npm install pptxgenjs
# 2. Run the script
node oha_presentation.js
# Output: Oral_Hypoglycemic_Agents_PG_IM.pptx
What's inside (14 slides)
| # | Slide |
|---|
| 1 | Title slide — dark navy with geometric teal/gold accents |
| 2 | Drug class overview — 9 colour-coded class tiles |
| 3 | Metformin — MOA, dosing, renal thresholds, monitoring |
| 4 | Sulfonylureas + Meglitinides — mechanism banner, drug table, warnings |
| 5 | Thiazolidinediones — PPARγ mechanism, pioglitazone vs rosiglitazone, full contraindications |
| 6 | DPP-4 inhibitors — drug/dose/renal table, saxagliptin HF warning |
| 7 | SGLT2 inhibitors — CVOT outcomes table, euglycaemic DKA, periop hold |
| 8 | GLP-1 RAs, alpha-glucosidase inhibitors, colesevelam, bromocriptine |
| 9 | Treatment escalation algorithm — 5-step colour-coded vertical columns |
| 10 | Individualization table — context vs. preferred vs. avoid |
| 11 | HbA1c targets (big number cards) + monitoring schedule table |
| 12 | 6 clinical caveat cards — contrast, euglycaemic DKA, SADMAN, acarbose glucose rule, GLP-1+DPP-4, CVOT summary |
| 13 | Renal dosing quick reference — full eGFR band table across all classes |
| 14 | Summary / take-home — dark closing slide with 7 key bullet points |