⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cardiovascular.frm

📁 一个用VB写的人工智能看病程序源代码
💻 FRM
📖 第 1 页 / 共 5 页
字号:
End Select
End If

End Sub

Private Sub CAD_KeyPress(KeyAscii As Integer)
If KeyAscii = 46 Then
KeyAscii = 0
Exit Sub
End If
If Chr(KeyAscii) Like "[a-zA-Z]" <> True And KeyAscii <> vbKeyBack And KeyAscii <> vbKeySpace And KeyAscii <> vbKeyDelete Then
KeyAscii = 0
End If

End Sub

Private Sub CAD_LostFocus()
If UCase(LTrim(RTrim(CAD))) <> "Y" And UCase(LTrim(RTrim(CAD))) <> "N" Then
    CAD = ""
Else
CAD = UCase((LTrim(RTrim(CAD))))
End If
End Sub

Private Sub Check1_Click(Index As Integer)
Select Case Index
Case 0
    Check1(1).Value = 0
    Check1(2).Value = 0
Case 1
    Check1(0).Value = 0
    Check1(2).Value = 0
Case 2
    Check1(1).Value = 0
    Check1(0).Value = 0
End Select
End Sub


Private Sub Check2_Click(Index As Integer)
Select Case Index
Case 0
    Check2(1).Value = 0
    Check2(2).Value = 0
Case 1
    Check2(0).Value = 0
    Check2(2).Value = 0
Case 2
    Check2(1).Value = 0
    Check2(0).Value = 0
End Select

End Sub

Private Sub Combo1_Click()

If Val(Inny) = 0 Then
    Exit Sub
    Inny.SetFocus
End If

Select Case Combo1.Text

Case "Kilograms to Pounds"
Outy = Str(Val(Inny) * 2.2)

Case "Pounds to Kilograms"
Outy = Str(Val(Inny) / 2.2)

Case "Centimeters to Inches"
Outy = Str(Val(Inny) / 2.54)

Case "Inches to Centimeters"
Outy = Str(Val(Inny) * 2.54)

Case "mmol/L to mg/dl"
Outy = Str(Val(Inny) / 0.0259)

Case "mg/dl to mmol/L"
Outy = Str(Val(Inny) * 0.0259)

Case "gm/L to mg/dl"
Outy = Str(Val(Inny) / 100)

Case "mg/dl to gm/L"
Outy = Str(Val(Inny) * 100)

End Select

End Sub

Private Sub Command1_Click()


End Sub

Private Sub Command2_Click()
Dim Msg, Style, Title, Help, Ctxt, Response, MyString
Dim Mortise As Integer
Dim MortiseRisk As String
Dim E10, E11, E12 As Integer
Dim Fib, Cholesterol1 As Double
Dim FibRisk As String
Dim HDLrisk As String
Dim HDLriskV As Double
Dim LDLrisk As String
Dim LDLriskV As Double
Dim NCEP As Integer
Dim NCEPs As String
Dim NCEP1 As Integer
Dim NCEPs1 As String
Dim ATP As Integer
Dim ATPs As String
Dim ATPx As Integer
ATPx = 0
ATP = 0
ATPs = ""
NCEP = 0
NCEPs = ""
NCEP1 = 0
NCEPs1 = ""
LDLrisk = ""
LDLriskV = 0
HDLrisk = ""
Fibrinogen = 0
FibRisk = ""
AHA = 0
AHArisk = ""
Mortise = 0
MortiseRisk = ""
E10 = 0

If Text1(1) = "" Or Text1(2) = "" Or Text1(13) = "" Or Text2 = "" Or Text1(6) = "" Or Text1(7) = "" Or Text1(8) = "" _
Or Text1(9) = "" Or Text1(10) = "" Or Text3 = "" Or Text4 = "" Or Text5 = "" Or Text6 = "" Or Text8 = "" Or Text10 = "" _
Or Text11 = "" Or CAD = "" Or Hypertension = "" Or Hyperlipidemia = "" Or FhxCAD = "" Or Obesity = "" Then
    Msg = "You MUST at the very least Complete Gender, Age, Weight, Height and ANSWER ALL Y/N Questions."
    Style = vbCritical
    Title = "Input Error"   ' Define title.
    Help = "DEMO.HLP"   ' Define Help file.
    Ctxt = 1000   ' Define topic
    Response = MsgBox(Msg, Style, Title, Help, Ctxt)
Exit Sub
End If

