Can i get psm based pot templetes Slide Distribution: Slide 1: Introduction of the Family Slide 2: Socio-demographic Profile Slide 3: Health Status & Problems Identified Slide 4: Interventions / Health Education Provided Slide 5: Before and After Changes observed after adopting the family Iec activities Diabetes and hypertension Personal hygiene Malaria Tree plantation Heat stroke Health camp Obesity Make a presentable ppt with light professional background and use tables and flow chart accordingly

Reading File
Reading File
Running Command

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

Running Command

mkdir -p /home/daytona/workspace/psm-pot

Writing File

~/psm-pot/create_psm_pot.js

const pptxgen = require("pptxgenjs");

const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "PSM POT - Family Visit Template";
pres.author = "Community Medicine";

// ─── THEME ───────────────────────────────────────────────────────────────────
const C = {
  navy:      "1A3C5E",   // dominant dark blue
  teal:      "2A7F7F",   // accent
  skyLight:  "EAF4FB",   // slide background (very light blue)
  white:     "FFFFFF",
  offWhite:  "F5F9FC",
  accent:    "F0A500",   // amber accent
  text:      "1A2E3C",   // near-black text
  subtext:   "4A6278",   // secondary text
  tableHdr:  "1A3C5E",
  tableAlt:  "D6EAF8",
  green:     "1A7A4A",
  greenLt:   "D5F5E3",
  red:       "C0392B",
  redLt:     "FADBD8",
  purple:    "6C3483",
  purpleLt:  "E8DAEF",
  orange:    "D35400",
  orangeLt:  "FDEBD0",
};

// ─── HELPER: SLIDE BACKGROUND + HEADER BAND ──────────────────────────────────
function addBase(slide, title, subtitle) {
  // background
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.skyLight } });
  // top navy band
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.75, fill: { color: C.navy } });
  // teal accent strip below band
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0.75, w: 10, h: 0.06, fill: { color: C.teal } });
  // amber left accent bar
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.12, h: 5.625, fill: { color: C.accent } });
  // bottom navy footer
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 5.3, w: 10, h: 0.325, fill: { color: C.navy } });
  slide.addText("PSM – Preventive & Social Medicine | Community Health Visit", {
    x: 0.2, y: 5.3, w: 8, h: 0.325, fontSize: 8, color: C.white, valign: "middle"
  });
  // Slide title
  if (title) {
    slide.addText(title, {
      x: 0.25, y: 0.1, w: 9.5, h: 0.55,
      fontSize: 16, bold: true, color: C.white, valign: "middle", margin: 0
    });
  }
  if (subtitle) {
    slide.addText(subtitle, {
      x: 0.25, y: 0.82, w: 9.4, h: 0.32,
      fontSize: 9.5, color: C.teal, italic: true, valign: "middle", margin: 0
    });
  }
}

// ─── HELPER: SECTION LABEL BOX ───────────────────────────────────────────────
function sectionBox(slide, label, x, y, w, h, bg, textColor) {
  slide.addShape(pres.ShapeType.roundRect, {
    x, y, w, h,
    fill: { color: bg || C.navy },
    line: { color: bg || C.navy, width: 0 },
    rectRadius: 0.08
  });
  slide.addText(label, {
    x, y, w, h,
    fontSize: 9, bold: true, color: textColor || C.white,
    align: "center", valign: "middle", margin: 0
  });
}

// ─── HELPER: FLOW ARROW ──────────────────────────────────────────────────────
function flowArrow(slide, x, y) {
  slide.addShape(pres.ShapeType.rightArrow, {
    x, y, w: 0.35, h: 0.28,
    fill: { color: C.accent }, line: { color: C.accent, width: 0 }
  });
}

// ════════════════════════════════════════════════════════════════════════════
// SLIDE 0 – COVER
// ════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  // full navy bg
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.navy } });
  // teal diagonal ribbon
  s.addShape(pres.ShapeType.rect, { x: 0, y: 3.8, w: 10, h: 1.825, fill: { color: C.teal } });
  // amber left bar
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.18, h: 5.625, fill: { color: C.accent } });
  // white top divider
  s.addShape(pres.ShapeType.rect, { x: 0, y: 3.78, w: 10, h: 0.04, fill: { color: C.white } });

  s.addText("PSM – PREVENTIVE & SOCIAL MEDICINE", {
    x: 0.3, y: 0.5, w: 9.4, h: 0.55,
    fontSize: 13, bold: true, color: C.accent, charSpacing: 3, align: "center"
  });
  s.addText("PERIPHERAL OUTREACH TRAINING (POT)", {
    x: 0.3, y: 1.1, w: 9.4, h: 0.9,
    fontSize: 26, bold: true, color: C.white, align: "center"
  });
  s.addText("Community Family Visit – Template Slides", {
    x: 0.3, y: 2.05, w: 9.4, h: 0.45,
    fontSize: 14, color: "A8D8EA", align: "center", italic: true
  });

  // boxes on teal band
  const topics = ["Family Introduction", "Socio-demographic Profile", "Health Problems", "Interventions", "Before & After Changes"];
  const bw = 1.75;
  const bstart = 0.25;
  topics.forEach((t, i) => {
    s.addShape(pres.ShapeType.roundRect, {
      x: bstart + i * (bw + 0.1), y: 3.95, w: bw, h: 0.55,
      fill: { color: C.white }, line: { color: C.accent, width: 1.5 },
      rectRadius: 0.1
    });
    s.addText(`${i+1}. ${t}`, {
      x: bstart + i * (bw + 0.1), y: 3.95, w: bw, h: 0.55,
      fontSize: 7.5, color: C.navy, bold: true, align: "center", valign: "middle", margin: 0
    });
  });

  s.addText("Department of Community Medicine  |  IEC Activities Included", {
    x: 0.3, y: 5.0, w: 9.4, h: 0.3,
    fontSize: 9, color: C.white, align: "center"
  });
}

// ════════════════════════════════════════════════════════════════════════════
// SLIDE 1 – INTRODUCTION OF THE FAMILY
// ════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  addBase(s, "SLIDE 1 – INTRODUCTION OF THE FAMILY", "A brief profile of the adopted family for community health visit");

  // Household info table
  const infoRows = [
    [{ text: "Field", options: { bold: true, color: C.white } }, { text: "Details", options: { bold: true, color: C.white } }],
    ["Name of Head of Family", "Mr. / Mrs. ___________________________"],
    ["House No. / Address", "House No. ______, Village/Urban Area ___________"],
    ["Distance from Health Centre", "___________ km"],
    ["Type of Family", "Nuclear / Joint / Extended"],
    ["Total Family Members", "___________ members"],
    ["Religion / Caste", "___________________________"],
    ["Socio-economic Status", "Upper / Middle / Lower (Kuppuswamy Scale)"],
    ["Date of First Visit", "___________________________"],
  ];

  s.addTable(infoRows, {
    x: 0.25, y: 1.22, w: 5.8, h: 3.8,
    fontSize: 9,
    colW: [2.4, 3.4],
    rowH: 0.38,
    border: { type: "solid", color: C.navy, pt: 0.5 },
    fill: { color: C.offWhite },
    color: C.text,
  });

  // override header row fill
  // (applied via first row bold + navy in cell options above)

  // Right panel – Family Visit objectives flowchart
  sectionBox(s, "OBJECTIVES OF FAMILY VISIT", 6.3, 1.22, 3.45, 0.38, C.navy, C.white);

  const objectives = [
    { icon: "1", text: "Establish rapport\nwith the family" },
    { icon: "2", text: "Identify health\nproblems" },
    { icon: "3", text: "Provide health\neducation (IEC)" },
    { icon: "4", text: "Record baseline\nhealth data" },
    { icon: "5", text: "Plan follow-up\ninterventions" },
  ];

  objectives.forEach((obj, i) => {
    const bx = 6.3;
    const by = 1.7 + i * 0.72;
    // circle badge
    s.addShape(pres.ShapeType.ellipse, {
      x: bx, y: by, w: 0.36, h: 0.36,
      fill: { color: C.accent }, line: { color: C.accent, width: 0 }
    });
    s.addText(obj.icon, { x: bx, y: by, w: 0.36, h: 0.36, fontSize: 9, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });
    s.addShape(pres.ShapeType.roundRect, {
      x: bx + 0.42, y: by, w: 3.0, h: 0.36,
      fill: { color: C.tableAlt }, line: { color: C.teal, width: 0.5 }, rectRadius: 0.06
    });
    s.addText(obj.text, {
      x: bx + 0.42, y: by, w: 3.0, h: 0.36,
      fontSize: 8, color: C.text, valign: "middle", margin: [0, 0.08]
    });
    // connector arrow (not last)
    if (i < objectives.length - 1) {
      s.addShape(pres.ShapeType.rect, {
        x: bx + 0.16, y: by + 0.36, w: 0.04, h: 0.18,
        fill: { color: C.teal }
      });
      s.addShape(pres.ShapeType.isoscelesTriangle, {
        x: bx + 0.1, y: by + 0.52, w: 0.16, h: 0.13,
        fill: { color: C.teal }
      });
    }
  });
}

