-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDoctor.cpp
150 lines (129 loc) · 3.27 KB
/
Doctor.cpp
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
143
144
145
146
147
148
149
150
#include "Doctor.h"
#include "Laboratory.h"
Doctor::Doctor()
{
// id = 0;
this->rating = 0.0;
// earliestDate=0;
}
Doctor::Doctor(QString p_name, int p_id, double p_rating, QString p_department)
{
this->name = p_name;
this->id = p_id;
this->rating = p_rating;
this->department = p_department;
// (int p_hour, int p_minute, int p_day, int p_month, int p_year)
DateAndTime dt1(9, 0, 21, 5, 2022);
DateAndTime dt2(10, 0, 21, 5, 2022);
DateAndTime dt3(11, 0, 21, 5, 2022);
DateAndTime dt4(12, 0, 21, 5, 2022);
DateAndTime dt5(1, 0, 21, 5, 2022);
DateAndTime dt6(2, 0, 21, 5, 2022);
DateAndTime dt7(3, 0, 21, 5, 2022);
this->timeList.push_back(dt1);
this->timeList.push_back(dt2);
this->timeList.push_back(dt3);
this->timeList.push_back(dt4);
this->timeList.push_back(dt5);
this->timeList.push_back(dt6);
this->timeList.push_back(dt7);
this->earliestDate = this->timeList.first();
}
Doctor::Doctor(QString p_name, int p_id, double p_rating, double p_fees, QString p_department)
{
this->name = p_name;
this->id = p_id;
this->rating = p_rating;
this->fees = p_fees;
this->department = p_department;
// (int p_hour, int p_minute, int p_day, int p_month, int p_year)
DateAndTime dt1(9, 0, 21, 5, 2022);
DateAndTime dt2(10, 0, 21, 5, 2022);
DateAndTime dt3(11, 0, 21, 5, 2022);
DateAndTime dt4(12, 0, 21, 5, 2022);
DateAndTime dt5(1, 0, 21, 5, 2022);
DateAndTime dt6(2, 0, 21, 5, 2022);
DateAndTime dt7(3, 0, 21, 5, 2022);
this->timeList.push_back(dt1);
this->timeList.push_back(dt2);
this->timeList.push_back(dt3);
this->timeList.push_back(dt4);
this->timeList.push_back(dt5);
this->timeList.push_back(dt6);
this->timeList.push_back(dt7);
this->earliestDate = this->timeList.first();
}
Doctor::Doctor(QString p_name, int p_id, double p_rating, DateAndTime p_earliestDate)
{
this->name = p_name;
this->id = p_id;
this->rating = p_rating;
this->earliestDate = p_earliestDate;
}
QString Doctor::getName() const
{
return this->name;
}
int Doctor::getId() const
{
return this->id;
}
double Doctor::getRating() const
{
return this->rating;
}
DateAndTime Doctor::getEarliestDate() const
{
return this->earliestDate;
}
void Doctor::setId(int p_id)
{
id = p_id;
}
void Doctor::setRating(double p_rating)
{
this->rating = p_rating;
}
void Doctor::setEarliestDate(DateAndTime p_earliestDate)
{
this->earliestDate = p_earliestDate;
}
double Doctor::showRating()
{
// ui->display->SetText("Rating: " + rating);
return 0;
}
void Doctor::requestBloodTest()
{
Laboratory BloodTest; // to be declared in mainwindow and passed as a parameter
BloodTest.test_results();
}
QString Doctor::getDepartment() const
{
return this->department;
}
void Doctor::setAddTimeList(DateAndTime dt)
{
this->timeList.push_back(dt);
}
void Doctor::setRemoveTimeList(DateAndTime dt)
{
this->timeList.removeOne(dt);
}
QVector<DateAndTime> Doctor::getTimeList() const
{
return this->timeList;
}
bool Doctor::operator==(const Doctor &d)
{
return (this->id == d.id);
}
double Doctor::getFees() const
{
return this->fees;
}
bool Doctor::approve() const
{
srand(time(NULL));
return rand() % 2;
}