Repository navigation
Expand file tree
/
Copy pathHealth_Care_System.cpp
More file actions
274 lines (224 loc) · 7 KB
/
Copy pathHealth_Care_System.cpp
File metadata and controls
274 lines (224 loc) · 7 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
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
#include<iostream>
#include<string>
using namespace std;
class Health_Care_System{
protected:
string name;
int age;
string gender;
};
class patient : public Health_Care_System{
private:
string disease;
long int phone_no;
long int patient_ID;
string Blood_group;
string time;
string Doctor_name;
public:
patient(){
cout<<"Enter Patient Name:";cin>>name;
cout<<"Enter Patient Age:";cin>>age;
cout<<"Enter Patient Gender:";cin>>gender;
cout<<"Enter Patient Blood Group:";cin>>Blood_group;
cout<<"Enter patient ID:";cin>>patient_ID;
cout<<"Enter Patient Contact Number:";cin>>phone_no;
cout<<"Enter Patient Disease:";cin>>disease;
}
//Doctor's Appointment
string Doctor_Appointment(){
cout<<"Enter Your's Doctor Name:";cin>>Doctor_name;
cout<<"Enter Appointment Time and Date:";cin>>time;
cout<<"<----------------------------------------->"<<endl;
cout<<"Patient of Doctor:"<<Doctor_name<<endl;
cout<<"Appointment of "<<this->name<<" with Doctor "<<this->Doctor_name<<" on "<<time<<endl;
cout<<"<----------------------------------------- >"<<endl;
return this->Doctor_name, this->time;
}
//Call to Ambulance Emergency
void Emergency(){
int temp;
cout<<"Enter Patient Temprature:";cin>>temp;
if (temp == 100 || temp == 101 || temp == 102 || temp == 103){
cout<<"=============================================="<<endl;
cout<<"Hurry! Call the Ambulance"<<endl;
cout<<"Call the nearest Health Care Specialist to Control the Situaition"<<endl;
cout<<"Give the Patient courage to destress him"<<endl;
cout<<"=============================================="<<endl;
}
}
//Patient information
void Patient_Info(){
cout<<"<----------------------------->"<<endl;
cout<<"\tPatient Information:"<<endl;
cout<<"<----------------------------->"<<endl;
cout<<"Patient Name_________:"<<name<<endl;
cout<<"Patient Age__________:"<<age<<endl;
cout<<"Patient Gender_______:"<<gender<<endl;
cout<<"Patient Blood Group__:"<<Blood_group<<endl;
cout<<"patient ID___________:"<<patient_ID<<endl;
cout<<"Patient Contact______:"<<phone_no<<endl;
cout<<"Patient Disease______:"<<disease<<endl;
}
};
class Pharmacy : public patient{
protected:
float Medicine_price;
float Doctor_fee;
float Sehat_card;
float Total_cost;
public:
Pharmacy(){
cout<<"Enter Medicine Price:";cin>>Medicine_price;
cout<<"Enter Doctor Fee:";cin>>Doctor_fee;
}
//Patient Expenditures calculation
float Calculator(){
cout<<"----------------------------"<<endl;
cout<<"\tPress (1) Sehat Card"<<endl;
cout<<"\tPress (2) Own Money"<<endl;
cout<<"----------------------------"<<endl;
char choose;
cout<<"Enter Your Choice :";cin>>choose;
switch(choose)
{
case '1':{
Total_cost = Medicine_price + Doctor_fee;
cout<<"Enter Sehat Card:";cin>>Sehat_card;
if (Sehat_card == 0 || Total_cost > Sehat_card){
cout<<"Your Sehat_Card is Empty";
return Sehat_card;
}
else{
Sehat_card = Sehat_card - (Medicine_price + Doctor_fee);
return Sehat_card;
}
break;
}
case '2':{
cout<<"Enter Total Money Spend:";cin>>Total_cost;
if (Sehat_card = Total_cost){
return Sehat_card = Medicine_price + Doctor_fee;
}
break;
}
default:{
cout<<"Invalid Input"<<endl;
break;
}
}
}
//pharmacy and Doctor Fee
void Pharmacy_Cost(){
cout<<"<-----Total Expenditure----->"<<endl;
cout<<"Patient Medicine Fee:"<<Medicine_price<<endl;
cout<<"Doctor's Fee:"<<Doctor_fee<<endl;
cout<<"Sehat Card Remaining Money:"<<Sehat_card<<endl;
cout<<"Total Money Spend:"<<Total_cost<<endl;
cout<<"Thank you!"<<endl;
cout<<"<--------------------------->"<<endl;
}
};
class Doctor : public Health_Care_System{ //class Doctor which is used to add
//a new doctor to the organiztion.
private:
string specialization;
long int phone_no;
string location;
long int doctor_ID;
public:
Doctor(){
cout<<"Enter Doctor Information:"<<endl;
cout<<"Enter Doctor Name__________ :";cin>>name;
cout<<"Enter Doctor Age___________ :";cin>>age;
cout<<"Enter Doctor Gender________ :";cin>>gender;
cout<<"Enter Doctor ID____________ :";cin>>doctor_ID;
cout<<"Enter Doctor Contact________:";cin>>phone_no;
cout<<"Enter Doctor Location_______:";cin>>location;
cout<<"Enter Doctor Specialization_:";cin>>specialization;
}
void Doctor_Info(){
cout<<"Doctor Information:"<<endl;
cout<<"Doctor Name__________:"<<name<<endl;
cout<<"Doctor Age___________:"<<age<<endl;
cout<<"Doctor Gender________:"<<gender<<endl;
cout<<"Doctor ID____________:"<<doctor_ID<<endl;
cout<<"Doctor Contact_______:"<<phone_no<<endl;
cout<<"Doctor Location______:"<<location<<endl;
cout<<"Doctor Specialization_:"<<specialization<<endl;
}
};
int main(){
do{ //do-while loop used to display the interface
//again if needed, otherwise press (6)-->Exit
cout<<"\t\t\t\t\t\t++++++++++++++++++++++++++++++++++++++++++"<<endl;
cout<<"\t\t\t\t\t\t\t<-----Health_Care Hospital----->"<<endl;
cout<<"\t\t\t\t\t\t++++++++++++++++++++++++++++++++++++++++++"<<endl;
cout<<"\t\t\t\t\t\t==========================================="<<endl;
cout<<"\t\t\t\t\t\t\tPress (1) Patient Admission"<<endl;
cout<<"\t\t\t\t\t\t\tPress (2) Emergency"<<endl;
cout<<"\t\t\t\t\t\t\tPress (3) Doctor's Appointment"<<endl;
cout<<"\t\t\t\t\t\t\tPress (4) New Doctor"<<endl;
cout<<"\t\t\t\t\t\t\tPress (5) Credits"<<endl;
cout<<"\t\t\t\t\t\t\tPress (6) Exit"<<endl;
cout<<"\t\t\t\t\t\t==========================================="<<endl;
int select;
cout<<"\t\t\t\t\t\tEnter Your Selection:";
cin>>select;
switch(select){
case 1:{
Pharmacy p;
p.Calculator();
p.Patient_Info();
p.Pharmacy_Cost();
break;
}
case 2:{
patient p1;
p1.Emergency();
break;
}
case 3:{
int close = 1;
cout<<"<-----Appointment Open (Only [3] Patient a Day)----->"<<endl;
for(int i = 1; i<=1; i++){
patient p2;
p2.Doctor_Appointment();
cout<<"============================"<<endl;
cout<<"Appointed"<<endl;
cout<<"============================"<<endl;
if (close == i){
cout<<"============================"<<endl;
cout<<"Today's Appointments Closed"<<endl;
cout<<"============================"<<endl;
}
}
break;
}
case 4:{
Doctor d;
d.Doctor_Info();
break;
}
case 5:{
cout<<"CREDITS TO:"<<endl;
cout<<"================================"<<endl;
cout<<"\t(1) Afaq Ahmad Khan"<<endl;
cout<<"\t(2) Muhammad Ahmar Shamim"<<endl;
cout<<"\t(3) Muhammad Ijaz"<<endl;
cout<<"================================"<<endl;
break;
}
case 6:{
exit;
break;
}
default:{
cout<<"Invalid Input"<<endl;
break;
}
}
}
while(true);
return 0;
}