// ════════════════════════════════════════════════════════════════════════════
// SLIDE 2 – SOCIO-DEMOGRAPHIC PROFILE
// ════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  addBase(s, "SLIDE 2 – SOCIO-DEMOGRAPHIC PROFILE", "Detailed demographic data of all family members");

  // Main family members table
  sectionBox(s, "FAMILY MEMBERS REGISTER", 0.25, 1.22, 9.5, 0.35, C.teal, C.white);

  const memberRows = [
    [
      { text: "S.No", options: { bold: true, color: C.white, fill: { color: C.navy } } },
      { text: "Name", options: { bold: true, color: C.white, fill: { color: C.navy } } },
      { text: "Relation", options: { bold: true, color: C.white, fill: { color: C.navy } } },
      { text: "Age/Sex", options: { bold: true, color: C.white, fill: { color: C.navy } } },
      { text: "Education", options: { bold: true, color: C.white, fill: { color: C.navy } } },
      { text: "Occupation", options: { bold: true, color: C.white, fill: { color: C.navy } } },
      { text: "Marital Status", options: { bold: true, color: C.white, fill: { color: C.navy } } },
      { text: "Health Status", options: { bold: true, color: C.white, fill: { color: C.navy } } },
    ],
    ["1", "___________", "Head", "___/M", "Graduate", "Farmer", "Married", "Healthy"],
    ["2", "___________", "Spouse", "___/F", "Secondary", "Homemaker", "Married", "HTN"],
    ["3", "___________", "Son/Daughter", "___/M", "Primary", "Student", "Unmarried", "Healthy"],
    ["4", "___________", "___________", "___/__", "___________", "___________", "___________", "___________"],
    ["5", "___________", "___________", "___/__", "___________", "___________", "___________", "___________"],
  ];

  s.addTable(memberRows, {
    x: 0.25, y: 1.58, w: 9.5, h: 2.1,
    fontSize: 7.5,
    colW: [0.4, 1.4, 1.1, 0.8, 1.0, 1.1, 1.1, 1.55],
    rowH: 0.35,
    border: { type: "solid", color: "B0C4D8", pt: 0.4 },
    fill: { color: C.offWhite },
    color: C.text
  });

  // Bottom 3 info boxes
  const boxData = [
    { label: "Housing Type", items: ["Pucca / Semi-pucca / Kutcha", "No. of rooms: _____", "Overcrowding: Yes / No", "Ventilation: Adequate / Inadequate"] },
    { label: "Sanitation & Water", items: ["Drinking Water: Tap / Well / Borewell", "Toilet: Yes / No (Open Defecation)", "Sewage: Closed drain / Open drain", "Waste disposal: Pit / Road-side"] },
    { label: "Per Capita Income (Kuppuswamy)", items: ["Class I (Upper): >Rs.26,749", "Class II: Rs.13,375–26,748", "Class III (Middle): Rs.8,025–13,374", "Class IV/V (Lower): <Rs.8,024"] },
  ];

  boxData.forEach((box, i) => {
    const bx = 0.25 + i * 3.2;
    s.addShape(pres.ShapeType.roundRect, {
      x: bx, y: 3.78, w: 3.1, h: 1.35,
      fill: { color: C.white }, line: { color: C.navy, width: 0.8 }, rectRadius: 0.1
    });
    s.addShape(pres.ShapeType.rect, {
      x: bx, y: 3.78, w: 3.1, h: 0.28,
      fill: { color: C.navy }
    });
    s.addText(box.label, {
      x: bx, y: 3.78, w: 3.1, h: 0.28,
      fontSize: 8.5, bold: true, color: C.white, align: "center", valign: "middle", margin: 0
    });
    s.addText(box.items.map(t => "• " + t).join("\n"), {
      x: bx + 0.08, y: 4.08, w: 2.96, h: 1.0,
      fontSize: 7.5, color: C.text, valign: "top", margin: 0
    });
  });
}

// ════════════════════════════════════════════════════════════════════════════
// SLIDE 3 – HEALTH STATUS & PROBLEMS IDENTIFIED
// ════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  addBase(s, "SLIDE 3 – HEALTH STATUS & PROBLEMS IDENTIFIED", "Comprehensive health assessment findings from family visit");

  // Health problems table
  sectionBox(s, "HEALTH PROBLEMS REGISTER", 0.25, 1.22, 5.6, 0.32, C.teal, C.white);

  const healthRows = [
    [
      { text: "Member", options: { bold: true, color: C.white, fill: { color: C.navy } } },
      { text: "Complaints / Diagnosis", options: { bold: true, color: C.white, fill: { color: C.navy } } },
      { text: "Duration", options: { bold: true, color: C.white, fill: { color: C.navy } } },
      { text: "Treatment", options: { bold: true, color: C.white, fill: { color: C.navy } } },
    ],
    ["Head of Family", "Hypertension, Diabetes", "3 yrs", "On medication"],
    ["Spouse", "Anaemia, Obesity (BMI >30)", "2 yrs", "Diet counselling"],
    ["Child 1", "Acute febrile illness", "5 days", "OPD treatment"],
    ["Child 2", "Malnutrition (Grade II)", "6 months", "ICDS referral"],
    ["Elderly", "COPD, Visual impairment", "5 yrs", "Specialist ref."],
    ["General", "Poor sanitation, Vector breeding", "Ongoing", "Health education"],
  ];

  s.addTable(healthRows, {
    x: 0.25, y: 1.56, w: 5.6, h: 2.35,
    fontSize: 8,
    colW: [1.3, 2.0, 0.9, 1.4],
    rowH: 0.35,
    border: { type: "solid", color: "B0C4D8", pt: 0.4 },
    fill: { color: C.offWhite },
    color: C.text
  });

  // Right – Priority problem matrix
  sectionBox(s, "PROBLEM PRIORITIZATION", 6.05, 1.22, 3.7, 0.32, C.red, C.white);

  const prioRows = [
    [
      { text: "Problem", options: { bold: true, color: C.white, fill: { color: C.red } } },
      { text: "Severity", options: { bold: true, color: C.white, fill: { color: C.red } } },
      { text: "Priority", options: { bold: true, color: C.white, fill: { color: C.red } } },
    ],
    ["Hypertension/DM", "High", "★★★"],
    ["Anaemia", "Moderate", "★★"],
    ["Malnutrition", "High", "★★★"],
    ["Vector breeding", "Moderate", "★★"],
    ["Poor sanitation", "High", "★★★"],
  ];

  s.addTable(prioRows, {
    x: 6.05, y: 1.56, w: 3.7, h: 2.2,
    fontSize: 8.5,
    colW: [1.7, 1.0, 1.0],
    rowH: 0.37,
    border: { type: "solid", color: "F5B7B1", pt: 0.4 },
    fill: { color: C.offWhite },
    color: C.text
  });

  // Bottom – Vital signs summary boxes
  const vitals = [
    { label: "BP (mmHg)", val: "___ / ___", icon: "♥", color: C.red },
    { label: "Blood Sugar (mg/dL)", val: "F: ___ PP: ___", icon: "🩸", color: C.orange },
    { label: "BMI (kg/m²)", val: "___._", icon: "⚖", color: C.purple },
    { label: "Hb (g/dL)", val: "___", icon: "🧪", color: C.green },
    { label: "Immunisation Status", val: "Complete / Partial", icon: "💉", color: C.teal },
  ];

  vitals.forEach((v, i) => {
    const bx = 0.25 + i * 1.93;
    s.addShape(pres.ShapeType.roundRect, {
      x: bx, y: 3.98, w: 1.83, h: 0.95,
      fill: { color: C.white }, line: { color: v.color, width: 1.2 }, rectRadius: 0.1
    });
    s.addShape(pres.ShapeType.rect, {
      x: bx, y: 3.98, w: 1.83, h: 0.24,
      fill: { color: v.color }
    });
    s.addText(v.label, {
      x: bx, y: 3.98, w: 1.83, h: 0.24,
      fontSize: 7, bold: true, color: C.white, align: "center", valign: "middle", margin: 0
    });
    s.addText(v.val, {
      x: bx, y: 4.24, w: 1.83, h: 0.65,
      fontSize: 14, bold: true, color: v.color, align: "center", valign: "middle"
    });
  });
}

// ════════════════════════════════════════════════════════════════════════════
// SLIDE 4 – INTERVENTIONS / HEALTH EDUCATION PROVIDED
// ════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  addBase(s, "SLIDE 4 – INTERVENTIONS & HEALTH EDUCATION PROVIDED", "Action plan and IEC activities conducted during visits");

  // Flowchart: Assessment → Plan → Execute → Follow-up
  const flow = ["ASSESS\nHealth Status", "IDENTIFY\nPriority Problems", "PLAN\nInterventions", "EXECUTE\nHealth Education", "FOLLOW-UP\n& Referral"];
  const colors = [C.navy, C.teal, C.orange, C.green, C.purple];

  flow.forEach((step, i) => {
    const bx = 0.2 + i * 1.95;
    s.addShape(pres.ShapeType.roundRect, {
      x: bx, y: 1.18, w: 1.7, h: 0.62,
      fill: { color: colors[i] }, line: { color: colors[i], width: 0 }, rectRadius: 0.1
    });
    s.addText(step, {
      x: bx, y: 1.18, w: 1.7, h: 0.62,
      fontSize: 8, bold: true, color: C.white, align: "center", valign: "middle"
    });
    if (i < flow.length - 1) {
      flowArrow(s, bx + 1.72, 1.35);
    }
  });

  // Interventions table
  const intRows = [
    [
      { text: "S.No", options: { bold: true, color: C.white, fill: { color: C.navy } } },
      { text: "Intervention / Activity", options: { bold: true, color: C.white, fill: { color: C.navy } } },
      { text: "Member Targeted", options: { bold: true, color: C.white, fill: { color: C.navy } } },
      { text: "Method Used", options: { bold: true, color: C.white, fill: { color: C.navy } } },
      { text: "Date", options: { bold: true, color: C.white, fill: { color: C.navy } } },
      { text: "Outcome", options: { bold: true, color: C.white, fill: { color: C.navy } } },
    ],
    ["1", "Health education on Hypertension & DM", "Head + Spouse", "Counselling, Pamphlet", "__/__/__", "Understood"],
    ["2", "Personal hygiene & hand washing demo", "All members", "Demonstration", "__/__/__", "Practiced"],
    ["3", "Malaria prevention – mosquito net use", "All members", "IEC material", "__/__/__", "Net used"],
    ["4", "Nutritional counselling – balanced diet", "Spouse, Child", "Group talk", "__/__/__", "Diet modified"],
    ["5", "Referral for specialist / OPD", "Elderly / HTN", "Referral slip", "__/__/__", "Referred"],
    ["6", "Immunisation status checked / advised", "Children", "Counselling", "__/__/__", "Completed"],
  ];

  s.addTable(intRows, {
    x: 0.25, y: 1.9, w: 9.5, h: 2.55,
    fontSize: 8,
    colW: [0.4, 2.5, 1.6, 1.5, 0.9, 1.1],
    rowH: 0.37,
    border: { type: "solid", color: "B0C4D8", pt: 0.4 },
    fill: { color: C.offWhite },
    color: C.text
  });

  // bottom note
  s.addShape(pres.ShapeType.roundRect, {
    x: 0.25, y: 4.55, w: 9.5, h: 0.52,
    fill: { color: "FEF9E7" }, line: { color: C.accent, width: 1 }, rectRadius: 0.08
  });
  s.addText("Note: All interventions should be documented with date, method, and response. Follow-up visits to be scheduled within 2–4 weeks for evaluation.", {
    x: 0.35, y: 4.55, w: 9.3, h: 0.52,
    fontSize: 8.5, color: C.orange, italic: true, valign: "middle"
  });
}

// ════════════════════════════════════════════════════════════════════════════
// SLIDE 5 – BEFORE AND AFTER CHANGES
// ════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  addBase(s, "SLIDE 5 – BEFORE & AFTER CHANGES OBSERVED", "Impact assessment after adopting health interventions");

  // Before column header
  s.addShape(pres.ShapeType.rect, { x: 0.25, y: 1.22, w: 4.1, h: 0.36, fill: { color: C.red } });
  s.addText("BEFORE INTERVENTION", { x: 0.25, y: 1.22, w: 4.1, h: 0.36, fontSize: 10, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });

  // After column header
  s.addShape(pres.ShapeType.rect, { x: 5.65, y: 1.22, w: 4.1, h: 0.36, fill: { color: C.green } });
  s.addText("AFTER INTERVENTION", { x: 5.65, y: 1.22, w: 4.1, h: 0.36, fontSize: 10, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });

  // Arrow in middle
  s.addShape(pres.ShapeType.rightArrow, { x: 4.4, y: 1.28, w: 1.2, h: 0.24, fill: { color: C.accent } });

  // Comparison rows
  const compare = [
    { domain: "Hygiene", before: "Irregular hand washing\nOpen defecation practiced\nNo use of soap", after: "Regular hand washing\nToilet construction done\nSoap use established" },
    { domain: "Diet & Nutrition", before: "High salt/oil intake\nIrregular meals\nNo vegetables daily", after: "Reduced salt/oil\nRegular meals, 3x/day\nVegetable intake improved" },
    { domain: "Chronic Disease", before: "BP/Sugar uncontrolled\nMedication non-compliance\nNo follow-up visits", after: "BP/Sugar controlled\nRegular medication intake\nFollow-up maintained" },
    { domain: "Vector Control", before: "Stagnant water present\nNo mosquito net used\nVector breeding spots", after: "Stagnant water removed\nMosquito net in use\nNo breeding spots" },
  ];

  compare.forEach((row, i) => {
    const ry = 1.65 + i * 0.88;
    // domain label
    s.addShape(pres.ShapeType.roundRect, { x: 4.35, y: ry, w: 1.3, h: 0.78, fill: { color: C.navy }, rectRadius: 0.06 });
    s.addText(row.domain, { x: 4.35, y: ry, w: 1.3, h: 0.78, fontSize: 7.5, bold: true, color: C.white, align: "center", valign: "middle" });

    // before box
    s.addShape(pres.ShapeType.roundRect, { x: 0.25, y: ry, w: 4.08, h: 0.78, fill: { color: C.redLt }, line: { color: C.red, width: 0.5 }, rectRadius: 0.06 });
    s.addText(row.before, { x: 0.35, y: ry + 0.05, w: 3.88, h: 0.68, fontSize: 8, color: C.text, valign: "top" });

    // after box
    s.addShape(pres.ShapeType.roundRect, { x: 5.67, y: ry, w: 4.08, h: 0.78, fill: { color: C.greenLt }, line: { color: C.green, width: 0.5 }, rectRadius: 0.06 });
    s.addText(row.after, { x: 5.77, y: ry + 0.05, w: 3.88, h: 0.68, fontSize: 8, color: C.text, valign: "top" });
  });
}

