Pts bsl ff is 201 n pp is 325 he is cutrently on met500 1-0-1n hlf and glimi 1 mg od and he cant afford expensive drugs so which tablets can i change and add So give me all the alternatives which canni give this pt pt is 45yrs male
affordable oral diabetes medications alternatives metformin glimepiride poor glycemic control type 2 diabetes India
| Drug | Current | Optimal Target Dose | Comment |
|---|---|---|---|
| Metformin | 500 mg BD | 500 mg TDS or 1000 mg BD (up to 2000 mg/day) | Titrate up by 500 mg every 1-2 weeks with food to reduce GI side effects |
| Glimepiride | 1 mg OD | 2-4 mg OD (up to 8 mg max) | Titrate monthly; take 30 min before breakfast |
Metformin 1000 mg BD + Glimepiride 2-4 mg OD
Metformin 1000 mg BD + Glimepiride 2 mg OD + Pioglitazone 15 mg OD (~INR 5-10/day total; proven in Indian population)
Metformin 1000 mg BD + Glimepiride 2 mg OD + Voglibose 0.2 mg TDS (with meals) (~INR 8-12/day total)
Glipizide 5 mg + Metformin 500 mg FDC tablet BD (pre-made combination) (~INR 2-4/day; very cheap, good adherence with single tablet)
| Drug Class | Examples | Why Avoid |
|---|---|---|
| SGLT2 inhibitors | Dapagliflozin, Empagliflozin | Very expensive (INR 50-100/day) |
| DPP-4 inhibitors | Sitagliptin, Vildagliptin | Expensive (INR 30-60/day) |
| GLP-1 agonists | Semaglutide, Liraglutide | Very expensive, injectable |
Create a diabetes medication flowchart (PPT) for affordable regimens in India
mkdir -p /home/daytona/workspace/diabetes-ppt && ls /home/daytona/workspace/diabetes-ppt
~/diabetes-ppt/create_ppt.js
const pptxgen = require("pptxgenjs");
const pres = new pptxgen();
pres.layout = "LAYOUT_WIDE"; // 13.3 x 7.5 inches
pres.title = "Affordable Diabetes Medication Flowchart - India";
pres.author = "Clinical Guide";
// ─── COLOUR PALETTE ───────────────────────────────────────────────
const C = {
navy: "0A2342", // dominant dark background
teal: "007C91", // section headers
green: "2ECC71", // first-line / go boxes
amber: "F39C12", // second-line / caution boxes
red: "E74C3C", // avoid / stop boxes
white: "FFFFFF",
offwhite: "F0F4F8",
gray: "8395A7",
darktext: "1A1A2E",
lightblue:"D6EAF8",
};
// ══════════════════════════════════════════════════════════════════
// SLIDE 1 — TITLE SLIDE
// ══════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
// Dark navy background
sl.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 13.3, h: 7.5, fill: { color: C.navy }, line: { color: C.navy } });
// Teal accent bar
sl.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 0.18, h: 7.5, fill: { color: C.teal }, line: { color: C.teal } });
// Green accent bar
sl.addShape(pres.shapes.RECTANGLE, { x: 0.18, y: 0, w: 0.08, h: 7.5, fill: { color: C.green }, line: { color: C.green } });
// Pill icon shape (rounded rect)
sl.addShape(pres.shapes.ROUNDED_RECTANGLE, {
x: 1.0, y: 1.5, w: 1.5, h: 0.6,
fill: { color: C.teal }, line: { color: C.teal }, rectRadius: 0.3
});
sl.addText("💊 Rx", { x: 1.0, y: 1.5, w: 1.5, h: 0.6, fontSize: 18, color: C.white, bold: true, align: "center", valign: "middle" });
sl.addText("Affordable Diabetes", {
x: 0.8, y: 2.2, w: 11, h: 1.1,
fontSize: 44, color: C.white, bold: true, align: "left", fontFace: "Calibri"
});
sl.addText("Medication Flowchart for India", {
x: 0.8, y: 3.2, w: 11, h: 0.85,
fontSize: 36, color: C.teal, bold: false, align: "left", fontFace: "Calibri"
});
// Divider line
sl.addShape(pres.shapes.RECTANGLE, { x: 0.8, y: 4.15, w: 8, h: 0.04, fill: { color: C.green }, line: { color: C.green } });
sl.addText("Type 2 Diabetes • Generic drugs only • INR-conscious prescribing", {
x: 0.8, y: 4.35, w: 11, h: 0.45,
fontSize: 15, color: C.gray, italic: true, align: "left"
});
// Key stats banner
const statBoxes = [
{ label: "1st Line", sub: "Metformin", color: C.green },
{ label: "2nd Line", sub: "+ Glimepiride\nor Glipizide", color: C.amber },
{ label: "3rd Line", sub: "+ Pioglitazone\nor Voglibose", color: C.teal },
{ label: "Avoid", sub: "SGLT2i / DPP4i\n(too costly)", color: C.red },
];
statBoxes.forEach((b, i) => {
const x = 0.8 + i * 3.05;
sl.addShape(pres.shapes.ROUNDED_RECTANGLE, {
x, y: 5.1, w: 2.8, h: 1.8,
fill: { color: b.color }, line: { color: b.color }, rectRadius: 0.1
});
sl.addText(b.label, { x, y: 5.15, w: 2.8, h: 0.55, fontSize: 17, color: C.white, bold: true, align: "center", valign: "middle" });
sl.addShape(pres.shapes.RECTANGLE, { x, y: 5.68, w: 2.8, h: 0.04, fill: { color: "FFFFFF" }, line: { color: "FFFFFF" } });
sl.addText(b.sub, { x, y: 5.72, w: 2.8, h: 1.1, fontSize: 13, color: C.white, align: "center", valign: "top" });
});
}
// ══════════════════════════════════════════════════════════════════
// SLIDE 2 — DIAGNOSIS & TARGETS
// ══════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
sl.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 13.3, h: 7.5, fill: { color: C.offwhite }, line: { color: C.offwhite } });
// Header bar
sl.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 13.3, h: 0.8, fill: { color: C.navy }, line: { color: C.navy } });
sl.addText("Step 1 — Diagnose & Set Targets", {
x: 0.3, y: 0, w: 12, h: 0.8, fontSize: 22, color: C.white, bold: true, valign: "middle"
});
// Diagnosis criteria box
sl.addShape(pres.shapes.ROUNDED_RECTANGLE, {
x: 0.4, y: 1.0, w: 5.8, h: 5.8,
fill: { color: C.white }, line: { color: C.teal, pt: 2 }, rectRadius: 0.15,
shadow: { type: "outer", color: "000000", blur: 5, offset: 2, angle: 135, opacity: 0.12 }
});
sl.addShape(pres.shapes.RECTANGLE, { x: 0.4, y: 1.0, w: 5.8, h: 0.55, fill: { color: C.teal }, line: { color: C.teal } });
sl.addText("Diagnosis Criteria (ADA 2024)", {
x: 0.4, y: 1.0, w: 5.8, h: 0.55, fontSize: 14, color: C.white, bold: true, align: "center", valign: "middle"
});
const diagItems = [
"FBS ≥ 126 mg/dL (fasting ≥ 8 hrs)",
"PPBS ≥ 200 mg/dL (2-hr post 75g OGTT)",
"Random BS ≥ 200 mg/dL + symptoms",
"HbA1c ≥ 6.5%",
];
diagItems.forEach((txt, i) => {
sl.addShape(pres.shapes.RECTANGLE, {
x: 0.55, y: 1.75 + i * 0.85, w: 5.5, h: 0.7,
fill: { color: C.lightblue }, line: { color: C.teal, pt: 1 }
});
sl.addText(`✓ ${txt}`, {
x: 0.55, y: 1.75 + i * 0.85, w: 5.5, h: 0.7,
fontSize: 13, color: C.darktext, align: "left", valign: "middle",
margin: [0, 0.1, 0, 0.1]
});
});
// Target box
sl.addShape(pres.shapes.ROUNDED_RECTANGLE, {
x: 7.0, y: 1.0, w: 5.9, h: 5.8,
fill: { color: C.white }, line: { color: C.green, pt: 2 }, rectRadius: 0.15,
shadow: { type: "outer", color: "000000", blur: 5, offset: 2, angle: 135, opacity: 0.12 }
});
sl.addShape(pres.shapes.RECTANGLE, { x: 7.0, y: 1.0, w: 5.9, h: 0.55, fill: { color: C.green }, line: { color: C.green } });
sl.addText("Glycaemic Targets (General)", {
x: 7.0, y: 1.0, w: 5.9, h: 0.55, fontSize: 14, color: C.white, bold: true, align: "center", valign: "middle"
});
const targetItems = [
["HbA1c", "< 7.0%"],
["FBS", "80 – 130 mg/dL"],
["PPBS (2-hr)", "< 180 mg/dL"],
["BP", "< 130/80 mmHg"],
["LDL", "< 100 mg/dL"],
];
targetItems.forEach(([param, val], i) => {
sl.addShape(pres.shapes.RECTANGLE, {
x: 7.15, y: 1.75 + i * 0.85, w: 2.2, h: 0.7,
fill: { color: C.navy }, line: { color: C.navy }
});
sl.addText(param, {
x: 7.15, y: 1.75 + i * 0.85, w: 2.2, h: 0.7,
fontSize: 13, color: C.white, bold: true, align: "center", valign: "middle"
});
sl.addShape(pres.shapes.RECTANGLE, {
x: 9.4, y: 1.75 + i * 0.85, w: 3.4, h: 0.7,
fill: { color: i % 2 === 0 ? "E8F8F5" : "FDFEFE" }, line: { color: C.green, pt: 1 }
});
sl.addText(val, {
x: 9.4, y: 1.75 + i * 0.85, w: 3.4, h: 0.7,
fontSize: 13, color: C.darktext, bold: true, align: "center", valign: "middle"
});
});
}
// ══════════════════════════════════════════════════════════════════
// SLIDE 3 — MAIN TREATMENT FLOWCHART
// ══════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
sl.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 13.3, h: 7.5, fill: { color: C.offwhite }, line: { color: C.offwhite } });
sl.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 13.3, h: 0.8, fill: { color: C.navy }, line: { color: C.navy } });
sl.addText("Treatment Flowchart — Affordable Oral Agents", {
x: 0.3, y: 0, w: 12, h: 0.8, fontSize: 22, color: C.white, bold: true, valign: "middle"
});
// Helper: flowchart box
function addBox(sl, x, y, w, h, title, sub, bgColor, textColor) {
sl.addShape(pres.shapes.ROUNDED_RECTANGLE, {
x, y, w, h,
fill: { color: bgColor }, line: { color: bgColor }, rectRadius: 0.12,
shadow: { type: "outer", color: "000000", blur: 4, offset: 2, angle: 135, opacity: 0.15 }
});
sl.addText(title, { x, y, w, h: h * 0.45, fontSize: 12, color: textColor, bold: true, align: "center", valign: "middle", margin: 0 });
if (sub) {
sl.addText(sub, { x, y: y + h * 0.45, w, h: h * 0.55, fontSize: 10, color: textColor, align: "center", valign: "top", margin: [0.03, 0.05, 0, 0.05] });
}
}
// Helper: downward arrow
function addArrow(sl, x, y, label) {
sl.addShape(pres.shapes.LINE, { x, y, w: 0, h: 0.28, line: { color: C.navy, pt: 2 } });
// arrowhead triangle
sl.addShape(pres.shapes.ISOSCELES_TRIANGLE, {
x: x - 0.1, y: y + 0.2, w: 0.2, h: 0.15,
fill: { color: C.navy }, line: { color: C.navy }, rotate: 180
});
if (label) {
sl.addText(label, { x: x + 0.05, y: y + 0.02, w: 1.5, h: 0.25, fontSize: 9, color: C.gray, italic: true });
}
}
// START box
sl.addShape(pres.shapes.ELLIPSE, {
x: 5.35, y: 0.95, w: 2.6, h: 0.55,
fill: { color: C.navy }, line: { color: C.navy }
});
sl.addText("NEW T2DM DIAGNOSIS", {
x: 5.35, y: 0.95, w: 2.6, h: 0.55, fontSize: 11, color: C.white, bold: true, align: "center", valign: "middle"
});
// Arrow down
addArrow(sl, 6.65, 1.5, "");
// LIFESTYLE box
sl.addShape(pres.shapes.ROUNDED_RECTANGLE, {
x: 4.8, y: 1.78, w: 3.7, h: 0.65,
fill: { color: "2C3E50" }, line: { color: "2C3E50" }, rectRadius: 0.08
});
sl.addText("🥗 Lifestyle + Diet + Exercise (always continue)", {
x: 4.8, y: 1.78, w: 3.7, h: 0.65, fontSize: 11, color: C.white, bold: true, align: "center", valign: "middle"
});
// Arrow
addArrow(sl, 6.65, 2.43, "");
// STEP 1 — Metformin
addBox(sl, 4.6, 2.72, 4.1, 0.9,
"STEP 1 — METFORMIN (1st Line)",
"500 mg BD → titrate to 1000 mg BD (target 2 g/day)\nCheapest: ~INR 1–2/tab | No hypoglycemia",
C.green, C.white);
// HbA1c not at goal?
addArrow(sl, 6.65, 3.62, "");
sl.addShape(pres.shapes.ROUNDED_RECTANGLE, {
x: 5.5, y: 3.9, w: 2.3, h: 0.5,
fill: { color: C.amber }, line: { color: C.amber }, rectRadius: 0.08
});
sl.addText("HbA1c NOT at goal in 3 months?", {
x: 5.5, y: 3.9, w: 2.3, h: 0.5, fontSize: 9.5, color: C.white, bold: true, align: "center", valign: "middle"
});
// Branches from HbA1c box — two arrows go left and right
// Left arrow to sulfonylurea
sl.addShape(pres.shapes.LINE, { x: 4.3, y: 4.15, w: 1.2, h: 0, line: { color: C.navy, pt: 2 } });
sl.addShape(pres.shapes.ISOSCELES_TRIANGLE, { x: 4.1, y: 4.05, w: 0.2, h: 0.15, fill: { color: C.navy }, line: { color: C.navy }, rotate: 270 });
// Right arrow to TZD
sl.addShape(pres.shapes.LINE, { x: 7.8, y: 4.15, w: 1.2, h: 0, line: { color: C.navy, pt: 2 } });
sl.addShape(pres.shapes.ISOSCELES_TRIANGLE, { x: 9.0, y: 4.05, w: 0.2, h: 0.15, fill: { color: C.navy }, line: { color: C.navy }, rotate: 90 });
// Left column: Sulfonylurea
addBox(sl, 1.4, 3.5, 2.8, 1.2,
"ADD Sulfonylurea (2nd Line)",
"Glimepiride 1→4 mg OD\nor Glipizide 5→20 mg/day\n~INR 1–3/tab",
C.amber, C.white);
// Right column: Alpha-glucosidase inhibitor / TZD
addBox(sl, 9.1, 3.5, 2.8, 1.2,
"ADD Pioglitazone OR Voglibose",
"Pio 15–30 mg OD (~INR 3/tab)\nor Voglibose 0.2 mg TDS (~INR 4/tab)\n(Best for high PPBS)",
C.teal, C.white);
// Arrows down from both columns
sl.addShape(pres.shapes.LINE, { x: 2.8, y: 4.7, w: 0, h: 0.35, line: { color: C.navy, pt: 2 } });
sl.addShape(pres.shapes.ISOSCELES_TRIANGLE, { x: 2.7, y: 4.97, w: 0.2, h: 0.15, fill: { color: C.navy }, line: { color: C.navy }, rotate: 180 });
sl.addShape(pres.shapes.LINE, { x: 10.5, y: 4.7, w: 0, h: 0.35, line: { color: C.navy, pt: 2 } });
sl.addShape(pres.shapes.ISOSCELES_TRIANGLE, { x: 10.4, y: 4.97, w: 0.2, h: 0.15, fill: { color: C.navy }, line: { color: C.navy }, rotate: 180 });
// STEP 3 — Triple combo
addBox(sl, 1.4, 5.1, 2.8, 1.0,
"STEP 3 — Triple Combo",
"Met + Glimi/Glipizide + Pio\nor + Voglibose\nReview after 3 months",
"1A5276", C.white);
addBox(sl, 9.1, 5.1, 2.8, 1.0,
"STEP 3 — Combination",
"Met + Pio + Glimepiride\nOR Met + Voglibose + SU\n~INR 5–12/day total",
"1A5276", C.white);
// Centre — Still not controlled?
sl.addShape(pres.shapes.LINE, { x: 4.2, y: 5.6, w: 1.6, h: 0, line: { color: C.navy, pt: 1.5, dashType: "dash" } });
sl.addShape(pres.shapes.LINE, { x: 7.5, y: 5.6, w: 1.6, h: 0, line: { color: C.navy, pt: 1.5, dashType: "dash" } });
sl.addShape(pres.shapes.ROUNDED_RECTANGLE, {
x: 5.1, y: 5.2, w: 3.1, h: 0.75,
fill: { color: C.red }, line: { color: C.red }, rectRadius: 0.08
});
sl.addText("Still uncontrolled or HbA1c >9%?", {
x: 5.1, y: 5.2, w: 3.1, h: 0.75, fontSize: 10, color: C.white, bold: true, align: "center", valign: "middle"
});
// Arrow to insulin
addArrow(sl, 6.65, 5.95, "");
sl.addShape(pres.shapes.ROUNDED_RECTANGLE, {
x: 5.0, y: 6.23, w: 3.3, h: 0.75,
fill: { color: C.red }, line: { color: C.red }, rectRadius: 0.08
});
sl.addText("Add Insulin (Basal: NPH 0.1–0.2 U/kg OD)\n→ Most affordable option; self-titrate by 2U every 3 days", {
x: 5.0, y: 6.23, w: 3.3, h: 0.75, fontSize: 9, color: C.white, align: "center", valign: "middle"
});
}
// ══════════════════════════════════════════════════════════════════
// SLIDE 4 — DRUG COMPARISON TABLE
// ══════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
sl.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 13.3, h: 7.5, fill: { color: C.offwhite }, line: { color: C.offwhite } });
sl.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 13.3, h: 0.8, fill: { color: C.navy }, line: { color: C.navy } });
sl.addText("Affordable Drug Comparison — At a Glance", {
x: 0.3, y: 0, w: 12, h: 0.8, fontSize: 22, color: C.white, bold: true, valign: "middle"
});
// Table headers
const cols = [
{ label: "Drug", x: 0.2, w: 1.9 },
{ label: "Class", x: 2.15, w: 1.8 },
{ label: "Dose", x: 4.0, w: 2.2 },
{ label: "HbA1c↓", x: 6.25, w: 1.3 },
{ label: "Hypo?", x: 7.6, w: 1.1 },
{ label: "Weight", x: 8.75, w: 1.1 },
{ label: "Cost/day", x: 9.9, w: 1.5 },
{ label: "Key Caution", x: 11.45, w: 1.65 },
];
cols.forEach(c => {
sl.addShape(pres.shapes.RECTANGLE, {
x: c.x, y: 0.9, w: c.w, h: 0.5,
fill: { color: C.teal }, line: { color: C.white, pt: 1 }
});
sl.addText(c.label, {
x: c.x, y: 0.9, w: c.w, h: 0.5, fontSize: 11, color: C.white, bold: true, align: "center", valign: "middle"
});
});
const rows = [
["Metformin", "Biguanide", "500–2000 mg/day in 2 doses", "1.5–2%", "No", "Neutral/↓", "~INR 2", "Avoid if eGFR <30"],
["Glimepiride", "Sulfonylurea", "1–8 mg OD (pre-breakfast)", "1–2%", "Yes", "↑", "~INR 2–3", "Risk of hypoglycemia"],
["Glipizide", "Sulfonylurea", "5–20 mg/day (BD)", "1–2%", "Yes", "↑", "~INR 1–2", "Shorter-acting, safer"],
["Pioglitazone", "TZD", "15–30 mg OD", "0.5–1.4%", "No", "↑↑", "~INR 3–5", "Edema, CHF CI, Bladder Ca"],
["Voglibose", "α-GI", "0.2–0.3 mg TDS (with meals)", "0.5–0.8%", "No", "Neutral", "~INR 4–6", "GI upset, flatulence"],
["NPH Insulin", "Insulin", "0.1–0.2 U/kg OD nocte", "2–4%", "Yes", "↑↑", "~INR 5–8", "Hypoglycemia, SMBG needed"],
["Repaglinide", "Meglitinide", "0.5–2 mg TDS pre-meal", "0.5–1.5%", "Yes", "↑", "~INR 5–8", "Don't combine with SU"],
["Glipizide+Met FDC", "SU+Biguanide", "5/500 mg BD", "1.5–2.5%", "Yes", "↑", "~INR 2–4", "Best cost adherence"],
];
const rowColors = ["FFFFFF", "EBF5FB", "FFFFFF", "EBF5FB", "FFFFFF", "EBF5FB", "FFFFFF", "EBF5FB"];
rows.forEach((row, ri) => {
cols.forEach((c, ci) => {
const highlight = ci === 0 && (ri === 0 || ri === 7); // Metformin + FDC highlighted
sl.addShape(pres.shapes.RECTANGLE, {
x: c.x, y: 1.4 + ri * 0.68, w: c.w, h: 0.68,
fill: { color: highlight ? "D5F5E3" : rowColors[ri] },
line: { color: "CCCCCC", pt: 1 }
});
sl.addText(row[ci], {
x: c.x, y: 1.4 + ri * 0.68, w: c.w, h: 0.68,
fontSize: 9.5, color: C.darktext, align: "center", valign: "middle",
bold: ci === 0, margin: [0, 0.04, 0, 0.04]
});
});
});
// Legend
sl.addText("🟢 Recommended first choices for cost-constrained patients | CI = Contraindicated | SU = Sulfonylurea | TZD = Thiazolidinedione | α-GI = Alpha-glucosidase inhibitor", {
x: 0.2, y: 7.05, w: 12.9, h: 0.35, fontSize: 8.5, color: C.gray, align: "left", italic: true
});
}
// ══════════════════════════════════════════════════════════════════
// SLIDE 5 — SPECIFIC REGIMENS
// ══════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
sl.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 13.3, h: 7.5, fill: { color: C.navy }, line: { color: C.navy } });
sl.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 13.3, h: 0.8, fill: { color: C.teal }, line: { color: C.teal } });
sl.addText("Recommended Regimens — Cost-Constrained Patient", {
x: 0.3, y: 0, w: 12, h: 0.8, fontSize: 22, color: C.white, bold: true, valign: "middle"
});
const regimens = [
{
step: "REGIMEN 1",
title: "Optimise Existing (Zero Extra Cost)",
color: C.green,
items: [
"Metformin 500 mg → 1000 mg BD (titrate over 2 weeks)",
"Glimepiride 1 mg → 2–4 mg OD (titrate monthly)",
"Review HbA1c at 3 months",
"Cost: ~INR 4–6/day",
],
note: "First step before adding any new drug"
},
{
step: "REGIMEN 2",
title: "Best Affordable Triple Therapy",
color: C.amber,
items: [
"Metformin 1000 mg BD",
"Glimepiride 2 mg OD",
"Pioglitazone 15 mg OD",
"Cost: ~INR 8–12/day",
],
note: "Proven in Indian population studies"
},
{
step: "REGIMEN 3",
title: "High PPBS → Target Postprandial",
color: C.teal,
items: [
"Metformin 1000 mg BD",
"Glimepiride 2 mg OD",
"Voglibose 0.2 mg TDS with meals",
"Cost: ~INR 10–14/day",
],
note: "Best when PP glucose >> fasting glucose"
},
{
step: "REGIMEN 4",
title: "Simplest / Cheapest FDC",
color: "7D3C98",
items: [
"Glipizide 5 mg + Metformin 500 mg FDC tablet BD",
"Single tablet = better adherence",
"Can uptitrate to Glipizide 10 mg + Met 1000 mg BD",
"Cost: ~INR 2–4/day",
],
note: "Best for adherence & cost combined"
},
];
regimens.forEach((r, i) => {
const x = 0.25 + (i % 2) * 6.55;
const y = 1.0 + Math.floor(i / 2) * 3.1;
// card bg
sl.addShape(pres.shapes.ROUNDED_RECTANGLE, {
x, y, w: 6.2, h: 2.8,
fill: { color: "1B2A3B" }, line: { color: r.color, pt: 2 }, rectRadius: 0.15
});
// header
sl.addShape(pres.shapes.RECTANGLE, { x, y, w: 6.2, h: 0.55, fill: { color: r.color }, line: { color: r.color } });
sl.addText(`${r.step} — ${r.title}`, {
x, y, w: 6.2, h: 0.55, fontSize: 12.5, color: C.white, bold: true, align: "center", valign: "middle"
});
// bullet items
r.items.forEach((item, ii) => {
sl.addText(`• ${item}`, {
x: x + 0.2, y: y + 0.65 + ii * 0.42, w: 5.8, h: 0.42,
fontSize: 11, color: C.white, align: "left", valign: "middle"
});
});
// note footer
sl.addShape(pres.shapes.RECTANGLE, {
x, y: y + 2.42, w: 6.2, h: 0.38,
fill: { color: r.color, transparency: 70 }, line: { color: r.color }
});
sl.addText(`📌 ${r.note}`, {
x, y: y + 2.42, w: 6.2, h: 0.38, fontSize: 10, color: C.white, italic: true, align: "center", valign: "middle"
});
});
}
// ══════════════════════════════════════════════════════════════════
// SLIDE 6 — WHAT TO AVOID + MONITORING
// ══════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
sl.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 13.3, h: 7.5, fill: { color: C.offwhite }, line: { color: C.offwhite } });
sl.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 13.3, h: 0.8, fill: { color: C.navy }, line: { color: C.navy } });
sl.addText("Drugs to Avoid (Cost) + Monitoring Plan", {
x: 0.3, y: 0, w: 12, h: 0.8, fontSize: 22, color: C.white, bold: true, valign: "middle"
});
// Left — Avoid box
sl.addShape(pres.shapes.ROUNDED_RECTANGLE, {
x: 0.3, y: 1.0, w: 5.8, h: 5.9,
fill: { color: C.white }, line: { color: C.red, pt: 2 }, rectRadius: 0.15,
shadow: { type: "outer", color: "000000", blur: 5, offset: 2, angle: 135, opacity: 0.12 }
});
sl.addShape(pres.shapes.RECTANGLE, { x: 0.3, y: 1.0, w: 5.8, h: 0.55, fill: { color: C.red }, line: { color: C.red } });
sl.addText("❌ Drugs to AVOID in Cost-Constrained Patients", {
x: 0.3, y: 1.0, w: 5.8, h: 0.55, fontSize: 13, color: C.white, bold: true, align: "center", valign: "middle"
});
const avoidItems = [
["SGLT2 Inhibitors", "Dapagliflozin, Empagliflozin, Canagliflozin", "~INR 50–100/day"],
["DPP-4 Inhibitors", "Sitagliptin, Vildagliptin, Teneligliptin*", "~INR 20–50/day"],
["GLP-1 Agonists", "Semaglutide (Ozempic), Liraglutide", "~INR 200–500/day"],
["SGLT2+DPP4 FDC", "Dapa+Saxa combinations", "~INR 80–120/day"],
];
avoidItems.forEach((item, i) => {
sl.addShape(pres.shapes.ROUNDED_RECTANGLE, {
x: 0.5, y: 1.7 + i * 1.1, w: 5.4, h: 0.95,
fill: { color: "FDEDEC" }, line: { color: C.red, pt: 1 }, rectRadius: 0.08
});
sl.addText(item[0], {
x: 0.6, y: 1.72 + i * 1.1, w: 5.2, h: 0.35, fontSize: 12, color: C.red, bold: true, align: "left", valign: "middle"
});
sl.addText(`${item[1]} | Cost: ${item[2]}`, {
x: 0.6, y: 2.06 + i * 1.1, w: 5.2, h: 0.35, fontSize: 10, color: C.darktext, align: "left", valign: "middle"
});
});
sl.addText("* Teneligliptin is relatively cheaper (~INR 10–15/day) and may be considered if DPP4i is clinically needed", {
x: 0.4, y: 6.15, w: 5.6, h: 0.6, fontSize: 9, color: C.gray, italic: true
});
// Right — Monitoring
sl.addShape(pres.shapes.ROUNDED_RECTANGLE, {
x: 7.2, y: 1.0, w: 5.8, h: 5.9,
fill: { color: C.white }, line: { color: C.green, pt: 2 }, rectRadius: 0.15,
shadow: { type: "outer", color: "000000", blur: 5, offset: 2, angle: 135, opacity: 0.12 }
});
sl.addShape(pres.shapes.RECTANGLE, { x: 7.2, y: 1.0, w: 5.8, h: 0.55, fill: { color: C.green }, line: { color: C.green } });
sl.addText("✅ Monitoring Plan", {
x: 7.2, y: 1.0, w: 5.8, h: 0.55, fontSize: 13, color: C.white, bold: true, align: "center", valign: "middle"
});
const monItems = [
{ freq: "Every Visit", tests: "BP, weight, foot exam, BSL (FBS + PPBS)" },
{ freq: "3 Months", tests: "HbA1c, review dose titration, check hypoglycemia history" },
{ freq: "6 Months", tests: "Lipid profile, LFTs (if on Pioglitazone), urine microalbumin" },
{ freq: "Yearly", tests: "Serum creatinine/eGFR, eye exam (retinopathy screen), ECG" },
{ freq: "As Needed", tests: "ECG if chest pain; foot ulcer referral; renal dose adjustment" },
];
monItems.forEach((item, i) => {
sl.addShape(pres.shapes.RECTANGLE, {
x: 7.35, y: 1.7 + i * 0.95, w: 1.5, h: 0.8,
fill: { color: C.navy }, line: { color: C.navy }
});
sl.addText(item.freq, {
x: 7.35, y: 1.7 + i * 0.95, w: 1.5, h: 0.8,
fontSize: 10, color: C.white, bold: true, align: "center", valign: "middle"
});
sl.addShape(pres.shapes.RECTANGLE, {
x: 8.88, y: 1.7 + i * 0.95, w: 3.95, h: 0.8,
fill: { color: i % 2 === 0 ? "EBF5FB" : C.white }, line: { color: "#D5D8DC" }
});
sl.addText(item.tests, {
x: 8.93, y: 1.7 + i * 0.95, w: 3.9, h: 0.8,
fontSize: 10, color: C.darktext, align: "left", valign: "middle"
});
});
// Hypo warning
sl.addShape(pres.shapes.ROUNDED_RECTANGLE, {
x: 7.25, y: 6.45, w: 5.7, h: 0.85,
fill: { color: "FEF9E7" }, line: { color: C.amber, pt: 1.5 }, rectRadius: 0.08
});
sl.addText("⚠️ Hypoglycemia Rule: Educate patient — if BSL <70 mg/dL → take 15g fast carbs (3 tsp sugar); reduce SU dose if recurrent", {
x: 7.3, y: 6.45, w: 5.6, h: 0.85, fontSize: 9.5, color: C.darktext, align: "left", valign: "middle"
});
}
// ══════════════════════════════════════════════════════════════════
// SLIDE 7 — SUMMARY CARD
// ══════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
sl.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 13.3, h: 7.5, fill: { color: C.navy }, line: { color: C.navy } });
sl.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 0.18, h: 7.5, fill: { color: C.green }, line: { color: C.green } });
sl.addText("Quick Reference Card", {
x: 0.5, y: 0.25, w: 12, h: 0.7, fontSize: 26, color: C.green, bold: true, align: "left"
});
sl.addText("Affordable T2DM Management — India", {
x: 0.5, y: 0.85, w: 12, h: 0.45, fontSize: 15, color: C.gray, align: "left"
});
sl.addShape(pres.shapes.RECTANGLE, { x: 0.5, y: 1.3, w: 12.4, h: 0.04, fill: { color: C.teal }, line: { color: C.teal } });
const summaryRows = [
{ icon: "1️⃣", title: "Always start with:", detail: "Metformin 500 mg BD → uptitrate to 1000 mg BD over 2 weeks. Cheapest, safest 1st-line drug." },
{ icon: "2️⃣", title: "Add sulfonylurea if needed:", detail: "Glimepiride 1→4 mg OD (before breakfast) OR Glipizide 5→20 mg/day. ~INR 1–3/tab." },
{ icon: "3️⃣", title: "Add 3rd agent for poor control:", detail: "Pioglitazone 15 mg OD (insulin sensitizer, cheap) OR Voglibose 0.2 mg TDS (for high PPBS). ~INR 3–6/tab." },
{ icon: "4️⃣", title: "Simplest cheapest option:", detail: "Glipizide + Metformin FDC (5/500 mg) BD — single tablet, ~INR 2–4/day, best adherence." },
{ icon: "5️⃣", title: "Escalate to insulin if:", detail: "HbA1c >9% or symptomatic hyperglycemia. NPH insulin 0.1–0.2 U/kg OD nocte. Monitor SMBG." },
{ icon: "🚫", title: "Avoid (too expensive):", detail: "SGLT2 inhibitors, DPP-4 inhibitors, GLP-1 agonists — unless patient can afford (INR 50–500/day)." },
];
summaryRows.forEach((r, i) => {
sl.addText(r.icon, {
x: 0.4, y: 1.45 + i * 0.9, w: 0.5, h: 0.8, fontSize: 18, align: "center", valign: "middle"
});
sl.addText(r.title, {
x: 0.95, y: 1.45 + i * 0.9, w: 2.4, h: 0.8, fontSize: 11.5, color: C.teal, bold: true, align: "left", valign: "middle"
});
sl.addText(r.detail, {
x: 3.4, y: 1.45 + i * 0.9, w: 9.5, h: 0.8, fontSize: 11, color: C.white, align: "left", valign: "middle"
});
if (i < summaryRows.length - 1) {
sl.addShape(pres.shapes.RECTANGLE, {
x: 0.5, y: 2.25 + i * 0.9, w: 12.4, h: 0.02,
fill: { color: "253545" }, line: { color: "253545" }
});
}
});
sl.addText("Orris Clinical Reference • Based on IDF & RSSDI Guidelines • Generic drugs, India pricing 2024", {
x: 0.5, y: 7.1, w: 12.3, h: 0.3, fontSize: 8.5, color: C.gray, italic: true, align: "center"
});
}
// ══════════════════════════════════════════════════════════════════
// WRITE FILE
// ══════════════════════════════════════════════════════════════════
pres.writeFile({ fileName: "/home/daytona/workspace/diabetes-ppt/Affordable_Diabetes_Medications_India.pptx" })
.then(() => console.log("✅ PPTX created successfully"))
.catch(e => console.error("❌ Error:", e));
cd /home/daytona/workspace/diabetes-ppt && node create_ppt.js 2>&1
node -e "const p = require('pptxgenjs'); const pres = new p(); console.log(Object.keys(pres.shapes).filter(k => k.includes('TRIANGLE') || k.includes('LINE') || k.includes('ARROW')).join('\n'));"
~/diabetes-ppt/create_ppt.js
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/diabetes-ppt/create_ppt.js'
~/diabetes-ppt/create_ppt.js
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/diabetes-ppt/create_ppt.js'
~/diabetes-ppt/create_ppt.js
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/diabetes-ppt/create_ppt.js'
~/diabetes-ppt/create_ppt.js
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/diabetes-ppt/create_ppt.js'
cd /home/daytona/workspace/diabetes-ppt && node create_ppt.js 2>&1
node -e "const p = require('pptxgenjs'); const pres = new p(); console.log(Object.keys(pres.shapes).filter(k => k.includes('ELLIPSE') || k.includes('OVAL') || k.includes('CIRCLE')).join('\n'));"
sed -i 's/pres\.shapes\.ELLIPSE/pres.shapes.OVAL/g' /home/daytona/workspace/diabetes-ppt/create_ppt.js && node /home/daytona/workspace/diabetes-ppt/create_ppt.js 2>&1
~/diabetes-ppt/create_ppt.js
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/diabetes-ppt/create_ppt.js'
node /home/daytona/workspace/diabetes-ppt/create_ppt.js 2>&1 && ls -lh /home/daytona/workspace/diabetes-ppt/