-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdiabetic_u.~pas
165 lines (147 loc) · 4.64 KB
/
diabetic_u.~pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
unit diabetic_u;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, StdCtrls, ExtCtrls, Spin, Grids, DBGrids, dmHospitalDB_u, patient_u, clsPatient_u;
type
TfrmDiabetic = class(TForm)
pnlMeasure: TPanel;
lblHeight: TLabel;
lblWeight: TLabel;
lblWaist: TLabel;
lblHR: TLabel;
lblMeasurements: TLabel;
edtHeight: TEdit;
sedHR: TSpinEdit;
pnlBP: TPanel;
lblSystolic: TLabel;
lblDiastolic: TLabel;
lblBP: TLabel;
sedSystolic: TSpinEdit;
sedDiastolic: TSpinEdit;
pnlGlucose: TPanel;
lblBG: TLabel;
lblFasting: TLabel;
lblPP: TLabel;
lblOvernight: TLabel;
edtOvernight: TEdit;
edtFasting: TEdit;
pnlVascular: TPanel;
lblVascular: TLabel;
cbxMicro: TCheckBox;
cbxMacro: TCheckBox;
lblPM: TLabel;
lblNotes: TLabel;
memNotes: TMemo;
rgpPills: TRadioGroup;
rgpInsulin: TRadioGroup;
ledInsDos: TLabeledEdit;
btnCheck: TButton;
redCheck: TRichEdit;
pnlFinal: TPanel;
btnDone: TButton;
btnReset: TButton;
edtPP: TEdit;
dbgDiabetc: TDBGrid;
lblDiabeticRecords: TLabel;
rgpClassification: TRadioGroup;
pnlHbA1c: TPanel;
lblA1cLevel: TLabel;
lblHbA1c: TLabel;
cbxHbA1c: TCheckBox;
edtHbA1c: TEdit;
sedWaist: TSpinEdit;
sedWeight: TSpinEdit;
procedure FormShow(Sender: TObject);
procedure memNotesClick(Sender: TObject);
procedure btnCheckClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frmDiabetic: TfrmDiabetic;
objDiabetic : TDiabeticPatient;
cGender : char;
sDiabeticDiagnosis, sGender, sPills, sInsulin : string;
bMacrovascular, bMicrovascular, bEpi, bAsm, bTB, bHypTns : boolean;
iAge, iDiastolic, iSystolic, iHeartRate, iWeight, iWaist : integer;
rFasting, rPostprandial, rOverNight, rHeight, rInsulinDosage : real;
implementation
{$R *.dfm}
procedure TfrmDiabetic.FormShow(Sender: TObject);
begin
with dmhospital do
begin
qryMinor.SQL.Clear;
qryMinor.SQL.Add('SELECT * FROM DiabeticClinic WHERE ID = "' + frmPatientData.sID + '" AND FolderNumber = ' + frmPatientData.sFolder + '" ORDER BY DateAndTime DESC');
qryMinor.Open;
end;
end;
procedure TfrmDiabetic.memNotesClick(Sender: TObject);
begin
memNotes.Lines.Clear;
memNotes.SetFocus;
end;
procedure TfrmDiabetic.btnCheckClick(Sender: TObject);
begin
iDiastolic := sedDiastolic.Value;
iSystolic := sedSystolic.Value;
rFasting := StrToFloat(edtFasting.Text);
rOverNight := StrToFloat(edtOvernight.Text);
rPostprandial := StrToFloat(edtPP.Text);
rHeight := StrToFloat(edtHeight.Text);
iHeartRate := sedHR.Value;
iWeight := sedWeight.Value;
iWaist := sedWaist.Value;
if cbxMicro.Checked = True then
bMicrovascular := True
else bMicrovascular := False;
if cbxMacro.Checked = True then
bMacrovascular := True
else bMacrovascular := False;
case rgpPills.ItemIndex of
0: sPills := 'Netforeman';
1: sPills := 'Glimepramide';
2: sPills := 'Glyclozide';
3: sPills := 'Glibenclamide';
end;
case rgpInsulin.ItemIndex of
0: sInsulin := 'Rapid Acting Insulin';
1: sInsulin := 'Short Acting Insulin';
2: sInsulin := 'Long Acting Insulin';
3: sInsulin := 'Ultra-Long Acting Insulin';
4: sInsulin := 'Actrofane';
5: sInsulin := 'Humolog';
6: sInsulin := 'Insuman';
end;
rInsulinDosage := StrToFloat(ledInsDos.Text);
objDiabetic := TDiabeticPatient.Create(frmPatientData.sFolder, iDiastolic, iSystolic, rFasting, rOverNight, rPostprandial, rHeight, iHeartRate, iWeight, iWaist, bMicrovascular, bMacrovascular, sPills, sInsulin, rInsulinDosage);
if cbxHbA1c.Checked = True then
begin
objDiabetic.SetHbA1c(StrToFloat(edtHbA1c.Text));
end;
with dmHospital do
begin
qryHospitalDB.SQL.Clear;
qryHospitalDB.SQL.Add('SELECT Age, Gender FROM PatientInfo WHERE FolderNumber = "' + frmPatientData.sFolder + '"');
qryHospitalDB.First;
iAge := qryHospitalDB['Age'];
sGender := qryHospitalDB['Gender'];
cGender := sGender[1];
objDiabetic.SetAge(iAge);
objDiabetic.SetGender(cGender);
qryMinor.SQL.Clear;
qryMinor.SQL.Add('SELECT * FROM GeneralHealth WHERE FolderNumber = "' + frmPatientData.sFolder + '"');
qryMinor.First;
bEpi := qryMinor['Eplilepsy'];
bAsm := qryMinor['Asthma'];
bTB := qryMinor['TB'];
bHypTns := qryMinor['HyperTension'];
sDiabeticDiagnosis := DateToStr(qryMinor['DiagnosisDiabetic']);
objDiabetic.SetDEATH(bepi, bAsm, bTB, bHypTns);
objDiabetic.SetDiagnosisDate(sDiabeticDiagnosis);
end;
end;
end.