// ════════════════════════════════════════════════════════════════════════════
// IEC ACTIVITIES – SECTION DIVIDER
// ════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.teal } });
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.18, h: 5.625, fill: { color: C.accent } });
  s.addShape(pres.ShapeType.rect, { x: 0, y: 4.8, w: 10, h: 0.825, fill: { color: C.navy } });

  s.addText("IEC ACTIVITIES", {
    x: 0.3, y: 0.7, w: 9.4, h: 1.1,
    fontSize: 38, bold: true, color: C.white, align: "center", charSpacing: 8
  });
  s.addText("Information, Education & Communication", {
    x: 0.3, y: 1.75, w: 9.4, h: 0.5,
    fontSize: 15, italic: true, color: "A8EFEF", align: "center"
  });
  s.addShape(pres.ShapeType.rect, { x: 2, y: 2.35, w: 6, h: 0.04, fill: { color: C.white } });

  const iecTopics = ["Diabetes & Hypertension", "Personal Hygiene", "Malaria", "Tree Plantation", "Heat Stroke", "Health Camp", "Obesity"];
  iecTopics.forEach((t, i) => {
    const col = i % 4;
    const row = Math.floor(i / 4);
    s.addShape(pres.ShapeType.roundRect, {
      x: 0.5 + col * 2.25, y: 2.55 + row * 0.7, w: 2.1, h: 0.55,
      fill: { color: "rgba(255,255,255,0.15)" },
      line: { color: C.white, width: 0.8 }, rectRadius: 0.1
    });
    s.addText(`${i + 1}. ${t}`, {
      x: 0.5 + col * 2.25, y: 2.55 + row * 0.7, w: 2.1, h: 0.55,
      fontSize: 9, bold: true, color: C.white, align: "center", valign: "middle"
    });
  });

  s.addText("Community Health Awareness | Preventive & Social Medicine", {
    x: 0.3, y: 4.85, w: 9.4, h: 0.4,
    fontSize: 9, color: "A8D8EA", align: "center"
  });
}

// ─── IEC HELPER ──────────────────────────────────────────────────────────────
function addIECSlide(title, subtitle, topicColor, leftCol, rightCol, tableData) {
  const s = pres.addSlide();
  addBase(s, `IEC – ${title.toUpperCase()}`, subtitle);

  // Left content column
  leftCol.forEach((section, si) => {
    const sy = 1.22 + si * (section.h || 1.1);
    sectionBox(s, section.header, 0.25, sy, 4.55, 0.32, topicColor, C.white);
    if (section.bullets) {
      s.addShape(pres.ShapeType.roundRect, {
        x: 0.25, y: sy + 0.33, w: 4.55, h: section.h - 0.38,
        fill: { color: C.white }, line: { color: topicColor, width: 0.6 }, rectRadius: 0.06
      });
      s.addText(section.bullets.map(b => ({ text: b, options: { bullet: { type: "bullet" }, breakLine: true } })), {
        x: 0.35, y: sy + 0.35, w: 4.38, h: section.h - 0.42,
        fontSize: 8.5, color: C.text, valign: "top"
      });
    }
  });

  // Right table
  if (tableData) {
    sectionBox(s, tableData.header, 5.0, 1.22, 4.75, 0.32, topicColor, C.white);
    s.addTable(tableData.rows, {
      x: 5.0, y: 1.56, w: 4.75, h: tableData.h || 2.5,
      fontSize: 8,
      colW: tableData.colW,
      rowH: tableData.rowH || 0.38,
      border: { type: "solid", color: "B0C4D8", pt: 0.4 },
      fill: { color: C.offWhite },
      color: C.text
    });
  }

  // right bullets only
  if (!tableData && rightCol) {
    rightCol.forEach((section, si) => {
      const sy = 1.22 + si * (section.h || 1.1);
      sectionBox(s, section.header, 5.0, sy, 4.75, 0.32, topicColor, C.white);
      s.addShape(pres.ShapeType.roundRect, {
        x: 5.0, y: sy + 0.33, w: 4.75, h: section.h - 0.38,
        fill: { color: C.white }, line: { color: topicColor, width: 0.6 }, rectRadius: 0.06
      });
      s.addText(section.bullets.map(b => ({ text: b, options: { bullet: { type: "bullet" }, breakLine: true } })), {
        x: 5.1, y: sy + 0.35, w: 4.58, h: section.h - 0.42,
        fontSize: 8.5, color: C.text, valign: "top"
      });
    });
  }

  return s;
}

// ════════════════════════════════════════════════════════════════════════════
// IEC 1 – DIABETES & HYPERTENSION
// ════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  addBase(s, "IEC – DIABETES & HYPERTENSION", "Prevention, early detection, and lifestyle modification");

  // Flowchart top: Risk → Screening → Diagnosis → Treatment → Control
  const steps = [
    { label: "RISK\nFACTORS", color: C.red },
    { label: "SCREENING\n& Detection", color: C.orange },
    { label: "DIAGNOSIS\nConfirmation", color: C.purple },
    { label: "TREATMENT\n& Medication", color: C.teal },
    { label: "LIFESTYLE\nControl", color: C.green },
  ];
  steps.forEach((st, i) => {
    s.addShape(pres.ShapeType.roundRect, {
      x: 0.2 + i * 1.95, y: 1.2, w: 1.7, h: 0.6,
      fill: { color: st.color }, rectRadius: 0.1
    });
    s.addText(st.label, { x: 0.2 + i * 1.95, y: 1.2, w: 1.7, h: 0.6, fontSize: 8, bold: true, color: C.white, align: "center", valign: "middle" });
    if (i < 4) flowArrow(s, 0.2 + i * 1.95 + 1.72, 1.36);
  });

  // Diabetes table
  sectionBox(s, "DIABETES MELLITUS – KEY FACTS", 0.25, 1.95, 4.55, 0.3, C.orange, C.white);
  const dmRows = [
    [{ text: "Parameter", options: { bold: true, color: C.white, fill: { color: C.orange } } }, { text: "Normal", options: { bold: true, color: C.white, fill: { color: C.orange } } }, { text: "DM (Diagnostic)", options: { bold: true, color: C.white, fill: { color: C.orange } } }],
    ["Fasting BG", "70–99 mg/dL", "≥126 mg/dL"],
    ["Post-prandial BG", "<140 mg/dL", "≥200 mg/dL"],
    ["HbA1c", "<5.7%", "≥6.5%"],
    ["Random BG", "<140 mg/dL", "≥200 + symptoms"],
  ];
  s.addTable(dmRows, {
    x: 0.25, y: 2.27, w: 4.55, h: 1.7,
    fontSize: 8, colW: [1.7, 1.2, 1.65], rowH: 0.35,
    border: { type: "solid", color: "F9E1C0", pt: 0.4 }, fill: { color: C.offWhite }, color: C.text
  });

  // HTN table
  sectionBox(s, "HYPERTENSION – JNC-8 CLASSIFICATION", 5.0, 1.95, 4.75, 0.3, C.red, C.white);
  const htnRows = [
    [{ text: "Category", options: { bold: true, color: C.white, fill: { color: C.red } } }, { text: "Systolic", options: { bold: true, color: C.white, fill: { color: C.red } } }, { text: "Diastolic", options: { bold: true, color: C.white, fill: { color: C.red } } }],
    ["Normal", "<120 mmHg", "<80 mmHg"],
    ["Elevated", "120–129 mmHg", "<80 mmHg"],
    ["Stage 1 HTN", "130–139 mmHg", "80–89 mmHg"],
    ["Stage 2 HTN", "≥140 mmHg", "≥90 mmHg"],
  ];
  s.addTable(htnRows, {
    x: 5.0, y: 2.27, w: 4.75, h: 1.7,
    fontSize: 8, colW: [1.8, 1.5, 1.45], rowH: 0.35,
    border: { type: "solid", color: "FADBD8", pt: 0.4 }, fill: { color: C.offWhite }, color: C.text
  });

  // Bottom lifestyle tips
  const tips = ["Reduce salt intake to <5g/day", "Exercise 30 min/day, 5 days/week", "Avoid smoking & alcohol", "Maintain BMI 18.5–24.9", "Regular BP/Sugar monitoring", "Take medication as prescribed"];
  sectionBox(s, "LIFESTYLE MODIFICATION TIPS (IEC MESSAGE)", 0.25, 4.05, 9.5, 0.3, C.green, C.white);
  s.addShape(pres.ShapeType.roundRect, { x: 0.25, y: 4.37, w: 9.5, h: 0.68, fill: { color: C.greenLt }, line: { color: C.green, width: 0.5 }, rectRadius: 0.06 });
  s.addText(tips.map((t, i) => `${i % 2 === 0 ? "\n" : ""}✓ ${t}`).join("   "), {
    x: 0.35, y: 4.37, w: 9.3, h: 0.68,
    fontSize: 8.5, color: C.text, valign: "middle"
  });
}

// ════════════════════════════════════════════════════════════════════════════
// IEC 2 – PERSONAL HYGIENE
// ════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  addBase(s, "IEC – PERSONAL HYGIENE", "Promoting cleanliness practices for disease prevention");

  const hygieneAreas = [
    { title: "HAND HYGIENE", steps: ["Wet hands with clean water", "Apply soap and lather 20 sec", "Scrub all surfaces of hands", "Rinse thoroughly under water", "Dry with clean cloth/air dry", "Key times: before eating, after toilet, after handling waste"], color: C.teal, x: 0.25, y: 1.22 },
    { title: "ORAL & DENTAL HYGIENE", steps: ["Brush teeth twice daily", "Use fluoride toothpaste", "Rinse mouth after every meal", "Replace toothbrush every 3 months", "Avoid tobacco/gutkha products", "Dental visit every 6 months"], color: C.navy, x: 5.0, y: 1.22 },
    { title: "BODY & SKIN HYGIENE", steps: ["Bathe daily with soap and water", "Keep nails short and clean", "Wear clean, washed clothes", "Change inner wear daily", "Avoid sharing personal items", "Maintain genital hygiene"], color: C.purple, x: 0.25, y: 2.98 },
    { title: "FOOD & WATER HYGIENE", steps: ["Drink boiled/filtered water", "Cover cooked food always", "Wash vegetables/fruits before eating", "Use clean utensils", "Avoid stale/outside food", "Store food in covered containers"], color: C.green, x: 5.0, y: 2.98 },
  ];

  hygieneAreas.forEach(area => {
    sectionBox(s, area.title, area.x, area.y, 4.6, 0.3, area.color, C.white);
    s.addShape(pres.ShapeType.roundRect, {
      x: area.x, y: area.y + 0.32, w: 4.6, h: 1.42,
      fill: { color: C.white }, line: { color: area.color, width: 0.6 }, rectRadius: 0.06
    });
    s.addText(area.steps.map(b => ({ text: b, options: { bullet: { type: "bullet" }, breakLine: true } })), {
      x: area.x + 0.1, y: area.y + 0.34, w: 4.44, h: 1.38,
      fontSize: 8, color: C.text, valign: "top"
    });
  });

  // bottom strip
  s.addShape(pres.ShapeType.roundRect, { x: 0.25, y: 5.02, w: 9.5, h: 0.28, fill: { color: C.teal }, rectRadius: 0.05 });
  s.addText("Key Message: \"CLEANLINESS IS NEXT TO HEALTHINESS\" – Practice hygiene to prevent 80% of infectious diseases", {
    x: 0.35, y: 5.02, w: 9.3, h: 0.28, fontSize: 8.5, bold: true, color: C.white, align: "center", valign: "middle", margin: 0
  });
}

// ════════════════════════════════════════════════════════════════════════════
// IEC 3 – MALARIA
// ════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  addBase(s, "IEC – MALARIA PREVENTION & CONTROL", "Vector control and early treatment are key to eliminating malaria");

  // Transmission cycle flowchart
  sectionBox(s, "MALARIA TRANSMISSION CYCLE", 0.25, 1.22, 9.5, 0.3, C.teal, C.white);
  const cycle = ["Infected\nAnopheles Mosquito", "Bites Human\n(Dusk/Dawn)", "Parasite enters\nBloodstream", "Liver Stage\n(Incubation)", "Symptoms Appear\n(Fever, Chills)", "Diagnosis &\nTreatment"];
  const cColors = [C.red, C.orange, C.purple, C.navy, C.teal, C.green];
  cycle.forEach((step, i) => {
    s.addShape(pres.ShapeType.roundRect, {
      x: 0.25 + i * 1.6, y: 1.57, w: 1.45, h: 0.62,
      fill: { color: cColors[i] }, rectRadius: 0.08
    });
    s.addText(step, { x: 0.25 + i * 1.6, y: 1.57, w: 1.45, h: 0.62, fontSize: 7.5, bold: true, color: C.white, align: "center", valign: "middle" });
    if (i < 5) flowArrow(s, 0.25 + i * 1.6 + 1.47, 1.73);
  });

  // Prevention table
  sectionBox(s, "PREVENTION STRATEGIES", 0.25, 2.3, 4.55, 0.3, C.navy, C.white);
  const malPrev = [
    [{ text: "Method", options: { bold: true, color: C.white, fill: { color: C.navy } } }, { text: "Details", options: { bold: true, color: C.white, fill: { color: C.navy } } }],
    ["LLIN / Bed Nets", "Use insecticide-treated nets every night"],
    ["IRS", "Indoor residual spray every 6 months"],
    ["Larval Control", "Remove stagnant water, use temephos"],
    ["Repellents", "Apply mosquito repellent on exposed skin"],
    ["Protective Clothing", "Full-sleeve clothes during evenings"],
  ];
  s.addTable(malPrev, {
    x: 0.25, y: 2.62, w: 4.55, h: 2.0,
    fontSize: 8, colW: [1.5, 3.05], rowH: 0.37,
    border: { type: "solid", color: "B0C4D8", pt: 0.4 }, fill: { color: C.offWhite }, color: C.text
  });

  // Symptoms & diagnosis right
  sectionBox(s, "SYMPTOMS & DIAGNOSIS", 5.0, 2.3, 4.75, 0.3, C.red, C.white);
  const malDiag = [
    [{ text: "Parameter", options: { bold: true, color: C.white, fill: { color: C.red } } }, { text: "P. vivax", options: { bold: true, color: C.white, fill: { color: C.red } } }, { text: "P. falciparum", options: { bold: true, color: C.white, fill: { color: C.red } } }],
    ["Fever pattern", "Every 48 hrs", "Irregular/Continuous"],
    ["Severity", "Benign", "Potentially fatal"],
    ["Diagnosis", "RDT / Smear", "RDT / Smear"],
    ["Treatment", "Chloroquine + Primaquine", "ACT (Artemether)"],
    ["Duration Rx", "14 days", "3 days ACT"],
  ];
  s.addTable(malDiag, {
    x: 5.0, y: 2.62, w: 4.75, h: 2.0,
    fontSize: 8, colW: [1.4, 1.6, 1.75], rowH: 0.37,
    border: { type: "solid", color: "FADBD8", pt: 0.4 }, fill: { color: C.offWhite }, color: C.text
  });

  s.addShape(pres.ShapeType.roundRect, { x: 0.25, y: 4.72, w: 9.5, h: 0.3, fill: { color: "E8F8F5" }, line: { color: C.green, width: 0.8 }, rectRadius: 0.05 });
  s.addText("Government Programme: National Vector Borne Disease Control Programme (NVBDCP) – Free diagnosis and treatment available at PHC/CHC", {
    x: 0.35, y: 4.72, w: 9.3, h: 0.3, fontSize: 8, color: C.green, align: "center", valign: "middle", margin: 0
  });
}

