What are the type of renal tubular acidosis mention it in the table format
"renal tubular acidosis" classification
| Feature | Type 1 (Distal RTA) | Type 2 (Proximal RTA) | Type 3 (Mixed/Combined) | Type 4 (Hyperkalemic Distal RTA) |
|---|---|---|---|---|
| Primary defect | Impaired distal H+ secretion (reduced H+-ATPase activity) at the collecting duct | Reduced proximal tubular HCO3- reabsorption | Carbonic anhydrase II deficiency - combines features of Type 1 and 2 | Reduced ammonium (NH4+) production due to aldosterone deficiency or resistance |
| Serum K+ | Low (hypokalemia) | Low (hypokalemia) | Variable | High (hyperkalemia) |
| Kidney function | Normal or near-normal | Normal or near-normal | Normal or near-normal | Reduced (often stage 3-5 CKD) |
| Urine pH during acidosis | High (>5.5), cannot acidify urine | Low (<5.5) once serum HCO3- falls below reabsorptive threshold | High | Low or high (depends on cause) |
| Serum HCO3- (mmol/L) | 10-20 (can be very low, <10) | 16-18 | Variable | 16-22 |
| Urine citrate | Low | High | Low | Low |
| Fanconi syndrome | No | May be present (glycosuria, aminoaciduria, phosphaturia) | No | No |
| Nephrocalcinosis/nephrolithiasis | Common (due to hypercalciuria + low citrate) | Rare | Rare | Rare |
| Common causes | Sjögren syndrome, autoimmune disease, hereditary H+-ATPase/anion exchanger mutations, amphotericin B, lithium | Fanconi syndrome, drug toxicity (ifosfamide, tenofovir, cidofovir, aristolochic acid, carbonic anhydrase inhibitors), cystinosis, multiple myeloma | Rare genetic (osteopetrosis with renal tubular acidosis, CA II mutation) | Diabetic nephropathy, interstitial nephritis, obstructive uropathy, ACE inhibitors/ARBs, NSAIDs, heparin, potassium-sparing diuretics (spironolactone, amiloride, finerenone), hyporeninemic hypoaldosteronism |
| Treatment | Oral alkali (bicarbonate or citrate) - low doses (1-2 mEq/kg/day) usually correct acidosis since GFR is normal | Large doses of alkali (10-15 mEq/kg/day) plus K+-Cl- supplementation; treat underlying Fanconi syndrome | Alkali replacement, manage bone disease | Correct hyperkalemia (low-K+ diet, loop/thiazide diuretics, K+-binders); fludrocortisone if mineralocorticoid deficient; treat underlying cause |
Create a clinical decision tree flowchart for diagnosing RTA type
python3 -c "import graphviz; print('graphviz python ok')"; which dot; dot -V 2>&1
mkdir -p /tmp/workspace/rta-flowchart && ls -la /tmp/workspace/
~/rta-flowchart/build_flowchart.py
import graphviz
dot = graphviz.Digraph('RTA_Decision_Tree', format='png')
dot.attr(rankdir='TB', splines='ortho', bgcolor='white', fontname='Helvetica')
dot.attr('node', fontname='Helvetica', fontsize='11')
dot.attr('edge', fontname='Helvetica', fontsize='10')
# ---------- Node styles ----------
def start(name, label):
dot.node(name, label, shape='oval', style='filled', fillcolor='#2c3e50', fontcolor='white')
def decision(name, label):
dot.node(name, label, shape='diamond', style='filled', fillcolor='#fef9e7', fontcolor='#7d6608')
def action(name, label):
dot.node(name, label, shape='box', style='rounded,filled', fillcolor='#eaf2f8', fontcolor='#1b4f72')
def workup(name, label):
dot.node(name, label, shape='box', style='rounded,filled', fillcolor='#f4ecf7', fontcolor='#4a235a')
def diagnosis(name, label, color):
dot.node(name, label, shape='box', style='rounded,filled,bold', fillcolor=color, fontcolor='white')
# ---------- Nodes ----------
start('A', 'Normal Anion Gap\n(Hyperchloremic) Metabolic Acidosis')
decision('B', 'History of diarrhea /\nileostomy / GI HCO3- loss?')
action('B1', 'Check Urine Anion Gap (UAG)\nor Urine Osmolal Gap')
diagnosis('B2', 'UAG strongly NEGATIVE\n(high NH4+ excretion)\n\nEXTRARENAL CAUSE\n(GI bicarbonate loss)\nNOT RTA', '#5d6d7e')
decision('C', 'Measure Serum K+')
# High K branch -> Type 4
workup('D', 'Suspect Type 4 RTA workup:\n- Plasma renin & aldosterone\n- Review drugs: ACEi/ARB, NSAIDs,\n K-sparing diuretics, heparin\n- Assess for CKD, diabetic\n nephropathy, interstitial disease')
action('D1', 'Urine pH variable (often <5.5)\nUAG positive, low TTKG')
diagnosis('D2', 'TYPE 4 RTA\n(Hyperkalemic Distal RTA)\n\nHigh K+, reduced GFR,\nlow aldosterone/NH4+ production', '#c0392b')
# Low/normal K branch
decision('E', 'Urine pH during\nactive acidosis')
workup('F', 'Suspect Type 1 (Distal) RTA:\n- Positive urine anion gap\n- Low urine citrate,\n hypercalciuria\n- Nephrocalcinosis /\n nephrolithiasis on imaging\n- NH4Cl acid-loading test\n (if diagnosis unclear)')
diagnosis('F1', 'TYPE 1 RTA\n(Classic Distal RTA)\n\nUrine pH > 5.5 despite acidemia\nHypokalemia, low HCO3- (10-20)', '#1a5276')
workup('G', 'Suspect Type 2 (Proximal) RTA:\n- Screen for Fanconi syndrome:\n glycosuria, aminoaciduria,\n phosphaturia, LMW proteinuria\n- Fractional excretion of HCO3-\n >15-20% during NaHCO3 infusion')
diagnosis('G1', 'TYPE 2 RTA\n(Proximal RTA)\n\nUrine pH < 5.5 (appropriate)\nHypokalemia, HCO3- 16-18\n+/- Fanconi syndrome', '#117864')
note = ('Note: Type 3 RTA is a rare mixed proximal + distal defect\n'
'(carbonic anhydrase II deficiency, often with osteopetrosis).\n'
'Not part of routine stepwise workup.')
dot.node('NOTE', note, shape='note', style='filled', fillcolor='#fdf2e9', fontcolor='#7e5109', fontsize='9')
# ---------- Edges ----------
dot.edge('A', 'B')
dot.edge('B', 'B1', label='Yes / suspected')
dot.edge('B1', 'B2', label='confirms GI loss')
dot.edge('B', 'C', label='No / equivocal\n(evaluate for RTA)')
dot.edge('C', 'D', label='HIGH K+\n(hyperkalemia)')
dot.edge('D', 'D1')
dot.edge('D1', 'D2')
dot.edge('C', 'E', label='LOW / NORMAL K+\n(hypokalemia)')
dot.edge('E', 'F', label='pH > 5.5\n(cannot acidify urine)')
dot.edge('F', 'F1')
dot.edge('E', 'G', label='pH < 5.5\n(urine appropriately acidic)')
dot.edge('G', 'G1')
dot.edge('G1', 'NOTE', style='invis')
dot.attr(label='Clinical Decision Tree: Diagnosing Renal Tubular Acidosis (RTA) Type\n\n', labelloc='t', fontsize='16', fontname='Helvetica-Bold')
dot.render('/tmp/workspace/rta-flowchart/rta_decision_tree', cleanup=True)
print('done')
cd /tmp/workspace/rta-flowchart && python3 build_flowchart.py && ls -la
~/rta-flowchart/build_flowchart.py
Successfully replaced 1 instance(s) of the string in '/tmp/workspace/rta-flowchart/build_flowchart.py'
cd /tmp/workspace/rta-flowchart && python3 build_flowchart.py && ls -la

rta decision tree
Image · PNG