# Example 1: Diabetic Ketoacidosis (High AG Met Acidosis)
# pH 7.2, pCO2 25 (Compensated), HCO3 10, Na 140, Cl 100
abg_analyzer(7.2, 25, 10, 140, 100)
# Example 2: Acute Respiratory Acidosis (Opioid Overdose)
# pH 7.25, pCO2 60, HCO3 26 (Acute/Uncompensated)
abg_analyzer(7.25, 60, 26)
# Example 3: Mixed Disorder (Septic Shock + Vomiting)
# High AG Acidosis + Met Alkalosis
# pH 7.4, pCO2 40, HCO3 24 (Normal pH/Nos), but High Gap
# Na 140, Cl 90, Alb 4.0
# AG = 140 - (90 + 24) = 26. Delta Gap = 14. Delta HCO3 = 0. Ratio > 2.0
abg_analyzer(7.4, 40, 24, 140, 90)
Run the code above in your browser using DataLab