// ════════════════════════════════════════════════════════════════════════════
// IEC 4 – TREE PLANTATION
// ════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  addBase(s, "IEC – TREE PLANTATION & ENVIRONMENTAL HEALTH", "Green community = Healthy community");

  // Benefits grid
  sectionBox(s, "HEALTH & ENVIRONMENTAL BENEFITS OF TREES", 0.25, 1.22, 9.5, 0.3, C.green, C.white);

  const benefits = [
    { icon: "🌬", title: "Air Purification", desc: "Trees absorb CO₂, release O₂\nFilter dust & particulate matter\nReduce air pollution by 25%" },
    { icon: "🌡", title: "Temperature Control", desc: "Reduce ambient temp by 2-8°C\nProvide shade & cooling\nPrevent urban heat island effect" },
    { icon: "🧠", title: "Mental Health", desc: "Green spaces reduce stress\nImprove mood & well-being\nLower anxiety & depression rates" },
    { icon: "💧", title: "Water Conservation", desc: "Prevent soil erosion\nRecharge groundwater table\nImprove water quality" },
    { icon: "🦋", title: "Biodiversity", desc: "Support wildlife & insects\nMaintain ecological balance\nPollinators for agriculture" },
    { icon: "🏥", title: "Disease Prevention", desc: "Reduce respiratory illness\nProvide medicinal plants\nImprove community immunity" },
  ];

  benefits.forEach((b, i) => {
    const col = i % 3;
    const row = Math.floor(i / 3);
    const bx = 0.25 + col * 3.2;
    const by = 1.6 + row * 1.55;
    s.addShape(pres.ShapeType.roundRect, {
      x: bx, y: by, w: 3.1, h: 1.4,
      fill: { color: C.white }, line: { color: C.green, width: 0.8 }, rectRadius: 0.1
    });
    s.addShape(pres.ShapeType.rect, { x: bx, y: by, w: 3.1, h: 0.32, fill: { color: C.green } });
    s.addText(`${b.icon}  ${b.title}`, { x: bx, y: by, w: 3.1, h: 0.32, fontSize: 8.5, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });
    s.addText(b.desc, { x: bx + 0.1, y: by + 0.34, w: 2.9, h: 1.0, fontSize: 8, color: C.text, valign: "top" });
  });

  s.addShape(pres.ShapeType.roundRect, { x: 0.25, y: 5.0, w: 9.5, h: 0.3, fill: { color: C.greenLt }, line: { color: C.green, width: 0.8 }, rectRadius: 0.05 });
  s.addText("Message: Plant at least ONE tree per family. Participate in Van Mahotsav (July) & World Environment Day (June 5) plantation drives.", {
    x: 0.35, y: 5.0, w: 9.3, h: 0.3, fontSize: 8.5, bold: true, color: C.green, align: "center", valign: "middle", margin: 0
  });
}

// ════════════════════════════════════════════════════════════════════════════
// IEC 5 – HEAT STROKE
// ════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  addBase(s, "IEC – HEAT STROKE PREVENTION & FIRST AID", "Recognise, Respond, Recover – Beat the Heat");

  // What is heat stroke
  sectionBox(s, "WHAT IS HEAT STROKE?", 0.25, 1.22, 4.55, 0.3, C.red, C.white);
  s.addShape(pres.ShapeType.roundRect, { x: 0.25, y: 1.54, w: 4.55, h: 1.0, fill: { color: C.redLt }, line: { color: C.red, width: 0.6 }, rectRadius: 0.06 });
  s.addText("Heat stroke is a life-threatening emergency where the body temperature rises above 40°C (104°F), leading to failure of the body's cooling mechanism.\n\nBody Temp >40°C + CNS dysfunction (confusion, seizures, coma) = HEAT STROKE", {
    x: 0.35, y: 1.57, w: 4.35, h: 0.94, fontSize: 8.5, color: C.text, valign: "top"
  });

  // Symptoms table
  sectionBox(s, "SYMPTOMS (RECOGNIZE)", 0.25, 2.62, 4.55, 0.3, C.orange, C.white);
  const syRows = [
    [{ text: "Mild Heat Illness", options: { bold: true, color: C.white, fill: { color: C.orange } } }, { text: "Severe Heat Stroke", options: { bold: true, color: C.white, fill: { color: C.red } } }],
    ["Muscle cramps", "Body temp > 40°C"],
    ["Heavy sweating", "No sweating (dry skin)"],
    ["Weakness, fatigue", "Confusion / altered sensorium"],
    ["Headache, dizziness", "Seizures / loss of consciousness"],
  ];
  s.addTable(syRows, {
    x: 0.25, y: 2.94, w: 4.55, h: 1.65,
    fontSize: 8, colW: [2.27, 2.28], rowH: 0.37,
    border: { type: "solid", color: "F9CFCF", pt: 0.4 }, fill: { color: C.offWhite }, color: C.text
  });

  // First aid flowchart on right
  sectionBox(s, "FIRST AID FOR HEAT STROKE (DO's)", 5.0, 1.22, 4.75, 0.3, C.teal, C.white);
  const firstAid = [
    { step: "1", text: "MOVE to cool/shaded area immediately", color: C.red },
    { step: "2", text: "REMOVE excess clothing", color: C.orange },
    { step: "3", text: "COOL with wet cloth/ice pack on neck, armpits, groin", color: C.teal },
    { step: "4", text: "REHYDRATE with ORS / cool water (if conscious)", color: C.green },
    { step: "5", text: "DO NOT give aspirin or paracetamol for heat stroke", color: C.purple },
    { step: "6", text: "RUSH to hospital / call 108 IMMEDIATELY", color: C.red },
  ];
  firstAid.forEach((fa, i) => {
    s.addShape(pres.ShapeType.ellipse, { x: 5.0, y: 1.6 + i * 0.57, w: 0.3, h: 0.3, fill: { color: fa.color } });
    s.addText(fa.step, { x: 5.0, y: 1.6 + i * 0.57, w: 0.3, h: 0.3, fontSize: 8, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });
    s.addShape(pres.ShapeType.roundRect, {
      x: 5.35, y: 1.6 + i * 0.57, w: 4.4, h: 0.3,
      fill: { color: C.white }, line: { color: fa.color, width: 0.5 }, rectRadius: 0.05
    });
    s.addText(fa.text, { x: 5.4, y: 1.6 + i * 0.57, w: 4.3, h: 0.3, fontSize: 8, color: C.text, valign: "middle", margin: 0 });
    if (i < 5) {
      s.addShape(pres.ShapeType.rect, { x: 5.14, y: 1.9 + i * 0.57, w: 0.02, h: 0.27, fill: { color: C.teal } });
    }
  });

  // prevention strip
  sectionBox(s, "PREVENTION TIPS", 0.25, 4.68, 9.5, 0.3, C.navy, C.white);
  s.addText("✓ Stay indoors 12PM–3PM  ✓ Drink 3–4 litres water daily  ✓ Wear light cotton clothes  ✓ Use umbrella/hat outdoors  ✓ Avoid alcohol & caffeinated drinks  ✓ Keep elderly & children hydrated", {
    x: 0.3, y: 5.0, w: 9.4, h: 0.26, fontSize: 8.5, color: C.text, align: "center", valign: "middle"
  });
}

// ════════════════════════════════════════════════════════════════════════════
// IEC 6 – HEALTH CAMP
// ════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  addBase(s, "IEC – HEALTH CAMP ORGANISATION", "Planning, executing, and evaluating community health camps");

  // Planning flowchart
  sectionBox(s, "HEALTH CAMP PLANNING FLOWCHART", 0.25, 1.22, 9.5, 0.3, C.navy, C.white);
  const campFlow = [
    { step: "PLAN\n(2–4 weeks)", items: ["Identify venue", "Set objectives", "Budget approval"] },
    { step: "PREPARE\n(1–2 weeks)", items: ["Team formation", "Equipment/drugs", "IEC material"] },
    { step: "PUBLICISE\n(1 week)", items: ["Posters/Banners", "Announce at PHC", "ASHA/ANM inform"] },
    { step: "CONDUCT\n(Camp Day)", items: ["Registration", "Screening/Checkup", "Free medicines"] },
    { step: "REPORT\n(Post-camp)", items: ["Data analysis", "Referral follow-up", "Report to DM/CMO"] },
  ];

  campFlow.forEach((cf, i) => {
    const bx = 0.25 + i * 1.95;
    s.addShape(pres.ShapeType.roundRect, { x: bx, y: 1.58, w: 1.75, h: 0.42, fill: { color: C.navy }, rectRadius: 0.08 });
    s.addText(cf.step, { x: bx, y: 1.58, w: 1.75, h: 0.42, fontSize: 7.5, bold: true, color: C.white, align: "center", valign: "middle" });
    cf.items.forEach((item, j) => {
      s.addShape(pres.ShapeType.roundRect, {
        x: bx, y: 2.06 + j * 0.28, w: 1.75, h: 0.26,
        fill: { color: C.tableAlt }, line: { color: C.teal, width: 0.3 }, rectRadius: 0.04
      });
      s.addText(`• ${item}`, { x: bx + 0.05, y: 2.06 + j * 0.28, w: 1.65, h: 0.26, fontSize: 7.5, color: C.text, valign: "middle" });
    });
    if (i < 4) flowArrow(s, bx + 1.77, 1.72);
  });

  // Services table
  sectionBox(s, "TYPICAL SERVICES PROVIDED IN HEALTH CAMP", 0.25, 2.98, 4.7, 0.3, C.teal, C.white);
  const campSvc = [
    [{ text: "Category", options: { bold: true, color: C.white, fill: { color: C.teal } } }, { text: "Services", options: { bold: true, color: C.white, fill: { color: C.teal } } }],
    ["Screening", "BP, Blood sugar, BMI, Hb, Vision, Dental"],
    ["Clinical", "General OPD, Paediatric, Gynaecology"],
    ["Diagnostic", "Blood tests, Urine tests, ECG"],
    ["Preventive", "Immunisation, Family planning services"],
    ["IEC", "Health talks, Pamphlets, Demonstrations"],
  ];
  s.addTable(campSvc, {
    x: 0.25, y: 3.3, w: 4.7, h: 1.9,
    fontSize: 8, colW: [1.4, 3.3], rowH: 0.37,
    border: { type: "solid", color: "B0C4D8", pt: 0.4 }, fill: { color: C.offWhite }, color: C.text
  });

  // Record keeping
  sectionBox(s, "CAMP RECORD & EVALUATION", 5.2, 2.98, 4.55, 0.3, C.purple, C.white);
  const campRec = [
    [{ text: "Indicator", options: { bold: true, color: C.white, fill: { color: C.purple } } }, { text: "Target/Entry", options: { bold: true, color: C.white, fill: { color: C.purple } } }],
    ["Total beneficiaries screened", "_____ persons"],
    ["Referred to CHC/District Hosp.", "_____ patients"],
    ["Free medicines distributed", "_____ units"],
    ["IEC material distributed", "_____ pieces"],
    ["Doctor-patient ratio", "1 : _____"],
  ];
  s.addTable(campRec, {
    x: 5.2, y: 3.3, w: 4.55, h: 1.9,
    fontSize: 8, colW: [2.4, 2.15], rowH: 0.37,
    border: { type: "solid", color: "E8DAEF", pt: 0.4 }, fill: { color: C.offWhite }, color: C.text
  });
}

