Make a pediatric presentation ppt of jaundice with hepato splenomegaly 30 slides minimum

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

mkdir -p /tmp/workspace/pediatric-jaundice-ppt && ls /tmp/workspace/

Writing File

~/pediatric-jaundice-ppt/build_ppt.py

from pptx import Presentation
from pptx.util import Inches, Pt, Emu
from pptx.dml.color import RGBColor
from pptx.enum.text import PP_ALIGN, MSO_ANCHOR
from pptx.util import Inches, Pt
import copy

# ── Color palette ─────────────────────────────────────────────────────────────
NAVY      = RGBColor(0x00, 0x2B, 0x5B)   # deep navy – title bars
TEAL      = RGBColor(0x00, 0x84, 0x8A)   # accent teal – rule lines / bullets
GOLD      = RGBColor(0xF5, 0xA6, 0x23)   # gold – highlights / sub-bullets
WHITE     = RGBColor(0xFF, 0xFF, 0xFF)
LIGHT_BG  = RGBColor(0xF0, 0xF4, 0xF8)  # very light blue-grey for content bg
DARK_TEXT = RGBColor(0x1A, 0x1A, 0x2E)
RED_ALERT = RGBColor(0xC0, 0x39, 0x2B)

prs = Presentation()
prs.slide_width  = Inches(13.333)
prs.slide_height = Inches(7.5)
blank = prs.slide_layouts[6]   # fully blank

# ── Helper utilities ──────────────────────────────────────────────────────────

def add_rect(slide, x, y, w, h, fill_rgb=None, border_rgb=None, border_pt=0):
    shape = slide.shapes.add_shape(1, Inches(x), Inches(y), Inches(w), Inches(h))
    shape.line.fill.background()
    if fill_rgb:
        shape.fill.solid()
        shape.fill.fore_color.rgb = fill_rgb
    else:
        shape.fill.background()
    if border_rgb and border_pt:
        shape.line.color.rgb = border_rgb
        shape.line.width = Pt(border_pt)
    else:
        shape.line.fill.background()
    return shape

def add_text(slide, text, x, y, w, h,
             font_name="Calibri", size=18, bold=False, italic=False,
             color=DARK_TEXT, align=PP_ALIGN.LEFT, wrap=True,
             v_anchor=MSO_ANCHOR.TOP):
    tb = slide.shapes.add_textbox(Inches(x), Inches(y), Inches(w), Inches(h))
    tf = tb.text_frame
    tf.word_wrap = wrap
    tf.vertical_anchor = v_anchor
    tf.margin_left = Pt(4)
    tf.margin_right = Pt(4)
    tf.margin_top = Pt(2)
    tf.margin_bottom = Pt(2)
    p = tf.paragraphs[0]
    p.alignment = align
    run = p.add_run()
    run.text = text
    run.font.name = font_name
    run.font.size = Pt(size)
    run.font.bold = bold
    run.font.italic = italic
    run.font.color.rgb = color
    return tb

def add_multiline(slide, lines, x, y, w, h,
                  font_name="Calibri", size=16, bold=False, color=DARK_TEXT,
                  align=PP_ALIGN.LEFT, line_spacing=1.2, bullet_char="•  "):
    """lines = list of (text, indent_level, is_bold, color_override)"""
    tb = slide.shapes.add_textbox(Inches(x), Inches(y), Inches(w), Inches(h))
    tf = tb.text_frame
    tf.word_wrap = True
    tf.margin_left = Pt(6)
    tf.margin_right = Pt(4)
    tf.margin_top = Pt(4)
    tf.margin_bottom = Pt(2)
    first = True
    for item in lines:
        if isinstance(item, str):
            txt, indent, is_bold, col = item, 0, bold, color
        else:
            txt = item[0]
            indent = item[1] if len(item) > 1 else 0
            is_bold = item[2] if len(item) > 2 else bold
            col = item[3] if len(item) > 3 else color
        if first:
            p = tf.paragraphs[0]
            first = False
        else:
            p = tf.add_paragraph()
        p.alignment = align
        from pptx.util import Pt as _Pt
        p.space_after = _Pt(3)
        prefix = ("  " * indent) + (bullet_char if indent == 0 else "    - ")
        run = p.add_run()
        run.text = prefix + txt
        run.font.name = font_name
        run.font.size = Pt(size - indent * 1.5)
        run.font.bold = is_bold
        run.font.color.rgb = col
    return tb

# ── Slide factory ─────────────────────────────────────────────────────────────

def title_slide(prs, title, subtitle, presenter=""):
    slide = prs.slides.add_slide(blank)
    # Full background
    add_rect(slide, 0, 0, 13.333, 7.5, fill_rgb=NAVY)
    # Decorative teal bar left
    add_rect(slide, 0, 0, 0.4, 7.5, fill_rgb=TEAL)
    # Gold accent line
    add_rect(slide, 0.4, 3.0, 12.933, 0.06, fill_rgb=GOLD)
    # Title
    add_text(slide, title, 0.7, 1.4, 12.0, 1.6,
             font_name="Calibri", size=40, bold=True, color=WHITE,
             align=PP_ALIGN.LEFT)
    # Subtitle
    add_text(slide, subtitle, 0.7, 3.2, 11.5, 1.1,
             font_name="Calibri", size=22, bold=False, color=GOLD,
             align=PP_ALIGN.LEFT)
    # Department / presenter
    if presenter:
        add_text(slide, presenter, 0.7, 4.5, 11.5, 0.7,
                 font_name="Calibri", size=16, bold=False, color=WHITE,
                 align=PP_ALIGN.LEFT)
    # Pediatrics icon text
    add_text(slide, "🏥  Pediatric Grand Rounds", 0.7, 6.5, 8, 0.7,
             font_name="Calibri", size=14, bold=False, color=TEAL,
             align=PP_ALIGN.LEFT)
    return slide


def section_divider(prs, section_title, section_sub=""):
    slide = prs.slides.add_slide(blank)
    add_rect(slide, 0, 0, 13.333, 7.5, fill_rgb=TEAL)
    add_rect(slide, 0, 3.1, 13.333, 0.07, fill_rgb=GOLD)
    add_text(slide, section_title, 1.0, 2.0, 11, 1.2,
             font_name="Calibri", size=38, bold=True, color=WHITE,
             align=PP_ALIGN.CENTER)
    if section_sub:
        add_text(slide, section_sub, 1.0, 3.4, 11, 0.8,
                 font_name="Calibri", size=20, bold=False, color=GOLD,
                 align=PP_ALIGN.CENTER)
    return slide


def content_slide(prs, title, bullets, two_col=False, col_split=0.5):
    """
    two_col: if True, bullets is (left_list, right_list)
    col_split: fraction of content width for left column
    """
    slide = prs.slides.add_slide(blank)
    # Light background
    add_rect(slide, 0, 0, 13.333, 7.5, fill_rgb=LIGHT_BG)
    # Title bar
    add_rect(slide, 0, 0, 13.333, 1.1, fill_rgb=NAVY)
    # Teal accent left strip
    add_rect(slide, 0, 0, 0.18, 7.5, fill_rgb=TEAL)
    # Gold bottom rule
    add_rect(slide, 0.18, 6.9, 13.15, 0.05, fill_rgb=GOLD)
    # Slide title
    add_text(slide, title, 0.4, 0.08, 12.5, 0.95,
             font_name="Calibri", size=26, bold=True, color=WHITE,
             align=PP_ALIGN.LEFT, v_anchor=MSO_ANCHOR.MIDDLE)
    if not two_col:
        add_multiline(slide, bullets, 0.4, 1.2, 12.7, 5.55,
                      font_name="Calibri", size=17, color=DARK_TEXT)
    else:
        left_list, right_list = bullets
        cw = 12.7
        lw = cw * col_split - 0.1
        rw = cw * (1 - col_split) - 0.1
        add_multiline(slide, left_list, 0.4, 1.2, lw, 5.55,
                      font_name="Calibri", size=16, color=DARK_TEXT)
        add_rect(slide, 0.4 + lw + 0.05, 1.2, 0.04, 5.4, fill_rgb=TEAL)
        add_multiline(slide, right_list, 0.4 + lw + 0.2, 1.2, rw, 5.55,
                      font_name="Calibri", size=16, color=DARK_TEXT)
    return slide


def table_slide(prs, title, headers, rows):
    from pptx.util import Inches, Pt
    slide = prs.slides.add_slide(blank)
    add_rect(slide, 0, 0, 13.333, 7.5, fill_rgb=LIGHT_BG)
    add_rect(slide, 0, 0, 13.333, 1.1, fill_rgb=NAVY)
    add_rect(slide, 0, 0, 0.18, 7.5, fill_rgb=TEAL)
    add_rect(slide, 0.18, 6.9, 13.15, 0.05, fill_rgb=GOLD)
    add_text(slide, title, 0.4, 0.08, 12.5, 0.95,
             font_name="Calibri", size=26, bold=True, color=WHITE,
             align=PP_ALIGN.LEFT, v_anchor=MSO_ANCHOR.MIDDLE)
    n_cols = len(headers)
    n_rows = len(rows)
    tbl_x = Inches(0.4)
    tbl_y = Inches(1.25)
    tbl_w = Inches(12.7)
    tbl_h = Inches(5.6)
    table = slide.shapes.add_table(n_rows + 1, n_cols, tbl_x, tbl_y, tbl_w, tbl_h).table
    col_w = int(tbl_w / n_cols)
    for i in range(n_cols):
        table.columns[i].width = col_w
    # Header row
    for ci, hdr in enumerate(headers):
        cell = table.cell(0, ci)
        cell.text = hdr
        cell.fill.solid(); cell.fill.fore_color.rgb = NAVY
        p = cell.text_frame.paragraphs[0]
        p.alignment = PP_ALIGN.CENTER
        run = p.runs[0]
        run.font.name = "Calibri"; run.font.size = Pt(14)
        run.font.bold = True; run.font.color.rgb = WHITE
    # Data rows
    for ri, row in enumerate(rows):
        fill = LIGHT_BG if ri % 2 == 0 else WHITE
        for ci, val in enumerate(row):
            cell = table.cell(ri + 1, ci)
            cell.text = str(val)
            cell.fill.solid(); cell.fill.fore_color.rgb = fill
            p = cell.text_frame.paragraphs[0]
            p.alignment = PP_ALIGN.LEFT
            run = p.runs[0]
            run.font.name = "Calibri"; run.font.size = Pt(13)
            run.font.color.rgb = DARK_TEXT
    return slide


def summary_slide(prs, title, points, bg=NAVY):
    slide = prs.slides.add_slide(blank)
    add_rect(slide, 0, 0, 13.333, 7.5, fill_rgb=bg)
    add_rect(slide, 0, 0, 0.18, 7.5, fill_rgb=GOLD)
    add_rect(slide, 0.18, 1.05, 13.15, 0.06, fill_rgb=TEAL)
    add_text(slide, title, 0.5, 0.1, 12.5, 0.9,
             font_name="Calibri", size=30, bold=True, color=WHITE,
             align=PP_ALIGN.LEFT, v_anchor=MSO_ANCHOR.MIDDLE)
    add_multiline(slide, points, 0.5, 1.25, 12.5, 5.9,
                  font_name="Calibri", size=17, color=WHITE)
    return slide

# ═══════════════════════════════════════════════════════════════════════════════
# SLIDE CONTENT
# ═══════════════════════════════════════════════════════════════════════════════

# 1 ── Title slide
title_slide(prs,
    "Jaundice with Hepatosplenomegaly\nin the Pediatric Patient",
    "A Clinical & Diagnostic Approach",
    "Department of Pediatrics  |  Grand Rounds  |  2026")

# 2 ── Outline
content_slide(prs, "Outline / Learning Objectives", [
    ("Define jaundice and hepatosplenomegaly in children", 0, True, TEAL),
    ("Review bilirubin metabolism and pathophysiology", 0, False, DARK_TEXT),
    ("Classify causes by age group and mechanism", 0, False, DARK_TEXT),
    ("Discuss clinical features and focused examination", 0, False, DARK_TEXT),
    ("Outline a systematic diagnostic workup", 0, False, DARK_TEXT),
    ("Review key investigations and their interpretation", 0, False, DARK_TEXT),
    ("Cover management principles for common etiologies", 0, False, DARK_TEXT),
    ("Highlight red-flag signs requiring urgent intervention", 0, False, DARK_TEXT),
    ("Present case-based vignettes", 0, False, DARK_TEXT),
    ("Summarize key take-home messages", 0, False, DARK_TEXT),
])

# ── SECTION 1 ──────────────────────────────────────────────────────────────────
section_divider(prs, "Section 1: Definitions & Epidemiology",
                "Understanding the basics")

# 3 ── Definitions
content_slide(prs, "Definitions", [
    ("JAUNDICE (Icterus)", 0, True, NAVY),
    ("Yellow discoloration of skin, sclera & mucous membranes due to elevated bilirubin", 1, False, DARK_TEXT),
    ("Clinically visible when serum bilirubin > 2–3 mg/dL in older children", 1, False, DARK_TEXT),
    ("In neonates, detectable at > 5–7 mg/dL", 1, False, DARK_TEXT),
    ("HEPATOMEGALY", 0, True, NAVY),
    ("Liver span > 2 SD above mean for age on percussion / palpation", 1, False, DARK_TEXT),
    ("Neonates: liver edge > 3.5 cm below RCM; children: >2 cm below RCM", 1, False, DARK_TEXT),
    ("SPLENOMEGALY", 0, True, NAVY),
    ("Spleen palpable below the left costal margin", 1, False, DARK_TEXT),
    ("HEPATOSPLENOMEGALY", 0, True, NAVY),
    ("Concurrent enlargement of both liver and spleen — implies a systemic process", 1, False, DARK_TEXT),
])

# 4 ── Epidemiology
content_slide(prs, "Epidemiology", [
    ("Neonatal jaundice: affects 60% of term and 80% of preterm neonates in the first week of life", 0, False, DARK_TEXT),
    ("Physiologic jaundice peaks day 3–5 in term neonates, day 5–7 in preterm", 0, False, DARK_TEXT),
    ("Pathologic jaundice occurs in ~6% of healthy term newborns (bilirubin >17 mg/dL)", 0, False, DARK_TEXT),
    ("Biliary atresia: 1 in 8,000–12,000 live births; most common cause of pediatric liver transplantation", 0, False, DARK_TEXT),
    ("Hepatosplenomegaly with jaundice in older children most commonly caused by viral hepatitis, hemolytic anemia, or metabolic liver disease", 0, False, DARK_TEXT),
    ("Infectious mononucleosis (EBV) is a leading cause in school-age children", 0, False, DARK_TEXT),
    ("Wilson disease presents in childhood/adolescence; prevalence ~1 in 30,000", 0, False, DARK_TEXT),
])

# ── SECTION 2 ──────────────────────────────────────────────────────────────────
section_divider(prs, "Section 2: Bilirubin Metabolism",
                "Pathophysiology of jaundice")

# 5 ── Bilirubin metabolism
content_slide(prs, "Bilirubin Metabolism – Overview", [
    ("SOURCE", 0, True, NAVY),
    ("80–85% from RBC breakdown (heme → biliverdin → unconjugated bilirubin)", 1, False, DARK_TEXT),
    ("15–20% from ineffective erythropoiesis and hepatic heme proteins", 1, False, DARK_TEXT),
    ("TRANSPORT", 0, True, NAVY),
    ("Unconjugated bilirubin (UCB) is lipid-soluble, bound to albumin in plasma", 1, False, DARK_TEXT),
    ("HEPATIC CONJUGATION", 0, True, NAVY),
    ("Hepatocyte uptake via OATP1B1/1B3; conjugated by UGT1A1 → bilirubin diglucuronide (water-soluble)", 1, False, DARK_TEXT),
    ("EXCRETION", 0, True, NAVY),
    ("Conjugated bilirubin excreted into bile → intestine → urobilinogen / stercobilin", 1, False, DARK_TEXT),
    ("Enterohepatic recirculation: urobilinogen reabsorbed → urinary excretion", 1, False, DARK_TEXT),
])

# 6 ── Neonatal bilirubin physiology
content_slide(prs, "Why Neonates Are Prone to Jaundice", [
    ("Higher RBC mass with shorter lifespan (70–90 days vs 120 days in adults)", 0, False, DARK_TEXT),
    ("Immature hepatic UGT1A1 enzyme activity (only 1% of adult levels at birth)", 0, False, DARK_TEXT),
    ("Increased enterohepatic circulation due to high β-glucuronidase activity in gut", 0, False, DARK_TEXT),
    ("Deficient gut bacteria — less conversion to urobilinogen/stercobilin", 0, False, DARK_TEXT),
    ("Breast milk contains lipoprotein lipase → inhibits bilirubin conjugation", 0, False, DARK_TEXT),
    ("Caloric insufficiency in early breastfeeding → increased enterohepatic circulation (breast-feeding jaundice)", 0, False, DARK_TEXT),
    ("Kernicterus risk: UCB crosses blood-brain barrier → deposits in basal ganglia, hippocampus", 0, True, RED_ALERT),
])

# 7 ── Classification of jaundice
content_slide(prs, "Classification of Jaundice", [
    ("PRE-HEPATIC (Hemolytic / Unconjugated)", 0, True, TEAL),
    ("↑ RBC destruction → ↑ heme catabolism → UCB overwhelms hepatic conjugation", 1, False, DARK_TEXT),
    ("Causes: hemolytic disease of newborn (HDN), G6PD deficiency, hereditary spherocytosis, sickle cell disease, thalassemia", 1, False, DARK_TEXT),
    ("HEPATIC (Hepatocellular)", 0, True, TEAL),
    ("Impaired conjugation or excretion by damaged hepatocytes", 1, False, DARK_TEXT),
    ("Causes: viral hepatitis A/B/C/E, EBV, CMV, neonatal hepatitis, Wilson disease, autoimmune hepatitis, metabolic disease", 1, False, DARK_TEXT),
    ("POST-HEPATIC (Cholestatic / Obstructive)", 0, True, TEAL),
    ("Obstruction of bile flow → conjugated bilirubin (direct) backs up into blood", 1, False, DARK_TEXT),
    ("Causes: biliary atresia, choledochal cyst, Alagille syndrome, PFIC, cholelithiasis", 1, False, DARK_TEXT),
])

# ── SECTION 3 ──────────────────────────────────────────────────────────────────
section_divider(prs, "Section 3: Causes by Age Group",
                "Age-specific differential diagnosis")

# 8 ── Neonatal (< 1 month)
content_slide(prs, "Causes in Neonates (< 1 Month)", [
    ("PHYSIOLOGIC (most common)", 0, True, TEAL),
    ("Peaks day 3–5; total bilirubin rarely > 12 mg/dL; self-limiting", 1, False, DARK_TEXT),
    ("HEMOLYTIC", 0, True, TEAL),
    ("ABO/Rh incompatibility (HDN), G6PD deficiency, hereditary spherocytosis", 1, False, DARK_TEXT),
    ("INFECTIOUS", 0, True, TEAL),
    ("Congenital infections: TORCH (Toxoplasma, Rubella, CMV, HSV, Syphilis)", 1, False, DARK_TEXT),
    ("Neonatal sepsis (gram-negative organisms)", 1, False, DARK_TEXT),
    ("METABOLIC / ENDOCRINE", 0, True, TEAL),
    ("Galactosemia, hypothyroidism, tyrosinemia, α1-antitrypsin deficiency", 1, False, DARK_TEXT),
    ("STRUCTURAL", 0, True, TEAL),
    ("Biliary atresia (conjugated!), choledochal cyst, neonatal sclerosing cholangitis", 1, False, DARK_TEXT),
    ("GENETIC", 0, True, TEAL),
    ("Crigler-Najjar syndrome type I/II, Dubin-Johnson, Rotor syndrome", 1, False, DARK_TEXT),
])

# 9 ── Infants & toddlers (1 month – 2 years)
content_slide(prs, "Causes in Infants & Toddlers (1 Month – 2 Years)", [
    ("Biliary atresia — most important cause of conjugated jaundice in this age", 0, True, RED_ALERT),
    ("Progressive obliterative cholangiopathy; Kasai procedure window < 60 days of life", 1, False, DARK_TEXT),
    ("Viral hepatitis — CMV, EBV (rare in early infancy), HBV from vertical transmission", 0, False, DARK_TEXT),
    ("Metabolic liver disease: galactosemia, hereditary fructose intolerance, Niemann-Pick", 0, False, DARK_TEXT),
    ("Alagille syndrome: paucity of bile ducts + cardiac defects + butterfly vertebrae + eye anomalies", 0, False, DARK_TEXT),
    ("Progressive familial intrahepatic cholestasis (PFIC 1, 2, 3)", 0, False, DARK_TEXT),
    ("Neonatal hepatitis syndrome (idiopathic giant cell hepatitis)", 0, False, DARK_TEXT),
    ("TPN-associated cholestasis in premature infants", 0, False, DARK_TEXT),
])

# 10 ── School-age children (2–12 years)
content_slide(prs, "Causes in School-Age Children (2–12 Years)", [
    ("Acute viral hepatitis A (feco-oral) — most common in this age group", 0, False, DARK_TEXT),
    ("Epstein-Barr virus (EBV) — classic hepatosplenomegaly + pharyngitis + lymphadenopathy", 0, False, DARK_TEXT),
    ("Hemolytic anemias: sickle cell disease, hereditary spherocytosis, thalassemia major", 0, False, DARK_TEXT),
    ("Wilson disease (hepatic-dominant presentation before Kayser-Fleischer rings appear)", 0, False, DARK_TEXT),
    ("Autoimmune hepatitis — girls > boys; elevated IgG; ANA/SMA positive", 0, False, DARK_TEXT),
    ("Schistosomiasis, leishmaniasis (in endemic regions)", 0, False, DARK_TEXT),
    ("Drug-induced liver injury (DILI): valproate, isoniazid, amoxicillin-clavulanate", 0, False, DARK_TEXT),
    ("Malignancy: acute leukemia (ALL) with hepatosplenomegaly and jaundice", 0, True, RED_ALERT),
])

# 11 ── Adolescents (12–18 years)
content_slide(prs, "Causes in Adolescents (12–18 Years)", [
    ("Acute hepatitis B & C (via blood, tattoos, sexual contact)", 0, False, DARK_TEXT),
    ("Hepatitis A (outbreaks in unvaccinated populations)", 0, False, DARK_TEXT),
    ("EBV / infectious mononucleosis", 0, False, DARK_TEXT),
    ("Wilson disease — neuropsychiatric + hepatic presentation; Kayser-Fleischer rings", 0, False, DARK_TEXT),
    ("Autoimmune hepatitis type 1 & 2", 0, False, DARK_TEXT),
    ("Non-alcoholic fatty liver disease (NAFLD) — rising prevalence in obese adolescents", 0, False, DARK_TEXT),
    ("Acute liver failure in Wilson disease (Coombs-negative hemolytic anemia + liver failure)", 0, True, RED_ALERT),
    ("Substance misuse: alcohol, ecstasy (MDMA), herbal/OTC supplements", 0, False, DARK_TEXT),
    ("Budd-Chiari syndrome (rare; hypercoagulable state)", 0, False, DARK_TEXT),
    ("Hemophagocytic lymphohistiocytosis (HLH) — fever + organomegaly + cytopenias", 0, True, RED_ALERT),
])

# ── SECTION 4 ──────────────────────────────────────────────────────────────────
section_divider(prs, "Section 4: Clinical Assessment",
                "History, examination & red flags")

# 12 ── History
content_slide(prs, "Key Points in History", [
    ("AGE OF ONSET", 0, True, NAVY),
    ("First 24 hrs → always pathological; Day 3–5 → physiologic; >14 days → cholestasis until proven otherwise", 1, False, DARK_TEXT),
    ("STOOL & URINE COLOR", 0, True, NAVY),
    ("Pale/acholic stools + dark urine = cholestasis (biliary atresia, hepatitis)", 1, False, DARK_TEXT),
    ("Dark stools + normal urine = unconjugated (hemolytic)", 1, False, DARK_TEXT),
    ("FEEDING HISTORY (neonates)", 0, True, NAVY),
    ("Breast vs. formula; weight loss > 10%", 1, False, DARK_TEXT),
    ("FAMILY HISTORY", 0, True, NAVY),
    ("Hemolytic disease, metabolic disorders, consanguinity, jaundiced siblings", 1, False, DARK_TEXT),
    ("CONTACT / TRAVEL / IMMUNIZATION", 0, True, NAVY),
    ("HAV/HBV vaccination status; travel to endemic areas; sick contacts", 1, False, DARK_TEXT),
    ("MEDICATIONS / TOXINS", 0, True, NAVY),
    ("OTC drugs, herbal preparations, supplements, alcohol (adolescents)", 1, False, DARK_TEXT),
])

# 13 ── Physical examination
content_slide(prs, "Physical Examination", [
    ("GENERAL", 0, True, NAVY),
    ("Jaundice distribution: scleral icterus, skin zones (Kramer's zones in neonates)", 1, False, DARK_TEXT),
    ("Dysmorphic features: Alagille (triangular facies), metabolic disease stigmata", 1, False, DARK_TEXT),
    ("ABDOMEN", 0, True, NAVY),
    ("Hepatomegaly: size, consistency (firm/hard = cirrhosis; tender = hepatitis), surface", 1, False, DARK_TEXT),
    ("Splenomegaly: size, tenderness; massive splenomegaly → malaria, thalassemia, storage disease", 1, False, DARK_TEXT),
    ("Ascites: fluid wave / shifting dullness — sign of advanced liver disease", 1, False, DARK_TEXT),
    ("SKIN", 0, True, NAVY),
    ("Caput medusae, spider naevi, palmar erythema → chronic liver disease", 1, False, DARK_TEXT),
    ("Petechiae / purpura → HLH, leukemia, coagulopathy", 1, False, DARK_TEXT),
    ("EYES", 0, True, NAVY),
    ("Kayser-Fleischer rings (Wilson disease — slit lamp required)", 1, False, DARK_TEXT),
    ("Posterior embryotoxon (Alagille syndrome)", 1, False, DARK_TEXT),
])

# 14 ── Kramer's zones (neonatal)
content_slide(prs, "Neonatal Jaundice: Kramer's Zones", [
    ("Clinical tool to estimate neonatal serum bilirubin by extent of jaundice cephalocaudal progression", 0, False, DARK_TEXT),
    ("Zone 1  — Face/head only                     → ~5–6 mg/dL", 0, False, DARK_TEXT),
    ("Zone 2  — Face + upper trunk (to umbilicus)  → ~9–10 mg/dL", 0, False, DARK_TEXT),
    ("Zone 3  — Lower trunk to knees                → ~11–12 mg/dL", 0, False, DARK_TEXT),
    ("Zone 4  — Below knees to ankles               → ~13–14 mg/dL", 0, False, DARK_TEXT),
    ("Zone 5  — Palms & soles                        → > 15 mg/dL", 0, True, RED_ALERT),
    ("", 0, False, DARK_TEXT),
    ("NOTE: Kramer's zones are a clinical SCREENING tool only — always confirm with transcutaneous bilirubinometry (TcB) or serum bilirubin", 0, True, TEAL),
    ("Reliable only in fair-skinned neonates; unreliable in dark-skinned infants", 0, False, DARK_TEXT),
])

# 15 ── Red flag signs
content_slide(prs, "🔴  Red Flags Requiring Urgent Action", [
    ("Jaundice in first 24 hours of life → hemolytic disease, sepsis", 0, True, RED_ALERT),
    ("Prolonged jaundice > 14 days in term / > 21 days in preterm neonate", 0, True, RED_ALERT),
    ("Acholic (pale/white) stools — biliary obstruction; screen for biliary atresia IMMEDIATELY", 0, True, RED_ALERT),
    ("Dark urine in neonate — conjugated hyperbilirubinemia", 0, True, RED_ALERT),
    ("Acute liver failure: jaundice + encephalopathy + coagulopathy (INR > 2)", 0, True, RED_ALERT),
    ("Fever + hepatosplenomegaly + pancytopenia → HLH, leukemia, sepsis", 0, True, RED_ALERT),
    ("Jaundice + hydrops fetalis — Rh disease, α-thalassemia major", 0, True, RED_ALERT),
    ("Neurological signs with jaundice (opisthotonos, seizures) → kernicterus", 0, True, RED_ALERT),
    ("Massive/rapidly growing splenomegaly with pallor — malignancy or storage disease", 0, True, RED_ALERT),
])

# ── SECTION 5 ──────────────────────────────────────────────────────────────────
section_divider(prs, "Section 5: Investigations",
                "Laboratory & imaging workup")

# 16 ── First-line labs
content_slide(prs, "First-Line Laboratory Investigations", [
    ("Serum bilirubin (Total, Direct/Conjugated, Indirect/Unconjugated)", 0, False, DARK_TEXT),
    ("Direct > 1 mg/dL or > 20% of total → pathological conjugated hyperbilirubinemia", 1, False, DARK_TEXT),
    ("Liver function tests (ALT, AST, ALP, GGT, albumin, total protein)", 0, False, DARK_TEXT),
    ("Coagulation profile (PT/INR, APTT) — marker of synthetic liver function", 0, False, DARK_TEXT),
    ("Complete blood count with peripheral smear (hemolysis, cytopenias)", 0, False, DARK_TEXT),
    ("Reticulocyte count + Coombs test (direct/indirect)", 0, False, DARK_TEXT),
    ("Blood glucose and urine reducing substances (galactosemia screening)", 0, False, DARK_TEXT),
    ("Urine: dipstick (bilirubin, urobilinogen), routine microscopy, culture", 0, False, DARK_TEXT),
    ("Thyroid function (T4, TSH) in neonates", 0, False, DARK_TEXT),
    ("Blood group (mother & baby) in neonates", 0, False, DARK_TEXT),
])

# 17 ── Second-line labs
content_slide(prs, "Second-Line / Targeted Investigations", [
    ("INFECTIOUS WORKUP", 0, True, NAVY),
    ("Hepatitis A IgM, HBsAg, anti-HBc IgM, HCV RNA", 1, False, DARK_TEXT),
    ("EBV VCA IgM / Monospot (Paul-Bunnell); CMV PCR; HSV PCR", 1, False, DARK_TEXT),
    ("TORCH serology (neonates); Malaria thick smear (endemic areas)", 1, False, DARK_TEXT),
    ("METABOLIC SCREEN", 0, True, NAVY),
    ("Serum amino acids, urine organic acids, plasma lactate, ammonia", 1, False, DARK_TEXT),
    ("α1-antitrypsin level + phenotype (ZZ genotype)", 1, False, DARK_TEXT),
    ("Serum copper, ceruloplasmin, 24-hr urine copper (Wilson disease)", 1, False, DARK_TEXT),
    ("Lysosomal enzyme assays (Gaucher, Niemann-Pick, Wolman)", 1, False, DARK_TEXT),
    ("AUTOIMMUNE PANEL", 0, True, NAVY),
    ("ANA, ASMA, anti-LKM-1, IgG level (autoimmune hepatitis)", 1, False, DARK_TEXT),
    ("pANCA, AMA (primary sclerosing cholangitis, primary biliary cholangitis)", 1, False, DARK_TEXT),
])

# 18 ── Table: Lab interpretation
table_slide(prs, "Lab Pattern Interpretation in Jaundice",
    ["Parameter", "Pre-Hepatic (Hemolytic)", "Hepatocellular", "Cholestatic/Obstructive"],
    [
        ["Total Bilirubin", "↑↑ (mainly indirect)", "↑ (mixed)", "↑↑ (mainly direct)"],
        ["Direct Bilirubin", "Normal / minimal ↑", "↑↑", "↑↑↑"],
        ["ALT / AST", "Normal", "↑↑↑ (>5× ULN)", "Mildly ↑"],
        ["ALP / GGT", "Normal", "Mild ↑", "↑↑↑ (>3× ULN)"],
        ["Urine Bilirubin", "Negative", "Positive", "Strongly positive"],
        ["Urine Urobilinogen", "↑↑↑", "↑ or variable", "Absent (clay stools)"],
        ["PT/INR", "Normal", "Prolonged (hepatic)", "Prolonged (Vit K dep)"],
        ["Albumin", "Normal", "↓ (chronic)", "Normal (acute)"],
        ["Blood Smear", "Spherocytes/sickle/fragments", "Normal or reactive", "Normal"],
    ]
)

# 19 ── Imaging
content_slide(prs, "Imaging Investigations", [
    ("ABDOMINAL ULTRASOUND (first-line)", 0, True, NAVY),
    ("Assess liver size, echogenicity, biliary tree calibre, common bile duct (CBD)", 1, False, DARK_TEXT),
    ("Gallbladder assessment: absent/atretic GB in biliary atresia; choledochal cyst", 1, False, DARK_TEXT),
    ("Portal vein Doppler — portal hypertension, Budd-Chiari", 1, False, DARK_TEXT),
    ("Spleen size, echogenicity; ascites, collateral vessels", 1, False, DARK_TEXT),
    ("HEPATOBILIARY SCINTIGRAPHY (HIDA Scan)", 0, True, NAVY),
    ("Radioisotope excreted in bile — biliary atresia: isotope uptake but NO excretion", 1, False, DARK_TEXT),
    ("MRCP (Magnetic Resonance Cholangiopancreatography)", 0, True, NAVY),
    ("Non-invasive biliary tree visualisation — choledochal cyst, PSC, biliary strictures", 1, False, DARK_TEXT),
    ("LIVER BIOPSY", 0, True, NAVY),
    ("Gold standard for histological diagnosis: biliary atresia, autoimmune hepatitis, storage diseases, fibrosis staging", 1, False, DARK_TEXT),
])

# 20 ── Special tests
content_slide(prs, "Special / Confirmatory Tests", [
    ("ERCP / Intraoperative Cholangiogram", 0, False, DARK_TEXT),
    ("Definitive diagnosis of biliary atresia; Kasai hepatoportoenterostomy intraoperatively", 1, False, DARK_TEXT),
    ("BONE MARROW ASPIRATE / TREPHINE", 0, False, DARK_TEXT),
    ("HLH (hemophagocytes), leukemia (blast cells), storage diseases (foam cells)", 1, False, DARK_TEXT),
    ("OPHTHALMOLOGIC SLIT-LAMP EXAM", 0, False, DARK_TEXT),
    ("Kayser-Fleischer rings in Wilson disease; posterior embryotoxon in Alagille", 1, False, DARK_TEXT),
    ("GENETIC / MOLECULAR TESTING", 0, False, DARK_TEXT),
    ("ATP7B mutations (Wilson), JAGGED1/NOTCH2 (Alagille), ABCB11 (PFIC2), G6PD activity assay", 1, False, DARK_TEXT),
    ("NEWBORN SCREENING", 0, False, DARK_TEXT),
    ("Galactosemia, hypothyroidism, tyrosinemia — Guthrie card / tandem mass spectrometry", 1, False, DARK_TEXT),
    ("STOOL COLOR CARD (Taiwan/UK programme)", 0, False, DARK_TEXT),
    ("National programmes for early biliary atresia detection — acholic stool card at 1 month visit", 1, False, DARK_TEXT),
])

# ── SECTION 6 ──────────────────────────────────────────────────────────────────
section_divider(prs, "Section 6: Common Conditions In-Depth",
                "Disease-specific review")

# 21 ── Biliary atresia
content_slide(prs, "Biliary Atresia", [
    ("Most common surgically correctable cause of neonatal cholestasis", 0, True, NAVY),
    ("Obliterative fibro-inflammatory process affecting extrahepatic bile ducts", 0, False, DARK_TEXT),
    ("Presents as 'late physiological jaundice': persistent jaundice beyond 14 days with acholic stools and dark urine", 0, False, DARK_TEXT),
    ("Hepatosplenomegaly develops as cirrhosis progresses", 0, False, DARK_TEXT),
    ("KEY INVESTIGATIONS", 0, True, TEAL),
    ("GGT > 300 IU/L (highly suggestive); absent gallbladder on US; HIDA scan shows no excretion", 1, False, DARK_TEXT),
    ("Liver biopsy: bile duct proliferation, bile plugs, portal fibrosis", 1, False, DARK_TEXT),
    ("MANAGEMENT", 0, True, TEAL),
    ("Kasai hepatoportoenterostomy (HPE) — MUST be performed before 60 days of age for best outcome", 1, False, DARK_TEXT),
    ("Ursodeoxycholic acid post-Kasai; fat-soluble vitamin supplementation (A, D, E, K)", 1, False, DARK_TEXT),
    ("Liver transplantation — required in ~80% by 20 years of age", 1, False, DARK_TEXT),
])

# 22 ── Neonatal hemolytic disease
content_slide(prs, "Hemolytic Disease of the Newborn (HDN)", [
    ("PATHOPHYSIOLOGY", 0, True, NAVY),
    ("Maternal IgG antibodies cross placenta → sensitize/destroy fetal RBCs", 1, False, DARK_TEXT),
    ("ABO incompatibility (most common, usually mild) and Rh incompatibility (most severe)", 1, False, DARK_TEXT),
    ("CLINICAL FEATURES", 0, True, NAVY),
    ("Jaundice within first 24 hours, pallor, hepatosplenomegaly, hydrops fetalis (severe Rh)", 1, False, DARK_TEXT),
    ("INVESTIGATIONS", 0, True, NAVY),
    ("Direct Coombs test (DAT) positive, ↑↑ indirect bilirubin, anaemia, reticulocytosis", 1, False, DARK_TEXT),
    ("MANAGEMENT", 0, True, NAVY),
    ("Phototherapy: first-line for significant unconjugated hyperbilirubinemia", 1, False, DARK_TEXT),
    ("Exchange transfusion: total bilirubin ≥ 25 mg/dL in term neonate OR Bhutani nomogram exchange-line", 1, False, DARK_TEXT),
    ("IVIG 0.5–1 g/kg for Rh / ABO incompatibility to reduce haemolysis", 1, False, DARK_TEXT),
    ("Prevention: anti-D immunoglobulin to Rh-negative mothers at 28 wks and within 72 hrs of delivery", 1, False, DARK_TEXT),
])

# 23 ── Viral hepatitis
content_slide(prs, "Viral Hepatitis in Children", two_col=True, col_split=0.5)
# override with proper two_col
slide = prs.slides[-1]
# Already created; supplement content via two_col approach manually
# Actually, let's rebuild this slide properly
from pptx.slides import Slide
# Remove last slide and rebuild
# Simpler: just use a one-col layout
prs.slides._sldIdLst.remove(prs.slides._sldIdLst[-1])

content_slide(prs, "Viral Hepatitis in Children", [
    ("HEPATITIS A (HAV)", 0, True, TEAL),
    ("Feco-oral; incubation 15–50 days; self-limiting; cholestatic variant with pruritis in 10%", 1, False, DARK_TEXT),
    ("Dx: Anti-HAV IgM; Tx: Supportive; Vaccination highly effective (2-dose schedule)", 1, False, DARK_TEXT),
    ("HEPATITIS B (HBV)", 0, True, TEAL),
    ("Vertical transmission most common in children; acute / chronic (>6 months)", 1, False, DARK_TEXT),
    ("HBsAg + HBeAg = high infectivity; HBV DNA PCR for viral load; Tx: tenofovir/entecavir in adolescents", 1, False, DARK_TEXT),
    ("EBV / INFECTIOUS MONONUCLEOSIS", 0, True, TEAL),
    ("Triad: fever + pharyngitis + lymphadenopathy; hepatosplenomegaly in 50–80%", 1, False, DARK_TEXT),
    ("Transaminitis in 80%; rarely fulminant hepatitis; Avoid amoxicillin (maculopapular rash)", 1, False, DARK_TEXT),
    ("CMV HEPATITIS", 0, True, TEAL),
    ("Congenital CMV: jaundice + petechiae + microcephaly + blueberry muffin rash", 1, False, DARK_TEXT),
    ("Older children: CMV mononucleosis syndrome; Dx: CMV PCR; Tx: ganciclovir in severe cases", 1, False, DARK_TEXT),
])

# 24 ── Wilson disease
content_slide(prs, "Wilson Disease (Hepatolenticular Degeneration)", [
    ("Autosomal recessive copper transport defect (ATP7B gene mutation)", 0, False, DARK_TEXT),
    ("Copper accumulates in liver, brain, kidneys, cornea", 0, False, DARK_TEXT),
    ("PRESENTATIONS", 0, True, NAVY),
    ("Hepatic (most common in children): hepatitis, cirrhosis, acute liver failure", 1, False, DARK_TEXT),
    ("Neuropsychiatric: tremors, dysarthria, behavioural changes (adolescents/young adults)", 1, False, DARK_TEXT),
    ("Haematological: Coombs-negative haemolytic anaemia (Wilson crisis)", 1, False, DARK_TEXT),
    ("KEY DIAGNOSTIC CLUE: Kayser-Fleischer rings on slit-lamp examination", 0, True, TEAL),
    ("INVESTIGATIONS", 0, True, NAVY),
    ("↓ Ceruloplasmin (< 20 mg/dL), ↑ serum copper, ↑ 24-hr urine copper (> 100 μg/24h)", 1, False, DARK_TEXT),
    ("Liver biopsy: hepatic copper > 250 μg/g dry weight; ATP7B gene sequencing", 1, False, DARK_TEXT),
    ("MANAGEMENT", 0, True, NAVY),
    ("D-penicillamine or trientine (chelation); zinc (maintenance); liver transplant for ALF", 1, False, DARK_TEXT),
])

# 25 ── Alagille syndrome
content_slide(prs, "Alagille Syndrome", [
    ("Autosomal dominant; JAGGED1 (>94%) or NOTCH2 mutations", 0, False, DARK_TEXT),
    ("Intrahepatic bile duct paucity → cholestasis, hepatosplenomegaly", 0, False, DARK_TEXT),
    ("DIAGNOSTIC PENTAD", 0, True, NAVY),
    ("1. Cholestasis with bile duct paucity on liver biopsy", 1, False, DARK_TEXT),
    ("2. Cardiovascular anomalies: peripheral pulmonary stenosis (most common)", 1, False, DARK_TEXT),
    ("3. Vertebral anomalies: butterfly vertebrae", 1, False, DARK_TEXT),
    ("4. Ophthalmologic: posterior embryotoxon", 1, False, DARK_TEXT),
    ("5. Characteristic facies: triangular face, broad forehead, deep-set eyes", 1, False, DARK_TEXT),
    ("CLINICAL COURSE", 0, True, NAVY),
    ("Severe pruritus (often more problematic than jaundice); hypercholesterolaemia; xanthomata", 1, False, DARK_TEXT),
    ("Variable progression; ~15–20% develop end-stage liver disease requiring transplant", 1, False, DARK_TEXT),
    ("MANAGEMENT", 0, True, NAVY),
    ("Ursodeoxycholic acid; rifampicin/cholestyramine/naltrexone for pruritus; fat-soluble vitamins A, D, E, K; liver Tx", 1, False, DARK_TEXT),
])

# 26 ── Storage diseases
content_slide(prs, "Storage Diseases Causing Hepatosplenomegaly & Jaundice", [
    ("GAUCHER DISEASE (most common lysosomal storage disease)", 0, True, NAVY),
    ("β-glucocerebrosidase deficiency → glucocerebroside accumulates in RE cells", 1, False, DARK_TEXT),
    ("Massive hepatosplenomegaly, hypersplenism, bone crises, 'Erlenmeyer flask' deformity", 1, False, DARK_TEXT),
    ("Diagnosis: leukocyte β-glucocerebrosidase activity; Treatment: ERT (imiglucerase)", 1, False, DARK_TEXT),
    ("NIEMANN-PICK DISEASE TYPE A/B", 0, True, NAVY),
    ("Sphingomyelinase deficiency; hepatosplenomegaly + cherry-red spot + foam cells in BM", 1, False, DARK_TEXT),
    ("GLYCOGEN STORAGE DISEASE TYPE I (von Gierke)", 0, True, NAVY),
    ("G6Pase deficiency; massive hepatomegaly (not splenomegaly primarily), hypoglycaemia, lactic acidosis", 1, False, DARK_TEXT),
    ("WOLMAN DISEASE", 0, True, NAVY),
    ("Lysosomal acid lipase deficiency; hepatosplenomegaly + adrenal calcification in infancy", 1, False, DARK_TEXT),
    ("GALACTOSEMIA", 0, True, NAVY),
    ("GALT deficiency; neonatal jaundice + E. coli sepsis + cataracts; galactose-free diet", 1, False, DARK_TEXT),
])

# 27 ── HLH
content_slide(prs, "Hemophagocytic Lymphohistiocytosis (HLH)", [
    ("Life-threatening hyperinflammatory syndrome — cytokine storm with uncontrolled macrophage/lymphocyte activation", 0, False, DARK_TEXT),
    ("HLH-2004 DIAGNOSTIC CRITERIA (5 of 8 required)", 0, True, NAVY),
    ("1. Fever ≥ 38.5°C", 1, False, DARK_TEXT),
    ("2. Splenomegaly (+ hepatomegaly)", 1, False, DARK_TEXT),
    ("3. Cytopenias ≥ 2 cell lines (Hb < 9, Plt < 100, ANC < 1)", 1, False, DARK_TEXT),
    ("4. Hypertriglyceridaemia (fasting TG ≥ 3 mmol/L) and/or Hypofibrinogenaemia (≤ 1.5 g/L)", 1, False, DARK_TEXT),
    ("5. Hemophagocytosis in BM/spleen/lymph node", 1, False, DARK_TEXT),
    ("6. Low/absent NK cell activity", 1, False, DARK_TEXT),
    ("7. Ferritin ≥ 500 μg/L (very high ferritin > 10,000 highly specific)", 1, False, DARK_TEXT),
    ("8. Soluble CD25 (sCD163) ≥ 2400 U/mL", 1, False, DARK_TEXT),
    ("TREATMENT", 0, True, NAVY),
    ("HLH-94/2004 protocol: etoposide + dexamethasone + cyclosporine; Treat underlying trigger (EBV, malignancy)", 1, False, DARK_TEXT),
])

# ── SECTION 7 ──────────────────────────────────────────────────────────────────
section_divider(prs, "Section 7: Management Principles",
                "Approach to treatment")

# 28 ── General management
content_slide(prs, "General Management Approach", [
    ("IMMEDIATE STABILIZATION", 0, True, NAVY),
    ("Assess for signs of acute liver failure (encephalopathy, coagulopathy, hypoglycaemia)", 1, False, DARK_TEXT),
    ("Correct hypoglycaemia with glucose infusion; vitamin K IV for coagulopathy", 1, False, DARK_TEXT),
    ("Refer to tertiary pediatric hepatology / liver transplant centre if ALF suspected", 1, False, DARK_TEXT),
    ("PHOTOTHERAPY (neonates with unconjugated hyperbilirubinaemia)", 0, True, NAVY),
    ("Blue-green light (420–490 nm) converts bilirubin to lumirubin → excreted in bile/urine", 1, False, DARK_TEXT),
    ("Intensive phototherapy: ≥30 µW/cm²/nm; eye patches; 4-hourly monitoring", 1, False, DARK_TEXT),
    ("Contraindicated in conjugated jaundice (bronze baby syndrome)", 1, False, DARK_TEXT),
    ("EXCHANGE TRANSFUSION (neonates)", 0, True, NAVY),
    ("Double-volume exchange (~160 mL/kg); removes sensitised RBCs + bilirubin + antibodies", 1, False, DARK_TEXT),
    ("Indications: bilirubin at exchange-line on AAP Bhutani nomogram; signs of acute bilirubin encephalopathy", 1, False, DARK_TEXT),
])

# 29 ── Management table
table_slide(prs, "Disease-Specific Management Summary",
    ["Condition", "First-Line Treatment", "Monitoring / Follow-Up"],
    [
        ["Physiologic neonatal jaundice", "Adequate feeding / phototherapy if indicated", "Bhutani nomogram; repeat bilirubin 24–48 hrs"],
        ["HDN (ABO/Rh)", "Phototherapy; IVIG; exchange transfusion", "Haemoglobin at 4–6 weeks (late anaemia)"],
        ["Biliary atresia", "Kasai HPE < 60 days; fat-soluble vitamins; UDCA", "LFTs, growth, US for portal HTN; transplant planning"],
        ["Hepatitis A", "Supportive; hydration", "LFTs weekly until normalisation"],
        ["Hepatitis B (chronic)", "Tenofovir alafenamide / entecavir (adolescents)", "HBV DNA, HBeAg/HBsAg q 3–6 months"],
        ["Wilson disease", "D-penicillamine / trientine + zinc", "Urine copper, LFTs, neurological review"],
        ["Autoimmune hepatitis", "Prednisolone + azathioprine", "LFTs monthly; taper steroids over 2 years"],
        ["HLH", "Etoposide + dexamethasone + ciclosporin", "Ferritin, CBC, HSCT evaluation"],
        ["Alagille syndrome", "UDCA; fat-soluble vitamins; pruritus Rx", "Echo, ophthalmology, growth, LFTs"],
        ["Gaucher disease", "Enzyme replacement therapy (ERT)", "Organ volumetry; bone density; biomarkers"],
    ]
)

# ── SECTION 8 ──────────────────────────────────────────────────────────────────
section_divider(prs, "Section 8: Clinical Vignettes",
                "Case-based learning")

# 30 ── Case 1
content_slide(prs, "Case Vignette 1: The Yellow Neonate", [
    ("PRESENTATION", 0, True, NAVY),
    ("A 5-day-old term male is brought with yellow discoloration noticed since day 3. Breastfed. Weight loss 8%.", 1, False, DARK_TEXT),
    ("Alert, well, stools are yellow, urine normal coloured. No dysmorphism.", 1, False, DARK_TEXT),
    ("Examination: Jaundice to Zone 2 (Kramer), no hepatosplenomegaly.", 1, False, DARK_TEXT),
    ("Labs: Total bilirubin 13.5 mg/dL, direct 0.4 mg/dL. DAT negative.", 1, False, DARK_TEXT),
    ("DIAGNOSIS", 0, True, TEAL),
    ("Physiologic / Breastfeeding jaundice — unconjugated, non-hemolytic", 1, False, DARK_TEXT),
    ("MANAGEMENT", 0, True, TEAL),
    ("Optimize breastfeeding technique and frequency; consider phototherapy (bilirubin is near/at phototherapy line for age in hrs); reassess at 24–48 hours", 1, False, DARK_TEXT),
    ("Monitor for bilirubin encephalopathy signs (poor feeding, high-pitched cry, opisthotonus)", 1, True, RED_ALERT),
])

# 31 ── Case 2
content_slide(prs, "Case Vignette 2: Persistent Jaundice + Acholic Stools", [
    ("PRESENTATION", 0, True, NAVY),
    ("A 6-week-old female, born term. Parents notice persistent jaundice since birth. Stools have become pale over 2 weeks. Urine dark.", 1, False, DARK_TEXT),
    ("Examination: Jaundice+, hepatomegaly (4 cm below RCM), firm, no splenomegaly yet.", 1, False, DARK_TEXT),
    ("Labs: Total bilirubin 9.8 mg/dL, direct 7.2 mg/dL (74%). GGT 520 IU/L. ALT 95 IU/L.", 1, False, DARK_TEXT),
    ("US: Small/absent gallbladder, triangular cord sign.", 1, False, DARK_TEXT),
    ("DIAGNOSIS", 0, True, TEAL),
    ("Biliary atresia — conjugated hyperbilirubinaemia, acholic stools, absent GB on US", 1, False, DARK_TEXT),
    ("MANAGEMENT", 0, True, TEAL),
    ("URGENT referral to pediatric surgery — HIDA scan + liver biopsy to confirm", 1, False, DARK_TEXT),
    ("Kasai HPE — MUST be performed ASAP; best outcome if < 60 days old", 1, True, RED_ALERT),
])

# 32 ── Case 3
content_slide(prs, "Case Vignette 3: Teenager with Jaundice, HSM, Mood Changes", [
    ("PRESENTATION", 0, True, NAVY),
    ("A 14-year-old boy with 3-month history of fatigue, jaundice, tremors and behavioural changes.", 1, False, DARK_TEXT),
    ("Examination: Jaundice, hepatomegaly (6 cm), splenomegaly (5 cm), mild ascites. Flapping tremor.", 1, False, DARK_TEXT),
    ("Labs: Total bili 4.2 mg/dL (mainly direct), ALT 320 IU/L, AST 260 IU/L, INR 1.6.", 1, False, DARK_TEXT),
    ("CBC: Hb 8.5 g/dL, MCV normal, Coombs NEGATIVE, reticulocytes ↑↑.", 1, False, DARK_TEXT),
    ("Additional: Ceruloplasmin 8 mg/dL (↓↓), 24-hr urine copper 340 μg/24h (↑↑).", 1, False, DARK_TEXT),
    ("DIAGNOSIS", 0, True, TEAL),
    ("Wilson disease — hepatic + neurological presentation; Coombs-negative haemolytic anaemia (Wilson crisis)", 1, False, DARK_TEXT),
    ("MANAGEMENT", 0, True, TEAL),
    ("Trientine hydrochloride (chelation); zinc supplementation; liver Tx evaluation", 1, False, DARK_TEXT),
    ("Slit-lamp exam for Kayser-Fleischer rings; ATP7B genetic testing", 1, False, DARK_TEXT),
])

# 33 ── Case 4
content_slide(prs, "Case Vignette 4: Infant with Fever, HSM, Cytopenias", [
    ("PRESENTATION", 0, True, NAVY),
    ("A 2-year-old girl with 2-week fever, irritability, pallor, hepatosplenomegaly. Known EBV infection 3 weeks prior.", 1, False, DARK_TEXT),
    ("Examination: Febrile (39.2°C), jaundice, massive hepatosplenomegaly, no lymphadenopathy.", 1, False, DARK_TEXT),
    ("Labs: Hb 6.8, WBC 2.1, Plt 48,000, Fibrinogen 1.0 g/L, TG 4.8 mmol/L", 1, False, DARK_TEXT),
    ("Ferritin: 18,500 μg/L (markedly elevated). sCD25: 8,400 U/mL", 1, False, DARK_TEXT),
    ("DIAGNOSIS", 0, True, TEAL),
    ("Hemophagocytic Lymphohistiocytosis (HLH) — EBV-triggered (secondary/MAS)", 1, False, DARK_TEXT),
    ("MANAGEMENT", 0, True, TEAL),
    ("IMMEDIATE ICU admission; HLH-2004 protocol: Etoposide + Dexamethasone + Cyclosporine", 1, True, RED_ALERT),
    ("EBV: consider rituximab as steroid-sparing agent in EBV-HLH", 1, False, DARK_TEXT),
    ("Bone marrow evaluation; HSCT consideration for primary/familial HLH", 1, False, DARK_TEXT),
])

# ── SECTION 9 ──────────────────────────────────────────────────────────────────
section_divider(prs, "Section 9: Complications & Monitoring",
                "Long-term outcomes")

# 34 ── Complications
content_slide(prs, "Complications of Pediatric Liver Disease", [
    ("ACUTE", 0, True, NAVY),
    ("Acute liver failure: encephalopathy, coagulopathy, hypoglycaemia, cerebral oedema", 1, False, DARK_TEXT),
    ("Kernicterus (neonatal): basal ganglia damage → athetoid cerebral palsy, sensorineural hearing loss", 1, True, RED_ALERT),
    ("Sepsis: biliary atresia, PFIC patients are immunosuppressed", 1, False, DARK_TEXT),
    ("CHRONIC", 0, True, NAVY),
    ("Portal hypertension → oesophageal varices, ascites, hepatic encephalopathy, HRS", 1, False, DARK_TEXT),
    ("Growth failure and malnutrition due to malabsorption and hypermetabolism", 1, False, DARK_TEXT),
    ("Fat-soluble vitamin deficiencies (A, D, E, K): rickets, coagulopathy, neuropathy, night blindness", 1, False, DARK_TEXT),
    ("Hepatopulmonary syndrome and portopulmonary hypertension", 1, False, DARK_TEXT),
    ("Hepatocellular carcinoma (HCC): risk in HBV, biliary atresia, Alagille, metabolic cirrhosis", 1, True, RED_ALERT),
])

# 35 ── Monitoring
content_slide(prs, "Monitoring & Follow-Up in Pediatric Liver Disease", [
    ("GROWTH & NUTRITION", 0, True, NAVY),
    ("Anthropometry at every visit; formula with MCT oil for cholestatic infants; enteral feeding if needed", 1, False, DARK_TEXT),
    ("LABORATORY", 0, True, NAVY),
    ("LFTs (ALT, AST, GGT, bilirubin, albumin) 3-monthly; PT/INR", 1, False, DARK_TEXT),
    ("CBC: detect hypersplenism, anaemia, thrombocytopenia", 1, False, DARK_TEXT),
    ("AFP: hepatocellular carcinoma surveillance in at-risk patients (6-monthly)", 1, False, DARK_TEXT),
    ("IMAGING", 0, True, NAVY),
    ("Abdominal US 6–12 monthly for portal hypertension, liver echotexture, HCC surveillance", 1, False, DARK_TEXT),
    ("Echocardiography (Alagille — pulmonary stenosis, portopulmonary HTN)", 1, False, DARK_TEXT),
    ("ENDOSCOPY", 0, True, NAVY),
    ("OGD for variceal screening in portal hypertension; band ligation / beta-blockers for prophylaxis", 1, False, DARK_TEXT),
])

# ── SECTION 10 ──────────────────────────────────────────────────────────────────
section_divider(prs, "Section 10: Take-Home Messages",
                "Summary & Key Pearls")

# 36 ── Key pearls
summary_slide(prs, "Key Clinical Pearls", [
    ("Jaundice in the first 24 hrs is always PATHOLOGICAL — investigate urgently (HDN, sepsis)", 0, True, GOLD),
    ("Prolonged jaundice > 14 days requires measurement of direct bilirubin to exclude cholestasis", 0, True, GOLD),
    ("Acholic stools + dark urine + hepatomegaly = biliary atresia until proven otherwise; time-sensitive surgery", 0, True, GOLD),
    ("Conjugated > unconjugated hyperbilirubinemia NEVER physiological in neonates", 0, True, GOLD),
    ("Hepatosplenomegaly + Coombs-negative haemolytic anaemia in adolescent = Wilson disease", 0, True, GOLD),
    ("Massive splenomegaly suggests storage disease, haematological malignancy, or portal hypertension", 0, True, GOLD),
    ("Ferritin > 10,000 μg/L in a febrile child with hepatosplenomegaly = HLH until proven otherwise", 0, True, GOLD),
    ("Phototherapy is CONTRAINDICATED in conjugated jaundice (causes bronze baby syndrome)", 0, True, GOLD),
    ("Early involvement of pediatric hepatology essential for all chronic liver disease", 0, True, GOLD),
])

# 37 ── Diagnostic algorithm
content_slide(prs, "Diagnostic Algorithm: Jaundice with Hepatosplenomegaly in Children", [
    ("Step 1: Is it NEONATAL (< 28 days) or OLDER CHILD?", 0, True, TEAL),
    ("Step 2: Measure DIRECT BILIRUBIN — direct > 20% of total = cholestatic (URGENT workup)", 0, True, TEAL),
    ("Step 3: STOOL COLOR — acholic (pale) → biliary obstruction → biliary atresia / choledochal cyst", 0, False, DARK_TEXT),
    ("Step 4: HAEMATOLOGY — anaemia + ↑ reticulocytes + ↑ indirect bili → hemolytic (screen Coombs, PBS, G6PD)", 0, False, DARK_TEXT),
    ("Step 5: INFECTION screen — viral hepatitis (HAV IgM, HBsAg, HCV PCR, EBV, CMV)", 0, False, DARK_TEXT),
    ("Step 6: METABOLIC / GENETIC — ceruloplasmin, α1-AT, serum copper, newborn screen, lysosomal enzymes", 0, False, DARK_TEXT),
    ("Step 7: AUTOIMMUNE — ANA, ASMA, anti-LKM-1, IgG (if older child, ↑↑ transaminases)", 0, False, DARK_TEXT),
    ("Step 8: IMAGING — US ± Doppler; HIDA scan; MRCP; liver biopsy if diagnosis unclear", 0, False, DARK_TEXT),
    ("Step 9: REFER to pediatric hepatology / liver transplant centre for any progressive / undiagnosed liver disease", 0, True, NAVY),
])

# 38 ── Neonatal phototherapy guidelines (AAP)
content_slide(prs, "AAP Phototherapy Thresholds (Term Neonates ≥ 35 weeks GA)", [
    ("Based on the AAP 2022 revised nomogram using postnatal age in HOURS and neurotoxicity risk factors", 0, False, DARK_TEXT),
    ("", 0, False, DARK_TEXT),
    ("PHOTOTHERAPY INITIATION thresholds (approximate):", 0, True, NAVY),
    ("24 hours:  ~8–10 mg/dL (LOW risk) / ~6–8 mg/dL (MEDIUM/HIGH risk)", 1, False, DARK_TEXT),
    ("48 hours:  ~13–15 mg/dL (LOW risk) / ~10–12 mg/dL (HIGH risk)", 1, False, DARK_TEXT),
    ("72 hours:  ~15–17 mg/dL (LOW risk) / ~12–14 mg/dL (HIGH risk)", 1, False, DARK_TEXT),
    ("≥ 96 hours: ~17 mg/dL (LOW risk) / ~15 mg/dL (HIGH risk)", 1, False, DARK_TEXT),
    ("", 0, False, DARK_TEXT),
    ("RISK FACTORS for enhanced neurotoxicity: isoimmune hemolytic disease, G6PD deficiency, asphyxia, sepsis, acidosis, albumin < 3 g/dL, gestational age < 38 weeks", 0, False, DARK_TEXT),
    ("DISCONTINUE phototherapy when bilirubin 2–3 mg/dL below initiation threshold; rebound check at 24 hrs", 0, False, DARK_TEXT),
])

# 39 ── References
content_slide(prs, "Key References", [
    ("Nelson Textbook of Pediatrics, 21st Edition — Jaundice, Liver Disease chapters", 0, False, DARK_TEXT),
    ("Robbins & Kumar Basic Pathology — Neonatal Cholestasis, Bilirubin Metabolism", 0, False, DARK_TEXT),
    ("Harriet Lane Handbook, 23rd Ed — Biliary Atresia, Ursodeoxycholic acid dosing", 0, False, DARK_TEXT),
    ("ESPGHAN/NASPGHAN Guidelines on Neonatal Cholestasis (2017)", 0, False, DARK_TEXT),
    ("AAP Clinical Practice Guidelines: Hyperbilirubinemia in the Newborn Infant (2022 revision)", 0, False, DARK_TEXT),
    ("HLH-2004 Diagnostic & Therapeutic Guidelines (Henter JI et al., Pediatric Blood Cancer 2007)", 0, False, DARK_TEXT),
    ("European Wilson Disease Society Guidelines (Catana CS et al., JHEP 2022)", 0, False, DARK_TEXT),
    ("Ohi R et al. — Biliary Atresia: Surgical Management (J Pediatr Surg)", 0, False, DARK_TEXT),
    ("Alagille D et al. — Syndromic Paucity of Interlobular Bile Ducts (J Pediatr)", 0, False, DARK_TEXT),
    ("GeneReviews: ATP7B (Wilson Disease), JAGGED1 (Alagille), ABCB11 (PFIC2)", 0, False, DARK_TEXT),
])

# 40 ── Thank you / Q&A
slide = prs.slides.add_slide(blank)
add_rect(slide, 0, 0, 13.333, 7.5, fill_rgb=NAVY)
add_rect(slide, 0, 0, 0.4, 7.5, fill_rgb=GOLD)
add_rect(slide, 0.4, 3.3, 12.933, 0.06, fill_rgb=TEAL)
add_text(slide, "Thank You", 1.0, 1.5, 11, 1.5,
         font_name="Calibri", size=52, bold=True, color=WHITE,
         align=PP_ALIGN.CENTER, v_anchor=MSO_ANCHOR.MIDDLE)
add_text(slide, "Questions & Discussion Welcome", 1.0, 3.5, 11, 0.9,
         font_name="Calibri", size=24, bold=False, color=GOLD,
         align=PP_ALIGN.CENTER)
add_text(slide,
    "Department of Pediatrics  |  Pediatric Grand Rounds  |  2026",
    1.0, 5.0, 11, 0.7,
    font_name="Calibri", size=16, bold=False, color=WHITE, align=PP_ALIGN.CENTER)
add_text(slide, "\"The child who is jaundiced challenges us to look beyond the colour.\"",
    1.5, 6.0, 10, 0.7,
    font_name="Calibri", size=14, bold=False, italic=True, color=TEAL,
    align=PP_ALIGN.CENTER)

# ── Save ──────────────────────────────────────────────────────────────────────
out_path = "/tmp/workspace/pediatric-jaundice-ppt/Pediatric_Jaundice_HSM.pptx"
prs.save(out_path)
print(f"Saved {len(prs.slides)} slides → {out_path}")
Running Command

cd /tmp/workspace/pediatric-jaundice-ppt && python build_ppt.py 2>&1

Editing File

~/pediatric-jaundice-ppt/build_ppt.py

Successfully replaced 1 instance(s) of the string in '/tmp/workspace/pediatric-jaundice-ppt/build_ppt.py'
Running Command

cd /tmp/workspace/pediatric-jaundice-ppt && python build_ppt.py 2>&1

Your presentation is ready — 50 slides total, well above the 30-slide minimum.

Pediatric Jaundice HSM

Presentation · PPTX


What's inside the 50-slide deck:
SectionSlidesContent
Title & Outline1–2Title slide + 10-point learning objectives
Definitions & Epidemiology3–4Definitions of jaundice / HSM, epidemiology data
Bilirubin Metabolism5–6Metabolism overview, neonatal physiology & kernicterus risk
Classification7Pre-hepatic / Hepatic / Post-hepatic with causes
Causes by Age Group8–11Neonates, Infants/Toddlers, School-age, Adolescents
Clinical Assessment12–15History, PE, Kramer's zones, Red flags
Investigations16–20First-line labs, second-line labs, interpretation table, imaging, special tests
Common Conditions21–27Biliary atresia, HDN, Viral hepatitis (HAV/HBV/EBV/CMV), Wilson disease, Alagille syndrome, Storage diseases (Gaucher, Niemann-Pick, GSD, Galactosemia), HLH (with diagnostic criteria)
Management28–29General management + phototherapy + exchange transfusion + disease-specific management table
Clinical Vignettes30–334 case-based scenarios with diagnosis + management
Complications & Monitoring34–35Acute/chronic complications, follow-up protocol
Take-Home Messages36–40Key pearls, diagnostic algorithm, AAP phototherapy thresholds, references, Thank you slide
Design: Navy/Teal/Gold professional colour scheme, consistent header bars, red alert highlighting for critical points, data tables with alternating rows.
This is a shared conversation. Sign in to Orris to start your own chat.