-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPatient.cpp
More file actions
122 lines (92 loc) · 2 KB
/
Patient.cpp
File metadata and controls
122 lines (92 loc) · 2 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
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
/*
* Patient.cpp
*
* Class Description: Models a walk-in clinic patient.
* Class Invariant: Each patient has a unique care card number.
* This care card number must have 10 digits.
* This care card number cannot be modified.
*
* Author: Denys Dziubii and Xubin Wang
* Date: January 22, 2019
*/
#include "Patient.h"
Patient::Patient()
{
this->name = "To be entered";
this->address = "To be entered";
this->email = "To be entered";
this->phone = "To be entered";
this->careCard = "0000000000";
}
Patient::Patient(string aCareCard)
{
this->name = "To be entered";
this->address = "To be entered";
this->email = "To be entered";
this->phone = "To be entered";
if(aCareCard.length() != 10)
{
this->careCard = "0000000000";
return;
}
this->careCard = aCareCard;
}
string Patient::getName() const
{
return this->name;
}
string Patient::getAddress() const
{
return this->address;
}
string Patient::getPhone() const
{
return this->phone;
}
string Patient::getEmail() const
{
return this->email;
}
string Patient::getCareCard() const
{
return this->careCard;
}
void Patient::setName(const string Name)
{
this->name = Name;
}
void Patient::setAddress(const string anAddress)
{
this->address = anAddress;
}
void Patient::setPhone(const string aPhone)
{
this->phone = aPhone;
}
void Patient::setEmail(const string anEmail)
{
this->email = anEmail;
}
bool Patient::operator == (const Patient & rhs)
{
if (this->careCard == rhs.getCareCard() )
return true;
else
return false;
}
bool Patient::operator > (const Patient & rhs)
{
if (this->careCard > rhs.getCareCard() )
return true;
else
return false;
}
ostream& operator << (ostream & os, const Patient & p)
{
os << p.getCareCard() << " - Patient: ";
os << p.getName() << ", ";
os << p.getAddress() << ", ";
os << p.getPhone() << ", ";
os << p.getEmail();
return os;
}