~/viral-hepatitis-ppt/generate.js
const pptxgen = require("pptxgenjs");
const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.author = "Internal Medicine";
pres.title = "Viral Hepatitis – Comprehensive Clinical Review";
// ─────────────────────────────────────────────
// THEME
// ─────────────────────────────────────────────
const C = {
navy: "0D2B4E", // dominant dark bg
teal: "0E7C86", // accent / section headers
gold: "E8A020", // highlight
white: "FFFFFF",
offWhite:"F0F4F8",
lt: "B8D4E0", // light text on dark
danger: "C0392B",
safe: "1E8449",
gray: "4A5568",
tableH: "0E7C86",
tableR1: "EAF4F6",
tableR2: "FFFFFF",
};
const FONT = "Calibri";
const FONT2 = "Calibri";
// ─────────────────────────────────────────────
// HELPERS
// ─────────────────────────────────────────────
function darkSlide(slide) {
slide.background = { color: C.navy };
}
function addHeader(slide, title, subtitle) {
// top teal bar
slide.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 10, h: 0.72, fill: { color: C.teal }, line: { color: C.teal } });
slide.addText(title.toUpperCase(), {
x: 0.35, y: 0, w: 9.3, h: 0.72,
fontSize: 17, bold: true, color: C.white, fontFace: FONT,
valign: "middle", charSpacing: 1.5, margin: 0,
});
if (subtitle) {
slide.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0.72, w: 10, h: 0.28, fill: { color: C.navy }, line: { color: C.navy } });
slide.addText(subtitle, {
x: 0.35, y: 0.72, w: 9.3, h: 0.28,
fontSize: 10, italic: true, color: C.lt, fontFace: FONT, valign: "middle", margin: 0,
});
}
}
function addFooter(slide, text) {
slide.addShape(pres.shapes.RECTANGLE, { x: 0, y: 5.4, w: 10, h: 0.22, fill: { color: C.teal }, line: { color: C.teal } });
slide.addText(text, {
x: 0.2, y: 5.4, w: 9.6, h: 0.22,
fontSize: 7.5, color: C.white, fontFace: FONT, valign: "middle", margin: 0,
});
}
function bodyY() { return 1.08; }
function bodyH() { return 4.25; }
function bullets(slide, items, opts = {}) {
const {
x = 0.4, y = bodyY(), w = 9.2, h = bodyH(),
fs = 13.5, color = C.offWhite, indent = 0.3,
level2items = [],
} = opts;
const textArr = [];
items.forEach((item, i) => {
const isLast = (i === items.length - 1) && level2items.length === 0;
textArr.push({
text: item,
options: {
bullet: { code: "25CF", color: C.gold },
indentLevel: 0,
breakLine: !isLast,
fontSize: fs,
color,
fontFace: FONT,
paraSpaceAfter: 4,
},
});
});
level2items.forEach((item, i) => {
const isLast = i === level2items.length - 1;
textArr.push({
text: item,
options: {
bullet: { code: "2013", color: C.lt },
indentLevel: 1,
breakLine: !isLast,
fontSize: fs - 1.5,
color: C.lt,
fontFace: FONT,
paraSpaceAfter: 3,
},
});
});
slide.addText(textArr, { x, y, w, h, valign: "top" });
}
function twoColBullets(slide, leftTitle, leftItems, rightTitle, rightItems, opts = {}) {
const { y = bodyY(), h = bodyH(), fs = 12.5 } = opts;
const colW = 4.5;
// Left column header
slide.addShape(pres.shapes.RECTANGLE, { x: 0.3, y: y - 0.05, w: colW, h: 0.32, fill: { color: C.teal }, line: { color: C.teal } });
slide.addText(leftTitle, { x: 0.3, y: y - 0.05, w: colW, h: 0.32, fontSize: 11, bold: true, color: C.white, fontFace: FONT, valign: "middle", margin: 4 });
// Right column header
slide.addShape(pres.shapes.RECTANGLE, { x: 5.2, y: y - 0.05, w: colW, h: 0.32, fill: { color: C.gold }, line: { color: C.gold } });
slide.addText(rightTitle, { x: 5.2, y: y - 0.05, w: colW, h: 0.32, fontSize: 11, bold: true, color: C.navy, fontFace: FONT, valign: "middle", margin: 4 });
const makeArr = (items) => items.map((item, i) => ({
text: item,
options: { bullet: { code: "25CF", color: C.gold }, breakLine: i < items.length - 1, fontSize: fs, color: C.offWhite, fontFace: FONT, paraSpaceAfter: 4 },
}));
slide.addText(makeArr(leftItems), { x: 0.3, y: y + 0.32, w: colW, h: h - 0.32, valign: "top" });
slide.addText(makeArr(rightItems), { x: 5.2, y: y + 0.32, w: colW, h: h - 0.32, valign: "top" });
}
// Simple table helper
function addTable(slide, headers, rows, opts = {}) {
const { x = 0.3, y = bodyY(), w = 9.4, fontSize = 10.5 } = opts;
const colW = w / headers.length;
const tableData = [];
tableData.push(headers.map(h => ({
text: h,
options: { bold: true, color: C.white, fill: C.tableH, fontSize, fontFace: FONT, align: "center", valign: "middle" },
})));
rows.forEach((row, ri) => {
tableData.push(row.map((cell, ci) => ({
text: cell,
options: {
fontSize: fontSize - 0.5,
color: C.gray,
fill: ri % 2 === 0 ? C.tableR1 : C.tableR2,
fontFace: FONT,
align: ci === 0 ? "left" : "center",
valign: "middle",
},
})));
});
slide.addTable(tableData, {
x, y, w,
colW: Array(headers.length).fill(colW),
border: { type: "solid", color: "D0DDE5", pt: 0.5 },
rowH: 0.34,
});
}
// ═══════════════════════════════════════════════
// SLIDE 1 – TITLE
// ═══════════════════════════════════════════════
{
const s = pres.addSlide();
darkSlide(s);
// left accent stripe
s.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 0.18, h: 5.625, fill: { color: C.teal }, line: { color: C.teal } });
// gold accent
s.addShape(pres.shapes.RECTANGLE, { x: 0.18, y: 0, w: 0.08, h: 5.625, fill: { color: C.gold }, line: { color: C.gold } });
// main title
s.addText("VIRAL HEPATITIS", {
x: 0.55, y: 1.2, w: 9.1, h: 1.1,
fontSize: 42, bold: true, color: C.white, fontFace: FONT, charSpacing: 3,
});
s.addText("A Comprehensive Clinical Review", {
x: 0.55, y: 2.35, w: 9.1, h: 0.55,
fontSize: 20, italic: true, color: C.lt, fontFace: FONT,
});
s.addShape(pres.shapes.RECTANGLE, { x: 0.55, y: 3.0, w: 3.8, h: 0.05, fill: { color: C.gold }, line: { color: C.gold } });
s.addText("Department of Internal Medicine | Grand Rounds", {
x: 0.55, y: 3.15, w: 9.1, h: 0.4,
fontSize: 12, color: C.lt, fontFace: FONT,
});
s.addText("HAV • HBV • HCV • HDV • HEV", {
x: 0.55, y: 3.65, w: 9.1, h: 0.4,
fontSize: 13, color: C.gold, fontFace: FONT, bold: true,
});
}
// ═══════════════════════════════════════════════
// SLIDE 2 – LEARNING OBJECTIVES
// ═══════════════════════════════════════════════
{
const s = pres.addSlide();
darkSlide(s);
addHeader(s, "Learning Objectives");
const items = [
"Classify the five hepatotropic viruses by virology, transmission, and natural history",
"Interpret serological markers for acute vs. chronic infection",
"Apply current treatment guidelines (EASL 2017, AASLD 2018, WHO)",
"Initiate antiviral therapy at the right time with the right agent",
"Recognize and manage complications: cirrhosis, HCC, and fulminant hepatic failure",
"Counsel special populations: pregnancy, immunosuppressed, HIV co-infection",
];
bullets(s, items, { fs: 14 });
addFooter(s, "Viral Hepatitis – Internal Medicine Grand Rounds");
}
// ═══════════════════════════════════════════════
// SLIDE 3 – OVERVIEW: COMPARATIVE TABLE
// ═══════════════════════════════════════════════
{
const s = pres.addSlide();
darkSlide(s);
addHeader(s, "Overview: The Five Hepatotropic Viruses");
addTable(s,
["Feature", "HAV", "HBV", "HCV", "HDV", "HEV"],
[
["Genome", "ssRNA", "dsDNA (partial)", "ssRNA", "ssRNA (defective)", "ssRNA"],
["Family", "Picornavirus", "Hepadnavirus", "Flavivirus", "Deltaviridae", "Hepeviridae"],
["Transmission", "Fecal-oral", "Parenteral / Perinatal / Sexual", "Parenteral (IDU #1)", "Parenteral (needs HBV)", "Fecal-oral / Zoonotic"],
["Incubation", "2–6 wks", "4 wks–6 mo", "4–26 wks (mean 9)", "3–7 wks", "2–8 wks"],
["Chronicity", "None", "5–10% (adults)\n90% (neonates)", "80–90%", "Yes (superinfection)", "None (except immunosuppressed)"],
["Fulminant risk", "Rare (0.1%)", "Yes", "Rare", "High (superinfection)", "20% in pregnancy (3rd trimester)"],
["Vaccine", "Yes (1995)", "Yes (1982)", "No", "Prevented by HBV vax", "Yes (China only)"],
],
{ y: 1.05, fontSize: 10 }
);
addFooter(s, "Viral Hepatitis – Internal Medicine Grand Rounds");
}
// ═══════════════════════════════════════════════
// SLIDE 4 – HEPATITIS A
// ═══════════════════════════════════════════════
{
const s = pres.addSlide();
darkSlide(s);
addHeader(s, "Hepatitis A Virus (HAV)", "Picornavirus · Fecal-oral · Self-limited");
twoColBullets(s,
"Virology & Epidemiology",
[
"Nonenveloped positive-strand RNA picornavirus (genus Hepatovirus)",
"Single serotype → effective vaccine coverage",
"~25% of acute hepatitis worldwide",
"Endemic in regions with poor sanitation",
">95% decline in USA since 1995 vaccine (~2,800 cases/yr)",
"Outbreaks: schools, food handlers, shellfish",
],
"Pathogenesis & Natural History",
[
"Spread via fecal-oral route; shed in stool 2–3 wks before jaundice",
"Viremia transient → no blood screening required",
"HAV is NOT directly cytopathic",
"Hepatocyte injury mediated by CD8+ cytotoxic T cells",
"Self-limited — DOES NOT cause chronic hepatitis",
"No carrier state; fulminant hepatitis in only 0.1%",
]
);
addFooter(s, "Source: Robbins & Kumar Basic Pathology");
}
// ═══════════════════════════════════════════════
// SLIDE 5 – HAV SEROLOGY & MANAGEMENT
// ═══════════════════════════════════════════════
{
const s = pres.addSlide();
darkSlide(s);
addHeader(s, "HAV: Serology, Management & Prevention");
addTable(s,
["Marker", "Significance", "When Detectable"],
[
["IgM anti-HAV", "ACUTE infection marker — diagnostic cornerstone", "At symptom onset; fades in months"],
["IgG anti-HAV", "Past infection / immunity", "Follows IgM; persists lifelong"],
],
{ y: 1.1, w: 9.4, fontSize: 11 }
);
// Management box
s.addShape(pres.shapes.RECTANGLE, { x: 0.3, y: 2.3, w: 4.5, h: 1.55, fill: { color: C.teal }, line: { color: C.teal }, rectRadius: 0.08 });
s.addText("Management", { x: 0.3, y: 2.3, w: 4.5, h: 0.35, fontSize: 12, bold: true, color: C.white, fontFace: FONT, align: "center", valign: "middle", margin: 0 });
s.addText([
{ text: "• Supportive care (hydration, rest)\n", options: {} },
{ text: "• Avoid alcohol and hepatotoxic drugs\n", options: {} },
{ text: "• No specific antiviral therapy\n", options: {} },
{ text: "• ICU if fulminant (coagulopathy, encephalopathy)", options: {} },
], { x: 0.4, y: 2.65, w: 4.3, h: 1.1, fontSize: 11, color: C.white, fontFace: FONT });
// Prevention box
s.addShape(pres.shapes.RECTANGLE, { x: 5.2, y: 2.3, w: 4.5, h: 1.55, fill: { color: C.gold }, line: { color: C.gold }, rectRadius: 0.08 });
s.addText("Prevention", { x: 5.2, y: 2.3, w: 4.5, h: 0.35, fontSize: 12, bold: true, color: C.navy, fontFace: FONT, align: "center", valign: "middle", margin: 0 });
s.addText([
{ text: "• HAV vaccine (2-dose series, >95% efficacy)\n", options: {} },
{ text: "• PEP: vaccine within 2 weeks of exposure\n", options: {} },
{ text: "• IG for immunocompromised contacts\n", options: {} },
{ text: "• Safe water, hand hygiene, sanitation", options: {} },
], { x: 5.3, y: 2.65, w: 4.3, h: 1.1, fontSize: 11, color: C.navy, fontFace: FONT });
s.addText("⚠ Screen for fulminant hepatitis: rising INR, encephalopathy — liver transplant evaluation if ALF criteria met", {
x: 0.3, y: 4.05, w: 9.4, h: 0.45,
fontSize: 11, color: C.gold, fontFace: FONT, bold: true,
fill: { color: "1A2E3F" }, margin: 6,
});
addFooter(s, "Viral Hepatitis – Internal Medicine Grand Rounds");
}
// ═══════════════════════════════════════════════
// SLIDE 6 – HBV VIROLOGY & EPIDEMIOLOGY
// ═══════════════════════════════════════════════
{
const s = pres.addSlide();
darkSlide(s);
addHeader(s, "Hepatitis B Virus (HBV)", "Hepadnavirus · Partially dsDNA · 300 million chronic carriers worldwide");
twoColBullets(s,
"Virology",
[
"Partially double-stranded DNA virus — Hepadnaviridae",
"Encodes a reverse transcriptase → key drug target",
"Key antigens: HBsAg (surface), HBcAg (core, intrahepatic only), HBeAg (replication marker)",
"Ground-glass hepatocytes: HBsAg accumulation in ER — pathognomonic on biopsy",
],
"Epidemiology & Transmission",
[
"~300 million chronic carriers; 820,000 deaths/yr (cirrhosis + HCC)",
"High endemicity: Sub-Saharan Africa, SE Asia, Pacific Islands",
"Route determines chronicity: perinatal → 90%; adult → 5–10%",
"Perinatal (most important in endemic areas — majority of chronic cases)",
"Parenteral: IDU, needlestick, blood products",
"Sexual contact; household horizontal transmission",
]
);
addFooter(s, "Source: Robbins & Kumar Basic Pathology");
}
// ═══════════════════════════════════════════════
// SLIDE 7 – HBV SEROLOGY
// ═══════════════════════════════════════════════
{
const s = pres.addSlide();
darkSlide(s);
addHeader(s, "HBV: Serological Markers & Interpretation");
addTable(s,
["Clinical Scenario", "HBsAg", "Anti-HBs", "Anti-HBc IgM", "Anti-HBc IgG", "HBeAg", "HBV DNA"],
[
["Acute HBV", "+", "–", "+ (diagnostic)", "–", "+", "High"],
["Window period", "–", "–", "+", "+", "–", "Low"],
["Resolved infection", "–", "+", "–", "+", "–", "–"],
["Chronic HBV (active)", "+", "–", "–", "+", "+", "High"],
["Inactive carrier", "+", "–", "–", "+", "–", "Low/<2000"],
["Vaccinated", "–", "+ (only)", "–", "–", "–", "–"],
],
{ y: 1.1, fontSize: 9.5 }
);
s.addText("KEY: Window period — HBsAg cleared, Anti-HBs not yet present → Anti-HBc IgM saves the diagnosis!", {
x: 0.3, y: 4.7, w: 9.4, h: 0.4,
fontSize: 11, color: C.gold, bold: true, fontFace: FONT,
fill: { color: "1A2E3F" }, margin: 6,
});
addFooter(s, "Viral Hepatitis – Internal Medicine Grand Rounds");
}
// ═══════════════════════════════════════════════
// SLIDE 8 – HBV NATURAL HISTORY
// ═══════════════════════════════════════════════
{
const s = pres.addSlide();
darkSlide(s);
addHeader(s, "HBV: Natural History & Phases of Chronic Infection");
const phases = [
["1. Immune Tolerant", "High HBV DNA, HBeAg+, normal ALT, minimal inflammation → common in perinatally infected; do NOT treat"],
["2. Immune Active (HBeAg+)", "High HBV DNA, HBeAg+, elevated ALT, active necroinflammation → TREAT"],
["3. Immune Control (Inactive Carrier)", "Low HBV DNA (<2000 IU/mL), HBeAg–/Anti-HBe+, normal ALT → monitor"],
["4. HBeAg-negative Chronic Hepatitis", "HBV DNA >2000 IU/mL, HBeAg– (mutant virus), elevated ALT → clinically significant, TREAT"],
["5. HBsAg Clearance (Functional Cure)", "HBsAg loss → rare (~1%/yr on NAs) — best outcome"],
];
const textArr = [];
phases.forEach(([title, detail], i) => {
textArr.push({ text: title + " ", options: { bold: true, color: C.gold, fontSize: 13, fontFace: FONT, breakLine: false } });
textArr.push({ text: detail, options: { color: C.offWhite, fontSize: 12, fontFace: FONT, breakLine: i < phases.length - 1, paraSpaceAfter: 5 } });
});
s.addText(textArr, { x: 0.4, y: bodyY(), w: 9.2, h: bodyH(), valign: "top" });
s.addText("Outcomes: Nonprogressive chronic hepatitis → Cirrhosis (~20%, 20–30 yrs) → HCC (200× risk) → Fulminant failure", {
x: 0.3, y: 4.72, w: 9.4, h: 0.4,
fontSize: 10.5, color: C.white, fontFace: FONT, bold: true,
fill: { color: C.danger }, margin: 5,
});
addFooter(s, "Viral Hepatitis – Internal Medicine Grand Rounds");
}
// ═══════════════════════════════════════════════
// SLIDE 9 – HBV TREATMENT
// ═══════════════════════════════════════════════
{
const s = pres.addSlide();
darkSlide(s);
addHeader(s, "HBV: Treatment Indications & First-Line Agents");
// Indications box
s.addShape(pres.shapes.RECTANGLE, { x: 0.3, y: 1.1, w: 9.4, h: 0.32, fill: { color: C.teal }, line: { color: C.teal } });
s.addText("TREAT WHEN (EASL 2017 / AASLD 2018):", { x: 0.3, y: 1.1, w: 9.4, h: 0.32, fontSize: 11, bold: true, color: C.white, fontFace: FONT, valign: "middle", margin: 5 });
s.addText([
{ text: "• HBV DNA >2,000 IU/mL + ALT >ULN + moderate fibrosis/necroinflammation ", options: { breakLine: false } },
{ text: "• Cirrhosis (compensated or decompensated) + detectable HBV DNA\n", options: { breakLine: true } },
{ text: "• HBV DNA >20,000 IU/mL + ALT >2×ULN ", options: { breakLine: false } },
{ text: "• HBeAg+, high viral load, age >30 yrs; Family history of HCC or cirrhosis", options: { breakLine: false } },
], { x: 0.4, y: 1.42, w: 9.2, h: 0.75, fontSize: 11, color: C.offWhite, fontFace: FONT, valign: "top" });
addTable(s,
["Drug", "Class", "Barrier to Resistance", "Key Notes"],
[
["Tenofovir DF (TDF)", "Nucleotide analog (NtRTI)", "High ✓✓", "Preferred; watch renal & bone density"],
["Tenofovir AF (TAF)", "Nucleotide analog (NtRTI)", "High ✓✓", "Better renal/bone safety than TDF"],
["Entecavir (ETV)", "Nucleoside analog (NRTI)", "High ✓✓", "Avoid if lamivudine-experienced"],
["Peg-IFN α-2a", "Immunomodulator", "N/A (finite course)", "48 wks; HBeAg seroconversion possible; NOT for decompensated cirrhosis"],
["Lamivudine / Adefovir / Telbivudine", "NRTIs (older)", "Low ✗", "High resistance — no longer preferred"],
],
{ y: 2.22, fontSize: 10 }
);
s.addText("Goal: Suppress HBV DNA to undetectable → Halt fibrosis progression → Prevent HCC | Functional cure (HBsAg loss) in ~1%/yr on NAs", {
x: 0.3, y: 4.72, w: 9.4, h: 0.4,
fontSize: 10, color: C.gold, bold: true, fontFace: FONT,
fill: { color: "1A2E3F" }, margin: 5,
});
addFooter(s, "Source: Yamada's Textbook of Gastroenterology; Goldman-Cecil Medicine");
}
// ═══════════════════════════════════════════════
// SLIDE 10 – HCV VIROLOGY & EPIDEMIOLOGY
// ═══════════════════════════════════════════════
{
const s = pres.addSlide();
darkSlide(s);
addHeader(s, "Hepatitis C Virus (HCV)", "Flavivirus · ssRNA · 80–90% chronicity rate");
twoColBullets(s,
"Virology",
[
"Enveloped ssRNA virus — Flaviviridae family",
"Encodes single polyprotein → 10 functional proteins (NS3/4A, NS5A, NS5B)",
"NS3/4A protease, NS5A, NS5B RNA polymerase → all drug targets",
"Low-fidelity RNA polymerase → quasispecies + 7 major genotypes",
"Genotyping mandatory before treatment selection",
],
"Epidemiology & Transmission",
[
"~58 million chronic carriers worldwide (WHO 2023)",
"Accounts for ~1/3 of HCC in the United States",
"IV drug use: dominant route in high-income countries",
"Needlestick risk: ~1.8% (vs 0.3% for HIV)",
"Perinatal: 5–6% from HCV+ mothers",
"Sexual transmission: low efficiency; higher in HIV+ MSM",
"1/3 of patients: no identifiable risk factor",
]
);
addFooter(s, "Source: Robbins & Kumar Basic Pathology");
}
// ═══════════════════════════════════════════════
// SLIDE 11 – HCV NATURAL HISTORY & DIAGNOSIS
// ═══════════════════════════════════════════════
{
const s = pres.addSlide();
darkSlide(s);
addHeader(s, "HCV: Natural History & Diagnosis");
// Natural history timeline boxes
const boxes = [
{ label: "Acute HCV", detail: "85% asymptomatic\nIncubation 4–26 wks (mean 9)\nHCV RNA detectable at 1–3 wks\nMild illness; severe acute rare", color: C.teal },
{ label: "Chronic HCV\n(80–90%)", detail: "Episodic ALT elevations\nEven normal ALT ≠ safe\nProgression accelerated by:\nalcohol, obesity, T2DM, HIV/HBV", color: "0E5C65" },
{ label: "Cirrhosis\n(~20%, 20–30 yrs)", detail: "Portal hypertension\nAscites, varices\nHepatic encephalopathy\nHRS, SBP", color: C.danger },
{ label: "HCC", detail: "~1/3 of US liver cancers\nUltrasound ± AFP\nevery 6 months surveillance", color: "6B1A1A" },
];
boxes.forEach((box, i) => {
const bx = 0.3 + i * 2.4;
s.addShape(pres.shapes.RECTANGLE, { x: bx, y: 1.12, w: 2.25, h: 2.0, fill: { color: box.color }, line: { color: box.color } });
s.addText(box.label, { x: bx, y: 1.12, w: 2.25, h: 0.45, fontSize: 11, bold: true, color: C.white, fontFace: FONT, align: "center", valign: "middle", margin: 0 });
s.addText(box.detail, { x: bx + 0.05, y: 1.57, w: 2.15, h: 1.45, fontSize: 9.5, color: C.white, fontFace: FONT, valign: "top", margin: 4 });
});
// Arrow between boxes
for (let i = 0; i < 3; i++) {
s.addText("▶", { x: 2.45 + i * 2.4, y: 1.85, w: 0.25, h: 0.35, fontSize: 16, color: C.gold, fontFace: FONT });
}
// Diagnosis table
s.addShape(pres.shapes.RECTANGLE, { x: 0.3, y: 3.25, w: 9.4, h: 0.3, fill: { color: C.teal }, line: { color: C.teal } });
s.addText("DIAGNOSTIC ALGORITHM", { x: 0.3, y: 3.25, w: 9.4, h: 0.3, fontSize: 11, bold: true, color: C.white, fontFace: FONT, valign: "middle", margin: 5 });
addTable(s,
["Step", "Test", "Purpose"],
[
["1st", "Anti-HCV antibody", "Screening — does NOT distinguish active from resolved infection"],
["2nd (if Ab+)", "HCV RNA (qualitative)", "Confirms ACTIVE infection; detectable 1–3 wks after exposure"],
["3rd", "HCV RNA (quantitative)", "Baseline viral load; monitors treatment response"],
["4th", "HCV Genotype (1–7)", "Guides DAA regimen selection"],
],
{ y: 3.55, fontSize: 10.5 }
);
addFooter(s, "Source: Robbins & Kumar Basic Pathology");
}
// ═══════════════════════════════════════════════
// SLIDE 12 – HCV TREATMENT: DAAs
// ═══════════════════════════════════════════════
{
const s = pres.addSlide();
darkSlide(s);
addHeader(s, "HCV: Direct-Acting Antivirals (DAAs) — The Cure");
s.addText("SVR12 (undetectable HCV RNA at 12 weeks post-treatment) = FUNCTIONAL CURE — achieved in >95% with modern DAAs", {
x: 0.3, y: 1.1, w: 9.4, h: 0.38,
fontSize: 11.5, color: C.navy, bold: true, fontFace: FONT,
fill: { color: C.gold }, margin: 6,
});
addTable(s,
["Regimen", "Class", "Genotype(s)", "Duration", "Notes"],
[
["Sofosbuvir / Velpatasvir", "NS5B + NS5A inhibitor", "Pan-genotypic (1–6)", "12 weeks", "Pan-genotypic first-line"],
["Glecaprevir / Pibrentasvir", "NS3/4A + NS5A inhibitor", "Pan-genotypic (1–6)", "8 wks (tx-naïve, no cirrhosis)", "Shortest course option"],
["SOF/VEL/Voxelaprevir", "NS5B + NS5A + NS3/4A", "Pan-genotypic; NS5A failures", "12 weeks", "Salvage after NS5A failure"],
["Ledipasvir / Sofosbuvir", "NS5A + NS5B inhibitor", "Gt 1, 4, 5, 6", "12 weeks", ""],
["Elbasvir / Grazoprevir", "NS5A + NS3/4A inhibitor", "Gt 1a, 1b, 4", "12 weeks", "Check NS5A RAVs for Gt 1a"],
],
{ y: 1.52, fontSize: 10 }
);
s.addText("⚠ SCREEN FOR HBV before starting DAAs — HBV reactivation in co-infected patients can cause fulminant hepatitis and death (start prophylactic NAs if HBsAg+)", {
x: 0.3, y: 4.0, w: 9.4, h: 0.45,
fontSize: 10.5, color: C.white, fontFace: FONT, bold: true,
fill: { color: C.danger }, margin: 6,
});
s.addText("Drug-drug interactions: Check rifampin, anticonvulsants, HIV ARVs, PPIs (reduce ledipasvir absorption)", {
x: 0.3, y: 4.5, w: 9.4, h: 0.35,
fontSize: 10.5, color: C.offWhite, fontFace: FONT,
fill: { color: "1A2E3F" }, margin: 5,
});
addFooter(s, "Source: Katzung's Basic and Clinical Pharmacology, 16th Ed.");
}
// ═══════════════════════════════════════════════
// SLIDE 13 – HDV
// ═══════════════════════════════════════════════
{
const s = pres.addSlide();
darkSlide(s);
addHeader(s, "Hepatitis D Virus (HDV)", "Defective RNA virus — requires HBV surface antigen to replicate");
twoColBullets(s,
"Virology & Epidemiology",
[
"Defective ssRNA virus (Deltaviridae) — cannot infect without HBV",
"Contains only one protein: HDAg (hepatitis D antigen)",
"~12–15 million co-infected globally",
"Endemic: Mediterranean, Middle East, Central Asia, Amazon",
"Diagnosis: Anti-HDV IgM (acute), IgG (chronic); HDV RNA",
],
"Coinfection vs Superinfection",
[
"COINFECTION (HBV + HDV simultaneously): usually self-limited; resolves with HBV; low chronicity; higher fulminant risk than HBV alone",
"SUPERINFECTION (HDV in chronic HBV): rapid progression; cirrhosis in 70–80%; HIGHEST fulminant hepatitis risk; highest HCC risk",
]
);
s.addText("Treatment: Peg-IFN-α 48 weeks (poor response ~25%) | Bulevirtide (entry inhibitor) — approved EU 2020, promising data", {
x: 0.3, y: 4.38, w: 9.4, h: 0.38,
fontSize: 11, color: C.navy, bold: true, fontFace: FONT,
fill: { color: C.gold }, margin: 6,
});
s.addText("PREVENTION: HBV vaccination COMPLETELY prevents HDV infection — the ultimate strategy", {
x: 0.3, y: 4.8, w: 9.4, h: 0.3,
fontSize: 10.5, color: C.white, fontFace: FONT, bold: true,
fill: { color: C.safe }, margin: 5,
});
addFooter(s, "Viral Hepatitis – Internal Medicine Grand Rounds");
}
// ═══════════════════════════════════════════════
// SLIDE 14 – HEV
// ═══════════════════════════════════════════════
{
const s = pres.addSlide();
darkSlide(s);
addHeader(s, "Hepatitis E Virus (HEV)", "Hepeviridae · Fecal-oral / Zoonotic · 20% mortality in pregnancy");
addTable(s,
["Feature", "Genotypes 1 & 2", "Genotypes 3 & 4"],
[
["Hosts", "Humans only", "Humans + swine, poultry, cattle, sheep"],
["Pattern", "Epidemic (monsoon season, South/Central Asia, India)", "Sporadic (farmers, undercooked meat)"],
["Chronicity", "No (immunocompetent)", "Yes — in immunosuppressed (organ transplant, HIV)"],
],
{ y: 1.12, fontSize: 11 }
);
// Alert box – pregnancy
s.addShape(pres.shapes.RECTANGLE, { x: 0.3, y: 2.55, w: 9.4, h: 0.85, fill: { color: C.danger }, line: { color: C.danger } });
s.addText("⚠ OBSTETRIC EMERGENCY: Acute HEV in 3rd trimester → Fulminant Hepatic Failure — mortality UP TO 20%\nAlso: intrauterine fetal death, preterm delivery, neonatal hepatitis (vertical transmission)", {
x: 0.35, y: 2.55, w: 9.3, h: 0.85,
fontSize: 12, color: C.white, bold: true, fontFace: FONT, valign: "middle", margin: 5,
});
bullets(s, [
"Immunosuppressed patients (transplant, HIV): Chronic HEV (Gt3) — treat with Ribavirin ± Peg-IFN; reduce immunosuppression",
"Serology: Anti-HEV IgM (acute), IgG (past); HCV RNA for immunosuppressed (antibody response may be blunted)",
"Prevention: Hecolin® vaccine (China 2011); safe water supply; cook pork/poultry thoroughly; avoid endemic areas in pregnancy",
], { y: 3.5, h: 1.7, fs: 12 });
addFooter(s, "Source: Sleisenger & Fordtran's GI and Liver Disease");
}
// ═══════════════════════════════════════════════
// SLIDE 15 – CLINICAL FEATURES OF ACUTE HEPATITIS
// ═══════════════════════════════════════════════
{
const s = pres.addSlide();
darkSlide(s);
addHeader(s, "Clinical Features of Acute Viral Hepatitis");
addTable(s,
["Phase", "Symptoms & Signs", "Duration"],
[
["Prodromal", "Fatigue, malaise, anorexia, nausea/vomiting; RUQ discomfort; low-grade fever; arthralgias/myalgias; dark urine (bilirubinuria); pale stools; urticaria/serum sickness (HBV)", "1–2 weeks before jaundice"],
["Icteric", "Jaundice (scleral icterus first → skin); tender hepatomegaly; transient splenomegaly (10–15%); pruritis if cholestatic", "Days to weeks"],
["Recovery", "Jaundice fades, appetite returns; fatigue may persist weeks to months", "Weeks to months"],
],
{ y: 1.12, fontSize: 11 }
);
s.addShape(pres.shapes.RECTANGLE, { x: 0.3, y: 3.35, w: 9.4, h: 0.3, fill: { color: C.teal }, line: { color: C.teal } });
s.addText("KEY LABORATORY FINDINGS:", { x: 0.3, y: 3.35, w: 9.4, h: 0.3, fontSize: 11, bold: true, color: C.white, fontFace: FONT, valign: "middle", margin: 5 });
addTable(s,
["Test", "Expected Finding", "Clinical Significance"],
[
["ALT / AST", "Markedly elevated (often >1000 U/L); ALT > AST", "ALT is more hepatocyte-specific"],
["Bilirubin (total + direct)", "Elevated", "Jaundice when total >3 mg/dL"],
["PT / INR", "Prolonged in severe disease", "Best acute marker of synthetic function — prognostic!"],
["Albumin", "Normal in acute hepatitis (long half-life); Low if chronic", "Low albumin = suspect chronic liver disease"],
["ALP", "Mildly elevated or normal", "Marked elevation suggests biliary or infiltrative disease"],
],
{ y: 3.68, fontSize: 10 }
);
addFooter(s, "Viral Hepatitis – Internal Medicine Grand Rounds");
}
// ═══════════════════════════════════════════════
// SLIDE 16 – COMPLICATIONS
// ═══════════════════════════════════════════════
{
const s = pres.addSlide();
darkSlide(s);
addHeader(s, "Complications of Viral Hepatitis");
const comps = [
{
title: "Fulminant Hepatic Failure (ALF)",
color: C.danger,
pts: ["Coagulopathy (INR ≥1.5) + Encephalopathy without prior liver disease", "Causes: HBV reactivation, HDV superinfection, HEV in pregnancy, HAV (rare)", "Emergency: ICU, treat encephalopathy (lactulose, rifaximin), FFP/Vit K", "Liver transplantation: Status 1 priority; list within 24h; transplant within 48–72h"],
},
{
title: "Cirrhosis",
color: C.teal,
pts: ["End-stage fibrosis from chronic hepatic inflammation", "Complications: portal HTN, ascites, SBP, varices, HRS, hepatic encephalopathy", "Decompensation: Child-Pugh B/C or MELD ≥15 — consider transplant evaluation"],
},
{
title: "Hepatocellular Carcinoma (HCC)",
color: "7B5E00",
pts: ["HBV: 200× risk; can occur WITHOUT cirrhosis!", "HCV: ~1/3 of US liver cancers; almost always on cirrhotic background", "SURVEILLANCE: Liver ultrasound ± AFP every 6 months in all at-risk patients"],
},
];
comps.forEach((comp, i) => {
const bx = 0.3 + i * 3.25;
s.addShape(pres.shapes.RECTANGLE, { x: bx, y: 1.12, w: 3.1, h: 0.36, fill: { color: comp.color }, line: { color: comp.color } });
s.addText(comp.title, { x: bx, y: 1.12, w: 3.1, h: 0.36, fontSize: 11, bold: true, color: C.white, fontFace: FONT, align: "center", valign: "middle", margin: 0 });
const arr = comp.pts.map((p, pi) => ({
text: p,
options: { bullet: { code: "25CF", color: C.gold }, breakLine: pi < comp.pts.length - 1, fontSize: 10.5, color: C.offWhite, fontFace: FONT, paraSpaceAfter: 4 },
}));
s.addText(arr, { x: bx + 0.05, y: 1.52, w: 3.0, h: 2.75, valign: "top" });
});
s.addShape(pres.shapes.RECTANGLE, { x: 0.3, y: 4.38, w: 9.4, h: 0.3, fill: { color: C.teal }, line: { color: C.teal } });
s.addText("Extrahepatic manifestations: HBV → Polyarteritis nodosa, membranous GN, serum sickness | HCV → Mixed cryoglobulinemia, MPGN, NHL, porphyria cutanea tarda", {
x: 0.3, y: 4.38, w: 9.4, h: 0.3, fontSize: 9, color: C.white, fontFace: FONT, valign: "middle", margin: 5,
});
addFooter(s, "Source: Goldman-Cecil Medicine; Robbins & Kumar; Sleisenger & Fordtran's");
}
// ═══════════════════════════════════════════════
// SLIDE 17 – SPECIAL POPULATIONS
// ═══════════════════════════════════════════════
{
const s = pres.addSlide();
darkSlide(s);
addHeader(s, "Special Populations");
const sp = [
{
title: "HBV in Pregnancy",
items: [
"Universal HBV screening of ALL pregnant women",
"Most transmission occurs at delivery (neonatal immune system cannot clear virus)",
"HBeAg+ mothers: highest perinatal transmission rates",
"Prevention: Neonatal HBsAg vaccine + HBIG within 12h of birth → 85–95% protection",
"If maternal HBV DNA >200,000 IU/mL: add Tenofovir in 3rd trimester",
"Breastfeeding: allowed if infant vaccinated + HBIG",
],
},
{
title: "HEV in Pregnancy",
items: [
"3rd trimester: fulminant hepatic failure — mortality up to 20%",
"Intrauterine fetal death, preterm delivery, neonatal hepatitis",
"No therapy prevents vertical transmission",
"Avoid travel to endemic areas during monsoon season",
],
},
{
title: "Immunosuppressed Patients",
items: [
"HBV reactivation risk: rituximab, steroids, TNF-α inhibitors, chemotherapy",
"Prophylactic entecavir/tenofovir before immunosuppression in ALL HBsAg+ patients",
"Occult HBV (HBsAg–/Anti-HBc+): monitor HBV DNA; consider prophylaxis for high-risk agents",
"Chronic HEV (Gt 3): treat with ribavirin ± IFN; reduce immunosuppression",
],
},
];
const colW = 3.05;
sp.forEach((col, i) => {
const bx = 0.3 + i * 3.23;
s.addShape(pres.shapes.RECTANGLE, { x: bx, y: 1.12, w: colW, h: 0.34, fill: { color: C.teal }, line: { color: C.teal } });
s.addText(col.title, { x: bx, y: 1.12, w: colW, h: 0.34, fontSize: 10.5, bold: true, color: C.white, fontFace: FONT, align: "center", valign: "middle", margin: 0 });
const arr = col.items.map((t, pi) => ({
text: t,
options: { bullet: { code: "25CF", color: C.gold }, breakLine: pi < col.items.length - 1, fontSize: 10.5, color: C.offWhite, fontFace: FONT, paraSpaceAfter: 3 },
}));
s.addText(arr, { x: bx + 0.05, y: 1.5, w: colW - 0.1, h: 3.6, valign: "top" });
});
addFooter(s, "Source: Sleisenger & Fordtran's GI and Liver Disease");
}
// ═══════════════════════════════════════════════
// SLIDE 18 – PREVENTION SUMMARY
// ═══════════════════════════════════════════════
{
const s = pres.addSlide();
darkSlide(s);
addHeader(s, "Prevention Summary");
addTable(s,
["Virus", "Vaccine", "Post-Exposure Prophylaxis", "Other Measures"],
[
["HAV", "Yes — 2-dose (since 1995)", "Vaccine within 2 wks; IG for immunocompromised", "Safe water; hand hygiene; sanitation"],
["HBV", "Yes — 3-dose (since 1982)\nUniversal infant vaccination", "HBIG + vaccine within 24h\n(needlestick/sexual/neonatal)", "Safe sex; needle exchange; universal infant vaccination"],
["HCV", "NO vaccine available", "No effective PEP", "Harm reduction; needle exchange; blood screening; DAA treatment as prevention"],
["HDV", "Prevented by HBV vaccination (no separate vaccine)", "HBV PEP prevents HDV", "Same as HBV prevention"],
["HEV", "Yes — Hecolin® (China only)", "None established", "Safe water; fully cook pork/poultry; pregnant women avoid endemic areas"],
],
{ y: 1.12, fontSize: 10.5 }
);
s.addText("HBV vaccination is one of the world's most effective anti-cancer vaccines — it prevents hepatocellular carcinoma", {
x: 0.3, y: 4.78, w: 9.4, h: 0.35,
fontSize: 11, color: C.navy, bold: true, fontFace: FONT,
fill: { color: C.gold }, margin: 5,
});
addFooter(s, "Viral Hepatitis – Internal Medicine Grand Rounds");
}
// ═══════════════════════════════════════════════
// SLIDE 19 – CLINICAL APPROACH ALGORITHM
// ═══════════════════════════════════════════════
{
const s = pres.addSlide();
darkSlide(s);
addHeader(s, "Clinical Approach: Elevated Liver Enzymes / Jaundice");
const steps = [
{ n: "1", label: "History", detail: "Exposures: travel, shellfish, IDU, sexual contacts, tattoos, blood products; alcohol; medications; family history; pregnancy; HIV status" },
{ n: "2", label: "Exam", detail: "Jaundice, hepatomegaly, splenomegaly, spider nevi, asterixis (encephalopathy = ALF alarm)" },
{ n: "3", label: "Initial Labs", detail: "ALT, AST, ALP, GGT, total + direct bilirubin, albumin, PT/INR, CBC, BMP" },
{ n: "4", label: "Viral Serology\n(run simultaneously)", detail: "Anti-HAV IgM | HBsAg, Anti-HBc IgM, HBV DNA | Anti-HCV → if+: HCV RNA + genotype | Anti-HDV (if HBsAg+) | Anti-HEV IgM (endemic exposure / pregnancy)" },
{ n: "5", label: "Assess Severity", detail: "INR >1.5 + encephalopathy → ACUTE LIVER FAILURE protocol; consider transplant listing within 24h" },
{ n: "6", label: "Manage", detail: "Targeted antiviral therapy per etiology + supportive care + specialist referral" },
];
steps.forEach((step, i) => {
const bx = 0.3;
const by = 1.12 + i * 0.69;
s.addShape(pres.shapes.RECTANGLE, { x: bx, y: by, w: 0.55, h: 0.55, fill: { color: C.gold }, line: { color: C.gold } });
s.addText(step.n, { x: bx, y: by, w: 0.55, h: 0.55, fontSize: 16, bold: true, color: C.navy, fontFace: FONT, align: "center", valign: "middle", margin: 0 });
s.addShape(pres.shapes.RECTANGLE, { x: 0.9, y: by, w: 1.6, h: 0.55, fill: { color: C.teal }, line: { color: C.teal } });
s.addText(step.label, { x: 0.9, y: by, w: 1.6, h: 0.55, fontSize: 10.5, bold: true, color: C.white, fontFace: FONT, align: "center", valign: "middle", margin: 0 });
s.addText(step.detail, { x: 2.55, y: by, w: 7.15, h: 0.55, fontSize: 10, color: C.offWhite, fontFace: FONT, valign: "middle" });
});
addFooter(s, "Viral Hepatitis – Internal Medicine Grand Rounds");
}
// ═══════════════════════════════════════════════
// SLIDE 20 – SUMMARY & KEY TAKEAWAYS
// ═══════════════════════════════════════════════
{
const s = pres.addSlide();
darkSlide(s);
addHeader(s, "Key Takeaways");
const pts = [
["HAV & HEV:", "Fecal-oral, self-limited; no chronic infection in immunocompetent — but HEV in 3rd trimester pregnancy = 20% mortality"],
["HBV:", "300M carriers; perinatal → 90% chronic; treat with TDF or ETV (high resistance barrier); vaccine prevents HBV AND HDV"],
["HCV:", "80–90% chronicity; now CURABLE >95% with 8–12 weeks of DAA therapy; no vaccine; screen everyone 18–79"],
["HDV:", "Defective virus requiring HBV; superinfection = worst prognosis (cirrhosis 70–80%); HBV vaccination is the ultimate prevention"],
["HEV:", "Self-limited in immunocompetent; chronic in immunosuppressed (ribavirin); devastating in pregnancy"],
["Complications:", "Fulminant failure → transplant emergency (Status 1, list in 24h); Cirrhosis; HCC → ultrasound ± AFP q6 months surveillance"],
["Screen:", "CDC: universal HCV testing ages 18–79; HBsAg in high-risk groups; screen for HBV before starting HCV DAAs"],
];
const textArr = [];
pts.forEach(([label, text], i) => {
textArr.push({ text: label + " ", options: { bold: true, color: C.gold, fontSize: 13, fontFace: FONT } });
textArr.push({ text, options: { color: C.offWhite, fontSize: 13, fontFace: FONT, breakLine: i < pts.length - 1, paraSpaceAfter: 4 } });
});
s.addText(textArr, { x: 0.4, y: bodyY(), w: 9.2, h: bodyH(), valign: "top" });
addFooter(s, "Viral Hepatitis – Internal Medicine Grand Rounds | Sources: Robbins & Kumar, Katzung, Yamada's, Goldman-Cecil, Sleisenger & Fordtran's");
}
// ─────────────────────────────────────────────
// WRITE FILE
// ─────────────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/workspace/viral-hepatitis-ppt/ViralHepatitis_InternalMedicine.pptx" })
.then(() => console.log("✅ Saved: /home/daytona/workspace/viral-hepatitis-ppt/ViralHepatitis_InternalMedicine.pptx"))
.catch(e => console.error("❌ Error:", e));