Make presentation on hepatitis for pharmacy students divide topic into five students

Checking Date & Time
Reading File
Reading File
Reading File
Finding Sources
Now let me pull content for all 5 student sections simultaneously:
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Reading File
Finding Sources
Searching Images

hepatitis virus types comparison table

I have an excellent Harrison's table image. Let me now read the key hepatitis content from the medical library and search for more images:
Reading File
Searching Images

hepatitis B serology markers diagnosis

Excellent! I have great content and images. Let me search for treatment and vaccine images, then build the presentation:
Searching Images

hepatitis C direct acting antiviral treatment sofosbuvir

Searching Images

hepatitis A vaccine hepatitis B vaccine schedule

I have excellent images and content. Now let me build the comprehensive PPTX presentation:
Running Command

ls -la /home/daytona/workspace/ && mkdir -p /home/daytona/workspace/hepatitis-pptx

Writing File

~/hepatitis-pptx/build.js

const pptxgen = require("pptxgenjs");
const { execSync } = require("child_process");

// ─── Fetch images ────────────────────────────────────────────────────────────
const imageUrls = [
  "https://cdn.orris.care/cdss_images/HARRISON_1763033912702_6c8b3aeb-d09d-4456-9e4a-51e468791295.png", // HAV-HEV nomenclature table
  "https://cdn.orris.care/cdss_images/HARRISON_1763031941963_b8714721-0c5c-4031-a531-da171f3c8e24.png", // chronic HBV serology timeline
  "https://cdn.orris.care/cdss_images/GLGCA_41753_1766502006027_6fb9687b-4165-46fa-a1ed-7ae80b6c4566_21bf0166-de59-45a3-9836-5b11d5412c80.png", // HBV/HDV lab diagnosis table
  "https://cdn.orris.care/cdss_images/GLGCA_25111_1766507250153_31c81149-4a38-4e6a-b6cf-03ba3e4a07f8_9859b8d5-ed1c-4ff6-a126-066bcccaf791.png", // HCV DAA lifecycle (try)
  "https://cdn.orris.care/cdss_images/GLGCA_2232415_1763366073233_eb427168-5573-434d-9914-2a97b7413bae.png", // HCV lifecycle & DAA targets
  "https://cdn.orris.care/cdss_images/GLGCA_4779637_1766686947536_b2bfdfdc-a8c3-49f6-b774-cb9299224a8f_a4791fd6-8d67-4a9b-afc8-071fa27ef5b8.png", // HAV vaccine table
];

console.log("Fetching images...");
let images = [];
try {
  const result = execSync(
    `node /home/daytona/skills/shared/scripts/fetch_images.js ${imageUrls.map(u => `"${u}"`).join(" ")}`,
    { timeout: 60000 }
  ).toString();
  images = JSON.parse(result);
  console.log("Images fetched:", images.map((img, i) => `${i}: ${img.error ? "ERROR: " + img.error : "OK"}`).join(", "));
} catch (e) {
  console.error("Image fetch error:", e.message);
  images = imageUrls.map(() => ({ base64: null, error: "fetch failed" }));
}

// ─── Color palette ───────────────────────────────────────────────────────────
const C = {
  navy:    "0D2B55",  // deep navy (dominant bg)
  teal:    "0E7C7B",  // teal accent (section headers)
  gold:    "F4A11D",  // gold accent (highlights / student labels)
  white:   "FFFFFF",
  offWhite:"EEF2F7",
  lightBg: "1A3A6B",  // slightly lighter navy for card bg
  subtleGray: "A8B8CC",
  darkText: "0D1F3C",
  red:     "D94F3D",
  green:   "2EAF6C",
};

// ─── Helpers ─────────────────────────────────────────────────────────────────
function addSlide(pres, bgColor) {
  const sld = pres.addSlide();
  sld.background = { color: bgColor || C.navy };
  return sld;
}

function sectionBanner(sld, studentNum, studentLabel, topic) {
  // Top banner stripe
  sld.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 13.33, h: 0.55, fill: { color: C.teal } });
  sld.addText(`STUDENT ${studentNum}  ·  ${studentLabel}`, {
    x: 0.3, y: 0, w: 9, h: 0.55,
    fontSize: 11, bold: true, color: C.white, valign: "middle", margin: 0
  });
  sld.addText(`HEPATITIS  ·  PHARMACY`, {
    x: 9.5, y: 0, w: 3.5, h: 0.55,
    fontSize: 9, color: C.offWhite, align: "right", valign: "middle", margin: 0
  });
}

function slideTitle(sld, title, subtitle, yTitle) {
  yTitle = yTitle || 0.7;
  sld.addText(title, {
    x: 0.4, y: yTitle, w: 12.5, h: 0.65,
    fontSize: 26, bold: true, color: C.gold, fontFace: "Calibri"
  });
  if (subtitle) {
    sld.addText(subtitle, {
      x: 0.4, y: yTitle + 0.65, w: 12.5, h: 0.38,
      fontSize: 13, color: C.subtleGray, italic: true
    });
  }
}

function bulletBox(sld, bullets, x, y, w, h, opts) {
  opts = opts || {};
  const items = bullets.map((b, i) => {
    if (typeof b === "object" && b.sub) {
      return [
        { text: b.head, options: { bullet: { indent: 15 }, bold: true, color: C.gold, fontSize: opts.fontSize || 13, breakLine: false } },
        { text: " — " + b.sub, options: { bold: false, color: C.offWhite, fontSize: opts.fontSize || 13, breakLine: true } }
      ];
    }
    return { text: b, options: { bullet: { indent: 15 }, color: C.offWhite, fontSize: opts.fontSize || 13, breakLine: i < bullets.length - 1 } };
  }).flat();
  sld.addText(items, { x, y, w, h, valign: "top", lineSpacingMultiple: 1.25, ...opts });
}

function divider(sld, y) {
  sld.addShape(pres.ShapeType.line, {
    x: 0.4, y, w: 12.5, h: 0,
    line: { color: C.teal, width: 1.2, dashType: "solid" }
  });
}

// ─── Init ─────────────────────────────────────────────────────────────────────
const pres = new pptxgen();
pres.layout = "LAYOUT_WIDE"; // 13.33" × 7.5"
pres.title = "Hepatitis — Pharmacy Students Presentation";
pres.author = "Orris Medical AI";

// ════════════════════════════════════════════════════════════
// SLIDE 1 — TITLE SLIDE
// ════════════════════════════════════════════════════════════
{
  const sld = addSlide(pres, C.navy);
  // decorative vertical stripe
  sld.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.18, h: 7.5, fill: { color: C.teal } });
  sld.addShape(pres.ShapeType.rect, { x: 0.18, y: 0, w: 0.08, h: 7.5, fill: { color: C.gold } });

  sld.addText("HEPATITIS", {
    x: 0.6, y: 1.2, w: 12, h: 1.6,
    fontSize: 72, bold: true, color: C.white, fontFace: "Calibri", charSpacing: 8
  });
  sld.addText("A Comprehensive Pharmacy Review", {
    x: 0.6, y: 2.85, w: 10, h: 0.6,
    fontSize: 22, color: C.gold, italic: true
  });

  // 5 student badges
  const students = [
    { n: "1", label: "Overview & Epidemiology" },
    { n: "2", label: "Pathophysiology" },
    { n: "3", label: "Diagnosis & Serology" },
    { n: "4", label: "Pharmacotherapy" },
    { n: "5", label: "Prevention & Vaccination" },
  ];
  students.forEach((s, i) => {
    const bx = 0.6 + i * 2.5;
    sld.addShape(pres.ShapeType.roundRect, { x: bx, y: 3.7, w: 2.3, h: 1.1, rectRadius: 0.12, fill: { color: C.lightBg }, line: { color: C.teal, width: 1.5 } });
    sld.addText(`Student ${s.n}`, { x: bx, y: 3.72, w: 2.3, h: 0.38, fontSize: 10, bold: true, color: C.gold, align: "center" });
    sld.addText(s.label, { x: bx + 0.08, y: 4.08, w: 2.14, h: 0.6, fontSize: 9.5, color: C.offWhite, align: "center" });
  });

  sld.addText("Pharmacy Students Group Presentation  ·  April 2026", {
    x: 0.6, y: 5.1, w: 10, h: 0.35,
    fontSize: 11, color: C.subtleGray
  });

  sld.addText("Sources: Harrison's, Goldman-Cecil, Robbins Pathology, Sleisenger & Fordtran, Red Book 2021", {
    x: 0.6, y: 6.95, w: 12, h: 0.35,
    fontSize: 8.5, color: C.subtleGray, italic: true
  });
}

// ════════════════════════════════════════════════════════════
// STUDENT 1 — OVERVIEW & EPIDEMIOLOGY
// ════════════════════════════════════════════════════════════

// Slide 2 — Types of Hepatitis Viruses
{
  const sld = addSlide(pres);
  sectionBanner(sld, 1, "Overview & Epidemiology", "Types of Hepatitis Viruses");
  slideTitle(sld, "Types of Hepatitis Viruses", "Five major viruses — distinct genomes, transmission routes & risks");

  bulletBox(sld, [
    { head: "Hepatitis A (HAV)", sub: "ssRNA picornavirus · fecal-oral · self-limiting acute disease" },
    { head: "Hepatitis B (HBV)", sub: "dsDNA hepadnavirus · parenteral/sexual/perinatal · can become chronic" },
    { head: "Hepatitis C (HCV)", sub: "ssRNA flavivirus · blood-borne · 70–85% progress to chronic" },
    { head: "Hepatitis D (HDV)", sub: "RNA deltavirus · requires HBV coinfection · worsens HBV severity" },
    { head: "Hepatitis E (HEV)", sub: "ssRNA hepevirus · fecal-oral · high mortality in pregnancy (20%)" },
  ], 0.4, 1.7, 7.2, 4.8, { fontSize: 13.5 });

  // image — Harrison's nomenclature table
  if (images[0] && !images[0].error) {
    sld.addImage({ data: images[0].base64, x: 7.8, y: 1.5, w: 5.2, h: 3.0 });
    sld.addText("Harrison's Principles of Internal Medicine 22E · Table 339-1", {
      x: 7.8, y: 4.55, w: 5.2, h: 0.28, fontSize: 7.5, color: C.subtleGray, italic: true, align: "center"
    });
  }
}