// ════════════════════════════════════════════════════════════════════════════
// IEC 7 – OBESITY
// ════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  addBase(s, "IEC – OBESITY PREVENTION & MANAGEMENT", "Understanding, measuring, and managing excess body weight");

  // BMI classification table
  sectionBox(s, "BMI CLASSIFICATION (WHO)", 0.25, 1.22, 4.55, 0.3, C.orange, C.white);
  const bmiRows = [
    [{ text: "BMI (kg/m²)", options: { bold: true, color: C.white, fill: { color: C.orange } } }, { text: "Category", options: { bold: true, color: C.white, fill: { color: C.orange } } }, { text: "Risk", options: { bold: true, color: C.white, fill: { color: C.orange } } }],
    ["< 18.5", "Underweight", "Moderate"],
    ["18.5 – 24.9", "Normal weight", "Low"],
    ["25.0 – 29.9", "Overweight", "Increased"],
    ["30.0 – 34.9", "Obese Class I", "High"],
    ["35.0 – 39.9", "Obese Class II", "Very High"],
    [">= 40.0", "Obese Class III (Morbid)", "Extremely High"],
  ];
  s.addTable(bmiRows, {
    x: 0.25, y: 1.54, w: 4.55, h: 2.35,
    fontSize: 8, colW: [1.4, 1.8, 1.35], rowH: 0.36,
    border: { type: "solid", color: "FDEBD0", pt: 0.4 }, fill: { color: C.offWhite }, color: C.text
  });

  // Complications right
  sectionBox(s, "COMPLICATIONS OF OBESITY", 5.0, 1.22, 4.75, 0.3, C.red, C.white);
  const compls = [
    "Cardiovascular: Hypertension, Coronary artery disease, Stroke",
    "Metabolic: Type 2 Diabetes mellitus, Dyslipidaemia",
    "Respiratory: Obstructive sleep apnoea, Asthma",
    "Orthopaedic: Osteoarthritis, Low back pain",
    "Reproductive: PCOS, Infertility, High-risk pregnancy",
    "Cancer: Endometrial, Breast, Colon, Oesophageal",
    "Psychological: Depression, Low self-esteem, Social stigma",
  ];
  s.addShape(pres.ShapeType.roundRect, { x: 5.0, y: 1.54, w: 4.75, h: 2.35, fill: { color: C.white }, line: { color: C.red, width: 0.6 }, rectRadius: 0.06 });
  s.addText(compls.map(c => ({ text: c, options: { bullet: { type: "bullet" }, breakLine: true } })), {
    x: 5.1, y: 1.57, w: 4.55, h: 2.28, fontSize: 8.5, color: C.text, valign: "top"
  });

  // Management flowchart
  sectionBox(s, "MANAGEMENT APPROACH (STEP-UP)", 0.25, 3.98, 9.5, 0.3, C.navy, C.white);
  const mgmt = [
    { step: "STEP 1\nDiet Modification", color: C.green },
    { step: "STEP 2\nPhysical Activity", color: C.teal },
    { step: "STEP 3\nBehavioural Therapy", color: C.purple },
    { step: "STEP 4\nPharmacotherapy\n(if BMI >30+comorbidity)", color: C.orange },
    { step: "STEP 5\nBariatric Surgery\n(BMI >40 or >35+comorbidity)", color: C.red },
  ];
  mgmt.forEach((m, i) => {
    s.addShape(pres.ShapeType.roundRect, {
      x: 0.25 + i * 1.93, y: 4.3, w: 1.78, h: 0.68,
      fill: { color: m.color }, rectRadius: 0.1
    });
    s.addText(m.step, { x: 0.25 + i * 1.93, y: 4.3, w: 1.78, h: 0.68, fontSize: 7.5, bold: true, color: C.white, align: "center", valign: "middle" });
    if (i < 4) flowArrow(s, 0.25 + i * 1.93 + 1.8, 4.56);
  });

  s.addShape(pres.ShapeType.roundRect, { x: 0.25, y: 5.02, w: 9.5, h: 0.28, fill: { color: C.orangeLt }, line: { color: C.orange, width: 0.6 }, rectRadius: 0.05 });
  s.addText("Target: Reduce body weight by 5–10% in 6 months through diet + exercise. BMI = Weight (kg) / [Height (m)]²  |  Waist >80cm (F), >90cm (M) = Central Obesity", {
    x: 0.35, y: 5.02, w: 9.3, h: 0.28, fontSize: 8, color: C.orange, align: "center", valign: "middle", margin: 0
  });
}

// ════════════════════════════════════════════════════════════════════════════
// FINAL SLIDE – SUMMARY / THANK YOU
// ════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.skyLight } });
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.75, fill: { color: C.navy } });
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.12, h: 5.625, fill: { color: C.accent } });
  s.addShape(pres.ShapeType.rect, { x: 0, y: 5.3, w: 10, h: 0.325, fill: { color: C.navy } });
  s.addText("SUMMARY & KEY TAKEAWAYS", { x: 0.25, y: 0.1, w: 9.5, h: 0.55, fontSize: 16, bold: true, color: C.white, valign: "middle", margin: 0 });

  const summary = [
    { num: "01", title: "Family Introduction", text: "Document household, family structure, socio-economic class, and type of family at first visit.", color: C.navy },
    { num: "02", title: "Socio-demographic Profile", text: "Record all members' age, sex, education, occupation, housing, sanitation and water supply.", color: C.teal },
    { num: "03", title: "Health Problems Identified", text: "Prioritise health issues using problem matrix; record vital signs and clinical findings.", color: C.red },
    { num: "04", title: "Interventions Provided", text: "Conduct IEC activities covering DM/HTN, hygiene, malaria, obesity, heat stroke, health camp.", color: C.green },
    { num: "05", title: "Before & After Assessment", text: "Document observable changes in behaviour, health indicators and environment post-intervention.", color: C.purple },
  ];

  summary.forEach((item, i) => {
    const by = 0.9 + i * 0.8;
    s.addShape(pres.ShapeType.ellipse, { x: 0.25, y: by, w: 0.52, h: 0.52, fill: { color: item.color } });
    s.addText(item.num, { x: 0.25, y: by, w: 0.52, h: 0.52, fontSize: 11, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });
    s.addText(item.title, { x: 0.85, y: by, w: 2.4, h: 0.52, fontSize: 10, bold: true, color: item.color, valign: "middle" });
    s.addText(item.text, { x: 3.3, y: by, w: 6.45, h: 0.52, fontSize: 8.5, color: C.text, valign: "middle" });
    if (i < 4) s.addShape(pres.ShapeType.rect, { x: 0.48, y: by + 0.52, w: 0.04, h: 0.28, fill: { color: C.accent } });
  });

  s.addText("Thank You  |  Community Medicine – PSM POT Family Visit Template  |  All slides are editable templates", {
    x: 0.2, y: 5.3, w: 9.6, h: 0.325, fontSize: 8, color: C.white, align: "center", valign: "middle"
  });
}

// ─── SAVE ─────────────────────────────────────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/workspace/psm-pot/PSM_POT_Community_Visit_Template.pptx" })
  .then(() => console.log("DONE: PSM_POT_Community_Visit_Template.pptx"))
  .catch(e => console.error("ERROR:", e));
Running Command

cd /home/daytona/workspace/psm-pot && node create_psm_pot.js 2>&1

Running Command

node -e "const p = require('pptxgenjs'); const pr = new p(); console.log(Object.keys(pr.ShapeType).filter(k => k.toLowerCase().includes('tri') || k.toLowerCase().includes('arrow') || k.toLowerCase().includes('ellipse') || k.toLowerCase().includes('round')).join('\n'))"

Editing File

~/psm-pot/create_psm_pot.js

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/psm-pot/create_psm_pot.js'
Running Command

cd /home/daytona/workspace/psm-pot && node create_psm_pot.js 2>&1

Editing File

~/psm-pot/create_psm_pot.js

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/psm-pot/create_psm_pot.js'
Running Command

cd /home/daytona/workspace/psm-pot && node create_psm_pot.js 2>&1

Running Command

ls -lh /home/daytona/workspace/psm-pot/PSM_POT_Community_Visit_Template.pptx

Your PSM POT presentation is ready!

PSM POT Community Visit Template

Presentation · PPTX


What's inside (14 slides total):

SlideContent
CoverTitle slide with all 5 family visit topics listed as boxes
Slide 1Introduction of the Family - household info table + Objectives flowchart
Slide 2Socio-demographic Profile - family members register table + housing/sanitation/SES boxes
Slide 3Health Status & Problems - health problems table + prioritization matrix + vital signs boxes
Slide 4Interventions - 5-step flowchart (Assess → Plan → Execute → Follow-up) + interventions table
Slide 5Before & After Changes - side-by-side colour-coded comparison (Red = Before, Green = After)
IEC DividerSection title slide listing all 7 IEC topics
IEC 1Diabetes & Hypertension - JNC-8 HTN classification table + DM diagnostic values table + lifestyle tips
IEC 2Personal Hygiene - 4-quadrant grid (Hand, Oral, Body, Food hygiene)
IEC 3Malaria - transmission cycle flowchart + P. vivax vs P. falciparum comparison table
IEC 4Tree Plantation - 6-box benefits grid
IEC 5Heat Stroke - symptoms table + 6-step first aid flowchart
IEC 6Health Camp - 5-phase planning flowchart + services table + evaluation table
IEC 7Obesity - WHO BMI classification table + complications + step-up management flowchart
Summary5-point recap with numbered circles
Design: Light blue professional background (EAF4FB), navy header band, amber left accent bar, navy/teal colour scheme throughout - all slides are fully editable templates with fill-in blanks for actual patient/family data.
This is a shared conversation. Sign in to Orris to start your own chat.