Created
July 27, 2023 22:07
-
-
Save halcwb/7514d08bea541377235b485fbb0564a5 to your computer and use it in GitHub Desktop.
Calculate the Alveolar Arterial Oxygen Difference
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub Main | |
Console.WriteLine(CalcAaDO2(50, 60, 80)) | |
End Sub | |
' Calculate the Alveolar Arterial Oxygen Difference. Returns -1 if calculation not possible | |
' AaDO2 = (713 * FiO2) - (PaCO2 / 0.8) - PaO2 | |
Function CalcAaDO2(dblPaCO2 As Double, dblPaO2 As Double, dblFiO2 As Double) As Double | |
Dim dblRatio As Double = -1 | |
If dblFiO2 > 1 Then dblFiO2 = dblFiO2 / 100 | |
If dblPaCO2 > 0 And dblPaO2 > 0 And dblFiO2 > 0 Then | |
dblRatio = (713 * dblFiO2) - (dblPaCO2 / 0.8) - dblPaO2 | |
End If | |
Return dblRatio | |
End Function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment