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

Reading File
Finding Sources
Finding Sources
Searching the Web

affordable oral diabetes medications alternatives metformin glimepiride poor glycemic control type 2 diabetes India

Finding Sources
Finding Sources
Finding Sources
Reading File
Reading File
I now have enough to give a thorough, clinically useful answer. Let me compile it.

Patient Summary

  • 45M, Type 2 DM
  • Current regimen: Metformin 500 mg 1-0-1 (1 g/day) + Glimepiride 1 mg OD
  • Fasting BSL: 201 mg/dL | Postprandial: 325 mg/dL
  • Constraint: Cost - must use affordable/generic medications only

Problem Analysis

The current regimen is under-dosed and under-optimized before even considering new drugs:
  1. Metformin 500 mg BD = only 1 g/day - therapeutic benefit continues up to 2000 mg/day; max effective dose is ~2000-2500 mg. He is on a sub-therapeutic dose.
  2. Glimepiride 1 mg OD - the range is 1-8 mg/day; 1 mg is the starting dose, not the optimized dose.
  3. Postprandial of 325 points significantly to prandial (post-meal) glucose not being covered - needs a drug or dose targeting postprandial spikes.

Step 1 - Optimize What He Is Already On (Free Change, No New Cost)

DrugCurrentOptimal Target DoseComment
Metformin500 mg BD500 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
Glimepiride1 mg OD2-4 mg OD (up to 8 mg max)Titrate monthly; take 30 min before breakfast
This alone may bring significant improvement before adding anything new.

Step 2 - Affordable Add-On / Substitution Options

All drugs below are cheap generics widely available in India (INR 1-5/tablet range):

Option A - Add Pioglitazone 15 mg OD (Best Affordable Add-on)

  • Cost: ~INR 2-4/tablet (very cheap)
  • Mechanism: Insulin sensitizer (PPAR-gamma agonist) - works differently from both Metformin and Glimepiride, so additive benefit
  • HbA1c reduction: ~0.5-1.4%
  • Benefit: Reduces both FBS and PPBS; also improves lipids (raises HDL, lowers TG)
  • Caution: Causes fluid retention/edema and weight gain (~2-3 kg). Check for cardiac failure or liver disease first. Also associated with bladder cancer risk with long-term use.
  • Triple combo: Met + Glimi + Pio = proven effective in Indian studies (PMC11157142)
  • Start at: 15 mg OD with food

Option B - Switch Glimepiride to Glipizide (Even Cheaper Sulfonylurea)

  • Cost: ~INR 1-2/tablet (Glipizide + Metformin FDC is ~INR 2/tablet)
  • Glipizide 5 mg before breakfast; can go up to 20 mg/day in 2 divided doses
  • Why consider: Glipizide is shorter-acting, lower risk of prolonged hypoglycemia compared to Glimepiride (especially important if the patient skips meals)
  • Equivalence: Glipizide 5 mg ≈ Glimepiride 1-2 mg in effect
  • Alternatively: Keep Glimepiride and dose-optimize (simpler)

Option C - Add Voglibose 0.2-0.3 mg TDS (Excellent for High PPBS)

  • Cost: ~INR 3-6/tablet
  • Mechanism: Alpha-glucosidase inhibitor - delays carbohydrate absorption, specifically blunts postprandial spikes
  • Ideal for this patient: His PP of 325 is very high - Voglibose directly targets this
  • Take: With first bite of each main meal, TDS
  • HbA1c reduction: ~0.5-0.8%
  • Side effects: Flatulence, bloating, diarrhea (usually settles after 2-4 weeks)
  • No hypoglycemia as monotherapy; no weight gain
  • Voglibose is also available as FDC with Metformin

Option D - Repaglinide 0.5-1 mg Before Meals (Prandial Secretagogue)

  • Cost: Moderate-cheap (~INR 5-8/tablet)
  • Best for: High postprandial glucose; short-acting so taken before meals only
  • Note: Avoid combining with Glimepiride (same class/mechanism - both are secretagogues, combining them increases hypoglycemia risk without much added benefit)
  • If choosing Repaglinide, consider stopping Glimepiride and using Repaglinide instead

Recommended Practical Regimens (Prioritized by Cost-Effectiveness)

Regimen 1 - Optimize existing drugs first (Zero extra cost)

Metformin 1000 mg BD + Glimepiride 2-4 mg OD

Regimen 2 - Best affordable triple therapy

Metformin 1000 mg BD + Glimepiride 2 mg OD + Pioglitazone 15 mg OD (~INR 5-10/day total; proven in Indian population)

Regimen 3 - If postprandial spikes are dominant concern

Metformin 1000 mg BD + Glimepiride 2 mg OD + Voglibose 0.2 mg TDS (with meals) (~INR 8-12/day total)

Regimen 4 - Glipizide FDC (simplest/cheapest)

Glipizide 5 mg + Metformin 500 mg FDC tablet BD (pre-made combination) (~INR 2-4/day; very cheap, good adherence with single tablet)

What to AVOID in a Cost-Constrained Patient

Drug ClassExamplesWhy Avoid
SGLT2 inhibitorsDapagliflozin, EmpagliflozinVery expensive (INR 50-100/day)
DPP-4 inhibitorsSitagliptin, VildagliptinExpensive (INR 30-60/day)
GLP-1 agonistsSemaglutide, LiraglutideVery expensive, injectable

Quick Monitoring Plan

  • Check HbA1c in 3 months after optimization
  • Target FBS < 130 mg/dL; PP < 180 mg/dL
  • Watch for hypoglycemia signs after increasing Glimepiride dose
  • If adding Pioglitazone - check for pedal edema monthly; avoid if cardiac/liver disease
  • Check LFT before starting Pioglitazone

Bottom line: Before adding new drugs, first uptitrate Metformin to 1000 mg BD and Glimepiride to 2-4 mg OD. If still uncontrolled, add Pioglitazone 15 mg OD (cheapest effective add-on) or Voglibose 0.2 mg TDS (best for the very high postprandial of 325). A Glipizide + Metformin FDC is the single most cost-effective switch available.

Create a diabetes medication flowchart (PPT) for affordable regimens in India

Reading File
Reading File
Reading File
Running Command

mkdir -p /home/daytona/workspace/diabetes-ppt && ls /home/daytona/workspace/diabetes-ppt

Writing File

~/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));
Running Command

cd /home/daytona/workspace/diabetes-ppt && node create_ppt.js 2>&1

Running Command

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'));"

Editing File

~/diabetes-ppt/create_ppt.js

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/diabetes-ppt/create_ppt.js'
Editing File

~/diabetes-ppt/create_ppt.js

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/diabetes-ppt/create_ppt.js'
Editing File

~/diabetes-ppt/create_ppt.js

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/diabetes-ppt/create_ppt.js'
Editing File

~/diabetes-ppt/create_ppt.js

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/diabetes-ppt/create_ppt.js'
Running Command

cd /home/daytona/workspace/diabetes-ppt && node create_ppt.js 2>&1

Reading File
Running Command

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'));"

Running Command

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

Editing File

~/diabetes-ppt/create_ppt.js

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/diabetes-ppt/create_ppt.js'
Running Command

node /home/daytona/workspace/diabetes-ppt/create_ppt.js 2>&1 && ls -lh /home/daytona/workspace/diabetes-ppt/

Model call limits exceeded: run limit (20/20)
This is a shared conversation. Sign in to Orris to start your own chat.