// Slide 3 — Global Epidemiology
{
  const sld = addSlide(pres);
  sectionBanner(sld, 1, "Overview & Epidemiology", "Global Burden of Hepatitis");
  slideTitle(sld, "Global Epidemiology", "Hepatitis remains a leading cause of liver-related mortality worldwide");

  // Stat cards
  const stats = [
    { val: "354 M", lbl: "Chronic HBV + HCV infections globally (WHO)" },
    { val: "~1.4M", lbl: "Deaths/year from viral hepatitis" },
    { val: "90%", lbl: "of infants exposed to HBV at birth develop chronic infection (without vaccination)" },
    { val: "70–85%", lbl: "of acute HCV infections become chronic" },
    { val: "20%", lbl: "Mortality rate of HEV in pregnant women" },
  ];
  stats.forEach((s, i) => {
    const rx = (i % 3) * 4.2 + 0.4;
    const ry = 1.8 + Math.floor(i / 3) * 2.1;
    sld.addShape(pres.ShapeType.roundRect, { x: rx, y: ry, w: 3.9, h: 1.85, rectRadius: 0.14, fill: { color: C.lightBg }, line: { color: C.teal, width: 1.2 } });
    sld.addText(s.val, { x: rx, y: ry + 0.08, w: 3.9, h: 0.75, fontSize: 30, bold: true, color: C.gold, align: "center" });
    sld.addText(s.lbl, { x: rx + 0.1, y: ry + 0.82, w: 3.7, h: 0.9, fontSize: 10.5, color: C.offWhite, align: "center" });
  });

  sld.addText("Sources: WHO Global Hepatitis Report · Goldman-Cecil Medicine · Harrison's 22E", {
    x: 0.4, y: 6.9, w: 12.5, h: 0.3, fontSize: 8, color: C.subtleGray, italic: true
  });
}

// Slide 4 — Transmission Routes
{
  const sld = addSlide(pres);
  sectionBanner(sld, 1, "Overview & Epidemiology", "Transmission Routes");
  slideTitle(sld, "Transmission Routes", "Understanding spread is key to prevention counselling");

  divider(sld, 1.5);

  // Two columns
  bulletBox(sld, [
    "🦠  HAV & HEV",
    "→ Contaminated food/water",
    "→ Poor sanitation & hygiene",
    "→ Travel to endemic regions",
    "→ Close household contact",
    "",
    "🩸  HBV, HCV & HDV",
    "→ Contaminated blood/needles",
    "→ Sexual contact (especially HBV)",
    "→ Perinatal (mother-to-child)",
    "→ Tattooing / unscreened blood products",
  ], 0.4, 1.6, 5.6, 4.9, { fontSize: 12.5 });

  // Risk factors box
  sld.addShape(pres.ShapeType.roundRect, { x: 6.5, y: 1.6, w: 6.5, h: 4.8, rectRadius: 0.14, fill: { color: C.lightBg }, line: { color: C.gold, width: 1.5 } });
  sld.addText("High-Risk Groups for Pharmacy Counselling", {
    x: 6.5, y: 1.65, w: 6.5, h: 0.5, fontSize: 13, bold: true, color: C.gold, align: "center"
  });
  divider(sld, 2.22);
  bulletBox(sld, [
    "Injection drug users (HBV, HCV, HDV)",
    "Healthcare workers — needlestick exposure",
    "Travellers to endemic regions (HAV, HEV)",
    "Pregnant women — risk of vertical HBV/HCV",
    "Patients on haemodialysis (HCV)",
    "Men who have sex with men (HAV, HBV)",
    "Immunocompromised patients (all types)",
  ], 6.7, 2.28, 6.1, 4.0, { fontSize: 12 });
}

// ════════════════════════════════════════════════════════════
// STUDENT 2 — PATHOPHYSIOLOGY
// ════════════════════════════════════════════════════════════

// Slide 5 — Liver Injury Mechanisms
{
  const sld = addSlide(pres);
  sectionBanner(sld, 2, "Pathophysiology", "Mechanisms of Hepatic Injury");
  slideTitle(sld, "Mechanisms of Hepatic Injury", "Immune-mediated damage is the hallmark of viral hepatitis");

  bulletBox(sld, [
    { head: "Direct cytopathic effect", sub: "HCV, HEV can directly damage hepatocytes" },
    { head: "CD8+ T-cell mediated killing", sub: "Primary mechanism in HBV; T-cells destroy infected hepatocytes presenting viral antigens (HBcAg, HBsAg)" },
    { head: "Cytokine storm", sub: "TNF-α, IFN-γ, IL-2 — amplify inflammation, cause bystander injury" },
    { head: "Interface hepatitis", sub: "Lymphocytic infiltration at the portal-parenchymal junction; drives fibrosis" },
    { head: "Hepatocyte apoptosis", sub: "Councilman bodies (acidophilic apoptotic remnants) — hallmark histology" },
    { head: "Stellate cell activation", sub: "Chronic inflammation → TGF-β → collagen deposition → FIBROSIS → CIRRHOSIS" },
  ], 0.4, 1.7, 12.5, 4.8, { fontSize: 13 });
}

// Slide 6 — Acute vs Chronic Hepatitis
{
  const sld = addSlide(pres);
  sectionBanner(sld, 2, "Pathophysiology", "Acute vs Chronic Disease");
  slideTitle(sld, "Acute vs Chronic Hepatitis", "Clinical course depends on immune response and viral persistence");

  // Acute column
  sld.addShape(pres.ShapeType.roundRect, { x: 0.4, y: 1.6, w: 5.9, h: 4.8, rectRadius: 0.14, fill: { color: C.lightBg }, line: { color: C.green, width: 1.5 } });
  sld.addText("ACUTE HEPATITIS", { x: 0.4, y: 1.65, w: 5.9, h: 0.45, fontSize: 14, bold: true, color: C.green, align: "center" });
  bulletBox(sld, [
    "Duration < 6 months",
    "AST/ALT markedly elevated (10–50× ULN)",
    "Symptoms: jaundice, RUQ pain, fatigue, nausea",
    "Fulminant hepatitis: rare but life-threatening (HBV > HAV)",
    "Histology: lobular disarray, Councilman bodies",
    "HAV & HEV → always self-limiting in immunocompetent",
    "HBV acute → 95% adults recover; 5% chronic",
    "HCV acute → 15–30% spontaneous clearance",
  ], 0.6, 2.15, 5.5, 4.1, { fontSize: 11.5 });

  // Chronic column
  sld.addShape(pres.ShapeType.roundRect, { x: 7.0, y: 1.6, w: 5.9, h: 4.8, rectRadius: 0.14, fill: { color: C.lightBg }, line: { color: C.red, width: 1.5 } });
  sld.addText("CHRONIC HEPATITIS", { x: 7.0, y: 1.65, w: 5.9, h: 0.45, fontSize: 14, bold: true, color: C.red, align: "center" });
  bulletBox(sld, [
    "Duration > 6 months",
    "HBV: risk highest in neonates (90%); lowest in adults (5%)",
    "HCV: 70–85% of acute infections",
    "HDV: always chronic if superinfection on HBV carrier",
    "Histology: periportal fibrosis, bridging, ground-glass hepatocytes (HBV)",
    "Complications: cirrhosis, portal hypertension, HCC",
    "HCC risk: 100× higher with chronic HBV than controls",
    "MELD score guides transplant prioritization",
  ], 7.2, 2.15, 5.5, 4.1, { fontSize: 11.5 });

  // Arrow between
  sld.addShape(pres.ShapeType.rect, { x: 6.35, y: 3.55, w: 0.6, h: 0.4, fill: { color: C.teal } });
  sld.addText("→", { x: 6.32, y: 3.52, w: 0.66, h: 0.46, fontSize: 22, bold: true, color: C.white, align: "center" });
}

// Slide 7 — HBV Histology Image
{
  const sld = addSlide(pres);
  sectionBanner(sld, 2, "Pathophysiology", "Histological Features");
  slideTitle(sld, "Histological Hallmarks of Viral Hepatitis");

  sld.addText("The histological findings below correlate with the degree of hepatocellular injury, inflammation, and fibrosis:", {
    x: 0.4, y: 1.48, w: 12.5, h: 0.4, fontSize: 12, color: C.offWhite, italic: true
  });

  bulletBox(sld, [
    { head: "Councilman bodies", sub: "Eosinophilic apoptotic hepatocytes — hallmark of acute viral hepatitis" },
    { head: "Ground-glass hepatocytes", sub: "HBsAg-laden cytoplasm in chronic HBV — pale, homogeneous staining" },
    { head: "Portal lymphocytic infiltrates", sub: "Predominant CD4+/CD8+ T-lymphocytes in HBV & HCV" },
    { head: "Bridging fibrosis", sub: "Connects adjacent portal tracts — precursor to cirrhosis" },
    { head: "Regenerative nodules", sub: "Cirrhotic remodelling — disrupts hepatic architecture" },
  ], 0.4, 2.0, 6.8, 4.5, { fontSize: 12.5 });

  sld.addText("Liver biopsy: chronic HBV with cirrhosis\nGround-glass cytoplasm, regenerative nodules, dense fibrous septa visible", {
    x: 7.5, y: 5.3, w: 5.5, h: 0.8, fontSize: 9, color: C.subtleGray, italic: true, align: "center"
  });
}

// ════════════════════════════════════════════════════════════
// STUDENT 3 — DIAGNOSIS & SEROLOGY
// ════════════════════════════════════════════════════════════

// Slide 8 — Clinical Presentation
{
  const sld = addSlide(pres);
  sectionBanner(sld, 3, "Diagnosis & Serology", "Clinical Presentation");
  slideTitle(sld, "Clinical Presentation of Hepatitis", "From subclinical infection to fulminant hepatic failure");

  // 3-phase timeline bar
  const phases = [
    { label: "Prodrome", dur: "1–2 weeks", sx: "Fatigue, anorexia, nausea, RUQ discomfort, fever (HAV)", color: C.teal },
    { label: "Icteric Phase", dur: "2–6 weeks", sx: "Jaundice, dark urine (bilirubinuria), pale stools, pruritus, tender hepatomegaly", color: C.gold },
    { label: "Recovery", dur: "Weeks–months", sx: "Symptom resolution; LFTs normalise; risk of chronicity (HBV/HCV)", color: C.green },
  ];
  phases.forEach((p, i) => {
    const bx = 0.4 + i * 4.3;
    sld.addShape(pres.ShapeType.roundRect, { x: bx, y: 1.7, w: 4.1, h: 1.0, rectRadius: 0.1, fill: { color: p.color } });
    sld.addText(`${p.label}  ·  ${p.dur}`, { x: bx, y: 1.72, w: 4.1, h: 0.45, fontSize: 12.5, bold: true, color: C.darkText, align: "center" });
    sld.addText(p.sx, { x: bx + 0.08, y: 2.18, w: 3.94, h: 0.48, fontSize: 9.5, color: C.darkText, align: "center" });
  });

  divider(sld, 2.85);

  sld.addText("Key Laboratory Findings:", { x: 0.4, y: 2.95, w: 12.5, h: 0.4, fontSize: 13, bold: true, color: C.gold });
  bulletBox(sld, [
    { head: "ALT/AST", sub: "Markedly elevated (hepatocellular pattern); ALT > AST in viral hepatitis" },
    { head: "Bilirubin", sub: "Total and direct bilirubin elevated; urobilinogen in urine" },
    { head: "Alkaline phosphatase / GGT", sub: "Mildly elevated (unless cholestatic component)" },
    { head: "PT / INR", sub: "Prolonged in severe or fulminant disease — best marker of synthetic function" },
    { head: "Albumin", sub: "Decreased in chronic hepatitis (impaired synthetic function)" },
  ], 0.4, 3.4, 12.5, 3.7, { fontSize: 12.5 });
}

