-
Notifications
You must be signed in to change notification settings - Fork 0
/
Patient.java
71 lines (59 loc) · 1.63 KB
/
Patient.java
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
package com.example.demo;
import java.util.Date;
public class Patient
{
private final int id;
private final String firstName;
private final String lastName;
private final String dateOfBirth;
private final String medicalCondition;
private final int urgency;
private String timeAttended;
public Patient(int id, String firstName, String lastName, String dateOfBirth, String medicalCondition, int urgency)
{
this.id=id;
this.firstName=firstName;
this.lastName=lastName;
this.dateOfBirth=dateOfBirth;
this.medicalCondition=medicalCondition;
this.urgency=urgency;
this.timeAttended=null;
}
public int getId()
{
return id;
}
public String getFirstName()
{
return firstName;
}
public String getLastName()
{
return lastName;
}
public String getDateOfBirth()
{
return dateOfBirth;
}
public String getMedicalCondition()
{
return medicalCondition;
}
public int getUrgency()
{
return urgency;
}
public void setTimeAttended()
{
this.timeAttended = new Date().toString();
}
public String getTimeAttended()
{
return timeAttended;
}
@Override
public String toString()
{
return "Patient ID: " + id + ", Name: " + firstName + " " + lastName + ", DOB: " + dateOfBirth +", Condition: " + medicalCondition + ", Urgency: " + urgency +", Time Attended: " + (timeAttended != null ? timeAttended : "Not yet attended");
}
}