Predictive markers of liver function.
"liver function" AND "predictive markers" AND biomarkers
"liver function tests" AND biomarkers AND hepatic
| Enzyme | Full Name | Primary Source | Specificity |
|---|---|---|---|
| ALT | Alanine aminotransferase | Primarily liver | More specific for liver injury |
| AST | Aspartate aminotransferase | Liver, cardiac/skeletal muscle, kidneys, brain, RBCs | Less specific |
"ALT is found primarily in the liver and is therefore a more specific indicator of liver injury." - Harrison's Principles of Internal Medicine 22E
| Marker | Comment |
|---|---|
| Serum cholesterol | Falls in severe hepatocellular failure (liver synthesises cholesterol); elevated in cholestasis |
| Plasma pseudocholinesterase | Synthesised by liver; falls in hepatocellular disease |
| Serum total protein | Decreases when >80% of liver is destroyed |
| Blood glucose | Hypoglycaemia in acute liver failure (impaired gluconeogenesis/glycogenolysis) |
| Fibrinogen | Short half-life; falls in acute synthetic failure |
| Score/Test | Components | Use |
|---|---|---|
| MELD 3.0 | Bilirubin + INR + creatinine + albumin + sodium (+ sex) | Predicts 90-day mortality; organ allocation |
| FIB-4 | Age + AST + ALT + platelet count | Non-invasive fibrosis staging (NAFLD, NASH, viral hepatitis) |
| APRI | AST + platelet count | Hepatic fibrosis and cirrhosis (hepatitis C) |
| Enhanced Liver Fibrosis (ELF) score | TIMP-1 + PIIINP + hyaluronic acid | Serum-based fibrosis score |
| Transient elastography (FibroScan) | Liver stiffness (kPa) | Gold standard non-invasive fibrosis assessment |
| Child-Pugh score | Bilirubin + albumin + PT + ascites + encephalopathy | Cirrhosis severity and surgical risk |
| Pattern | Predominant Abnormality | Likely Disease |
|---|---|---|
| Hepatocellular | AST/ALT markedly elevated; mild ALP | Acute hepatitis, toxic injury, ischaemia |
| Cholestatic | ALP/GGT markedly elevated; mild AST/ALT; elevated conjugated bilirubin | Biliary obstruction, PBC, PSC, drug-induced cholestasis |
| Synthetic failure | Low albumin, prolonged PT/INR | Cirrhosis, fulminant hepatic failure |
| Mixed | ALP + aminotransferase elevation | Infiltrative disease, drug injury, alcoholic hepatitis |
| Isolated bilirubin rise (unconjugated) | No enzyme elevation | Haemolysis, Gilbert's syndrome |

| Marker | What It Measures | Best Use |
|---|---|---|
| ALT | Hepatocyte injury | Detecting active liver cell damage |
| AST | Hepatocyte injury (less specific) | Alcoholic hepatitis when AST:ALT >2 |
| ALP | Biliary/cholestatic disease | Cholestasis, infiltrative disease |
| GGT | Biliary disease; alcohol; drugs | Confirming hepatic origin of ALP |
| Total bilirubin | Excretory function | Prognosis in hepatitis, cholestasis; MELD |
| Albumin | Chronic synthetic function | Staging cirrhosis; chronic disease |
| PT/INR | Acute synthetic function | Prognosis in acute hepatic failure; MELD |
| Ammonia | Urea cycle function | Encephalopathy workup; fulminant failure |
| FIB-4/APRI | Fibrosis stage | Non-invasive staging of chronic liver disease |
| MELD 3.0 | Overall decompensation | Transplant allocation; mortality prediction |
Create a reference guide PDF on liver function tests for clinical use
mkdir -p /tmp/workspace/lft-reference && ls /tmp/workspace/
~/lft-reference/build_lft_pdf.py
"""
Clinical Reference Guide: Liver Function Tests
Builds a professional multi-page PDF using ReportLab.
"""
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
HRFlowable, PageBreak, KeepTogether
)
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib import colors
from reportlab.lib.units import cm
from reportlab.lib.pagesizes import A4
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_RIGHT
from reportlab.platypus import Flowable
OUTPUT = "/tmp/workspace/lft-reference/LFT_Clinical_Reference_Guide.pdf"
# ─── Colour palette ───────────────────────────────────────────────────────────
NAVY = colors.HexColor("#1B3A6B")
TEAL = colors.HexColor("#0F7173")
LIGHT_TEAL = colors.HexColor("#D6EFEF")
AMBER = colors.HexColor("#E87722")
LIGHT_AMBER= colors.HexColor("#FFF3E0")
GREY_LIGHT = colors.HexColor("#F4F6F9")
GREY_MID = colors.HexColor("#CDD5E0")
WHITE = colors.white
RED_LIGHT = colors.HexColor("#FDECEA")
RED = colors.HexColor("#C0392B")
GREEN_LIGHT= colors.HexColor("#E8F5E9")
GREEN = colors.HexColor("#1B6B2F")
# ─── Document setup ───────────────────────────────────────────────────────────
doc = SimpleDocTemplate(
OUTPUT,
pagesize=A4,
leftMargin=1.8*cm, rightMargin=1.8*cm,
topMargin=2.0*cm, bottomMargin=2.0*cm,
title="Liver Function Tests – Clinical Reference Guide",
author="Orris Clinical Reference",
subject="Hepatology / Biochemistry",
)
PAGE_W = A4[0] - 3.6*cm # usable width
# ─── Styles ───────────────────────────────────────────────────────────────────
base = getSampleStyleSheet()
def ps(name, parent="Normal", **kw):
return ParagraphStyle(name, parent=base[parent], **kw)
sTitle = ps("sTitle", "Title",
fontSize=26, textColor=WHITE, leading=32,
spaceAfter=4, alignment=TA_CENTER, fontName="Helvetica-Bold")
sSubtitle = ps("sSubtitle",
fontSize=12, textColor=WHITE, leading=16,
spaceAfter=2, alignment=TA_CENTER, fontName="Helvetica")
sH1 = ps("sH1",
fontSize=13, textColor=WHITE, leading=18,
spaceBefore=8, spaceAfter=4,
fontName="Helvetica-Bold", alignment=TA_LEFT)
sH2 = ps("sH2",
fontSize=11, textColor=NAVY, leading=15,
spaceBefore=10, spaceAfter=3,
fontName="Helvetica-Bold")
sH3 = ps("sH3",
fontSize=10, textColor=TEAL, leading=14,
spaceBefore=6, spaceAfter=2,
fontName="Helvetica-Bold")
sBody = ps("sBody",
fontSize=9, leading=13, spaceAfter=4,
fontName="Helvetica", textColor=colors.HexColor("#1A1A2E"))
sBullet = ps("sBullet",
fontSize=9, leading=13, spaceAfter=2,
leftIndent=14, firstLineIndent=-10,
fontName="Helvetica", textColor=colors.HexColor("#1A1A2E"))
sSmall = ps("sSmall",
fontSize=7.5, leading=11, spaceAfter=2,
fontName="Helvetica", textColor=colors.HexColor("#555555"))
sNote = ps("sNote",
fontSize=8.5, leading=12, spaceAfter=2,
fontName="Helvetica-Oblique", textColor=colors.HexColor("#444444"))
sFooter = ps("sFooter",
fontSize=7, leading=10,
fontName="Helvetica", textColor=colors.HexColor("#888888"),
alignment=TA_CENTER)
sTH = ps("sTH",
fontSize=8.5, leading=12, fontName="Helvetica-Bold",
textColor=WHITE, alignment=TA_CENTER)
sTD = ps("sTD",
fontSize=8.5, leading=12, fontName="Helvetica",
textColor=colors.HexColor("#1A1A2E"), alignment=TA_LEFT)
sTDc = ps("sTDc",
fontSize=8.5, leading=12, fontName="Helvetica",
textColor=colors.HexColor("#1A1A2E"), alignment=TA_CENTER)
sTDbold = ps("sTDbold",
fontSize=8.5, leading=12, fontName="Helvetica-Bold",
textColor=NAVY, alignment=TA_LEFT)
sAlert = ps("sAlert",
fontSize=8.5, leading=12, fontName="Helvetica-Bold",
textColor=RED, alignment=TA_LEFT)
# ─── Helper: coloured section header band ────────────────────────────────────
class SectionBand(Flowable):
def __init__(self, text, bg=NAVY, width=None, height=24):
super().__init__()
self.text = text
self.bg = bg
self._width = width
self.height = height
def wrap(self, availW, availH):
self._width = self._width or availW
return self._width, self.height
def draw(self):
c = self.canv
c.setFillColor(self.bg)
c.roundRect(0, 0, self._width, self.height, 4, fill=1, stroke=0)
c.setFillColor(WHITE)
c.setFont("Helvetica-Bold", 11)
c.drawString(10, 7, self.text)
class TitleBanner(Flowable):
"""Full-width decorative title banner."""
def __init__(self, title, subtitle, width=None):
super().__init__()
self.title = title
self.subtitle = subtitle
self._width = width
self.height = 90
def wrap(self, availW, availH):
self._width = self._width or availW
return self._width, self.height
def draw(self):
c = self.canv
w, h = self._width, self.height
# Gradient-like block
c.setFillColor(NAVY)
c.roundRect(0, 0, w, h, 6, fill=1, stroke=0)
# Accent stripe
c.setFillColor(TEAL)
c.rect(0, 0, 6, h, fill=1, stroke=0)
# Amber accent line at top
c.setFillColor(AMBER)
c.rect(0, h-4, w, 4, fill=1, stroke=0)
# Title text
c.setFillColor(WHITE)
c.setFont("Helvetica-Bold", 22)
c.drawCentredString(w/2, h-36, self.title)
# Subtitle
c.setFont("Helvetica", 10)
c.setFillColor(LIGHT_TEAL)
c.drawCentredString(w/2, h-52, self.subtitle)
# Footer line in banner
c.setFillColor(colors.HexColor("#AACCCC"))
c.setFont("Helvetica-Oblique", 8)
c.drawCentredString(w/2, 8, "Sources: Harrison's Principles of Internal Medicine 22E · Henry's Clinical Diagnosis · Sleisenger & Fordtran")
def make_table(data, col_widths, header_bg=NAVY, stripe=True, font_size=8.5):
"""Build a styled table. data[0] is header row."""
cell_data = []
for i, row in enumerate(data):
cell_row = []
for j, cell in enumerate(row):
if i == 0:
cell_row.append(Paragraph(str(cell), sTH))
else:
p = sTDbold if j == 0 else sTD
cell_row.append(Paragraph(str(cell), p))
cell_data.append(cell_row)
cmds = [
("BACKGROUND", (0,0), (-1,0), header_bg),
("ROWBACKGROUNDS", (0,1), (-1,-1), [WHITE, GREY_LIGHT]),
("GRID", (0,0), (-1,-1), 0.4, GREY_MID),
("LINEBELOW", (0,0), (-1,0), 1.0, header_bg),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
("TOPPADDING", (0,0), (-1,-1), 4),
("BOTTOMPADDING",(0,0), (-1,-1), 4),
("LEFTPADDING", (0,0), (-1,-1), 6),
("RIGHTPADDING", (0,0), (-1,-1), 6),
]
t = Table(cell_data, colWidths=col_widths, repeatRows=1)
t.setStyle(TableStyle(cmds))
return t
def make_alert_box(text, bg=LIGHT_AMBER, border=AMBER):
"""Coloured alert/tip box."""
inner = Table(
[[Paragraph(text, sBody)]],
colWidths=[PAGE_W - 1.2*cm]
)
inner.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), bg),
("LINEAFTER", (0,0), (0,-1), 3, border),
("LINEBEFORE", (0,0), (0,-1), 3, border),
("TOPPADDING", (0,0), (-1,-1), 6),
("BOTTOMPADDING", (0,0), (-1,-1), 6),
("LEFTPADDING", (0,0), (-1,-1), 10),
("RIGHTPADDING", (0,0), (-1,-1), 10),
]))
return inner
# ═══════════════════════════════════════════════════════════════════════════════
# BUILD CONTENT
# ═══════════════════════════════════════════════════════════════════════════════
story = []
S = Spacer
def add_section(title, color=NAVY):
story.append(S(1, 10))
story.append(SectionBand(title, bg=color, width=PAGE_W))
story.append(S(1, 6))
# ─── PAGE 1 : COVER / OVERVIEW ───────────────────────────────────────────────
story.append(TitleBanner(
"Liver Function Tests",
"Clinical Reference Guide • Orris Medical • 2026",
width=PAGE_W
))
story.append(S(1, 10))
story.append(Paragraph(
"This guide provides a rapid-access reference for interpreting liver biochemistry panels in clinical practice. "
"Tests are grouped by the hepatic system they reflect: <b>cell integrity</b>, <b>cholestasis</b>, "
"<b>synthetic function</b>, and <b>non-invasive fibrosis staging</b>. "
"No single test captures total liver function — a panel approach is required.",
sBody
))
story.append(S(1, 8))
# KEY POINT BOX
story.append(make_alert_box(
"<b>Key principle:</b> Use LFTs as a battery, not in isolation. "
"Persistent or multi-test abnormalities increase specificity. "
"Aminotransferases detect <i>cell damage</i>; albumin and PT/INR assess true <i>synthetic function</i>.",
bg=LIGHT_TEAL, border=TEAL
))
story.append(S(1, 12))
# OVERVIEW TABLE
add_section("▸ Overview: Categories of Liver Function Tests", NAVY)
overview_data = [
["Category", "Tests", "What It Measures", "Rises / Falls"],
["Hepatocyte integrity", "ALT, AST, LDH", "Cell membrane damage / necrosis", "Rises with injury"],
["Cholestatic / biliary", "ALP, GGT, 5'-NT, Bilirubin (conjugated)", "Bile flow obstruction", "Rises with obstruction"],
["Synthetic function", "Albumin, PT/INR, Fibrinogen, Cholesterol", "Protein & factor production", "Falls with failure"],
["Excretory function", "Total & fractionated Bilirubin", "Conjugation & excretion of bilirubin", "Rises with impairment"],
["Detoxification", "Serum Ammonia", "Urea cycle capacity", "Rises when >80% liver lost"],
["Fibrosis staging", "FIB-4, APRI, ELF score, FibroScan", "Hepatic fibrosis extent", "Rises with fibrosis"],
["Prognostic scores", "MELD 3.0, Child-Pugh", "Decompensation / mortality", "Higher = worse prognosis"],
]
overview_cw = [3.5*cm, 4.5*cm, 5.0*cm, 3.5*cm]
story.append(make_table(overview_data, overview_cw, header_bg=NAVY))
story.append(S(1, 10))
# ─── PAGE 2 : HEPATOCYTE INTEGRITY ───────────────────────────────────────────
story.append(PageBreak())
story.append(TitleBanner(
"Section 1: Hepatocellular Integrity Markers",
"Aminotransferases — Detect cell injury before necrosis occurs",
width=PAGE_W
))
story.append(S(1, 10))
add_section("▸ Aminotransferases (Transaminases)", TEAL)
aminotransferase_data = [
["Enzyme", "Full Name", "Primary Source", "Normal Range", "Specificity"],
["ALT", "Alanine aminotransferase", "Primarily liver", "7–56 U/L", "High for liver injury"],
["AST", "Aspartate aminotransferase", "Liver, cardiac & skeletal muscle,\nkidneys, brain, RBCs", "10–40 U/L", "Lower (multi-organ)"],
["LDH", "Lactate dehydrogenase", "Liver, heart, muscle, RBCs", "140–280 U/L", "Non-specific"],
]
aminotransferase_cw = [2.0*cm, 4.5*cm, 5.0*cm, 2.5*cm, 2.5*cm]
story.append(make_table(aminotransferase_data, aminotransferase_cw, header_bg=TEAL))
story.append(S(1, 8))
story.append(Paragraph("<b>Interpretation rules:</b>", sH3))
bullets_alt = [
"Both ALT and AST are released into blood when hepatocyte membrane permeability increases — <b>cell necrosis is not required</b>.",
"ALT is more liver-specific; AST elevations can originate from muscle, heart, or haemolysis.",
"<b>Massive elevation (>1000 U/L):</b> Acute viral hepatitis, ischaemic hepatitis ('shock liver'), or drug/toxin-induced injury.",
"<b>Moderate elevation (5–15× ULN):</b> Chronic hepatitis B/C, alcoholic hepatitis, autoimmune hepatitis.",
"<b>Mild elevation (<5× ULN):</b> Non-alcoholic fatty liver disease (NAFLD), medications, thyroid disease, coeliac disease.",
]
for b in bullets_alt:
story.append(Paragraph(f"• {b}", sBullet))
story.append(S(1, 8))
add_section("▸ AST:ALT Ratio — Diagnostic Clues", TEAL)
ratio_data = [
["AST:ALT Ratio", "Interpretation", "Classic Cause"],
[">2:1", "Strongly suggests alcoholic aetiology", "Alcoholic liver disease (ALD)"],
[">3:1", "Highly specific for ALD", "Alcoholic hepatitis"],
["~1:1", "Equal elevation", "Viral hepatitis, NAFLD"],
["ALT > AST", "ALT dominates", "Chronic viral hepatitis (HBV, HCV)"],
["Both >1000 U/L", "Massive hepatocellular necrosis", "Ischaemia, acetaminophen toxicity, acute viral hepatitis"],
]
ratio_cw = [3.0*cm, 6.0*cm, 7.0*cm]
story.append(make_table(ratio_data, ratio_cw, header_bg=TEAL))
story.append(S(1, 8))
story.append(make_alert_box(
"<b>Pitfall:</b> AST:ALT ratio >2 in ALD is partly because pyridoxine (vitamin B6) deficiency impairs ALT synthesis more than AST. "
"Elevated AST from myocardial infarction, myopathy, or haemolysis can mimic liver disease — always consider non-hepatic sources.",
bg=RED_LIGHT, border=RED
))
# ─── PAGE 3 : CHOLESTASIS MARKERS ────────────────────────────────────────────
story.append(PageBreak())
story.append(TitleBanner(
"Section 2: Cholestatic & Biliary Markers",
"ALP · GGT · 5'-NT · Bilirubin",
width=PAGE_W
))
story.append(S(1, 10))
add_section("▸ Alkaline Phosphatase (ALP)", NAVY)
story.append(Paragraph(
"ALP is located on the <b>canalicular surface</b> of hepatocytes. Elevated in biliary obstruction, cholestasis, and infiltrative liver disease. "
"Also elevated in bone disease, pregnancy, and normal childhood growth (non-hepatic isoforms). "
"If ALP is elevated in isolation, fractionation or GGT/5'-NT measurement confirms hepatic origin.",
sBody
))
story.append(S(1,4))
alp_data = [
["ALP Level", "Likely Significance"],
["1–3× ULN", "May be non-specific; check GGT/5'-NT"],
["3–10× ULN", "Suggestive of cholestasis or infiltrative disease"],
[">10× ULN", "High likelihood of biliary obstruction or primary biliary cholangitis (PBC)"],
["Elevated + normal GGT", "Likely bone origin (Paget's, growth, fracture, bone mets)"],
["Elevated + elevated GGT", "Confirms hepatic origin"],
]
alp_cw = [3.5*cm, 13.0*cm]
story.append(make_table(alp_data, alp_cw, header_bg=NAVY))
story.append(S(1, 10))
add_section("▸ Gamma-Glutamyl Transferase (GGT)", NAVY)
story.append(Paragraph(
"GGT is on the <b>hepatic (sinusoidal) surface</b> of canalicular membranes. Highly sensitive but not specific. "
"Elevated by cholestasis, alcohol, many drugs (phenytoin, barbiturates, warfarin), and fatty liver disease. "
"<b>Not elevated in bone disease</b> — useful to differentiate hepatic vs. bone ALP.",
sBody
))
story.append(S(1, 10))
add_section("▸ 5'-Nucleotidase (5'-NT)", NAVY)
story.append(Paragraph(
"Like GGT, 5'-NT confirms the hepatic origin of an elevated ALP. Elevated specifically in biliary/cholestatic conditions. "
"Not influenced by alcohol, drugs, or pregnancy to the same degree as GGT.",
sBody
))
story.append(S(1, 10))
add_section("▸ Serum Bilirubin", NAVY)
bili_data = [
["Fraction", "Solubility", "Normal", "Elevated When", "Key Point"],
["Total bilirubin", "—", "0.2–0.9 mg/dL\n(ULN ~1–1.5)", "Any liver/biliary disease,\nhaemolysis", "Used in MELD 3.0"],
["Unconjugated\n(indirect)", "Water-insoluble\n(albumin-bound)", "<85% of total", "Haemolysis, Gilbert's,\nCrigler-Najjar", "Not filtered by kidney;\nno bilirubinuria"],
["Conjugated\n(direct)", "Water-soluble", "<0.3 mg/dL\n(<15% of total)", "Liver disease,\nbiliary obstruction", "Almost always\nimplies hepatobiliary disease"],
]
bili_cw = [2.8*cm, 3.0*cm, 2.8*cm, 4.2*cm, 3.7*cm]
story.append(make_table(bili_data, bili_cw, header_bg=NAVY))
story.append(S(1, 8))
story.append(Paragraph("<b>Prognostic value of total bilirubin:</b>", sH3))
bili_prog = [
"Higher bilirubin = greater hepatocellular damage in acute viral hepatitis.",
"Strongly correlates with mortality in <b>alcoholic hepatitis</b>.",
"Key component of <b>MELD 3.0</b> (predicts 90-day mortality, guides transplant allocation).",
"Prognostic marker in <b>primary biliary cholangitis (PBC)</b>.",
"Elevation in drug-induced liver injury signals more severe injury.",
"<b>Bilirubinuria</b> (dipstick) = conjugated bilirubin in urine → implies hepatobiliary disease (nearly 100% accurate).",
]
for b in bili_prog:
story.append(Paragraph(f"• {b}", sBullet))
# ─── PAGE 4 : SYNTHETIC FUNCTION ─────────────────────────────────────────────
story.append(PageBreak())
story.append(TitleBanner(
"Section 3: Hepatic Synthetic Function",
"Albumin · PT/INR · Coagulation Factors · Ammonia",
width=PAGE_W
))
story.append(S(1, 10))
story.append(Paragraph(
"True synthetic markers fall <b>only when >80% of functional liver tissue is destroyed</b>. "
"They are the most reliable indicators of overall hepatic reserve.",
sBody
))
story.append(S(1, 6))
add_section("▸ Serum Albumin", TEAL)
alb_rows = [
["Parameter", "Detail"],
["Synthesis", "Exclusively by hepatocytes; accounts for >50% of plasma protein synthesis"],
["Normal range", "3.5–5.0 g/dL"],
["Half-life", "~21 days (3 weeks) — NOT useful for acute injury assessment"],
["Best use", "Chronic liver disease staging (cirrhosis, chronic hepatitis)"],
["Falls with", ">80% hepatocyte destruction, malnutrition, protein-losing states (nephrotic syndrome, protein-losing enteropathy)"],
["Limitations", "Long half-life means slow response; also falls in systemic inflammation (negative acute-phase reactant)"],
]
alb_cw = [4.0*cm, 12.5*cm]
story.append(make_table(alb_rows, alb_cw, header_bg=TEAL))
story.append(S(1, 10))
add_section("▸ Prothrombin Time (PT) / INR", TEAL)
story.append(Paragraph(
"The <b>single best acute measure</b> of hepatic synthetic function. All clotting factors except Factor VIII are made exclusively in hepatocytes.",
sBody
))
story.append(S(1, 4))
factors_data = [
["Coagulation Factor", "Half-life", "Measured by PT?", "Vitamin K-dependent?"],
["Factor I (Fibrinogen)", "~5 days", "Indirectly", "No"],
["Factor II (Prothrombin)", "~3 days", "Yes", "Yes"],
["Factor V", "~1 day", "Yes", "No"],
["Factor VII", "~6 hours", "Yes", "Yes"],
["Factor X", "~2 days", "Yes", "Yes"],
["Factor VIII", "~12 hours", "No", "No (produced by endothelium)"],
]
factors_cw = [5.0*cm, 2.5*cm, 3.0*cm, 3.5*cm]
story.append(make_table(factors_data, factors_cw, header_bg=TEAL))
story.append(S(1, 8))
story.append(Paragraph("<b>Interpreting PT/INR in liver disease:</b>", sH3))
pt_points = [
"<b>Factor VII</b> has the shortest half-life (6 h) → PT/INR is the most rapidly responsive test for acute synthetic failure.",
"PT prolonged >5 s above control, <b>not corrected by parenteral vitamin K</b>, is a poor prognostic sign in acute hepatitis.",
"<b>Vitamin K deficiency</b> (cholestasis, fat malabsorption) also prolongs PT — responds to IV vitamin K. True synthetic failure does NOT respond.",
"INR is a core component of <b>MELD 3.0</b>.",
"Administer IV vitamin K (10 mg) before attributing PT prolongation to synthetic failure.",
]
for b in pt_points:
story.append(Paragraph(f"• {b}", sBullet))
story.append(S(1, 8))
add_section("▸ Other Synthetic Markers", TEAL)
other_syn_data = [
["Marker", "Direction in Failure", "Key Use / Notes"],
["Fibrinogen", "Decreases", "Short half-life; sensitive in acute failure; also consumed in DIC"],
["Serum Cholesterol", "Decreases", "Falls in severe hepatocellular failure (liver makes cholesterol). Rises in cholestasis"],
["Plasma Pseudocholinesterase", "Decreases", "Liver-synthesised; reduced in cirrhosis; relevant in anaesthesia (suxamethonium sensitivity)"],
["Blood Glucose", "Decreases (hypoglycaemia)", "Impaired gluconeogenesis/glycogenolysis in acute fulminant failure"],
["Total Protein", "Decreases", "Falls when >80% liver is destroyed; less sensitive than albumin alone"],
]
other_syn_cw = [4.5*cm, 3.5*cm, 8.5*cm]
story.append(make_table(other_syn_data, other_syn_cw, header_bg=TEAL))
story.append(S(1, 10))
add_section("▸ Serum Ammonia", TEAL)
ammonia_points = [
"The liver is the <b>only organ</b> that metabolises ammonia to urea (Krebs-Henseleit cycle).",
"Ammonia rises when >80% of hepatic tissue is destroyed or in significant <b>portosystemic shunting</b>.",
"<b>Poor correlation</b> with the presence or severity of hepatic encephalopathy (HE) — do not use alone for HE diagnosis.",
"<b>Elevated arterial ammonia</b> does correlate with outcome in <b>fulminant hepatic failure</b>.",
"Useful to identify occult liver disease in patients with unexplained mental status changes.",
"Muscle wasting in cirrhosis worsens hyperammonaemia (muscle also detoxifies ammonia → glutamine).",
]
for b in ammonia_points:
story.append(Paragraph(f"• {b}", sBullet))
# ─── PAGE 5 : FIBROSIS + SCORES ──────────────────────────────────────────────
story.append(PageBreak())
story.append(TitleBanner(
"Section 4: Non-Invasive Fibrosis Staging & Prognostic Scores",
"FIB-4 · APRI · ELF · Child-Pugh · MELD 3.0",
width=PAGE_W
))
story.append(S(1, 10))
add_section("▸ Non-Invasive Fibrosis Scores", NAVY)
fib_data = [
["Score / Test", "Formula / Components", "Threshold", "Use"],
["FIB-4", "Age × AST / (Platelets × √ALT)", "<1.30 = low fibrosis\n>2.67 = high fibrosis", "NAFLD, HCV, HBV staging"],
["APRI", "(AST/ULN) / Platelets × 100", "<0.5 = low\n>1.0 = significant fibrosis", "HCV fibrosis, cirrhosis"],
["ELF Score", "TIMP-1 + PIIINP + Hyaluronic acid", ">9.8 = advanced fibrosis", "Chronic liver disease"],
["FibroScan\n(Transient Elastography)", "Liver stiffness (kPa) via ultrasound probe", "<7 kPa = F0–F1\n>12–14 kPa = cirrhosis", "Gold-standard non-invasive; most validated"],
["NFS (NAFLD Fibrosis Score)", "Age, BMI, IFG/DM, AST:ALT ratio,\nplatelets, albumin", "<-1.455 = low risk\n>0.676 = high risk", "Specifically validated in NAFLD/MASLD"],
]
fib_cw = [3.0*cm, 5.5*cm, 4.0*cm, 4.0*cm]
story.append(make_table(fib_data, fib_cw, header_bg=NAVY))
story.append(S(1, 10))
add_section("▸ Prognostic Scoring Systems", AMBER)
score_data = [
["Score", "Components", "Score Range", "Clinical Use"],
["MELD 3.0", "Bilirubin + INR + Creatinine +\nAlbumin + Sodium (+ 1.33 if female)", "6–40 (higher = worse)", "90-day mortality; transplant organ allocation; surgical risk in cirrhosis"],
["Child-Pugh", "Bilirubin + Albumin + PT +\nAscites + Encephalopathy", "A (5–6): mild\nB (7–9): moderate\nC (10–15): severe", "Cirrhosis staging; surgical risk; prognosis in chronic liver disease"],
["Maddrey's DF", "(PT – control × 4.6) + Bilirubin", "≥32 = severe alcoholic hepatitis", "Steroid treatment decision in alcoholic hepatitis"],
["Glasgow AH Score", "Age + WBC + Urea + PT ratio + Bilirubin", "≥9 = poor prognosis", "Alcoholic hepatitis 28-day survival"],
]
score_cw = [2.5*cm, 5.0*cm, 4.0*cm, 5.0*cm]
story.append(make_table(score_data, score_cw, header_bg=AMBER))
story.append(S(1, 10))
story.append(make_alert_box(
"<b>MELD 3.0 Formula:</b> "
"4.56 × ln(bilirubin) + 9.09 × ln(INR) + 11.14 × ln(creatinine) + 1.85 × (138 – sodium) – 0.24 × (138 – sodium) × ln(creatinine) – 7 × albumin + 1.33 (if female) + 9.09 "
"| Score ≥15: benefit from transplantation. Score ≥40: ~100% 3-month mortality without transplant.",
bg=LIGHT_AMBER, border=AMBER
))
# ─── PAGE 6 : DIAGNOSTIC PATTERNS ────────────────────────────────────────────
story.append(PageBreak())
story.append(TitleBanner(
"Section 5: Diagnostic Pattern Recognition",
"Interpreting the test battery — pattern approach to liver disease",
width=PAGE_W
))
story.append(S(1, 10))
add_section("▸ Classic Biochemical Patterns", NAVY)
pattern_data = [
["Pattern", "ALT / AST", "ALP / GGT", "Bilirubin", "Albumin / PT", "Classic Aetiology"],
["Acute hepatocellular\ninjury", "Markedly elevated\n(>10× ULN)", "Mildly elevated\n(1–3×)", "Moderately raised\n(conjugated+unconj.)", "PT may prolong\nacutely", "Viral hepatitis, drug toxicity,\nischaemic hepatitis"],
["Chronic hepatocellular\ndisease", "Mildly–moderately\nelevated (1–10×)", "Mildly elevated", "Normal or\nmildly raised", "Albumin low;\nPT prolonged", "Cirrhosis, chronic HCV/HBV,\nNAFLD"],
["Cholestatic\n(obstructive)", "Mildly elevated\n(<3×)", "Markedly elevated\n(>4×)", "Conjugated bili-\nrubin dominates", "Normal unless\nprolonged cholestasis", "Gallstones, cholangiocarcinoma,\nPSC, PBC, drug-induced"],
["Alcoholic hepatitis", "AST:ALT >2:1\n(rarely >300 U/L)", "GGT markedly elevated;\nALP variable", "Elevated", "Albumin low;\nPT prolonged", "Alcohol use disorder"],
["Infiltrative disease\n(e.g. malignancy,\ngranuloma)", "Normal or mildly\nelevated", "ALP markedly\nelevated", "Mildly elevated\nor normal", "Normal (early)", "Hepatic metastases, sarcoidosis,\ntuberculosis, amyloid"],
["Isolated unconjugated\nhyperbilirubinaemia", "Normal", "Normal", "Unconjugated\nfraction only", "Normal", "Gilbert's syndrome,\nhaemolysis"],
["Fulminant hepatic\nfailure", "Very high\n(>1000 U/L)", "Elevated", "Very high", "Albumin falls;\nPT/INR markedly\nprolonged", "Acute viral hepatitis,\nacetaminophen, Wilson's disease"],
]
pattern_cw = [2.8*cm, 2.8*cm, 2.8*cm, 2.8*cm, 2.8*cm, 3.5*cm]
story.append(make_table(pattern_data, pattern_cw, header_bg=NAVY))
story.append(S(1, 10))
add_section("▸ Differential by Degree of ALT/AST Elevation", TEAL)
elevation_data = [
["Elevation Level", "ALT/AST Range", "Typical Causes"],
["Mild", "<3× ULN", "NAFLD, medications (statins, antibiotics), thyroid disease, coeliac disease, early cirrhosis"],
["Moderate", "3–10× ULN", "Chronic viral hepatitis (HBV/HCV), autoimmune hepatitis, alcoholic liver disease, haemochromatosis"],
["Marked", "10–40× ULN", "Acute viral hepatitis, drug-induced liver injury (DILI), acute biliary obstruction"],
["Massive (>1000 U/L)", ">40× ULN", "Ischaemic/shock hepatitis, acetaminophen toxicity, severe acute viral hepatitis, Budd-Chiari (acute)"],
]
elevation_cw = [2.5*cm, 3.0*cm, 11.0*cm]
story.append(make_table(elevation_data, elevation_cw, header_bg=TEAL))
# ─── PAGE 7 : QUICK REFERENCE CARD ──────────────────────────────────────────
story.append(PageBreak())
story.append(TitleBanner(
"Section 6: Quick Reference Card",
"Normal ranges · clinical red flags · follow-up thresholds",
width=PAGE_W
))
story.append(S(1, 10))
add_section("▸ Normal Reference Ranges (Adult)", NAVY)
normal_data = [
["Test", "Conventional Units", "SI Units", "Notes"],
["ALT", "7–56 U/L", "0.12–0.93 µkat/L", "Female ULN slightly lower in many labs"],
["AST", "10–40 U/L", "0.17–0.67 µkat/L", "Higher in neonates"],
["ALP", "44–147 U/L", "0.73–2.45 µkat/L", "Elevated in children, pregnancy (placental isoform)"],
["GGT", "9–48 U/L (M)\n7–25 U/L (F)", "—", "Age/sex-dependent; rises with alcohol, drugs"],
["Total Bilirubin", "0.2–1.2 mg/dL", "3.4–20.5 µmol/L", "95th percentile: 0.2–0.9 mg/dL"],
["Direct (Conj.) Bilirubin", "<0.3 mg/dL", "<5.1 µmol/L", ">15% of total = conjugated hyperbilirubinaemia"],
["Albumin", "3.5–5.0 g/dL", "35–50 g/L", "Nutritional status also affects levels"],
["Prothrombin Time", "11–13.5 sec", "INR: 0.9–1.1", "Reagent-dependent; INR standardises comparison"],
["Ammonia (venous)", "15–45 µg/dL", "9–33 µmol/L", "Arterial sample preferred for critical illness"],
["Fibrinogen", "200–400 mg/dL", "2.0–4.0 g/L", "Acute-phase reactant; may initially rise in inflammation"],
]
normal_cw = [3.5*cm, 3.5*cm, 3.0*cm, 6.5*cm]
story.append(make_table(normal_data, normal_cw, header_bg=NAVY))
story.append(S(1, 10))
add_section("▸ Clinical Red Flags Requiring Urgent Action", RED)
redflag_data = [
["Finding", "Clinical Significance", "Action"],
["PT/INR >1.5 + jaundice\n(not corrected by vitamin K)", "Acute liver failure (ALF) or\nsevere synthetic failure", "Admit, liver transplant centre referral, N-acetylcysteine if acetaminophen"],
["Bilirubin rising + PT\nprolonging in viral hepatitis", "Pending acute liver failure", "Urgent hepatology review"],
["ALT/AST falling but PT rising\nin acute hepatitis", "\"Burned-out\" necrosis —\nparadoxical sign of deterioration", "Urgent review; mass necrosis"],
["Ammonia >150 µmol/L\n+ encephalopathy", "Severe hyperammonaemia in\nfultminant failure", "ICU level care; transplant evaluation"],
["Maddrey DF ≥32", "Severe alcoholic hepatitis:\n~50% 30-day mortality", "Consider corticosteroids (Prednisolone 40 mg/day) if no contraindication"],
["Child-Pugh C\n(score 10–15)", "Advanced cirrhosis; high\noperative mortality", "Avoid elective surgery; transplant assessment"],
]
redflag_cw = [4.0*cm, 5.5*cm, 7.0*cm]
story.append(make_table(redflag_data, redflag_cw, header_bg=RED))
story.append(S(1, 10))
# ─── PAGE 8 : APPROACH & SOURCES ─────────────────────────────────────────────
story.append(PageBreak())
story.append(TitleBanner(
"Section 7: Stepwise Clinical Approach",
"When you receive an abnormal LFT panel",
width=PAGE_W
))
story.append(S(1, 10))
add_section("▸ Step-by-Step Evaluation Algorithm", TEAL)
steps = [
("<b>Step 1 — Identify the dominant pattern</b>",
"Is it hepatocellular (ALT/AST ↑↑), cholestatic (ALP/GGT ↑↑), or mixed? Look at the ratio of transaminases to ALP."),
("<b>Step 2 — Assess severity</b>",
"Check synthetic markers (albumin, PT/INR) and bilirubin. Prolonged PT not corrected by vitamin K = true synthetic failure."),
("<b>Step 3 — Acute vs. chronic?</b>",
"Albumin falls over weeks; PT/INR changes within hours–days. Low albumin + normal PT suggests chronic disease. Very high AST/ALT (>500) suggests acute injury."),
("<b>Step 4 — Confirm hepatic origin of ALP</b>",
"If ALP is elevated, check GGT or 5'-NT. If both elevated = hepatic origin. If GGT normal = likely bone or pregnancy."),
("<b>Step 5 — Fractionate bilirubin if needed</b>",
"Unconjugated dominant → haemolysis or Gilbert's. Conjugated dominant → hepatobiliary disease. Mixed elevation = most liver diseases."),
("<b>Step 6 — Directed aetiological workup</b>",
"Hepatocellular pattern → Hepatitis B/C serology, autoimmune panel (ANA, ASMA, anti-LKM), iron studies, ceruloplasmin (age <40), ferritin, alcohol history, drug review. "
"Cholestatic pattern → Ultrasound first; if ducts not dilated → AMA (PBC); if dilated → CT/MRCP/ERCP."),
("<b>Step 7 — Stage fibrosis in chronic disease</b>",
"Use FIB-4, APRI, or FibroScan to assess fibrosis non-invasively before considering biopsy."),
("<b>Step 8 — Calculate a prognostic score</b>",
"MELD 3.0 for transplant/mortality risk. Child-Pugh for surgical planning. Maddrey DF for alcoholic hepatitis treatment decision."),
]
for i, (heading, body) in enumerate(steps):
story.append(Paragraph(heading, sH3))
story.append(Paragraph(body, sBody))
story.append(S(1, 4))
story.append(S(1, 10))
add_section("▸ Sources & References", GREY_MID if False else colors.HexColor("#3D3D5C"))
refs = [
"Harrison's Principles of Internal Medicine, 22nd Edition (2025, McGraw Hill) — Chapter 348: Evaluation of Liver Function (Bethea ED, Pratt DS)",
"Henry's Clinical Diagnosis and Management by Laboratory Methods — Chapter: Liver Function Tests",
"Sleisenger and Fordtran's Gastrointestinal and Liver Disease — Tests to Establish the Presence and Severity of Liver Disease",
"Morgan & Mikhail's Clinical Anesthesiology, 7th Edition — Liver Function Testing",
"Barash, Cullen & Stoelting's Clinical Anesthesia, 9th Edition — Assessment of Hepatic Function",
"MELD 3.0: Kim WR et al. MELD 3.0: The Model for End-Stage Liver Disease Updated for the 21st Century. Hepatology. 2021;74(4):1instance68–1177.",
"European Association for the Study of the Liver (EASL) Clinical Practice Guidelines — Non-invasive tests for evaluation of liver disease",
]
for r in refs:
story.append(Paragraph(f"• {r}", sSmall))
story.append(S(1, 14))
story.append(HRFlowable(width=PAGE_W, thickness=0.5, color=GREY_MID))
story.append(S(1, 6))
story.append(Paragraph(
"This reference guide is intended for qualified healthcare professionals. Clinical decisions must integrate patient-specific context, "
"institutional guidelines, and current evidence. Always verify reference ranges against your local laboratory's validated intervals.",
sNote
))
story.append(S(1, 4))
story.append(Paragraph("Orris Clinical Reference • Liver Function Tests Guide • July 2026", sFooter))
# ─── BUILD ────────────────────────────────────────────────────────────────────
doc.build(story)
print(f"PDF written to: {OUTPUT}")
cd /tmp/workspace/lft-reference && python build_lft_pdf.py 2>&1
ls -lh /tmp/workspace/lft-reference/LFT_Clinical_Reference_Guide.pdf
LFT Clinical Reference Guide
PDF Document · PDF
| Section | Content |
|---|---|
| Cover / Overview | Introductory panel, key principle box, master categories table |
| Section 1 - Hepatocellular Integrity | ALT & AST normal ranges, specificity, interpretation rules, AST:ALT ratio table with classic aetiologies, pitfall alert box |
| Section 2 - Cholestatic & Biliary | ALP (with degree-of-elevation table), GGT, 5'-NT, full bilirubin fractionation table, prognostic value of bilirubin |
| Section 3 - Synthetic Function | Albumin (half-life caveats), PT/INR with coagulation factor table (half-lives, vitamin K dependence), other synthetic markers, ammonia |
| Section 4 - Fibrosis & Prognostic Scores | FIB-4, APRI, ELF, FibroScan, NFS; MELD 3.0 formula + thresholds, Child-Pugh, Maddrey DF, Glasgow AH score |
| Section 5 - Diagnostic Patterns | Pattern recognition table (8 clinical scenarios), differential by degree of ALT/AST elevation |
| Section 6 - Quick Reference Card | Normal reference ranges (conventional + SI units), red flag findings with action thresholds |
| Section 7 - Stepwise Approach & References | 8-step clinical algorithm, primary sources (Harrison's 22E, Henry's, Sleisenger & Fordtran) |