-
Notifications
You must be signed in to change notification settings - Fork 0
/
EMR
142 lines (105 loc) · 3.24 KB
/
EMR
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
package studenthealthservices;
public class EmR {
private String name;
private String dateOfBirth;
private String reasonForVisit;
private double bodyTemp;
private double heartRate;
private String diagnosis;
private String perscribedMedicine;
public static int totalPatients;
// Constructors
public EmR() {
totalPatients = totalPatients + 1;
}
public EmR(String newName, String newDateOfBirth) {
name = newName;
dateOfBirth = newDateOfBirth;
totalPatients = totalPatients + 1;
}
public EmR
(String newName, String newDateOfBirth, String newReasonForVisit, double newBodyTemp, double newHeartRate, String newDiagnosis, String newPerscribedMedicine) {
name = newName;
dateOfBirth = newDateOfBirth;
reasonForVisit = newReasonForVisit;
bodyTemp = newBodyTemp;
heartRate = newHeartRate;
diagnosis = newDiagnosis;
perscribedMedicine = newPerscribedMedicine;
totalPatients = totalPatients + 1;
}
// Get and set methods
// name
public String getName() {
return name;
}
public void setName(String newName) {
name = newName;
}
// DOB
public String getDateOfBirth() {
return dateOfBirth;
}
public void setDateOfBirth(String newDateOfBirth) {
dateOfBirth = newDateOfBirth;
}
// reason for visit
public String getReasonForVisit() {
return reasonForVisit;
}
public void setReasonForVisit(String newReason) {
reasonForVisit = newReason;
}
// body temp
public double getBodyTemp() {
return bodyTemp;
}
public void setBodyTemp(double newBodyTemp) {
bodyTemp = newBodyTemp;
}
// heart rate
public double getHeartRate() {
return heartRate;
}
public void setHeartRate(double newHeartRate) {
heartRate = newHeartRate;
}
// diagnosis
public String getDiagnosis() {
return diagnosis;
}
public void setDiagnosis(String newDiagnosis) {
diagnosis = newDiagnosis;
}
// perscribed medicine
public String getPerscribedMedicine() {
return perscribedMedicine;
}
public void setPerscribedMedicine(String newPerscribedMedicine) {
perscribedMedicine = newPerscribedMedicine;
}
// total patients
public static int getTotalPatients() {
return totalPatients;
}
// Red Flags
public boolean redFlags() {
if (heartRate < 60 ^ heartRate > 100) {
return true;
}else if(bodyTemp < 97.3 ^ bodyTemp > 99.1) {
return true;
}
return false;
}
// Convert the data to string
public String getInfo() {
return
"Name: " + name +
"\n" + "DOB: " + dateOfBirth +
"\n" + "Body Temp: " + bodyTemp +
"\n" + "Heart Rate: " + heartRate +
"\n" + "Reason For Visit: " + reasonForVisit +
"\n" + "Diagnosis: " + diagnosis +
"\n" + "Perscribed Medicine: " + perscribedMedicine;
}
}