-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPatient.java
More file actions
76 lines (62 loc) · 1.73 KB
/
Patient.java
File metadata and controls
76 lines (62 loc) · 1.73 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
import java.util.Date;
import java.util.List;
import java.util.ArrayList;
class Patient {
private final String firstName;
private final String lastName;
private final String ICNumber;
private final int floor;
private final String ward;
private final int bedNumber;
private final Date stayFrom;
private final Date stayTo;
private final boolean wantVisitors;
private List<Visitor> listOfVisitors;
public Patient(String firstName,
String lastName,
String ICNumber,
int floor,
String ward,
int bedNumber,
Date stayFrom,
Date stayTo,
boolean wantVisitors) {
this.firstName = firstName;
this.lastName = lastName;
this.ICNumber = ICNumber;
this.floor = floor;
this.ward = ward;
this.bedNumber = bedNumber;
this.stayFrom = stayFrom;
this.stayTo = stayTo;
this.wantVisitors = wantVisitors;
this.listOfVisitors = new ArrayList<>();
}
int getFloor() {
return this.floor;
}
String getWard() {
return this.ward;
}
int getBedNumber() {
return this.bedNumber;
}
String getICNumber() {
return this.ICNumber;
}
boolean getWantVisitors() {
return this.wantVisitors;
}
int getNumberOfVisitors() {
return this.listOfVisitors.size();
}
String getName() {
return String.format("%s %s", this.firstName, this.lastName);
}
String getLocation() {
return String.format("Floor %s, Ward %s, Bed %s", this.floor, this.ward, this.bedNumber);
}
void addVisitor(Visitor visitor) {
this.listOfVisitors.add(visitor);
}
}