Describe renal blood flow as long answere mbbs physiology
RPF = (1 - Hct) × RBF
| Vessel | Pressure at Entry (mm Hg) | Pressure at Exit (mm Hg) | % of Total Resistance |
|---|---|---|---|
| Renal artery | 100 | 100 | ~0 |
| Interlobar/arcuate/interlobular arteries | ~100 | 85 | ~16 |
| Afferent arteriole | 85 | 60 | ~26 |
| Glomerular capillaries | 60 | 59 | ~1 |
| Efferent arteriole | 59 | 18 | ~43 |
| Peritubular capillaries | 18 | 8 | ~10 |
| Veins | 8 | 4 | ~4 |
RBF = (Renal artery pressure - Renal vein pressure) / Total renal vascular resistance
| Agent | Effect on RBF | Effect on GFR | Mechanism |
|---|---|---|---|
| Norepinephrine/Epinephrine | ↓ | ↓ | Vasoconstriction (afferent + efferent) |
| Endothelin | ↓ | ↓ | Potent vasoconstriction (released by damaged endothelium) |
| Angiotensin II | ↓ | ↔ (or ↓ at high levels) | Preferentially constricts efferent > afferent |
| Nitric oxide | ↑ | ↑ | Vasodilation (basal production maintains normal RBF) |
| Prostaglandins (PGE₂, PGI₂) | ↑ | ↑ | Vasodilation; counteract vasoconstriction |
| Bradykinin | ↑ | ↑ | Vasodilation |
| Dopamine | ↑ | ↑ | D₁ receptor-mediated vasodilation |
| ANP (Atrial Natriuretic Peptide) | ↑ | ↑ | Dilates afferent, constricts efferent |
Clinical correlate: Aminoglycosides and contrast agents can injure the macula densa, impairing TGF and predisposing to nephrotoxicity.
RPF = ([U]_PAH × V̇) / ([RA]_PAH - [RV]_PAH)
Effective RPF = C_PAH = (U_PAH × V̇) / P_PAH
RBF = RPF / (1 - Hct)
FF = GFR / RPF = 125 / 600 ≈ 0.20 (20%)
| Factor | RBF | Mechanism |
|---|---|---|
| ↑ Arterial pressure (within autoregulatory range) | Unchanged | Myogenic + TGF autoregulation |
| ↑ Arterial pressure (>170 mm Hg) | ↑ | Autoregulation breaks down |
| ↓ Arterial pressure (<80 mm Hg) | ↓ | Below autoregulatory range |
| ↑ Sympathetic activity (severe) | ↓ | α₁ vasoconstriction of afferent/efferent |
| Angiotensin II (low-mod. dose) | ↓ | Efferent > afferent constriction |
| Angiotensin II (high dose) | ↓↓ | Both arterioles constrict |
| Endothelin | ↓ | Strong vasoconstriction |
| Nitric oxide | ↑ | Vasodilation |
| PGE₂/PGI₂ | ↑ | Vasodilation (especially under stress) |
| NSAIDs (in volume depletion) | ↓ | Remove prostaglandin buffer |
| ACE inhibitors (efferent dilation) | ↑ | Efferent relaxation → ↓ resistance |
| Parameter | Normal Value |
|---|---|
| RBF (both kidneys) | ~1000-1100 mL/min (~22% of CO) |
| RPF | ~600-660 mL/min |
| GFR | ~125 mL/min |
| Filtration fraction (FF) | ~20% |
| Autoregulation range | MAP 80-170 mm Hg |
| Medullary blood flow | ~1-2% of RBF (via vasa recta) |
| PAH extraction ratio | ~0.90 |
Generate a summary PDF on RBF autoregulation mechanisms and clinical applications
mkdir -p /home/daytona/workspace/rbf-pdf && ls /home/daytona/workspace/
~/rbf-pdf/generate_rbf_pdf.py
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm, mm
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
HRFlowable, KeepTogether
)
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.platypus import PageBreak
OUTPUT = "/home/daytona/workspace/rbf-pdf/RBF_Autoregulation_Summary.pdf"
# ---------- COLOUR PALETTE ----------
DARK_BLUE = colors.HexColor("#1A3A5C")
MED_BLUE = colors.HexColor("#2563A8")
LIGHT_BLUE = colors.HexColor("#D6E8FA")
ACCENT = colors.HexColor("#E85D04")
SOFT_GREY = colors.HexColor("#F4F6F9")
DARK_GREY = colors.HexColor("#374151")
GREEN = colors.HexColor("#166534")
GREEN_BG = colors.HexColor("#D1FAE5")
RED_BG = colors.HexColor("#FEE2E2")
RED_TEXT = colors.HexColor("#991B1B")
YELLOW_BG = colors.HexColor("#FEF3C7")
YELLOW_TEXT = colors.HexColor("#92400E")
WHITE = colors.white
# ---------- STYLES ----------
styles = getSampleStyleSheet()
def make_style(name, parent="Normal", **kw):
return ParagraphStyle(name, parent=styles[parent], **kw)
cover_title = make_style("CoverTitle", fontSize=26, textColor=WHITE,
alignment=TA_CENTER, spaceAfter=6, leading=32,
fontName="Helvetica-Bold")
cover_sub = make_style("CoverSub", fontSize=13, textColor=LIGHT_BLUE,
alignment=TA_CENTER, spaceAfter=4, leading=18)
cover_meta = make_style("CoverMeta", fontSize=10, textColor=colors.HexColor("#94A3B8"),
alignment=TA_CENTER, leading=14)
h1 = make_style("H1", fontSize=14, textColor=WHITE,
fontName="Helvetica-Bold", spaceAfter=4, leading=18)
h2 = make_style("H2", fontSize=11, textColor=DARK_BLUE,
fontName="Helvetica-Bold", spaceBefore=10, spaceAfter=4, leading=14)
h3 = make_style("H3", fontSize=10, textColor=MED_BLUE,
fontName="Helvetica-Bold", spaceBefore=6, spaceAfter=3, leading=13)
body = make_style("Body", fontSize=9.5, textColor=DARK_GREY,
leading=14, spaceAfter=5, alignment=TA_JUSTIFY)
bullet_style = make_style("Bullet", fontSize=9.5, textColor=DARK_GREY,
leading=13, spaceAfter=3, leftIndent=14,
firstLineIndent=-10)
small = make_style("Small", fontSize=8.5, textColor=colors.HexColor("#6B7280"),
leading=12, spaceAfter=3, alignment=TA_CENTER)
box_title = make_style("BoxTitle", fontSize=10, textColor=DARK_BLUE,
fontName="Helvetica-Bold", leading=13, spaceAfter=2)
box_body = make_style("BoxBody", fontSize=9, textColor=DARK_GREY,
leading=13, spaceAfter=2)
warn_body = make_style("WarnBody", fontSize=9, textColor=RED_TEXT,
leading=13, spaceAfter=2)
tip_body = make_style("TipBody", fontSize=9, textColor=GREEN,
leading=13, spaceAfter=2)
def bullet(text):
return Paragraph(f"• {text}", bullet_style)
def section_header(title, sub=None):
"""Dark blue banner with white title."""
rows = [[Paragraph(title, h1)]]
tbl = Table(rows, colWidths=[17*cm])
tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), DARK_BLUE),
("TOPPADDING", (0,0), (-1,-1), 7),
("BOTTOMPADDING", (0,0), (-1,-1), 7),
("LEFTPADDING", (0,0), (-1,-1), 10),
("RIGHTPADDING", (0,0), (-1,-1), 10),
("ROUNDEDCORNERS", [4]),
]))
items = [Spacer(1, 8), tbl, Spacer(1, 6)]
if sub:
items.append(Paragraph(sub, body))
return items
def info_box(title, lines, bg=LIGHT_BLUE, title_color=DARK_BLUE, body_style=box_body):
content = [Paragraph(title, ParagraphStyle("bxT", parent=box_title, textColor=title_color))]
for l in lines:
content.append(Paragraph(l, body_style))
inner = Table([[c] for c in content], colWidths=[15.5*cm])
inner.setStyle(TableStyle([
("LEFTPADDING", (0,0), (-1,-1), 0),
("RIGHTPADDING", (0,0), (-1,-1), 0),
("TOPPADDING", (0,0), (-1,-1), 1),
("BOTTOMPADDING", (0,0), (-1,-1), 1),
]))
outer = Table([[inner]], colWidths=[16.5*cm])
outer.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), bg),
("TOPPADDING", (0,0), (-1,-1), 8),
("BOTTOMPADDING", (0,0), (-1,-1), 8),
("LEFTPADDING", (0,0), (-1,-1), 10),
("RIGHTPADDING", (0,0), (-1,-1), 10),
("BOX", (0,0), (-1,-1), 1, colors.HexColor("#CBD5E1")),
("ROUNDEDCORNERS", [4]),
]))
return [outer, Spacer(1, 6)]
# ---------- DOCUMENT ----------
doc = SimpleDocTemplate(
OUTPUT,
pagesize=A4,
leftMargin=2*cm,
rightMargin=2*cm,
topMargin=2*cm,
bottomMargin=2*cm,
title="RBF Autoregulation: Mechanisms & Clinical Applications",
author="Orris Medical AI",
subject="Renal Physiology - MBBS",
)
story = []
# =====================================================================
# COVER PAGE
# =====================================================================
story.append(Spacer(1, 1.5*cm))
cover_banner_data = [[
Paragraph("RENAL BLOOD FLOW", cover_title),
], [
Paragraph("Autoregulation Mechanisms & Clinical Applications", cover_sub),
], [
Paragraph("MBBS Physiology · Renal System Summary", cover_meta),
], [
Spacer(1, 6),
], [
Paragraph("Sources: Guyton & Hall (14th ed.) · Costanzo Physiology (7th ed.) · Medical Physiology - Boron & Boulpaep", cover_meta),
]]
cover_tbl = Table(cover_banner_data, colWidths=[17*cm])
cover_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), DARK_BLUE),
("TOPPADDING", (0,0), (0,0), 30),
("TOPPADDING", (0,1), (-1,-1), 8),
("BOTTOMPADDING", (0,-1), (-1,-1), 30),
("BOTTOMPADDING", (0,0), (0,-2), 4),
("LEFTPADDING", (0,0), (-1,-1), 20),
("RIGHTPADDING", (0,0), (-1,-1), 20),
("ROUNDEDCORNERS", [6]),
]))
story.append(cover_tbl)
story.append(Spacer(1, 0.8*cm))
# Quick stats row
stats = [
["~1100 mL/min", "80-170 mmHg", "~20%", "1-2%"],
["Total RBF\n(both kidneys)", "Autoregulation\nRange (MAP)", "Filtration\nFraction", "Medullary\nBlood Flow"],
]
stat_tbl = Table(stats, colWidths=[4.25*cm]*4)
stat_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), MED_BLUE),
("BACKGROUND", (0,1), (-1,1), LIGHT_BLUE),
("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"),
("FONTSIZE", (0,0), (-1,0), 13),
("FONTSIZE", (0,1), (-1,1), 8.5),
("TEXTCOLOR", (0,0), (-1,0), WHITE),
("TEXTCOLOR", (0,1), (-1,1), DARK_BLUE),
("ALIGN", (0,0), (-1,-1), "CENTER"),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
("TOPPADDING", (0,0), (-1,0), 10),
("BOTTOMPADDING", (0,0), (-1,0), 10),
("TOPPADDING", (0,1), (-1,1), 6),
("BOTTOMPADDING", (0,1), (-1,1), 6),
("BOX", (0,0), (-1,-1), 1, MED_BLUE),
("INNERGRID", (0,0), (-1,-1), 0.5, colors.HexColor("#93C5FD")),
]))
story.append(stat_tbl)
story.append(Spacer(1, 0.5*cm))
# Table of Contents box
toc_lines = [
"1. What is Autoregulation?",
"2. Myogenic Mechanism",
"3. Tubuloglomerular Feedback (TGF)",
"4. Hormonal & Neural Regulation",
"5. Vasoactive Agents Summary Table",
"6. Clinical Applications",
"7. Key Equations & Quick Reference",
]
toc_content = [Paragraph("<b>CONTENTS</b>", make_style("TocH", fontSize=10, textColor=DARK_BLUE,
fontName="Helvetica-Bold", leading=14))]
for item in toc_lines:
toc_content.append(Paragraph(item, make_style("TocI", fontSize=9, textColor=DARK_GREY,
leading=13, leftIndent=8)))
toc_inner = Table([[c] for c in toc_content], colWidths=[15*cm])
toc_inner.setStyle(TableStyle([("TOPPADDING",(0,0),(-1,-1),1),("BOTTOMPADDING",(0,0),(-1,-1),1),
("LEFTPADDING",(0,0),(-1,-1),0),("RIGHTPADDING",(0,0),(-1,-1),0)]))
toc_outer = Table([[toc_inner]], colWidths=[17*cm])
toc_outer.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), SOFT_GREY),
("BOX", (0,0), (-1,-1), 1.5, MED_BLUE),
("TOPPADDING", (0,0), (-1,-1), 10),
("BOTTOMPADDING", (0,0), (-1,-1), 10),
("LEFTPADDING", (0,0), (-1,-1), 14),
("RIGHTPADDING", (0,0), (-1,-1), 14),
]))
story.append(toc_outer)
story.append(PageBreak())
# =====================================================================
# SECTION 1 - WHAT IS AUTOREGULATION
# =====================================================================
story += section_header("1. What is Autoregulation?")
story.append(Paragraph(
"Autoregulation is the intrinsic ability of the kidney to maintain relatively constant "
"Renal Blood Flow (RBF) and GFR over a wide range of renal arterial pressures, "
"<b>independent of external neural or hormonal control</b>. Even a denervated (transplanted) "
"kidney autoregulates as well as an intact kidney.",
body))
story += info_box("Key Facts", [
"• Autoregulation range: Mean Arterial Pressure (MAP) 80-170 mmHg",
"• Below 80 mmHg: RBF falls proportionally with pressure",
"• Above ~170 mmHg: autoregulation breaks down",
"• GFR is maintained within ±10% despite large BP fluctuations in the normal range",
"• Primary purpose in the kidney: maintain stable GFR for precise fluid/solute excretion",
], bg=LIGHT_BLUE)
story.append(Paragraph("<b>Why is autoregulation essential?</b>", h3))
story.append(Paragraph(
"Without autoregulation, a 25% rise in MAP (100 → 125 mmHg) would increase GFR from "
"180 L/day to ~225 L/day. With tubular reabsorption fixed at 178.5 L/day, urine output "
"would surge from 1.5 L/day to 46.5 L/day — a 30-fold increase that would rapidly deplete "
"plasma volume and be incompatible with life.", body))
story.append(HRFlowable(width="100%", thickness=0.5, color=colors.HexColor("#CBD5E1"), spaceAfter=6))
# =====================================================================
# SECTION 2 - MYOGENIC MECHANISM
# =====================================================================
story += section_header("2. Myogenic Mechanism")
story.append(Paragraph(
"The myogenic mechanism is the <b>faster</b> of the two autoregulatory mechanisms, "
"responding within seconds to pressure changes.", body))
story.append(Paragraph("Mechanism (Step-by-Step):", h3))
steps_data = [
["Step", "Event"],
["1", "↑ Renal arterial pressure → stretches afferent arteriolar wall"],
["2", "Stretch activates mechanosensitive (stretch-activated) Ca²⁺ channels in smooth muscle"],
["3", "↑ Intracellular Ca²⁺ → smooth muscle contraction"],
["4", "↑ Afferent arteriolar resistance"],
["5", "Resistance increase offsets pressure rise → RBF and GFR remain constant"],
["↓ Pressure", "Reverse: wall relaxes → ↓ resistance → maintained flow"],
]
steps_tbl = Table(steps_data, colWidths=[3*cm, 14*cm])
steps_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), MED_BLUE),
("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"),
("TEXTCOLOR", (0,0), (-1,0), WHITE),
("FONTSIZE", (0,0), (-1,-1), 9),
("BACKGROUND", (0,1), (-1,-1), WHITE),
("ROWBACKGROUNDS",(0,1), (-1,-1), [WHITE, SOFT_GREY]),
("ALIGN", (0,0), (0,-1), "CENTER"),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 8),
("BOX", (0,0), (-1,-1), 1, colors.HexColor("#CBD5E1")),
("INNERGRID", (0,0), (-1,-1), 0.5, colors.HexColor("#E5E7EB")),
]))
story.append(steps_tbl)
story.append(Spacer(1, 8))
story += info_box("Key Point", [
"The myogenic mechanism acts primarily at the AFFERENT arteriole. "
"It is the 'fast' component of autoregulation — operational within seconds.",
], bg=YELLOW_BG, title_color=YELLOW_TEXT)
story.append(HRFlowable(width="100%", thickness=0.5, color=colors.HexColor("#CBD5E1"), spaceAfter=6))
# =====================================================================
# SECTION 3 - TGF
# =====================================================================
story += section_header("3. Tubuloglomerular Feedback (TGF)")
story.append(Paragraph(
"Tubuloglomerular feedback is a <b>paracrine negative feedback loop</b> involving the "
"juxtaglomerular apparatus (JGA). It is the 'slower' component (seconds to minutes) but "
"is arguably the most physiologically important autoregulatory mechanism.", body))
story.append(Paragraph("Components of the JGA:", h3))
jga_items = [
"• <b>Macula densa</b>: specialized epithelial cells in the thick ascending limb at the early distal tubule — the NaCl sensor",
"• <b>Granular (juxtaglomerular) cells</b>: in the afferent arteriolar wall — secrete renin",
"• <b>Extraglomerular mesangial cells</b> (Lacis cells): interconnect macula densa to arterioles",
]
for item in jga_items:
story.append(Paragraph(item, bullet_style))
story.append(Spacer(1, 6))
story.append(Paragraph("TGF Mechanism (Step-by-Step):", h3))
tgf_data = [
["Step", "Event"],
["1", "↑ MAP → ↑ RBF → ↑ GFR"],
["2", "↑ GFR → ↑ NaCl and fluid delivery to macula densa"],
["3", "Macula densa senses ↑ NaCl via NKCC2 cotransporter (Na-K-2Cl)"],
["4", "Macula densa releases Adenosine (main mediator) and TXA₂ via paracrine route"],
["5", "Adenosine acts on A1 receptors → afferent arteriolar vasoconstriction"],
["6", "↑ Afferent resistance → ↓ RBF and ↓ GFR → NaCl delivery normalizes"],
["Net Effect", "Stable NaCl delivery to distal tubule despite changing systemic BP"],
]
tgf_tbl = Table(tgf_data, colWidths=[3*cm, 14*cm])
tgf_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), colors.HexColor("#065F46")),
("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"),
("TEXTCOLOR", (0,0), (-1,0), WHITE),
("FONTSIZE", (0,0), (-1,-1), 9),
("ROWBACKGROUNDS",(0,1), (-1,-1), [WHITE, GREEN_BG]),
("ALIGN", (0,0), (0,-1), "CENTER"),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 8),
("BOX", (0,0), (-1,-1), 1, colors.HexColor("#6EE7B7")),
("INNERGRID", (0,0), (-1,-1), 0.5, colors.HexColor("#D1FAE5")),
]))
story.append(tgf_tbl)
story.append(Spacer(1, 8))
story.append(Paragraph("TGF in Physiological Scenarios:", h3))
tgf_scenarios = [
["Scenario", "TGF Response", "Outcome"],
["High-protein meal", "Amino acids + Na co-transport in PCT → ↓ NaCl at macula densa → afferent dilation",
"↑ RBF & GFR → ↑ excretion of urea, creatinine"],
["Uncontrolled diabetes\n(early)", "Glucose + Na co-transport in PCT → ↓ NaCl at macula densa → afferent dilation",
"Glomerular hyperfiltration (early diabetic nephropathy)"],
["Proximal tubule damage\n(e.g., heavy metals)", "↓ NaCl reabsorption → ↑ NaCl at macula densa → afferent constriction",
"↓ RBF and GFR → compensatory response to ↓ distal NaCl load"],
["SGLT2 inhibition", "↓ Glucose-Na cotransport in PCT → ↑ NaCl at macula densa → afferent constriction",
"↓ GFR / ↓ hyperfiltration → renoprotection"],
]
tgf_sc_tbl = Table(tgf_scenarios, colWidths=[4.5*cm, 7.5*cm, 5*cm])
tgf_sc_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), DARK_BLUE),
("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"),
("TEXTCOLOR", (0,0), (-1,0), WHITE),
("FONTSIZE", (0,0), (-1,-1), 8.5),
("ROWBACKGROUNDS",(0,1), (-1,-1), [WHITE, SOFT_GREY]),
("VALIGN", (0,0), (-1,-1), "TOP"),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 6),
("BOX", (0,0), (-1,-1), 1, colors.HexColor("#CBD5E1")),
("INNERGRID", (0,0), (-1,-1), 0.5, colors.HexColor("#E5E7EB")),
]))
story.append(tgf_sc_tbl)
story.append(Spacer(1, 8))
story.append(PageBreak())
# =====================================================================
# SECTION 4 - HORMONAL & NEURAL
# =====================================================================
story += section_header("4. Hormonal & Neural Regulation of RBF")
story.append(Paragraph(
"Beyond intrinsic autoregulation, RBF is also modulated by the autonomic nervous system "
"and circulating/local vasoactive agents. These extrinsic mechanisms override "
"autoregulation under physiological stress.", body))
story.append(Paragraph("Sympathetic Nervous System:", h3))
story.append(Paragraph(
"Both afferent and efferent arterioles are richly innervated by sympathetic fibers acting "
"on α₁-adrenergic receptors. Afferent arterioles have far more α₁ receptors.", body))
sym_data = [
["Level of Activation", "Effect on RBF/GFR", "Clinical Context"],
["Mild", "Minimal change in RBF/GFR\n↑ Renin release\n↑ Tubular Na reabsorption",
"Normal daily activity, mild posture changes"],
["Moderate", "Modest ↓ RBF; GFR relatively preserved",
"Moderate blood loss, exercise"],
["Severe", "Marked ↓ RBF and GFR\nOliguria/anuria",
"Severe hemorrhage, septic shock, defense reaction"],
]
sym_tbl = Table(sym_data, colWidths=[4*cm, 7*cm, 6*cm])
sym_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), colors.HexColor("#7C3AED")),
("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"),
("TEXTCOLOR", (0,0), (-1,0), WHITE),
("FONTSIZE", (0,0), (-1,-1), 8.5),
("ROWBACKGROUNDS",(0,1), (-1,-1), [WHITE, SOFT_GREY]),
("VALIGN", (0,0), (-1,-1), "TOP"),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 6),
("BOX", (0,0), (-1,-1), 1, colors.HexColor("#DDD6FE")),
("INNERGRID", (0,0), (-1,-1), 0.5, colors.HexColor("#EDE9FE")),
]))
story.append(sym_tbl)
story.append(Spacer(1, 8))
# Angiotensin II special box
story.append(Paragraph("Angiotensin II — Special Consideration:", h3))
ang_text = [
"<b>Low-moderate concentrations</b>: preferentially constricts EFFERENT arteriole",
" → ↓ RBF, but ↑ glomerular hydrostatic pressure → GFR maintained or slightly ↑",
"<b>High concentrations</b>: constricts BOTH arterioles → ↓↓ RBF and ↓ GFR",
"<b>Clinical significance</b>: ACE inhibitors/ARBs block this → efferent dilation → ↓ GFR. "
"Contraindicated in bilateral renal artery stenosis.",
]
story += info_box("Angiotensin II - Differential Arteriolar Effect", ang_text, bg=YELLOW_BG, title_color=YELLOW_TEXT)
story.append(HRFlowable(width="100%", thickness=0.5, color=colors.HexColor("#CBD5E1"), spaceAfter=6))
# =====================================================================
# SECTION 5 - VASOACTIVE AGENTS TABLE
# =====================================================================
story += section_header("5. Vasoactive Agents — Summary Table")
agents_data = [
["Agent", "Source", "Effect on RBF", "Effect on GFR", "Notes"],
["Norepinephrine / Epinephrine", "Adrenal medulla / SNS", "↓↓", "↓↓",
"Parallel to sympathetic activity; significant in hemorrhage"],
["Endothelin", "Damaged vascular endothelium", "↓↓", "↓↓",
"Released in AKI, toxemia, uremia; potent vasoconstrictor"],
["Angiotensin II\n(low-mod dose)", "RAAS", "↓", "↔ or ↑",
"Efferent > afferent constriction; protects GFR in hypotension"],
["Angiotensin II\n(high dose)", "RAAS", "↓↓", "↓↓",
"Both arterioles constricted"],
["Nitric Oxide", "Vascular endothelium (basal)", "↑", "↑",
"Tonic vasodilation; NO inhibition → hypertension, ↓ RBF"],
["PGE₂ / PGI₂", "Renal endothelium/interstitium", "↑", "↑",
"Buffer vasoconstrictors; NSAIDs remove this → AKI risk"],
["Bradykinin", "Local renal tissue", "↑", "↑",
"Vasodilator; degraded by ACE (ACEi → ↑ bradykinin → cough)"],
["Dopamine", "Renal nerve endings", "↑", "↑",
"D₁ receptor-mediated; used in low doses for renal protection"],
["ANP", "Atria (↑ stretch)", "↑", "↑",
"Dilates afferent, constricts efferent → ↑ GFR; natriuretic"],
["Adenosine", "Macula densa (TGF)", "↓ (afferent)", "↓",
"A1 receptor; main mediator of TGF vasoconstriction"],
]
col_w = [4*cm, 3.5*cm, 2*cm, 2*cm, 5.5*cm]
agents_tbl = Table(agents_data, colWidths=col_w)
agents_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), DARK_BLUE),
("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"),
("TEXTCOLOR", (0,0), (-1,0), WHITE),
("FONTSIZE", (0,0), (-1,-1), 8),
("ROWBACKGROUNDS",(0,1), (-1,-1), [WHITE, SOFT_GREY]),
("VALIGN", (0,0), (-1,-1), "TOP"),
("ALIGN", (2,0), (3,-1), "CENTER"),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 5),
("RIGHTPADDING", (0,0), (-1,-1), 5),
("BOX", (0,0), (-1,-1), 1, colors.HexColor("#CBD5E1")),
("INNERGRID", (0,0), (-1,-1), 0.5, colors.HexColor("#E5E7EB")),
]))
story.append(agents_tbl)
story.append(Spacer(1, 8))
story.append(Paragraph("↑ = increases | ↓ = decreases | ↓↓ = markedly decreases | ↔ = unchanged", small))
story.append(PageBreak())
# =====================================================================
# SECTION 6 - CLINICAL APPLICATIONS
# =====================================================================
story += section_header("6. Clinical Applications")
story.append(Paragraph(
"Understanding RBF autoregulation is directly applicable to major clinical scenarios "
"encountered in medicine.", body))
# Clinical cards
def clin_card(title, mechanism, implication, bg=SOFT_GREY, border_color=MED_BLUE):
s = make_style("ct", fontSize=10, textColor=DARK_BLUE, fontName="Helvetica-Bold", leading=13)
sm = make_style("cm", fontSize=9, textColor=DARK_GREY, leading=13)
sl = make_style("cl", fontSize=8.5, textColor=colors.HexColor("#6B7280"), leading=12)
content = [
[Paragraph(title, s)],
[Paragraph(f"<b>Mechanism:</b> {mechanism}", sm)],
[Paragraph(f"<b>Clinical Implication:</b> {implication}", sl)],
]
inner = Table(content, colWidths=[15.5*cm])
inner.setStyle(TableStyle([("TOPPADDING",(0,0),(-1,-1),2),("BOTTOMPADDING",(0,0),(-1,-1),2),
("LEFTPADDING",(0,0),(-1,-1),0),("RIGHTPADDING",(0,0),(-1,-1),0)]))
outer = Table([[inner]], colWidths=[16.5*cm])
outer.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), bg),
("BOX", (0,0), (-1,-1), 1.5, border_color),
("TOPPADDING", (0,0), (-1,-1), 8),
("BOTTOMPADDING", (0,0), (-1,-1), 8),
("LEFTPADDING", (0,0), (-1,-1), 12),
("RIGHTPADDING", (0,0), (-1,-1), 12),
]))
return [outer, Spacer(1, 6)]
story += clin_card(
"1. Bilateral Renal Artery Stenosis + ACE Inhibitors",
"Stenosis reduces perfusion pressure below the autoregulatory range. Kidneys rely on "
"Angiotensin II-mediated efferent constriction to maintain GFR. ACE inhibitors/ARBs "
"block this → efferent dilation → precipitous ↓ GFR.",
"ACE inhibitors and ARBs are CONTRAINDICATED in bilateral renal artery stenosis (or "
"unilateral stenosis in a solitary kidney). Monitor creatinine carefully when starting these drugs.",
bg=RED_BG, border_color=RED_TEXT
)
story += clin_card(
"2. Hemorrhagic / Hypovolemic Shock",
"Massive sympathetic activation + angiotensin II → intense afferent vasoconstriction. "
"MAP falls below 80 mmHg → autoregulation fails → RBF falls proportionally.",
"Oliguria/anuria. Prolonged ischemia → acute tubular necrosis (ATN). "
"Aggressive fluid resuscitation and vasopressors aim to restore MAP above the "
"autoregulatory threshold (>65-70 mmHg).",
bg=RED_BG, border_color=RED_TEXT
)
story += clin_card(
"3. NSAID-Induced Acute Kidney Injury",
"In volume-depleted/heart failure patients, prostaglandins (PGE₂/PGI₂) buffer sympathetic "
"and angiotensin II-mediated afferent vasoconstriction. NSAIDs inhibit COX → ↓ prostaglandins "
"→ unopposed vasoconstriction → ↓↓ RBF and GFR.",
"Avoid NSAIDs in: elderly patients, CKD, heart failure, cirrhosis, volume depletion, "
"and concurrent ACE inhibitor/diuretic use (the 'triple whammy' combination).",
bg=YELLOW_BG, border_color=YELLOW_TEXT
)
story += clin_card(
"4. Diabetic Nephropathy — Early Hyperfiltration",
"Glucose-Na cotransport in the proximal tubule increases Na reabsorption before the macula "
"densa → TGF senses ↓ NaCl → afferent vasodilation → ↑ RBF and GFR (hyperfiltration). "
"Sustained high GFR damages the glomerular filtration barrier.",
"SGLT2 inhibitors (e.g., empagliflozin, dapagliflozin) restore NaCl delivery to macula densa "
"→ afferent constriction → ↓ hyperfiltration → renoprotection independent of glucose control.",
bg=GREEN_BG, border_color=GREEN
)
story += clin_card(
"5. Hypertensive Emergency (MAP >170 mmHg)",
"When MAP exceeds the upper autoregulatory limit (~170 mmHg), autoregulation fails. "
"The afferent arterioles can no longer increase resistance enough. Glomerular capillary "
"pressure rises dramatically → endothelial injury → fibrinoid necrosis.",
"Malignant hypertension causes acute kidney injury via loss of autoregulation. "
"Gradual BP reduction (not too rapid) is targeted to restore autoregulation without "
"causing ischemia.",
bg=RED_BG, border_color=RED_TEXT
)
story += clin_card(
"6. Cardio-Renal Syndrome (Heart Failure)",
"Reduced cardiac output → ↓ renal perfusion pressure → compensatory vasoconstriction "
"(sympathetic + angiotensin II + ADH). Kidneys retain Na and water → worsens cardiac "
"preload → vicious cycle.",
"Loop diuretics relieve congestion but can over-diurese → ↓ preload → ↓ RBF → "
"worsening renal function. SGLT2 inhibitors and sacubitril/valsartan offer renoprotection "
"in heart failure with reduced ejection fraction.",
bg=YELLOW_BG, border_color=YELLOW_TEXT
)
story += clin_card(
"7. Contrast-Induced Nephropathy",
"Iodinated contrast agents cause direct tubular toxicity AND transient renal vasoconstriction "
"(endothelin, reduced NO). In patients with pre-existing ↓ RBF (CKD, heart failure, "
"diabetes), the autoregulatory reserve is already exhausted.",
"Pre-hydration with isotonic saline expands volume, suppresses RAAS and sympathetic tone, "
"and maintains RBF. N-acetylcysteine has limited evidence but is low-risk. Avoid concurrent "
"nephrotoxins (NSAIDs, aminoglycosides).",
bg=LIGHT_BLUE, border_color=MED_BLUE
)
story.append(PageBreak())
# =====================================================================
# SECTION 7 - KEY EQUATIONS
# =====================================================================
story += section_header("7. Key Equations & Quick Reference")
eq_data = [
["Formula", "Equation", "Notes"],
["Renal Blood Flow", "RBF = (PA - PV) / Total Renal Resistance",
"PA ≈ 100 mmHg, PV ≈ 3-4 mmHg"],
["Renal Plasma Flow", "RPF = (1 - Hct) × RBF",
"Normal RPF ≈ 600-660 mL/min"],
["RBF from RPF", "RBF = RPF / (1 - Hct)",
"Normal RBF ≈ 1000-1100 mL/min"],
["Effective RPF\n(PAH Clearance)", "eRPF = C_PAH = (U_PAH × V̇) / P_PAH",
"~90% of true RPF; PAH extraction ratio ≈ 0.9"],
["True RPF\n(Fick Principle)", "RPF = (U_PAH × V̇) / ([RA]_PAH - [RV]_PAH)",
"Requires renal artery and vein sampling"],
["Filtration Fraction", "FF = GFR / RPF",
"Normal ≈ 0.20 (20%)"],
["GFR", "GFR = C_inulin = (U_inulin × V̇) / P_inulin",
"Inulin: freely filtered, not reabsorbed or secreted"],
]
eq_tbl = Table(eq_data, colWidths=[4.5*cm, 7*cm, 5.5*cm])
eq_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), DARK_BLUE),
("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"),
("TEXTCOLOR", (0,0), (-1,0), WHITE),
("FONTSIZE", (0,0), (-1,-1), 8.5),
("ROWBACKGROUNDS",(0,1), (-1,-1), [WHITE, SOFT_GREY]),
("VALIGN", (0,0), (-1,-1), "TOP"),
("TOPPADDING", (0,0), (-1,-1), 6),
("BOTTOMPADDING", (0,0), (-1,-1), 6),
("LEFTPADDING", (0,0), (-1,-1), 7),
("BOX", (0,0), (-1,-1), 1, colors.HexColor("#CBD5E1")),
("INNERGRID", (0,0), (-1,-1), 0.5, colors.HexColor("#E5E7EB")),
]))
story.append(eq_tbl)
story.append(Spacer(1, 10))
# Quick reference summary table
story.append(Paragraph("Normal Renal Haemodynamic Values:", h2))
qr_data = [
["Parameter", "Normal Value"],
["Renal Blood Flow (RBF)", "~1000-1100 mL/min (~22% of cardiac output)"],
["Renal Plasma Flow (RPF)", "~600-660 mL/min"],
["GFR (both kidneys)", "~125 mL/min (~180 L/day)"],
["Filtration Fraction (FF)", "~20%"],
["Autoregulation range (MAP)", "80 - 170 mmHg"],
["Medullary blood flow", "~1-2% of RBF (via vasa recta)"],
["PAH extraction ratio", "~90%"],
["Glomerular capillary pressure", "~60 mmHg"],
["Efferent arteriolar resistance", "~43% of total renal resistance"],
["Afferent arteriolar resistance", "~26% of total renal resistance"],
]
qr_tbl = Table(qr_data, colWidths=[8*cm, 9*cm])
qr_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), MED_BLUE),
("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"),
("TEXTCOLOR", (0,0), (-1,0), WHITE),
("FONTSIZE", (0,0), (-1,-1), 9),
("ROWBACKGROUNDS",(0,1), (-1,-1), [WHITE, LIGHT_BLUE]),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 8),
("BOX", (0,0), (-1,-1), 1, MED_BLUE),
("INNERGRID", (0,0), (-1,-1), 0.5, colors.HexColor("#BFDBFE")),
]))
story.append(qr_tbl)
story.append(Spacer(1, 10))
# Mnemonic box
story += info_box("Memory Aid — Vasoconstrictors vs Vasodilators", [
"VASOCONSTRICTORS (↓ RBF): 'NASE' — Norepinephrine, Angiotensin II, Sympathetic nerves, Endothelin",
"VASODILATORS (↑ RBF): 'NPBDA' — Nitric oxide, Prostaglandins (PGE₂/PGI₂), Bradykinin, Dopamine, ANP",
"Autoregulation range: 80-170 mmHg (mnemonic: '80-170, not too low, not too high')",
], bg=YELLOW_BG, title_color=YELLOW_TEXT)
story.append(HRFlowable(width="100%", thickness=0.5, color=colors.HexColor("#CBD5E1"), spaceAfter=6))
# Footer reference
story.append(Paragraph(
"References: Guyton and Hall Textbook of Medical Physiology, 14th ed., pp. 340-345 | "
"Costanzo Physiology, 7th ed., pp. 262-265 | "
"Medical Physiology — Boron & Boulpaep, p. 1112 | Generated by Orris Medical AI",
small))
# ---------- BUILD ----------
doc.build(story)
print(f"PDF generated: {OUTPUT}")
cd /home/daytona/workspace/rbf-pdf && python generate_rbf_pdf.py 2>&1
ls -lh /home/daytona/workspace/rbf-pdf/RBF_Autoregulation_Summary.pdf
RBF Autoregulation Summary
PDF Document · PDF