# Example 1: Severe Acidosis
# 70kg patient, current HCO3 8, target 15 (partial correction)
# Deficit = 0.4 * 70 * (15 - 8) = 196 mEq
bicarbonate_deficit(70, 8, 15)
# Example 2: Full Correction Calculation
# 80kg patient, current 12, target 24
# Deficit = 0.4 * 80 * (24 - 12) = 384 mEq
bicarbonate_deficit(80, 12, 24)
Run the code above in your browser using DataLab