-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtrabPOO.cpp
134 lines (123 loc) · 3.4 KB
/
trabPOO.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
#include <iostream>
#include "Service.h"
#include "Patient.h"
#include "Exam.h"
#include "Clinic.h"
#include "Appointment.h"
#include "Colecao.h"
using namespace std;
void PrintPatientsList(Clinic* clinic)
{
for (Patient* pa : clinic->GetPatientsList())
{
cout << "ID :" << pa->getId() << " Name: " << pa->getName() << endl;
}
}
void PrintAppointmetsHistory(int paId, Clinic* cl)
{
Colecao<Appointment*> history = cl->showAppointmentHistory(paId);
for (Appointment* app : history)
{
cout << "App_ID: " << app->getId() << " PA_ID: " << app->getPaId() << " Diagnost: " << app->getDiagnosis() << " Date: " << app->getDate() << " Cost: " << app->getCost() << endl;
}
}
void PrintMenu()
{
cout << "Welcome to Clinic Manager App\n";
cout << "Please Select from List Below\n";
cout << "1 - Add Pacient \n";
cout << "2 - Add Appointments\n";
cout << "3 - Add Exams To Appointmets\n";
cout << "4 - Show Appointmets History\n";
cout << "5 - Calculate Total Billed\n";
}
void PrintExams()
{
}
int main()
{
Clinic* clinic = new Clinic();
/*Patient* pat = new Patient("Mahmoud");
Patient* pat2 = new Patient("ahmad");
Patient* pat3 = new Patient("aeham");*/
//int id = pat->getId();
/*clinic->registerPatient("Mahmoud");
clinic->registerPatient("Ahmad");
clinic->registerPatient("Aeham");
clinic->registerAppoinmtent(new Appointment(1, "date", 10, "he is Ok!"), 1);
clinic->registerAppoinmtent(new Appointment(1, "date", 20, "he is Ok!"), 1);
clinic->registerAppoinmtent(new Appointment(1, "date", 30, "he is Ok!"), 1);
clinic->registerAppoinmtent(new Appointment(1, "date", 40, "he is Ok!"), 1);*/
//Colecao<Appointment*> history = clinic->showAppointmentHistory(id);
////Colecao<Exam*> ex;
//for (Appointment* app : history)
//{
// app->addExam(new Exam(id, 150, "Checkup", "12"));
// app->addExam(new Exam(id, 0, "Checkup", "12"));
// app->addExam(new Exam(id, 50, "Checkup", "12"));
// /*Colecao<Exam*> exams = app->getExamsList();
// for (Exam* ex : exams)
// {
// cout << "Ex ID" << " :" << ex->getId();
// }*/
//}
//cout << clinic->totalBilled(id);
//Exam* extoinsert = new Exam(10, 100, "Test", "te");
//bool res = ex.insert(extoinsert);
//cout << res;
PrintMenu();
//PrintPatientsList(clinic);
//PrintAppointmetsHistory(1, clinic);
int selected = 0;
while (selected == 0)
{
string name = "";
int Pid = 0;
string date = "";
float cost = 0;
string diagnost = "";
cin >> selected;
switch (selected)
{
case 1:
// Add Patient
cout << "Enter Pacient Name:";
cin >> name;
clinic->registerPatient(name);
cout << "Pacient Added";
selected = 0;
system("CLS");
PrintMenu();
break;
case 2:
PrintPatientsList(clinic);
cout << "\nPlease Select PID To Add Appointmets to Pacient \n";
cin >> Pid;
cout << "\nEnter Appointment Date:" << endl;
cin >> date;
cout << "\nEnter Appointment Cost:" << endl;
cin >> cost;
cout << "\nEnter Appointment Diagnost:" << endl;
cin >> diagnost;
clinic->registerAppoinmtent(new Appointment(0, date, cost, diagnost), Pid);
cout << "\nAppointment Added !";
selected = 0;
system("CLS");
PrintMenu();
break;
case 3:
PrintPatientsList(clinic);
cout << "\nPlease Select PID to Show Appontments \n";
cin >> Pid;
PrintAppointmetsHistory(Pid, clinic);
cout << "\nPlease Select ID to Add Exams \n";
break;
default:
selected = 0;
system("CLS");
PrintMenu();
break;
}
}
return 0;
}