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(CalcPAFratio("", 0, 100, 50)) | |
Console.WriteLine(CalcPAFratio("", 0, 50, 100)) | |
Console.WriteLine(CalcPAFratio("lowflow", 5, 100, 50)) | |
Console.WriteLine(CalcPAFratio("mask", 6, 100, 50)) | |
Console.WriteLine(CalcPAFratio("mask", 12, 100, 50)) | |
End Sub |
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 | |
Dim dblAge As Double = 0 | |
For intM As Integer = 0 To 12 | |
dblAge = intM / 12 | |
Console.WriteLine("{0}, {1}", intM, CalcEstimatedBW(dblAge, "", 0)) | |
Next | |
For intY As Integer = 0 To 9 | |
dblAge = intY |
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(CalcAaO2Gradient(21, 80, 45)) | |
End Sub | |
' A-a O2 Gradient = [ (FiO2) × (Atmospheric Pressure - H2O Pressure) - (PaCO2/0.8) ] – PaO2 | |
' Normal gradient = (age / 4) + 4 | |
' Returns -1 if A-a O2 gradient cannot be calculated | |
Function CalcAaO2Gradient(dblFiO2 As Double, dblPaO2 As Double, dblPaCO2 As Double) As Double | |
Dim dblGrad As Double = -1 | |
Const dblPatm As Double = 760 |
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 | |
Dim dblCreat As Double = 88.42 | |
Dim dblUrea As Double = 0.3571 | |
Dim dbleGFR As Double | |
' cannot calculate | |
dblEGFR = CalcEGFR("", 0, 0, 0, 0, 0) | |
Console.WriteLine(System.Math.Round(dbleGFR, 0)) ' -1 |
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 | |
Dim strApiKey As String = "<API_KEY>" | |
Dim strContent As String = "say: Hello world, this is from open AI" | |
Dim strResult = MakeWebRequest(CreateOpenAIRequest(strApiKey, strContent)) | |
Console.WriteLine(ParseOpenAIJson(strResult, "content")) | |
End Sub | |
Function CreateOpenAIRequest(strApiKey As String, strContent As String) As System.Net.Http.HttpRequestMessage |
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
begin transaction | |
declare @stat_ModuleID as smallint; | |
declare @stat_VBScript as nvarchar(max); | |
declare @stat_Name as nvarchar(100); | |
declare @stat_Description as nvarchar(1000); | |
declare @stat_OldVbScript as nvarchar(max); | |
declare @stat_LastUpdateGUID as uniqueidentifier; | |
-- makes it an internal parameterized function |
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 | |
Dim dtmFrom As Date | |
Dim dtmTo As Date | |
' 366. 1-1-2022 - 1-1-2023 -> Age: 1 years, 11 months, 0 weeks, -334 days | |
dtmFrom = New System.DateTime(2022, 1, 1) | |
dtmTo = New System.DateTime(2023, 1, 1) | |
' TestCase(1, dtmFrom, dtmTo) | |
TestAll() | |
TestRand() |
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 | |
Dim dblW As Double = 10 | |
Dim dblH As Double = 70 | |
Dim strForm As String = "" | |
System.Console.WriteLine("{0}: {1}", strForm, CalcBSA(strForm, dblW, dblH)) | |
strForm = "mosteller" | |
System.Console.WriteLine("{0}: {1}", strForm, CalcBSA(strForm, dblW, dblH)) | |
strForm = "dubois" | |
System.Console.WriteLine("{0}: {1}", strForm, CalcBSA(strForm, dblW, dblH)) |
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 | |
Dim dblNum As Double = 1.12345 | |
Console.WriteLine("FixPrec: {0}", FixPrecision(dblNum, 2)) | |
End Sub | |
' Purpose: Relative rounding of a number with a specified minimum precision. All digits | |
' before the decimal point are preserved. Digits after the decimal point are preserved | |
' as follows: |
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
module DateTime = | |
open System | |
let create (year: int) (month: int) (day: int) = DateTime(year, month, day) | |
let withContinuation fSucc fErr year month day = |