approach to acute liver failure in children a case based scenario

Reading File
Finding Sources
Finding Sources
Searching PubMed

"acute liver failure" AND children

Finding Sources
Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Reading File
Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Finding Sources
I now have comprehensive material from multiple sources. Let me compile the full case-based educational response on Pediatric Acute Liver Failure (PALF).

Approach to Acute Liver Failure in Children: A Case-Based Scenario


THE CASE

A 9-year-old boy presents to the emergency department with a 5-day history of jaundice, fatigue, and vomiting. His parents report he had a "flu-like" illness 2 weeks ago. On day 3, they noticed his eyes turning yellow. Today he is confused and difficult to arouse.
Examination:
  • Deeply jaundiced, icteric sclerae
  • GCS 12/15, disoriented to place and time
  • Febrile 38.6°C, HR 118, BP 90/60
  • Liver not palpable (shrunken), no splenomegaly
  • No asterixis (difficult to assess in children)
  • Bilateral Babinski signs
Labs:
  • AST 4,200 U/L, ALT 3,800 U/L
  • Total bilirubin 18 mg/dL (direct 14)
  • INR 3.8, PT 38 seconds
  • Serum ammonia 210 µmol/L
  • Creatinine 1.4 mg/dL (elevated for age)
  • Blood glucose 52 mg/dL (hypoglycemia)
  • pH 7.31, lactate 4.1 mmol/L

STEP 1: RECOGNIZE AND DEFINE PALF

Pediatric Acute Liver Failure (PALF) is defined by:
  • Severe hepatic dysfunction within 8 weeks of illness onset
  • No underlying liver disease
  • Liver-based coagulopathy:
    • INR ≥ 1.5 with encephalopathy, OR
    • INR ≥ 2.0 (PT ≥ 20 s) without encephalopathy
This boy meets all criteria: INR 3.8 + encephalopathy (confusion) = PALF confirmed.
Key point - pediatric definition differs from adults: In adults, encephalopathy is a mandatory component. In children, encephalopathy can be subtle or absent (younger children can't demonstrate asterixis), so coagulopathy alone with INR ≥2.0 qualifies. This is important because encephalopathy is underdiagnosed in children due to more subtle manifestations. - Fischer's Mastery of Surgery, 8e; Bradley and Daroff's Neurology in Clinical Practice
PALF was historically associated with mortality rates of 70-95%; with modern ICU care and liver transplantation, this has decreased to approximately 30%. - Fischer's Mastery of Surgery, 8e

STEP 2: IMMEDIATE STABILIZATION (ABC + METABOLIC RESCUE)

Airway & Neurological

  • Grade the encephalopathy:
    • Grade 1: Subtle, minimal change in consciousness
    • Grade 2: Disoriented, inappropriate behavior
    • Grade 3: Somnolent but arousable
    • Grade 4: Comatose
    • This boy is Grade 2-3; anticipate rapid progression
  • Position: head of bed at 30 degrees
  • Intubate early (at Grade 3 encephalopathy) - do NOT wait for Grade 4
  • Minimize stimulation; use sedation to reduce ICP

Metabolic Emergencies - Address Immediately

ProblemTargetIntervention
Hypoglycemia (glucose 52)≥ 70 mg/dLD10W infusion; check q1-2h
Coagulopathy (INR 3.8)Do NOT correct unless bleedingFresh frozen plasma (FFP) or Vitamin K only if active bleed or procedure
Hyperammonemia (210 µmol/L)ReduceEnteral lactulose (limited evidence in ALF vs cirrhosis); restrict dietary protein temporarily
Acidosis (pH 7.31, lactate 4.1)CorrectCautious fluid resuscitation; identify sepsis
Hypotension (BP 90/60)MAP ≥ 60IV fluid bolus; consider norepinephrine
Critical note on coagulopathy: In ALF, the INR reflects loss of synthetic function but NOT actual bleeding risk, since clotting inhibitors (protein C, S) are also lost. Do NOT reflexively transfuse FFP to "correct" the INR - this obscures the trend, which is the most useful prognostic marker. - Goldman-Cecil Medicine
Note on lactulose: Unlike in cirrhosis, lactulose has never been shown to improve survival in ALF. Therapeutic focus should be on reducing ICP directly. - Current Surgical Therapy, 14e

STEP 3: URGENT TRANSFER

"Patients suspected of having ALF should be immediately transferred to a liver transplant center because this can progress very rapidly to fulminant liver failure and then death." - Current Surgical Therapy, 14e
Children with PALF should be transferred to a transplant center for urgent evaluation and possible listing. - Fischer's Mastery of Surgery, 8e

STEP 4: DETERMINE THE ETIOLOGY (Parallel Workup)

In 50% of pediatric cases, the etiology remains indeterminate even after full workup - compared with only ~15% of adult cases. - Robbins, Cotran & Kumar Pathologic Basis of Disease
Use the mnemonic A-B-C-D-E-F to organize causes:
LetterEtiology
AAcetaminophen toxicity, Hepatitis A, Autoimmune hepatitis
BHepatitis B
CHepatitis C, Cryptogenic
DDrugs/toxins (idiosyncratic DILI), Hepatitis D
EHepatitis E, Esoteric causes (Wilson disease, Budd-Chiari, lymphoma)
FFatty change - microvesicular (Reye syndrome, valproate, tetracycline, fatty liver of pregnancy)
Robbins, Cotran & Kumar Pathologic Basis of Disease

Pediatric-Specific Causes to Prioritize:

Metabolic/Genetic (especially in younger children):
  • Wilson disease - copper accumulation; presents in children >5 years; treatable with D-penicillamine or chelation; liver transplant is curative
  • Tyrosinemia type 1 - neonates/infants
  • Galactosemia, hereditary fructose intolerance - neonates
  • Mitochondrial disorders (POLG mutations) - recurrent PALF; consider in genetic workup
  • Reye syndrome - acute encephalopathy + microvesicular steatosis in children/adolescents; associated with salicylates + viral illness
Infectious:
  • Viral hepatitis (A, B, E)
  • EBV, CMV, HSV, adenovirus (especially in immunocompromised)
  • Dengue (consider in endemic regions)
Autoimmune hepatitis - commonly presents as acute/fulminant in children; important to identify as it may respond to steroids (controversial in ALF setting)

Minimum Workup Panel:

CategoryTests
ViralAnti-HAV IgM, HBsAg, Anti-HBc IgM, Anti-HCV, HCV-RNA, Anti-HEV IgM, EBV/CMV/HSV serology, HSV PCR, adenovirus PCR
MetabolicSerum ceruloplasmin, 24h urine copper, slit-lamp exam (Wilson), urine reducing substances, plasma amino acids, urine organic acids, lactate/pyruvate ratio
AutoimmuneANA, ASMA, anti-LKM1, serum IgG
ToxicologyAcetaminophen level, drug screen, salicylate level
OthersBlood cultures, ferritin (HLH), triglycerides, bone marrow biopsy if HLH suspected

STEP 5: MONITOR FOR AND MANAGE COMPLICATIONS

1. Cerebral Edema and Raised ICP

This is the #1 cause of death in fulminant hepatic failure. Cerebral edema develops in ~80% of patients who reach Grade 4 encephalopathy. - Current Surgical Therapy, 14e
Mechanism: Hyperammonemia drives cerebral astrocyte swelling via glutamine accumulation.
Management:
  • ICP monitoring (consider invasive monitoring in Grade 3-4 encephalopathy)
  • Head of bed elevated 30°
  • Minimize stimulation, sedation/neuromuscular blockade
  • Mannitol 0.5-1 g/kg IV bolus for ICP spikes (if serum osmolality < 320 mOsm/L)
  • Hypertonic saline to maintain serum Na 145-155 mEq/L (osmotic control)
  • Avoid hyperthermia, hypoxia, hypotension - all worsen cerebral edema
  • CT head: insensitive early, but rules out intracranial hemorrhage; needed in Grade 3-4 - Current Surgical Therapy, 14e

2. Coagulopathy and Bleeding

  • Vitamin K 1 mg/kg IV (up to 10 mg max) to rule out deficiency
  • FFP or cryoprecipitate only for active bleeding or invasive procedures
  • Avoid routine prophylactic correction (masks INR trend)
  • PPI/H2 blocker for GI prophylaxis

3. Hepatorenal Syndrome (HRS) / Acute Kidney Injury

  • Avoid nephrotoxic drugs (NSAIDs, aminoglycosides, contrast)
  • Careful fluid management; monitor urine output strictly
  • Renal replacement therapy (CVVH) if needed

4. Infection and Sepsis

  • Common organisms: Gram-positive cocci, Candida species
  • Low threshold for blood/urine/BAL cultures and empirical antibiotics
  • Fungal prophylaxis in severe cases

5. Hemodynamic Instability

  • Splanchnic vasodilation leads to distributive shock
  • Norepinephrine preferred vasopressor; terlipressin for HRS

6. Metabolic

  • Hypoglycemia: continuous glucose monitoring, D10W infusion
  • Hyponatremia: restrict free water; hypertonic saline to maintain Na 145-155
  • Metabolic acidosis: treat underlying cause

7. Respiratory

  • Risk of pulmonary edema (from fluid overload) and ARDS
  • Early intubation at Grade 3 encephalopathy

STEP 6: APPLY PROGNOSTIC CRITERIA - WHEN TO LIST FOR TRANSPLANT?

King's College Criteria (Box 1)

For Acetaminophen-induced ALF:
  • pH < 7.3, OR
  • INR > 6.5 AND serum creatinine > 3.4 mg/dL
For Non-Acetaminophen ALF:
  • INR > 6.5, OR any 3 of the following:
    • INR > 3.5
    • Bilirubin > 17.6 mg/dL
    • Age < 10 or > 40 years
    • Cause: drug toxicity
    • Time from onset of jaundice to encephalopathy > 7 days
Positive predictive value: 80-100% - Current Surgical Therapy, 14e
Our patient: Age 9 (< 10), bilirubin 18 (> 17.6 mg/dL), INR 3.8 (> 3.5) = 3 criteria met → MEETS King's College criteria → List for transplant

Serial Biomarkers for Prognosis

Track the following serially every 6-12 hours:
  • INR / Factor V level - Factor V has the shortest half-life; most sensitive marker of hepatic regeneration vs. deterioration
  • Serum bilirubin trend (rising = poor)
  • Serum pH and lactate (persistent acidosis = poor prognosis)
  • Arterial ammonia (> 150-200 µmol/L correlates with cerebral herniation risk)
  • Serum creatinine (rising = HRS / multi-organ failure)
Improvement in Factor V or INR over 24-48h is the most reassuring sign of hepatic regeneration and possible avoidance of transplant.

STEP 7: SPECIFIC THERAPIES (ETIOLOGY-DIRECTED)

EtiologySpecific Treatment
AcetaminophenN-acetylcysteine (NAC) IV: 150 mg/kg over 1h, then 50 mg/kg over 4h, then 100 mg/kg over 16h. Continue beyond standard protocol in ALF.
Autoimmune hepatitisIV methylprednisolone 1-2 mg/kg/day (if ALF - controversial; consult hepatology)
Wilson diseaseD-penicillamine + zinc; consider plasmapheresis as bridge to transplant; transplant is curative
HSV hepatitisIV acyclovir 15-30 mg/kg/day
EBV/CMVIVIG; consider ganciclovir in immunocompromised
Hemophagocytic lymphohistiocytosis (HLH)Dexamethasone + etoposide (HLH-2004 protocol)
Mushroom poisoning (Amanita phalloides)Silibinin (milk thistle extract), NAC, supportive care
GalactosemiaRemove galactose from diet immediately

STEP 8: TRANSPLANT LISTING AND OUTCOMES

Liver transplantation is the only definitive treatment for patients with fulminant liver failure who meet criteria. - Current Surgical Therapy, 14e
PALF-specific outcomes post-transplant:
  • 1-year patient survival: 73% (vs. 89% for biliary atresia)
  • 1-year graft survival: 59% (vs. 78% for biliary atresia)
  • Listing rates have decreased (7.7% in 2020) due to improved medical management
Options:
  • Whole liver transplant (deceased donor)
  • Living-donor split liver transplant (smaller pediatric recipients)
  • Auxiliary partial orthotopic liver transplant (APOLT) - allows native liver to potentially regenerate; immunosuppression can be weaned if regeneration occurs
Decision challenge: Listing is difficult because some children recover with medical management alone, while transplant commits to lifelong immunosuppression and lower graft/patient survival. This must be discussed with family transparently.

CASE OUTCOME

This patient was:
  1. Intubated for Grade 3 encephalopathy progressing to Grade 4
  2. Transferred to the PICU of a liver transplant center
  3. Worked up: Ceruloplasmin low (0.07 g/L), urine copper high, slit-lamp confirmed Kayser-Fleischer rings → Wilson disease diagnosed
  4. Started on D-penicillamine + zinc; plasmapheresis initiated as bridge
  5. Liver transplant listed; received living-donor transplant from parent on Day 7
  6. Post-transplant course complicated by early rejection; treated with pulse steroids
  7. Discharged Day 28 on tacrolimus; full recovery, Wilson disease cured

SUMMARY ALGORITHM

Child with jaundice + coagulopathy + altered mental status
               ↓
         CONFIRM PALF
   (INR ≥1.5 + encephalopathy OR INR ≥2.0)
               ↓
   STABILIZE: ABC, glucose, ICP control
               ↓
   TRANSFER to transplant center URGENTLY
               ↓
   PARALLEL: Etiology workup + Monitor complications
               ↓
   Apply King's College Criteria (serial INR, Factor V)
               ↓
   Etiology-directed therapy + Bridge support
               ↓
   TRANSPLANT if criteria met or deteriorating

Recent Evidence (2024-2025)

  • Autoimmune hepatitis presenting as PALF (PMID 38700362): Individual patient data meta-analysis (2024) found specific patterns of response to immunosuppression; early steroid trial reasonable but requires expert oversight.
  • Recurrent PALF (PMID 41159810): Systematic review (2025) characterized phenotype and long-term outcomes; recurrent PALF often linked to genetic/metabolic causes (especially mitochondrial POLG mutations) and carries high mortality - always pursue genetic workup after first episode.
  • Dengue-associated ALF (PMID 39024894): Significant incidence of ALF in dengue infection; relevant in tropical/endemic regions.

Sources: Fischer's Mastery of Surgery, 8e | Current Surgical Therapy, 14e | Goldman-Cecil Medicine | Robbins, Cotran & Kumar Pathologic Basis of Disease | Robbins & Kumar Basic Pathology | Bradley and Daroff's Neurology in Clinical Practice

i need to preaseant a seminar on this around 25 slides and as a pg resident to faculty so give me asinformastion per powerpoint slide and mention everything necessary and avoid whats not important

Reading File
Reading File
Reading File
Reading File
Running Command

ls /home/daytona/workspace/ 2>/dev/null || echo "workspace empty or not found"

Running Command

mkdir -p /home/daytona/workspace/palf-seminar && ls /home/daytona/workspace/palf-seminar/

Writing File

~/palf-seminar/build.js

const pptxgen = require("pptxgenjs");
const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Pediatric Acute Liver Failure";
pres.author = "PG Resident Seminar";

// ─── COLOUR PALETTE ────────────────────────────────────────────────
const C = {
  navy:    "0D2B55",   // dominant dark
  teal:    "0E7C86",   // accent
  amber:   "E8A838",   // highlight / warning
  red:     "C0392B",   // danger / critical
  light:   "EDF4F8",   // slide background
  white:   "FFFFFF",
  darkTxt: "1A2B3C",
  midTxt:  "2C4A6E",
  subTxt:  "5B7FA6",
};

// ─── HELPERS ───────────────────────────────────────────────────────

function titleBar(slide, title, subtitle) {
  // dark header band
  slide.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 10, h: 0.9, fill: { color: C.navy }, line: { color: C.navy } });
  slide.addText(title, { x: 0.3, y: 0, w: 9, h: 0.9, fontSize: 20, bold: true, color: C.white, valign: "middle", margin: 0 });
  if (subtitle) {
    slide.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0.9, w: 10, h: 0.28, fill: { color: C.teal }, line: { color: C.teal } });
    slide.addText(subtitle, { x: 0.3, y: 0.9, w: 9.4, h: 0.28, fontSize: 11, color: C.white, valign: "middle", margin: 0, italic: true });
  }
  slide.background = { color: C.light };
}

function sectionDivider(slide, sectionNum, sectionTitle, description) {
  slide.background = { color: C.navy };
  slide.addShape(pres.shapes.RECTANGLE, { x: 0, y: 2, w: 10, h: 0.08, fill: { color: C.teal }, line: { color: C.teal } });
  slide.addText(`SECTION ${sectionNum}`, { x: 0.6, y: 0.7, w: 8.8, h: 0.6, fontSize: 14, color: C.amber, bold: true, charSpacing: 4, margin: 0 });
  slide.addText(sectionTitle, { x: 0.6, y: 1.3, w: 8.8, h: 0.9, fontSize: 32, color: C.white, bold: true, margin: 0 });
  slide.addText(description, { x: 0.6, y: 2.2, w: 8.8, h: 1, fontSize: 14, color: C.subTxt.replace("5B7FA6", "8BAED1"), italic: true, margin: 0 });
}

function bullets(slide, items, opts = {}) {
  const { x=0.3, y=1.3, w=9.4, h=3.8, fs=14, color=C.darkTxt, indent=0.3, bold=false } = opts;
  const textArr = items.map((item, i) => ({
    text: item,
    options: { bullet: { indent: indent * 914400/100 || true }, breakLine: i < items.length - 1, fontSize: fs, color, bold }
  }));
  slide.addText(textArr, { x, y, w, h, valign: "top", margin: 0 });
}

function twoCol(slide, leftItems, rightItems, opts = {}) {
  const { yStart=1.3, fs=13 } = opts;
  const leftArr = leftItems.map((item, i) => ({
    text: item, options: { bullet: true, breakLine: i < leftItems.length - 1, fontSize: fs, color: C.darkTxt }
  }));
  const rightArr = rightItems.map((item, i) => ({
    text: item, options: { bullet: true, breakLine: i < rightItems.length - 1, fontSize: fs, color: C.darkTxt }
  }));
  slide.addShape(pres.shapes.RECTANGLE, { x: 0.25, y: yStart, w: 4.55, h: 3.9, fill: { color: "DEEAF4" }, line: { color: "C0D6E8" } });
  slide.addShape(pres.shapes.RECTANGLE, { x: 5.2,  y: yStart, w: 4.55, h: 3.9, fill: { color: "FFF8EC" }, line: { color: "F0D9A0" } });
  slide.addText(leftArr,  { x: 0.4, y: yStart + 0.1, w: 4.2, h: 3.7, valign: "top", margin: 0 });
  slide.addText(rightArr, { x: 5.35, y: yStart + 0.1, w: 4.2, h: 3.7, valign: "top", margin: 0 });
}

function infoBox(slide, label, content, x, y, w, h, boxColor="DEEAF4", borderColor="0E7C86") {
  slide.addShape(pres.shapes.RECTANGLE, { x, y, w, h, fill: { color: boxColor }, line: { color: borderColor, pt: 1.5 } });
  slide.addText([
    { text: label + "\n", options: { bold: true, fontSize: 11, color: C.teal, breakLine: true } },
    { text: content,       options: { fontSize: 12, color: C.darkTxt } }
  ], { x: x+0.1, y: y+0.08, w: w-0.2, h: h-0.15, valign: "top", margin: 0 });
}

function warningBox(slide, text, x, y, w) {
  slide.addShape(pres.shapes.RECTANGLE, { x, y, w, h: 0.5, fill: { color: "FDECEA" }, line: { color: C.red, pt: 1.5 } });
  slide.addText("⚠  " + text, { x: x+0.1, y: y+0.02, w: w-0.2, h: 0.46, fontSize: 11, color: C.red, bold: true, valign: "middle", margin: 0 });
}

function footer(slide, num, total=25) {
  slide.addShape(pres.shapes.RECTANGLE, { x: 0, y: 5.3, w: 10, h: 0.325, fill: { color: C.navy }, line: { color: C.navy } });
  slide.addText("Pediatric Acute Liver Failure  |  PG Seminar", { x: 0.3, y: 5.3, w: 7, h: 0.325, fontSize: 9, color: "8BAED1", valign: "middle", margin: 0 });
  slide.addText(`${num} / ${total}`, { x: 9.2, y: 5.3, w: 0.7, h: 0.325, fontSize: 9, color: "8BAED1", valign: "middle", align: "right", margin: 0 });
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 1 — TITLE SLIDE
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.navy };
  // Teal accent stripe
  s.addShape(pres.shapes.RECTANGLE, { x: 0, y: 3.6, w: 10, h: 0.07, fill: { color: C.teal }, line: { color: C.teal } });
  s.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 0.18, h: 5.625, fill: { color: C.teal }, line: { color: C.teal } });
  s.addText("PEDIATRIC ACUTE LIVER FAILURE", {
    x: 0.45, y: 0.8, w: 9.2, h: 1.2, fontSize: 36, bold: true, color: C.white, align: "left", valign: "middle", margin: 0, charSpacing: 1
  });
  s.addText("A Case-Based Approach for the PG Resident", {
    x: 0.45, y: 2.0, w: 9.2, h: 0.55, fontSize: 18, color: C.amber, align: "left", margin: 0
  });
  s.addText("Seminar Presentation  |  Dept. of Pediatrics", {
    x: 0.45, y: 3.8, w: 9.2, h: 0.4, fontSize: 13, color: "8BAED1", align: "left", margin: 0
  });
  s.addText("Sources: Fischer's Mastery of Surgery 8e  •  Goldman-Cecil Medicine  •  Robbins Pathologic Basis of Disease", {
    x: 0.45, y: 4.85, w: 9.2, h: 0.35, fontSize: 9, color: "5A7EA0", align: "left", margin: 0
  });
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 2 — CASE INTRODUCTION
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  titleBar(s, "THE CASE  —  Why Are We Here?", "A 9-year-old boy in the Emergency Department");
  s.addShape(pres.shapes.RECTANGLE, { x: 0.25, y: 1.25, w: 9.5, h: 3.7, fill: { color: "EAF4FB" }, line: { color: C.teal, pt: 1.5 } });
  s.addText([
    { text: "Chief Complaints  (5-day history)\n", options: { bold: true, fontSize: 13, color: C.teal, breakLine: true } },
    { text: "Jaundice  •  Fatigue  •  Vomiting  •  Confusion\n\n", options: { fontSize: 13, color: C.darkTxt, breakLine: true } },
    { text: "History\n", options: { bold: true, fontSize: 13, color: C.teal, breakLine: true } },
    { text: "Flu-like illness 2 weeks ago  →  Progressive jaundice from day 3  →  Confusion today\n\n", options: { fontSize: 13, color: C.darkTxt, breakLine: true } },
    { text: "Examination\n", options: { bold: true, fontSize: 13, color: C.teal, breakLine: true } },
    { text: "Deeply jaundiced  •  GCS 12/15 (disoriented)  •  Febrile 38.6°C  •  HR 118  •  BP 90/60\nLiver NOT palpable (shrunken)  •  Bilateral Babinski positive", options: { fontSize: 13, color: C.darkTxt } }
  ], { x: 0.5, y: 1.35, w: 9, h: 3.5, valign: "top", margin: 0 });
  warningBox(s, "Child is confused + jaundiced + hypotensive  =  EMERGENCY — Act Now!", 0.25, 5.0, 9.5);
  footer(s, 2);
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 3 — CASE LABS
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  titleBar(s, "THE CASE  —  Laboratory Findings", "Urgently interpret every value");
  s.addTable([
    [{ text: "Investigation", options: { bold: true, color: C.white, fill: { color: C.navy } } },
     { text: "Result", options: { bold: true, color: C.white, fill: { color: C.navy } } },
     { text: "Significance", options: { bold: true, color: C.white, fill: { color: C.navy } } }],
    ["AST / ALT", "4200 / 3800 U/L", "Massive hepatocellular necrosis"],
    ["Total Bilirubin", "18 mg/dL (Direct 14)", "Severe cholestasis"],
    [{ text: "INR / PT", options: { bold: true } }, { text: "3.8 / 38 sec", options: { bold: true, color: C.red } }, { text: "Synthetic failure — KEY criterion", options: { bold: true, color: C.red } }],
    ["Serum Ammonia", "210 µmol/L", "Risk of cerebral edema / herniation"],
    ["Creatinine", "1.4 mg/dL (↑ for age)", "Hepatorenal syndrome developing"],
    [{ text: "Blood Glucose", options: { bold: true } }, { text: "52 mg/dL", options: { bold: true, color: C.red } }, { text: "Hypoglycemia — immediate correction", options: { bold: true, color: C.red } }],
    ["pH / Lactate", "7.31 / 4.1 mmol/L", "Lactic acidosis — poor perfusion"],
  ], {
    x: 0.25, y: 1.3, w: 9.5, h: 3.75,
    border: { pt: 1, color: "CCDDEC" },
    colW: [2.2, 2.5, 4.8],
    rowH: [0.38, 0.38, 0.38, 0.38, 0.38, 0.38, 0.38, 0.38],
  });
  footer(s, 3);
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 4 — SECTION DIVIDER: DEFINITION
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  sectionDivider(s, "01", "Definition & Diagnosis", "What is PALF and how is it different from adults?");
  footer(s, 4);
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 5 — DEFINITION OF PALF
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  titleBar(s, "Defining Pediatric Acute Liver Failure (PALF)", "Fischer's Mastery of Surgery 8e  •  Robbins Pathologic Basis of Disease");

  infoBox(s, "PALF DEFINITION", "Severe hepatic dysfunction within 8 weeks of illness onset\nNo pre-existing liver disease\nLiver-based coagulopathy (criteria below)", 0.25, 1.3, 9.5, 1.2);

  // Criteria boxes
  s.addShape(pres.shapes.RECTANGLE, { x: 0.25, y: 2.65, w: 4.55, h: 1.35, fill: { color: "FFF2CC" }, line: { color: C.amber, pt: 2 } });
  s.addText([
    { text: "WITH Encephalopathy\n", options: { bold: true, fontSize: 13, color: C.amber, breakLine: true } },
    { text: "INR ≥ 1.5  OR  PT > 15 seconds", options: { fontSize: 13, color: C.darkTxt } }
  ], { x: 0.4, y: 2.7, w: 4.2, h: 1.2, valign: "middle", margin: 0 });

  s.addShape(pres.shapes.RECTANGLE, { x: 5.2, y: 2.65, w: 4.55, h: 1.35, fill: { color: "FDECEA" }, line: { color: C.red, pt: 2 } });
  s.addText([
    { text: "WITHOUT Encephalopathy\n", options: { bold: true, fontSize: 13, color: C.red, breakLine: true } },
    { text: "INR ≥ 2.0  OR  PT ≥ 20 seconds", options: { fontSize: 13, color: C.darkTxt } }
  ], { x: 5.35, y: 2.7, w: 4.2, h: 1.2, valign: "middle", margin: 0 });

  // Key difference from adults
  s.addShape(pres.shapes.RECTANGLE, { x: 0.25, y: 4.1, w: 9.5, h: 0.85, fill: { color: "E8F4FD" }, line: { color: C.teal, pt: 1.5 } });
  s.addText([
    { text: "Key Pediatric Difference: ", options: { bold: true, fontSize: 12, color: C.teal } },
    { text: "Encephalopathy is NOT mandatory in children. It is often subtle or absent in younger children who cannot demonstrate asterixis — hence the coagulopathy alone (INR ≥2.0) qualifies as PALF.", options: { fontSize: 12, color: C.darkTxt } }
  ], { x: 0.4, y: 4.15, w: 9.1, h: 0.75, valign: "middle", margin: 0 });

  footer(s, 5);
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 6 — EPIDEMIOLOGY & PROGNOSIS
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  titleBar(s, "Epidemiology & Prognosis", "Understanding the stakes");

  const rows = [
    [{ text: "Parameter", options: { bold: true, color: C.white, fill: { color: C.navy } } },
     { text: "Data", options: { bold: true, color: C.white, fill: { color: C.navy } } }],
    ["Historical mortality (pre-transplant era)", "70 – 95%"],
    [{ text: "Current mortality (with ICU + transplant)", options: { bold: true } }, { text: "~30%", options: { bold: true, color: C.teal } }],
    ["Post-transplant 1-year patient survival (PALF)", "73%"],
    ["Post-transplant 1-year graft survival (PALF)", "59%"],
    ["PALF listing rate (2020)", "7.7% (most recover with medical Rx)"],
    ["Etiology indeterminate (pediatric)", "~50% (vs 15% in adults)"],
    ["Cerebral edema in Grade 4 encephalopathy", "~80% of patients"],
  ];
  s.addTable(rows, {
    x: 0.25, y: 1.3, w: 9.5, h: 3.9,
    border: { pt: 1, color: "CCDDEC" },
    colW: [5.5, 4.0],
  });

  footer(s, 6);
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 7 — SECTION DIVIDER: ETIOLOGY
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  sectionDivider(s, "02", "Etiology & Workup", "ABCDEF mnemonic + pediatric priorities");
  footer(s, 7);
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 8 — ETIOLOGY MNEMONIC
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  titleBar(s, "Etiology — ABCDEF Mnemonic", "Robbins, Cotran & Kumar Pathologic Basis of Disease");

  const letters = [
    { l: "A", c: C.teal,  t: "Acetaminophen toxicity  •  Hepatitis A  •  Autoimmune hepatitis" },
    { l: "B", c: C.navy,  t: "Hepatitis B" },
    { l: "C", c: C.teal,  t: "Hepatitis C  •  Cryptogenic" },
    { l: "D", c: C.navy,  t: "Drugs / Toxins (idiosyncratic DILI)  •  Hepatitis D" },
    { l: "E", c: C.teal,  t: "Hepatitis E  •  Esoteric causes (Wilson disease, Budd-Chiari, lymphoma)" },
    { l: "F", c: C.amber, t: "Fatty change – microvesicular (Reye syndrome, valproate, tetracycline)" },
  ];

  letters.forEach((item, i) => {
    const yPos = 1.3 + i * 0.65;
    s.addShape(pres.shapes.RECTANGLE, { x: 0.25, y: yPos, w: 0.55, h: 0.55, fill: { color: item.c }, line: { color: item.c } });
    s.addText(item.l, { x: 0.25, y: yPos, w: 0.55, h: 0.55, fontSize: 22, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });
    s.addShape(pres.shapes.RECTANGLE, { x: 0.85, y: yPos, w: 8.9, h: 0.55, fill: { color: i % 2 === 0 ? "EDF4F8" : "F8F8F8" }, line: { color: "D0DEE8" } });
    s.addText(item.t, { x: 0.95, y: yPos + 0.05, w: 8.6, h: 0.45, fontSize: 13, color: C.darkTxt, valign: "middle", margin: 0 });
  });

  footer(s, 8);
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 9 — PEDIATRIC-SPECIFIC CAUSES
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  titleBar(s, "Pediatric-Specific Etiologies to Prioritize", "Age-group approach is essential in PALF workup");

  const data = [
    [{ text: "Age Group", options: { bold: true, color: C.white, fill: { color: C.navy } } },
     { text: "Key Diagnoses to Exclude", options: { bold: true, color: C.white, fill: { color: C.navy } } }],
    ["Neonates / Infants", "Galactosemia, Hereditary fructose intolerance, Tyrosinemia type 1, HSV, Neonatal hemochromatosis"],
    ["Toddlers (1–5 yr)", "Mitochondrial disorders (POLG), Metabolic disease, Viral (EBV, adenovirus), HLH"],
    ["School-age (5–12 yr)", "Wilson disease ★, Autoimmune hepatitis, Viral hepatitis (A, B, E)"],
    ["Adolescents", "Acetaminophen (intentional overdose), Autoimmune hepatitis, Wilson disease, Viral"],
    ["Any age", "Sepsis-associated ALF, Budd-Chiari syndrome, Mushroom poisoning (Amanita)"],
  ];

  s.addTable(data, {
    x: 0.25, y: 1.3, w: 9.5, h: 3.85,
    border: { pt: 1, color: "CCDDEC" },
    colW: [2.8, 6.7],
  });

  warningBox(s, "In ~50% of pediatric ALF cases, no etiology is found despite full workup", 0.25, 5.05, 9.5);
  footer(s, 9);
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 10 — DIAGNOSTIC WORKUP PANEL
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  titleBar(s, "Minimum Diagnostic Workup Panel", "Run simultaneously on arrival — do not delay");

  const left = [
    "VIRAL: Anti-HAV IgM, HBsAg, Anti-HBc IgM, Anti-HCV, HEV IgM",
    "VIRAL PCR: EBV, CMV, HSV, Adenovirus (esp. if immunocompromised)",
    "METABOLIC: Ceruloplasmin, 24h urine copper, slit-lamp exam (Wilson)",
    "METABOLIC: Plasma amino acids, urine organic acids, lactate/pyruvate",
    "AUTOIMMUNE: ANA, ASMA, anti-LKM1, serum IgG",
  ];
  const right = [
    "TOXICOLOGY: Acetaminophen level, paracetamol screen, salicylates",
    "SEPSIS: Blood cultures x2, urine culture, CRP, procalcitonin",
    "HLH screen: Ferritin, triglycerides, NK cell activity, sCD25",
    "HAEMATOLOGY: CBC, peripheral smear, bone marrow biopsy if HLH",
    "IMAGING: Liver USS with Doppler (vascular), CXR, ECHO if needed",
  ];

  twoCol(s, left, right, { yStart: 1.3, fs: 12 });

  s.addShape(pres.shapes.RECTANGLE, { x: 0.25, y: 5.0, w: 9.5, h: 0.38, fill: { color: "E8F4FD" }, line: { color: C.teal } });
  s.addText("Send ALL samples simultaneously. Do not wait for one result before ordering the next.", {
    x: 0.4, y: 5.02, w: 9.1, h: 0.35, fontSize: 11, color: C.teal, bold: true, valign: "middle", margin: 0
  });
  footer(s, 10);
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 11 — SECTION DIVIDER: IMMEDIATE MANAGEMENT
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  sectionDivider(s, "03", "Immediate Stabilization", "First hours determine outcome");
  footer(s, 11);
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 12 — IMMEDIATE STEPS (ABCs + TRANSFER)
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  titleBar(s, "First Steps: Stabilize & Transfer URGENTLY", "Current Surgical Therapy 14e  •  Fischer's Mastery of Surgery 8e");

  const steps = [
    { num: "1", title: "ABC + IV Access", body: "Two large-bore IVs  •  Continuous SpO2, ECG, ETCO2  •  Intubate at Grade 3 encephalopathy (do not wait for Grade 4)" },
    { num: "2", title: "Correct Hypoglycemia NOW", body: "D10W infusion  •  Target glucose > 70 mg/dL  •  Check every 1–2 hours" },
    { num: "3", title: "Haemodynamic Support", body: "Normal saline bolus 10 mL/kg for hypotension  •  Add Norepinephrine if no response  •  Target MAP ≥ 60 mmHg" },
    { num: "4", title: "TRANSFER to Liver Transplant Centre", body: '"Patients with ALF should be immediately transferred — this can progress rapidly to fulminant failure and death" — Current Surgical Therapy 14e' },
  ];

  steps.forEach((step, i) => {
    const yPos = 1.3 + i * 1.0;
    s.addShape(pres.shapes.RECTANGLE, { x: 0.25, y: yPos, w: 0.6, h: 0.8, fill: { color: i === 3 ? C.red : C.teal }, line: { color: i === 3 ? C.red : C.teal } });
    s.addText(step.num, { x: 0.25, y: yPos, w: 0.6, h: 0.8, fontSize: 22, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });
    s.addShape(pres.shapes.RECTANGLE, { x: 0.9, y: yPos, w: 8.85, h: 0.8, fill: { color: i % 2 === 0 ? "EDF4F8" : "F4F8FB" }, line: { color: "C8DCEC" } });
    s.addText([
      { text: step.title + "  —  ", options: { bold: true, fontSize: 13, color: i === 3 ? C.red : C.navy } },
      { text: step.body, options: { fontSize: 12, color: C.darkTxt } }
    ], { x: 1.0, y: yPos + 0.05, w: 8.6, h: 0.7, valign: "middle", margin: 0 });
  });

  footer(s, 12);
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 13 — METABOLIC EMERGENCY TABLE
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  titleBar(s, "Metabolic Emergencies — Identify & Treat Simultaneously", "Goldman-Cecil Medicine");

  const rows = [
    [{ text: "Problem", options: { bold: true, color: C.white, fill: { color: C.navy } } },
     { text: "Target", options: { bold: true, color: C.white, fill: { color: C.navy } } },
     { text: "Intervention", options: { bold: true, color: C.white, fill: { color: C.navy } } }],
    [{ text: "Hypoglycaemia", options: { bold: true, color: C.red } }, "> 70 mg/dL", "D10W continuous infusion; check q1h"],
    ["Coagulopathy (INR 3.8)", "Monitor trend only", "Vitamin K IV (up to 10 mg); FFP ONLY for active bleeding/procedure"],
    [{ text: "Hyperammonaemia", options: { bold: true } }, "Reduce < 100 µmol/L", "Restrict protein temporarily; lactulose (limited ALF evidence); RRT if needed"],
    ["Metabolic acidosis (pH 7.31)", "pH > 7.35", "Cautious fluid; identify source; bicarbonate rarely needed"],
    ["Hyponatraemia", "Na 145–155 mEq/L", "Restrict free water; hypertonic saline for ICP control"],
    [{ text: "Hypotension (BP 90/60)", options: { bold: true, color: C.red } }, "MAP ≥ 60 mmHg", "NS 10 mL/kg bolus → norepinephrine → vasopressin"],
  ];

  s.addTable(rows, {
    x: 0.25, y: 1.3, w: 9.5, h: 3.9,
    border: { pt: 1, color: "CCDDEC" },
    colW: [2.5, 2.2, 4.8],
  });

  footer(s, 13);
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 14 — IMPORTANT CAVEAT: COAGULOPATHY & LACTULOSE
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  titleBar(s, "Two Critical Misconceptions in PALF Management", "Current Surgical Therapy 14e  •  Goldman-Cecil Medicine");

  // Box 1
  s.addShape(pres.shapes.RECTANGLE, { x: 0.25, y: 1.25, w: 9.5, h: 1.8, fill: { color: "FDECEA" }, line: { color: C.red, pt: 2 } });
  s.addText([
    { text: "MISCONCEPTION 1: Correct the INR with FFP\n", options: { bold: true, fontSize: 15, color: C.red, breakLine: true } },
    { text: "INR in ALF does NOT reflect true bleeding risk — clotting inhibitors (Protein C & S) are also lost, creating a re-balanced haemostasis.\n", options: { fontSize: 13, color: C.darkTxt, breakLine: true } },
    { text: "Giving FFP masks the INR trend, which is your MOST important prognostic marker. Give FFP only for active bleeding or before invasive procedures.", options: { fontSize: 12, color: C.darkTxt, italic: true } }
  ], { x: 0.4, y: 1.3, w: 9.1, h: 1.65, valign: "top", margin: 0 });

  // Box 2
  s.addShape(pres.shapes.RECTANGLE, { x: 0.25, y: 3.2, w: 9.5, h: 1.8, fill: { color: "FFF2CC" }, line: { color: C.amber, pt: 2 } });
  s.addText([
    { text: "MISCONCEPTION 2: Use Lactulose for encephalopathy (as in cirrhosis)\n", options: { bold: true, fontSize: 15, color: C.amber, breakLine: true } },
    { text: "ALF encephalopathy is driven by CEREBRAL OEDEMA — not portosystemic shunting.\n", options: { fontSize: 13, color: C.darkTxt, breakLine: true } },
    { text: "Lactulose has NEVER been shown to improve survival in ALF. Therapeutic focus must be on ICP reduction (head elevation, mannitol, hypertonic saline, sedation).", options: { fontSize: 12, color: C.darkTxt, italic: true } }
  ], { x: 0.4, y: 3.25, w: 9.1, h: 1.65, valign: "top", margin: 0 });

  footer(s, 14);
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 15 — SECTION DIVIDER: COMPLICATIONS
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  sectionDivider(s, "04", "Complications", "The killers — recognise and manage proactively");
  footer(s, 15);
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 16 — CEREBRAL OEDEMA (THE #1 KILLER)
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  titleBar(s, "Cerebral Oedema — The Leading Cause of Death in PALF", "Current Surgical Therapy 14e");

  infoBox(s, "PATHOPHYSIOLOGY",
    "Hyperammonaemia → Cerebral astrocyte swelling (glutamine accumulation) → Cytotoxic oedema → ↑ICP → ↓CPP → Ischaemia + Herniation",
    0.25, 1.3, 9.5, 0.9, "FFF2CC", C.amber);

  s.addText("Management Protocol", { x: 0.25, y: 2.35, w: 9.5, h: 0.4, fontSize: 14, bold: true, color: C.navy, margin: 0 });

  const mgmt = [
    "Head of bed at 30° at all times",
    "Intubate early (Grade 3 encephalopathy) — controlled ventilation, target PaCO2 35-40 mmHg",
    "Minimize stimulation; sedation/neuromuscular blockade (reduces ICP spikes)",
    "Mannitol 0.5–1 g/kg IV bolus for ICP spikes (only if serum osmolality < 320 mOsm/L)",
    "Hypertonic saline (3%) to target serum Na 145–155 mEq/L — prophylactic osmotherapy",
    "ICP monitoring (invasive) in Grade 3–4 encephalopathy — consider at transplant centre",
    "Avoid hyperthermia, hypoxia, hypotension — all worsen oedema",
    "CT brain: insensitive early, but rules out intracranial haemorrhage",
  ];
  bullets(s, mgmt, { y: 2.75, h: 2.35, fs: 12 });

  warningBox(s, "Ammonia > 150–200 µmol/L correlates with risk of cerebral herniation — act aggressively", 0.25, 5.08, 9.5);
  footer(s, 16);
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 17 — OTHER MAJOR COMPLICATIONS
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  titleBar(s, "Other Major Complications in PALF", "Anticipate and monitor for all simultaneously");

  const comps = [
    { title: "Hepatorenal Syndrome", body: "Avoid nephrotoxins (NSAIDs, aminoglycosides, contrast)  •  Strict I/O monitoring  •  CVVH for oliguria/AKI" },
    { title: "Sepsis & Infection", body: "Gram-positive cocci + Candida most common  •  Low threshold for blood/urine cultures  •  Empirical broad-spectrum antibiotics + antifungals" },
    { title: "GI Bleeding", body: "PPIs / H2 blockers for prophylaxis  •  FFP + platelets if actively bleeding  •  Avoid NG tubes unless needed" },
    { title: "Hypoglycaemia", body: "Continuous D10W infusion  •  Check glucose every 1–2 hours  •  Glucagon NOT effective in liver failure" },
    { title: "Pulmonary Complications", body: "Risk of pulmonary oedema (↑capillary permeability + fluid overload)  •  ARDS  •  Early intubation protective" },
    { title: "Multi-organ Failure", body: "Reflects disease severity  •  Prognostic significance  •  Activate transplant listing without delay" },
  ];

  comps.forEach((c, i) => {
    const col = i % 2;
    const row = Math.floor(i / 2);
    const x = col === 0 ? 0.25 : 5.15;
    const y = 1.3 + row * 1.38;
    s.addShape(pres.shapes.RECTANGLE, { x, y, w: 4.75, h: 1.25, fill: { color: i % 2 === 0 ? "EDF4F8" : "F4FBFD" }, line: { color: "C0D6E8" } });
    s.addText([
      { text: c.title + "\n", options: { bold: true, fontSize: 12, color: C.teal, breakLine: true } },
      { text: c.body, options: { fontSize: 11, color: C.darkTxt } }
    ], { x: x + 0.12, y: y + 0.06, w: 4.5, h: 1.1, valign: "top", margin: 0 });
  });

  footer(s, 17);
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 18 — SECTION DIVIDER: PROGNOSIS & TRANSPLANT
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  sectionDivider(s, "05", "Prognostic Criteria & Transplant", "When to list — the hardest decision");
  footer(s, 18);
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 19 — KING'S COLLEGE CRITERIA
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  titleBar(s, "King's College Criteria — When to List for Transplant", "Current Surgical Therapy 14e  |  PPV 80–100%");

  // Acetaminophen box
  s.addShape(pres.shapes.RECTANGLE, { x: 0.25, y: 1.3, w: 4.55, h: 2.2, fill: { color: "EDF4F8" }, line: { color: C.teal, pt: 2 } });
  s.addText("ACETAMINOPHEN-INDUCED", { x: 0.35, y: 1.35, w: 4.3, h: 0.4, fontSize: 12, bold: true, color: C.teal, margin: 0 });
  s.addText([
    { text: "pH < 7.3\n", options: { bold: true, fontSize: 14, color: C.red, breakLine: true } },
    { text: "OR\n", options: { fontSize: 12, color: C.darkTxt, breakLine: true } },
    { text: "INR > 6.5  AND  Creatinine > 3.4 mg/dL", options: { fontSize: 13, bold: true, color: C.red } }
  ], { x: 0.4, y: 1.8, w: 4.2, h: 1.5, valign: "middle", margin: 0 });

  // Non-acetaminophen box
  s.addShape(pres.shapes.RECTANGLE, { x: 5.2, y: 1.3, w: 4.55, h: 2.2, fill: { color: "FFF8EC" }, line: { color: C.amber, pt: 2 } });
  s.addText("NON-ACETAMINOPHEN", { x: 5.3, y: 1.35, w: 4.3, h: 0.4, fontSize: 12, bold: true, color: C.amber, margin: 0 });
  s.addText([
    { text: "INR > 6.5  alone  OR  any 3 of:\n", options: { bold: true, fontSize: 12, color: C.red, breakLine: true } },
    { text: "• INR > 3.5\n• Bilirubin > 17.6 mg/dL\n• Age < 10 or > 40 years\n• Drug toxicity as cause\n• Jaundice-to-encephalopathy > 7 days", options: { fontSize: 12, color: C.darkTxt } }
  ], { x: 5.3, y: 1.78, w: 4.2, h: 1.6, valign: "top", margin: 0 });

  // Case application
  s.addShape(pres.shapes.RECTANGLE, { x: 0.25, y: 3.65, w: 9.5, h: 1.05, fill: { color: "FDECEA" }, line: { color: C.red, pt: 2 } });
  s.addText([
    { text: "OUR CASE MEETS CRITERIA:\n", options: { bold: true, fontSize: 13, color: C.red, breakLine: true } },
    { text: "Age 9 (< 10 years)  +  Bilirubin 18 mg/dL (> 17.6)  +  INR 3.8 (> 3.5)  =  3 criteria  →  LIST FOR TRANSPLANT", options: { fontSize: 13, color: C.darkTxt, bold: true } }
  ], { x: 0.4, y: 3.7, w: 9.1, h: 0.9, valign: "middle", margin: 0 });

  infoBox(s, "NOTE", "Serial monitoring every 6–12h. Improvement in INR/Factor V = regeneration = may avoid transplant", 0.25, 4.85, 9.5, 0.5, "E8F4FD", C.teal);

  footer(s, 19);
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 20 — SERIAL BIOMARKERS FOR PROGNOSIS
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  titleBar(s, "Serial Biomarkers for Prognosis — Monitor Every 6–12h", "Goldman-Cecil Medicine");

  const rows = [
    [{ text: "Biomarker", options: { bold: true, color: C.white, fill: { color: C.navy } } },
     { text: "Trend suggesting Recovery", options: { bold: true, color: C.white, fill: { color: C.navy } } },
     { text: "Trend suggesting Need for Transplant", options: { bold: true, color: C.white, fill: { color: C.navy } } }],
    [{ text: "INR / Factor V ★", options: { bold: true } }, "Falling INR = synthetic recovery", "Rising INR = progressive failure"],
    ["Serum Bilirubin", "Plateau or fall", "Continuously rising = poor"],
    ["Arterial Ammonia", "< 100 µmol/L, falling", "> 150–200 µmol/L → herniation risk"],
    ["Serum pH", "Normalising > 7.35", "Persistent acidosis < 7.3 = listing criteria"],
    ["Lactate", "Falling < 2 mmol/L", "Persistent ↑ = multi-organ failure"],
    ["Creatinine", "Stable or falling", "Rising = HRS → worse prognosis"],
  ];

  s.addTable(rows, {
    x: 0.25, y: 1.3, w: 9.5, h: 3.9,
    border: { pt: 1, color: "CCDDEC" },
    colW: [2.4, 3.5, 3.6],
  });

  s.addText("★ Factor V has the shortest half-life of all clotting factors — it is the MOST sensitive marker of hepatic regeneration vs. deterioration", {
    x: 0.25, y: 5.1, w: 9.5, h: 0.35, fontSize: 10, color: C.teal, italic: true, margin: 0
  });

  footer(s, 20);
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 21 — SECTION DIVIDER: SPECIFIC THERAPIES
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  sectionDivider(s, "06", "Etiology-Directed Therapy", "Treat the cause, not just the failure");
  footer(s, 21);
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 22 — SPECIFIC THERAPIES TABLE
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  titleBar(s, "Specific / Etiology-Directed Treatments", "Identify the cause → targeted therapy changes outcomes");

  const rows = [
    [{ text: "Etiology", options: { bold: true, color: C.white, fill: { color: C.navy } } },
     { text: "Specific Treatment", options: { bold: true, color: C.white, fill: { color: C.navy } } }],
    [{ text: "Acetaminophen toxicity", options: { bold: true } }, "N-Acetylcysteine (NAC) IV: 150 mg/kg/h × 1h → 50 mg/kg/4h → 100 mg/kg/16h. Continue beyond standard protocol in ALF."],
    ["Autoimmune hepatitis", "IV Methylprednisolone 1–2 mg/kg/day (controversial in ALF; consult hepatology urgently)"],
    [{ text: "Wilson disease ★", options: { bold: true, color: C.teal } }, "D-penicillamine + zinc supplementation; plasmapheresis as bridge to transplant; LT is CURATIVE"],
    ["Herpes simplex hepatitis", "IV Acyclovir 15–30 mg/kg/day (empirical if HSV suspected — high mortality if delayed)"],
    ["HLH", "Dexamethasone + Etoposide (HLH-2004 protocol); consider HSCT"],
    ["Amanita phalloides poisoning", "Silibinin (milk thistle) IV + NAC + early LT listing"],
    ["Galactosaemia / Fructosaemia", "Remove galactose/fructose from diet IMMEDIATELY"],
  ];

  s.addTable(rows, {
    x: 0.25, y: 1.3, w: 9.5, h: 3.9,
    border: { pt: 1, color: "CCDDEC" },
    colW: [2.8, 6.7],
  });

  s.addText("★ Our case — Wilson disease: diagnosed by low ceruloplasmin + high urine copper + Kayser-Fleischer rings", {
    x: 0.25, y: 5.1, w: 9.5, h: 0.35, fontSize: 10, color: C.teal, italic: true, margin: 0
  });

  footer(s, 22);
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 23 — LIVER TRANSPLANT IN PALF
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  titleBar(s, "Liver Transplantation in PALF", "Fischer's Mastery of Surgery 8e  •  Current Surgical Therapy 14e");

  const left = [
    "ONLY definitive treatment for ALF meeting criteria",
    "Without transplant: mortality ~80% in fulminant ALF",
    "Options: whole-organ, living-donor split, or APOLT (auxiliary — allows native liver regeneration)",
    "1-year patient survival post-LT for PALF: 73%",
    "1-year graft survival post-LT for PALF: 59%",
    "(vs 89% / 78% for biliary atresia — lower outcomes reflect disease severity)",
  ];
  const right = [
    "Listing rate decreased to 7.7% in 2020 — most children recover",
    "List early — do not wait for Grade 4 encephalopathy",
    "Discuss with family: lifelong immunosuppression vs. mortality risk",
    "Post-LT monitoring: rejection, infection, metabolic complications",
    "Wilson disease: LT is curative — copper metabolism normalises",
    "Genetic diagnoses (POLG, tyrosinaemia): LT not always curative",
  ];

  twoCol(s, left, right, { yStart: 1.3, fs: 12 });

  footer(s, 23);
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 24 — CASE CONCLUSION + MANAGEMENT ALGORITHM
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  titleBar(s, "Case Conclusion & Management Algorithm", "Tying it all together");

  // Case box
  s.addShape(pres.shapes.RECTANGLE, { x: 0.25, y: 1.25, w: 9.5, h: 1.5, fill: { color: "EDF8F3" }, line: { color: C.teal, pt: 1.5 } });
  s.addText([
    { text: "Case Outcome:\n", options: { bold: true, fontSize: 13, color: C.teal, breakLine: true } },
    { text: "Intubated for Grade 3–4 encephalopathy  •  Transferred to PICU of transplant centre  •  Wilson disease confirmed (low ceruloplasmin, high urine copper, KF rings)  •  Plasmapheresis as bridge  •  Living-donor LT from parent on Day 7  •  Post-LT: tackled rejection with pulse steroids  •  Discharged Day 28 on tacrolimus  •  Full recovery — Wilson disease cured", options: { fontSize: 11, color: C.darkTxt } }
  ], { x: 0.4, y: 1.3, w: 9.1, h: 1.35, valign: "top", margin: 0 });

  // Algorithm
  const steps = [
    "Jaundice + Coagulopathy + Altered Sensorium → CONFIRM PALF",
    "Stabilise (ABC, glucose, ICP control) + URGENT TRANSFER",
    "Parallel: Etiology workup (ABCDEF) + Monitor complications",
    "Apply King's College Criteria (serial INR, Factor V q6h)",
    "Etiology-directed therapy (NAC / steroids / copper chelation etc.)",
    "TRANSPLANT if criteria met or clinical deterioration",
  ];

  steps.forEach((step, i) => {
    const yPos = 2.9 + i * 0.38;
    s.addShape(pres.shapes.RECTANGLE, { x: 0.25, y: yPos, w: 0.38, h: 0.33, fill: { color: i === 5 ? C.red : C.teal }, line: { color: i === 5 ? C.red : C.teal } });
    s.addText(String(i + 1), { x: 0.25, y: yPos, w: 0.38, h: 0.33, fontSize: 12, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });
    s.addShape(pres.shapes.RECTANGLE, { x: 0.68, y: yPos, w: 9.07, h: 0.33, fill: { color: i % 2 === 0 ? "EDF4F8" : "F4F8FB" }, line: { color: "C8DCEC" } });
    s.addText(step, { x: 0.78, y: yPos + 0.02, w: 8.85, h: 0.3, fontSize: 12, color: i === 5 ? C.red : C.darkTxt, bold: i === 5, valign: "middle", margin: 0 });
    if (i < 5) {
      s.addText("↓", { x: 0.33, y: yPos + 0.33, w: 0.2, h: 0.05, fontSize: 8, color: C.teal, align: "center", margin: 0 });
    }
  });

  footer(s, 24);
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 25 — SUMMARY & REFERENCES
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.navy };
  s.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 0.18, h: 5.625, fill: { color: C.teal }, line: { color: C.teal } });
  s.addText("TAKE-HOME MESSAGES", { x: 0.45, y: 0.2, w: 9.2, h: 0.55, fontSize: 22, bold: true, color: C.amber, margin: 0, charSpacing: 2 });

  const msgs = [
    "PALF = severe hepatic dysfunction < 8 weeks + coagulopathy (INR ≥1.5 with, ≥2.0 without encephalopathy). Encephalopathy NOT mandatory in children.",
    "TRANSFER immediately to a liver transplant centre — delay is the enemy.",
    "Correct hypoglycaemia aggressively. Do NOT reflexively correct INR with FFP — it masks prognosis.",
    "Cerebral oedema is the #1 killer. Mannitol, hypertonic saline, controlled ventilation, and ICP monitoring are essential.",
    "Lactulose has no survival benefit in ALF (different mechanism from cirrhosis).",
    "ABCDEF mnemonic for causes. In ~50% of children, cause is never found.",
    "King's College Criteria: PPV 80–100%. Apply and list for transplant without hesitation when met.",
    "Serial Factor V / INR every 6–12h is the best indicator of regeneration vs. deterioration.",
    "Etiology-directed therapy is critical (NAC for APAP, acyclovir for HSV, LT for Wilson disease).",
  ];

  msgs.forEach((msg, i) => {
    s.addShape(pres.shapes.RECTANGLE, { x: 0.45, y: 0.85 + i * 0.49, w: 9.3, h: 0.43, fill: { color: i % 2 === 0 ? "112B4A" : "0E2440" }, line: { color: "1A3D5E" } });
    s.addText([
      { text: `${i + 1}.  `, options: { bold: true, fontSize: 11, color: C.amber } },
      { text: msg, options: { fontSize: 11, color: "C8DDEF" } }
    ], { x: 0.55, y: 0.87 + i * 0.49, w: 9.1, h: 0.39, valign: "middle", margin: 0 });
  });

  s.addText("References: Fischer's Mastery of Surgery 8e  •  Goldman-Cecil Medicine  •  Robbins, Cotran & Kumar Pathologic Basis of Disease  •  Current Surgical Therapy 14e  •  PMID 38700362, 41159810 (2024–25)", {
    x: 0.45, y: 5.3, w: 9.3, h: 0.28, fontSize: 8, color: "4A6A8A", margin: 0
  });
}

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

cd /home/daytona/workspace/palf-seminar && node build.js 2>&1

Running Command

ls -lh /home/daytona/workspace/palf-seminar/PALF_Seminar.pptx

Your presentation is ready. Download it here:

PALF Seminar

Presentation · PPTX

(490 KB)

What's Inside — All 25 Slides

#SlideContent
1Title SlideNavy/teal theme, bold title, institution
2The Case9-yr-old boy — chief complaints, history, examination
3Case LabsFull table: INR 3.8, ammonia 210, glucose 52, pH 7.31 — color-coded red for critical values
4Section DividerDefinition & Diagnosis
5PALF DefinitionINR ≥1.5 with encephalopathy vs. INR ≥2.0 without; pediatric-specific note
6Epidemiology & PrognosisMortality 70-95% → 30%; 1-yr graft survival 59%
7Section DividerEtiology & Workup
8ABCDEF MnemonicColored letter boxes — A through F causes
9Age-Specific EtiologiesNeonates → Adolescents table; Wilson disease highlighted
10Diagnostic Workup PanelTwo-column: viral + metabolic / autoimmune + toxicology
11Section DividerImmediate Stabilization
12First Steps4-step numbered: ABC, glucose, haemodynamics, URGENT TRANSFER
13Metabolic EmergenciesTable: hypoglycaemia, coagulopathy, ammonia, acidosis, HRS
14Two MisconceptionsRed box (don't correct INR) + amber box (lactulose has no role)
15Section DividerComplications
16Cerebral Oedema#1 killer — pathophysiology + full ICP management protocol
17Other Complications6-box grid: HRS, sepsis, GI bleed, hypoglycaemia, pulmonary, MOF
18Section DividerPrognostic Criteria & Transplant
19King's College CriteriaBoth arms + case application showing 3 criteria met
20Serial BiomarkersFactor V, INR, bilirubin, ammonia, pH, lactate — recovery vs. deterioration
21Section DividerEtiology-Directed Therapy
22Specific TherapiesNAC, steroids, Wilson protocol, acyclovir, HLH, Amanita, galactosaemia
23Liver TransplantationOptions, outcomes, APOLT, discussion points
24Case Conclusion + AlgorithmWilson disease outcome + 6-step management flowchart
25Take-Home Messages9 key points on dark navy background + full references
Design: Navy dominant + teal accent + amber highlights. Tables, color-coded boxes, warning banners, and numbered steps throughout - faculty-ready level.
This is a shared conversation. Sign in to Orris to start your own chat.