Clinical and diagnostic algorithm for the management of patients with viral hepatitis and liver cirrhosis Make a word document ppt
"hepatitis B"[MeSH Terms] AND "liver cirrhosis"[MeSH Terms] AND "guideline"
EASL guidelines hepatitis B 2025 hepatitis C treatment cirrhosis Baveno VII portal hypertension algorithm
https://www.hepb.org/assets/Uploads/EASL-guidelines-May-2025…
ls -la /tmp/workspace/
mkdir -p /tmp/workspace/hepatitis-cirrhosis/assets /tmp/workspace/hepatitis-cirrhosis/src /tmp/workspace/hepatitis-cirrhosis/output && cat > /tmp/workspace/hepatitis-cirrhosis/src/flow.py <<'EOF' import matplotlib matplotlib.use("Agg") import matplotlib.pyplot as plt from matplotlib.patches import FancyBboxPatch fig, ax = plt.subplots(figsize=(13, 7.2)) ax.set_xlim(0, 100); ax.set_ylim(0, 60); ax.axis("off") def box(x, y, w, h, text, fc="#E8F0FA", ec="#1F3864", fs=9, bold=False): ax.add_patch(FancyBboxPatch((x, y), w, h, boxstyle="round,pad=0.3,rounding_size=1", fc=fc, ec=ec, lw=1.4)) ax.text(x + w/2, y + h/2, text, ha="center", va="center", fontsize=fs, fontweight="bold" if bold else "normal", wrap=True) def arrow(x1, y1, x2, y2): ax.annotate("", xy=(x2, y2), xytext=(x1, y1), arrowprops=dict(arrowstyle="-|>", color="#1F3864", lw=1.4)) box(30, 53, 40, 5, "Adult with raised ALT, risk factors, or incidental abnormal LFTs\nScreen: HBsAg, anti-HBc, anti-HCV (reflex HCV RNA)", fc="#1F3864", fs=9, bold=True) ax.texts[-1].set_color("white") arrow(50, 53, 22, 48.5); arrow(50, 53, 78, 48.5) box(2, 41, 40, 7, "HBsAg POSITIVE\nHBV DNA, HBeAg/anti-HBe, ALT, anti-HDV, HIV, HCV\nFibrosis: platelets, FIB-4, elastography", fc="#FDEBD0", ec="#B9770E") box(58, 41, 40, 7, "anti-HCV POSITIVE\nHCV RNA (active infection?), genotype optional\nHBsAg/anti-HBc (reactivation risk), HIV, fibrosis stage", fc="#E3F4E1", ec="#2E7D32") arrow(22, 41, 22, 36.5); arrow(78, 41, 78, 36.5) box(2, 29, 40, 7, "Cirrhosis or advanced fibrosis (LSM >8 kPa)\nand HBV DNA detectable: TREAT (TDF, TAF or ETV)\nOthers: DNA >= 2,000 IU/mL + ALT > ULN or fibrosis", fc="#FFF3E0", ec="#B9770E") box(58, 29, 40, 7, "Detectable HCV RNA: TREAT ALL\nSOF/VEL 12 wk or GLE/PIB 8-12 wk (compensated)\nDecompensated: no protease inhibitors, specialist unit", fc="#EAF7E8", ec="#2E7D32") arrow(22, 29, 40, 24.5); arrow(78, 29, 60, 24.5) box(25, 17.5, 50, 7, "Stage the liver: CIRRHOSIS? Child-Pugh, MELD-Na, LSM + platelets, endoscopy per Baveno VII\nCompensated (cACLD) vs Decompensated (ascites, variceal bleed, HE, jaundice)", fc="#F3E5F5", ec="#6A1B9A", bold=True) arrow(38, 17.5, 20, 12.5); arrow(62, 17.5, 80, 12.5) box(2, 1.5, 44, 11, "COMPENSATED\n- Continue etiologic control (NA / confirm SVR12)\n- LSM <20 kPa + platelets >150: no screening EGD\n- Otherwise EGD; carvedilol if CSPH\n- HCC surveillance US +/- AFP every 6 months\n- Vaccinate (HAV, HBV), alcohol abstinence", fc="#E8F5E9", ec="#2E7D32", fs=8.5) box(54, 1.5, 44, 11, "DECOMPENSATED\n- Treat cause (NA for HBV; DAA by specialist for HCV)\n- Ascites: diuretics, LVP + albumin, SBP work-up\n- Variceal bleed: vasoactive drug, antibiotics, EVL\n- HE: lactulose +/- rifaximin\n- Refer for liver transplant assessment early", fc="#FDECEA", ec="#C62828", fs=8.5) plt.savefig("/tmp/workspace/hepatitis-cirrhosis/assets/master_algorithm.png", dpi=170, bbox_inches="tight") EOF python3 /tmp/workspace/hepatitis-cirrhosis/src/flow.py && echo ok
cd /tmp/workspace/hepatitis-cirrhosis/src && sed -i 's/box(30, 53, 40, 5,/box(22, 53, 56, 5,/; s/box(25, 17.5, 50, 7,/box(12, 17.5, 76, 7,/' flow.py && sed -i 's/arrow(50, 53, 22, 48.5); arrow(50, 53, 78, 48.5)/arrow(40, 53, 22, 48.5); arrow(60, 53, 78, 48.5)/' flow.py && python3 flow.py && echo ok
cat > /tmp/workspace/hepatitis-cirrhosis/src/build.py <<'EOF' from docx import Document from docx.shared import Pt, Inches, RGBColor from docx.enum.section import WD_ORIENT from docx.enum.text import WD_ALIGN_PARAGRAPH, WD_BREAK from docx.enum.table import WD_TABLE_ALIGNMENT from docx.oxml.ns import qn from docx.oxml import OxmlElement NAVY = RGBColor(0x1F, 0x38, 0x64) doc = Document() sec = doc.sections[0] sec.orientation = WD_ORIENT.LANDSCAPE sec.page_width, sec.page_height = Inches(11), Inches(8.5) for m in ("left_margin", "right_margin"): setattr(sec, m, Inches(0.7)) sec.top_margin = Inches(0.6); sec.bottom_margin = Inches(0.6) st = doc.styles["Normal"]; st.font.name = "Calibri"; st.font.size = Pt(12) st.element.rPr.rFonts.set(qn("w:eastAsia"), "Calibri") for name, size in (("Heading 1", 24), ("Heading 2", 15)): h = doc.styles[name]; h.font.name = "Calibri"; h.font.size = Pt(size); h.font.bold = True h.font.color.rgb = NAVY h.element.rPr.rFonts.set(qn("w:eastAsia"), "Calibri") def shade(cell, color): tcPr = cell._tc.get_or_add_tcPr() shd = OxmlElement("w:shd"); shd.set(qn("w:val"), "clear"); shd.set(qn("w:color"), "auto"); shd.set(qn("w:fill"), color) tcPr.append(shd) def bottom_border(p, color="1F3864"): pPr = p._p.get_or_add_pPr(); b = OxmlElement("w:pBdr"); bt = OxmlElement("w:bottom") for k, v in (("val", "single"), ("sz", "12"), ("space", "1"), ("color", color)): bt.set(qn("w:" + k), v) b.append(bt); pPr.append(b) slide_no = [0] def slide(title, first=False): if not first: doc.add_paragraph().add_run().add_break(WD_BREAK.PAGE) slide_no[0] += 1 h = doc.add_heading(f"{slide_no[0]}. {title}", level=1) bottom_border(h) return h def bullets(items, size=12): for it in items: p = doc.add_paragraph(style="List Bullet") p.paragraph_format.space_after = Pt(3) if isinstance(it, tuple): r = p.add_run(it[0] + " "); r.bold = True; r.font.size = Pt(size) r2 = p.add_run(it[1]); r2.font.size = Pt(size) else: r = p.add_run(it); r.font.size = Pt(size) def table(headers, rows, widths=None, hfill="1F3864", size=10.5, zebra=True): t = doc.add_table(rows=1, cols=len(headers)); t.style = "Table Grid"; t.alignment = WD_TABLE_ALIGNMENT.CENTER for i, h in enumerate(headers): c = t.rows[0].cells[i]; c.text = ""; shade(c, hfill) r = c.paragraphs[0].add_run(h); r.bold = True; r.font.size = Pt(size); r.font.color.rgb = RGBColor(255, 255, 255) for ri, row in enumerate(rows): cells = t.add_row().cells for i, v in enumerate(row): cells[i].text = "" r = cells[i].paragraphs[0].add_run(v); r.font.size = Pt(size) if i == 0: r.bold = True if zebra and ri % 2 == 1: shade(cells[i], "EEF3FA") if widths: for row in t.rows: for i, w in enumerate(widths): row.cells[i].width = Inches(w) doc.add_paragraph().paragraph_format.space_after = Pt(2) return t def note(text, fill="FFF4D6"): t = doc.add_table(rows=1, cols=1); t.style = "Table Grid" c = t.rows[0].cells[0]; c.text = ""; shade(c, fill) r = c.paragraphs[0].add_run(text); r.font.size = Pt(10.5); r.italic = True # ---------- Title ---------- slide("Clinical and Diagnostic Algorithm for Viral Hepatitis and Liver Cirrhosis", first=True) p = doc.add_paragraph(); r = p.add_run("Stepwise approach from first abnormal test to long-term follow-up and transplant referral"); r.font.size = Pt(16); r.font.color.rgb = RGBColor(0x55, 0x55, 0x55) doc.add_paragraph() table(["Part", "Content"], [ ["A", "Diagnosis: serology, virology, fibrosis staging (slides 2-6)"], ["B", "Antiviral management: HBV, HCV, HDV, special groups (slides 7-11)"], ["C", "Cirrhosis: staging, portal hypertension, decompensation, HCC, transplant (slides 12-17)"], ["D", "Master algorithm, follow-up schedule, evidence and references (slides 18-21)"], ], widths=[1.0, 8.4], size=12) note("Educational summary based on textbook sources (Goldman-Cecil, Tietz, Sleisenger and Fordtran, Harrison 22E) and EASL/Baveno VII guidance. Doses, local availability and national protocols must be checked before clinical use.") # ---------- 2 ---------- slide("Who to test and first-line tests") bullets([ ("Test when:", "raised ALT/AST, jaundice, unexplained cirrhosis or HCC, risk exposure (injection drug use, transfusion before screening, dialysis, MSM, HIV, migrants from endemic areas, household contacts, mother-to-infant risk), before chemotherapy or immunosuppression."), ("Universal screening:", "HBsAg, anti-HBc (total) and anti-HBs once in every adult; anti-HCV once in every adult and in each pregnancy where guidelines advise."), ("Reflex testing:", "anti-HCV positive leads to HCV RNA on the same sample; HBsAg positive leads to HBV DNA, HBeAg/anti-HBe and anti-HDV."), ("Always exclude:", "co-infection (HIV, HCV, HBV, HDV), alcohol, metabolic liver disease (MASLD), autoimmune and iron/copper disorders, drug injury."), ], size=13) table(["Test", "Result", "Meaning"], [ ["HBsAg", "Positive", "Current HBV infection (acute or chronic). Persisting over 6 months = chronic."], ["Anti-HBc IgM", "Positive", "Acute HBV or flare of chronic HBV"], ["Anti-HBc total + anti-HBs, HBsAg negative", "Positive", "Resolved or occult exposure: reactivation risk with immunosuppression"], ["Anti-HCV", "Positive", "Past or current HCV. Confirm with HCV RNA."], ["HCV RNA", "Detectable", "Active infection: needs treatment"], ["Anti-HDV", "Positive in HBsAg+ patient", "Check HDV RNA"], ], widths=[3.0, 2.2, 4.2]) # ---------- 3 ---------- slide("Acute viral hepatitis: serologic algorithm") doc.add_paragraph("Adapted from the World Gastroenterology Organisation pathway reproduced in Tietz Textbook of Laboratory Medicine, 7th ed.") table(["Virus", "Step 1", "Step 2", "Interpretation"], [ ["HAV", "Anti-HAV IgM", "-", "Positive = acute hepatitis A"], ["HBV", "HBsAg", "Anti-HBc IgM", "Positive = acute HBV or flare of chronic HBV"], ["HCV", "Anti-HCV; HCV RNA if anti-HCV negative", "Seroconversion to anti-HCV", "RNA early, antibody may lag by weeks"], ["HDV", "Positive HBsAg", "Anti-HDV IgM or IgG", "If positive, HDV RNA or HDAg = acute hepatitis D"], ["HEV", "Negative for HAV IgM, HBsAg/anti-HBc IgM, anti-HCV/HCV RNA", "Anti-HEV IgM or IgG (HEV RNA)", "Positive = acute hepatitis E"], ], widths=[0.9, 3.0, 2.6, 2.9]) bullets([ "Serology is enough in most cases. Add molecular tests (RNA/DNA, quantitative) to confirm and monitor.", "Red flags for acute liver failure: INR 1.5 or more, encephalopathy, rapidly rising bilirubin. Admit to a transplant-capable centre.", "Chronic hepatitis = inflammation persisting for at least 6 months. Severity is staged by fibrosis, not by transaminase level (Tietz, 7th ed.).", ], size=12) # ---------- 4 ---------- slide("Assess the liver: fibrosis staging and cirrhosis diagnosis") bullets([ ("Aim:", "identify advanced fibrosis or cirrhosis, because this changes antiviral indication, HCC surveillance and variceal screening."), ("Step 1 - blood scores:", "FIB-4 = (age x AST) / (platelets x sqrt ALT). Under 1.3 makes advanced fibrosis unlikely; above 2.67 makes it likely. APRI is an alternative."), ("Step 2 - elastography (VCTE):", "liver stiffness measurement (LSM). In HBV, LSM above 8 kPa is used as equivalent to advanced fibrosis (EASL 2025). In compensated advanced chronic liver disease (cACLD): under 10 kPa rules out, 10-15 kPa suggestive, 15 kPa or more rules in (Baveno VII). ALT flares raise LSM falsely."), ("Step 3 - imaging:", "ultrasound for nodular surface, caudate hypertrophy, splenomegaly, ascites, portal vein flow; CT/MRI if HCC suspected."), ("Step 4 - biopsy:", "only when non-invasive tests disagree or another liver disease is suspected."), ("Clinical clues of cirrhosis:", "platelets under 150, low albumin, raised INR, spider naevi, palmar erythema, ascites, splenomegaly."), ], size=12) note("Non-invasive tests have been validated in HBV for WHO 2024 guidelines (meta-analysis, Lancet Gastroenterol Hepatol 2025, PMID 39983746).") # ---------- 5 ---------- slide("HBV: define the disease phase") table(["Phase (EASL 2017/2025 terms)", "HBeAg", "HBV DNA", "ALT", "Usual action"], [ ["HBeAg+ chronic infection", "+", "Very high (above 1e7 IU/mL)", "Normal", "Monitor, treat if fibrosis, age over 30 or family history"], ["HBeAg+ chronic hepatitis", "+", "High", "Raised", "Treat if persistent or fibrosis"], ["HBeAg- chronic infection", "-", "Under 2,000 IU/mL", "Normal", "Monitor ALT/DNA; quantify HBsAg"], ["HBeAg- chronic hepatitis", "-", "2,000 IU/mL or more", "Raised", "Treat"], ["Cirrhosis (any phase)", "+/-", "Any detectable level", "Any", "Treat if DNA detectable"], ], widths=[2.6, 0.8, 2.1, 1.0, 2.9]) bullets([ "Check ALT upper limit used: about 35 U/L men, 25 U/L women (EASL) rather than laboratory range.", "Always test HDV (anti-HDV) and HIV/HCV once in HBsAg-positive patients.", "The newest EASL (2025) approach moves from fixed phases to a risk-based indication: all HBsAg-positive patients with detectable HBV DNA are candidates for therapy.", ], size=12) # ---------- 6 ---------- slide("HCV: confirm infection and assess before treatment") bullets([ "Anti-HCV positive: send HCV RNA. Detectable RNA = active infection; anti-HCV positive with undetectable RNA = cleared or resolved (repeat RNA if recent exposure).", "Genotype is optional with pan-genotypic regimens, but needed where only some regimens are available.", "Before treatment: fibrosis stage (FIB-4/elastography), CBC, INR, albumin, bilirubin, renal function, HBsAg and anti-HBc (HBV reactivation risk with DAAs), HIV, pregnancy test, drug-drug interactions (www.hep-druginteractions.org), prior treatment history.", "Cirrhosis status decides regimen choice and post-cure follow-up (Goldman-Cecil Medicine, ch. 135).", ], size=13) # ---------- 7 ---------- slide("HBV treatment algorithm") doc.add_paragraph("Treatment indication (EASL Clinical Practice Guidelines 2025, Fig. 1)") table(["Question", "Yes", "No"], [ ["1. HBsAg positive with advanced fibrosis or cirrhosis, and HBV DNA positive?", "TREAT, regardless of DNA level or ALT", "Go to question 2"], ["2. HBV DNA 2,000 IU/mL or more?", "Treat if ALT above ULN, or fibrosis, or HCC risk factors, or extrahepatic manifestations, or immunosuppression, or transmission risk. Exclude other causes of high ALT first.", "Treat if DNA detectable plus the same modifiers; otherwise monitor"], ], widths=[3.8, 3.4, 2.2]) bullets([ ("First-line drugs:", "tenofovir disoproxil (TDF), tenofovir alafenamide (TAF) or entecavir (ETV). High genetic barrier, rare resistance. Preferred in compensated cirrhosis (Goldman-Cecil Medicine)."), ("Avoid:", "lamivudine, telbivudine, adefovir (resistance). PEG-interferon is contraindicated in decompensated cirrhosis."), ("Renal/bone disease:", "choose TAF or ETV; adjust ETV and TDF to eGFR. Lactic acidosis is a risk with ETV in MELD above 20."), ("Decompensated cirrhosis:", "start NA immediately with specialist and transplant centre input. Transplant-free survival above 80% and up to one-third regress to compensated disease (EASL 2025)."), ("Duration:", "long term. Stopping NA in cirrhosis is not recommended because of the risk of flares and decompensation."), ("Endpoints:", "undetectable HBV DNA, ALT normalisation; HBsAg loss is the ideal but rare."), ], size=11.5) # ---------- 8 ---------- slide("HCV treatment algorithm") bullets([ "Goal: sustained virologic response (SVR12 = undetectable RNA 12 weeks after end of treatment). SVR equals cure and exceeds 95% with pan-genotypic regimens (Goldman-Cecil Medicine).", "Treat all patients with detectable RNA without delay, regardless of fibrosis, unless life expectancy is limited by non-liver disease.", ], size=12) table(["Situation", "Regimen", "Duration"], [ ["No cirrhosis or compensated cirrhosis", "Sofosbuvir/velpatasvir", "12 weeks"], ["No cirrhosis or compensated cirrhosis (treatment-naive)", "Glecaprevir/pibrentasvir", "8 weeks (12 weeks if compensated cirrhosis with prior peg-IFN or sofosbuvir+RBV failure)"], ["Decompensated cirrhosis (Child-Pugh B/C)", "Sofosbuvir/velpatasvir + ribavirin (or 24 weeks without ribavirin if intolerant). Protease inhibitors (glecaprevir, voxilaprevir) are NOT used.", "12 weeks (24 weeks without RBV). Treat in a transplant-capable centre."], ["DAA failure", "Sofosbuvir/velpatasvir/voxilaprevir (compensated only)", "12 weeks"], ["Low-resource setting", "Sofosbuvir + daclatasvir (generic)", "12 weeks; 24 weeks or RBV in cirrhosis per local protocol"], ], widths=[2.9, 4.0, 2.5]) note("Check HBV status first: HBsAg-positive patients on DAAs need NA prophylaxis or close HBV DNA monitoring because of reactivation risk.") # ---------- 9 ---------- slide("HDV, HEV and HAV: practical points") table(["Virus", "When to suspect", "Diagnosis", "Management"], [ ["HDV", "Any HBsAg-positive patient; rapid progression to cirrhosis", "Anti-HDV total, then HDV RNA", "Bulevirtide (EU-approved) or PEG-IFN in compensated disease; continue HBV NA; transplant in end-stage disease"], ["HEV", "Unexplained acute hepatitis, immunosuppressed patients (chronic infection)", "Anti-HEV IgM/IgG and HEV RNA", "Supportive in acute disease. Reduce immunosuppression and consider ribavirin in chronic HEV."], ["HAV", "Acute hepatitis, travel, outbreak", "Anti-HAV IgM", "Supportive; vaccinate all patients with chronic liver disease"], ], widths=[0.8, 2.6, 2.4, 3.6]) # ---------- 10 ---------- slide("Special groups") table(["Group", "Key action"], [ ["HIV co-infection", "Start ART that includes tenofovir for HBV; DAA choice checked for interactions."], ["Pregnancy (HBV)", "Screen HBsAg. TDF (or TAF) from week 24-28 if HBV DNA above 200,000 IU/mL or HBsAg high; infant HBV vaccine plus HBIG within 12 hours."], ["Immunosuppression/chemotherapy", "Test HBsAg and anti-HBc first. HBsAg+: start NA before treatment. HBsAg-, anti-HBc+: prophylaxis with high-risk agents (rituximab, anti-CD20) or monitor."], ["Dialysis/CKD", "TAF or ETV; DAA safe at all eGFR with sofosbuvir-based or glecaprevir/pibrentasvir regimens."], ["Liver transplant recipient", "Lifelong NA (plus or minus HBIG) for HBV; DAAs before or after transplant for HCV."], ["Alcohol, obesity, diabetes", "Cofactors speeding fibrosis: counsel abstinence, weight loss, manage MASLD."], ], widths=[2.6, 6.8]) # ---------- 11 ---------- slide("Prevention and vaccination") bullets([ "HBV: vaccinate every non-immune patient (check anti-HBs 1-2 months after the series). Screen household and sexual contacts.", "HAV: vaccinate all with chronic liver disease or cirrhosis.", "Pneumococcal, influenza and COVID-19 vaccines in cirrhosis.", "HCV: no vaccine. Reinfection prevention counselling after cure, harm-reduction services.", "Avoid NSAIDs, nephrotoxins, sedatives; use acetaminophen up to 2 g/day in cirrhosis.", ], size=13) # ---------- 12 ---------- slide("Cirrhosis: confirm and stage") table(["Domain", "Tool / criterion"], [ ["Compensated vs decompensated", "Decompensation = ascites, variceal bleeding, overt hepatic encephalopathy, jaundice"], ["Prognosis", "Child-Pugh (A 5-6, B 7-9, C 10-15); MELD-Na for transplant allocation"], ["Portal hypertension", "Clinically significant (CSPH): HVPG 10 mmHg or more. LSM above 25 kPa rules in CSPH; LSM and platelets also used non-invasively."], ["Varices", "Baveno VII: LSM under 20 kPa and platelets over 150 x 10^9/L can avoid screening endoscopy (under 5% high-risk varices)."], ["HCC", "Ultrasound with or without AFP every 6 months in all cirrhosis, and in HBV carriers at risk"], ["Nutrition and frailty", "Protein 1.2-1.5 g/kg/day, late-evening snack, avoid fasting; screen sarcopenia"], ], widths=[2.6, 6.8]) bullets([ "Baveno VII 'recompensation': sustained cause control, resolved ascites/HE/bleeding, and improved liver function. About 60% of HBV-related decompensated patients may recompensate with antiviral therapy.", ], size=12) # ---------- 13 ---------- slide("Compensated cirrhosis: management pathway") table(["Step", "Action"], [ ["1. Treat the cause", "HBV: lifelong TDF/TAF/ETV. HCV: DAA to SVR12. Stop alcohol. Treat MASLD."], ["2. Risk-stratify portal hypertension", "LSM + platelets. Endoscopy if LSM 20 kPa or more or platelets 150 or less."], ["3. Prevent decompensation", "CSPH: carvedilol (start 6.25 mg daily, titrate to 12.5 mg); NSBB not needed if no CSPH."], ["4. Varices on endoscopy", "Small low risk: carvedilol or repeat EGD in 2 years. Medium/large: carvedilol or propranolol, or endoscopic variceal ligation if NSBB intolerance."], ["5. HCC surveillance", "Ultrasound with or without AFP every 6 months"], ["6. Vaccines and lifestyle", "HAV, HBV, pneumococcus, influenza; no alcohol; coffee and exercise are beneficial"], ], widths=[2.8, 6.6]) note("After HCV cure, patients with cirrhosis remain under HCC and portal hypertension surveillance; those with F3 and non-invasive tests of low risk may follow EASL 2024 position paper on post-SVR follow-up.") # ---------- 14 ---------- slide("Decompensation: ascites, SBP, hepatorenal syndrome") table(["Problem", "Diagnosis", "Treatment"], [ ["Ascites grade 2-3", "Ultrasound; diagnostic paracentesis (cells, albumin, SAAG, culture)", "Sodium restriction 80-120 mmol/day (about 2 g Na); spironolactone 100 mg + furosemide 40 mg, step up to 400/160; large-volume paracentesis with albumin 6-8 g per litre removed above 5 L"], ["SBP", "Ascitic PMN 250/mm3 or more", "Cefotaxime/ceftriaxone plus albumin 1.5 g/kg day 1 and 1 g/kg day 3; secondary prophylaxis (norfloxacin or ciprofloxacin per local resistance)"], ["Refractory ascites", "No response to maximal diuretics or intolerance", "Repeated paracentesis with albumin; TIPS; transplant referral"], ["Hyponatraemia", "Na under 125 mmol/L", "Stop diuretics, restrict fluid, albumin"], ["HRS-AKI", "Creatinine rise 0.3 mg/dL or 50% after 48 h diuretic stop and albumin 1 g/kg", "Terlipressin (or noradrenaline) plus albumin; transplant or TIPS evaluation"], ], widths=[1.7, 3.0, 4.7], size=10) doc.add_paragraph("Ascites management follows Sleisenger and Fordtran's Gastrointestinal and Liver Disease and EASL decompensated cirrhosis guidelines.").runs[0].font.size = Pt(10) # ---------- 15 ---------- slide("Decompensation: variceal bleeding and hepatic encephalopathy") table(["Problem", "Immediate management", "Prevention"], [ ["Acute variceal bleed", "Resuscitate (restrictive transfusion, Hb target 7-8 g/dL); vasoactive drug (terlipressin, octreotide) before endoscopy; antibiotic prophylaxis (ceftriaxone 1 g/day, max 7 days); endoscopy within 12 hours with band ligation. Pre-emptive TIPS within 72 h for Child-Pugh C 10-13 or B with active bleeding.", "NSBB + EVL for secondary prophylaxis"], ["Overt hepatic encephalopathy", "Find and treat precipitant (infection, bleeding, constipation, drugs, electrolytes, dehydration). Lactulose 25 mL every 1-2 hours until bowel movement, then titrate to 2-3 soft stools/day.", "Lactulose; add rifaximin 550 mg twice daily after second episode"], ["Jaundice / liver failure", "Evaluate for acute-on-chronic liver failure (ACLF), organ support, early transplant discussion", "Treat precipitant (alcohol, HBV flare, infection)"], ], widths=[1.8, 5.0, 2.6], size=10) # ---------- 16 ---------- slide("Hepatocellular carcinoma surveillance and diagnosis") bullets([ ("Who:", "all patients with cirrhosis; HBV carriers with high PAGE-B score, family history of HCC or non-cirrhotic F3 disease; post-SVR patients with cirrhosis."), ("How:", "abdominal ultrasound (add AFP) every 6 months."), ("Positive result:", "multiphasic CT or MRI. Typical arterial hyperenhancement with washout in cirrhosis = HCC (LI-RADS 5); otherwise biopsy or multidisciplinary review."), ("Treatment by BCLC stage:", "resection or ablation (very early/early), TACE (intermediate), systemic therapy such as atezolizumab/bevacizumab or durvalumab/tremelimumab (advanced), transplant within criteria."), ("Remember:", "cirrhosis remains the strongest predictor of HCC, even after viral suppression (EASL 2025)."), ], size=12.5) # ---------- 17 ---------- slide("Liver transplant referral") table(["Trigger", "Action"], [ ["MELD-Na 15 or more, or any decompensation event", "Refer to transplant centre for assessment"], ["Refractory ascites, recurrent HE, hepatorenal syndrome, recurrent variceal bleeding", "Refer; consider TIPS as bridge"], ["HCC within Milan or extended criteria", "Refer early, bridging with locoregional therapy"], ["Acute liver failure (HBV, HAV, HEV, drugs)", "Urgent referral; King's College or similar criteria"], ["After transplant", "HBV: NA lifelong ± HBIG. HCV: DAA, SVR in more than 95%"], ], widths=[5.0, 4.4]) # ---------- 18 ---------- slide("Master algorithm: viral hepatitis to cirrhosis") doc.add_picture("/tmp/workspace/hepatitis-cirrhosis/assets/master_algorithm.png", width=Inches(9.0)) doc.paragraphs[-1].alignment = WD_ALIGN_PARAGRAPH.CENTER c = doc.add_paragraph("NA, nucleos(t)ide analogue; DAA, direct-acting antiviral; LSM, liver stiffness measurement; CSPH, clinically significant portal hypertension; EGD, oesophagogastroduodenoscopy; EVL, endoscopic variceal ligation; LVP, large-volume paracentesis; HE, hepatic encephalopathy.") c.runs[0].font.size = Pt(9); c.runs[0].italic = True # ---------- 19 ---------- slide("Monitoring schedule") table(["Condition", "Tests", "Frequency"], [ ["HBV on NA, non-cirrhotic", "ALT, HBV DNA, creatinine/phosphate (TDF), quantitative HBsAg", "Every 3-6 months in year 1, then every 6-12 months"], ["HBV compensated cirrhosis, DNA undetectable, ALT normal", "ALT and HBV DNA every 6 months; quantitative HBsAg every 12 months; LSM and platelets for portal hypertension risk", "As listed (EASL 2025)"], ["HBV inactive carrier (not treated)", "ALT, HBV DNA, HBsAg level", "ALT every 3-6 months, DNA yearly; lifelong"], ["HCV after DAA", "HCV RNA at 12 weeks (SVR12), then ALT", "SVR12; reassess if cirrhosis"], ["Cirrhosis (any cause)", "CBC, INR, albumin, bilirubin, creatinine, Na; ultrasound ± AFP", "Every 3-6 months; ultrasound every 6 months"], ["Varices on NSBB", "Heart rate, blood pressure, renal function", "Each visit; repeat EGD only if not on NSBB"], ], widths=[2.8, 4.1, 2.5], size=10.5) # ---------- 20 ---------- slide("Key take-home points") bullets([ "Screen HBsAg, anti-HBc, anti-HBs and anti-HCV once in every adult; confirm HCV with RNA and test HBsAg-positive patients for HDV.", "Fibrosis stage, not ALT, drives decisions. Use FIB-4 and elastography first.", "HBV with cirrhosis and detectable DNA: treat with TDF, TAF or ETV, long term.", "HCV: treat everyone with detectable RNA; pan-genotypic DAA cure rate exceeds 95%; no protease inhibitors in decompensated disease.", "Cirrhosis: control the cause, prevent decompensation (carvedilol if CSPH), HCC ultrasound every 6 months, vaccinate.", "Decompensation is a trigger for transplant assessment; antiviral therapy can lead to recompensation.", ], size=14) # ---------- 21 ---------- slide("Evidence base and references") bullets([ "Goldman-Cecil Medicine, International Edition: Antivirals for HBV; Treatment of chronic hepatitis C (ch. 135).", "Tietz Textbook of Laboratory Medicine, 7th ed.: Diagnostic algorithm of viral hepatitis through serology.", "Sleisenger and Fordtran's Gastrointestinal and Liver Disease: Management of ascites in cirrhosis; nucleoside and nucleotide analogs.", "Harrison's Principles of Internal Medicine, 22nd ed.: Chronic hepatitis B.", "EASL Clinical Practice Guidelines on the management of hepatitis B virus infection. J Hepatol 2025.", "de Franchis R, et al. Baveno VII - Renewing consensus in portal hypertension. J Hepatol 2022;76:959-974.", "Reiberger T, et al. EASL position paper on clinical follow-up after HCV cure. J Hepatol 2024;81:326-344.", "Liguori A, et al. Non-invasive tests in chronic hepatitis B for WHO 2024 guidelines. Lancet Gastroenterol Hepatol 2025 (PMID 39983746).", "Pan CQ, et al. Technical systematic review supporting the 2025 AASLD Practice Guideline on chronic hepatitis B. Hepatology 2026 (PMID 41186417).", ], size=11) note("Recent evidence check: a 2025 AASLD HBV practice guideline and a 2026 meta-analysis of untreated non-cirrhotic HBV (PMID 41839199) may broaden treatment thresholds beyond older phase-based criteria. Check the current guideline for your region.") doc.save("/tmp/workspace/hepatitis-cirrhosis/output/Viral_Hepatitis_Cirrhosis_Algorithm.docx") EOF cd /tmp/workspace/hepatitis-cirrhosis && python3 src/build.py && ls -la output
Quick answer
master algorithm
Image · PNG
| Problem | Core management |
|---|---|
| Ascites | Sodium restriction, spironolactone plus furosemide, large-volume paracentesis with albumin, then TIPS or transplant for refractory ascites (Sleisenger and Fordtran) |
| Spontaneous bacterial peritonitis (SBP) | Diagnostic paracentesis (PMN 250 or more per mm³), antibiotics, albumin |
| Variceal bleed | Vasoactive drug, antibiotics, endoscopic band ligation |
| HE | Find the precipitant, give lactulose, add rifaximin |
| Hepatorenal syndrome - AKI | Stop diuretics, give albumin, then vasoconstrictor |
| Transplant | Refer early after the first decompensation or at MELD 15 or above |
cd /tmp/workspace/hepatitis-cirrhosis && python3 -c " from docx import Document d=Document('output/Viral_Hepatitis_Cirrhosis_Algorithm.docx') t=' '.join(p.text for p in d.paragraphs)+' '.join(c.text for tb in d.tables for r in tb.rows for c in r.cells) print(len(d.paragraphs),len(d.tables),'\u2014' in t,'\u2013' in t)"
Viral Hepatitis Cirrhosis Algorithm
Word Document · DOCX