Created
July 27, 2023 21:51
-
-
Save halcwb/68e5e336d3b5a2d2347d1395a29b6718 to your computer and use it in GitHub Desktop.
Calculate the oxygenation index
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(CalcOI(12, 80, 60)) | |
Console.WriteLine(CalcOI(12, 0.8, 60)) | |
End Sub | |
' Calculate the oxygenation index. Returns -1 if calculation not possible | |
' OI = (MAP * FiO2 * 100) / PaO2 | |
Function CalcOI(dblMAP As Double, dblFiO2 As Double, dblPaO2 As Double) As Double | |
Dim dblOI As Double = -1 | |
If dblFiO2 >= 0.21 And dblFiO2 <= 1 Then dblFiO2 = dblFiO2 * 100 | |
If dblPaO2 > 0 And dblMAP > 0 And dblFiO2 >= 21 Then | |
dblOI = (dblMAP * dblFiO2) / dblPaO2 | |
End If | |
Return dblOI | |
End Function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment