Treatment of hepatic encephalopathy based on harrison's

Reading File
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Reading File
Reading File
I now have all the content needed. Here is the full Harrison's-based answer:

Treatment of Hepatic Encephalopathy

Harrison's Principles of Internal Medicine, 22nd Edition (2025)

Pathophysiology (Brief)

Gut-derived neurotoxins - not cleared by the liver due to vascular shunting and decreased hepatic mass - reach the brain and produce the symptoms of hepatic encephalopathy. Ammonia is the key toxin, but ammonia levels correlate poorly with symptom severity; most hepatologists do not use ammonia levels to guide diagnosis or monitor progress. Other contributors include false neurotransmitters and mercaptans.

1. Identify and Correct Precipitating Factors (First Priority)

In patients with cirrhosis, encephalopathy is usually triggered by an identifiable precipitant. Harrison's lists the most common ones:
PrecipitantAction
Volume depletionAppropriate hydration
GI bleedingIdentify and treat bleeding source
HyponatremiaCorrect electrolytes
Infection (including SBP)Tap ascites to rule out infection; treat with antibiotics
ConstipationCatharsis
Sometimes, hydration and correction of electrolyte imbalance alone are sufficient to resolve encephalopathy.

2. Dietary Protein - Do NOT Restrict

Historically, protein restriction was used. Harrison's 22E strongly discourages this practice. The negative nutritional impact outweighs any benefit. Adequate protein intake is important, especially given the high risk of sarcopenia in cirrhosis.

3. Lactulose (Mainstay of Treatment)

  • Mechanism: Lactulose is a non-absorbable disaccharide that causes colonic acidification (lowers luminal pH), which traps ammonia as NH4+ and promotes its elimination in stool. Catharsis further reduces nitrogenous substrate in the gut.
  • Goal: 2-3 soft stools per day.
  • Dosing: Patients self-titrate their lactulose dose to achieve this target.
  • Duration: Lactulose is typically continued after the initial episode (long-term secondary prevention).

4. Poorly Absorbed Antibiotics (Adjunctive Therapy)

Used in patients who:
  • Have difficulty tolerating lactulose, OR
  • Have recurrent episodes of encephalopathy
Harrison's specifically mentions rifaximin as the best-studied agent. Rifaximin acts by decreasing the production of ammonia and other gut-derived toxins by intestinal bacteria.
"Rifaximin, in a dose of 550 mg twice daily, has been shown to be superior to placebo, in addition to lactulose, in preventing recurrent bouts of hepatic encephalopathy."
  • Harrison's, p. 2760

5. Special Considerations by Setting

Acute Liver Failure (ALF)

  • Encephalopathy in ALF can be associated with life-threatening cerebral edema - a feature not seen in chronic liver disease.
  • Treatment of cerebral edema: hypertonic saline or mannitol.
  • Cerebral herniation is the feared complication.

Chronic Liver Disease / Cirrhosis

  • Focus is on identifying precipitants and initiating lactulose ± rifaximin.
  • Patients who have experienced an episode often learn to self-medicate at early signs of recurrence.

6. Liver Transplantation

For patients with recurrent or refractory hepatic encephalopathy as part of decompensated cirrhosis or ACLF (acute-on-chronic liver failure), Harrison's recommends immediate referral for liver transplantation evaluation, as this is the definitive treatment.

Summary Table

InterventionRoleNotes
Treat precipitating causeFirst-line, alwaysVolume, infection, GI bleed, electrolytes
Protein restrictionContraindicatedWorsens malnutrition/sarcopenia
LactuloseMainstayTarget 2-3 soft stools/day; long-term use
Rifaximin 550 mg BIDAdjunct / recurrence preventionSuperior to placebo when added to lactulose
Hypertonic saline / mannitolFor cerebral edema in ALF onlyNot applicable in chronic liver disease
Liver transplantationDefinitiveIndicated in refractory/recurrent HE

Source: Harrison's Principles of Internal Medicine 22E (2025), Chapter on Cirrhosis and Its Complications, pp. 2759-2760.

Create a treatment algorithm poster for hepatic encephalopathy management

Generating Image

A clean, professional medical treatment algorithm poster for Hepatic Encephalopathy Management based on Harrison's Principles of Internal Medicine. The poster should have: - Title at top: "HEPATIC ENCEPHALOPATHY: Treatment Algorithm" with a subtitle "Based on Harrison's Principles of Internal Medicine 22E" - A flowchart/algorithm with the following steps in order: STEP 1 (top box, red/orange): "DIAGNOSE HEPATIC ENCEPHALOPATHY - Clinical diagnosis: altered mental status + liver disease - Check for asterixis (liver flap) - Rule out alternative causes" STEP 2 (yellow box): "IDENTIFY & CORRECT PRECIPITATING FACTORS" with 5 sub-boxes in a row: "Volume Depletion → Hydrate", "GI Bleeding → Treat", "Infection/SBP → Tap ascites + Antibiotics", "Electrolyte Abnormalities → Correct", "Constipation → Catharsis" STEP 3 (green box): "ACUTE LIVER FAILURE?" with two branches - YES branch (red): "Cerebral edema risk → Hypertonic saline or Mannitol" and NO branch: Continue to Step 4 STEP 4 (blue box, main treatment): "MAINSTAY TREATMENT: LACTULOSE (Non-absorbable disaccharide) - Goal: 2-3 soft stools/day - Patient self-titrates dose - Continue long-term after first episode - Mechanism: colonic acidification → traps NH3 as NH4+" STEP 5 (purple box): "RECURRENT or REFRACTORY EPISODES? Add RIFAXIMIN 550 mg twice daily (superior to placebo when added to lactulose)" IMPORTANT NOTE box (red border): "❌ DO NOT restrict dietary protein — worsens malnutrition and sarcopenia" STEP 6 (dark blue box at bottom): "REFRACTORY HE → Refer for LIVER TRANSPLANTATION (Definitive treatment)" Use color-coded boxes, arrows connecting each step, clean medical typography, white background, professional clinical design suitable for a hospital ward.

Here is your treatment algorithm poster for Hepatic Encephalopathy management:
Hepatic Encephalopathy Treatment Algorithm
The poster covers the full management pathway from Harrison's 22E:
  1. Diagnose HE - clinical diagnosis with asterixis
  2. Identify and correct precipitants - the 5 key triggers (volume depletion, GI bleed, infection/SBP, electrolyte abnormalities, constipation)
  3. Branch for Acute Liver Failure - cerebral edema managed with hypertonic saline or mannitol
  4. Lactulose as the mainstay treatment (goal: 2-3 soft stools/day)
  5. Rifaximin 550 mg BID added for recurrent/refractory episodes
  6. No protein restriction warning (strongly discouraged per Harrison's)
  7. Liver transplantation for definitive/refractory cases

Ascites ppt based on harrison's

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

mkdir -p /home/daytona/workspace/ascites-ppt && ls /home/daytona/workspace/ascit…

Writing File

~/ascites-ppt/create_ascites_ppt.js

const pptxgen = require("pptxgenjs");

const pres = new pptxgen();
pres.layout = "LAYOUT_WIDE"; // 13.3" x 7.5"
pres.title = "Ascites - Harrison's Principles of Internal Medicine 22E";
pres.author = "Harrison's PMI 22E";

// ─── COLOR PALETTE ───────────────────────────────────────────────────────────
const DARK_BLUE   = "0D2B55";   // dominant navy
const MED_BLUE    = "1565C0";   // accent
const LIGHT_BLUE  = "E3F0FC";   // slide bg tint
const TEAL        = "00796B";   // subheadings
const ORANGE      = "E65100";   // warnings / highlights
const WHITE       = "FFFFFF";
const LIGHT_GRAY  = "F4F7FB";
const MEDIUM_GRAY = "90A4AE";
const DARK_TEXT   = "1A2A3A";
const ACCENT_RED  = "C62828";
const ACCENT_GOLD = "F9A825";

// ─── HELPER: Slide header band ────────────────────────────────────────────────
function addHeader(slide, title, subtitle) {
  // Dark blue top bar
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 0, w: 13.3, h: 1.0,
    fill: { color: DARK_BLUE }, line: { color: DARK_BLUE }
  });
  // Accent line
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 1.0, w: 13.3, h: 0.06,
    fill: { color: ACCENT_GOLD }, line: { color: ACCENT_GOLD }
  });
  // Title
  slide.addText(title, {
    x: 0.35, y: 0.08, w: 10, h: 0.55,
    fontSize: 22, bold: true, color: WHITE, fontFace: "Calibri", margin: 0
  });
  if (subtitle) {
    slide.addText(subtitle, {
      x: 0.35, y: 0.63, w: 10, h: 0.35,
      fontSize: 11, color: ACCENT_GOLD, fontFace: "Calibri", margin: 0, italic: true
    });
  }
  // Harrison's badge top right
  slide.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x: 11.2, y: 0.18, w: 1.85, h: 0.62,
    fill: { color: MED_BLUE }, line: { color: MED_BLUE }, rectRadius: 0.08
  });
  slide.addText("Harrison's 22E", {
    x: 11.2, y: 0.18, w: 1.85, h: 0.62,
    fontSize: 9, bold: true, color: WHITE, align: "center", valign: "middle", fontFace: "Calibri", margin: 0
  });
}

// ─── HELPER: Colored box with title + bullets ─────────────────────────────────
function addContentBox(slide, x, y, w, h, headerColor, headerText, bullets, fontSize) {
  fontSize = fontSize || 12;
  // Header bar
  slide.addShape(pres.shapes.RECTANGLE, {
    x, y, w, h: 0.42,
    fill: { color: headerColor }, line: { color: headerColor }
  });
  slide.addText(headerText, {
    x: x + 0.12, y, w: w - 0.15, h: 0.42,
    fontSize: 13, bold: true, color: WHITE, fontFace: "Calibri", valign: "middle", margin: 0
  });
  // Body
  slide.addShape(pres.shapes.RECTANGLE, {
    x, y: y + 0.42, w, h: h - 0.42,
    fill: { color: LIGHT_GRAY }, line: { color: headerColor, pt: 1.5 }
  });
  const items = bullets.map((b, i) => ({
    text: b,
    options: { bullet: true, breakLine: i < bullets.length - 1, fontSize, color: DARK_TEXT, fontFace: "Calibri" }
  }));
  slide.addText(items, {
    x: x + 0.15, y: y + 0.48, w: w - 0.3, h: h - 0.58,
    valign: "top"
  });
}

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 1 — TITLE SLIDE
// ─────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  // Full background
  s.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 0, w: 13.3, h: 7.5, fill: { color: DARK_BLUE }, line: { color: DARK_BLUE }
  });
  // Decorative stripe
  s.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 3.9, w: 13.3, h: 0.09, fill: { color: ACCENT_GOLD }, line: { color: ACCENT_GOLD }
  });
  s.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 4.05, w: 13.3, h: 0.04, fill: { color: MED_BLUE }, line: { color: MED_BLUE }
  });

  s.addText("ASCITES", {
    x: 0.8, y: 1.2, w: 11.7, h: 1.5,
    fontSize: 72, bold: true, color: WHITE, align: "center", fontFace: "Calibri",
    charSpacing: 12
  });
  s.addText("A Comprehensive Clinical Review", {
    x: 0.8, y: 2.8, w: 11.7, h: 0.6,
    fontSize: 22, color: ACCENT_GOLD, align: "center", fontFace: "Calibri", italic: true
  });
  s.addText("Based on Harrison's Principles of Internal Medicine, 22nd Edition (2025)", {
    x: 1.5, y: 4.3, w: 10.3, h: 0.5,
    fontSize: 14, color: MEDIUM_GRAY, align: "center", fontFace: "Calibri"
  });
  s.addText("Gastroenterology & Hepatology", {
    x: 1.5, y: 4.95, w: 10.3, h: 0.4,
    fontSize: 13, color: WHITE, align: "center", fontFace: "Calibri", bold: true
  });

  // Bottom footnote
  s.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 7.1, w: 13.3, h: 0.4, fill: { color: "0A1F3C" }, line: { color: "0A1F3C" }
  });
  s.addText("Harrison's Principles of Internal Medicine 22E  |  Chapter 355: Cirrhosis and Its Complications", {
    x: 0.3, y: 7.1, w: 12.7, h: 0.4,
    fontSize: 9, color: MEDIUM_GRAY, align: "center", fontFace: "Calibri"
  });
}

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 2 — OVERVIEW & OUTLINE
// ─────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  s.addShape(pres.shapes.RECTANGLE, { x:0,y:0,w:13.3,h:7.5, fill:{color:LIGHT_BLUE}, line:{color:LIGHT_BLUE}});
  addHeader(s, "Overview", "Key topics covered in this presentation");

  const topics = [
    { num: "01", title: "Definition & Pathogenesis", color: MED_BLUE },
    { num: "02", title: "Clinical Features", color: TEAL },
    { num: "03", title: "Diagnosis & SAAG", color: "6A1B9A" },
    { num: "04", title: "Treatment of Ascites", color: ORANGE },
    { num: "05", title: "Spontaneous Bacterial Peritonitis (SBP)", color: ACCENT_RED },
    { num: "06", title: "Hepatorenal Syndrome (HRS)", color: "37474F" },
    { num: "07", title: "Refractory Ascites", color: MED_BLUE },
  ];

  topics.forEach((t, i) => {
    const col = i < 4 ? 0 : 1;
    const row = i < 4 ? i : i - 4;
    const x = col === 0 ? 0.6 : 7.2;
    const y = 1.35 + row * 1.35;
    const w = col === 0 ? 6.0 : 5.8;

    s.addShape(pres.shapes.RECTANGLE, {
      x, y, w, h: 1.1,
      fill: { color: t.color }, line: { color: t.color },
      shadow: { type: "outer", color: "000000", blur: 6, offset: 2, angle: 135, opacity: 0.15 }
    });
    s.addText(t.num, {
      x: x + 0.1, y, w: 0.6, h: 1.1,
      fontSize: 28, bold: true, color: WHITE, valign: "middle", align: "center", fontFace: "Calibri", margin: 0
    });
    s.addShape(pres.shapes.RECTANGLE, {
      x: x + 0.7, y, w: 0.04, h: 1.1, fill: { color: WHITE, transparency: 40 }, line: { color: WHITE, transparency: 40 }
    });
    s.addText(t.title, {
      x: x + 0.85, y, w: w - 0.95, h: 1.1,
      fontSize: 16, bold: true, color: WHITE, valign: "middle", fontFace: "Calibri", margin: 0
    });
  });
}

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 3 — DEFINITION & PATHOGENESIS
// ─────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  s.addShape(pres.shapes.RECTANGLE, { x:0,y:0,w:13.3,h:7.5, fill:{color:LIGHT_BLUE}, line:{color:LIGHT_BLUE}});
  addHeader(s, "Definition & Pathogenesis", "How ascites develops in cirrhosis");

  // Definition box
  s.addShape(pres.shapes.RECTANGLE, {
    x: 0.4, y: 1.25, w: 12.5, h: 0.85,
    fill: { color: DARK_BLUE }, line: { color: DARK_BLUE }
  });
  s.addText([
    { text: "DEFINITION:  ", options: { bold: true, color: ACCENT_GOLD, fontSize: 13 } },
    { text: "Ascites is the accumulation of fluid within the peritoneal cavity. The most common cause is ", options: { color: WHITE, fontSize: 13 } },
    { text: "portal hypertension related to cirrhosis", options: { bold: true, color: ACCENT_GOLD, fontSize: 13 } },
    { text: "; malignant, infectious, and cardiac causes must also be considered.", options: { color: WHITE, fontSize: 13 } }
  ], { x: 0.6, y: 1.28, w: 12.1, h: 0.79, valign: "middle", fontFace: "Calibri" });

  // Pathogenesis steps
  const steps = [
    { label: "1", title: "↑ Intrahepatic Resistance", desc: "→ Increased portal pressure", color: MED_BLUE },
    { label: "2", title: "Splanchnic Vasodilation", desc: "Nitric oxide → ↑ portal venous inflow", color: TEAL },
    { label: "3", title: "RAAS Activation", desc: "Hyperaldosteronism + sympathetic activation → Na⁺ retention", color: "6A1B9A" },
    { label: "4", title: "Fluid Accumulation", desc: "↓ Oncotic pressure (hypoalbuminemia) → peritoneal fluid", color: ORANGE },
  ];

  steps.forEach((st, i) => {
    const x = 0.4 + i * 3.15;
    s.addShape(pres.shapes.RECTANGLE, {
      x, y: 2.35, w: 3.0, h: 0.62,
      fill: { color: st.color }, line: { color: st.color }
    });
    s.addText(`${st.label}. ${st.title}`, {
      x: x + 0.1, y: 2.35, w: 2.8, h: 0.62,
      fontSize: 12, bold: true, color: WHITE, valign: "middle", fontFace: "Calibri", margin: 0
    });
    s.addShape(pres.shapes.RECTANGLE, {
      x, y: 2.97, w: 3.0, h: 0.85,
      fill: { color: LIGHT_GRAY }, line: { color: st.color, pt: 1.5 }
    });
    s.addText(st.desc, {
      x: x + 0.1, y: 2.97, w: 2.8, h: 0.85,
      fontSize: 11, color: DARK_TEXT, valign: "middle", fontFace: "Calibri", margin: 0
    });
    // Arrow between boxes
    if (i < 3) {
      s.addText("→", {
        x: x + 3.0, y: 2.55, w: 0.15, h: 0.45,
        fontSize: 18, bold: true, color: MED_BLUE, align: "center", valign: "middle", margin: 0
      });
    }
  });

  // Result
  s.addShape(pres.shapes.RECTANGLE, {
    x: 0.4, y: 4.05, w: 12.5, h: 0.55,
    fill: { color: ACCENT_RED }, line: { color: ACCENT_RED }
  });
  s.addText("NET RESULT: Fluid constantly leaks into the peritoneal cavity; vascular filling is never achieved — the cycle continues.", {
    x: 0.55, y: 4.05, w: 12.2, h: 0.55,
    fontSize: 12, bold: true, color: WHITE, valign: "middle", fontFace: "Calibri", margin: 0
  });

  // Grades
  s.addText("Grading of Ascites", {
    x: 0.4, y: 4.8, w: 12.5, h: 0.4,
    fontSize: 14, bold: true, color: DARK_BLUE, fontFace: "Calibri"
  });
  const grades = [
    { g: "Grade 1", d: "Detectable only by ultrasonography", c: TEAL },
    { g: "Grade 2", d: "Detectable on physical examination (shifting dullness)", c: MED_BLUE },
    { g: "Grade 3", d: "Marked abdominal distension (massive)", c: ACCENT_RED },
  ];
  grades.forEach((gr, i) => {
    const x = 0.4 + i * 4.2;
    s.addShape(pres.shapes.RECTANGLE, { x, y: 5.2, w: 4.0, h: 0.42, fill:{color: gr.c}, line:{color: gr.c}});
    s.addText(gr.g, { x: x+0.1, y: 5.2, w: 3.8, h: 0.42, fontSize: 13, bold: true, color: WHITE, valign: "middle", fontFace: "Calibri", margin:0 });
    s.addShape(pres.shapes.RECTANGLE, { x, y: 5.62, w: 4.0, h: 0.65, fill:{color: LIGHT_GRAY}, line:{color: gr.c, pt:1.5}});
    s.addText(gr.d, { x: x+0.1, y: 5.62, w: 3.8, h: 0.65, fontSize: 11, color: DARK_TEXT, valign: "middle", fontFace: "Calibri", margin:0 });
  });

  // Footer
  s.addText("Harrison's Principles of Internal Medicine 22E  |  Chapter 355", {
    x: 0, y: 7.15, w: 13.3, h: 0.35, fontSize: 8, color: MEDIUM_GRAY, align: "center", fontFace: "Calibri"
  });
}

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 4 — CLINICAL FEATURES & DIAGNOSIS
// ─────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  s.addShape(pres.shapes.RECTANGLE, { x:0,y:0,w:13.3,h:7.5, fill:{color:LIGHT_BLUE}, line:{color:LIGHT_BLUE}});
  addHeader(s, "Clinical Features & Diagnosis", "Symptoms, signs, and diagnostic workup");

  // Left column - Clinical Features
  addContentBox(s, 0.35, 1.25, 5.9, 3.0, MED_BLUE, "Clinical Features", [
    "Increasing abdominal girth (often insidious)",
    "Peripheral edema accompanying fluid accumulation",
    "At least 1–2 L needed before patient notices",
    "Dyspnea if ascites is massive (diaphragm pressure)",
    "Hepatic hydrothorax — more common on the right",
    "Muscle wasting, fatigue, and weakness in massive ascites",
    "Bulging flanks on examination",
    "Fluid wave or shifting dullness on percussion",
  ], 11);

  // Right column - Diagnosis
  addContentBox(s, 6.6, 1.25, 6.35, 3.0, TEAL, "Diagnostic Workup", [
    "Physical exam: shifting dullness, fluid wave",
    "Ultrasound/CT: detect subtle amounts",
    "Diagnostic paracentesis recommended on first presentation",
    "Ascitic fluid: total protein, albumin, cell count + differential, cultures",
    "In cirrhosis: protein usually <2.5 g/dL",
    "Amylase if pancreatic ascites suspected; cytology if malignancy suspected",
    "Bedside blood culture bottles for cultures (higher yield)",
  ], 11);

  // SAAG section
  s.addShape(pres.shapes.RECTANGLE, {
    x: 0.35, y: 4.45, w: 12.6, h: 0.42,
    fill: { color: "6A1B9A" }, line: { color: "6A1B9A" }
  });
  s.addText("SERUM ASCITES-ALBUMIN GRADIENT (SAAG)", {
    x: 0.5, y: 4.45, w: 12.3, h: 0.42,
    fontSize: 14, bold: true, color: WHITE, valign: "middle", fontFace: "Calibri", margin: 0
  });

  // SAAG formula
  s.addShape(pres.shapes.RECTANGLE, {
    x: 0.35, y: 4.87, w: 3.4, h: 0.75,
    fill: { color: WHITE }, line: { color: "6A1B9A", pt: 2 }
  });
  s.addText("SAAG = Serum Albumin − Ascitic Fluid Albumin", {
    x: 0.45, y: 4.87, w: 3.3, h: 0.75,
    fontSize: 11, bold: true, color: "6A1B9A", valign: "middle", align: "center", fontFace: "Calibri", margin: 0
  });

  const saagData = [
    { label: "SAAG ≥ 1.1 g/dL", title: "Portal Hypertension", examples: "Cirrhosis, cardiac ascites, Budd-Chiari, portal vein thrombosis", color: MED_BLUE },
    { label: "SAAG < 1.1 g/dL", title: "Non-Portal Hypertension", examples: "Malignancy, TB peritonitis, pancreatic ascites, nephrotic syndrome", color: ACCENT_RED },
  ];
  saagData.forEach((d, i) => {
    const x = 4.0 + i * 4.45;
    s.addShape(pres.shapes.RECTANGLE, { x, y: 4.87, w: 4.25, h: 0.42, fill:{color: d.color}, line:{color: d.color}});
    s.addText(`${d.label}  →  ${d.title}`, { x: x+0.1, y: 4.87, w: 4.1, h: 0.42, fontSize: 12, bold: true, color: WHITE, valign: "middle", fontFace: "Calibri", margin: 0});
    s.addShape(pres.shapes.RECTANGLE, { x, y: 5.29, w: 4.25, h: 0.33, fill:{color: LIGHT_GRAY}, line:{color: d.color, pt:1.5}});
    s.addText(`e.g. ${d.examples}`, { x: x+0.1, y: 5.29, w: 4.1, h: 0.33, fontSize: 9, color: DARK_TEXT, valign: "middle", fontFace: "Calibri", margin: 0});
  });

  s.addText("Sensitivity and specificity of SAAG ≥ 1.1 for portal hypertension: ~97%", {
    x: 0.35, y: 5.75, w: 12.6, h: 0.35,
    fontSize: 11, color: "6A1B9A", bold: true, fontFace: "Calibri"
  });

  s.addText("Harrison's Principles of Internal Medicine 22E  |  Chapter 355", {
    x: 0, y: 7.15, w: 13.3, h: 0.35, fontSize: 8, color: MEDIUM_GRAY, align: "center", fontFace: "Calibri"
  });
}

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 5 — TREATMENT OF ASCITES
// ─────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  s.addShape(pres.shapes.RECTANGLE, { x:0,y:0,w:13.3,h:7.5, fill:{color:LIGHT_BLUE}, line:{color:LIGHT_BLUE}});
  addHeader(s, "Treatment of Ascites", "Stepwise management based on Harrison's 22E");

  // Step 1
  s.addShape(pres.shapes.RECTANGLE, { x:0.35, y:1.28, w:12.6, h:0.42, fill:{color:TEAL}, line:{color:TEAL}});
  s.addText("STEP 1: Sodium Restriction — ALL Patients", { x:0.5, y:1.28, w:12.3, h:0.42, fontSize:14, bold:true, color:WHITE, valign:"middle", fontFace:"Calibri", margin:0 });
  s.addShape(pres.shapes.RECTANGLE, { x:0.35, y:1.7, w:12.6, h:0.55, fill:{color:LIGHT_GRAY}, line:{color:TEAL, pt:1.5}});
  s.addText("Restrict dietary sodium to 2 g/day (~¾ tsp salt). Avoid canned/processed foods; prefer fresh or frozen foods. Sodium pamphlets are helpful.", {
    x:0.5, y:1.7, w:12.3, h:0.55, fontSize:12, color:DARK_TEXT, valign:"middle", fontFace:"Calibri", margin:0 });

  // Step 2 - Diuretics
  s.addShape(pres.shapes.RECTANGLE, { x:0.35, y:2.42, w:12.6, h:0.42, fill:{color:MED_BLUE}, line:{color:MED_BLUE}});
  s.addText("STEP 2: Diuretic Therapy — Moderate Ascites", { x:0.5, y:2.42, w:12.3, h:0.42, fontSize:14, bold:true, color:WHITE, valign:"middle", fontFace:"Calibri", margin:0 });

  // Two drug boxes
  const drugs = [
    { name: "Spironolactone", start: "100 mg/day", max: "400 mg/day", notes: "Aldosterone antagonist — inhibits Na⁺ reabsorption in distal tubule. May cause gynecomastia (switch to amiloride 5–40 mg/d), hyperkalemia, hyponatremia", color: "6A1B9A" },
    { name: "Furosemide", start: "40 mg/day", max: "160 mg/day", notes: "Loop diuretic — used in combination with spironolactone at ratio 40:100. Add especially when peripheral edema is present", color: ORANGE },
  ];
  drugs.forEach((d, i) => {
    const x = 0.35 + i * 6.3;
    s.addShape(pres.shapes.RECTANGLE, { x, y:2.84, w:6.1, h:0.38, fill:{color:d.color}, line:{color:d.color}});
    s.addText(d.name, { x:x+0.1, y:2.84, w:5.9, h:0.38, fontSize:13, bold:true, color:WHITE, valign:"middle", fontFace:"Calibri", margin:0});
    s.addShape(pres.shapes.RECTANGLE, { x, y:3.22, w:6.1, h:1.05, fill:{color:LIGHT_GRAY}, line:{color:d.color, pt:1.5}});
    s.addText([
      { text: `Starting dose: ${d.start}  |  Max: ${d.max}\n`, options: { bold: true, fontSize: 11, color: DARK_TEXT } },
      { text: d.notes, options: { fontSize: 10, color: DARK_TEXT } }
    ], { x:x+0.12, y:3.22, w:5.86, h:1.05, valign:"top", fontFace:"Calibri" });
  });

  // Failure note
  s.addShape(pres.shapes.RECTANGLE, { x:0.35, y:4.35, w:12.6, h:0.38, fill:{color:ACCENT_RED, transparency:15}, line:{color:ACCENT_RED}});
  s.addText("⚠  Failure of diuretics → first check dietary compliance. If compliant, escalate doses incrementally to maximum before declaring refractory.", {
    x:0.5, y:4.35, w:12.3, h:0.38, fontSize:11, color:ACCENT_RED, bold:true, valign:"middle", fontFace:"Calibri", margin:0 });

  // Drugs to avoid
  s.addShape(pres.shapes.RECTANGLE, { x:0.35, y:4.85, w:12.6, h:0.38, fill:{color:"37474F"}, line:{color:"37474F"}});
  s.addText("DRUGS TO AVOID in patients with cirrhosis + ascites:", { x:0.5, y:4.85, w:6, h:0.38, fontSize:12, bold:true, color:WHITE, valign:"middle", fontFace:"Calibri", margin:0});
  s.addShape(pres.shapes.RECTANGLE, { x:0.35, y:5.23, w:12.6, h:0.55, fill:{color:LIGHT_GRAY}, line:{color:"37474F", pt:1.5}});
  s.addText("NSAIDs (risk of renal failure)  |  Aminoglycosides (nephrotoxic)  |  ACE inhibitors / ARBs (use with caution — monitor BP and renal function closely)", {
    x:0.5, y:5.23, w:12.3, h:0.55, fontSize:11.5, color:DARK_TEXT, valign:"middle", fontFace:"Calibri", margin:0 });

  // Prognosis note
  s.addShape(pres.shapes.RECTANGLE, { x:0.35, y:5.9, w:12.6, h:0.45, fill:{color:DARK_BLUE}, line:{color:DARK_BLUE}});
  s.addText("Prognosis: <50% of patients survive 2 years after onset of ascites → Consider liver transplantation referral", {
    x:0.5, y:5.9, w:12.3, h:0.45, fontSize:12, color:ACCENT_GOLD, bold:true, valign:"middle", fontFace:"Calibri", margin:0});

  s.addText("Harrison's Principles of Internal Medicine 22E  |  Chapter 355", {
    x:0, y:7.15, w:13.3, h:0.35, fontSize:8, color:MEDIUM_GRAY, align:"center", fontFace:"Calibri" });
}

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 6 — REFRACTORY ASCITES
// ─────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  s.addShape(pres.shapes.RECTANGLE, { x:0,y:0,w:13.3,h:7.5, fill:{color:LIGHT_BLUE}, line:{color:LIGHT_BLUE}});
  addHeader(s, "Refractory Ascites", "Definition, pharmacologic options, and procedural management");

  // Definition
  s.addShape(pres.shapes.RECTANGLE, { x:0.35, y:1.28, w:12.6, h:0.42, fill:{color:ACCENT_RED}, line:{color:ACCENT_RED}});
  s.addText("DEFINITION OF REFRACTORY ASCITES", { x:0.5, y:1.28, w:12.3, h:0.42, fontSize:14, bold:true, color:WHITE, valign:"middle", fontFace:"Calibri", margin:0});
  s.addShape(pres.shapes.RECTANGLE, { x:0.35, y:1.7, w:12.6, h:0.62, fill:{color:LIGHT_GRAY}, line:{color:ACCENT_RED, pt:1.5}});
  s.addText([
    { text: "Diuretic-Resistant: ", options: { bold: true, color: ACCENT_RED } },
    { text: "Persistence of ascites despite sodium restriction + maximum diuretic doses (spiro 400 mg/d + furosemide 160 mg/d)  |  ", options: { color: DARK_TEXT } },
    { text: "Diuretic-Intractable: ", options: { bold: true, color: MED_BLUE } },
    { text: "Development of side effects that preclude maximum doses", options: { color: DARK_TEXT } },
  ], { x:0.5, y:1.7, w:12.3, h:0.62, fontSize:11.5, valign:"middle", fontFace:"Calibri" });

  // Pharmacologic additions
  s.addText("Pharmacologic Additions", { x:0.35, y:2.5, w:5.5, h:0.38, fontSize:13, bold:true, color:DARK_BLUE, fontFace:"Calibri" });
  const drugs2 = [
    { name: "Midodrine", detail: "α1-adrenergic agonist\nCounteracts splanchnic vasodilation\nImproves hemodynamics + ascites control", color: "6A1B9A" },
    { name: "Clonidine", detail: "α2-adrenergic agonist\nUsed alone or combined with midodrine\nFurther reduces sympathetic activity", color: TEAL },
    { name: "⚠ Beta-Blockers", detail: "Often used for variceal prophylaxis\nIn refractory ascites: associated with\nDECREASED SURVIVAL — use with caution", color: ACCENT_RED },
  ];
  drugs2.forEach((d, i) => {
    const x = 0.35 + i * 4.2;
    s.addShape(pres.shapes.RECTANGLE, { x, y:2.9, w:4.0, h:0.38, fill:{color:d.color}, line:{color:d.color}});
    s.addText(d.name, { x:x+0.1, y:2.9, w:3.8, h:0.38, fontSize:12, bold:true, color:WHITE, valign:"middle", fontFace:"Calibri", margin:0});
    s.addShape(pres.shapes.RECTANGLE, { x, y:3.28, w:4.0, h:0.85, fill:{color:LIGHT_GRAY}, line:{color:d.color, pt:1.5}});
    s.addText(d.detail, { x:x+0.1, y:3.28, w:3.8, h:0.85, fontSize:10, color:DARK_TEXT, valign:"middle", fontFace:"Calibri", margin:0});
  });

  // Procedural
  s.addText("Procedural Management", { x:0.35, y:4.3, w:8, h:0.38, fontSize:13, bold:true, color:DARK_BLUE, fontFace:"Calibri" });
  const procedures = [
    { name: "Large-Volume Paracentesis (LVP)", detail: "Remove >5 L of ascitic fluid\nMust give IV 25% albumin: 6–8 g/L of ascites removed\nPrevents post-paracentesis circulatory dysfunction and death\nRepeated as needed", color: MED_BLUE },
    { name: "TIPS (Transjugular Intrahepatic Portosystemic Shunt)", detail: "Decompresses hepatic sinusoids\nSuperior to LVP for reaccumulation\nNo mortality benefit over LVP\nAssociated with ↑ hepatic encephalopathy\nConsider case-by-case", color: ORANGE },
    { name: "Liver Transplantation", detail: "Definitive treatment\nConsidered in all patients with ascites given poor prognosis (<50% survive 2 years)\nEvaluation should begin early", color: DARK_BLUE },
  ];
  procedures.forEach((p, i) => {
    const x = 0.35 + i * 4.3;
    s.addShape(pres.shapes.RECTANGLE, { x, y:4.72, w:4.1, h:0.45, fill:{color:p.color}, line:{color:p.color}});
    s.addText(p.name, { x:x+0.1, y:4.72, w:3.9, h:0.45, fontSize:10.5, bold:true, color:WHITE, valign:"middle", fontFace:"Calibri", margin:0});
    s.addShape(pres.shapes.RECTANGLE, { x, y:5.17, w:4.1, h:1.5, fill:{color:LIGHT_GRAY}, line:{color:p.color, pt:1.5}});
    s.addText(p.detail, { x:x+0.12, y:5.17, w:3.86, h:1.5, fontSize:10, color:DARK_TEXT, valign:"top", fontFace:"Calibri", margin:0});
  });

  s.addText("Harrison's Principles of Internal Medicine 22E  |  Chapter 355", {
    x:0, y:7.15, w:13.3, h:0.35, fontSize:8, color:MEDIUM_GRAY, align:"center", fontFace:"Calibri" });
}

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 7 — SPONTANEOUS BACTERIAL PERITONITIS (SBP)
// ─────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  s.addShape(pres.shapes.RECTANGLE, { x:0,y:0,w:13.3,h:7.5, fill:{color:LIGHT_BLUE}, line:{color:LIGHT_BLUE}});
  addHeader(s, "Spontaneous Bacterial Peritonitis (SBP)", "A common and life-threatening complication of ascites");

  // Key stats
  const stats = [
    { val: "~30%", label: "Incidence in hospitalized cirrhosis patients", color: ACCENT_RED },
    { val: "25%", label: "In-hospital mortality rate", color: ORANGE },
    { val: ">250", label: "Neutrophils/μL in ascitic fluid = diagnostic threshold", color: MED_BLUE },
  ];
  stats.forEach((st, i) => {
    const x = 0.35 + i * 4.3;
    s.addShape(pres.shapes.RECTANGLE, { x, y:1.28, w:4.1, h:0.85, fill:{color:st.color}, line:{color:st.color}});
    s.addText(st.val, { x, y:1.28, w:4.1, h:0.5, fontSize:26, bold:true, color:WHITE, align:"center", valign:"middle", fontFace:"Calibri", margin:0});
    s.addText(st.label, { x:x+0.1, y:1.73, w:3.9, h:0.4, fontSize:9.5, color:WHITE, align:"center", fontFace:"Calibri", margin:0});
  });

  // Left - Pathogenesis + Organisms
  addContentBox(s, 0.35, 2.35, 6.0, 2.6, "37474F", "Pathogenesis & Organisms", [
    "Mechanism: bacterial translocation — gut flora traverse intestine into mesenteric lymph nodes → bacteremia → seeding of ascitic fluid",
    "Most common: Escherichia coli and other gram-negative gut bacteria",
    "Gram-positive: Streptococcus viridans, Staphylococcus aureus, Enterococcus spp.",
    "If >2 organisms identified → suspect secondary peritonitis (perforated viscus)",
  ], 11);

  // Right - Clinical Features
  addContentBox(s, 6.7, 2.35, 6.25, 2.6, TEAL, "Clinical Presentation (may be subtle!)", [
    "Fever",
    "Abdominal pain or discomfort",
    "Altered mental status",
    "Elevated WBC count",
    "Acute kidney injury",
    "⚠ May present without ANY of these features → High clinical suspicion required",
    "Peritoneal tap recommended in all cirrhosis patients hospitalized with ascites",
  ], 11);

  // Treatment
  s.addShape(pres.shapes.RECTANGLE, { x:0.35, y:5.1, w:12.6, h:0.42, fill:{color:MED_BLUE}, line:{color:MED_BLUE}});
  s.addText("TREATMENT", { x:0.5, y:5.1, w:12.3, h:0.42, fontSize:14, bold:true, color:WHITE, valign:"middle", fontFace:"Calibri", margin:0});

  const txts = [
    { t: "Antibiotic", d: "IV 3rd-generation cephalosporin × 5 days\n(Cefotaxime / Ceftriaxone)" , c: MED_BLUE},
    { t: "Albumin (mandatory)", d: "IV Albumin:\n  Day 1: 1.5 g/kg body weight\n  Day 3: 1.0 g/kg body weight\nReduces renal failure & improves survival", c: TEAL},
    { t: "Prophylaxis", d: "GI bleeding: SBP prophylaxis at presentation\nPost-SBP: Quinolone antibiotic long-term to prevent recurrence", c: "6A1B9A"},
  ];
  txts.forEach((t, i) => {
    const x = 0.35 + i * 4.3;
    s.addShape(pres.shapes.RECTANGLE, { x, y:5.52, w:4.1, h:0.38, fill:{color:t.c}, line:{color:t.c}});
    s.addText(t.t, { x:x+0.1, y:5.52, w:3.9, h:0.38, fontSize:11, bold:true, color:WHITE, valign:"middle", fontFace:"Calibri", margin:0});
    s.addShape(pres.shapes.RECTANGLE, { x, y:5.9, w:4.1, h:1.0, fill:{color:LIGHT_GRAY}, line:{color:t.c, pt:1.5}});
    s.addText(t.d, { x:x+0.1, y:5.9, w:3.9, h:1.0, fontSize:10, color:DARK_TEXT, valign:"top", fontFace:"Calibri", margin:0});
  });

  s.addText("Harrison's Principles of Internal Medicine 22E  |  Chapter 355", {
    x:0, y:7.15, w:13.3, h:0.35, fontSize:8, color:MEDIUM_GRAY, align:"center", fontFace:"Calibri" });
}

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 8 — HEPATORENAL SYNDROME
// ─────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  s.addShape(pres.shapes.RECTANGLE, { x:0,y:0,w:13.3,h:7.5, fill:{color:LIGHT_BLUE}, line:{color:LIGHT_BLUE}});
  addHeader(s, "Hepatorenal Syndrome (HRS)", "Functional renal failure in advanced cirrhosis");

  // Definition box
  s.addShape(pres.shapes.RECTANGLE, { x:0.35, y:1.28, w:12.6, h:0.75, fill:{color:DARK_BLUE}, line:{color:DARK_BLUE}});
  s.addText("Functional renal failure without renal pathology; occurs in ~10% of patients with advanced cirrhosis or acute liver failure. Marked renal vasoconstriction + reduced systemic vascular resistance.", {
    x:0.5, y:1.28, w:12.3, h:0.75, fontSize:12, color:WHITE, valign:"middle", fontFace:"Calibri", margin:0});

  // Types
  s.addText("Classification", { x:0.35, y:2.18, w:5, h:0.38, fontSize:13, bold:true, color:DARK_BLUE, fontFace:"Calibri"});
  const types = [
    { type: "HRS-AKI (Type 1 HRS)", def: "Rapid progressive renal impairment\n• Creatinine rise ≥0.3 mg/dL in 48h, OR ≥50% from baseline\n• Poor prognosis", color: ACCENT_RED },
    { type: "HRS-CKD (Type 2 HRS)", def: "Stable reduction in GFR\n• Persistent ↑ creatinine\n• Associated with refractory ascites\n• Relatively better outcome than Type 1", color: ORANGE },
  ];
  types.forEach((t, i) => {
    const x = 0.35 + i * 6.3;
    s.addShape(pres.shapes.RECTANGLE, { x, y:2.58, w:6.1, h:0.42, fill:{color:t.color}, line:{color:t.color}});
    s.addText(t.type, { x:x+0.1, y:2.58, w:5.9, h:0.42, fontSize:12, bold:true, color:WHITE, valign:"middle", fontFace:"Calibri", margin:0});
    s.addShape(pres.shapes.RECTANGLE, { x, y:3.0, w:6.1, h:0.92, fill:{color:LIGHT_GRAY}, line:{color:t.color, pt:1.5}});
    s.addText(t.def, { x:x+0.12, y:3.0, w:5.86, h:0.92, fontSize:11, color:DARK_TEXT, valign:"top", fontFace:"Calibri", margin:0});
  });

  // Diagnosis
  s.addShape(pres.shapes.RECTANGLE, { x:0.35, y:4.1, w:12.6, h:0.42, fill:{color:TEAL}, line:{color:TEAL}});
  s.addText("Diagnosis — Exclusion Required (HRS-AKI)", { x:0.5, y:4.1, w:12.3, h:0.42, fontSize:14, bold:true, color:WHITE, valign:"middle", fontFace:"Calibri", margin:0});
  s.addShape(pres.shapes.RECTANGLE, { x:0.35, y:4.52, w:12.6, h:0.65, fill:{color:LIGHT_GRAY}, line:{color:TEAL, pt:1.5}});
  s.addText("1. Stop diuretics  |  2. Infuse albumin 1 g/kg/day × 48 hrs without improvement  |  3. Exclude intrinsic kidney disease (ATN, AIN, GN) and obstructive uropathy", {
    x:0.5, y:4.52, w:12.3, h:0.65, fontSize:11.5, color:DARK_TEXT, valign:"middle", fontFace:"Calibri", margin:0});

  // Treatment
  s.addShape(pres.shapes.RECTANGLE, { x:0.35, y:5.32, w:12.6, h:0.42, fill:{color:MED_BLUE}, line:{color:MED_BLUE}});
  s.addText("TREATMENT — in order of preference", { x:0.5, y:5.32, w:12.3, h:0.42, fontSize:14, bold:true, color:WHITE, valign:"middle", fontFace:"Calibri", margin:0});
  const hrsTx = [
    { line: "1st Line: Vasoconstrictors", detail: "Terlipressin (preferred) or Norepinephrine (requires ICU monitoring)", c: ACCENT_RED },
    { line: "2nd Line: Midodrine + Octreotide + IV Albumin", detail: "Used in the US (terlipressin availability limited); now considered 3rd line per Harrison's 22E", c: ORANGE },
    { line: "Dialysis / RRT", detail: "If vasoconstrictors fail; bridge to transplant", c: "37474F" },
    { line: "Liver Transplantation", detail: "BEST therapy — recovery of renal function typical", c: DARK_BLUE },
  ];
  hrsTx.forEach((t, i) => {
    const x = 0.35 + i * 3.15;
    s.addShape(pres.shapes.RECTANGLE, { x, y:5.74, w:3.0, h:0.38, fill:{color:t.c}, line:{color:t.c}});
    s.addText(t.line, { x:x+0.08, y:5.74, w:2.84, h:0.38, fontSize:9, bold:true, color:WHITE, valign:"middle", fontFace:"Calibri", margin:0});
    s.addShape(pres.shapes.RECTANGLE, { x, y:6.12, w:3.0, h:0.7, fill:{color:LIGHT_GRAY}, line:{color:t.c, pt:1.5}});
    s.addText(t.detail, { x:x+0.08, y:6.12, w:2.84, h:0.7, fontSize:9, color:DARK_TEXT, valign:"top", fontFace:"Calibri", margin:0});
  });

  s.addText("Harrison's Principles of Internal Medicine 22E  |  Chapter 355", {
    x:0, y:7.15, w:13.3, h:0.35, fontSize:8, color:MEDIUM_GRAY, align:"center", fontFace:"Calibri" });
}

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 9 — SUMMARY & KEY TAKE-AWAYS
// ─────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  s.addShape(pres.shapes.RECTANGLE, { x:0,y:0,w:13.3,h:7.5, fill:{color:DARK_BLUE}, line:{color:DARK_BLUE}});
  s.addShape(pres.shapes.RECTANGLE, { x:0, y:1.08, w:13.3, h:0.06, fill:{color:ACCENT_GOLD}, line:{color:ACCENT_GOLD}});
  s.addShape(pres.shapes.RECTANGLE, { x:0, y:6.8, w:13.3, h:0.06, fill:{color:ACCENT_GOLD}, line:{color:ACCENT_GOLD}});

  s.addText("KEY TAKE-AWAYS", {
    x:0.5, y:0.22, w:12.3, h:0.78, fontSize:30, bold:true, color:WHITE, align:"center", fontFace:"Calibri", charSpacing:6
  });

  const points = [
    { icon: "1", text: "Cirrhosis + portal hypertension accounts for >80% of ascites — always consider SAAG to differentiate", color: MED_BLUE },
    { icon: "2", text: "SAAG ≥ 1.1 g/dL → portal hypertension; SAAG < 1.1 → non-portal cause (malignancy, TB, nephrotic syndrome)", color: TEAL },
    { icon: "3", text: "Treatment: Sodium restriction (2 g/day) → Spironolactone + Furosemide (ratio 100:40) → Escalate to max → LVP / TIPS for refractory cases", color: "6A1B9A" },
    { icon: "4", text: "Always give IV albumin 6–8 g/L after LVP of ≥5 L to prevent post-paracentesis circulatory dysfunction", color: ORANGE },
    { icon: "5", text: "SBP: diagnose if ascitic neutrophils >250/µL → Treat with IV 3rd-gen cephalosporin + albumin (1.5 g/kg day 1, 1.0 g/kg day 3)", color: ACCENT_RED },
    { icon: "6", text: "HRS: best treated with liver transplantation. Use terlipressin/norepinephrine as vasoconstrictors; avoid NSAIDs, aminoglycosides, ACE inhibitors", color: "00838F" },
    { icon: "7", text: "Prognosis is poor (<50% survive 2 years) — refer all eligible patients for liver transplant evaluation early", color: ACCENT_GOLD },
  ];

  points.forEach((p, i) => {
    const col = i < 4 ? 0 : 1;
    const row = i < 4 ? i : i - 4;
    const x = col === 0 ? 0.4 : 6.85;
    const y = 1.28 + row * 1.3;
    const w = col === 0 ? 6.2 : 6.1;

    s.addShape(pres.shapes.RECTANGLE, { x, y, w:0.55, h:1.1, fill:{color:p.color}, line:{color:p.color}});
    s.addText(p.icon, { x, y, w:0.55, h:1.1, fontSize:22, bold:true, color:WHITE, align:"center", valign:"middle", fontFace:"Calibri", margin:0});
    s.addShape(pres.shapes.RECTANGLE, { x:x+0.55, y, w:w-0.55, h:1.1, fill:{color:"0A1F3C"}, line:{color:p.color, pt:1}});
    s.addText(p.text, { x:x+0.68, y, w:w-0.75, h:1.1, fontSize:11, color:WHITE, valign:"middle", fontFace:"Calibri", margin:0});
  });

  // Bottom reference
  s.addText("Source: Harrison's Principles of Internal Medicine, 22nd Edition (2025)  |  Chapters 39 & 355", {
    x:0, y:6.88, w:13.3, h:0.6, fontSize:10, color:MEDIUM_GRAY, align:"center", valign:"middle", fontFace:"Calibri"
  });
}

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

cd /home/daytona/workspace/ascites-ppt && node create_ascites_ppt.js

Your presentation is ready!

Ascites Harrisons 22E

Presentation · PPTX

The deck has 9 slides built entirely from Harrison's Principles of Internal Medicine 22E (2025), styled with a professional navy/gold color palette:
SlideContent
1Title slide
2Overview / outline (7 topics)
3Definition & Pathogenesis (4-step mechanism + grading)
4Clinical Features, Diagnosis & SAAG interpretation
5Treatment - sodium restriction, spironolactone + furosemide, drugs to avoid, prognosis
6Refractory Ascites - definition, midodrine/clonidine, LVP, TIPS, transplant
7Spontaneous Bacterial Peritonitis (SBP) - diagnosis, organisms, treatment with albumin
8Hepatorenal Syndrome (HRS) - HRS-AKI vs HRS-CKD, diagnosis, treatment hierarchy
9Key Take-Aways summary (7 high-yield points)

Ppt on Rheumatoid arthritis with images based on harrison's

Finding Sources
Reading File
Reading File
Finding Sources
Reading File
Finding Sources
Finding Sources
Reading File
Reading File
Searching Content

"cdn.orris.care" in /textbooks/9781265977061

Running Command

node /home/daytona/skills/shared/scripts/fetch_images.js \ "https://cdn.orris.…

Running Command

node /home/daytona/skills/shared/scripts/fetch_images.js \ "https://cdn.orris.…

Writing File

~/ascites-ppt/create_ra_ppt.js

const pptxgen = require("pptxgenjs");
const fs = require("fs");

const pres = new pptxgen();
pres.layout = "LAYOUT_WIDE"; // 13.3" x 7.5"
pres.title = "Rheumatoid Arthritis - Harrison's PMI 22E";

// ─── PALETTE ──────────────────────────────────────────────────────────────────
const DARK        = "1A1A2E";   // deep navy-black
const NAVY        = "16213E";   // slide backgrounds (dark slides)
const TEAL        = "0F3460";   // section headers
const ACCENT      = "E94560";   // hot coral accent
const GOLD        = "F5A623";   // highlight / warning
const TEAL_LIGHT  = "00B4D8";   // info boxes
const GREEN       = "00897B";   // positive / treatment
const PURPLE      = "7B2D8B";   // autoantibodies
const ORANGE      = "E65100";   // warnings
const WHITE       = "FFFFFF";
const LIGHT_BG    = "F0F4F8";
const CARD_BG     = "FFFFFF";
const DARK_TEXT   = "1A2A3A";
const GRAY        = "90A4AE";
const LIGHT_TEAL  = "E0F7FA";

// ─── Image data ───────────────────────────────────────────────────────────────
const img0 = fs.readFileSync("/tmp/ra_img0.b64", "utf8"); // global prevalence map

// ─── HELPERS ──────────────────────────────────────────────────────────────────
function hdr(s, title, sub) {
  s.addShape(pres.shapes.RECTANGLE, { x:0,y:0,w:13.3,h:0.95, fill:{color:TEAL}, line:{color:TEAL}});
  s.addShape(pres.shapes.RECTANGLE, { x:0,y:0.95,w:13.3,h:0.06, fill:{color:ACCENT}, line:{color:ACCENT}});
  s.addText(title, { x:0.35,y:0.08,w:10,h:0.52, fontSize:22, bold:true, color:WHITE, fontFace:"Calibri", margin:0});
  if(sub) s.addText(sub, { x:0.35,y:0.6,w:10,h:0.3, fontSize:11, color:GOLD, fontFace:"Calibri", italic:true, margin:0});
  s.addShape(pres.shapes.ROUNDED_RECTANGLE, { x:11.2,y:0.18,w:1.85,h:0.6, fill:{color:ACCENT}, line:{color:ACCENT}, rectRadius:0.08});
  s.addText("Harrison's 22E", { x:11.2,y:0.18,w:1.85,h:0.6, fontSize:9, bold:true, color:WHITE, align:"center", valign:"middle", fontFace:"Calibri", margin:0});
}
function foot(s) {
  s.addText("Harrison's Principles of Internal Medicine 22E  |  Chapter 370: Rheumatoid Arthritis", {
    x:0,y:7.17,w:13.3,h:0.33, fontSize:8, color:GRAY, align:"center", fontFace:"Calibri"});
}
function box(s, x, y, w, h, hColor, title, lines, fs_) {
  fs_ = fs_||11;
  s.addShape(pres.shapes.RECTANGLE, { x,y,w,h:0.4, fill:{color:hColor}, line:{color:hColor}});
  s.addText(title, { x:x+0.1,y,w:w-0.15,h:0.4, fontSize:13, bold:true, color:WHITE, fontFace:"Calibri", valign:"middle", margin:0});
  s.addShape(pres.shapes.RECTANGLE, { x,y:y+0.4,w,h:h-0.4, fill:{color:LIGHT_BG}, line:{color:hColor, pt:1.5}});
  const items = lines.map((b,i)=>({ text:b, options:{ bullet:true, breakLine:i<lines.length-1, fontSize:fs_, color:DARK_TEXT, fontFace:"Calibri"}}));
  s.addText(items, { x:x+0.14,y:y+0.46,w:w-0.28,h:h-0.56, valign:"top"});
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 1 — TITLE
// ═══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  // Dark gradient background via shapes
  s.addShape(pres.shapes.RECTANGLE, { x:0,y:0,w:13.3,h:7.5, fill:{color:NAVY}, line:{color:NAVY}});
  s.addShape(pres.shapes.RECTANGLE, { x:0,y:0,w:5.5,h:7.5, fill:{color:TEAL}, line:{color:TEAL}});
  s.addShape(pres.shapes.RECTANGLE, { x:5.5,y:0,w:0.06,h:7.5, fill:{color:ACCENT}, line:{color:ACCENT}});

  // Title text on dark right side
  s.addText("RHEUMATOID", { x:5.8,y:1.0,w:7.2,h:1.0, fontSize:52, bold:true, color:WHITE, fontFace:"Calibri", charSpacing:4});
  s.addText("ARTHRITIS", { x:5.8,y:1.95,w:7.2,h:1.0, fontSize:52, bold:true, color:ACCENT, fontFace:"Calibri", charSpacing:4});
  s.addShape(pres.shapes.RECTANGLE, { x:5.8,y:3.05,w:7.1,h:0.05, fill:{color:GOLD}, line:{color:GOLD}});
  s.addText("A Comprehensive Clinical Review", { x:5.8,y:3.2,w:7.1,h:0.45, fontSize:18, color:GOLD, fontFace:"Calibri", italic:true});
  s.addText("Based on Harrison's Principles of Internal Medicine\n22nd Edition (2025)", {
    x:5.8,y:3.85,w:7.1,h:0.8, fontSize:13, color:GRAY, fontFace:"Calibri"});

  // Left-side topic pills
  const topics = ["Epidemiology","Pathogenesis","Clinical Features","Diagnosis & Criteria","DMARDs & Biologics","Treatment Algorithm","Extra-articular Features","Prognosis"];
  topics.forEach((t,i)=>{
    s.addShape(pres.shapes.ROUNDED_RECTANGLE, { x:0.2,y:0.3+i*0.88,w:5.1,h:0.7, fill:{color:"0A2240", transparency:0}, line:{color:TEAL_LIGHT, pt:1}, rectRadius:0.06});
    s.addText(`${String(i+1).padStart(2,'0')}  ${t}`, { x:0.35,y:0.3+i*0.88,w:4.9,h:0.7, fontSize:13, color:WHITE, fontFace:"Calibri", valign:"middle", margin:0});
  });

  s.addText("Chapter 370  |  Rheumatology  |  Internal Medicine", { x:5.8,y:7.0,w:7.2,h:0.4, fontSize:9, color:GRAY, fontFace:"Calibri"});
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 2 — EPIDEMIOLOGY & RISK FACTORS (with prevalence map image)
// ═══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.shapes.RECTANGLE, { x:0,y:0,w:13.3,h:7.5, fill:{color:LIGHT_BG}, line:{color:LIGHT_BG}});
  hdr(s,"Epidemiology & Risk Factors","Global burden, genetics, and environmental triggers");

  // Stats row
  const stats = [
    { v:"0.5–1%",  l:"Global prevalence", c:TEAL },
    { v:"3:1",     l:"Female-to-Male ratio", c:ACCENT },
    { v:"40-60y",  l:"Peak onset age", c:GREEN },
    { v:"~60%",    l:"Risk attributed to genetics", c:PURPLE },
    { v:"1.5–3.5×",l:"Smoking risk increase", c:ORANGE },
  ];
  stats.forEach((st,i)=>{
    const x = 0.3+i*2.54;
    s.addShape(pres.shapes.RECTANGLE, { x,y:1.22,w:2.4,h:0.65, fill:{color:st.c}, line:{color:st.c}});
    s.addText(st.v, { x,y:1.22,w:2.4,h:0.42, fontSize:20, bold:true, color:WHITE, align:"center", fontFace:"Calibri", margin:0});
    s.addText(st.l, { x:x+0.05,y:1.59,w:2.3,h:0.28, fontSize:8.5, color:WHITE, align:"center", fontFace:"Calibri", margin:0});
  });

  // Left content boxes
  box(s, 0.3, 2.07, 5.9, 2.3, TEAL, "Genetic Risk Factors",[
    "HLA-DRB1 shared epitope (SE) — major risk allele",
    "*0401/*0404 in Northern Europeans (50–70%); *0405/*0901 in Asians",
    "Pima/Tlingit Native Americans: prevalence up to 7% (*1042 allele)",
    "PTPN22 gene — regulates T/B cell function; absent in East Asians",
    "PADI4 gene — encodes enzyme converting arginine → citrulline",
    ">100 non-MHC loci identified by GWAS; individually modest effect",
  ],10.5);

  box(s, 0.3, 4.52, 5.9, 2.5, ORANGE, "Environmental Risk Factors",[
    "Cigarette smoking: RR 1.5–3.5×; synergizes with SE alleles → 20–40× risk",
    "Risk persists 15 years after smoking cessation",
    "Almost exclusively ACPA/RF-positive disease",
    "Silica inhalation and inhalant occupations",
    "Periodontal disease / Porphyromonas gingivalis (PAD enzyme → citrullination)",
    "Gut and oral microbiome dysbiosis — emerging evidence",
  ],10.5);

  // Right: Prevalence map image
  s.addShape(pres.shapes.RECTANGLE, { x:6.45,y:2.07,w:6.6,h:4.3, fill:{color:WHITE}, line:{color:TEAL, pt:1.5}});
  s.addText("FIGURE 370-1  Global Prevalence & Genetic Associations of RA", { x:6.55,y:2.1,w:6.4,h:0.38, fontSize:10, bold:true, color:TEAL, fontFace:"Calibri", margin:0});
  s.addImage({ data: img0, x:6.5,y:2.52,w:6.5,h:3.6 });
  s.addText("HLA-DRB1 mutations are found globally; specific alleles vary by ethnicity. (Harrison's 22E)", { x:6.5,y:6.17,w:6.5,h:0.3, fontSize:8, color:GRAY, fontFace:"Calibri", italic:true });

  foot(s);
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 3 — PATHOGENESIS
// ═══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.shapes.RECTANGLE, { x:0,y:0,w:13.3,h:7.5, fill:{color:LIGHT_BG}, line:{color:LIGHT_BG}});
  hdr(s,"Pathogenesis","Autoimmune cascade driving synovial inflammation and joint destruction");

  // Cascade flow
  const steps = [
    { n:"1", t:"Genetic + Environmental Trigger", d:"SE alleles + smoking → citrullination of self-proteins (ACPA generation)", c:TEAL },
    { n:"2", t:"Autoantibody Production", d:"RF + ACPA produced years before clinical disease. Immune complex deposition in synovium", c:PURPLE },
    { n:"3", t:"Synovial T-cell Activation", d:"CD4+ T cells, B cells infiltrate synovium. Th1/Th17 polarization → cytokine release", c:ACCENT },
    { n:"4", t:"Cytokine Storm", d:"TNF-α, IL-1, IL-6, IL-17 drive pannus formation. Synoviocyte (FLS) proliferation", c:ORANGE },
    { n:"5", t:"Pannus & Joint Destruction", d:"Aggressive granulation tissue (pannus) erodes cartilage and bone. RANKL activates osteoclasts", c:ACCENT },
  ];
  steps.forEach((st,i)=>{
    const x = 0.25 + i*2.58;
    s.addShape(pres.shapes.RECTANGLE, { x,y:1.22,w:0.6,h:3.2, fill:{color:st.c}, line:{color:st.c}});
    s.addText(st.n, { x,y:1.22,w:0.6,h:0.6, fontSize:20, bold:true, color:WHITE, align:"center", valign:"middle", fontFace:"Calibri", margin:0});
    s.addShape(pres.shapes.RECTANGLE, { x:x+0.6,y:1.22,w:1.88,h:0.62, fill:{color:st.c}, line:{color:st.c}});
    s.addText(st.t, { x:x+0.65,y:1.22,w:1.78,h:0.62, fontSize:11, bold:true, color:WHITE, valign:"middle", fontFace:"Calibri", margin:0});
    s.addShape(pres.shapes.RECTANGLE, { x:x+0.6,y:1.84,w:1.88,h:2.58, fill:{color:WHITE}, line:{color:st.c, pt:1.5}});
    s.addText(st.d, { x:x+0.7,y:1.9,w:1.68,h:2.4, fontSize:10, color:DARK_TEXT, valign:"top", fontFace:"Calibri", margin:0});
    if(i<4) s.addText("→", { x:x+2.49,y:2.5,w:0.2,h:0.5, fontSize:20, bold:true, color:st.c, align:"center", valign:"middle", margin:0});
  });

  // Key mediators
  s.addShape(pres.shapes.RECTANGLE, { x:0.25,y:4.62,w:12.8,h:0.42, fill:{color:NAVY}, line:{color:NAVY}});
  s.addText("KEY THERAPEUTIC TARGETS in the Pathogenesis Cascade:", { x:0.4,y:4.62,w:12.5,h:0.42, fontSize:12, bold:true, color:WHITE, valign:"middle", fontFace:"Calibri", margin:0});

  const tgts = [
    { label:"TNF-α", rx:"Etanercept, Infliximab, Adalimumab, Certolizumab, Golimumab", c:ACCENT },
    { label:"IL-6R", rx:"Tocilizumab, Sarilumab", c:TEAL },
    { label:"CD80/86 (T-cell co-stim)", rx:"Abatacept", c:PURPLE },
    { label:"CD20 (B cells)", rx:"Rituximab", c:GREEN },
    { label:"JAK1/2/3", rx:"Tofacitinib, Baricitinib, Upadacitinib", c:ORANGE },
  ];
  tgts.forEach((t,i)=>{
    const x = 0.25 + i*2.58;
    s.addShape(pres.shapes.RECTANGLE, { x,y:5.04,w:2.45,h:0.42, fill:{color:t.c}, line:{color:t.c}});
    s.addText(t.label, { x:x+0.06,y:5.04,w:2.35,h:0.42, fontSize:11, bold:true, color:WHITE, valign:"middle", fontFace:"Calibri", margin:0});
    s.addShape(pres.shapes.RECTANGLE, { x,y:5.46,w:2.45,h:0.85, fill:{color:LIGHT_BG}, line:{color:t.c, pt:1.5}});
    s.addText(t.rx, { x:x+0.07,y:5.46,w:2.31,h:0.85, fontSize:9, color:DARK_TEXT, valign:"middle", fontFace:"Calibri", margin:0});
  });

  foot(s);
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 4 — CLINICAL FEATURES
// ═══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.shapes.RECTANGLE, { x:0,y:0,w:13.3,h:7.5, fill:{color:LIGHT_BG}, line:{color:LIGHT_BG}});
  hdr(s,"Clinical Features","Articular and extra-articular manifestations");

  // Articular features
  box(s, 0.3,1.2, 4.1, 3.35, TEAL, "Articular Features",[
    "Symmetric polyarthritis — hallmark",
    "Small joints of hands/wrists/feet first affected",
    "Morning stiffness >1 hour (disease activity marker)",
    "MCP, PIP joints involved (NOT DIP)",
    "Pain, swelling, warmth, tenderness on palpation",
    "Soft tissue swelling vs bony enlargement (OA)",
    "Pannus erosion → deformity over time",
    "Boutonniere deformity, Swan-neck deformity",
    "Ulnar deviation of fingers",
    "Z-deformity of thumb",
  ],10.5);

  // Joint deformities illustration box
  s.addShape(pres.shapes.RECTANGLE, { x:4.55,y:1.2,w:3.6,h:3.35, fill:{color:WHITE}, line:{color:TEAL, pt:1.5}});
  s.addText("Joint Deformities in RA", { x:4.65,y:1.25,w:3.4,h:0.4, fontSize:12, bold:true, color:TEAL, fontFace:"Calibri", margin:0});
  const deforms = [
    { d:"Boutonnière", m:"PIP flexion + DIP hyperextension" },
    { d:"Swan-neck", m:"PIP hyperextension + DIP flexion" },
    { d:"Ulnar deviation", m:"MCP joint drift toward ulna" },
    { d:"Z-thumb", m:"MCP flexion + IP hyperextension" },
    { d:"Piano-key sign", m:"Subluxation of distal ulna" },
    { d:"Atlanto-axial subluxation", m:"Cervical spine — neurological emergency" },
  ];
  deforms.forEach((d,i)=>{
    s.addShape(pres.shapes.RECTANGLE, { x:4.65,y:1.7+i*0.4,w:1.3,h:0.36, fill:{color:TEAL, transparency:i%2===0?0:30}, line:{color:TEAL}});
    s.addText(d.d, { x:4.67,y:1.7+i*0.4,w:1.27,h:0.36, fontSize:9, bold:true, color:WHITE, valign:"middle", fontFace:"Calibri", margin:0});
    s.addShape(pres.shapes.RECTANGLE, { x:5.95,y:1.7+i*0.4,w:2.1,h:0.36, fill:{color:LIGHT_BG}, line:{color:TEAL, pt:0.8}});
    s.addText(d.m, { x:6.0,y:1.7+i*0.4,w:2.0,h:0.36, fontSize:9, color:DARK_TEXT, valign:"middle", fontFace:"Calibri", margin:0});
  });

  // Extra-articular features
  s.addShape(pres.shapes.RECTANGLE, { x:8.3,y:1.2,w:4.7,h:3.35, fill:{color:WHITE}, line:{color:ACCENT, pt:1.5}});
  s.addShape(pres.shapes.RECTANGLE, { x:8.3,y:1.2,w:4.7,h:0.4, fill:{color:ACCENT}, line:{color:ACCENT}});
  s.addText("Extra-articular Features", { x:8.4,y:1.2,w:4.5,h:0.4, fontSize:13, bold:true, color:WHITE, valign:"middle", fontFace:"Calibri", margin:0});
  const eaf = [
    { sys:"Skin", feat:"Rheumatoid nodules (20–30%), vasculitis" },
    { sys:"Pulmonary", feat:"ILD (UIP/NSIP), pleuritis, nodules, Caplan syndrome" },
    { sys:"Cardiac", feat:"Pericarditis, myocarditis, ↑ CVD risk" },
    { sys:"Eye", feat:"Keratoconjunctivitis sicca, scleritis, episcleritis" },
    { sys:"Haematologic", feat:"Felty syndrome (RA + neutropenia + splenomegaly)" },
    { sys:"Neurologic", feat:"Mononeuritis multiplex, cervical myelopathy" },
    { sys:"Renal", feat:"Amyloidosis (secondary), drug-related" },
    { sys:"Systemic", feat:"Fatigue, weight loss, low-grade fever" },
  ];
  eaf.forEach((e,i)=>{
    s.addShape(pres.shapes.RECTANGLE, { x:8.35,y:1.65+i*0.34,w:1.05,h:0.3, fill:{color:ACCENT, transparency:i%2===0?0:25}, line:{color:ACCENT}});
    s.addText(e.sys, { x:8.37,y:1.65+i*0.34,w:1.0,h:0.3, fontSize:8.5, bold:true, color:WHITE, valign:"middle", fontFace:"Calibri", margin:0});
    s.addShape(pres.shapes.RECTANGLE, { x:9.4,y:1.65+i*0.34,w:3.5,h:0.3, fill:{color:LIGHT_BG}, line:{color:ACCENT, pt:0.8}});
    s.addText(e.feat, { x:9.45,y:1.65+i*0.34,w:3.4,h:0.3, fontSize:8.5, color:DARK_TEXT, valign:"middle", fontFace:"Calibri", margin:0});
  });

  // Disease activity & labs
  s.addShape(pres.shapes.RECTANGLE, { x:0.3,y:4.7,w:12.7,h:0.4, fill:{color:NAVY}, line:{color:NAVY}});
  s.addText("Laboratory Findings & Autoantibodies", { x:0.45,y:4.7,w:12.4,h:0.4, fontSize:13, bold:true, color:WHITE, valign:"middle", fontFace:"Calibri", margin:0});
  const labs = [
    { l:"RF (Rheumatoid Factor)", d:"IgM anti-IgG. Positive in ~75–80%. NOT specific — also in SLE, Sjögren's, infections, healthy elderly", c:PURPLE },
    { l:"Anti-CCP (ACPA)", d:"Highly specific (~95%) and sensitive (~70%). Predictive of erosive disease. Present years before symptoms", c:TEAL },
    { l:"ESR / CRP", d:"Elevated in active disease. Useful to monitor response to treatment. CRP also predicts CV risk", c:GREEN },
    { l:"ANA", d:"Positive in ~30% of RA patients. Low titer. Does not indicate SLE", c:ORANGE },
  ];
  labs.forEach((l,i)=>{
    const x=0.3+i*3.17;
    s.addShape(pres.shapes.RECTANGLE, { x,y:5.1,w:3.05,h:0.38, fill:{color:l.c}, line:{color:l.c}});
    s.addText(l.l, { x:x+0.08,y:5.1,w:2.89,h:0.38, fontSize:10, bold:true, color:WHITE, valign:"middle", fontFace:"Calibri", margin:0});
    s.addShape(pres.shapes.RECTANGLE, { x,y:5.48,w:3.05,h:1.35, fill:{color:LIGHT_BG}, line:{color:l.c, pt:1.5}});
    s.addText(l.d, { x:x+0.09,y:5.53,w:2.87,h:1.25, fontSize:9.5, color:DARK_TEXT, valign:"top", fontFace:"Calibri", margin:0});
  });

  foot(s);
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 5 — 2010 ACR/EULAR CLASSIFICATION CRITERIA
// ═══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.shapes.RECTANGLE, { x:0,y:0,w:13.3,h:7.5, fill:{color:LIGHT_BG}, line:{color:LIGHT_BG}});
  hdr(s,"2010 ACR/EULAR Classification Criteria for RA","Score ≥6/10 = definite RA (requires at least 1 joint with synovitis not explained by another diagnosis)");

  // Score table
  s.addShape(pres.shapes.RECTANGLE, { x:0.3,y:1.22,w:12.7,h:0.45, fill:{color:TEAL}, line:{color:TEAL}});
  const cols = ["DOMAIN","FINDING","SCORE"];
  const cx = [0.35, 3.2, 12.35];
  const cw = [2.8, 8.95, 0.6];
  cols.forEach((c,i)=> s.addText(c, { x:cx[i],y:1.22,w:cw[i],h:0.45, fontSize:12, bold:true, color:WHITE, valign:"middle", fontFace:"Calibri", margin:0, align: i===2?"center":"left"}));

  const criteria = [
    { dom:"Joint Involvement", find:"1 large joint (shoulder, elbow, hip, knee, ankle)", score:"0" },
    { dom:"", find:"2–10 large joints", score:"1" },
    { dom:"", find:"1–3 small joints (MCP, PIP, wrist, 2nd–5th MTP)", score:"2" },
    { dom:"", find:"4–10 small joints", score:"3" },
    { dom:"", find:">10 joints (at least 1 small joint)", score:"5" },
    { dom:"Serology", find:"Negative RF AND negative ACPA", score:"0" },
    { dom:"", find:"Low-positive RF OR low-positive ACPA (≤3× ULN)", score:"2" },
    { dom:"", find:"High-positive RF OR high-positive ACPA (>3× ULN)", score:"3" },
    { dom:"Acute-Phase Reactants", find:"Normal CRP AND normal ESR", score:"0" },
    { dom:"", find:"Abnormal CRP OR abnormal ESR", score:"1" },
    { dom:"Duration of Symptoms", find:"<6 weeks", score:"0" },
    { dom:"", find:"≥6 weeks", score:"1" },
  ];
  const rowColors = [TEAL,TEAL,"","","",PURPLE,PURPLE,PURPLE,GREEN,GREEN,ORANGE,ORANGE];
  criteria.forEach((r,i)=>{
    const y = 1.67 + i*0.42;
    const bg = i%2===0 ? WHITE : LIGHT_BG;
    s.addShape(pres.shapes.RECTANGLE, { x:0.3,y,w:12.7,h:0.42, fill:{color:bg}, line:{color:"D0D8E0", pt:0.5}});
    if(r.dom) {
      s.addShape(pres.shapes.RECTANGLE, { x:0.3,y,w:2.85,h:0.42, fill:{color:rowColors[i]||TEAL}, line:{color:rowColors[i]||TEAL}});
      s.addText(r.dom, { x:0.38,y,w:2.7,h:0.42, fontSize:10, bold:true, color:WHITE, valign:"middle", fontFace:"Calibri", margin:0});
    }
    s.addText(r.find, { x:3.25,y,w:8.8,h:0.42, fontSize:10, color:DARK_TEXT, valign:"middle", fontFace:"Calibri", margin:0});
    s.addShape(pres.shapes.RECTANGLE, { x:12.25,y,w:0.75,h:0.42, fill:{color:Number(r.score)>=3?ACCENT:Number(r.score)>=1?GOLD:LIGHT_BG}, line:{color:"D0D8E0"}});
    s.addText(r.score, { x:12.25,y,w:0.75,h:0.42, fontSize:12, bold:true, color:Number(r.score)>=1?WHITE:DARK_TEXT, align:"center", valign:"middle", fontFace:"Calibri", margin:0});
  });

  s.addShape(pres.shapes.RECTANGLE, { x:0.3,y:6.7,w:12.7,h:0.42, fill:{color:ACCENT}, line:{color:ACCENT}});
  s.addText("SCORE ≥ 6/10 = DEFINITE RHEUMATOID ARTHRITIS", { x:0.4,y:6.7,w:12.5,h:0.42, fontSize:13, bold:true, color:WHITE, align:"center", valign:"middle", fontFace:"Calibri", margin:0});

  foot(s);
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 6 — TREATMENT OVERVIEW
// ═══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.shapes.RECTANGLE, { x:0,y:0,w:13.3,h:7.5, fill:{color:LIGHT_BG}, line:{color:LIGHT_BG}});
  hdr(s,"Treatment of Rheumatoid Arthritis","Treat-to-target: goal is remission or low disease activity");

  // Principle
  s.addShape(pres.shapes.RECTANGLE, { x:0.3,y:1.22,w:12.7,h:0.55, fill:{color:NAVY}, line:{color:NAVY}});
  s.addText([
    { text:"Treat-to-Target (T2T): ", options:{ bold:true, color:GOLD, fontSize:12 }},
    { text:"Target is remission (DAS28 <2.6) or low disease activity. Reassess every 1–3 months. Escalate DMARD therapy if target not met within 3–6 months.", options:{ color:WHITE, fontSize:12 }},
  ],{ x:0.45,y:1.22,w:12.4,h:0.55, valign:"middle", fontFace:"Calibri"});

  // Drug categories
  const cats = [
    { title:"NSAIDs", color:TEAL_LIGHT, tc:TEAL,
      points:["Adjunctive agents only (not disease-modifying)","COX-1 and COX-2 inhibition → analgesic + anti-inflammatory","Minimize chronic use: GI toxicity (peptic ulcer, gastritis), renal injury","Roughly equivalent efficacy; individual response varies"] },
    { title:"Glucocorticoids", color:"FFF3E0", tc:ORANGE,
      points:["Bridge therapy while DMARD takes effect (weeks–months)","Acute flare management: short burst (1–2 weeks)","Chronic low-dose: ≤5–10 mg/day prednisone","⚠ Long-term risks: osteoporosis, infection, metabolic effects","Intra-articular injection for mono/oligoarticular flare"] },
    { title:"csDMARDs (Conventional)", color:"E8F5E9", tc:GREEN,
      points:["Methotrexate (MTX): DRUG OF CHOICE for early RA","Start MTX 7.5–15 mg/week; up to 25 mg/week","Always supplement with folic acid","Other csDMARDs: hydroxychloroquine, sulfasalazine, leflunomide","Triple therapy (MTX + HCQ + SSZ) = proven superiority over MTX alone"] },
  ];
  cats.forEach((c,i)=>{
    const x=0.3+i*4.28;
    s.addShape(pres.shapes.RECTANGLE, { x,y:1.95,w:4.1,h:0.42, fill:{color:c.tc}, line:{color:c.tc}});
    s.addText(c.title, { x:x+0.1,y:1.95,w:3.9,h:0.42, fontSize:13, bold:true, color:WHITE, valign:"middle", fontFace:"Calibri", margin:0});
    s.addShape(pres.shapes.RECTANGLE, { x,y:2.37,w:4.1,h:2.35, fill:{color:LIGHT_BG}, line:{color:c.tc, pt:1.5}});
    const items=c.points.map((p,j)=>({ text:p, options:{ bullet:true, breakLine:j<c.points.length-1, fontSize:10.5, color:DARK_TEXT, fontFace:"Calibri"}}));
    s.addText(items, { x:x+0.12,y:2.43,w:3.86,h:2.23, valign:"top"});
  });

  // Biologic section header
  s.addShape(pres.shapes.RECTANGLE, { x:0.3,y:4.85,w:12.7,h:0.42, fill:{color:ACCENT}, line:{color:ACCENT}});
  s.addText("BIOLOGIC DMARDs (bDMARDs) — Used when csDMARDs are inadequate", { x:0.45,y:4.85,w:12.4,h:0.42, fontSize:13, bold:true, color:WHITE, valign:"middle", fontFace:"Calibri", margin:0});

  const bios = [
    { n:"Anti-TNF", d:"Etanercept, Infliximab, Adalimumab, Certolizumab, Golimumab", c:ACCENT },
    { n:"Anti-IL-6R", d:"Tocilizumab, Sarilumab", c:TEAL },
    { n:"Anti-CD80/86", d:"Abatacept (CTLA4-Ig)\nT-cell co-stimulation blockade", c:PURPLE },
    { n:"Anti-CD20", d:"Rituximab\nB-cell depletion", c:GREEN },
    { n:"JAK Inhibitors", d:"Tofacitinib, Baricitinib, Upadacitinib\n(tsDMARDs — oral)", c:ORANGE },
  ];
  bios.forEach((b,i)=>{
    const x=0.3+i*2.55;
    s.addShape(pres.shapes.RECTANGLE, { x,y:5.27,w:2.42,h:0.4, fill:{color:b.c}, line:{color:b.c}});
    s.addText(b.n, { x:x+0.08,y:5.27,w:2.26,h:0.4, fontSize:11, bold:true, color:WHITE, valign:"middle", fontFace:"Calibri", margin:0});
    s.addShape(pres.shapes.RECTANGLE, { x,y:5.67,w:2.42,h:1.15, fill:{color:LIGHT_BG}, line:{color:b.c, pt:1.5}});
    s.addText(b.d, { x:x+0.09,y:5.7,w:2.24,h:1.1, fontSize:9, color:DARK_TEXT, valign:"top", fontFace:"Calibri", margin:0});
  });

  foot(s);
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 7 — DMARDs TABLE
// ═══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.shapes.RECTANGLE, { x:0,y:0,w:13.3,h:7.5, fill:{color:LIGHT_BG}, line:{color:LIGHT_BG}});
  hdr(s,"Key DMARDs — Dosing, Mechanism & Toxicity","Based on Table 370-3, Harrison's 22E");

  const hdr2 = ["Drug","Mechanism","Dose","Key Toxicities","Monitoring"];
  const hx=[0.25,2.4,5.0,6.65,10.0]; const hw=[2.1,2.55,1.6,3.3,3.05];
  s.addShape(pres.shapes.RECTANGLE, { x:0.25,y:1.22,w:12.8,h:0.42, fill:{color:NAVY}, line:{color:NAVY}});
  hdr2.forEach((h,i)=> s.addText(h, { x:hx[i]+0.05,y:1.22,w:hw[i]-0.1,h:0.42, fontSize:11, bold:true, color:WHITE, valign:"middle", fontFace:"Calibri", margin:0}));

  const rows=[
    { drug:"Methotrexate",       mech:"Inhibits DHFR; anti-inflammatory via adenosine", dose:"7.5–25 mg/wk", tox:"Hepatotoxicity, mucositis, myelosuppression, teratogenic, pneumonitis", mon:"LFTs, CBC, Cr q4–8wk; avoid alcohol", c:GREEN},
    { drug:"Hydroxychloroquine", mech:"Inhibits TLR signalling, lysosomal acidification",   dose:"≤5 mg/kg/d",  tox:"Retinal toxicity (maculopathy)",                                        mon:"Annual ophthalmology exam", c:TEAL},
    { drug:"Sulfasalazine",      mech:"Anti-inflammatory; unknown exact mechanism",          dose:"1–1.5 g BID",  tox:"GI upset, rash, leukopenia, hepatitis",                                 mon:"CBC, LFTs q3mo", c:TEAL_LIGHT},
    { drug:"Leflunomide",        mech:"Inhibits pyrimidine synthesis (DHODH)",               dose:"20 mg/d",     tox:"Hepatotoxicity, HTN, teratogenic, diarrhea",                             mon:"LFTs, BP monthly × 6mo then q6mo", c:PURPLE},
    { drug:"Adalimumab",         mech:"Monoclonal Ab; neutralizes TNF-α",                   dose:"40 mg q2wk SC",tox:"Infection (TB reactivation), demyelination, lymphoma risk",             mon:"TB screen before start; CBC, LFTs", c:ACCENT},
    { drug:"Etanercept",         mech:"Fusion protein; binds TNF-α + TNF-β",                dose:"50 mg/wk SC", tox:"Injection site reactions, infection, heart failure",                      mon:"TB screen before start", c:ACCENT},
    { drug:"Tocilizumab",        mech:"Blocks IL-6 receptor (soluble + membrane-bound)",    dose:"162 mg/wk SC", tox:"↑ LFTs, ↑ lipids, GI perforation, cytopenias",                         mon:"LFTs, lipids, CBC q4–8wk", c:ORANGE},
    { drug:"Abatacept",          mech:"CTLA4-Ig; blocks CD80/CD86:CD28 co-stimulation",    dose:"SC weekly or IV monthly", tox:"Infection, COPD exacerbation",                               mon:"Watch for TB, hepatitis", c:PURPLE},
    { drug:"Rituximab",          mech:"Anti-CD20; depletes B lymphocytes",                  dose:"1000 mg IV ×2 (2wk apart)", tox:"Infusion reaction, PML (rare), immunosuppression",        mon:"Immunoglobulin levels before each cycle", c:GREEN},
    { drug:"Tofacitinib",        mech:"JAK1/3 inhibitor → blocks cytokine signalling",     dose:"5 mg BID oral",tox:"VTE (↑ risk), serious infection, CV risk, malignancy",                   mon:"CBC, LFTs, lipids; avoid with live vaccines", c:"8D6A9F"},
  ];
  rows.forEach((r,i)=>{
    const y=1.64+i*0.54;
    const bg=i%2===0?WHITE:LIGHT_BG;
    s.addShape(pres.shapes.RECTANGLE, { x:0.25,y,w:12.8,h:0.54, fill:{color:bg}, line:{color:"D0D8E0", pt:0.5}});
    s.addShape(pres.shapes.RECTANGLE, { x:0.25,y,w:2.1,h:0.54, fill:{color:r.c}, line:{color:r.c}});
    s.addText(r.drug, { x:0.3,y,w:2.0,h:0.54, fontSize:10, bold:true, color:WHITE, valign:"middle", fontFace:"Calibri", margin:0});
    s.addText(r.mech, { x:hx[1]+0.05,y,w:hw[1]-0.1,h:0.54, fontSize:8.5, color:DARK_TEXT, valign:"middle", fontFace:"Calibri", margin:0});
    s.addText(r.dose, { x:hx[2]+0.05,y,w:hw[2]-0.1,h:0.54, fontSize:8.5, color:DARK_TEXT, valign:"middle", fontFace:"Calibri", margin:0});
    s.addText(r.tox,  { x:hx[3]+0.05,y,w:hw[3]-0.1,h:0.54, fontSize:8, color:DARK_TEXT, valign:"middle", fontFace:"Calibri", margin:0});
    s.addText(r.mon,  { x:hx[4]+0.05,y,w:hw[4]-0.1,h:0.54, fontSize:8, color:DARK_TEXT, valign:"middle", fontFace:"Calibri", margin:0});
  });

  foot(s);
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 8 — TREATMENT ALGORITHM
// ═══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.shapes.RECTANGLE, { x:0,y:0,w:13.3,h:7.5, fill:{color:LIGHT_BG}, line:{color:LIGHT_BG}});
  hdr(s,"Treatment Algorithm","Step-up strategy with treat-to-target approach (Harrison's 22E + ACR 2021 Guidelines)");

  // Step boxes with arrows
  const steps = [
    { n:"STEP 1", t:"Diagnosis + Early DMARD Start", d:"Start MTX as soon as possible after diagnosis. Add folic acid.\nBridge with low-dose glucocorticoids if needed.", c:GREEN },
    { n:"STEP 2", t:"Reassess at 3 months", d:"If LDA/remission not achieved:\nEscalate MTX dose to maximum tolerated (25 mg/wk)\nConsider adding HCQ and/or SSZ (triple therapy)", c:TEAL },
    { n:"STEP 3", t:"Moderate–High Disease Activity persists", d:"Add biologic DMARD or JAK inhibitor to MTX:\nFirst choice: Anti-TNF agents (most data)\nAlternatives: abatacept, tocilizumab, rituximab", c:ACCENT },
    { n:"STEP 4", t:"Inadequate response / toxicity", d:"Switch biologic (different mechanism class)\nor switch to JAK inhibitor\nor trial of combination bDMARD strategies", c:PURPLE },
    { n:"STEP 5", t:"Refractory / Ongoing Activity", d:"Re-evaluate diagnosis\nReferral to tertiary rheumatology\nConsider clinical trial enrollment\nAddress comorbidities (CVD, osteoporosis)", c:ORANGE },
  ];
  steps.forEach((st,i)=>{
    const y=1.22+i*1.18;
    s.addShape(pres.shapes.RECTANGLE, { x:0.3,y,w:1.2,h:0.9, fill:{color:st.c}, line:{color:st.c}});
    s.addText(st.n, { x:0.3,y,w:1.2,h:0.9, fontSize:11, bold:true, color:WHITE, align:"center", valign:"middle", fontFace:"Calibri", margin:0});
    s.addShape(pres.shapes.RECTANGLE, { x:1.5,y,w:3.0,h:0.9, fill:{color:st.c}, line:{color:st.c}});
    s.addText(st.t, { x:1.58,y,w:2.84,h:0.9, fontSize:12, bold:true, color:WHITE, valign:"middle", fontFace:"Calibri", margin:0});
    s.addShape(pres.shapes.RECTANGLE, { x:4.5,y,w:8.55,h:0.9, fill:{color:LIGHT_BG}, line:{color:st.c, pt:1.5}});
    s.addText(st.d, { x:4.62,y:y+0.04,w:8.33,h:0.82, fontSize:11, color:DARK_TEXT, valign:"middle", fontFace:"Calibri", margin:0});
    if(i<4) {
      s.addShape(pres.shapes.RECTANGLE, { x:0.82,y:y+0.9,w:0.16,h:0.28, fill:{color:st.c}, line:{color:st.c}});
    }
  });

  // Key principle box
  s.addShape(pres.shapes.RECTANGLE, { x:0.3,y:7.08,w:12.7,h:0.35, fill:{color:NAVY}, line:{color:NAVY}});
  s.addText("Key principle: Escalate therapy every 3 months if treatment target (remission / LDA) not achieved  |  Combination > Monotherapy in most patients", {
    x:0.4,y:7.08,w:12.5,h:0.35, fontSize:9.5, color:GOLD, bold:true, valign:"middle", fontFace:"Calibri", margin:0});
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 9 — DISEASE ACTIVITY INDICES & MONITORING
// ═══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.shapes.RECTANGLE, { x:0,y:0,w:13.3,h:7.5, fill:{color:LIGHT_BG}, line:{color:LIGHT_BG}});
  hdr(s,"Disease Activity Measurement & Monitoring","Tools for tracking RA and guiding treatment decisions");

  // Indices
  s.addShape(pres.shapes.RECTANGLE, { x:0.3,y:1.22,w:6.2,h:0.42, fill:{color:TEAL}, line:{color:TEAL}});
  s.addText("Disease Activity Indices", { x:0.4,y:1.22,w:6.0,h:0.42, fontSize:13, bold:true, color:WHITE, valign:"middle", fontFace:"Calibri", margin:0});

  const indices = [
    { name:"DAS28 (Disease Activity Score)", comp:"28 tender + swollen joint counts, ESR/CRP, patient VAS", use:"<2.6 = remission; 2.6–3.2 = LDA; 3.2–5.1 = MDA; >5.1 = HDA", c:TEAL },
    { name:"SDAI (Simplified DA Index)",      comp:"28 SJC + 28 TJC + patient VAS + physician VAS + CRP",   use:"≤3.3 = remission; 3.4–11 = LDA", c:GREEN },
    { name:"CDAI (Clinical DA Index)",        comp:"28 SJC + 28 TJC + patient VAS + physician VAS (no labs)", use:"≤2.8 = remission; 2.9–10 = LDA; useful in clinical practice", c:PURPLE },
    { name:"ACR 20/50/70 Response",           comp:"20/50/70% improvement in joint counts + 3 of 5 other measures", use:"Primary endpoint in clinical trials", c:ORANGE },
    { name:"RAPID3",                          comp:"Patient self-report only (no joint counts)", use:"Simple; for busy clinical settings", c:TEAL_LIGHT },
  ];
  indices.forEach((r,i)=>{
    const y=1.64+i*0.9;
    s.addShape(pres.shapes.RECTANGLE, { x:0.3,y,w:2.6,h:0.9, fill:{color:r.c}, line:{color:r.c}});
    s.addText(r.name, { x:0.38,y,w:2.44,h:0.9, fontSize:9.5, bold:true, color:WHITE, valign:"middle", fontFace:"Calibri", margin:0});
    s.addShape(pres.shapes.RECTANGLE, { x:2.9,y,w:1.8,h:0.9, fill:{color:LIGHT_BG}, line:{color:r.c, pt:1}});
    s.addText(r.comp, { x:2.97,y,w:1.66,h:0.9, fontSize:8.5, color:DARK_TEXT, valign:"middle", fontFace:"Calibri", margin:0});
    s.addShape(pres.shapes.RECTANGLE, { x:4.7,y,w:1.8,h:0.9, fill:{color:LIGHT_BG}, line:{color:r.c, pt:1}});
    s.addText(r.use, { x:4.77,y,w:1.66,h:0.9, fontSize:8.5, color:DARK_TEXT, valign:"middle", fontFace:"Calibri", margin:0});
  });

  // Monitoring right panel
  s.addShape(pres.shapes.RECTANGLE, { x:6.75,y:1.22,w:6.25,h:0.42, fill:{color:ACCENT}, line:{color:ACCENT}});
  s.addText("Ongoing Monitoring of RA Patients", { x:6.85,y:1.22,w:6.05,h:0.42, fontSize:13, bold:true, color:WHITE, valign:"middle", fontFace:"Calibri", margin:0});

  const monitors = [
    { cat:"Clinical", items:"Joint counts (TJC/SJC), morning stiffness duration, functional disability (HAQ), patient VAS, physician global assessment" },
    { cat:"Laboratory", items:"CRP, ESR, CBC, LFTs, creatinine — frequency depends on DMARD used (q4–8 weeks when initiating, then q3 months)" },
    { cat:"Imaging", items:"X-rays of hands/feet at baseline and annually to detect erosions. MRI/ultrasound more sensitive for early erosions and synovitis" },
    { cat:"Comorbidities", items:"Cardiovascular risk (RA doubles CV mortality) — screen lipids, BP. Osteoporosis screening — DEXA scan. Infection risk — vaccinate (flu, pneumococcal, zoster)" },
    { cat:"Drug Toxicity", items:"MTX: LFTs, CBC, creatinine. Anti-TNF: TB screen, hepatitis B, infection surveillance. JAK inhibitors: lipids, VTE risk, CBC" },
  ];
  monitors.forEach((m,i)=>{
    const y=1.64+i*0.95;
    const c=i%2===0?ACCENT:PURPLE;
    s.addShape(pres.shapes.RECTANGLE, { x:6.75,y,w:1.4,h:0.95, fill:{color:c}, line:{color:c}});
    s.addText(m.cat, { x:6.78,y,w:1.34,h:0.95, fontSize:10, bold:true, color:WHITE, valign:"middle", fontFace:"Calibri", margin:0});
    s.addShape(pres.shapes.RECTANGLE, { x:8.15,y,w:4.85,h:0.95, fill:{color:LIGHT_BG}, line:{color:c, pt:1.5}});
    s.addText(m.items, { x:8.22,y,w:4.72,h:0.95, fontSize:9.5, color:DARK_TEXT, valign:"middle", fontFace:"Calibri", margin:0});
  });

  foot(s);
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 10 — KEY TAKE-AWAYS
// ═══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.shapes.RECTANGLE, { x:0,y:0,w:13.3,h:7.5, fill:{color:NAVY}, line:{color:NAVY}});
  s.addShape(pres.shapes.RECTANGLE, { x:0,y:1.08,w:13.3,h:0.06, fill:{color:ACCENT}, line:{color:ACCENT}});
  s.addShape(pres.shapes.RECTANGLE, { x:0,y:6.9,w:13.3,h:0.06, fill:{color:GOLD}, line:{color:GOLD}});

  s.addText("KEY TAKE-AWAYS", {
    x:0.5,y:0.18,w:12.3,h:0.82, fontSize:28, bold:true, color:WHITE, align:"center", fontFace:"Calibri", charSpacing:8});

  const pts = [
    { n:"1", t:"RA is a symmetric polyarthritis", d:"Predominantly small joints (MCP, PIP, wrists). Morning stiffness >1 hour is hallmark. DIP sparing differentiates from OA.", c:TEAL },
    { n:"2", t:"RF + Anti-CCP (ACPA)", d:"ACPA is highly specific (~95%) and predictive of erosive disease. Present years before symptoms = preclinical RA.", c:PURPLE },
    { n:"3", t:"2010 ACR/EULAR criteria", d:"Score ≥6/10 = definite RA. Domains: joint involvement, serology, acute-phase reactants, symptom duration.", c:GREEN },
    { n:"4", t:"Methotrexate is drug of first choice", d:"csDMARD of choice for early RA. Always give folic acid. Escalate to 25 mg/wk. Triple therapy > monotherapy.", c:GOLD },
    { n:"5", t:"Treat-to-Target (T2T)", d:"Reassess every 1–3 months. Escalate if target (remission/LDA) not met within 3–6 months.", c:ACCENT },
    { n:"6", t:"Biologics for inadequate csDMARD response", d:"Anti-TNF agents are first-line biologics. Alternatives: tocilizumab, abatacept, rituximab. Oral JAK inhibitors available.", c:TEAL_LIGHT },
    { n:"7", t:"Screen before biologics", d:"TB, hepatitis B, varicella screen mandatory. Do not start anti-TNF in active infection.", c:ORANGE },
    { n:"8", t:"RA doubles cardiovascular mortality", d:"Monitor and treat CV risk factors aggressively. Osteoporosis prophylaxis in steroid users.", c:ACCENT },
  ];

  pts.forEach((p,i)=>{
    const col=i<4?0:1;
    const row=i<4?i:i-4;
    const x=col===0?0.3:6.85;
    const y=1.22+row*1.35;
    const w=6.25;
    s.addShape(pres.shapes.RECTANGLE, { x,y,w:0.65,h:1.2, fill:{color:p.c}, line:{color:p.c}});
    s.addText(p.n, { x,y,w:0.65,h:1.2, fontSize:22, bold:true, color:WHITE, align:"center", valign:"middle", fontFace:"Calibri", margin:0});
    s.addShape(pres.shapes.RECTANGLE, { x:x+0.65,y,w:w-0.65,h:1.2, fill:{color:"0A1F3C"}, line:{color:p.c, pt:1}});
    s.addText(p.t, { x:x+0.75,y:y+0.05,w:w-0.8,h:0.4, fontSize:11, bold:true, color:GOLD, fontFace:"Calibri", margin:0});
    s.addText(p.d, { x:x+0.75,y:y+0.43,w:w-0.82,h:0.72, fontSize:10, color:"CBD5E0", fontFace:"Calibri", margin:0});
  });

  s.addText("Source: Harrison's Principles of Internal Medicine 22E (2025)  |  Chapter 370: Rheumatoid Arthritis", {
    x:0,y:6.98,w:13.3,h:0.5, fontSize:9, color:GRAY, align:"center", valign:"middle", fontFace:"Calibri"});
}

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

cd /home/daytona/workspace/ascites-ppt && node create_ra_ppt.js

Your Rheumatoid Arthritis presentation is ready!

RA Harrisons 22E

Presentation · PPTX


The deck has 10 slides built entirely from Harrison's 22E (Chapter 370), styled in a bold navy/coral/gold palette with a real embedded image from the textbook:
SlideContent
1Title slide with 8-topic agenda panel
2Epidemiology & Risk Factors - 5 key statistics + genetic risk factors + environmental triggers + embedded Harrison's global prevalence map (Figure 370-1)
3Pathogenesis - 5-step cascade (Genetic trigger → Autoantibodies → T-cell activation → Cytokine storm → Pannus/joint destruction) + key therapeutic targets per mechanism
4Clinical Features - Articular features, joint deformities table (Boutonnière, Swan-neck, ulnar deviation), extra-articular features by organ system, autoantibodies (RF, ACPA, ESR/CRP, ANA)
52010 ACR/EULAR Classification Criteria - Full scoring table with color-coded scores (max 10; ≥6 = definite RA)
6Treatment Overview - NSAIDs, glucocorticoids, csDMARDs (MTX as drug of choice), biologic DMARDs with 5 mechanism classes
7DMARDs Table - 10 drugs with mechanism, dose, key toxicities, and monitoring requirements
8Treatment Algorithm - 5-step escalation strategy with treat-to-target principle
9Disease Activity Indices & Monitoring - DAS28, SDAI, CDAI, ACR criteria + clinical/lab/imaging/comorbidity monitoring
10Key Take-Aways - 8 high-yield clinical pearls

Find latest EULAR 2024 RA management guidelines with evidence summaries

Searching PubMed

EULAR recommendations management rheumatoid arthritis

Searching the Web

EULAR 2024 rheumatoid arthritis management guidelines update

Reading Web Page

https://www.news-medical.net/news/20260313/Updated-EULAR-rec…

Searching PubMed

EULAR recommendations rheumatoid arthritis DMARDs 2025 update Smolen

Searching the Web

Smolen EULAR 2025 RA recommendations annals rheumatic diseases DOI 10.1016/j.ard.2026.01.023

Reading Article

PMID: 41826212

Reading Article

PMID: 41997804

Reading Article

PMID: 41951459

Reading Web Page

https://www.guidelinecentral.com/guideline/5135295

I now have the full picture. Here is the comprehensive summary:

EULAR 2025 RA Management Recommendations

Correct name: "2025 Update" (not 2024) Full citation: Smolen JS, Edwards CJ, Konzett V, et al. EULAR recommendations for the management of rheumatoid arthritis with synthetic and biologic disease-modifying antirheumatic drugs: 2025 update. Ann Rheum Dis. 2026 Jun;85(6):991-1009. doi:10.1016/j.ard.2026.01.023 | PMID: 41826212 Published online: 12 March 2026. This is the 5th update since EULAR first published RA recommendations in 2010.

What Changed vs. 2022?

The number of individual recommendations was reduced from 12 to 9 (streamlined), and several key strategic changes were introduced:
ChangePrevious (2022)New (2025)
Recommendations count129 (streamlined)
Risk stratification after first DMARD failureStratify by risk factors for bad outcomeRemoved - DMARD failure itself is already a risk factor
DMARD tapering in sustained remissionDose reduction "may be considered"Preference for continuation; tapering still possible but explicit caution added
JAK inhibitorsConsidered after bDMARD failureMay be considered after csDMARD failure, but risk factors must be assessed first
Pre-RA preventionNot addressedAcknowledged but insufficient evidence for a recommendation yet

5 Overarching Principles

  1. Treatment must be aimed at best care and based on shared decision-making between patient and rheumatologist.
  2. Treatment decisions are based on disease activity, safety, and other patient factors (comorbidities, structural damage progression).
  3. Rheumatologists are the specialists who should primarily care for RA patients.
  4. Patients require access to multiple drugs with different modes of action due to RA heterogeneity; they may require successive therapies throughout life.
  5. RA incurs high individual, medical, and societal costs - all should be considered in management.

9 Individual Recommendations

Recommendation 1 - Start DMARDs Immediately

"DMARDs should be started as soon as the diagnosis of RA is made."
  • LoE 1a | SoR A

Recommendation 2 - Treat-to-Target (T2T)

"Treatment should be aimed at reaching a target of sustained remission or low disease activity in every patient."
  • LoE 1a | SoR A
  • Monitor every 1-3 months in active disease
  • If no improvement by 3 months → adjust therapy
  • If target not reached by 6 months → adjust therapy

Recommendation 3 - MTX First

"MTX should be part of the first treatment strategy."
  • LoE 1a | SoR A
  • If contraindicated or not tolerated early: use leflunomide or sulfasalazine

Recommendation 4 - Glucocorticoids as Bridge

"Short-term glucocorticoids should be considered when initiating or changing csDMARDs, in different dose regimens and routes of administration, but should be tapered and discontinued as rapidly as clinically feasible."
  • LoE 1a | SoR A
  • Purpose: bridging while awaiting DMARD effect - NOT long-term agents

Recommendation 5 - Escalate to bDMARD After csDMARD Failure

"If the treatment target is not achieved with the csDMARD strategy, a bDMARD should be added; JAK inhibitors may be considered, but pertinent risk factors must be taken into account."
  • Efficacy: LoE 1a | SoR A
  • Safety: LoE 2a | SoR B
  • JAK inhibitor risk factors to assess: MACEs, malignancy, VTE, age >65, long-term smoker, serious cardiovascular risk

Recommendation 6 - Combine bDMARDs/tsDMARDs with csDMARDs

"bDMARDs/tsDMARDs should be combined with a csDMARD; in patients who cannot use csDMARDs as comedication, IL-6 pathway inhibitors and JAK inhibitors may have some advantages compared with other bDMARDs."
  • LoE 1a | SoR A
  • Rationale: IL-6 inhibitors and JAKi have efficacy as monotherapy; TNF inhibitors and abatacept are less effective without MTX

Recommendation 7 - Switching After First bDMARD/JAKi Failure

"If the first bDMARD (or JAKi) fails, any other bDMARD (from another or the same class) or JAKi (considering risks) is recommended."
  • No mandatory class-switching required
  • Both within-class and between-class switching are acceptable

Recommendation 8 - Tapering in Sustained Remission

"With sustained remission (after glucocorticoids have been stopped), DMARD continuation is preferred; dose reduction may be considered."
  • LoE 5 | SoR D (key change: explicit preference for continuation over stopping)
  • Stopping treatment frequently leads to flare, especially with bDMARDs and JAKi

Recommendation 9 - Safety Monitoring

Embedded throughout - risk-based monitoring for:
  • JAKi: MACE, malignancy, VTE/PE, herpes zoster
  • TNF inhibitors: TB reactivation, infections, demyelination
  • All DMARDs: infection risk, immunizations before starting

Evidence Base: Supporting Systematic Literature Reviews

Two dedicated SLRs (published June 2026, Ann Rheum Dis) underpinned the update:

SLR 1 - Efficacy (PMID: 41997804)

  • Searched: Jan 2022 - Jan 2025 | 12,567 references screened | 72 studies included
  • Key findings:
    • Strategic trials confirmed bDMARD/tsDMARD strategies superior to csDMARD monotherapy in inadequate responders
    • Precision-medicine approaches (synovial biopsy-guided therapy, therapeutic drug monitoring) show promise but not yet practice-ready
    • Evidence on DMARD tapering reinforced caution against stopping
    • Nintedanib and pirfenidone evaluated for RA-ILD (included in ILD subgroup)
    • 7 studies on DMARDs for RA prevention in at-risk populations - insufficient for recommendation

SLR 2 - Safety (PMID: 41951459)

  • Searched: Jan 2022 - Jan 2025 | 3,837 articles | 71 studies included
  • Key safety signals:
Safety DomainKey Finding
Serious infectionsMore common with bDMARDs than csDMARDs
Herpes zosterHigher with JAKi than bDMARDs
TuberculosisHigher with infliximab/adalimumab vs etanercept; NOT increased with JAKi vs bDMARDs
MACE (cardiac events)No consistent increased risk with JAKi vs bDMARDs in new data
VTE/PEElevated with JAKi vs bDMARDs, driven mainly by pulmonary embolism
MalignancyIncreased NMSC with DMARDs overall vs general population; no drug-specific link
Glucocorticoid safetyUnder-studied in this period (surprisingly few new studies)

Additional 2024 EULAR Update Relevant to RA

EULAR 2024 update on antirheumatic drugs in reproduction, pregnancy, and lactation:
Rüegg L, et al. Ann Rheum Dis. 2025;84(6):910-26.
Key points for RA patients of reproductive age:
  • Methotrexate and leflunomide: contraindicated in pregnancy (teratogenic) - washout required
  • Hydroxychloroquine: safe in pregnancy and breastfeeding
  • TNF inhibitors: most can be continued into pregnancy (certolizumab has lowest placental transfer)
  • JAK inhibitors: avoid in pregnancy - insufficient safety data

Summary: What This Means in Practice

  1. Start MTX + short-course glucocorticoids immediately on diagnosis
  2. Reassess at 3 months - escalate if no improvement; target remission/LDA by 6 months
  3. If csDMARD fails → add bDMARD first (anti-TNF remains first choice by experience); JAKi are an option but screen for cardiovascular risk, VTE risk, malignancy history, and age >65 first
  4. Any bDMARD/JAKi failure → switch class or within-class - both acceptable
  5. In sustained remission → keep the DMARD (reduce dose if needed, but don't stop)
  6. No new drugs approved since 2022 - guidance refined by strategic and safety evidence

Make flowchar on treatment

Generating Image

A professional clinical treatment flowchart for Rheumatoid Arthritis management based on EULAR 2025 recommendations. Clean white background, medical style, color-coded boxes with arrows. Title at top: "RHEUMATOID ARTHRITIS: Treatment Algorithm" with subtitle "EULAR 2025 Recommendations | Smolen et al., Ann Rheum Dis 2026" The flowchart flows top-to-bottom with clear arrows: START BOX (dark navy blue, rounded): "NEW DIAGNOSIS OF RA" with note: "Start DMARDs IMMEDIATELY after diagnosis" ↓ arrow STEP 1 BOX (green): "FIRST-LINE: csDMARD Therapy" • Methotrexate (MTX) — drug of first choice • If MTX contraindicated: Leflunomide or Sulfasalazine • Add short-term Glucocorticoids as bridge (taper ASAP) • Add Folic acid with MTX ↓ arrow DECISION DIAMOND (orange): "Reassess at 3 months — Target achieved? (Remission or LDA)" Two branches: → YES branch (right side, green): "CONTINUE current therapy. Monitor every 1–3 months. If sustained remission → prefer DMARD continuation; dose reduction may be considered" → NO branch (downward, red): "Not at target by 3–6 months → ESCALATE" ↓ from NO STEP 2 BOX (blue): "ADD bDMARD (preferred) or consider JAKi" Preferred bDMARDs: • Anti-TNF: Adalimumab, Etanercept, Infliximab, Certolizumab, Golimumab • Abatacept (anti-CD80/86) • Tocilizumab / Sarilumab (IL-6 inhibitors) • Rituximab (anti-CD20) JAK Inhibitors (assess risk first): ⚠ Screen for: MACE risk, VTE/PE risk, malignancy history, age >65, heavy smoker • Tofacitinib, Baricitinib, Filgotinib, Upadacitinib Important note box (yellow): "Combine bDMARD/JAKi with csDMARD. If csDMARD not tolerated: IL-6i or JAKi preferred (effective as monotherapy)" ↓ arrow DECISION DIAMOND (orange): "Response adequate? Target reached?" → YES (green right branch): "Continue. Sustained remission → prefer continuation, reduce dose cautiously" → NO (red downward): "bDMARD or JAKi failure" ↓ STEP 3 BOX (purple): "SWITCH bDMARD or JAKi" • Switch to different class bDMARD, OR • Switch within same class, OR • Switch to JAKi (if not used; assess risks) • Both within-class and between-class switching acceptable ↓ arrow BOTTOM BOX (dark navy): "Throughout all steps: Reassess every 1–3 months | Glucocorticoids: bridge only — taper and stop | Shared decision-making with patient at every step" Small red warning box on side: "⚠ JAKi Risk Factors — Assess before use: Age >65 | Cardiovascular disease | Prior malignancy | VTE/Pulmonary embolism history | Long-term smoker" The flowchart uses color-coded sections: green for first-line, blue for second-line, purple for third-line, orange for decision points, red arrows for failure paths, green arrows for success paths.

EULAR 2025 RA Treatment Flowchart
The flowchart covers the full EULAR 2025 treatment algorithm:
Step 1 - First-line (Green): MTX + short-term glucocorticoids immediately on diagnosis
Decision at 3 months: Target (remission/LDA) achieved?
  • Yes → Continue + monitor
  • No → Escalate
Step 2 - Second-line (Blue): Add bDMARD (preferred) or JAKi (after risk screening). Combine with csDMARD where possible - IL-6 inhibitors and JAKi work as monotherapy if csDMARD not tolerated.
JAKi Warning Panel (Red): Screen for MACE risk, VTE/PE history, malignancy, age >65, smoking before prescribing.
Step 3 - Switch (Purple): If bDMARD/JAKi fails - switch within-class or between-class, both are acceptable.
Bottom principle: In sustained remission - prefer DMARD continuation; stopping frequently causes flare.

Treatment of tuberculosis based on harrison's

Reading File
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
I now have all the content needed for a comprehensive answer. Here is the full Harrison's-based treatment of tuberculosis:

Treatment of Tuberculosis

Harrison's Principles of Internal Medicine, 22nd Edition (2025) — Chapters 183 & 186

Part 1: Latent TB Infection (LTBI) Treatment

LTBI = M. tuberculosis infection without active disease. Treated to prevent progression to active TB.
RegimenDoseDurationNotes
Isoniazid + Rifapentine (3HP)INH 900 mg + RPT 900 mg, once weekly3 monthsRegimen of choice in children >2 yr and all adults including HIV+. DOT recommended. Not for pregnant women.
Rifampin alone600 mg/day (10 mg/kg)4 monthsPreferred in HIV-negative individuals; insufficient data for HIV+
Isoniazid + RifampinINH 300 mg/d + RIF 600 mg/d3 monthsHigher hepatotoxicity risk vs individual drugs
Isoniazid alone300 mg/d (or 900 mg twice weekly)6-9 months9 months more effective but higher hepatotoxicity; twice-weekly requires DOT
Key principle: Shorter rifamycin-based regimens (3HP, 4R, or 3HR) are currently preferred over 6-9 months of isoniazid alone in adults and children for effectiveness, safety, and tolerability.

Part 2: Active TB Disease - Drug-Susceptible (Standard Treatment)

Standard 6-Month Regimen (HRZE → HR)

PhaseDrugsDurationFrequency
Intensive phaseHINH + Rifampin + ZPyrazinamide + Ethambutol2 monthsDaily (preferred); 3×/week with dose adjustment acceptable in non-HIV, non-cavitary
Continuation phaseHINH + Rifampin4 monthsDaily or 5 days/week
Total6 months

When to Extend the Continuation Phase

SituationExtension
HIV+ and NOT on ARTExtend continuation phase to 7 months (total 9 months)
Prolonged culture conversion (>2 months)Extend continuation phase to 7 months
Cavitation on chest X-rayExtend continuation phase to 7 months
Culture-negative TBContinuation phase only 2 months (total 4 months); extend to 4 months if HIV+

New 4-Month Regimen (2023/2025 Evidence)

A large multinational RCT showed a 4-month regimen of:
  • Rifapentine + Isoniazid + Pyrazinamide + Moxifloxacin (8 weeks) → Rifapentine + Isoniazid + Moxifloxacin (9 weeks)
  • Non-inferior to standard 6-month HRZE regimen
  • Includes HIV+ patients with CD4 >100
  • Conditional recommendation by WHO and US guidelines
  • Concerns: higher pill burden, moxifloxacin side effects, need for fluoroquinolone resistance testing in high-resistance areas

Part 3: First-Line Antituberculosis Drugs

Isoniazid (INH / H)

  • Mechanism: Prodrug activated by KatG catalase-peroxidase → inhibits InhA (ketoenoyl-reductase) → blocks mycolic acid synthesis + free radical release
  • Dose: 300 mg/day (or 5 mg/kg/day); 900 mg twice weekly for intermittent regimens
  • Key toxicities: Hepatotoxicity (monitor LFTs), peripheral neuropathy (prevent with pyridoxine 25-50 mg/day), drug-induced lupus
  • Always give with pyridoxine (Vitamin B6) 25-50 mg/day to prevent neuropathy
  • Diffuses into CSF at concentrations comparable to serum - effective for TB meningitis
  • Resistance: ~7-8% primary resistance in the US (katG and inhA gene mutations)

Rifampin (RIF / R)

  • Mechanism: Inhibits DNA-dependent RNA polymerase (rpoB gene) → blocks mRNA transcription
  • Dose: 600 mg/day (10 mg/kg/day)
  • Key features: Bactericidal AND sterilizing activity against both dividing and non-dividing organisms. Introduced in 1968 - allowed shortening of treatment from years to 6 months
  • Key toxicities: Hepatotoxicity, orange discoloration of secretions/urine, drug interactions (potent CYP450 inducer - lowers levels of protease inhibitors, OCPs, warfarin, etc.)
  • Resistance: rpoB mutations in 95% of cases

Pyrazinamide (PZA / Z)

  • Mechanism: Active at acidic pH within macrophages → kills intracellular organisms
  • Dose: 25 mg/kg/day
  • Key feature: Its inclusion for 2 months allows shortening treatment from 9 to 6 months and decreases relapse rates
  • Key toxicities: Hepatotoxicity, hyperuricemia/gout, arthralgia
  • Avoid in liver failure and in pregnant women (US guidelines - insufficient safety data)
  • Resistance: pncA gene mutations (up to 98%)

Ethambutol (EMB / E)

  • Mechanism: Inhibits arabinosyltransferase (EmbB) → disrupts arabinogalactan in cell wall
  • Dose: 15-20 mg/kg/day
  • Key toxicity: Optic neuritis (dose-dependent) - monthly visual acuity + color vision testing
  • Used in intensive phase to prevent emergence of resistance; can be stopped once drug susceptibility confirmed
  • Resistance: embB gene mutations (50-65%)
  • Avoid or monitor carefully in renal failure (requires level monitoring)

Part 4: Extrapulmonary TB - Duration Modifications

SiteStandard RecommendationExtended Duration
Most extrapulmonary TB (including miliary)Standard 6-month HRZE/HR regimenNo extension needed
TB MeningitisHRZE × 2 months + HR × 7-10 months (ATS/CDC/IDSA)Total: 9-12 months
Bone & Joint TB6 months standard; some extend to 9 monthsChildren: up to 12 months (WHO)
SilicotuberculosisExtend by at least 2 extra months
Always add glucocorticoids in TB meningitisDexamethasone reduces mortality

Part 5: Drug-Resistant TB

Definitions

  • Isoniazid-resistant TB (Hr-TB): Resistant to INH only; rifampin susceptible
  • RR-TB: Rifampin-resistant (any)
  • MDR-TB: Resistant to both isoniazid AND rifampin
  • Pre-XDR-TB: MDR + resistant to any fluoroquinolone
  • XDR-TB: MDR + resistant to fluoroquinolone + at least one Group A drug (bedaquiline or linezolid)

Isoniazid-Resistant TB (Hr-TB)

Regimen: Rifampin + Ethambutol + Pyrazinamide + Levofloxacin × 6 months
  • Fluoroquinolone must be confirmed susceptible before use
  • If fluoroquinolone contraindicated: RIF + EMB + PZA × 6 months

RR-TB / MDR-TB

Three approved regimens:
RegimenDrugsDurationEligibility
BPaLM (preferred)Bedaquiline + Pretomanid + Linezolid + Moxifloxacin6 monthsPre-XDR or XDR or intolerant/resistant to first-line agents
WHO Short-CourseBedaquiline + fluoroquinolone + linezolid + clofazimine ± others9 monthsNo prior second-line exposure; fluoroquinolone susceptible
Extended regimenIndividualized based on DST18-20 monthsThose not qualifying for short-course regimens
Cardinal rule in failing regimens: Always add more than one drug (2-3) at a time to a failing regimen - never add a single agent (causes acquired resistance).

Part 6: TB in Special Populations

TB + HIV

  • Start anti-TB treatment first, then initiate ART within 2 weeks (especially if CD4 <50/µL)
  • Exception: TB Meningitis - delay ART for 8 weeks regardless of CD4 count (paradoxical IRIS risk is severe)
  • Use rifampin-compatible ART: Dolutegravir (double dose) or Raltegravir + 2 NRTIs; OR Efavirenz + 2 NRTIs
  • Avoid intermittent regimens in all HIV+ TB patients - daily rifampin only
  • Standard 6-month daily regimen is equally effective in HIV+ and HIV- patients with drug-susceptible TB

TB in Pregnancy

Regimen: INH + RIF + EMB × 2 months → INH + RIF × 7 months (total 9 months)
  • Avoid streptomycin - causes 8th cranial nerve damage in fetus (cochleotoxicity)
  • Pyrazinamide - not recommended in the US (insufficient safety data); WHO recommends it
  • Avoid: Thioamides (ethionamide/prothionamide), bedaquiline, delamanid in MDR-TB in pregnancy
  • Breastfeeding is NOT contraindicated; drug levels in breast milk are too low to be therapeutic

TB in Renal Failure

  • Never use aminoglycosides
  • Ethambutol: use only if serum levels can be monitored
  • INH, RIF, PZA: usual doses in mild-moderate renal failure; reduce PZA dose in severe renal failure

TB in Hepatic Disease

  • Severe hepatic disease: Use EMB + streptomycin ± fluoroquinolone (avoid hepatotoxic drugs)
  • Avoid PZA in liver failure
  • INH and RIF may be used under close supervision if required

Part 7: TB Preventive Treatment (TPT) - Summary Table

Based on Table 183-6, Harrison's 22E:
RegimenDoseDurationAdverse Events
Isoniazid + Rifapentine (3HP)INH 900 mg + RPT 900 mg weekly3 monthsSystemic drug reaction, flu-like symptoms, hepatotoxicity
Rifampin (4R)600 mg/day4 monthsHepatotoxicity, drug interactions
Isoniazid + Rifampin (3HR)INH 300 mg/d + RIF 600 mg/d3 monthsHigher hepatotoxicity risk
Isoniazid (6H or 9H)300 mg/day or 900 mg twice weekly6-9 monthsHepatotoxicity (dose and duration dependent), neuropathy

Part 8: Directly Observed Therapy (DOT)

  • DOT is recommended for all intermittent regimens and for patients with:
    • History of non-adherence
    • Substance use disorders
    • MDR/XDR-TB
    • Homelessness or social instability
  • Patient support and supervision are critical principles: "sound treatment = at least 2 susceptible bactericidal drugs + DOT + verification of course completion"

Sources: Harrison's Principles of Internal Medicine 22E (2025), Chapters 183 (Tuberculosis, pp. 1433-1444) and 186 (Antimycobacterial Agents, pp. 1462-1465)
This is a shared conversation. Sign in to Orris to start your own chat.