// Slide 9 — Serological Markers
{
  const sld = addSlide(pres);
  sectionBanner(sld, 3, "Diagnosis & Serology", "Serological Markers");
  slideTitle(sld, "Serological Diagnosis", "Specific serological markers identify virus type, phase and immunity status");

  // HAV
  sld.addShape(pres.ShapeType.roundRect, { x: 0.4, y: 1.6, w: 3.8, h: 2.45, rectRadius: 0.1, fill: { color: C.lightBg }, line: { color: C.teal, width: 1.2 } });
  sld.addText("Hepatitis A", { x: 0.4, y: 1.62, w: 3.8, h: 0.38, fontSize: 12, bold: true, color: C.teal, align: "center" });
  bulletBox(sld, [
    "IgM anti-HAV → Acute infection",
    "IgG anti-HAV → Past infection / immunity",
    "No chronic carrier state",
  ], 0.55, 2.04, 3.5, 1.9, { fontSize: 11 });

  // HBV
  sld.addShape(pres.ShapeType.roundRect, { x: 4.5, y: 1.6, w: 4.1, h: 2.45, rectRadius: 0.1, fill: { color: C.lightBg }, line: { color: C.gold, width: 1.2 } });
  sld.addText("Hepatitis B", { x: 4.5, y: 1.62, w: 4.1, h: 0.38, fontSize: 12, bold: true, color: C.gold, align: "center" });
  bulletBox(sld, [
    "HBsAg → Active infection (surface antigen)",
    "Anti-HBs → Immunity (recovery/vaccine)",
    "IgM anti-HBc → Acute HBV",
    "IgG anti-HBc → Past/chronic exposure",
    "HBeAg → High replication / infectivity",
    "HBV DNA → Viral load (PCR)",
  ], 4.65, 2.04, 3.8, 2.0, { fontSize: 10.5 });

  // HCV
  sld.addShape(pres.ShapeType.roundRect, { x: 8.9, y: 1.6, w: 4.1, h: 2.45, rectRadius: 0.1, fill: { color: C.lightBg }, line: { color: C.red, width: 1.2 } });
  sld.addText("Hepatitis C", { x: 8.9, y: 1.62, w: 4.1, h: 0.38, fontSize: 12, bold: true, color: C.red, align: "center" });
  bulletBox(sld, [
    "Anti-HCV ELISA → Screening test",
    "HCV RNA (PCR) → Confirms active infection",
    "HCV genotype → Guides DAA therapy",
    "Anti-HCV alone ≠ active infection",
    "(does not distinguish acute/chronic/resolved)",
  ], 9.05, 2.04, 3.8, 2.0, { fontSize: 10.5 });

  // Bottom: HBV serology timeline image
  if (images[1] && !images[1].error) {
    sld.addImage({ data: images[1].base64, x: 0.4, y: 4.2, w: 7.5, h: 2.9 });
    sld.addText("Chronic HBV serology timeline — Harrison's Principles of Internal Medicine 22E", {
      x: 0.4, y: 7.15, w: 7.5, h: 0.28, fontSize: 7.5, color: C.subtleGray, italic: true, align: "center"
    });
  }

  if (images[2] && !images[2].error) {
    sld.addImage({ data: images[2].base64, x: 8.2, y: 4.2, w: 4.9, h: 2.9 });
    sld.addText("HBV/HDV lab diagnosis markers — Clinical Microbiology Guide", {
      x: 8.2, y: 7.15, w: 4.9, h: 0.28, fontSize: 7.5, color: C.subtleGray, italic: true, align: "center"
    });
  }
}

// Slide 10 — Diagnostic Algorithm
{
  const sld = addSlide(pres);
  sectionBanner(sld, 3, "Diagnosis & Serology", "Diagnostic Algorithm");
  slideTitle(sld, "Diagnostic Algorithm for Hepatitis", "Step-by-step approach to identifying hepatitis type");

  const steps = [
    { n: "1", title: "Suspect viral hepatitis", body: "↑ ALT/AST + jaundice/fatigue + risk factors" },
    { n: "2", title: "Initial screening panel", body: "IgM anti-HAV · HBsAg · IgM anti-HBc · Anti-HCV" },
    { n: "3", title: "Confirm & characterise", body: "HCV RNA (if anti-HCV+) · HBV DNA, HBeAg, anti-HBe · HEV IgM (if travel history)" },
    { n: "4", title: "Assess severity", body: "LFTs (ALT, AST, bilirubin, albumin) · PT/INR · CBC · Ultrasound / fibroscan" },
    { n: "5", title: "Chronic disease workup", body: "Liver biopsy (HAI score) · AFP (HCC surveillance) · EGD (varices) · MELD score" },
  ];
  steps.forEach((s, i) => {
    const sy = 1.75 + i * 1.0;
    sld.addShape(pres.ShapeType.ellipse, { x: 0.3, y: sy, w: 0.55, h: 0.55, fill: { color: C.teal } });
    sld.addText(s.n, { x: 0.3, y: sy, w: 0.55, h: 0.55, fontSize: 16, bold: true, color: C.white, align: "center", valign: "middle" });
    sld.addShape(pres.ShapeType.roundRect, { x: 1.05, y: sy, w: 11.8, h: 0.82, rectRadius: 0.08, fill: { color: C.lightBg }, line: { color: C.teal, width: 0.8 } });
    sld.addText(s.title, { x: 1.15, y: sy + 0.04, w: 3.5, h: 0.38, fontSize: 13, bold: true, color: C.gold });
    sld.addText(s.body, { x: 4.8, y: sy + 0.06, w: 7.8, h: 0.62, fontSize: 11.5, color: C.offWhite, valign: "middle" });
  });
}

// ════════════════════════════════════════════════════════════
// STUDENT 4 — PHARMACOTHERAPY
// ════════════════════════════════════════════════════════════

// Slide 11 — HBV Treatment
{
  const sld = addSlide(pres);
  sectionBanner(sld, 4, "Pharmacotherapy", "Hepatitis B Treatment");
  slideTitle(sld, "Pharmacotherapy: Hepatitis B", "Goals — Suppress viral replication, prevent cirrhosis & HCC");

  bulletBox(sld, [
    { head: "PEG-Interferon α-2a", sub: "Subcutaneous · 48 weeks · finite therapy · HBeAg seroconversion in ~30%" },
    { head: "Tenofovir disoproxil (TDF)", sub: "1st-line NRT analogue · high barrier to resistance · safe in pregnancy" },
    { head: "Tenofovir alafenamide (TAF)", sub: "Preferred over TDF — lower bone/renal toxicity; 25 mg/day orally" },
    { head: "Entecavir (ETV)", sub: "1st-line; high genetic barrier to resistance; avoid in lamivudine-resistant HBV" },
    { head: "Lamivudine / Adefovir", sub: "Older agents; high resistance rates — no longer preferred first-line" },
  ], 0.4, 1.7, 12.5, 4.2, { fontSize: 13 });

  divider(sld, 5.8);
  sld.addText("Treatment indications:  HBeAg+ with HBV DNA >20,000 IU/mL  ·  HBeAg− with HBV DNA >2,000 IU/mL  ·  Any HBV with compensated or decompensated cirrhosis", {
    x: 0.4, y: 5.9, w: 12.5, h: 0.55, fontSize: 10.5, color: C.subtleGray, italic: true
  });
}

// Slide 12 — HCV Treatment (DAAs)
{
  const sld = addSlide(pres);
  sectionBanner(sld, 4, "Pharmacotherapy", "Hepatitis C — Direct-Acting Antivirals");
  slideTitle(sld, "Pharmacotherapy: Hepatitis C", "DAAs achieve >95% sustained virological response (SVR) — effectively curative");

  // Left: drug classes
  bulletBox(sld, [
    { head: "NS3/4A Protease Inhibitors (-previr)", sub: "Glecaprevir, Grazoprevir, Voxilaprevir — block polyprotein processing" },
    { head: "NS5A Inhibitors (-asvir)", sub: "Pibrentasvir, Ledipasvir, Velpatasvir — block RNA replication complex" },
    { head: "NS5B Polymerase Inhibitors (-buvir)", sub: "Sofosbuvir (NUC) — inhibits RNA-dependent RNA polymerase" },
    "",
    { head: "Key Regimens (pan-genotypic):", sub: "" },
    { head: "Glecaprevir/Pibrentasvir (Maviret)", sub: "8–12 weeks · pan-genotypic · treatment-naive non-cirrhotic: 8 wks" },
    { head: "Sofosbuvir/Velpatasvir (Epclusa)", sub: "12 weeks · pan-genotypic · can be used in decompensated cirrhosis (+ ribavirin)" },
    { head: "Ledipasvir/Sofosbuvir (Harvoni)", sub: "8–12 weeks · genotype 1 preferred" },
  ], 0.4, 1.7, 6.8, 5.1, { fontSize: 12 });

  // HCV lifecycle image
  if (images[4] && !images[4].error) {
    sld.addImage({ data: images[4].base64, x: 7.5, y: 1.5, w: 5.5, h: 4.0 });
    sld.addText("HCV life cycle & DAA molecular targets", {
      x: 7.5, y: 5.55, w: 5.5, h: 0.28, fontSize: 8, color: C.subtleGray, italic: true, align: "center"
    });
  }
}

// Slide 13 — Other hepatitis treatments
{
  const sld = addSlide(pres);
  sectionBanner(sld, 4, "Pharmacotherapy", "HAV · HDV · HEV & Supportive Care");
  slideTitle(sld, "Other Hepatitis — Management", "Supportive care, emerging therapies and special situations");

  // cards
  const cards = [
    { title: "Hepatitis A (HAV)", color: C.teal, items: [
      "No specific antiviral therapy",
      "Supportive care: rest, hydration, avoid hepatotoxic drugs & alcohol",
      "Post-exposure prophylaxis: Ig within 14 days + vaccine",
      "Hospitalise if PT/INR ↑ or severe bilirubin elevation",
    ]},
    { title: "Hepatitis D (HDV)", color: C.red, items: [
      "Peg-interferon α-2a — only approved therapy; 48 weeks",
      "Bulevirtide (EU approved, 2020) — entry inhibitor; prevents HBV/HDV co-entry",
      "Control HBV with NRTIs — reducing HBV replication limits HDV",
      "Liver transplant for end-stage disease",
    ]},
    { title: "Hepatitis E (HEV)", color: C.gold, items: [
      "Usually self-limiting — supportive care",
      "Ribavirin — immunocompromised/chronic HEV (off-label)",
      "Hecolin® vaccine — approved in China (genotype 1); not WHO pre-qualified",
      "Stop immunosuppression in transplant recipients if possible",
    ]},
  ];
  cards.forEach((c, i) => {
    const bx = 0.4 + i * 4.3;
    sld.addShape(pres.ShapeType.roundRect, { x: bx, y: 1.6, w: 4.1, h: 5.3, rectRadius: 0.14, fill: { color: C.lightBg }, line: { color: c.color, width: 1.8 } });
    sld.addText(c.title, { x: bx, y: 1.64, w: 4.1, h: 0.45, fontSize: 13.5, bold: true, color: c.color, align: "center" });
    bulletBox(sld, c.items, bx + 0.12, 2.14, 3.86, 4.6, { fontSize: 11.5 });
  });
}

// ════════════════════════════════════════════════════════════
// STUDENT 5 — PREVENTION & VACCINATION
// ════════════════════════════════════════════════════════════

// Slide 14 — Vaccines
{
  const sld = addSlide(pres);
  sectionBanner(sld, 5, "Prevention & Vaccination", "Hepatitis Vaccines");
  slideTitle(sld, "Hepatitis Vaccines", "Vaccination is the most powerful tool for preventing viral hepatitis");

  bulletBox(sld, [
    { head: "Hepatitis A Vaccine (Havrix / Vaqta)", sub: "Inactivated · 2-dose series (0, 6–12 months) · >94% seroprotection after 2 doses · lifelong immunity" },
    { head: "Hepatitis B Vaccine (Engerix-B / Recombivax HB)", sub: "Recombinant HBsAg · 3-dose series (0, 1, 6 months) · confirm Anti-HBs ≥10 mIU/mL post-series" },
    { head: "Heplisav-B (HepB-CpG)", sub: "Adjuvanted with CpG1018 · 2-dose series (0, 4 weeks) · higher seroprotection rates vs standard" },
    { head: "Twinrix (HAV + HBV)", sub: "Combined · 3 doses (0, 1, 6 months) · ≥18 years · accelerated schedule available" },
    { head: "HEV vaccine (Hecolin®)", sub: "Approved in China only · genotype 1 · 3 doses · especially important for pregnant women in endemic areas" },
    { head: "No vaccine for HCV or HDV", sub: "HDV: preventing/treating HBV prevents HDV · HCV: research ongoing" },
  ], 0.4, 1.7, 12.5, 4.8, { fontSize: 12.5 });
}

// Slide 15 — Vaccine schedule + image
{
  const sld = addSlide(pres);
  sectionBanner(sld, 5, "Prevention & Vaccination", "Vaccine Schedules & Special Populations");
  slideTitle(sld, "Vaccine Schedules & Special Populations");

  // Left: schedule content
  bulletBox(sld, [
    "Universal HBV vaccination: birth dose within 24 hours + 2–3 booster doses",
    "HBsAg+ mothers: infant receives HBV vaccine + HBIG at birth (prevents 85–95% vertical transmission)",
    "HAV: recommended for all travellers to endemic regions, MSM, PWID, chronic liver disease patients",
    "Healthcare workers: mandatory HBV vaccination; confirm anti-HBs response",
    "Dialysis patients: double-dose HBV vaccine + regular anti-HBs monitoring",
    "HIV+ patients: Heplisav-B preferred (superior response with CpG adjuvant)",
    "Pregnancy: HBV vaccine safe; HAV vaccine may be given if high risk",
  ], 0.4, 1.65, 7.0, 5.0, { fontSize: 12 });

  // HAV vaccine table image
  if (images[5] && !images[5].error) {
    sld.addImage({ data: images[5].base64, x: 7.7, y: 1.5, w: 5.4, h: 3.5 });
    sld.addText("Hepatitis A vaccine schedules — Sexually Transmitted Infections reference guide", {
      x: 7.7, y: 5.05, w: 5.4, h: 0.28, fontSize: 7.5, color: C.subtleGray, italic: true, align: "center"
    });
  }
}

// Slide 16 — Post-Exposure Prophylaxis
{
  const sld = addSlide(pres);
  sectionBanner(sld, 5, "Prevention & Vaccination", "Post-Exposure Prophylaxis");
  slideTitle(sld, "Post-Exposure Prophylaxis (PEP)", "Time-critical interventions for pharmacy practice");

  // HBV PEP
  sld.addShape(pres.ShapeType.roundRect, { x: 0.4, y: 1.6, w: 5.9, h: 5.3, rectRadius: 0.12, fill: { color: C.lightBg }, line: { color: C.gold, width: 1.5 } });
  sld.addText("HBV Post-Exposure Prophylaxis", { x: 0.4, y: 1.64, w: 5.9, h: 0.42, fontSize: 13, bold: true, color: C.gold, align: "center" });
  bulletBox(sld, [
    "Unvaccinated: HBIG (0.06 mL/kg IM) + HBV vaccine — within 24 h",
    "Previously vaccinated with adequate anti-HBs (≥10 mIU/mL): no action",
    "Previously vaccinated — non-responder: HBIG × 2 doses (1 month apart)",
    "Needle-stick or sexual exposure: administer within 7 days (ideally 24 h)",
    "HBIG = Hepatitis B Immunoglobulin (passive immunity)",
    "Efficacy of combined HBIG + vaccine: 85–95%",
  ], 0.55, 2.1, 5.6, 4.5, { fontSize: 11.5 });

  // HAV PEP
  sld.addShape(pres.ShapeType.roundRect, { x: 7.0, y: 1.6, w: 5.9, h: 5.3, rectRadius: 0.12, fill: { color: C.lightBg }, line: { color: C.teal, width: 1.5 } });
  sld.addText("HAV Post-Exposure Prophylaxis", { x: 7.0, y: 1.64, w: 5.9, h: 0.42, fontSize: 13, bold: true, color: C.teal, align: "center" });
  bulletBox(sld, [
    "Immune globulin (IGIM) — effective if given within 14 days of exposure",
    "HAV vaccine preferred for healthy persons aged 1–40 years",
    "Both IGIM + vaccine for immunocompromised, chronic liver disease, or >40 years",
    "Travel prophylaxis: single HAV vaccine dose sufficient for most destinations",
    "Dose: IGIM 0.1 mL/kg IM for short-term travel (≤1 month)",
    "Breastfeeding: not contraindicated with hepatitis B vaccination",
  ], 7.15, 2.1, 5.6, 4.5, { fontSize: 11.5 });
}

// ════════════════════════════════════════════════════════════
// SUMMARY SLIDE
// ════════════════════════════════════════════════════════════
{
  const sld = addSlide(pres, C.navy);
  sld.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.18, h: 7.5, fill: { color: C.gold } });
  sld.addShape(pres.ShapeType.rect, { x: 0.18, y: 0, w: 0.08, h: 7.5, fill: { color: C.teal } });

  sld.addText("Key Takeaways", { x: 0.5, y: 0.2, w: 12.5, h: 0.7, fontSize: 32, bold: true, color: C.gold });
  divider(sld, 0.95);

  const takeaways = [
    { n: "1", text: "Five distinct hepatitis viruses (A–E) differ in genome, transmission, chronicity risk and clinical outcomes." },
    { n: "2", text: "Immune-mediated hepatocellular injury (CD8+ T-cells, cytokines) drives both acute damage and chronic fibrosis/cirrhosis." },
    { n: "3", text: "Serology is the cornerstone of diagnosis: HBsAg, anti-HBc IgM, HCV RNA, and anti-HAV IgM guide management." },
    { n: "4", text: "HBV treatment: TDF/TAF or Entecavir (NRTIs) suppress viral replication; PEG-IFN for finite therapy. HCV DAAs achieve >95% cure." },
    { n: "5", text: "Vaccination (HBV at birth, HAV for at-risk groups) combined with HBIG PEP are the most effective preventive strategies." },
  ];
  takeaways.forEach((t, i) => {
    const ty = 1.1 + i * 1.1;
    sld.addShape(pres.ShapeType.ellipse, { x: 0.5, y: ty + 0.05, w: 0.55, h: 0.55, fill: { color: C.teal } });
    sld.addText(t.n, { x: 0.5, y: ty + 0.05, w: 0.55, h: 0.55, fontSize: 16, bold: true, color: C.white, align: "center", valign: "middle" });
    sld.addText(t.text, { x: 1.25, y: ty, w: 11.8, h: 0.75, fontSize: 13, color: C.offWhite, valign: "middle" });
  });

  sld.addText("Sources: Harrison's 22E · Goldman-Cecil Medicine · Robbins & Kumar Pathology · Sleisenger & Fordtran · Red Book 2021 · Washington Manual", {
    x: 0.5, y: 6.9, w: 12.5, h: 0.35, fontSize: 8.5, color: C.subtleGray, italic: true
  });
}

// ─── Write file ────────────────────────────────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/workspace/hepatitis-pptx/Hepatitis_Pharmacy_Presentation.pptx" })
  .then(() => console.log("SUCCESS: Presentation created!"))
  .catch(err => { console.error("ERROR:", err); process.exit(1); });
Running Command

cd /home/daytona/workspace/hepatitis-pptx && node build.js 2>&1

Two issues: (1) image fetch using too many URL args causes ENOBUFS, and (2) the bulletBox helper passes an object {head, sub} but the inner array flattening passes objects not strings. Let me fix both:
Writing File

~/hepatitis-pptx/build.js

const pptxgen = require("pptxgenjs");
const { execSync } = require("child_process");
const fs = require("fs");

// ─── Fetch images in small batches ───────────────────────────────────────────
const imageUrls = [
  "https://cdn.orris.care/cdss_images/HARRISON_1763033912702_6c8b3aeb-d09d-4456-9e4a-51e468791295.png",
  "https://cdn.orris.care/cdss_images/HARRISON_1763031941963_b8714721-0c5c-4031-a531-da171f3c8e24.png",
  "https://cdn.orris.care/cdss_images/GLGCA_41753_1766502006027_6fb9687b-4165-46fa-a1ed-7ae80b6c4566_21bf0166-de59-45a3-9836-5b11d5412c80.png",
  "https://cdn.orris.care/cdss_images/GLGCA_2232415_1763366073233_eb427168-5573-434d-9914-2a97b7413bae.png",
  "https://cdn.orris.care/cdss_images/GLGCA_4779637_1766686947536_b2bfdfdc-a8c3-49f6-b774-cb9299224a8f_a4791fd6-8d67-4a9b-afc8-071fa27ef5b8.png",
];

function fetchImages(urls) {
  const results = [];
  for (const url of urls) {
    try {
      const r = execSync(
        `node /home/daytona/skills/shared/scripts/fetch_images.js "${url}"`,
        { timeout: 30000, maxBuffer: 20 * 1024 * 1024 }
      ).toString();
      const parsed = JSON.parse(r);
      results.push(parsed[0]);
    } catch (e) {
      console.warn("Image fetch failed for", url, ":", e.message.slice(0, 80));
      results.push({ url, base64: null, error: e.message });
    }
  }
  return results;
}

console.log("Fetching images one by one...");
const images = fetchImages(imageUrls);
console.log("Images:", images.map((img, i) => `${i}:${img && !img.error ? "OK" : "FAIL"}`).join(", "));

// ─── Color palette ────────────────────────────────────────────────────────────
const C = {
  navy:      "0D2B55",
  teal:      "0E7C7B",
  gold:      "F4A11D",
  white:     "FFFFFF",
  offWhite:  "EEF2F7",
  lightBg:   "1A3A6B",
  subtleGray:"A8B8CC",
  darkText:  "0D1F3C",
  red:       "D94F3D",
  green:     "2EAF6C",
};

const pres = new pptxgen();
pres.layout = "LAYOUT_WIDE"; // 13.33" × 7.5"
pres.title = "Hepatitis — Pharmacy Students Presentation";
pres.author = "Orris Medical AI";

// ─── Helpers ──────────────────────────────────────────────────────────────────
function addSlide(bgColor) {
  const sld = pres.addSlide();
  sld.background = { color: bgColor || C.navy };
  return sld;
}

function sectionBanner(sld, studentNum, studentLabel, topic) {
  sld.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 13.33, h: 0.52, fill: { color: C.teal } });
  sld.addText(`STUDENT ${studentNum}  ·  ${studentLabel.toUpperCase()}`, {
    x: 0.3, y: 0, w: 9, h: 0.52,
    fontSize: 10, bold: true, color: C.white, valign: "middle", margin: 0
  });
  sld.addText("HEPATITIS  ·  PHARMACY", {
    x: 9.5, y: 0, w: 3.5, h: 0.52,
    fontSize: 9, color: C.offWhite, align: "right", valign: "middle", margin: 0
  });
}

function slideTitle(sld, title, subtitle) {
  sld.addText(title, {
    x: 0.4, y: 0.62, w: 12.5, h: 0.68,
    fontSize: 26, bold: true, color: C.gold, fontFace: "Calibri"
  });
  if (subtitle) {
    sld.addText(subtitle, {
      x: 0.4, y: 1.3, w: 12.5, h: 0.35,
      fontSize: 12, color: C.subtleGray, italic: true
    });
  }
}

// Converts bullet items (string or {head, sub} objects) to rich text array
function makeBulletItems(bullets, fontSize) {
  const fs2 = fontSize || 12;
  const items = [];
  for (let i = 0; i < bullets.length; i++) {
    const b = bullets[i];
    if (!b || b === "") {
      items.push({ text: " ", options: { fontSize: fs2 * 0.5, breakLine: true } });
    } else if (typeof b === "object" && b.head !== undefined) {
      // head + sub on same line
      items.push({ text: b.head, options: { bullet: { indent: 14 }, bold: true, color: C.gold, fontSize: fs2, breakLine: !b.sub } });
      if (b.sub) {
        items.push({ text: " — " + b.sub, options: { bold: false, color: C.offWhite, fontSize: fs2, breakLine: true } });
      }
    } else {
      items.push({ text: String(b), options: { bullet: { indent: 14 }, color: C.offWhite, fontSize: fs2, breakLine: true } });
    }
  }
  // remove breakLine from last real item
  if (items.length > 0) {
    items[items.length - 1].options.breakLine = false;
  }
  return items;
}

function bulletBox(sld, bullets, x, y, w, h, fontSize) {
  const items = makeBulletItems(bullets, fontSize);
  sld.addText(items, { x, y, w, h, valign: "top", lineSpacingMultiple: 1.28 });
}

function divider(sld, y) {
  sld.addShape(pres.ShapeType.line, {
    x: 0.4, y, w: 12.5, h: 0,
    line: { color: C.teal, width: 1.2 }
  });
}

// ════════════════════════════════════════════════════════════
// SLIDE 1 — TITLE SLIDE
// ════════════════════════════════════════════════════════════
{
  const sld = addSlide(C.navy);
  sld.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.18, h: 7.5, fill: { color: C.teal } });
  sld.addShape(pres.ShapeType.rect, { x: 0.18, y: 0, w: 0.08, h: 7.5, fill: { color: C.gold } });

  sld.addText("HEPATITIS", {
    x: 0.6, y: 0.9, w: 12, h: 1.6,
    fontSize: 72, bold: true, color: C.white, fontFace: "Calibri", charSpacing: 8
  });
  sld.addText("A Comprehensive Pharmacy Review", {
    x: 0.6, y: 2.55, w: 10, h: 0.6,
    fontSize: 22, color: C.gold, italic: true
  });

  const students = [
    { n: "1", label: "Overview &\nEpidemiology" },
    { n: "2", label: "Pathophysiology" },
    { n: "3", label: "Diagnosis &\nSerology" },
    { n: "4", label: "Pharmacotherapy" },
    { n: "5", label: "Prevention &\nVaccination" },
  ];
  students.forEach((s, i) => {
    const bx = 0.5 + i * 2.5;
    sld.addShape(pres.ShapeType.roundRect, { x: bx, y: 3.4, w: 2.3, h: 1.2, rectRadius: 0.12, fill: { color: C.lightBg }, line: { color: C.teal, width: 1.5 } });
    sld.addText("Student " + s.n, { x: bx, y: 3.42, w: 2.3, h: 0.4, fontSize: 11, bold: true, color: C.gold, align: "center" });
    sld.addText(s.label, { x: bx + 0.08, y: 3.82, w: 2.14, h: 0.68, fontSize: 10, color: C.offWhite, align: "center" });
  });

  sld.addText("Pharmacy Students Group Presentation  |  April 2026", {
    x: 0.6, y: 4.85, w: 10, h: 0.35,
    fontSize: 11, color: C.subtleGray
  });
  sld.addText("Sources: Harrison's 22E · Goldman-Cecil Medicine · Robbins Pathology · Sleisenger & Fordtran · Red Book 2021", {
    x: 0.6, y: 7.05, w: 12, h: 0.3,
    fontSize: 8.5, color: C.subtleGray, italic: true
  });
}

// ════════════════════════════════════════════════════════════
// STUDENT 1 — OVERVIEW & EPIDEMIOLOGY
// ════════════════════════════════════════════════════════════

// Slide 2 — Types of Hepatitis Viruses
{
  const sld = addSlide();
  sectionBanner(sld, 1, "Overview & Epidemiology", "Types");
  slideTitle(sld, "Types of Hepatitis Viruses", "Five major viruses — distinct genomes, transmission routes and clinical courses");

  bulletBox(sld, [
    { head: "Hepatitis A (HAV)", sub: "ssRNA picornavirus  |  fecal-oral  |  self-limiting acute disease, no chronicity" },
    { head: "Hepatitis B (HBV)", sub: "dsDNA hepadnavirus (3.2 kb)  |  parenteral/sexual/perinatal  |  chronic in 5–10% adults; 90% neonates" },
    { head: "Hepatitis C (HCV)", sub: "ssRNA flavivirus  |  blood-borne  |  70–85% progress to chronic; 6 genotypes" },
    { head: "Hepatitis D (HDV)", sub: "RNA deltavirus  |  requires HBV co-infection  |  worsens HBV severity significantly" },
    { head: "Hepatitis E (HEV)", sub: "ssRNA hepevirus  |  fecal-oral  |  usually self-limiting; 20% mortality in pregnant women" },
  ], 0.4, 1.65, 7.0, 5.0, 13);

  if (images[0] && !images[0].error) {
    sld.addImage({ data: images[0].base64, x: 7.7, y: 1.45, w: 5.3, h: 3.0 });
    sld.addText("Harrison's Principles of Internal Medicine 22E — Table 339-1", {
      x: 7.7, y: 4.5, w: 5.3, h: 0.28, fontSize: 7.5, color: C.subtleGray, italic: true, align: "center"
    });
  }
}

// Slide 3 — Global Epidemiology
{
  const sld = addSlide();
  sectionBanner(sld, 1, "Overview & Epidemiology", "Global Burden");
  slideTitle(sld, "Global Epidemiology", "Hepatitis remains a leading infectious cause of liver-related mortality worldwide");

  const stats = [
    { val: "354 M", lbl: "People with chronic HBV or HCV infection globally (WHO 2022)" },
    { val: "~1.4 M", lbl: "Deaths per year attributed to viral hepatitis" },
    { val: "90%", lbl: "Neonates exposed to HBV without vaccination who develop chronic infection" },
    { val: "70–85%", lbl: "Acute HCV infections that progress to chronicity" },
    { val: "20%", lbl: "Case fatality rate of HEV in pregnant women (3rd trimester)" },
    { val: "2 M+", lbl: "New HCV infections per year (injection drug use main driver)" },
  ];
  stats.forEach((s, i) => {
    const rx = (i % 3) * 4.3 + 0.4;
    const ry = 1.65 + Math.floor(i / 3) * 2.2;
    sld.addShape(pres.ShapeType.roundRect, { x: rx, y: ry, w: 4.0, h: 1.95, rectRadius: 0.14, fill: { color: C.lightBg }, line: { color: C.teal, width: 1.2 } });
    sld.addText(s.val, { x: rx, y: ry + 0.1, w: 4.0, h: 0.75, fontSize: 30, bold: true, color: C.gold, align: "center" });
    sld.addText(s.lbl, { x: rx + 0.1, y: ry + 0.88, w: 3.8, h: 0.95, fontSize: 10.5, color: C.offWhite, align: "center" });
  });
}

// Slide 4 — Transmission Routes
{
  const sld = addSlide();
  sectionBanner(sld, 1, "Overview & Epidemiology", "Transmission");
  slideTitle(sld, "Transmission Routes & High-Risk Groups", "Key counselling points for pharmacy practice");

  sld.addShape(pres.ShapeType.roundRect, { x: 0.3, y: 1.6, w: 6.0, h: 5.3, rectRadius: 0.12, fill: { color: C.lightBg }, line: { color: C.teal, width: 1.3 } });
  sld.addText("Fecal-Oral (HAV, HEV)", { x: 0.4, y: 1.65, w: 5.8, h: 0.42, fontSize: 13.5, bold: true, color: C.teal, align: "center" });
  bulletBox(sld, [
    "Contaminated food or water",
    "Poor sanitation / inadequate hand hygiene",
    "Travel to endemic areas",
    "Shellfish from polluted waters",
    "Close household or institutional contact",
  ], 0.5, 2.12, 5.7, 2.2, 12);

  sld.addText("Parenteral / Blood-Borne (HBV, HCV, HDV)", { x: 0.4, y: 4.3, w: 5.8, h: 0.42, fontSize: 12, bold: true, color: C.gold, align: "center" });
  bulletBox(sld, [
    "Sharing needles (PWID — major HCV driver)",
    "Sexual contact (especially HBV in MSM)",
    "Perinatal: mother-to-child (HBV, HCV)",
    "Needlestick injuries in healthcare workers",
    "Unscreened blood products / tattooing",
  ], 0.5, 4.75, 5.7, 2.0, 12);

  sld.addShape(pres.ShapeType.roundRect, { x: 6.8, y: 1.6, w: 6.2, h: 5.3, rectRadius: 0.12, fill: { color: C.lightBg }, line: { color: C.gold, width: 1.3 } });
  sld.addText("High-Risk Groups for Pharmacy Counselling", { x: 6.9, y: 1.65, w: 6.0, h: 0.42, fontSize: 13, bold: true, color: C.gold, align: "center" });
  bulletBox(sld, [
    "Injection drug users (HCV, HBV, HDV)",
    "Healthcare workers — needlestick exposure",
    "Travellers to HAV/HEV endemic regions",
    "Pregnant women — vertical transmission risk",
    "Haemodialysis patients (HCV)",
    "Men who have sex with men (HAV, HBV)",
    "Immunocompromised / HIV co-infected patients",
    "Household contacts of HBV-infected individuals",
    "Infants born to HBsAg-positive mothers",
  ], 7.0, 2.12, 5.8, 4.6, 12);
}

// ════════════════════════════════════════════════════════════
// STUDENT 2 — PATHOPHYSIOLOGY
// ════════════════════════════════════════════════════════════

// Slide 5 — Mechanisms of Hepatic Injury
{
  const sld = addSlide();
  sectionBanner(sld, 2, "Pathophysiology", "Mechanisms of Hepatic Injury");
  slideTitle(sld, "Mechanisms of Hepatic Injury", "Immune-mediated hepatocellular damage is the hallmark of viral hepatitis");

  bulletBox(sld, [
    { head: "Direct cytopathic effect", sub: "HCV & HEV can directly damage hepatocytes; limited in HBV" },
    { head: "CD8+ cytotoxic T-cell killing", sub: "Primary HBV mechanism — T-cells destroy infected hepatocytes presenting HBcAg/HBsAg on MHC-I" },
    { head: "Cytokine-mediated inflammation", sub: "TNF-α, IFN-γ, IL-2, IL-6 — amplify hepatic inflammation and cause bystander hepatocyte injury" },
    { head: "Interface hepatitis", sub: "Lymphocytic infiltration at portal-parenchymal junction — drives fibrosis progression (HAI score)" },
    { head: "Hepatocyte apoptosis", sub: "Councilman (acidophilic) bodies — apoptotic remnants; hallmark histological finding in acute hepatitis" },
    { head: "Hepatic stellate cell activation", sub: "Chronic injury → TGF-β release → stellate cells activate → collagen deposition → FIBROSIS → CIRRHOSIS" },
    { head: "Oxidative stress & mitochondrial dysfunction", sub: "Contributes to hepatocyte necrosis and lipid peroxidation in chronic HCV" },
  ], 0.4, 1.65, 12.5, 5.5, 13);
}

// Slide 6 — Acute vs Chronic Hepatitis
{
  const sld = addSlide();
  sectionBanner(sld, 2, "Pathophysiology", "Acute vs Chronic Disease");
  slideTitle(sld, "Acute vs Chronic Hepatitis", "Clinical course depends on viral load, host immunity and viral persistence");

  sld.addShape(pres.ShapeType.roundRect, { x: 0.3, y: 1.55, w: 6.0, h: 5.45, rectRadius: 0.14, fill: { color: C.lightBg }, line: { color: C.green, width: 1.5 } });
  sld.addText("ACUTE HEPATITIS  (<6 months)", { x: 0.3, y: 1.59, w: 6.0, h: 0.45, fontSize: 13.5, bold: true, color: C.green, align: "center" });
  bulletBox(sld, [
    "AST/ALT markedly elevated (10–50× ULN)",
    "Jaundice, RUQ pain, fatigue, nausea, anorexia",
    "Fulminant hepatitis: rare — coagulopathy + encephalopathy",
    "Histology: lobular disarray, Councilman bodies, ballooning",
    "HAV & HEV → always self-limiting in immunocompetent",
    "Acute HBV → 95% adults recover spontaneously",
    "Acute HCV → 15–30% spontaneous clearance",
    "Management: supportive; avoid hepatotoxic drugs & alcohol",
  ], 0.5, 2.1, 5.7, 4.7, 11.5);

  sld.addShape(pres.ShapeType.roundRect, { x: 7.0, y: 1.55, w: 6.0, h: 5.45, rectRadius: 0.14, fill: { color: C.lightBg }, line: { color: C.red, width: 1.5 } });
  sld.addText("CHRONIC HEPATITIS  (>6 months)", { x: 7.0, y: 1.59, w: 6.0, h: 0.45, fontSize: 13.5, bold: true, color: C.red, align: "center" });
  bulletBox(sld, [
    "Defined as persistence of HBsAg or HCV RNA >6 months",
    "HBV: risk 90% in neonates; 5% in immunocompetent adults",
    "HCV: 70–85% of acute infections become chronic",
    "HDV: always chronic if HBV superinfection",
    "Ground-glass hepatocytes (HBsAg-laden cytoplasm) in HBV",
    "Complications: cirrhosis, portal hypertension, HCC",
    "HCC risk: 100× higher with chronic HBV vs general population",
    "Monitor: LFTs, viral load, AFP, HCC surveillance every 6 months",
  ], 7.2, 2.1, 5.7, 4.7, 11.5);
}

// ════════════════════════════════════════════════════════════
// STUDENT 3 — DIAGNOSIS & SEROLOGY
// ════════════════════════════════════════════════════════════

// Slide 7 — Clinical Presentation
{
  const sld = addSlide();
  sectionBanner(sld, 3, "Diagnosis & Serology", "Clinical Presentation");
  slideTitle(sld, "Clinical Presentation", "From asymptomatic infection to fulminant hepatic failure");

  const phases = [
    { label: "Prodrome", dur: "1–2 weeks", sx: "Fatigue, anorexia, nausea, low-grade fever, RUQ discomfort, myalgia", color: C.teal },
    { label: "Icteric Phase", dur: "2–6 weeks", sx: "Jaundice, dark urine (bilirubinuria), pale stools, pruritus, tender hepatomegaly", color: C.gold },
    { label: "Recovery", dur: "Weeks–months", sx: "Symptom resolution; LFTs normalise; risk of chronicity persists for HBV/HCV/HDV", color: C.green },
  ];
  phases.forEach((p, i) => {
    const bx = 0.4 + i * 4.3;
    sld.addShape(pres.ShapeType.roundRect, { x: bx, y: 1.65, w: 4.1, h: 1.05, rectRadius: 0.1, fill: { color: p.color } });
    sld.addText(p.label + "  |  " + p.dur, { x: bx + 0.08, y: 1.67, w: 3.94, h: 0.44, fontSize: 12.5, bold: true, color: C.darkText, align: "center" });
    sld.addText(p.sx, { x: bx + 0.08, y: 2.12, w: 3.94, h: 0.55, fontSize: 10, color: C.darkText, align: "center" });
  });

  divider(sld, 2.85);
  sld.addText("Key Laboratory Findings:", { x: 0.4, y: 2.9, w: 12.5, h: 0.4, fontSize: 13.5, bold: true, color: C.gold });
  bulletBox(sld, [
    { head: "ALT / AST", sub: "Markedly elevated (hepatocellular pattern); ALT > AST distinguishes viral from alcoholic hepatitis" },
    { head: "Total & Direct Bilirubin", sub: "Elevated with jaundice; urobilinogen in urine; absent urobilinogen in complete obstruction" },
    { head: "Alkaline Phosphatase / GGT", sub: "Mildly elevated unless cholestatic component; GGT rises with alcohol use" },
    { head: "Prothrombin Time / INR", sub: "Best marker of hepatic synthetic function; prolonged in severe/fulminant hepatitis" },
    { head: "Albumin", sub: "Decreased in chronic hepatitis — reflects long-term synthetic failure" },
  ], 0.4, 3.35, 12.5, 3.85, 12.5);
}

// Slide 8 — Serological Markers
{
  const sld = addSlide();
  sectionBanner(sld, 3, "Diagnosis & Serology", "Serological Markers");
  slideTitle(sld, "Serological Diagnosis", "Specific markers identify virus type, phase and immunity status");

  // HAV card
  sld.addShape(pres.ShapeType.roundRect, { x: 0.3, y: 1.58, w: 3.9, h: 2.55, rectRadius: 0.1, fill: { color: C.lightBg }, line: { color: C.teal, width: 1.3 } });
  sld.addText("Hepatitis A", { x: 0.3, y: 1.61, w: 3.9, h: 0.4, fontSize: 13, bold: true, color: C.teal, align: "center" });
  bulletBox(sld, [
    "IgM anti-HAV → Acute active infection",
    "IgG anti-HAV → Past infection or vaccination immunity",
    "No chronic carrier state",
    "Window period: IgM appears 5–10 days after symptoms",
  ], 0.45, 2.06, 3.65, 2.0, 11);

  // HBV card
  sld.addShape(pres.ShapeType.roundRect, { x: 4.5, y: 1.58, w: 4.3, h: 2.55, rectRadius: 0.1, fill: { color: C.lightBg }, line: { color: C.gold, width: 1.3 } });
  sld.addText("Hepatitis B", { x: 4.5, y: 1.61, w: 4.3, h: 0.4, fontSize: 13, bold: true, color: C.gold, align: "center" });
  bulletBox(sld, [
    "HBsAg — Active infection (surface antigen)",
    "Anti-HBs — Immunity (recovery or vaccine)",
    "IgM anti-HBc — Acute HBV infection",
    "IgG anti-HBc — Past or chronic exposure",
    "HBeAg — High viral replication / infectivity",
    "Anti-HBe — Seroconversion, lower infectivity",
    "HBV DNA (PCR) — Viral load monitoring",
  ], 4.65, 2.05, 4.0, 2.05, 10.5);

  // HCV card
  sld.addShape(pres.ShapeType.roundRect, { x: 9.1, y: 1.58, w: 3.9, h: 2.55, rectRadius: 0.1, fill: { color: C.lightBg }, line: { color: C.red, width: 1.3 } });
  sld.addText("Hepatitis C", { x: 9.1, y: 1.61, w: 3.9, h: 0.4, fontSize: 13, bold: true, color: C.red, align: "center" });
  bulletBox(sld, [
    "Anti-HCV (ELISA) → Screening",
    "HCV RNA (PCR) → Confirms active infection",
    "HCV genotype → Guides DAA selection",
    "Anti-HCV alone ≠ active infection",
    "(cannot distinguish acute/chronic/resolved)",
    "SVR12 = cure (no HCV RNA at 12 weeks post-therapy)",
  ], 9.25, 2.05, 3.65, 2.0, 10.5);

  // Bottom images
  if (images[1] && !images[1].error) {
    sld.addImage({ data: images[1].base64, x: 0.3, y: 4.28, w: 7.5, h: 2.85 });
    sld.addText("Chronic HBV serology timeline — Harrison's 22E", {
      x: 0.3, y: 7.15, w: 7.5, h: 0.28, fontSize: 7.5, color: C.subtleGray, italic: true, align: "center"
    });
  }
  if (images[2] && !images[2].error) {
    sld.addImage({ data: images[2].base64, x: 8.1, y: 4.28, w: 5.0, h: 2.85 });
    sld.addText("HBV/HDV laboratory diagnosis markers — Clinical Microbiology Guide", {
      x: 8.1, y: 7.15, w: 5.0, h: 0.28, fontSize: 7.5, color: C.subtleGray, italic: true, align: "center"
    });
  }
}

// Slide 9 — Diagnostic Algorithm
{
  const sld = addSlide();
  sectionBanner(sld, 3, "Diagnosis & Serology", "Diagnostic Algorithm");
  slideTitle(sld, "Diagnostic Algorithm", "Systematic approach to identifying hepatitis type and severity");

  const steps = [
    { n: "1", title: "Suspect Viral Hepatitis", body: "Elevated ALT/AST + jaundice/fatigue + risk factors (travel, PWID, sexual exposure, healthcare worker)" },
    { n: "2", title: "Initial Screening Panel", body: "IgM anti-HAV  ·  HBsAg  ·  IgM anti-HBc  ·  Anti-HCV ELISA  ·  HEV IgM if travel history" },
    { n: "3", title: "Confirmatory & Characterisation Tests", body: "HCV RNA PCR (if anti-HCV+)  ·  HBV DNA + HBeAg/anti-HBe  ·  HBsAg quantification for HBV" },
    { n: "4", title: "Severity Assessment", body: "Full LFTs  ·  PT/INR  ·  Albumin  ·  CBC  ·  Abdominal ultrasound / FibroScan (liver stiffness)" },
    { n: "5", title: "Chronic Disease Workup", body: "Liver biopsy (Knodell/HAI score)  ·  AFP (HCC surveillance every 6 months)  ·  EGD for varices  ·  MELD score" },
  ];
  steps.forEach((s, i) => {
    const sy = 1.62 + i * 1.07;
    sld.addShape(pres.ShapeType.ellipse, { x: 0.3, y: sy, w: 0.58, h: 0.58, fill: { color: C.teal } });
    sld.addText(s.n, { x: 0.3, y: sy, w: 0.58, h: 0.58, fontSize: 17, bold: true, color: C.white, align: "center", valign: "middle" });
    sld.addShape(pres.ShapeType.roundRect, { x: 1.05, y: sy, w: 12.0, h: 0.88, rectRadius: 0.08, fill: { color: C.lightBg }, line: { color: C.teal, width: 0.8 } });
    sld.addText(s.title, { x: 1.18, y: sy + 0.05, w: 3.6, h: 0.38, fontSize: 12.5, bold: true, color: C.gold });
    sld.addText(s.body, { x: 5.0, y: sy + 0.06, w: 7.8, h: 0.72, fontSize: 11, color: C.offWhite, valign: "middle" });
  });
}

// ════════════════════════════════════════════════════════════
// STUDENT 4 — PHARMACOTHERAPY
// ════════════════════════════════════════════════════════════

// Slide 10 — HBV Treatment
{
  const sld = addSlide();
  sectionBanner(sld, 4, "Pharmacotherapy", "Hepatitis B Treatment");
  slideTitle(sld, "Pharmacotherapy: Hepatitis B (HBV)", "Goal — Suppress viral replication, prevent cirrhosis and hepatocellular carcinoma");

  bulletBox(sld, [
    { head: "PEG-Interferon α-2a (Pegasys)", sub: "SC injection · 48 weeks · finite therapy · ~30% HBeAg seroconversion · many side effects" },
    { head: "Tenofovir disoproxil fumarate (TDF)", sub: "1st-line NRTI analogue · very high barrier to resistance · safe in pregnancy (Cat B)" },
    { head: "Tenofovir alafenamide (TAF)", sub: "Preferred over TDF — lower bone/renal toxicity · 25 mg/day orally" },
    { head: "Entecavir (ETV)", sub: "1st-line · high barrier to resistance · avoid in lamivudine-resistant HBV (cross-resistance risk)" },
    { head: "Lamivudine / Adefovir / Telbivudine", sub: "Older agents — high resistance rates; no longer preferred 1st-line therapy" },
  ], 0.4, 1.65, 12.5, 4.4, 13);

  divider(sld, 5.85);
  sld.addText("Treatment indications (AASLD):  HBeAg+ with HBV DNA >20,000 IU/mL  |  HBeAg− with HBV DNA >2,000 IU/mL + elevated ALT  |  Any HBV with cirrhosis regardless of HBV DNA", {
    x: 0.4, y: 5.95, w: 12.5, h: 0.55, fontSize: 10.5, color: C.subtleGray, italic: true
  });
  sld.addText("Sources: Harrison's 22E · AASLD HBV Guidelines", {
    x: 0.4, y: 7.1, w: 12.5, h: 0.3, fontSize: 8, color: C.subtleGray, italic: true
  });
}

// Slide 11 — HCV Treatment (DAAs)
{
  const sld = addSlide();
  sectionBanner(sld, 4, "Pharmacotherapy", "Hepatitis C — Direct-Acting Antivirals");
  slideTitle(sld, "Pharmacotherapy: Hepatitis C (HCV)", "Direct-acting antivirals (DAAs) achieve >95% sustained virological response — effectively curative");

  bulletBox(sld, [
    { head: "NS3/4A Protease Inhibitors (-previr)", sub: "Glecaprevir, Grazoprevir, Voxilaprevir — block polyprotein processing; pan-genotypic" },
    { head: "NS5A Inhibitors (-asvir)", sub: "Pibrentasvir, Ledipasvir, Velpatasvir — inhibit RNA replication complex; pan-genotypic" },
    { head: "NS5B Polymerase Inhibitors (-buvir)", sub: "Sofosbuvir (nucleotide analogue) — inhibits RNA-dependent RNA polymerase; backbone of all regimens" },
    { head: "Glecaprevir + Pibrentasvir (Maviret)", sub: "8 weeks for treatment-naive non-cirrhotic · pan-genotypic · 12 weeks for cirrhosis" },
    { head: "Sofosbuvir + Velpatasvir (Epclusa)", sub: "12 weeks · pan-genotypic · with ribavirin for decompensated cirrhosis" },
    { head: "Ledipasvir + Sofosbuvir (Harvoni)", sub: "8–12 weeks · genotype 1 preferred · 8 weeks if non-cirrhotic + low viral load" },
  ], 0.4, 1.65, 7.2, 5.5, 12.5);

  if (images[3] && !images[3].error) {
    sld.addImage({ data: images[3].base64, x: 7.8, y: 1.45, w: 5.2, h: 4.2 });
    sld.addText("HCV life cycle & DAA molecular targets — Hepatitis C in CKD", {
      x: 7.8, y: 5.68, w: 5.2, h: 0.28, fontSize: 7.5, color: C.subtleGray, italic: true, align: "center"
    });
  }
}

// Slide 12 — HAV / HDV / HEV Management
{
  const sld = addSlide();
  sectionBanner(sld, 4, "Pharmacotherapy", "HAV · HDV · HEV Management");
  slideTitle(sld, "Management: HAV, HDV & HEV", "Supportive care remains central; emerging therapies for HDV");

  const cards = [
    { title: "Hepatitis A (HAV)", color: C.teal, items: [
      "No specific antiviral therapy available",
      "Supportive care: rest, hydration, adequate nutrition",
      "Avoid hepatotoxic drugs (paracetamol high-dose, statins) & alcohol",
      "Post-exposure: IGIM (within 14 days) + HAV vaccine",
      "Hospitalise if PT/INR prolonged or severe bilirubin elevation",
      "Prognosis: excellent; <1% fulminant hepatitis",
    ]},
    { title: "Hepatitis D (HDV)", color: C.red, items: [
      "Peg-interferon α-2a: only established therapy; 48 weeks",
      "Bulevirtide (Hepcludi): EU-approved 2020 — entry inhibitor; prevents HBV/HDV co-entry into hepatocytes",
      "Control HBV with NRTIs — reducing HBV replication limits HDV",
      "Lonafarnib (farnesyl inhibitor) — investigational",
      "Liver transplantation for end-stage disease",
    ]},
    { title: "Hepatitis E (HEV)", color: C.gold, items: [
      "Immunocompetent: supportive care — self-limiting",
      "Ribavirin (off-label): for chronic HEV in transplant recipients or immunocompromised (3–6 months)",
      "PEG-interferon: used with ribavirin failure in transplant recipients",
      "Reduce immunosuppression if possible in organ transplant patients",
      "Hecolin vaccine (China only) — 3 doses; not WHO pre-qualified",
    ]},
  ];
  cards.forEach((c, i) => {
    const bx = 0.3 + i * 4.35;
    sld.addShape(pres.ShapeType.roundRect, { x: bx, y: 1.58, w: 4.15, h: 5.55, rectRadius: 0.14, fill: { color: C.lightBg }, line: { color: c.color, width: 1.8 } });
    sld.addText(c.title, { x: bx, y: 1.62, w: 4.15, h: 0.44, fontSize: 13.5, bold: true, color: c.color, align: "center" });
    bulletBox(sld, c.items, bx + 0.1, 2.1, 3.95, 4.9, 11);
  });
}

// ════════════════════════════════════════════════════════════
// STUDENT 5 — PREVENTION & VACCINATION
// ════════════════════════════════════════════════════════════

// Slide 13 — Vaccines
{
  const sld = addSlide();
  sectionBanner(sld, 5, "Prevention & Vaccination", "Hepatitis Vaccines");
  slideTitle(sld, "Hepatitis Vaccines", "Vaccination is the most effective public health tool for preventing viral hepatitis");

  bulletBox(sld, [
    { head: "Hepatitis A Vaccine (Havrix / Vaqta)", sub: "Inactivated · 2-dose series (0, 6–12 months) · >94% seroprotection · lifelong immunity after complete series" },
    { head: "Hepatitis B Vaccine (Engerix-B / Recombivax HB)", sub: "Recombinant HBsAg · 3-dose series (0, 1, 6 months) · confirm anti-HBs ≥10 mIU/mL post-vaccination" },
    { head: "Heplisav-B (HepB-CpG adjuvanted)", sub: "2-dose series (0, 4 weeks) · CpG1018 adjuvant → superior immunogenicity · preferred in adults ≥18 years" },
    { head: "Twinrix (HAV + HBV combined)", sub: "3 doses (0, 1, 6 months) · adults ≥18 years · accelerated schedule: 0, 7, 21–30 days + booster at 12 months" },
    { head: "Hecolin® (HEV vaccine)", sub: "Approved in China only · genotype 1 · 3 doses · important for pregnant women and travellers to endemic areas" },
    { head: "No vaccine for HCV or HDV", sub: "HDV prevention: control HBV through vaccination · HCV: no vaccine; prevention relies on harm reduction strategies" },
  ], 0.4, 1.65, 12.5, 5.3, 12.5);
}

// Slide 14 — Vaccine schedules with image
{
  const sld = addSlide();
  sectionBanner(sld, 5, "Prevention & Vaccination", "Schedules & Special Populations");
  slideTitle(sld, "Vaccine Schedules & Special Populations");

  bulletBox(sld, [
    "Universal HBV at birth: dose within 24 hours + 2–3 booster doses (ACIP schedule)",
    "HBsAg+ mothers: infant receives HBV vaccine + HBIG at birth → prevents 85–95% vertical transmission",
    "HAV: all travellers to endemic regions · MSM · PWID · chronic liver disease patients",
    "Healthcare workers: mandatory HBV vaccination + post-series anti-HBs confirmation",
    "Dialysis patients: double-dose HBV vaccine + regular anti-HBs monitoring every 12 months",
    "HIV-positive patients: Heplisav-B preferred (CpG adjuvant provides superior response)",
    "Pregnancy: HBV vaccine safe in all trimesters · HAV may be given if at-risk",
    "Non-responders (<10 mIU/mL): revaccinate with Heplisav-B series or additional 3-dose series",
  ], 0.4, 1.6, 7.2, 5.4, 12);

  if (images[4] && !images[4].error) {
    sld.addImage({ data: images[4].base64, x: 7.8, y: 1.45, w: 5.2, h: 3.8 });
    sld.addText("Hepatitis A vaccine schedules (Havrix, Vaqta, Twinrix) — STI Reference Guide", {
      x: 7.8, y: 5.28, w: 5.2, h: 0.35, fontSize: 7.5, color: C.subtleGray, italic: true, align: "center"
    });
  }
}

// Slide 15 — Post-Exposure Prophylaxis
{
  const sld = addSlide();
  sectionBanner(sld, 5, "Prevention & Vaccination", "Post-Exposure Prophylaxis");
  slideTitle(sld, "Post-Exposure Prophylaxis (PEP)", "Time-critical interventions — essential pharmacist counselling points");

  sld.addShape(pres.ShapeType.roundRect, { x: 0.3, y: 1.58, w: 6.0, h: 5.45, rectRadius: 0.12, fill: { color: C.lightBg }, line: { color: C.gold, width: 1.5 } });
  sld.addText("HBV Post-Exposure Prophylaxis", { x: 0.3, y: 1.62, w: 6.0, h: 0.44, fontSize: 13, bold: true, color: C.gold, align: "center" });
  bulletBox(sld, [
    "Unvaccinated: HBIG (0.06 mL/kg IM) + HBV vaccine within 24 hours",
    "Previously vaccinated with adequate anti-HBs (≥10 mIU/mL): no action needed",
    "Previously vaccinated non-responder: HBIG × 2 doses (1 month apart)",
    "Needle-stick or sexual exposure: administer within 7 days (ideally <24 h)",
    "HBIG = Hepatitis B Immune Globulin — provides passive immediate immunity",
    "Combined HBIG + vaccine efficacy: 85–95% for perinatal exposure",
    "HCV: no proven PEP — monitor HCV RNA at 4–6 weeks post-exposure",
    "Follow-up LFTs and viral markers at 6 weeks, 3 months, 6 months",
  ], 0.48, 2.1, 5.7, 4.75, 11.2);

  sld.addShape(pres.ShapeType.roundRect, { x: 7.0, y: 1.58, w: 6.0, h: 5.45, rectRadius: 0.12, fill: { color: C.lightBg }, line: { color: C.teal, width: 1.5 } });
  sld.addText("HAV Post-Exposure Prophylaxis", { x: 7.0, y: 1.62, w: 6.0, h: 0.44, fontSize: 13, bold: true, color: C.teal, align: "center" });
  bulletBox(sld, [
    "IGIM is effective if given within 14 days of exposure",
    "HAV vaccine preferred for healthy persons aged 1–40 years (rapid immunisation)",
    "Immunocompromised / chronic liver disease / >40 years: IGIM + vaccine",
    "IGIM dose: 0.1 mL/kg IM for short-term travel (≤1 month)",
    "0.2 mL/kg IM for longer stays in endemic areas",
    "Not indicated >14 days after exposure or if clinical disease has started",
    "HEV: no licensed PEP; supportive care only",
    "Breastfeeding: not contraindicated with hepatitis B vaccination",
  ], 7.18, 2.1, 5.7, 4.75, 11.2);
}

// ════════════════════════════════════════════════════════════
// SUMMARY / KEY TAKEAWAYS SLIDE
// ════════════════════════════════════════════════════════════
{
  const sld = addSlide(C.navy);
  sld.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.2, h: 7.5, fill: { color: C.gold } });
  sld.addShape(pres.ShapeType.rect, { x: 0.2, y: 0, w: 0.08, h: 7.5, fill: { color: C.teal } });

  sld.addText("Key Takeaways", { x: 0.55, y: 0.15, w: 12.5, h: 0.75, fontSize: 34, bold: true, color: C.gold });
  divider(sld, 0.95);

  const takeaways = [
    { n: "1", s: "Student 1", text: "Five distinct hepatitis viruses (A–E) differ in genome type, transmission route, chronicity risk and clinical outcomes. HAV/HEV are fecal-oral; HBV/HCV/HDV are bloodborne." },
    { n: "2", s: "Student 2", text: "Immune-mediated hepatocellular injury (CD8+ T-cells, TNF-α, IL-6) drives both acute inflammation and chronic fibrosis; stellate cell activation is the key fibrosis pathway." },
    { n: "3", s: "Student 3", text: "Serology is the cornerstone of diagnosis: HBsAg, IgM anti-HBc, HCV RNA PCR, and IgM anti-HAV guide management decisions and treatment timing." },
    { n: "4", s: "Student 4", text: "HBV: 1st-line TDF/TAF or entecavir (long-term NRTIs). HCV: pan-genotypic DAA regimens achieve >95% SVR12 — a functional cure of HCV infection." },
    { n: "5", s: "Student 5", text: "Universal HBV vaccination (birth dose) + HBIG PEP for exposed neonates prevents the majority of chronic infections. HAV vaccine for travellers and at-risk groups." },
  ];
  takeaways.forEach((t, i) => {
    const ty = 1.08 + i * 1.2;
    sld.addShape(pres.ShapeType.ellipse, { x: 0.45, y: ty + 0.08, w: 0.56, h: 0.56, fill: { color: C.teal } });
    sld.addText(t.n, { x: 0.45, y: ty + 0.08, w: 0.56, h: 0.56, fontSize: 16, bold: true, color: C.white, align: "center", valign: "middle" });
    sld.addText(t.s + ": ", { x: 1.2, y: ty + 0.08, w: 1.5, h: 0.56, fontSize: 11, bold: true, color: C.gold, valign: "middle" });
    sld.addText(t.text, { x: 2.7, y: ty, w: 10.3, h: 0.85, fontSize: 12, color: C.offWhite, valign: "middle" });
  });

  sld.addText("References: Harrison's Principles of Internal Medicine 22E  ·  Goldman-Cecil Medicine  ·  Robbins & Kumar Basic Pathology  ·  Sleisenger & Fordtran's GI & Liver Disease  ·  Red Book 2021", {
    x: 0.4, y: 7.1, w: 12.7, h: 0.28, fontSize: 7.5, color: C.subtleGray, italic: true
  });
}

// ─── Write file ────────────────────────────────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/workspace/hepatitis-pptx/Hepatitis_Pharmacy_Presentation.pptx" })
  .then(() => console.log("SUCCESS: Presentation created!"))
  .catch(err => { console.error("ERROR:", err); process.exit(1); });
Your credits are exhausted. Your daily credits reset tomorrow, or you can purchase a top-up for more.
This is a shared conversation. Sign in to Orris to start your own chat.