If Text1(0) = "M" Then   'gender
    E10 = 1
    Text3.Text = "N"
    Text4.Text = "N"
    Select Case Val(Text1(1)) 'Age
    Case Is >= 45
        ATP = 1
    Case 35 To 44.9
        NCEP1 = 1
    Case 45 To 54.9
        NCEP1 = 2
    Case 55 To 64.9
        NCEP1 = 3
    Case 65 To 74.9
        NCEP1 = 4
    Case 75 To 84.9
        NCEP1 = 5
    Case 85 To 94.9
        NCEP1 = 6
    Case 95 To 104.9
        NCEP1 = 7
    Case Is >= 105
        NCEP1 = 8
    Case Is < 40
        Mortise = 3
    Case Is >= 45
        NCEP = 1
    Case 40 To 55
        Mortise = 6
    Case Is > 55
        Mortise = 9
    End Select
    
    Select Case Val(Text1(1)) 'Age
    Case Is < 35
        AHA = 0
    Case 35.1 To 40
        AHA = 1
    Case 40.1 To 49
        AHA = 2
    Case 49.1 To 54
        AHA = 3
    Case Is > 54
        AHA = 4
    End Select
    
Else  'Female

    If Text3 = "Y" And Text4 = "Y" Then NCEP = 1
    Select Case Val(Text1(1)) 'Age
    Case Is >= 55
        ATP = 1
    Case 35 To 44.9
        NCEP1 = 0
    Case 45 To 54.9
        NCEP1 = 1
    Case 55 To 64.9
        NCEP1 = 2
    Case 65 To 74.9
        NCEP1 = 3
    Case 75 To 84.9
        NCEP1 = 4
    Case 85 To 94.9
        NCEP1 = 5
    Case 95 To 104.9
        NCEP1 = 6
    Case Is >= 105
        NCEP1 = 7

    Case Is <= 50
        Mortise = 3
    Case Is >= 55
        NCEP = 1
    Case 50 To 65
        Mortise = 6
    Case Is > 65
        Mortise = 9
    End Select
    
    Select Case Val(Text1(1))
    Case Is < 42
        AHA = 0
    Case 42.1 To 45
        AHA = 1
    Case 45.1 To 55
        AHA = 3
    Case 45.1 To 74
        AHA = 3
    Case Is > 74
        AHA = 4
    End Select
End If
If Text1(11) = "" Or Text1(12) = "" Then
    Msg = "The very minimal interpretation requires a Total Cholesterol and an HDL-Cholesterol."
    Style = vbCritical
    Title = "Input Error"   ' Define title.
    Help = "DEMO.HLP"   ' Define Help file.
    Ctxt = 1000   ' Define topic
    Response = MsgBox(Msg, Style, Title, Help, Ctxt)
Exit Sub
End If


If Text6 = "Y" Or Text7 = "Y" Then NCEP = NCEP + 1


If Text1(6) = "Y" Then AHA = AHA + 2 'FHx of Heart ds or MI prior to age of 60? (Y/N)

If Text1(7) = "Y" Then AHA = AHA + 1 'Rarely exercise or do anything physical? (Y/N)

If Text1(8) = "Y" Then 'Do you smoke? (Y/N)
    AHA = AHA + 1
    Mortise = Mortise + 1
    E11 = 1
    NCEP = NCEP + 1
    NCEP1 = NCEP1 + 1
    ATP = ATP + 1
End If

If Text1(9) = "Y" And Text1(0) = "M" Then
    AHA = AHA + 1 'Diabetic? (Y/N)
    Mortise = Mortise + 2
    NCEP = NCEP + 1
    NCEP1 = NCEP1 + 1
End If
If Text1(9) = "Y" And Text1(0) = "F" Then
    AHA = AHA + 2 'female diabetic
    Mortise = Mortise + 2
    NCEP = NCEP + 1
    NCEP1 = NCEP1 + 1
End If

If Text10 = "Y" Or Text11 = "Y" Then ATP = ATP + 1

If Text5 = "Y" Or Text1(10) = "Y" Then
    NCEP = NCEP + 1
    NCEP1 = NCEP1 + 1
End If
If Val(Syst) >= 140 And Val(diastolic) >= 9 Then
    ATP = ATP + 1
Else
    If Text1(10) = "Y" Then ATP = ATP + 1
End If

If Val(Text1(12)) >= 60 Then
    NCEP = NCEP - 1
    NCEP1 = NCEP1 - 1
    ATP = ATP - 1
End If
If Val(Text1(12)) < 40 And Text1(12) <> "" Then
    ATP = ATP + 1
End If

If Val(Text1(12)) < 35 And Text1(12) <> "" Then
    NCEP = NCEP + 1
    NCEP1 = NCEP1 + 1
End If

If Val(LDL) >= 200 Then NCEP1 = NCEP1 + 1

If Hypertension = "Y" Then
    Mortise = Mortise + 1
    E12 = 1
End If
If Hyperlipidemia = "Y" Then
    Mortise = Mortise + 1
End If
If FhxCAD = "Y" Then
    Mortise = Mortise + 1
End If
If Obesity = "Y" Then
    Mortise = Mortise + 1
End If
If Check1(0).Value = 1 Then Mortise = Mortise + 5
If Check1(1).Value = 1 Then Mortise = Mortise + 3
If Check1(2).Value = 1 Then Mortise = Mortise + 1
If Check2(0).Value = 1 Then Mortise = Mortise + 0
If Check2(1).Value = 1 Then Mortise = Mortise - 3
If Check2(2).Value = 1 Then Mortise = Mortise + 3




If Text1(10) = "N" Then 'Current BP meds? (Y/N)
    If Val(Syst1) > 170 Then
        AHA = AHA + 2
    End If
    If Val(Syst1) >= 140 And Val(Syst1) <= 170 Then
    AHA = AHA + 1
    End If
Else
    AHA = AHA + 1
End If
Select Case Val(Text1(11)) 'Current Total Cholesterol level, in mg/dL
    Case 240 To 315
        AHA = AHA + 1
    Case Is > 315
        AHA = AHA + 2
End Select
'=IF(B23>=60,-1,IF(B23>38,0,IF(B23>=30,1,2)))
Select Case Val(Text1(12)) 'Current HDL cholesterol level, in mg/dL
    Case Is < 30
        AHA = AHA + 2
    Case 30 To 38
        AHA = AHA + 1
    Case Is >= 60
        AHA = AHA - 1
End Select

If AHA >= 4 Then
AHArisk = "ABOVE AVERAGE risk of a first heart attack relative to the general adult population"
Else
AHArisk = "AVERAGE risk of a first heart attack relative to the general adult population"
End If
If Mortise <= 8 Then MortiseRisk = "Low"
If Mortise > 8 And Mortise <= 15 Then MortiseRisk = "Intermediate"
If Mortise > 15 Then MortiseRisk = "High"
Fib = (0.05 * Val(Text1(1))) + (0.1 * Val(Text1(11)) / Val(Text1(12))) + (0.5 * E10) + (0.002857 * Val(Fibrinogen)) + (0.5 * E11) + (0.7 * E12)
FibRisk = Str(Int(Fib * 100) / 100)


Interpret = "The Total number of AHA points is: " & Str(AHA) & " out of 21." & vbCr & vbLf & vbCr & vbLf & AHArisk & " (American Heart Association)."

If Text2 = "Y" Then
    Interpret = Interpret & vbCr & vbLf & vbCr & vbLf & "The Clinical Score of Mortise for Coronary Artery Disease is : " & Mortise & vbCr & vbLf & vbCr & vbLf & "The Mortise Risk for the presence of CAD is " & MortiseRisk
End If

If Val(Fibrinogen) <> 0 Then
    Interpret = Interpret & vbCr & vbLf & vbCr & vbLf & "The Fibrinogen (Schermund) based Overall risk for Coronary Atherosclerotic Disease is : " & FibRisk
End If

If Triglyceride <> "" Then
    If Val(Triglyceride) <= 400 Then
        Interpret = Interpret & vbCr & vbLf & vbCr & vbLf & "The Calculated VLDL is : " & Val(triglycerides) / 5
    Else
        Interpret = Interpret & vbCr & vbLf & vbCr & vbLf & "One can not accurately Calculate the VLDL as the Triglycerides exceed 400 mg/dl.   Measure it directly."
    End If
End If
If Triglyceride <> "" Then
    If Val(Triglyceride) <= 400 Then
        Interpret = Interpret & vbCr & vbLf & vbCr & vbLf & "The Calculated LDL is : " & Val(Text1(11)) - (Val(triglycerides) / 5) - Val(Text1(12)) & " (Cholesterol - VLDL - HDL)"
    Else
        Interpret = Interpret & vbCr & vbLf & vbCr & vbLf & "One can not accurately Calculate the LDL as the Triglycerides exceed 400 mg/dl.   Measure LDL directly."
    End If
End If

If LDL <> "" Then
    Interpret = Interpret & vbCr & vbLf & vbCr & vbLf & "The measured LDL Cholesterol is " & LDL & " mg/dl"
End If

If Text1(0) = "M" Then
Select Case Val(Text1(12))
    Case Is > 65
        HDLrisk = "Very Low Risk"
    Case 25 To 65 '
        HDLriskV = (0.000658 * (Val(Text1(12)) ^ 2)) - (0.0979 * Val(Text1(12))) + 4.085
        HDLrisk = Str(HDLriskV) & " times the Average Risk"

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -