# Example 1: DKA with glucose 600 mg/dL
# Measured Na 128, Glucose 600, using Katz (1.6)
# Correction = 1.6 * ((600-100)/100) = 1.6 * 5 = 8
# Corrected Na = 128 + 8 = 136
sodium_correction_hyperglycemia(128, 600)
# Example 2: Using Hillier factor (2.4) for severe hyperglycemia
# Measured Na 130, Glucose 800
# Correction = 2.4 * 7 = 16.8 -> Corrected ~146.8
sodium_correction_hyperglycemia(130, 800, correction_factor = 2.4)
Run the code above in your browser using DataLab