Give me a ppt of diabetes mellitus and its types and its treatment

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

ls -la /home/daytona/workspace/ 2>/dev/null || echo "workspace does not exist"

Running Command

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

Writing File

~/diabetes-ppt/build.js

const pptxgen = require("pptxgenjs");

const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Diabetes Mellitus";
pres.author = "Orris Medical";

// ─── COLOUR PALETTE ───────────────────────────────────────────────────────────
const DARK_BG   = "0D2137";   // deep navy  (title / section dividers)
const MID_BG    = "103455";   // mid navy   (accent headers)
const LIGHT_BG  = "EBF4FB";   // pale blue  (content bg)
const ACCENT    = "1A8FE3";   // vivid blue (highlight bars, icons)
const WHITE     = "FFFFFF";
const BODY_TEXT = "1C2B3A";
const MUTED     = "4A6580";

// ─── HELPER: section header bar ───────────────────────────────────────────────
function addHeader(slide, text, bg = MID_BG) {
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.72, fill: { color: bg } });
  slide.addText(text, {
    x: 0.38, y: 0, w: 9.24, h: 0.72,
    fontSize: 22, bold: true, color: WHITE, valign: "middle", margin: 0,
  });
}

// ─── HELPER: accent side-bar ──────────────────────────────────────────────────
function addSideBar(slide, color = ACCENT) {
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.12, h: 5.625, fill: { color } });
}

// ─── SLIDE 1: TITLE ───────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  s.background = { color: DARK_BG };

  // decorative rectangle top
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.18, fill: { color: ACCENT } });
  // decorative rectangle bottom
  s.addShape(pres.ShapeType.rect, { x: 0, y: 5.445, w: 10, h: 0.18, fill: { color: ACCENT } });

  s.addText("DIABETES MELLITUS", {
    x: 0.6, y: 1.4, w: 8.8, h: 1.2,
    fontSize: 46, bold: true, color: WHITE, align: "center", charSpacing: 4,
  });
  s.addText("Types · Pathophysiology · Treatment", {
    x: 0.6, y: 2.75, w: 8.8, h: 0.7,
    fontSize: 22, color: ACCENT, align: "center", italic: true,
  });
  s.addText("A comprehensive clinical overview", {
    x: 0.6, y: 3.55, w: 8.8, h: 0.5,
    fontSize: 14, color: "8BB8D4", align: "center",
  });
  s.addText("Source: Textbook of Family Medicine 9e  |  Washington Manual of Medical Therapeutics", {
    x: 0.6, y: 5.0, w: 8.8, h: 0.35,
    fontSize: 10, color: "607D8B", align: "center",
  });
}

// ─── SLIDE 2: OVERVIEW ────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  s.background = { color: LIGHT_BG };
  addSideBar(s);
  addHeader(s, "What is Diabetes Mellitus?");

  const bullets = [
    "Diabetes mellitus (DM) is a group of metabolic diseases characterised by chronic hyperglycaemia.",
    "Results from defects in insulin secretion, insulin action, or both.",
    "~25.8 million Americans have DM; 79 million have pre-diabetes.",
    "~1.9 million new cases diagnosed annually in adults aged ≥20 years.",
    "WHO projects >350 million people worldwide will have DM by 2025.",
    "Nearly 80 % of people with DM will die of cardiovascular disease (CVD) complications.",
    "DM is classified as a CAD risk equivalent by the NCEP.",
  ];

  s.addText(bullets.map((t, i) => ({
    text: t,
    options: { bullet: { type: "bullet", code: "2022" }, breakLine: i < bullets.length - 1, paraSpaceAfter: 4 },
  })), {
    x: 0.55, y: 0.85, w: 9.1, h: 4.5,
    fontSize: 14, color: BODY_TEXT, lineSpacingMultiple: 1.25,
  });
}

// ─── SLIDE 3: CLASSIFICATION ──────────────────────────────────────────────────
{
  const s = pres.addSlide();
  s.background = { color: LIGHT_BG };
  addSideBar(s);
  addHeader(s, "Classification of Diabetes Mellitus");

  const types = [
    { label: "Type 1 DM", color: "C0392B", text: "Autoimmune destruction of β-cells → absolute insulin deficiency. Requires lifelong insulin therapy. Previously called IDDM." },
    { label: "Type 2 DM", color: "1A8FE3", text: "Progressive insulin secretory defect on a background of insulin resistance. ~90–95 % of all adult DM. Strongly linked to obesity." },
    { label: "Gestational DM", color: "27AE60", text: "Glucose intolerance first recognised during pregnancy. Increases maternal and foetal risk." },
    { label: "Other Specific Types", color: "8E44AD", text: "MODY (monogenic), drug-induced (steroids, antipsychotics), diseases of exocrine pancreas (pancreatitis, CF), endocrinopathies (Cushing's, acromegaly)." },
  ];

  types.forEach((t, i) => {
    const y = 0.9 + i * 1.12;
    s.addShape(pres.ShapeType.rect, { x: 0.55, y, w: 9.1, h: 0.95, fill: { color: WHITE }, line: { color: t.color, width: 2 } });
    s.addShape(pres.ShapeType.rect, { x: 0.55, y, w: 2.1, h: 0.95, fill: { color: t.color } });
    s.addText(t.label, { x: 0.55, y, w: 2.1, h: 0.95, fontSize: 13, bold: true, color: WHITE, align: "center", valign: "middle", margin: 0 });
    s.addText(t.text, { x: 2.75, y: y + 0.08, w: 6.75, h: 0.78, fontSize: 12, color: BODY_TEXT, valign: "middle" });
  });
}

// ─── SLIDE 4: TYPE 1 DM ───────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  s.background = { color: LIGHT_BG };
  addSideBar(s, "C0392B");
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.72, fill: { color: "C0392B" } });
  s.addText("Type 1 Diabetes Mellitus (T1DM)", {
    x: 0.38, y: 0, w: 9.24, h: 0.72,
    fontSize: 22, bold: true, color: WHITE, valign: "middle", margin: 0,
  });

  const left = [
    { hdr: "Aetiology", body: "T-cell mediated autoimmune destruction of pancreatic β-cells. Associated with HLA-DR3 and HLA-DR4." },
    { hdr: "Onset", body: "Usually childhood/adolescence; can occur at any age." },
    { hdr: "Pathophysiology", body: "Complete or near-complete insulin deficiency → hyperglycaemia, ketogenesis, DKA if untreated." },
    { hdr: "Classic Symptoms", body: "Polyuria, polydipsia, polyphagia, weight loss, fatigue, blurred vision." },
  ];

  left.forEach((item, i) => {
    const y = 0.9 + i * 1.12;
    s.addText(item.hdr, { x: 0.3, y, w: 4.5, h: 0.32, fontSize: 13, bold: true, color: "C0392B", margin: 0 });
    s.addText(item.body, { x: 0.3, y: y + 0.30, w: 4.5, h: 0.72, fontSize: 12, color: BODY_TEXT });
  });

  // right panel
  s.addShape(pres.ShapeType.rect, { x: 5.1, y: 0.82, w: 4.6, h: 4.6, fill: { color: "FEF9F9" }, line: { color: "C0392B", width: 1 } });
  s.addText("Key Diagnostics", { x: 5.2, y: 0.88, w: 4.4, h: 0.38, fontSize: 14, bold: true, color: "C0392B" });
  const diag = [
    "Fasting plasma glucose ≥ 126 mg/dL",
    "2-hr glucose ≥ 200 mg/dL (OGTT)",
    "HbA1c ≥ 6.5 %",
    "Random glucose ≥ 200 mg/dL + symptoms",
    "Positive islet-cell / anti-GAD antibodies",
    "C-peptide low or undetectable",
  ];
  s.addText(diag.map((d, i) => ({
    text: d,
    options: { bullet: { type: "bullet" }, breakLine: i < diag.length - 1, paraSpaceAfter: 3 },
  })), { x: 5.2, y: 1.3, w: 4.4, h: 3.8, fontSize: 12, color: BODY_TEXT });
}

// ─── SLIDE 5: TYPE 2 DM ───────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  s.background = { color: LIGHT_BG };
  addSideBar(s, ACCENT);
  addHeader(s, "Type 2 Diabetes Mellitus (T2DM)");

  // Two columns
  const colA = [
    { hdr: "Insulin Resistance", body: "Target tissues (muscle, liver, fat) fail to respond normally to insulin. Compensatory hyperinsulinaemia follows." },
    { hdr: "β-cell Failure", body: "Progressive decline in β-cell mass and function → relative insulin deficiency over time." },
    { hdr: "Risk Factors", body: "Obesity (central adiposity), physical inactivity, family history, age >45, ethnicity, hypertension, dyslipidaemia, prior GDM." },
  ];
  const colB = [
    { hdr: "Ominous Octet", body: "Liver ↑ glucose output, muscle ↓ uptake, fat ↑ lipolysis, GI ↓ incretins, α-cells ↑ glucagon, kidney ↑ glucose reabsorption, brain neurotransmitter dysregulation, β-cells ↓ secretion." },
    { hdr: "Macrovascular Complications", body: "MI, stroke, PAD. DM = CAD risk equivalent. Atherosclerosis accelerated by hyperglycaemia, oxidative stress, AGEs." },
    { hdr: "Microvascular Complications", body: "Nephropathy, retinopathy, neuropathy. Every 1 % drop in HbA1c → 37 % reduction in microvascular risk (UKPDS 35)." },
  ];

  colA.forEach((item, i) => {
    const y = 0.9 + i * 1.55;
    s.addText(item.hdr, { x: 0.3, y, w: 4.6, h: 0.3, fontSize: 13, bold: true, color: ACCENT, margin: 0 });
    s.addText(item.body, { x: 0.3, y: y + 0.28, w: 4.6, h: 1.1, fontSize: 12, color: BODY_TEXT });
  });
  colB.forEach((item, i) => {
    const y = 0.9 + i * 1.55;
    s.addText(item.hdr, { x: 5.2, y, w: 4.6, h: 0.3, fontSize: 13, bold: true, color: MID_BG, margin: 0 });
    s.addText(item.body, { x: 5.2, y: y + 0.28, w: 4.6, h: 1.1, fontSize: 12, color: BODY_TEXT });
  });
  // divider
  s.addShape(pres.ShapeType.line, { x: 5.0, y: 0.85, w: 0, h: 4.5, line: { color: ACCENT, width: 1, dashType: "sysDash" } });
}

// ─── SLIDE 6: GESTATIONAL & OTHER ─────────────────────────────────────────────
{
  const s = pres.addSlide();
  s.background = { color: LIGHT_BG };
  addSideBar(s, "27AE60");
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.72, fill: { color: "27AE60" } });
  s.addText("Gestational DM & Other Specific Types", {
    x: 0.38, y: 0, w: 9.24, h: 0.72,
    fontSize: 22, bold: true, color: WHITE, valign: "middle", margin: 0,
  });

  // GDM box
  s.addShape(pres.ShapeType.rect, { x: 0.3, y: 0.85, w: 4.5, h: 4.6, fill: { color: "F0FBF4" }, line: { color: "27AE60", width: 2 } });
  s.addText("Gestational DM (GDM)", { x: 0.4, y: 0.95, w: 4.3, h: 0.38, fontSize: 14, bold: true, color: "27AE60" });
  const gdm = [
    "Glucose intolerance first detected in pregnancy",
    "Screening: 24–28 weeks gestation with OGTT",
    "Risks: macrosomia, neonatal hypoglycaemia, pre-eclampsia",
    "Management: diet, exercise, insulin if targets not met",
    "50 % lifetime risk of developing T2DM post-partum",
  ];
  s.addText(gdm.map((d, i) => ({
    text: d,
    options: { bullet: { type: "bullet" }, breakLine: i < gdm.length - 1, paraSpaceAfter: 4 },
  })), { x: 0.4, y: 1.4, w: 4.3, h: 3.8, fontSize: 12, color: BODY_TEXT });

  // Other types box
  s.addShape(pres.ShapeType.rect, { x: 5.1, y: 0.85, w: 4.6, h: 4.6, fill: { color: "F9F4FD" }, line: { color: "8E44AD", width: 2 } });
  s.addText("Other Specific Types", { x: 5.2, y: 0.95, w: 4.4, h: 0.38, fontSize: 14, bold: true, color: "8E44AD" });
  const other = [
    "MODY (1–6): single-gene defects in β-cell function",
    "Pancreatogenic: chronic pancreatitis, cystic fibrosis, pancreatectomy",
    "Endocrinopathies: Cushing's syndrome, acromegaly, phaeochromocytoma",
    "Drug/chemical-induced: glucocorticoids, thiazides, antipsychotics, tacrolimus",
    "Infections: congenital rubella, CMV",
    "Rare immune-mediated: stiff-man syndrome, anti-insulin receptor antibodies",
  ];
  s.addText(other.map((d, i) => ({
    text: d,
    options: { bullet: { type: "bullet" }, breakLine: i < other.length - 1, paraSpaceAfter: 4 },
  })), { x: 5.2, y: 1.4, w: 4.4, h: 3.8, fontSize: 12, color: BODY_TEXT });
}

// ─── SLIDE 7: DIAGNOSIS ───────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  s.background = { color: LIGHT_BG };
  addSideBar(s);
  addHeader(s, "Diagnosis & Glycaemic Targets");

  const criteria = [
    ["Test", "Normal", "Pre-diabetes", "Diabetes"],
    ["Fasting Plasma Glucose", "< 100 mg/dL", "100–125 mg/dL", "≥ 126 mg/dL"],
    ["2-hr OGTT (75 g)", "< 140 mg/dL", "140–199 mg/dL", "≥ 200 mg/dL"],
    ["HbA1c", "< 5.7 %", "5.7–6.4 %", "≥ 6.5 %"],
    ["Random Glucose + Sx", "—", "—", "≥ 200 mg/dL"],
  ];

  s.addTable(criteria, {
    x: 0.4, y: 0.85, w: 9.2, h: 2.9,
    colW: [2.4, 1.9, 1.9, 1.9],
    fontFace: "Calibri",
    fontSize: 12,
    align: "center",
    border: { pt: 1, color: "C5D8EA" },
    fill: WHITE,
    color: BODY_TEXT,
    autoPage: false,
    rowH: 0.52,
  });

  // Colour header row by overriding with a rect
  s.addShape(pres.ShapeType.rect, { x: 0.4, y: 0.85, w: 9.2, h: 0.52, fill: { color: DARK_BG } });
  s.addText(["Test", "Normal", "Pre-diabetes", "Diabetes"].map((t, i) => ({
    text: t,
    options: { breakLine: false },
  })).reduce((acc, cur, i, arr) => {
    if (i < arr.length - 1) { acc.push(cur); acc.push({ text: "     ", options: {} }); }
    else acc.push(cur);
    return acc;
  }, []), {
    x: 0.4, y: 0.85, w: 9.2, h: 0.52,
    fontSize: 13, bold: true, color: WHITE, align: "center", valign: "middle",
  });

  s.addText("Glycaemic Targets (ADA / ACE)", { x: 0.4, y: 3.92, w: 9.2, h: 0.38, fontSize: 14, bold: true, color: MID_BG });
  const targets = [
    "HbA1c < 7.0 % (ADA)  |  < 6.5 % (ACE) — tighter control if tolerated without hypoglycaemia",
    "Fasting glucose: 80–130 mg/dL  |  Peak post-prandial glucose < 180 mg/dL",
    "Every 1 % reduction in HbA1c → 21 % reduction in any DM-related endpoint (UKPDS 35)",
    "Blood pressure < 130/80 mmHg; LDL-C < 100 mg/dL (< 70 mg/dL if CVD present)",
  ];
  s.addText(targets.map((d, i) => ({
    text: d,
    options: { bullet: { type: "bullet" }, breakLine: i < targets.length - 1, paraSpaceAfter: 3 },
  })), { x: 0.4, y: 4.35, w: 9.2, h: 1.15, fontSize: 12, color: BODY_TEXT });
}

// ─── SLIDE 8: T1DM TREATMENT ──────────────────────────────────────────────────
{
  const s = pres.addSlide();
  s.background = { color: LIGHT_BG };
  addSideBar(s, "C0392B");
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.72, fill: { color: "C0392B" } });
  s.addText("Treatment: Type 1 DM — Insulin Therapy", {
    x: 0.38, y: 0, w: 9.24, h: 0.72,
    fontSize: 22, bold: true, color: WHITE, valign: "middle", margin: 0,
  });

  const insulins = [
    ["Insulin Type", "Onset", "Peak", "Duration", "Example"],
    ["Rapid-acting", "5–15 min", "30–90 min", "3–5 hr", "Lispro, Aspart, Glulisine"],
    ["Short-acting", "30–60 min", "2–4 hr", "6–8 hr", "Regular (Humulin R)"],
    ["Intermediate", "1–3 hr", "4–10 hr", "12–18 hr", "NPH (Humulin N)"],
    ["Long-acting", "1–2 hr", "No peak", "20–24 hr", "Glargine, Detemir"],
    ["Ultra-long", "~6 hr", "No peak", ">36 hr", "Degludec"],
  ];

  s.addTable(insulins, {
    x: 0.3, y: 0.85, w: 9.4, h: 3.0,
    colW: [1.85, 1.35, 1.35, 1.35, 3.5],
    fontSize: 11,
    fontFace: "Calibri",
    align: "center",
    border: { pt: 1, color: "EECFCF" },
    fill: WHITE,
    color: BODY_TEXT,
    rowH: 0.44,
  });

  s.addShape(pres.ShapeType.rect, { x: 0.3, y: 0.85, w: 9.4, h: 0.44, fill: { color: "C0392B" } });
  s.addText("Insulin Type       Onset       Peak       Duration       Example", {
    x: 0.3, y: 0.85, w: 9.4, h: 0.44,
    fontSize: 12, bold: true, color: WHITE, align: "center", valign: "middle",
  });

  const notes = [
    "Basal–bolus regimen is standard of care: long-acting basal + rapid-acting bolus at meals.",
    "Continuous glucose monitoring (CGM) + insulin pump (CSII) improves outcomes.",
    "DCCT trial: intensive glycaemic control reduces microvascular complications by 40–70 %.",
    "Prevent DKA: never omit basal insulin; sick-day rules essential.",
  ];
  s.addText(notes.map((d, i) => ({
    text: d,
    options: { bullet: { type: "bullet" }, breakLine: i < notes.length - 1, paraSpaceAfter: 3 },
  })), { x: 0.3, y: 4.0, w: 9.4, h: 1.45, fontSize: 12, color: BODY_TEXT });
}

// ─── SLIDE 9: T2DM TREATMENT – OAD ────────────────────────────────────────────
{
  const s = pres.addSlide();
  s.background = { color: LIGHT_BG };
  addSideBar(s, ACCENT);
  addHeader(s, "Treatment: Type 2 DM — Oral & Non-Insulin Agents");

  const drugs = [
    { cls: "Biguanides", eg: "Metformin", moa: "↓ hepatic glucose output, ↑ insulin sensitivity", notes: "1st-line; cardioprotective (UKPDS: −38 % CV events); hold if eGFR <30" },
    { cls: "Sulfonylureas", eg: "Glipizide, Glimepiride", moa: "↑ insulin secretion (KATP closure)", notes: "Risk of hypoglycaemia & weight gain; avoid in renal failure" },
    { cls: "SGLT-2 inhibitors", eg: "Empagliflozin, Dapagliflozin", moa: "↑ urinary glucose excretion", notes: "CV & renal protective; weight loss; risk of genital infections, DKA" },
    { cls: "GLP-1 agonists", eg: "Semaglutide, Liraglutide", moa: "↑ insulin, ↓ glucagon, ↓ appetite (incretin-based)", notes: "CV benefit; significant weight loss; GI side effects; injectable" },
    { cls: "DPP-4 inhibitors", eg: "Sitagliptin, Saxagliptin", moa: "↑ endogenous GLP-1 / GIP (incretin-based)", notes: "Weight neutral; well tolerated; modest HbA1c reduction" },
    { cls: "TZDs", eg: "Pioglitazone", moa: "PPAR-γ agonist → ↑ insulin sensitivity", notes: "Fluid retention, weight gain, risk of HF and fractures" },
    { cls: "Alpha-glucosidase inhibitors", eg: "Acarbose", moa: "↓ carbohydrate absorption in gut", notes: "GI side effects (flatulence, diarrhoea); modest efficacy" },
  ];

  drugs.forEach((d, i) => {
    const y = 0.85 + i * 0.67;
    const bg = i % 2 === 0 ? WHITE : "F0F7FF";
    s.addShape(pres.ShapeType.rect, { x: 0.3, y, w: 9.4, h: 0.62, fill: { color: bg }, line: { color: "D0E4F0", width: 1 } });
    s.addText(d.cls, { x: 0.35, y: y + 0.06, w: 2.0, h: 0.5, fontSize: 11, bold: true, color: MID_BG, valign: "middle" });
    s.addText(d.eg,  { x: 2.4,  y: y + 0.06, w: 1.8, h: 0.5, fontSize: 10, italic: true, color: MUTED, valign: "middle" });
    s.addText(d.moa, { x: 4.25, y: y + 0.06, w: 2.5, h: 0.5, fontSize: 10, color: BODY_TEXT, valign: "middle" });
    s.addText(d.notes,{ x: 6.8, y: y + 0.06, w: 2.85, h: 0.5, fontSize: 10, color: BODY_TEXT, valign: "middle" });
  });

  // column headers
  s.addShape(pres.ShapeType.rect, { x: 0.3, y: 0.85, w: 9.4, h: 0.42, fill: { color: MID_BG } });
  ["Drug Class", "Example(s)", "Mechanism", "Key Notes"].forEach((h, i) => {
    const xs = [0.35, 2.4, 4.25, 6.8];
    const ws = [2.0, 1.8, 2.5, 2.85];
    s.addText(h, { x: xs[i], y: 0.85, w: ws[i], h: 0.42, fontSize: 11, bold: true, color: WHITE, valign: "middle", margin: 0 });
  });
}

// ─── SLIDE 10: T2DM TREATMENT – LIFESTYLE & ALGORITHM ─────────────────────────
{
  const s = pres.addSlide();
  s.background = { color: LIGHT_BG };
  addSideBar(s, ACCENT);
  addHeader(s, "Treatment Algorithm & Lifestyle Management");

  // Step boxes
  const steps = [
    { n: "1", label: "Lifestyle Modification", detail: "Medical nutrition therapy · ≥150 min/week moderate exercise · weight loss 5–10 % · smoking cessation", color: "27AE60" },
    { n: "2", label: "Metformin (if tolerated)", detail: "Start alongside lifestyle changes at diagnosis. Target HbA1c < 7 %. Titrate over 4–8 weeks.", color: ACCENT },
    { n: "3", label: "Add 2nd Agent", detail: "Choose based on CVD/renal status:\n• CVD present → SGLT-2i or GLP-1 RA\n• HF/CKD → SGLT-2i preferred\n• Weight concern → GLP-1 RA or SGLT-2i\n• Hypoglycaemia risk → DPP-4i or TZD", color: "E67E22" },
    { n: "4", label: "Add 3rd Agent or Insulin", detail: "Triple oral therapy or initiate basal insulin (10 units/night or 0.1–0.2 U/kg). Intensify to basal–bolus if needed.", color: "C0392B" },
  ];

  steps.forEach((step, i) => {
    const y = 0.85 + i * 1.15;
    s.addShape(pres.ShapeType.rect, { x: 0.3, y, w: 9.4, h: 1.05, fill: { color: WHITE }, line: { color: step.color, width: 2 } });
    s.addShape(pres.ShapeType.rect, { x: 0.3, y, w: 0.65, h: 1.05, fill: { color: step.color } });
    s.addText(step.n, { x: 0.3, y, w: 0.65, h: 1.05, fontSize: 24, bold: true, color: WHITE, align: "center", valign: "middle", margin: 0 });
    s.addText(step.label, { x: 1.05, y: y + 0.05, w: 3.0, h: 0.38, fontSize: 13, bold: true, color: step.color, margin: 0 });
    s.addText(step.detail, { x: 1.05, y: y + 0.42, w: 8.5, h: 0.58, fontSize: 11, color: BODY_TEXT });
  });
}

// ─── SLIDE 11: COMPLICATIONS ──────────────────────────────────────────────────
{
  const s = pres.addSlide();
  s.background = { color: LIGHT_BG };
  addSideBar(s);
  addHeader(s, "Complications of Diabetes Mellitus");

  // Acute
  s.addShape(pres.ShapeType.rect, { x: 0.3, y: 0.85, w: 4.5, h: 4.55, fill: { color: "FFF8E1" }, line: { color: "F39C12", width: 2 } });
  s.addText("ACUTE", { x: 0.4, y: 0.92, w: 4.3, h: 0.36, fontSize: 14, bold: true, color: "E67E22" });
  const acute = [
    "DKA (T1DM): ketones, pH <7.3, anion-gap acidosis",
    "HHS (T2DM): extreme hyperglycaemia >600 mg/dL, hyperosmolarity, no ketosis",
    "Hypoglycaemia: BG <70 mg/dL — tremor, diaphoresis, confusion",
    "Hypoglycaemia unawareness: especially with tight control",
  ];
  s.addText(acute.map((d, i) => ({
    text: d,
    options: { bullet: { type: "bullet" }, breakLine: i < acute.length - 1, paraSpaceAfter: 5 },
  })), { x: 0.4, y: 1.35, w: 4.3, h: 3.8, fontSize: 12, color: BODY_TEXT });

  // Chronic
  s.addShape(pres.ShapeType.rect, { x: 5.1, y: 0.85, w: 4.6, h: 4.55, fill: { color: "EBF5FB" }, line: { color: ACCENT, width: 2 } });
  s.addText("CHRONIC", { x: 5.2, y: 0.92, w: 4.4, h: 0.36, fontSize: 14, bold: true, color: MID_BG });
  const chronic = [
    "Macrovascular: CAD, stroke, peripheral arterial disease",
    "Diabetic nephropathy: leading cause of ESRD; screen with urine albumin",
    "Diabetic retinopathy: leading cause of blindness in working age adults",
    "Diabetic neuropathy: peripheral (stocking-glove), autonomic",
    "Diabetic foot: ulcers, Charcot arthropathy, amputation risk",
    "Increased infection risk: UTI, cellulitis, TB, candidiasis",
  ];
  s.addText(chronic.map((d, i) => ({
    text: d,
    options: { bullet: { type: "bullet" }, breakLine: i < chronic.length - 1, paraSpaceAfter: 4 },
  })), { x: 5.2, y: 1.35, w: 4.4, h: 3.8, fontSize: 12, color: BODY_TEXT });
}

// ─── SLIDE 12: MONITORING & FOLLOW-UP ─────────────────────────────────────────
{
  const s = pres.addSlide();
  s.background = { color: LIGHT_BG };
  addSideBar(s);
  addHeader(s, "Monitoring & Preventive Care");

  const items = [
    { icon: "HbA1c", freq: "Every 3 months", detail: "Target < 7.0 % (ADA) or < 6.5 % (ACE)" },
    { icon: "BP", freq: "Every visit", detail: "Target < 130/80 mmHg; ACE-I or ARB preferred (renoprotective)" },
    { icon: "Lipids", freq: "Annually", detail: "Statin therapy for all adults with DM (high-intensity if CVD)" },
    { icon: "Urine Albumin", freq: "Annually", detail: "ACR; ACE-I/ARB if microalbuminuria detected (≥30 mg/g)" },
    { icon: "Eye Exam", freq: "Annually", detail: "Dilated fundoscopy; refer to ophthalmology" },
    { icon: "Foot Exam", freq: "Every visit", detail: "Monofilament, vibration, pulses; preventive podiatry care" },
    { icon: "Vaccinations", freq: "Per schedule", detail: "Influenza annually; pneumococcal; Hepatitis B series" },
    { icon: "Aspirin", freq: "Daily", detail: "75–162 mg/day if 10-yr CVD risk > 10 % or established CVD" },
  ];

  items.forEach((item, i) => {
    const col = i < 4 ? 0 : 1;
    const row = i % 4;
    const x = col === 0 ? 0.3 : 5.1;
    const y = 0.88 + row * 1.12;
    const colors = ["1A8FE3","27AE60","E67E22","8E44AD","C0392B","1A8FE3","27AE60","E67E22"];
    s.addShape(pres.ShapeType.rect, { x, y, w: 4.5, h: 1.0, fill: { color: WHITE }, line: { color: colors[i], width: 1.5 } });
    s.addShape(pres.ShapeType.rect, { x, y, w: 1.2, h: 1.0, fill: { color: colors[i] } });
    s.addText(item.icon, { x, y, w: 1.2, h: 1.0, fontSize: 10, bold: true, color: WHITE, align: "center", valign: "middle", margin: 0 });
    s.addText(item.freq, { x: x + 1.28, y: y + 0.06, w: 3.1, h: 0.3, fontSize: 11, bold: true, color: colors[i], margin: 0 });
    s.addText(item.detail, { x: x + 1.28, y: y + 0.36, w: 3.1, h: 0.55, fontSize: 10, color: BODY_TEXT });
  });
}

// ─── SLIDE 13: KEY TAKEAWAYS ──────────────────────────────────────────────────
{
  const s = pres.addSlide();
  s.background = { color: DARK_BG };

  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.18, fill: { color: ACCENT } });
  s.addShape(pres.ShapeType.rect, { x: 0, y: 5.445, w: 10, h: 0.18, fill: { color: ACCENT } });

  s.addText("Key Takeaways", {
    x: 0.5, y: 0.3, w: 9, h: 0.65,
    fontSize: 28, bold: true, color: WHITE, align: "center",
  });

  const takes = [
    "DM is a heterogeneous metabolic disorder — classify correctly (T1/T2/GDM/Other) before selecting therapy.",
    "Type 1 DM requires lifelong insulin. Basal–bolus regimens and CGM are standard of care.",
    "Type 2 DM treatment is stepwise: lifestyle → Metformin → add cardio/renally protective agent → insulin.",
    "SGLT-2 inhibitors and GLP-1 agonists provide independent cardiovascular and renal benefits beyond glucose control.",
    "Tight control (HbA1c < 7 %) reduces microvascular risk; balance against hypoglycaemia risk.",
    "Every 1 % fall in HbA1c cuts microvascular risk by 37 % and any DM endpoint by 21 % (UKPDS 35).",
    "Multifactorial risk reduction (glucose + BP + lipids + aspirin) is mandatory — STRATOS-2 showed 50 % ↓ in CV events.",
  ];

  takes.forEach((t, i) => {
    const y = 1.1 + i * 0.61;
    s.addShape(pres.ShapeType.rect, { x: 0.45, y: y + 0.08, w: 0.35, h: 0.35, fill: { color: ACCENT } });
    s.addText(`${i + 1}`, { x: 0.45, y: y + 0.08, w: 0.35, h: 0.35, fontSize: 11, bold: true, color: WHITE, align: "center", valign: "middle", margin: 0 });
    s.addText(t, { x: 0.9, y, w: 8.8, h: 0.55, fontSize: 12, color: "D0E8F8", valign: "middle" });
  });
}

// ─── WRITE FILE ───────────────────────────────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/workspace/diabetes-ppt/Diabetes_Mellitus.pptx" })
  .then(() => console.log("SUCCESS"))
  .catch(e => { console.error("ERROR:", e); process.exit(1); });
Running Command

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

Running Command

ls -lh /home/daytona/workspace/diabetes-ppt/Diabetes_Mellitus.pptx

Your presentation is ready. Here is the download link:

Diabetes Mellitus

Presentation · PPTX


The deck is 13 slides with a professional navy-and-blue colour scheme. Here is what each slide covers:
#SlideContent
1TitleCover with subtitle and source attribution
2OverviewDefinition, global burden, epidemiology (ADA stats)
3ClassificationVisual 4-type grid (T1, T2, GDM, Other) with colour-coded boxes
4Type 1 DMAetiology, autoimmune pathophysiology, diagnostic criteria, antibody testing
5Type 2 DMInsulin resistance, beta-cell failure, ominous octet, macro/microvascular complications
6GDM & Other TypesGDM screening/risks + MODY, drug-induced, endocrinopathies, pancreatogenic
7DiagnosisADA diagnostic table (FPG / OGTT / HbA1c / Random) + glycaemic targets
8T1 TreatmentInsulin types table (rapid/short/intermediate/long/ultra-long), basal-bolus, DCCT evidence
9T2 Oral Agents7-class drug table: Metformin, sulfonylureas, SGLT-2i, GLP-1 RA, DPP-4i, TZD, Acarbose
10Treatment AlgorithmStep-by-step T2DM algorithm (lifestyle → Metformin → add-on → insulin)
11ComplicationsAcute (DKA, HHS, hypoglycaemia) vs Chronic (nephropathy, retinopathy, neuropathy, foot)
12Monitoring8-parameter follow-up grid (HbA1c, BP, lipids, urine albumin, eye, foot, vaccinations, aspirin)
13Key Takeaways7 evidence-based summary points with UKPDS and STRATOS-2 references
This is a shared conversation. Sign in to Orris to start your own chat.