Created
July 27, 2023 21:56
-
-
Save halcwb/3d9c9f84818346884adabc2066144735 to your computer and use it in GitHub Desktop.
Calculate the ventilation 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(CalcVentilationIndex(50, 25, 10, 15)) | |
End Sub | |
' Calculate the ventilation index. Returns -1 if calculation not possible | |
' VI = (PaCO2 * (PIP - PEEP) * rate) / 1000 | |
Function CalcVentilationIndex(dblPaCO2 As Double, dblPIP As Double, dblPEEP As Double, intRate As Integer) As Double | |
Dim dblVI As Double = -1 | |
If dblPaCO2 > 0 And dblPIP > 0 And dblPEEP > 0 And intRate > 0 Then | |
dblVI = (dblPaCO2 * (dblPIP - dblPEEP) * intRate) / 1000 | |
End If | |
Return dblVI | |
End Function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment