-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathNurse.java
More file actions
79 lines (61 loc) · 2.36 KB
/
Nurse.java
File metadata and controls
79 lines (61 loc) · 2.36 KB
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
import java.util.ArrayList;
public class Nurse extends Account {
// work done by Long Ly
// MAINLY DONE NEED PATIENT LIST TO FINISH
// Nurse responsibities
/*
* Current Patient List of all doctors View Patient List Records Patient
* Measurements Appoint Doctor to Patient Add new patient to patient list Remove
* patient from patient list
*/
// Nurse Constructor
// WIP
private Patient patient;
private Doctor[] doctors;
private PatientList patientList;
private MessageHandler messageHandler;
// I don't think nurses have their own id or names
public Nurse(String username, String password) {
super(username, password);
// messageHandler = New MessageHandler();
}// end of Nurse Constructor
public void appointDoctorToPatient(Doctor doctor) {
this.patient.assignDoctor(doctor);
}
// updating Patient Vitals from Patient class
// Also appoints paitent to doctor at the same time
public void updatePatientVitals(float weight, String height, float bodytemp, float bloodPres, Doctor doctor) {
this.patient.updateVitals(weight, height, bodytemp, bloodPres);
appointDoctorToPatient(doctor);
}// end of updatePaitentVitals
//
public void setCurrentPatient(Patient patient) {
this.patient = patient;
}
public void sendMessage(Account recipient, String message) {
// uses messageHandler to message Patient
Patient patient = (Patient) recipient;
String messageToSend = "Nurse " + username + ": " + message;
try {
messageHandler.writeMessage(this, patient, messageToSend);
} catch (Exception e) {
System.out.println("there was a problem creating a message from doctor to current patient");
e.printStackTrace();
}
}
//
public ArrayList<String> patientHistory() {
return this.patient.getPatientHistoryArray();
}
private void viewPatientList() {
// TO BE WORKED ON
}// end of viewPatientList
private void addNewPatientToList(Patient patient) {
// TO BE WORKED ON
// ADDS PATIENT TO PATIENTLIST
}// end of addNewPatientToList
private void removePatientFromList(Patient patient) {
// TO BE WORKED ON
// REMOVES PATIENT FROM PATIENTLIST
}// removePatientFromList
}// end of nurse class