Physiology and Pathophysiology of Liver and the the parameters that are observed in Liver function test and their reasons for variations in pdf format with download option

Reading File
Reading File
Finding Sources
Finding Sources
Finding Sources
Searching PubMed

"liver function tests"[MeSH Terms] AND "abnormal"

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

mkdir -p /tmp/workspace/liver-pdf && ls -la /tmp/workspace/ /tmp/workspace/liver-pdf

Writing File

~/liver-pdf/make_pdf.py

from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.units import mm
from reportlab.lib.styles import ParagraphStyle, getSampleStyleSheet
from reportlab.lib.enums import TA_LEFT
from reportlab.platypus import (BaseDocTemplate, PageTemplate, Frame, Paragraph, Spacer,
                                Table, TableStyle, PageBreak, KeepTogether)

OUT = "/tmp/workspace/liver-pdf/Liver_Physiology_Pathophysiology_and_LFT.pdf"
NAVY = colors.HexColor("#1F3A5F")
TEAL = colors.HexColor("#2A7F8E")
LIGHT = colors.HexColor("#EAF2F6")
GREY = colors.HexColor("#F5F5F5")

ss = getSampleStyleSheet()
body = ParagraphStyle("body", parent=ss["Normal"], fontName="Helvetica", fontSize=9.6, leading=13.2, spaceAfter=5)
h1 = ParagraphStyle("h1", parent=body, fontName="Helvetica-Bold", fontSize=15, leading=19, textColor=NAVY, spaceBefore=10, spaceAfter=6)
h2 = ParagraphStyle("h2", parent=body, fontName="Helvetica-Bold", fontSize=11.5, leading=15, textColor=TEAL, spaceBefore=8, spaceAfter=4)
bul = ParagraphStyle("bul", parent=body, leftIndent=14, bulletIndent=4, spaceAfter=2.5)
cell = ParagraphStyle("cell", parent=body, fontSize=8.2, leading=10.4, spaceAfter=0)
cellb = ParagraphStyle("cellb", parent=cell, fontName="Helvetica-Bold")
cellh = ParagraphStyle("cellh", parent=cell, fontName="Helvetica-Bold", textColor=colors.white)
note = ParagraphStyle("note", parent=body, fontSize=8.6, leading=11.5, textColor=colors.HexColor("#444444"))
title = ParagraphStyle("title", parent=body, fontName="Helvetica-Bold", fontSize=24, leading=30, textColor=NAVY, spaceAfter=8)
sub = ParagraphStyle("sub", parent=body, fontSize=12, leading=16, textColor=TEAL)


def P(t, s=body): return Paragraph(t, s)
def H1(t): return Paragraph(t, h1)
def H2(t): return Paragraph(t, h2)
def B(items): return [Paragraph(i, bul, bulletText="\u2022") for i in items]


def tbl(rows, widths, header=True, zebra=True):
    data = []
    for r_i, r in enumerate(rows):
        row = []
        for c_i, c in enumerate(r):
            if header and r_i == 0:
                row.append(Paragraph(c, cellh))
            elif c_i == 0:
                row.append(Paragraph(c, cellb))
            else:
                row.append(Paragraph(c, cell))
        data.append(row)
    t = Table(data, colWidths=widths, repeatRows=1 if header else 0)
    st = [("VALIGN", (0, 0), (-1, -1), "TOP"),
          ("GRID", (0, 0), (-1, -1), 0.4, colors.HexColor("#B5C4CE")),
          ("LEFTPADDING", (0, 0), (-1, -1), 4), ("RIGHTPADDING", (0, 0), (-1, -1), 4),
          ("TOPPADDING", (0, 0), (-1, -1), 3), ("BOTTOMPADDING", (0, 0), (-1, -1), 3)]
    if header:
        st.append(("BACKGROUND", (0, 0), (-1, 0), NAVY))
    if zebra:
        for i in range(1, len(rows)):
            if i % 2 == 0:
                st.append(("BACKGROUND", (0, i), (-1, i), LIGHT))
    t.setStyle(TableStyle(st))
    return t


def footer(canvas, doc):
    canvas.saveState()
    canvas.setFont("Helvetica", 8)
    canvas.setFillColor(colors.HexColor("#666666"))
    canvas.drawString(18 * mm, 10 * mm, "Liver: Physiology, Pathophysiology and Liver Function Tests")
    canvas.drawRightString(A4[0] - 18 * mm, 10 * mm, "Page %d" % doc.page)
    canvas.setStrokeColor(TEAL)
    canvas.line(18 * mm, 13 * mm, A4[0] - 18 * mm, 13 * mm)
    canvas.restoreState()


doc = BaseDocTemplate(OUT, pagesize=A4, leftMargin=18 * mm, rightMargin=18 * mm,
                      topMargin=16 * mm, bottomMargin=18 * mm,
                      title="Liver: Physiology, Pathophysiology and Liver Function Tests",
                      author="Orris")
frame = Frame(doc.leftMargin, doc.bottomMargin, doc.width, doc.height, id="f")
doc.addPageTemplates([PageTemplate(id="p", frames=[frame], onPage=footer)])
W = doc.width

S = []
# ---------------- Title block
S += [Spacer(1, 30), P("Liver: Physiology, Pathophysiology and Liver Function Tests", title),
      P("Parameters measured, what each one reflects, and why they change", sub),
      Spacer(1, 6)]
S.append(tbl([["Contents"],
              ["1. Functional anatomy of the liver<br/>2. Physiology: the major functions<br/>3. Bilirubin metabolism<br/>"
               "4. Pathophysiology: how the liver fails<br/>5. Liver function tests: parameter by parameter<br/>"
               "6. Patterns of abnormality in common diseases<br/>7. Interpretation tips and pitfalls<br/>"
               "8. Quick revision summary<br/>9. Sources"]], [W]))
S.append(Spacer(1, 6))
S.append(P("Note on terminology: \"liver function tests\" (LFTs) is the traditional name, but only some of the tests measure function "
           "(albumin, bilirubin, prothrombin time). Aminotransferases, ALP and GGT mostly measure injury or cholestasis. "
           "Reference ranges below are typical adult values and differ between laboratories; always use your own lab's range.", note))

# ---------------- 1 Functional anatomy
S.append(H1("1. Functional anatomy of the liver"))
S += B([
    "<b>Dual blood supply:</b> about 75% of inflow comes from the portal vein (nutrient-rich, partly deoxygenated blood from gut and spleen) and about 25% from the hepatic artery (oxygen-rich). Total flow is roughly 1.5 L/min, about 25% of cardiac output.",
    "<b>Sinusoids:</b> fenestrated, low-pressure capillaries lined by endothelium with no basement membrane. The space of Disse between endothelium and hepatocytes allows free exchange of albumin-bound substances.",
    "<b>Cell types:</b> hepatocytes (about 80% of mass; synthesis, metabolism, bile secretion), Kupffer cells (resident macrophages; clear bacteria, endotoxin and senescent red cells), hepatic stellate cells (store vitamin A; the main collagen-producing cells in fibrosis), sinusoidal endothelial cells, and cholangiocytes (line the bile ducts and modify bile).",
    "<b>Acinar zones (Rappaport):</b> Zone 1 (periportal) is closest to the blood supply: gluconeogenesis, urea synthesis, beta-oxidation; most resistant to ischemia but first hit by toxins entering via the portal vein. Zone 3 (centrilobular) has the lowest oxygen tension and the highest cytochrome P450 activity: most vulnerable to hypoxia and to drugs such as paracetamol (acetaminophen).",
    "<b>Bile flow:</b> hepatocyte canaliculus, canal of Hering, bile ductules, interlobular and septal ducts, left and right hepatic ducts, common hepatic duct, then common bile duct to the duodenum (the gallbladder stores and concentrates bile between meals).",
])
S.append(P("Henry's textbook describes the liver as three systems: (1) a chemical metabolic system, (2) a reticuloendothelial system of Kupffer cells that handle hemoglobin released from red cells, and (3) a system for secreting bilirubin into the biliary tract. Each system is tested by a different group of laboratory tests (see section 5). - Henry's Clinical Diagnosis and Management by Laboratory Methods, p. 139-140", note))

# ---------------- 2 Physiology
S.append(H1("2. Physiology: the major functions"))
rows = [["Function", "What the liver does", "Clinical or laboratory correlate"],
        ["Carbohydrate metabolism", "Glycogen storage and glycogenolysis; gluconeogenesis from lactate, amino acids and glycerol; galactose and fructose conversion to glucose.", "Hypoglycemia in fulminant failure and advanced cirrhosis (lost glycogen stores and gluconeogenesis); glycogen storage diseases."],
        ["Lipid metabolism", "Synthesis of cholesterol, triglyceride and lipoproteins (VLDL, HDL); beta-oxidation; ketogenesis; bile acid synthesis from cholesterol.", "Steatosis when VLDL export falls or fat input rises; low cholesterol in advanced failure; high cholesterol and lipoprotein X in cholestasis."],
        ["Protein synthesis", "Albumin (about 10-15 g/day), most clotting factors (I, II, V, VII, IX, X, XI, XII, XIII), fibrinogen, transport proteins (transferrin, ceruloplasmin, alpha-1 antitrypsin), complement, angiotensinogen, hepatic hormones such as IGF-1 and thrombopoietin.", "Low albumin, prolonged PT/INR, edema, ascites, low platelets (reduced thrombopoietin plus splenic sequestration)."],
        ["Amino acid and ammonia handling", "Deamination and transamination; conversion of ammonia to urea (Krebs-Henseleit urea cycle). The liver is the only organ that performs this at scale.", "Raised blood ammonia and hepatic encephalopathy when more than about 80% of functioning tissue is lost or when blood bypasses the liver (portosystemic shunt)."],
        ["Bile formation", "Hepatocytes secrete bile acids, bilirubin conjugates, cholesterol, phospholipids and electrolytes; bile acids emulsify fat and drive absorption of vitamins A, D, E and K.", "Cholestasis causes itch, steatorrhea, fat-soluble vitamin deficiency (including vitamin K deficiency coagulopathy)."],
        ["Biotransformation and detoxification", "Phase I (oxidation, reduction, hydrolysis; CYP450) and Phase II (conjugation: glucuronidation, sulfation, glutathione) make drugs and toxins water-soluble. Ethanol is metabolized by alcohol and aldehyde dehydrogenase.", "Drug toxicity, altered drug clearance in liver disease, drug-induced liver injury; reduced clearance of sedatives."],
        ["Storage", "Glycogen, vitamins A, D, B12, K, iron (ferritin), copper.", "Iron overload (hemochromatosis), copper overload (Wilson disease)."],
        ["Hormone and mediator clearance", "Inactivates estrogens, aldosterone, insulin, glucagon, vasoactive substances.", "Spider angiomata, palmar erythema, gynecomastia and hypogonadism in cirrhosis; vasodilatation and hyperdynamic circulation."],
        ["Immune and reticuloendothelial function", "Kupffer cells remove gut-derived bacteria and endotoxin; the liver synthesizes complement and acute-phase proteins.", "Infection risk and spontaneous bacterial peritonitis in cirrhosis."],
        ["Hemoglobin breakdown", "Kupffer cells and the spleen convert heme to biliverdin and then bilirubin (see section 3).", "Jaundice when production exceeds clearance, or when uptake, conjugation or excretion is impaired."]]
S.append(tbl(rows, [W * 0.19, W * 0.43, W * 0.38]))
S.append(Spacer(1, 4))
S.append(P("Functional reserve: the liver has a large reserve and a remarkable ability to regenerate. This is why albumin, ammonia and clotting tests usually stay normal in acute hepatitis (much less than 80% of tissue is lost and regeneration is complete) and become abnormal only when about 80% or more of the functioning liver is destroyed or bypassed, as in cirrhosis or fulminant failure. - Henry's, p. 139-140", note))

# ---------------- 3 Bilirubin
S.append(H1("3. Bilirubin metabolism"))
S += B([
    "<b>Production:</b> about 4 mg/kg/day. Around 80% comes from the heme of senescent red cells (broken down in the spleen and by Kupffer cells); the rest comes from ineffective erythropoiesis and hepatic heme proteins such as cytochromes. Heme oxygenase opens the porphyrin ring (releasing CO and iron) to give biliverdin, and biliverdin reductase converts it to <b>unconjugated (indirect) bilirubin</b>.",
    "<b>Transport:</b> unconjugated bilirubin is lipid-soluble, tightly bound to albumin, not filtered by the kidney, and therefore does not appear in urine.",
    "<b>Hepatic uptake:</b> carrier-mediated uptake across the sinusoidal membrane (OATP1B1/1B3), then binding to intracellular proteins (ligandin).",
    "<b>Conjugation:</b> UDP-glucuronosyltransferase 1A1 (UGT1A1) in the smooth endoplasmic reticulum attaches glucuronic acid to make water-soluble <b>conjugated (direct) bilirubin</b> (mono- and diglucuronides). Reduced UGT1A1 activity underlies Gilbert syndrome (mild) and Crigler-Najjar syndrome (severe), and physiological neonatal jaundice.",
    "<b>Excretion:</b> an ATP-dependent canalicular transporter (MRP2) is the rate-limiting step; conjugated bilirubin enters bile. Conjugated bilirubin is water-soluble and appears in urine (dark urine) when plasma levels rise.",
    "<b>Gut and enterohepatic cycle:</b> intestinal bacteria deconjugate bilirubin and reduce it to urobilinogen. Most is converted to stercobilin (brown stool color). About 10-20% of urobilinogen is reabsorbed and re-excreted by the liver; a small fraction is excreted in urine. - Harrison's Principles of Internal Medicine 22e, Production and Metabolism of Bilirubin",
])
S.append(H2("Jaundice classification and reasons"))
rows = [["Type", "Mechanism", "Bilirubin fraction", "Urine and stool", "Examples"],
        ["Pre-hepatic", "Overproduction exceeds hepatic capacity to conjugate", "Unconjugated (indirect) raised", "No bilirubinuria; urobilinogen increased; stool normal or dark", "Hemolysis, ineffective erythropoiesis, large hematoma resorption"],
        ["Hepatic (hepatocellular)", "Reduced uptake, reduced conjugation and impaired canalicular excretion; swollen injured cells compress canaliculi", "Mixed, both raised", "Bilirubinuria; urobilinogen variable (may fall if cholestasis is severe)", "Viral or alcoholic hepatitis, cirrhosis, drug injury, Gilbert and Crigler-Najjar (isolated unconjugated)"],
        ["Post-hepatic (obstructive or cholestatic)", "Blocked bile flow; conjugated bilirubin regurgitates into blood", "Conjugated (direct) raised", "Dark urine; pale clay-colored stool; urinary urobilinogen absent", "Gallstone in the common bile duct, pancreatic head carcinoma, cholangiocarcinoma, primary sclerosing cholangitis, stricture"]]
S.append(tbl(rows, [W * 0.14, W * 0.25, W * 0.18, W * 0.22, W * 0.21]))

# ---------------- 4 Pathophysiology
S.append(H1("4. Pathophysiology: how the liver fails"))
S.append(H2("4.1 Hepatocellular injury"))
S.append(P("Viruses (hepatitis A, B, C, E), alcohol, drugs and toxins (paracetamol, isoniazid, amiodarone), autoimmunity, ischemia, metabolic disease (Wilson disease, hemochromatosis, NAFLD/MASLD) and trauma all damage the hepatocyte membrane. Cytoplasmic enzymes (ALT, AST, LDH) leak into the sinusoid, so serum levels rise in proportion to the number of cells injured. If the injury is mild, regeneration restores the liver; if it is sustained, stellate cells activate and lay down collagen."))
S.append(H2("4.2 Cholestasis"))
S.append(P("Impaired bile secretion (intrahepatic, at the canalicular or ductular level) or blocked bile flow (extrahepatic) causes retention of bile acids, bilirubin and cholesterol. Retained bile acids induce synthesis of ALP and GGT in biliary epithelium and canalicular membranes, so serum ALP and GGT rise. Bile acid retention itself injures hepatocytes and causes pruritus. Lack of intestinal bile acids causes fat malabsorption and vitamin K deficiency."))
S.append(H2("4.3 Fibrosis and cirrhosis"))
S += B([
    "Chronic injury leads to stellate cell activation, collagen deposition, loss of fenestrae (capillarization of sinusoids) and nodular regeneration.",
    "Cirrhosis has two cardinal features: fibrosis that prevents regeneration, and nodules of regenerating tissue that are the only remaining source of function. Enzymes (AST, ALT, LDH) come from these nodules and are therefore normal, low or only mildly raised, while albumin and total protein fall and ammonia rises. - Henry's, p. 140",
    "Architectural distortion raises intrahepatic resistance, which produces <b>portal hypertension</b>.",
])
S.append(H2("4.4 Portal hypertension and its consequences"))
S += B([
    "<b>Varices:</b> portal blood is diverted into portosystemic collaterals (esophagus, rectum, umbilicus); rupture causes major bleeding.",
    "<b>Splenomegaly and hypersplenism:</b> low platelets, white cells and red cells.",
    "<b>Ascites:</b> raised sinusoidal and splanchnic capillary pressure, low albumin (reduced oncotic pressure), splanchnic vasodilatation with arterial underfilling, and activation of renin-angiotensin-aldosterone and ADH leading to sodium and water retention.",
    "<b>Hepatic encephalopathy:</b> ammonia and other gut-derived neurotoxins bypass the failing liver; astrocytes convert ammonia to glutamine, causing swelling and altered neurotransmission.",
    "<b>Hepatorenal syndrome:</b> extreme splanchnic vasodilatation and effective hypovolemia cause intense renal vasoconstriction and functional kidney failure.",
])
S.append(H2("4.5 Synthetic failure"))
S.append(P("Loss of synthetic capacity causes hypoalbuminemia (edema, ascites, reduced drug binding), a prolonged prothrombin time and INR (factor VII has the shortest half-life, about 6 hours, so PT changes early), low fibrinogen in late disease, and impaired complement and acute-phase responses. Vitamin K deficiency from cholestasis also prolongs PT but corrects with parenteral vitamin K; true synthetic failure does not."))
S.append(H2("4.6 Acute liver failure"))
S.append(P("Rapid loss of hepatocyte function with coagulopathy (INR 1.5 or higher) and encephalopathy in a patient without previous liver disease. Aminotransferases can exceed 10,000 IU/L early, then fall as the liver mass shrinks (a falling ALT with rising bilirubin and INR is an ominous sign). Total albumin may initially be normal because of its long half-life (about 20 days) and falls later. Hypoglycemia, lactic acidosis, cerebral edema and multi-organ failure follow. - Henry's, p. 140"))
S.append(H2("4.7 Ischemic and congestive injury"))
S.append(P("Hypoperfusion (shock) causes centrilobular (zone 3) necrosis with a sharp rise and fast fall of AST/ALT and LDH. Right heart failure causes passive congestion, with mild transaminase rise and, in severe cases, a rise in bilirubin and ALP. Infiltrative disease and space-occupying lesions (metastases, hepatocellular carcinoma, abscess, granuloma) cause isolated ALP and LDH rises by local biliary obstruction and induction of enzyme synthesis. - Henry's, p. 140"))
S.append(H2("4.8 Steatosis and steatohepatitis"))
S.append(P("Excess fat delivery (obesity, insulin resistance), reduced fat export and impaired beta-oxidation allow triglyceride to accumulate in hepatocytes. Oxidative stress, lipotoxicity and inflammatory signaling convert simple steatosis to steatohepatitis in some patients. Alcohol adds acetaldehyde toxicity, a shifted NADH/NAD ratio and mitochondrial injury."))

# ---------------- 5 LFT
S.append(H1("5. Liver function tests: parameter by parameter"))
S.append(P("The tests fall into three groups: (A) markers of hepatocellular injury, (B) markers of cholestasis and bile excretion, and (C) markers of synthetic and metabolic function.", body))
S.append(H2("A. Hepatocellular injury markers"))
rows = [["Test (typical adult range)", "Source and physiology", "Raised in (reason)", "Low or normal despite disease"],
        ["<b>ALT</b> (alanine aminotransferase, SGPT)<br/>about 7-55 U/L",
         "Cytoplasmic enzyme. Highest concentration in liver, so it is the more liver-specific transaminase. Half-life about 47 h. Catalyzes transfer of an amino group from alanine to alpha-ketoglutarate (needs pyridoxal phosphate).",
         "Hepatocyte membrane damage or necrosis: viral hepatitis (often 500-5000 U/L), drug and toxin injury, autoimmune hepatitis, ischemic hepatitis (can exceed 5000 U/L with rapid fall), MASLD (usually under 300 U/L), Wilson disease, acute biliary obstruction (transient spike). Mild rise in obesity and after strenuous exercise.",
         "Low in advanced cirrhosis (few viable hepatocytes), in vitamin B6 deficiency, and late in acute liver failure (liver mass lost)."],
        ["<b>AST</b> (aspartate aminotransferase, SGOT)<br/>about 8-48 U/L",
         "Cytoplasmic (about 20%) and mitochondrial (about 80%) isoenzymes. Found in liver, heart, skeletal muscle, kidney, brain and red cells, so it is less liver-specific. Half-life about 17 h.",
         "All causes of hepatocellular injury; <b>AST:ALT over 2:1 suggests alcoholic liver disease</b> (alcohol injures mitochondria, releasing the mitochondrial isoenzyme; ALT is lowered by pyridoxal phosphate deficiency). Ratio over 1 also in cirrhosis. Non-hepatic causes: myocardial infarction, rhabdomyolysis, hemolysis, strenuous exercise, macro-AST.",
         "May be normal in cirrhosis with little ongoing necrosis."],
        ["<b>LDH</b> (lactate dehydrogenase)<br/>about 120-250 U/L",
         "Cytoplasmic enzyme of glycolysis in all tissues; non-specific.",
         "Hepatocyte necrosis (hepatitis, ischemia), mass lesions (metastases, hepatocellular carcinoma), also hemolysis, myocardial and muscle injury, lymphoma. A very high AST/ALT with an ALT:LDH ratio below 1.5 favors ischemic or paracetamol injury over viral hepatitis.",
         "Normal in simple biliary obstruction."]]
S.append(tbl(rows, [W * 0.17, W * 0.27, W * 0.37, W * 0.19]))
S.append(P("Why the aminotransferase level does not equal liver function: enzyme release reflects the number of injured cells, not the liver's capacity. A patient with end-stage cirrhosis can have near-normal ALT and AST. The magnitude of the rise is only a rough guide: marked elevation (above 1000 U/L) points to acute viral hepatitis, ischemia or toxins; mild elevation (under 5 times the upper limit) is typical of chronic disease, steatosis and alcohol.", note))

S.append(H2("B. Cholestasis and bile excretion markers"))
rows = [["Test (typical adult range)", "Source and physiology", "Raised in (reason)", "Low in"],
        ["<b>ALP</b> (alkaline phosphatase)<br/>about 44-147 U/L (higher in children and adolescents)",
         "Membrane enzyme on the canalicular (apical) surface of hepatocytes and bile duct epithelium; also bone (osteoblasts), intestine, placenta, kidney. Half-life about 7 days.",
         "<b>Cholestasis</b>: retained bile acids increase de novo ALP synthesis and release from the membrane. Extrahepatic obstruction (stone, tumor), primary biliary cholangitis, primary sclerosing cholangitis, drug cholestasis, infiltrative disease (metastases, granulomas, amyloid). Non-hepatic: bone growth, fracture, Paget disease, osteomalacia, bone metastases, pregnancy (placental, third trimester), childhood growth, and blood group O/B secretors after a fatty meal. Confirm hepatic origin with GGT, 5'-nucleotidase or ALP isoenzymes.",
         "Wilson disease with hemolysis (zinc-depleted enzyme), hypophosphatasia, zinc or magnesium deficiency, hypothyroidism, anemia of severe malnutrition."],
        ["<b>GGT</b> (gamma-glutamyl transferase)<br/>about 9-48 U/L",
         "Membrane enzyme in biliary epithelium, hepatocytes, kidney, pancreas. Involved in glutathione and amino acid transport. Induced by alcohol and by microsomal enzyme-inducing drugs.",
         "Cholestasis (rises in parallel with ALP, which confirms hepatic origin of ALP); alcohol use (even without liver disease); enzyme inducers (phenytoin, carbamazepine, barbiturates); MASLD; diabetes; obesity. Not raised in bone disease or pregnancy.",
         "Not clinically useful."],
        ["<b>5'-Nucleotidase</b><br/>about 0-11 U/L",
         "Canalicular and sinusoidal membrane enzyme.",
         "Rises with cholestasis; like GGT, it is specific for hepatobiliary source of a raised ALP.",
         "Not clinically useful."],
        ["<b>Total bilirubin</b><br/>about 0.2-1.2 mg/dL (3-20 micromol/L)<br/><b>Direct (conjugated)</b> under 0.3 mg/dL",
         "End product of heme breakdown; see section 3. Reflects uptake, conjugation and excretion (so partly a true function test).",
         "Pre-hepatic: hemolysis (mostly unconjugated, usually under 5 mg/dL, because a healthy liver can compensate). Hepatic: reduced uptake, conjugation and excretion; mixed. Post-hepatic: conjugated fraction predominates, often above 10 mg/dL in malignant obstruction. Gilbert syndrome: isolated unconjugated rise during fasting, illness, stress (reduced UGT1A1). Dubin-Johnson and Rotor syndromes: isolated conjugated rise.",
         "Not clinically significant."],
        ["<b>Urine bilirubin and urobilinogen</b>",
         "Only conjugated bilirubin is filtered. Urobilinogen forms from gut bacterial action and is partly reabsorbed.",
         "Bilirubinuria: conjugated hyperbilirubinemia. Urobilinogen increased: hemolysis or hepatocellular disease (reduced hepatic re-uptake). Urobilinogen absent: complete biliary obstruction or antibiotic suppression of gut flora.",
         "-"],
        ["<b>Serum bile acids</b>",
         "Synthesized from cholesterol in hepatocytes, secreted into bile and recycled efficiently by the enterohepatic circulation.",
         "Sensitive marker of cholestasis (including intrahepatic cholestasis of pregnancy, where it is used for diagnosis and risk assessment) and of portosystemic shunting.",
         "-"]]
S.append(tbl(rows, [W * 0.17, W * 0.24, W * 0.42, W * 0.17]))

S.append(H2("C. Synthetic and metabolic function markers"))
rows = [["Test (typical adult range)", "Source and physiology", "Abnormal in (reason)"],
        ["<b>Serum albumin</b><br/>about 3.5-5.0 g/dL",
         "Made only by hepatocytes (10-15 g/day). Half-life about 20 days, so it falls only in chronic disease or very severe acute disease. Maintains oncotic pressure and carries bilirubin, fatty acids, hormones and drugs.",
         "<b>Low</b> in cirrhosis and chronic liver disease (reduced synthesis; plus dilution from fluid retention, and loss into ascites). Non-hepatic causes: nephrotic syndrome, protein-losing enteropathy, malnutrition, burns, sepsis and other inflammation (negative acute-phase protein), pregnancy (hemodilution, albumin falls by about 20% by mid-pregnancy). Normal in uncomplicated acute hepatitis. Low albumin is not specific for liver disease."],
        ["<b>Total protein and globulins</b><br/>total 6.0-8.3 g/dL; globulin 2.0-3.5 g/dL",
         "Albumin plus globulins. Most globulins except immunoglobulins are made in the liver.",
         "Total protein falls with albumin in cirrhosis; <b>globulins rise</b> in chronic liver disease (polyclonal gamma-globulin from portal-systemic shunting of gut antigens to lymphoid tissue). Marked IgG rise suggests autoimmune hepatitis; IgM suggests primary biliary cholangitis; IgA suggests alcoholic liver disease. A low albumin:globulin ratio is common in cirrhosis."],
        ["<b>Prothrombin time (PT) and INR</b><br/>PT about 11-13.5 s; INR 0.8-1.1",
         "PT measures the extrinsic and common pathways (factors VII, X, V, II, fibrinogen). Factor VII half-life is about 6 hours, so PT is the best bedside marker of acute synthetic function. Factors II, VII, IX, X need vitamin K for gamma-carboxylation.",
         "<b>Prolonged</b> in severe acute and advanced chronic liver disease (reduced factor synthesis). Also prolonged in vitamin K deficiency (cholestasis with fat malabsorption, antibiotics, malnutrition) and warfarin. Test: PT that corrects within 24 h of parenteral vitamin K points to deficiency, not failure of synthesis. Factor VIII is not made in hepatocytes and is often normal or high in cirrhosis, so factor V and VII are used to separate vitamin K deficiency from liver failure. INR is a prognostic component in MELD and Child-Pugh scores."],
        ["<b>Blood ammonia</b><br/>about 15-45 mcg/dL (venous, on ice)",
         "Produced from amino acid deamination and gut bacterial metabolism; converted to urea only in hepatocytes (periportal) and to glutamine by perivenous hepatocytes, muscle and brain.",
         "<b>Raised</b> in advanced cirrhosis, acute liver failure and portosystemic shunting (hepatic encephalopathy); also in urea cycle defects, Reye syndrome, valproate toxicity and after tourniquet use or delayed sample processing. Level correlates imperfectly with encephalopathy grade; a normal value in a patient with suggestive symptoms argues against hepatic encephalopathy."],
        ["<b>Blood glucose, cholesterol, urea</b>",
         "Reflect gluconeogenesis, lipid synthesis and the urea cycle.",
         "Hypoglycemia (fulminant failure), low cholesterol (advanced failure), low urea (reduced synthesis, in advanced disease). Cholesterol raised in cholestasis."],
        ["<b>Alpha-fetoprotein, ferritin, ceruloplasmin, autoantibodies, viral serology</b> (second-line)",
         "Aetiology work-up after pattern recognition.",
         "AFP in hepatocellular carcinoma (and regenerating liver); ferritin and transferrin saturation in hemochromatosis; low ceruloplasmin in Wilson disease; ANA/ASMA/anti-LKM1 in autoimmune hepatitis; AMA in primary biliary cholangitis; HBsAg, anti-HCV, anti-HAV IgM, anti-HEV in viral hepatitis."]]
S.append(tbl(rows, [W * 0.18, W * 0.31, W * 0.51]))

# ---------------- 6 Patterns
S.append(H1("6. Patterns of abnormality in common diseases"))
S.append(P("Henry's describes six characteristic patterns. The table below combines them with additional common conditions. Arrows: up = raised, down = low, N = normal. - Henry's, Table 9.5 and text, p. 139-141"))
rows = [["Condition", "AST / ALT", "ALP / GGT", "Bilirubin", "Albumin / PT", "Ammonia", "Reasoning"],
        ["Acute hepatitis (viral, drug)", "Marked up (often 10-100 x normal)", "Mild up", "Up (both fractions)", "N", "N", "Hepatocyte necrosis releases enzymes; less than 80% of tissue lost and regeneration is complete, so synthetic function is preserved."],
        ["Cirrhosis", "N, low or mildly up", "Mild up", "Up (both)", "Albumin down; PT prolonged", "Up", "Only regenerating nodules remain, so little enzyme release but poor function; fibrosis destroys cholangioles; more than 80% of functional tissue lost."],
        ["Acute biliary obstruction (stone, tumor)", "N or mild up (early transient spike with stone)", "Marked up", "Up, mainly direct", "N (PT prolongs if vitamin K deficient)", "N", "Blocked bile flow raises canalicular enzymes and conjugated bilirubin; hepatocytes remain healthy."],
        ["Space-occupying lesion (metastases, hepatocellular carcinoma, abscess)", "N or mild up", "Isolated up in ALP/GGT; LDH up", "N or mild up", "N", "N", "Local ductal compression and enzyme induction; mechanism not fully understood. - Henry's"],
        ["Passive congestion (right heart failure)", "Mild up", "Mild up", "Mild or moderate up", "N or mild change", "N", "Centrilobular hypoxia and sinusoidal back pressure."],
        ["Ischemic hepatitis", "Very high (over 1000 U/L), falls fast", "N or mild up", "Mild up", "PT may prolong", "N or up", "Zone 3 necrosis from hypoperfusion."],
        ["Acute liver failure", "Extremely high (over 10,000 IU/L), then falls", "Variable", "Markedly up", "Albumin down; PT/INR markedly prolonged", "Up", "Combines hepatitis (cell necrosis) with cirrhosis-like loss of function. - Henry's"],
        ["Alcoholic hepatitis", "AST up (usually under 300), AST:ALT over 2", "GGT up, ALP mild up", "Up", "PT prolonged in severe disease", "May rise", "Mitochondrial injury, pyridoxal phosphate depletion, enzyme induction (GGT)."],
        ["MASLD (fatty liver)", "ALT mild up (ALT greater than AST until cirrhosis)", "GGT often up", "N", "N", "N", "Fat-laden hepatocytes with low-grade inflammation."],
        ["Primary biliary cholangitis / sclerosing cholangitis", "Mild up", "Marked up", "Up late", "Albumin and PT fall late", "N until late", "Immune destruction of small (PBC) or large (PSC) bile ducts."],
        ["Hemolysis", "AST mild up (red cell AST), LDH up", "N", "Up, unconjugated", "N", "N", "Pre-hepatic overproduction of bilirubin; liver normal."],
        ["Gilbert syndrome", "N", "N", "Mild unconjugated rise", "N", "N", "Reduced UGT1A1 activity; rise with fasting or stress."]]
S.append(tbl(rows, [W * 0.15, W * 0.13, W * 0.12, W * 0.11, W * 0.12, W * 0.08, W * 0.29]))

S.append(H2("Hepatocellular versus cholestatic: the R ratio"))
S.append(P("R = (ALT / ULN of ALT) divided by (ALP / ULN of ALP). R of 5 or more suggests a hepatocellular pattern, R of 2 or less suggests a cholestatic pattern, and R between 2 and 5 is mixed. This is widely used in drug-induced liver injury and helps choose between further serology and imaging (ultrasound, MRCP) as first-line next steps."))

# ---------------- 7 Interpretation
S.append(H1("7. Interpretation tips and pitfalls"))
S += B([
    "<b>Always look at the pattern, not one value.</b> Combine enzyme pattern, bilirubin fractions, and synthetic tests with history and examination.",
    "<b>Do the tests correspond to the underlying question?</b> Injury: ALT, AST. Cholestasis: ALP, GGT, conjugated bilirubin. Function: albumin, PT/INR, bilirubin, ammonia, bile acids.",
    "<b>Time course matters:</b> AST and ALT rise within hours of injury; ALP rises over days after obstruction; albumin falls over weeks; PT changes within a day. Transaminases fall quickly after ischemia and also fall in end-stage liver failure, which can falsely reassure.",
    "<b>Think outside the liver:</b> AST with CK points to muscle; ALP with calcium/phosphate and bone pain points to bone; low albumin with proteinuria points to the kidney; isolated indirect hyperbilirubinemia with normal other tests suggests Gilbert syndrome or hemolysis.",
    "<b>Pregnancy:</b> plasma volume expands by about 50%, serum albumin and total protein fall by about 20% by mid-pregnancy, and ALP rises in the third trimester because of placental production, so ALP is only informative early in pregnancy. ALT, AST and bilirubin should stay normal; rises suggest pre-eclampsia/HELLP, acute fatty liver of pregnancy or intrahepatic cholestasis of pregnancy. - Sleisenger and Fordtran's Gastrointestinal and Liver Disease, Hepatic Function",
    "<b>Children and elderly:</b> ALP is physiologically higher in growing children; neonatal unconjugated bilirubin is higher (low UGT1A1 and enterohepatic recycling of unconjugated bilirubin); albumin tends to fall with age.",
    "<b>Drugs and supplements:</b> paracetamol, isoniazid, statins, amiodarone, methotrexate, antiepileptics and herbal products can raise ALT/AST; anabolic steroids, estrogens and macrolides cause cholestasis; enzyme inducers raise GGT.",
    "<b>Mild asymptomatic ALT elevation</b> is most often MASLD, alcohol, medications or chronic viral hepatitis; repeat in a few weeks, then investigate if persistent.",
    "<b>Prognostic scores</b> built from LFTs: Child-Pugh (bilirubin, albumin, INR, ascites, encephalopathy) and MELD / MELD-Na (bilirubin, INR, creatinine, sodium).",
])
S.append(H2("Stepwise approach (simplified)"))
rows = [["Step", "Question", "Next action"],
        ["1", "Is it hepatocellular, cholestatic or mixed? (R ratio and pattern)", "Hepatocellular: viral serology, autoimmune markers, iron studies, ceruloplasmin, medication and alcohol history, ultrasound. Cholestatic: ultrasound for ductal dilatation, then MRCP/ERCP or AMA as indicated."],
        ["2", "Is synthetic function impaired? (albumin, INR, bilirubin)", "If yes, assess for cirrhosis or acute liver failure; check ammonia, glucose, lactate; urgent referral if INR is raised with encephalopathy."],
        ["3", "Is the abnormality really from the liver?", "Check CK, thyroid tests, celiac serology, bone profile, hemolysis markers, GGT to confirm ALP origin."],
        ["4", "Is there fibrosis?", "Non-invasive scores (FIB-4, transient elastography), imaging for portal hypertension; biopsy when needed."]]
S.append(tbl(rows, [W * 0.07, W * 0.33, W * 0.60]))

# ---------------- 8 Summary
S.append(H1("8. Quick revision summary"))
rows = [["Parameter", "Reflects", "Rises with", "Falls with"],
        ["ALT", "Hepatocyte injury (liver-specific)", "Hepatitis, ischemia, drugs, MASLD", "Late-stage cirrhosis or end-stage failure"],
        ["AST", "Hepatocyte (and muscle, heart) injury", "Alcohol (AST:ALT over 2), cirrhosis, muscle injury", "-"],
        ["ALP", "Biliary canalicular function", "Cholestasis, infiltration, bone disease, pregnancy", "Wilson (acute), hypophosphatasia, zinc deficiency"],
        ["GGT", "Biliary enzyme induction", "Cholestasis, alcohol, enzyme-inducing drugs", "-"],
        ["Bilirubin", "Production, uptake, conjugation, excretion", "Hemolysis, hepatocyte disease, obstruction, Gilbert", "-"],
        ["Albumin", "Chronic synthetic capacity", "Dehydration", "Chronic liver disease, nephrotic syndrome, malnutrition, inflammation"],
        ["PT / INR", "Acute synthetic capacity", "Prolonged: liver failure, vitamin K deficiency, warfarin", "-"],
        ["Ammonia", "Urea cycle capacity and shunting", "Cirrhosis, ALF, shunts, urea cycle defects", "-"],
        ["Globulins", "Immune stimulation", "Chronic hepatitis, cirrhosis, autoimmune disease", "Immunodeficiency"]]
S.append(tbl(rows, [W * 0.14, W * 0.28, W * 0.34, W * 0.24]))

# ---------------- 9 Sources
S.append(H1("9. Sources"))
S += B([
    "Henry's Clinical Diagnosis and Management by Laboratory Methods, Liver Function Tests (Chapter 9), p. 139-141, and Hepatic Function panels.",
    "Harrison's Principles of Internal Medicine, 22e, Production and Metabolism of Bilirubin.",
    "Robbins, Cotran and Kumar Pathologic Basis of Disease, Bile Formation and Secretion.",
    "Sleisenger and Fordtran's Gastrointestinal and Liver Disease, Hepatic Function (pregnancy).",
    "Lippincott Illustrated Reviews: Biochemistry, 8th ed, Jaundice; Harper's Illustrated Biochemistry, 32nd ed (UGT1A1 and bilirubin).",
    "Tietz Textbook of Laboratory Medicine, 7th ed, diagnostic strategy for abnormal liver tests; Goldman-Cecil Medicine, Laboratory Studies.",
    "Recent evidence check (PubMed, last 2 years, systematic reviews): no recent review found that contradicts the standard interpretation above. Related recent reviews: Ranjbar et al., Nutr Rev 2025 (intermittent fasting and LFTs, PMID 38917447); Dastjerdi et al., BMC Cardiovasc Disord 2025 (liver biomarkers and prognosis in HFpEF, PMID 40175926).",
])
S.append(Spacer(1, 6))
S.append(P("Educational summary for study purposes. Reference ranges and cut-offs vary by laboratory and population; clinical decisions should rely on local laboratory ranges and current guidelines.", note))

doc.build(S)
print("ok")
Running Command

cd /tmp/workspace/liver-pdf && python make_pdf.py && python -c " from pypdf import PdfReader r=PdfReader('Liver_Physiology_Pathophysiology_and_LFT.pdf');print(len(r.pages)) t=''.join(p.extract_text() for p in r.pages) print([c for c in ['\u2014','\u2013','crucial','vital','comprehensive','robust'] if c in t.lower()]) "; ls -la

I've made the PDF. It runs to 8 pages (A4), and the layout hasn't been checked by eye.

Liver Physiology Pathophysiology and LFT

PDF Document · PDF

What it covers
  1. Functional anatomy: dual blood supply, cell types, acinar zones and bile flow.
  2. Physiology: a table of liver functions (carbohydrate, lipid, protein, ammonia and urea, bile, detoxification, storage, hormone clearance, immune function), each with its clinical correlate.
  3. Bilirubin metabolism: from heme to the enterohepatic cycle, plus a table of pre-hepatic, hepatic and post-hepatic jaundice.
  4. Pathophysiology:
    • hepatocellular injury and cholestasis
    • fibrosis and cirrhosis
    • portal hypertension, ascites, hepatic encephalopathy and hepatorenal syndrome
    • synthetic failure, acute liver failure, ischemic and congestive injury, and fatty liver
  5. LFT parameters, each with its source and the reasons it goes up or down:
    • Injury markers: ALT, AST, LDH.
    • Cholestasis markers: ALP, GGT, 5'-nucleotidase, bilirubin (total and direct), urine bilirubin and urobilinogen, bile acids.
    • Function markers: albumin, globulins, PT/INR, ammonia, glucose and cholesterol, and second-line tests.
  6. Patterns in common diseases: acute hepatitis, cirrhosis, biliary obstruction, space-occupying lesions, congestion, ischemic hepatitis, acute liver failure, alcoholic hepatitis, fatty liver, PBC/PSC, hemolysis and Gilbert syndrome. It also explains the R ratio.
  7. Interpretation pitfalls: non-liver causes, timing, pregnancy, children, drugs, Child-Pugh and MELD, and a stepwise approach.
  8. Quick revision table, then the sources.
Sources
  • The core logic comes from the textbook library. The main sources are Henry's Clinical Diagnosis and Management by Laboratory Methods (LFT chapter, p. 139-141), Harrison's 22e, Robbins, and Sleisenger and Fordtran's.
  • A PubMed check of the last 2 years found no systematic review that contradicts the standard interpretation. The two related reviews found (PMIDs 38917447 and 40175926) are listed in the PDF's sources section.
  • Some details are from my own knowledge, not the retrieved texts. These include the half-lives, the R-ratio cut-offs and the exact reference ranges. Reference ranges vary between laboratories, so use your own lab's values.
This is a shared conversation. Sign in to Orris to start your own chat.