Sei sulla pagina 1di 69

Bulacan State University

College of Information and Communications Technology


City of Malolos, Bulacan

Final Requirement in IT 103


Computer Programming 1

Submitted by:

Team Leader:

Moraga, Mark Henry G.

Members:

Jose, Frances Claire V.


Ochoa, Kyle Emmanuel F.
Pagaduan, Giselle Joy L.
Sarte, Mariella Sophia S.

BSIT – 1KG2

Submitted to:

Ms. Jennylyn L. Aniag


Subject Instructor

Date:
December 13, 2019
I. Introduction

Hospitals are essential parts of people’s lives, to provide the best medical condition to
people suffering from various ailments. It is important for the hospitals to keep track of its day-
to-day activities and records that the hospitals encounter from its patients, doctors, and also the
staffs that help run the hospitals.

Hospital management has modified over the last decades. Business expertise, trendy
technologies, connected devices, mobile apps, and information of healthcare are key are the
important factors for the implementation of hospital management system project. The number of
healthcare providers has increased and also the patients have a large alternative of medical
alternative. The application of Hospital Management System project it provides the
establishment with different advantages that improve the service quality and efficiency of the
hospitals. The essence of the hospital management system is the arrangement of necessary
information, to have a precise and appropriate data, and by the help of hospital management
system it should ensure the system work and can be accessed anytime. With the help of the
Information Technology system, it has become possible to digitalize every records of a hospital.
The creators of this program have made their own version of a hospital management system
code written and compiled in C++. This program contains the list of details of the different types
of patients such as they names, blood types, contact numbers, and such.
The Hospital Record Management program, at the start of its execution will first and
foremost ask the user to login (The default username is Admin and the default password is also
Admin). The user must login correctly within the first three attempts and failure to do so will
cause the program to terminate abruptly. If the login is done successfully, the program will
display the selection menu and will prompt the user to input a letter that corresponds to the
choice of function (Note that entering other inputs aside from the given choices will lead to the
program prompting the user once again to insert a working input). Under the menu lies the
following functions and the tasks that they contain:

Add Patient Information - Personal information and the health information of the patient.

Add Doctor Information - Personal information and the specialization of the doctor.

Add Employee Information - Personal information and the position of the employee.

Search Information - Complete records of all patients and personnels.

Update Information – It updates the existing information.

Delete Record - Deletion of a record.

Log out - Logs the user out.

Exit - Exits the program.

Each and one of these can be accessed after a completion of any of these functions
(aside from the log out and exit functions) All data inputted in the program will be saved and can
be accessed in future times.
II. Major Functions of the System and its Description

Log in

The log in function prompts the user to input his/her account username and password
and if inputted correctly, the program will go to menu but if inputted incorrectly, the program will
ask the user again to login and if failed three times, the program will terminate. A while loop and
if else statements were used to create this feature.

Add Patient Information

This function allows the user to create a new patient ID, along with the patient's
information such as name, age, sex, and such. If else statement, switch, boolean, array, goto
and ofstream was used in this feature.

Add Doctor Information

This function allows the user to create a new doctor ID, along with the doctor's
information such name, age, sex, height, specialization, and such. If else statement, switch,
boolean, goto, array and ofstream were utilized to create this feature.

Add Employee Information

This function is similar to the previous two; the only difference is that it is for employees' data. If
else statement, switch, boolean, goto, array and ofstream functions was used in this feature.

Search Information

This function prompts the user to input the ID of the individual that they want to check
upon. After entering a correct ID, the program then displays all the information that is inputted
on that individual. If else statement, ifstream and while loop was utilized in this feature.

Update Information

This function allows the user to update the existing information in the program. If else
statement, boolean, switch, array, goto and for loop statement were utilized to accomplish this
feature.

Delete Record

This function allows the user to delete an entire patient/doctor/employee's record by


inputting the ID of that individual. This effectively erases all the inputted information about that
individual from the program. If else statement, remove function and ifstream were used to create
this feature.

Log out

This feature allows the user to log out of his/her account and log in on another account if
so desired.

Exit

This feature is used to terminate the entire program. This can be located on the menu
right after the log in screen. An abort function was utilized to create this feature.
III. Screen Shots (UI Design)

I. Login and welcome screen


II. Selection Screen
III. Add Patient Information
IV. Add Doctor Information
V. Add Employee Information
VI. Search Information
VII. Update Information
VIII. Delete Record
IX. Log out
X. Exit
IV. Conclusion and Recommendations

Modern technology requires continuous innovation, and as the world perpetually


ameliorates, our need to cope up also continues. Different businesses and organizations
already maximize the use of technology, and one example of it is in the medical field. Hospitals
deal with large data that they need in order to capacitate every requisite of their patients. The
Hospital Management System that the amateur programmers of BSIT 1K-G2 did is an example
of an innovation that hospitals use to accomplish their tasks easily. Developing this system is a
great opportunity to create the distinct, efficient and fast delivering health care model. It helps to
store all kinds of records, administer coordination and user communication, implement
regulations, improvise everyday operations, and market hospital services. It benefits the needs
of patients, staff and hospital authorities and simplifies their tasks.

The creators of this program have a few recommendations for the future programmers
that aspire the continuation and further sophistication of this Hospital Management System
program. The following aspects of this program still have places for improvement and these
aspects can become the focus of modification:

1. User Interface – The user interface of this program is based only on the limited knowledge
and information of the creators of this program, therefore resulting to a much simpler design.
The future programmers are encouraged to expand their knowledge base in order to create a
more enticing and user-friendly user interface that can appeal to both teenagers and senior
citizens.

2. Timeframe – The creators of this program are limited only to a short amount of time to finish
the said program. Lengthening the amount of time intended for the creation of a program might
induce better overall functions and aspects of the management system.

3. Functionality – The functions of the program are only limited to the details of the patients
and such. The addition of internet access for this program allows for multiple users to use the
program and also it enables the storing of the data that users input in the program to a cloud
storage. This lessens the risk of losing the data in unintentional reasons.

4. Implementation of system generated ID number.

5. Possibility of searching using variables such as names, location, sex, age and related
diseases to be able to retrieve information easily.

6. A feature to edit only certain information such as name, age, sex or address to avoid rewriting
the whole data.

7. A feature to create multiple accounts that have access to data that is appropriate to the user
such as a doctor being able to view his/her patients' information for better diagnosis.

8. A feature for the validation of room designation. The programmers needed to ensure that
there will be no overlapping in terms of accommodation in day and time of consultation.

9. A feature to delete records because in order to delete a file in the program, the user must
close the system first and this creates inefficiency as when an obvious error occurs in the
middle of the inputs, in order to be user-friendly, the program must have a function to be able to
edit. Delete it within the same frame.
V. Source Code

#include <iostream>
#include <string>
#include <fstream>
#include<stdio.h>
#include <cstdio>
#include<stdlib.h>
#include<conio.h>
#include<iomanip>

using namespace std;


void UpdateRecord();
void WelcomeScreen();
void TitleHeader();
void Selection();
void DeleteRecord();
void AddPatientInformation();
void SearchPatient();
void AddDoctorInformation();
void LogIn();
void AddEmployeeInformation();
void Selection()
{
TryAgain:
system("cls");
TitleHeader();
char choice;
cout << "\t\t\t\t\t[A] Add Patient Information\n" << endl;
cout <<"\t\t\t\t\t[B] Add Doctor Information\n" << endl;
cout <<"\t\t\t\t\t[C] Add Employee Information\n" << endl;
cout << "\t\t\t\t\t[D] Search Information\n" << endl;
cout << "\t\t\t\t\t[E] Update Information\n" << endl;
cout <<"\t\t\t\t\t[F] Delete Record\n" << endl;
cout <<"\t\t\t\t\t[G] Log Out\n" << endl;
cout <<"\t\t\t\t\t[H] Exit\n"<<endl;
cout<<"\t\t\t\t\tSelect Action:\t";
cin >> choice;
system("cls");
switch (choice){
case 'A':
AddPatientInformation();
break;
case 'B':
AddDoctorInformation();
break;
case 'C':
AddEmployeeInformation();
break;
case 'D':
SearchPatient();
break;
case 'E':
UpdateRecord();
break;
case'F':
DeleteRecord();
break;
case 'G':
TitleHeader();
cout<<"\t\t\t\t\tLogging out... Please wait...\n";
cout<<"\t\t\t\t\tLogged out.\n";
cout<<"\n\t\t\t\t\t"<<system("pause");
system("cls");
LogIn();
Selection();
break;
case 'H':
TitleHeader();
cout <<"\t\t\t\t\tClosing Application... Please wait."<<endl;
abort();
break;
default:
TitleHeader();
cout<<"\t\t\t\t\tIncorrect input. Press any key to go back to selection!";
cout<<"\n\t\t\t\t\t"<<system("pause");
goto TryAgain;

}
}
int main()
{
system("mode 650");
system("Color F9");
LogIn();
Selection();
return 0;
}
void AddPatientInformation()
{
TitleHeader();
int int_date, int_year;
long int PatientNumber;
char SelectMonth, SpecializationSelection,SelectionBloodType, Age[99], Year[4], date[2], temp;
double Height, Weight;
string ContactNumber,BloodType, Vaccination, Month, PatientID, CurrentMedications,Allergies, str_age;
string FirstName,MiddleName,LastName,Sex,Location, Doctor, Specialization,Concern,PrescribedMedicine;
bool SexValid=false;
cout<<"\n\t\t\t\t\tCreate Patient ID (ex. 100001)"<<endl;
TryAgainPatientID:
cout<<"\n\t\t\t\t\tPatient ID:\t\t";
cin>>PatientID;
PatientNumber = atol(PatientID.c_str());
if (ifstream(PatientID.c_str())){cout<<"\n\t\t\t\t\tFile already exist! Enter another name."<<endl;
goto TryAgainPatientID;
}
if ((PatientNumber>=100000)&&(PatientNumber<=199999)){cout<<"\n\t\t\t\t\tCreated successfully!";}
else{cout<<"\n\t\t\t\t\tInvalid Patient ID! Try Again!\n";
goto TryAgainPatientID;}
ofstream Data;
Data.open(PatientID.c_str());
if (Data.is_open())
{cout<<"\n\t\t\t\t\t--Patient Information--\n"<<endl;
cout<<"\n\t\t\t\t\tLast Name:\t\t";
getline(cin >> ws, LastName);
cout<<"\n\t\t\t\t\tFirst Name:\t\t";
getline(cin, FirstName);
cout<<"\n\t\t\t\t\tMiddle Name:\t\t";
getline(cin, MiddleName);
cout<<"\n\t\t\t\t\tAge:\t\t\t";
for (int i = 0;;)
{
temp = getch();

if (temp >= '0' and temp <= '9')


{
Age[i] = temp;
++i;
cout << temp;
}
if (temp == '\b' and i >= 1)
{
cout << "\b \b";
--i;
}
if (temp == '\r' and i > 0)
{
Age[i] = '\0';
break;
}
}
string str_age = Age;
cout<<"\n\n\t\t\t\t\tBirthday\n";
cout<<"\n\t\t\t\t\tMonth\n";
cout<<"\n\t\t\t\t\t[A] Jan \t\t[E] May\t\t[I] Sep\n";
cout<<"\n\t\t\t\t\t[B] Feb \t\t[F] Jun\t\t[J] Oct\n";
cout<<"\n\t\t\t\t\t[C] Mar \t\t[G] Jul\t\t[K] Nov\n";
cout<<"\n\t\t\t\t\t[E] Apr \t\t[H] Aug\t\t[L] Dec\n";
TryAgainMonth:
cout<<"\n\t\t\t\t\tSelect Month:\t\t";
cin>>SelectMonth;
switch (SelectMonth){
case 'A':
Month="January";
break;
case 'B':
Month="February";
break;
case 'C':
Month="March";
break;
case 'D':
Month="April";
break;
case 'E':
Month="May";
break;
case 'F':
Month="June";
break;
case 'G':
Month="July";
break;
case 'H':
Month="August";
break;
case 'I':
Month="September";
break;
case 'J':
Month="October";
break;
case 'K':
Month="November";
break;
case 'L':
Month="December";
break;
default:{cout<<"\n\t\t\t\t\tInvalid Input!";
goto TryAgainMonth;
break;}
}
TryAgainDate:
cout<<"\n\t\t\t\t\tDate:\t\t\t";
for (int i = 0; i < 3;)
{
temp = getch();

if ((temp >= '0') and (temp <= '9'))


{
date[i] = temp;
++i;
cout << temp;
}
if (temp == '\b' and i >= 1)
{
cout << "\b \b";
--i;
}
if (temp == '\r')
{
date[i] = '\0';
break;
}
if (i == 3)
{
goto TryAgainDate;
}
}
string str_date = date;
int_date = atol(str_date.c_str());
if ((int_date<1) || (int_date>31)){
cout<<"\n\t\t\t\t\tInvalid Date!";
goto TryAgainDate;
}
TryAgainYear:
cout<<"\n\n\t\t\t\t\tYear:\t\t\t";
for (int i = 0; i < 5;)
{
temp = getch();

if ((temp >= '0') and (temp <= '9'))


{
Year[i] = temp;
++i;
cout << temp;
}
if (temp == '\b' and i >= 1)
{
cout << "\b \b";
--i;
}
if (temp == '\r')
{
Year[i] = '\0';
break;
}
if (i == 5)
{
goto TryAgainYear;
}
}
cin.ignore();
string str_year = Year;
int_year = atol(str_year.c_str());
if ((int_year<1900) or (int_year>2019)){
cout<<"\n\t\t\t\t\tInvalid Year!";
goto TryAgainYear;
}
cout<<"\n\n\t\t\t\t\tSex:\t";
cout<<"\n\t\t\t\t\t[M] Male\t\t[F] Female"<<endl;
cout<<"\n\t\t\t\t\tChoose sex:\t\t";
do {
getline(cin, Sex);
SexValid =((Sex== "M") || (Sex== "F"));
if (SexValid)
{break;}
else {cout << "\n\t\t\t\t\tInvalid input";
cout<<"\n\t\t\t\t\tChoose sex:\t\t";}
} while (!SexValid);
cout<<"\n\t\t\t\t\tLocation:\t\t";
getline(cin, Location);
cout<<"\n\t\t\t\t\tContact Number:\t\t";
getline(cin, ContactNumber);
cout<<"\n\t\t\t\t\tHeight (cm):\t\t";
cin>>Height;
cout<<"\n\t\t\t\t\tWeight (kg):\t\t";
cin>>Weight;
cout<<"\n\t\t\t\t\tBlood Type\n";
cout<<"\n\t\t\t\t\t[A] A+ [E] AB+\n";
cout<<"\n\t\t\t\t\t[B] A- [F] AB-\n";
cout<<"\n\t\t\t\t\t[C] B+ [G] O+\n";
cout<<"\n\t\t\t\t\t[D] B- [H] O-\n";
TryAgainBloodType:
cout<<"\n\t\t\t\t\tBlood Type:\t\t";
cin>> SelectionBloodType;
cin.ignore();
switch (SelectionBloodType){
case 'A':
BloodType="A+";
break;
case 'B':
BloodType="A-";
break;
case 'C':
BloodType="B+";
break;
case 'D':
BloodType="B-";
break;
case 'E':
BloodType="AB+";
break;
case 'F':
BloodType="AB-";
break;
case 'G':
BloodType="O+";
break;
case 'H':
BloodType="O-";
break;
default :
cout<<"\n\t\t\t\t\tIncorrect Blood Type! Try Again!\n";
goto TryAgainBloodType;
break;}
cout<<"\n\t\t\t\t\tCurrent Medication:\t";
getline(cin, CurrentMedications);
cout<<"\n\t\t\t\t\tAllergies:\t\t";
getline(cin, Allergies);
cout<<"\n\t\t\t\t\tVaccinations:\t\t";
getline(cin, Vaccination);
cout<<"\n\t\t\t\t\tConcern:\t\t";
getline(cin, Concern);
cout<<"\n\t\t\t\t\tPrescribed Medicine:\t";
getline(cin, PrescribedMedicine);
cout<<"\n\t\t\t\t\tDoctor:\t\t\t";
getline(cin, Doctor);
cout<<"\n\t\t\t\t\tSpecialization:\t"<<endl;
cout<<"\n\t\t\t\t\t[A] Pediatrics\t\t\t[F] Obstetrics \t\t\t[K] Ophthalmology"<<endl;
cout<<"\n\t\t\t\t\t[B] General Practice\t\t[G] Psychiatry \t\t\t[L] Ear, Nose, and Throat"<<endl;
cout<<"\n\t\t\t\t\t[C] Internal Medicine\t\t[H] Neurology \t\t\t[M] Urology"<<endl;
cout<<"\n\t\t\t\t\t[D] Cardiology\t\t\t[I] Orthopedics \t\t[N] Pulmonology"<<endl;
cout<<"\n\t\t\t\t\t[E] Surgeon\t\t\t[J] Dermatology\t\t\t[O] Endocrinology"<<endl;
TryAgainDepartment:
cout<<"\n\t\t\t\t\tSelect specialization:\t";
cin>>SpecializationSelection;
switch(SpecializationSelection){
case 'A':
Specialization="Pediatrics";
break;
case 'B':
Specialization="General Practice";
break;
case 'C':
Specialization="Internal Medicine";
break;
case 'D':
Specialization="Cardiology";
break;
case 'E':
Specialization="Surgery";
break;
case 'F':
Specialization="Obstetrics";
break;
case 'G':
Specialization="Psychiatry";
break;
case 'H':
Specialization="Neurology";
break;
case 'I':
Specialization="Orthopedics";
break;
case 'J':
Specialization="Dermatology";
break;
case 'K':
Specialization="Ophthalmology";
break;
case 'L':
Specialization="Ear, Nose, and Throat";
break;
case 'M':
Specialization="Urology";
break;
case 'N':
Specialization="Pulmonology";
break;
case 'O':
Specialization="Endocrinology";
break;
default :
cout<<"\n\t\t\t\t\tIncorrect Department!\n";
cout<<"\n\t\t\t\t\tTry Again!\n";
goto TryAgainDepartment;
break;}
Data <<"\n\n\t\t\t\t\t--Personal Information--\n"<<"\n\t\t\t\t\tLast Name:\t\t" <<LastName <<"\n\t\t\t\t\tFirst
Name:\t\t" <<FirstName << "\n\t\t\t\t\tMiddle Name:\t\t" << MiddleName << "\n\t\t\t\t\tAge:\t\t\t" << str_age
<< "\n\t\t\t\t\tBirthday:\t\t" <<Month<<" "<<str_date<<", "<< str_year <<"\n\t\t\t\t\tSex:\t\t\t" << Sex <<
"\n\t\t\t\t\tLocation:\t\t" << Location << "\n\t\t\t\t\tContact Number:\t\t" << ContactNumber <<"\n\n\t\t\t\t\t--
Body Information--\n"<<"\n\t\t\t\t\tHeight:\t\t\t" <<Height<<" cm"<< "\n\t\t\t\t\tWeight:\t\t\t" <<Weight <<"
kg" << "\n\t\t\t\t\tBlood Type:\t\t" << BloodType << "\n\t\t\t\t\tCurrent Medication:\t" << CurrentMedications <<
"\n\t\t\t\t\tAllergies:\t\t" << Allergies <<"\n\t\t\t\t\tVaccination:\t\t" << Vaccination<< "\n\n\t\t\t\t\t--Diagnosis
and Doctor Information--\n"<<"\n\t\t\t\t\tConcern:\t\t" << Concern << "\n\t\t\t\t\tPrescribed Medicine:\t" <<
PrescribedMedicine << "\n\t\t\t\t\tDoctor:\t\t\t" << Doctor << "\n\t\t\t\t\tSpecialization:\t\t" << Specialization <<
endl;
Data.close();
cout<<"\n\t\t\t\t\tSuccessfully Recorded!\n";
system("pause");
Selection();}
else {cout<<"\n\t\t\t\t\tError";}
main();
}
void SearchPatient()
{
TitleHeader();

cout<<"\n\t\t\t\t\t\t\t \t\t\t.-------------.";
cout<<"\n\t\t\t\t\t\t\t \t\t\t| Information |";
cout<<"\n\t\t\t\t\t\t\t \t\t\t'-------------'";
string getcontent, InformationID;
cout<<"\n\t\t\t\t\tSearch Information:\t";
cin>>InformationID;
ifstream Data (InformationID.c_str());
if(Data.is_open())
{
while(Data)
{
getline(Data, getcontent);
cout <<getcontent << endl;
}
cout<<"\t\t\t\t\t---------------------------------------END OF REPORT-----------------------------------------\n\n";
}
else {cout<<"\n\t\t\t\t\tData does not exist.";}
cout<<"\n\t\t\t\t\t"<<system("pause");
Selection();
}
void LogIn()
{
string userName;
string userPassword;
int loginAttempt = 3;

while (loginAttempt > 0)


{
WelcomeScreen();
cout << "\t\t\t\t\tLog In"<<endl;
cout << "\n\t\t\t\t\tYou only have three (3) attempts "<< endl;
cout <<"\n\t\t\t\t\t"<< loginAttempt<<" remaining."<< endl;
cout << "\n\t\t\t\t\tUsername: ";
cin >> userName;
cout << "\n\t\t\t\t\tPassword: ";
cin >> userPassword;

if (userName == "Admin" && userPassword == "Admin")


{
system("cls");
TitleHeader();
cout << "\n\t\t\t\t\tWelcome Admin!\n";
break;
}
else
{
cout << "\n\t\t\t\t\tInvalid login attempt. Please try again.\n" << '\n';

loginAttempt--;
cout<<"\n\t\t\t\t\t"<<system("pause");
system("cls");
}
}
if (loginAttempt == 0)
{
WelcomeScreen();
cout << "\t You have reach the limit of log in attempt. Please try again later.\n";
cout << "\t\t\t\t\t\t\t\t The program will now terminate.";
abort();
}

cout << "\t\t\t\t\tThank you for logging in.\n";


cout<<"\n\t\t\t\t\t"<<system("pause");
}
void AddEmployeeInformation()
{
int int_year, int_date;
long int EmployeeNumber;
char SelectMonth, DepartmentSelection, OfficeSelection, Age[99], temp, Year[4], date[2];
string ContactNumber, EmployeeID, SelectionServices,Month,str_age;
string FirstName,MiddleName,LastName,Sex,Location, Department, Position, Office;
bool SexValid=false;
TitleHeader();
cout<<"\n\t\t\t\t\tCreate Employee ID (ex. 300001)"<<endl;
TryAgainEmployeeID:
cout<<"\n\t\t\t\t\tEmployee ID:\t";
cin>>EmployeeID;
EmployeeNumber = atol(EmployeeID.c_str());
if (ifstream(EmployeeID.c_str())){cout<<"\n\t\t\t\t\tFile already exist! Enter another name."<<endl;
goto TryAgainEmployeeID;
}
if ((EmployeeNumber>=300000)&&(EmployeeNumber<=399999)){cout<<"\n\t\t\t\t\tCreated successfully!";}
else{cout<<"\n\t\t\t\t\tInvalid Employee ID! Try Again!";
goto TryAgainEmployeeID;}
ofstream EmployeeData;
EmployeeData.open(EmployeeID.c_str());
if (EmployeeData.is_open())
{cout<<"\n\t\t\t\t\t--Employee Information--\n"<<endl;
cout << "\n\t\t\t\t\tPersonal Information\n"<<endl;
cout<<"\n\t\t\t\t\tLast Name:\t\t";
getline(cin >> ws, LastName);
cout<<"\n\t\t\t\t\tFirst Name:\t\t";
getline(cin, FirstName);
cout<<"\n\t\t\t\t\tMiddle Name:\t\t";
getline(cin, MiddleName);
cout<<"\n\t\t\t\t\tAge:\t\t\t";
for (int i = 0;;)
{
temp = getch();

if (temp >= '0' and temp <= '9')


{
Age[i] = temp;
++i;
cout << temp;
}
if (temp == '\b' and i >= 1)
{
cout << "\b \b";
--i;
}
if (temp == '\r' and i > 0)
{
Age[i] = '\0';
break;
}
}
string str_age = Age;
cout<<"\n\n\t\t\t\t\tBirthday\n";
cout<<"\n\t\t\t\t\tMonth\n";
cout<<"\n\t\t\t\t\t[A] Jan \t\t[E] May\t\t[I] Sep\n";
cout<<"\n\t\t\t\t\t[B] Feb \t\t[F] Jun\t\t[J] Oct\n";
cout<<"\n\t\t\t\t\t[C] Mar \t\t[G] Jul\t\t[K] Nov\n";
cout<<"\n\t\t\t\t\t[E] Apr \t\t[H] Aug\t\t[L] Dec\n";
TryAgainMonth:
cout<<"\n\t\t\t\t\tSelect Month:\t\t";
cin>>SelectMonth;
switch (SelectMonth){
case 'A':
Month="January";
break;
case 'B':
Month="February";
break;
case 'C':
Month="March";
break;
case 'D':
Month="April";
break;
case 'E':
Month="May";
break;
case 'F':
Month="June";
break;
case 'G':
Month="July";
break;
case 'H':
Month="August";
break;
case 'I':
Month="September";
break;
case 'J':
Month="October";
break;
case 'K':
Month="November";
break;
case 'L':
Month="December";
break;
default:{cout<<"\n\t\t\t\t\tInvalid Input!";
goto TryAgainMonth;
break;}
}
TryAgainDate:
cout<<"\n\t\t\t\t\tDate:\t\t\t";
for (int i = 0; i < 3;)
{
temp = getch();

if ((temp >= '0') and (temp <= '9'))


{
date[i] = temp;
++i;
cout << temp;
}
if (temp == '\b' and i >= 1)
{
cout << "\b \b";
--i;
}
if (temp == '\r')
{
date[i] = '\0';
break;
}
if (i == 3)
{
goto TryAgainDate;
}
}
string str_date = date;
int_date = atol(str_date.c_str());
if ((int_date<1) || (int_date>31)){
cout<<"\n\t\t\t\t\tInvalid Date!";
goto TryAgainDate;
}
TryAgainYear:
cout<<"\n\n\t\t\t\t\tYear:\t\t\t";
for (int i = 0; i < 5;)
{
temp = getch();

if ((temp >= '0') and (temp <= '9'))


{
Year[i] = temp;
++i;
cout << temp;
}
if (temp == '\b' and i >= 1)
{
cout << "\b \b";
--i;
}
if (temp == '\r')
{
Year[i] = '\0';
break;
}
if (i == 5)
{
goto TryAgainYear;
}
}
cin.ignore();
string str_year = Year;
int_year = atol(str_year.c_str());
if ((int_year<1900) or (int_year>2019)){
cout<<"\n\t\t\t\t\tInvalid Year!";
goto TryAgainYear;
}
cout<<"\n\n\t\t\t\t\tSex\n";
cout<<"\n\t\t\t\t\t[M] Male\t\t[F] Female"<<endl;
cout<<"\n\t\t\t\t\tChoose sex:\t\t";
do {
getline(cin, Sex);
SexValid =((Sex== "M") || (Sex== "F"));
if (SexValid)
{break;}
else {cout << "\n\t\t\t\t\tInvalid input";
cout<<"\n\t\t\t\t\tChoose sex:\t\t";}
} while (!SexValid);
cout<<"\n\t\t\t\t\tLocation:\t\t";
getline(cin, Location);
cout<<"\n\t\t\t\t\tContact Number:\t\t";
getline(cin, ContactNumber);
cout<< "\n\t\t\t\t\tWork Information\n"<< endl;
cout<<"\n\t\t\t\t\tDepartment:\t"<<endl;
cout<<"\n\t\t\t\t\t[A] Administrative"<<endl;
cout<<"\n\t\t\t\t\t[B] Information Department"<<endl;
cout<<"\n\t\t\t\t\t[C] Therapeutic Department"<<endl;
cout<<"\n\t\t\t\t\t[D] Diagnostic Department"<<endl;
cout<<"\n\t\t\t\t\t[E] Support Department"<<endl;
TryAgainDepartment:
cout<<"\n\t\t\t\t\tSelect Department:\t";
cin >> DepartmentSelection;
switch (DepartmentSelection)
{
case 'A':
Department = "Administratrative";
Office = "Office of the Administrator";
cout<<"\n\t\t\t\t\tADMINISTRATIVE DEPARTMENT\n";
cout<< "\n\t\t\t\t\tEnter position: \t";
getline(cin>>ws, Position);
break;
case 'B':
Department = "Information";
cout <<"\n\t\t\t\t\tINFORMATION DEPARTMENT\n";
cout<< "\n\t\t\t\t\tOffice\n";
cout<<"\n\t\t\t\t\t[A] Admission"<<endl;
cout<<"\n\t\t\t\t\t[B] Billing and Collection"<<endl;
cout<<"\n\t\t\t\t\t[C] Health Education"<<endl;
cout<<"\n\t\t\t\t\t[D] Medical Records"<<endl;
cout<<"\n\t\t\t\t\t[E] Management Information System"<<endl;
cout<<"\n\t\t\t\t\t[F] Human Resource"<<endl;
TryAgainOfficeInformation:
cout<<"\n\t\t\t\t\tSelect Office:\t\t";
cin>>OfficeSelection;
switch (OfficeSelection)
{
case 'A':
Office = "Admission";
cout << "\n\t\t\t\t\tAdmission Office";;
cout <<"\n\t\t\t\t\tEnter Company Position:\t";
getline(cin>>ws, Position);
break;
case 'B':
Office = "Billing and Collection";
cout << "\n\t\t\t\t\tBilling and Collection Office";
cout <<"\n\t\t\t\t\tEnter Company Position:\t";
getline(cin>>ws, Position);
break;
case 'C':
Office = "Health Education";
cout << "\n\t\t\t\t\tHealth Education Office";
cout <<"\n\t\t\t\t\tEnter Company Position:\t";
getline(cin>>ws, Position);
break;
case 'D':
Office = "Medical Records";
cout << "\n\t\t\t\t\tMedical Records Offices";
cout <<"\n\t\t\t\t\tEnter Company Position:\t";
getline(cin>>ws, Position);
break;
case 'E':
Office = "Management Information System";
cout << "\n\t\t\t\t\tManagement Information System Office";
cout <<"\n\t\t\t\t\tEnter Company Position:\t";
getline(cin>>ws, Position);
break;
case 'F':
Office = "Human Resource";
cout << "\n\t\t\t\t\tHuman Resource Office";
cout <<"\n\t\t\t\t\tEnter Company Position:\t";
getline(cin>>ws, Position);
break;
default: cout<< "\n\t\t\t\t\tInvalid input!";
goto TryAgainOfficeInformation;
break;
}
break;
case 'C':
Department = "Therapeutic";
cout <<"\n\t\t\t\t\tTHERAPEUTIC DEPARTMENT\n";
cout<< "\n\t\t\t\t\tOffice\n";
cout<<"\n\t\t\t\t\t[A] Physical Therapy"<<endl;
cout<<"\n\t\t\t\t\t[B] Occupational Therapy"<<endl;
cout<<"\n\t\t\t\t\t[C] Language Pathology"<<endl;
cout<<"\n\t\t\t\t\t[D] Respiratory Therapy"<<endl;
cout<<"\n\t\t\t\t\t[E] Medical Psychology"<<endl;
cout<<"\n\t\t\t\t\t[F] Social Services"<<endl;
cout<<"\n\t\t\t\t\t[G] Pharmacy"<<endl;
cout<<"\n\t\t\t\t\t[H] Dietary"<<endl;
cout<<"\n\t\t\t\t\t[I] Nursing"<<endl;
TryAgainOfficeTherapeutic:
cout<<"\n\t\t\t\t\tSelect Office:\t\t";
cin>>OfficeSelection;
switch (OfficeSelection)
{
case 'A':
Office = "Physical Therapy";
cout << "\n\t\t\t\t\tPhysical Therapy Office";
cout <<"\n\t\t\t\t\tEnter Company Position:\t";
getline(cin>>ws, Position);
break;
case 'B':
Office = "Occupational Therapy";
cout << "\n\t\t\t\t\tOccupational Therapy Office";
cout <<"\n\t\t\t\t\tEnter Company Position:\t";
getline(cin>>ws, Position);
break;
case 'C':
Office = "Language Pathology";
cout << "\n\t\t\t\t\tLanguage Pathology Office";
cout <<"\n\t\t\t\t\tEnter Company Position:\t";
getline(cin>>ws, Position);
break;
case 'D':
Office = "Respiratory Therapy";
cout << "\n\t\t\t\t\tRespiratory Therapy Office";
cout <<"\n\t\t\t\t\tEnter Company Position:\t";
getline(cin>>ws, Position);
break;
case 'E':
Office = "Medical Psychology";
cout << "\n\t\t\t\t\tMedical Psychology Office";
cout <<"\n\t\t\t\t\tEnter Company Position:\t";
getline(cin>>ws, Position);
break;
case 'F':
Office = "Social Services";
cout << "\n\t\t\t\t\tSocial Services Office";
cout <<"\n\t\t\t\t\tEnter Company Position:\t";
getline(cin>>ws, Position);
break;
case 'G':
Office = "Pharmacy";
cout << "\n\t\t\t\t\tPharmacy Office";
cout <<"\n\t\t\t\t\tEnter Company Position:\t";
getline(cin>>ws, Position);
break;
case 'H':
Office = "Dietary";
cout << "\n\t\t\t\t\tDietary Office";
cout <<"\n\t\t\t\t\tEnter Company Position:\t";
getline(cin>>ws, Position);
break;
case 'I':
Office = "Nursing";
cout << "\n\t\t\t\t\tNursing Office";
cout <<"\n\t\t\t\t\tEnter Company Position:\t";
getline(cin>>ws, Position);
break;
default: cout<< "\n\t\t\t\t\tInvalid input!";
goto TryAgainOfficeTherapeutic;
break;
}
break;
case 'D':
Department = "Diagnostic";
cout <<"\n\t\t\t\t\tDIAGNOSTIC DEPARTMENT\n";
cout<< "\n\t\t\t\t\tOffice\n";
cout<<"\n\t\t\t\t\t[A] Medical Laboratory"<<endl;
cout<<"\n\t\t\t\t\t[B] Radiology"<<endl;
cout<<"\n\t\t\t\t\t[C] Emergency Medicine"<<endl;
TryAgainOfficeDiagnostic:
cout<<"\n\t\t\t\t\tSelect Office:\t\t";
cin>>OfficeSelection;
switch (OfficeSelection)
{
case 'A':
Office = "Medical Laboratory";
cout << "\n\t\t\t\t\tMedical Laboratory Office";;
cout <<"\n\t\t\t\t\tEnter Company Position:\t";
getline(cin>>ws, Position);
break;
case 'B':
Office = "Radiology";
cout << "\n\t\t\t\t\tRadiology Office";
cout <<"\n\t\t\t\t\tEnter Company Position:\t";
getline(cin>>ws, Position);
break;
case 'C':
Office = "Emergency Medicine";
cout << "\n\t\t\t\t\tEmergency Medicine Office";
cout <<"\n\t\t\t\t\tEnter Company Position:\t";
getline(cin>>ws, Position);
break;
default: cout<< "\n\t\t\t\t\tInvalid input!";
goto TryAgainOfficeDiagnostic;
break;
}
break;
case 'E':
Department = "Support";
cout <<"\n\t\t\t\t\tSUPPORT DEPARTMENT\n";
cout<< "\n\t\t\t\t\tOffice\n";
cout<<"\n\t\t\t\t\t[A] Central Supply"<<endl;
cout<<"\n\t\t\t\t\t[B] Biomedical Technology"<<endl;
cout<<"\n\t\t\t\t\t[C] Housekeeping and Maintenance"<<endl;
TryAgainOfficeSupport:
cout<<"\n\t\t\t\t\tSelect Office:\t\t";
cin>>OfficeSelection;
switch (OfficeSelection)
{
case 'A':
Office = "Central Supply";
cout << "\n\t\t\t\t\tCentral Supply Office";;
cout <<"\n\t\t\t\t\tEnter Company Position:\t";
getline(cin>>ws, Position);
break;
case 'B':
Office = "Biomedical Technology";
cout << "\n\t\t\t\t\tBiomedical Technology Office";
cout <<"\n\t\t\t\t\tEnter Company Position:\t";
getline(cin>>ws, Position);
break;
case 'C':
Office = "Housekeeping and Maintenance";
cout << "\n\t\t\t\t\tHousekeeping and Maintenance Office";
cout <<"\n\t\t\t\t\tEnter Company Position:\t";
getline(cin>>ws, Position);
break;
default: cout<< "\n\t\t\t\t\tInvalid input!";
goto TryAgainOfficeSupport;
break;
}
break;
default:
cout << "\n\t\t\t\t\tInvalid Input!";
goto TryAgainDepartment;
break;
}
EmployeeData<<"\n\t\t\t\t\t--Personal Information--\n"<<"\n\t\t\t\t\tLast Name:\t\t" <<LastName
<<"\n\t\t\t\t\tFirst Name:\t\t" <<FirstName << "\n\t\t\t\t\tMiddle Name:\t\t" << MiddleName <<
"\n\t\t\t\t\tAge:\t\t\t" << str_age << "\n\t\t\t\t\tBirthday:\t\t" <<Month<<" "<<str_date<<", "<<str_year <<
"\n\t\t\t\t\tSex:\t\t\t" << Sex << "\n\t\t\t\t\tLocation:\t\t" << Location << "\n\t\t\t\t\tContact Number:\t" <<
ContactNumber <<"\n\t\t\t\t\t--Work Information--\n"<< "\n\t\t\t\t\tDepartment:\t\t" << Department <<
"\n\t\t\t\t\tOffice:\t\t\t" << Office << "\n\t\t\t\t\tPosition:\t\t" << Position <<endl;
EmployeeData.close();
cout<<"\n\t\t\t\t\tSuccessfully Recorded!\n";
cout<<"\n\t\t\t\t\t"<<system("pause");
Selection();}
else {cout<<"\n\t\t\t\t\tError";}
main();
}
void AddDoctorInformation()
{
int Room, int_date, int_year;
long int DoctorNumber;
char ScheduleSelection, DaySelection, SpecializationSelection, SelectMonth,Age[99], temp, Year[4], date[2];
string ContactNumber, DoctorID,str_age;
string FirstName,MiddleName,LastName,Sex,Location, Specialization, Schedule, Day, Month;
bool SexValid=false;
TitleHeader();
cout<<"\n\t\t\t\t\tCreate Doctor ID (ex. 200001)"<<endl;
TryAgainDoctorID:
cout<<"\n\t\t\t\t\tDoctor ID:\t";
cin>>DoctorID;
DoctorNumber = atol(DoctorID.c_str());
if (ifstream(DoctorID.c_str())){cout<<"\n\t\t\t\t\tFile already exist! Enter another name."<<endl;
goto TryAgainDoctorID;
}
if ((DoctorNumber>=200000)&&(DoctorNumber<=299999)){cout<<"\n\t\t\t\t\tCreated successfully!";}
else{cout<<"\n\t\t\t\t\tInvalid Doctor ID! Try Again!";
goto TryAgainDoctorID;}
ofstream DoctorData;
DoctorData.open(DoctorID.c_str());
if (DoctorData.is_open())
{cout<<"\n\t\t\t\t\t--Doctor Information--\n"<<endl;
cout << "\n\t\t\t\t\tPersonal Information\n"<<endl;
cout<<"\n\t\t\t\t\tLast Name:\t\t";
getline(cin >> ws, LastName);
cout<<"\n\t\t\t\t\tFirst Name:\t\t";
getline(cin, FirstName);
cout<<"\n\t\t\t\t\tMiddle Name:\t\t";
getline(cin, MiddleName);
cout<<"\n\t\t\t\t\tAge:\t\t\t";
for (int i = 0;;)
{
temp = getch();

if (temp >= '0' and temp <= '9')


{
Age[i] = temp;
++i;
cout << temp;
}
if (temp == '\b' and i >= 1)
{
cout << "\b \b";
--i;
}
if (temp == '\r' and i > 0)
{
Age[i] = '\0';
break;
}
}
string str_age = Age;
cout<<"\n\n\t\t\t\t\tBirthday\n";
cout<<"\n\t\t\t\t\tMonth\n";
cout<<"\n\t\t\t\t\t[A] Jan \t\t[E] May\t\t[I] Sep\n";
cout<<"\n\t\t\t\t\t[B] Feb \t\t[F] Jun\t\t[J] Oct\n";
cout<<"\n\t\t\t\t\t[C] Mar \t\t[G] Jul\t\t[K] Nov\n";
cout<<"\n\t\t\t\t\t[E] Apr \t\t[H] Aug\t\t[L] Dec\n";
TryAgainMonth:
cout<<"\n\t\t\t\t\tSelect Month:\t\t";
cin>>SelectMonth;
switch (SelectMonth){
case 'A':
Month="January";
break;
case 'B':
Month="February";
break;
case 'C':
Month="March";
break;
case 'D':
Month="April";
break;
case 'E':
Month="May";
break;
case 'F':
Month="June";
break;
case 'G':
Month="July";
break;
case 'H':
Month="August";
break;
case 'I':
Month="September";
break;
case 'J':
Month="October";
break;
case 'K':
Month="November";
break;
case 'L':
Month="December";
break;
default:{cout<<"\n\t\t\t\t\tInvalid Input!";
goto TryAgainMonth;
break;}
}
TryAgainDate:
cout<<"\n\t\t\t\t\tDate:\t\t\t";
for (int i = 0; i < 3;)
{
temp = getch();

if ((temp >= '0') and (temp <= '9'))


{
date[i] = temp;
++i;
cout << temp;
}
if (temp == '\b' and i >= 1)
{
cout << "\b \b";
--i;
}
if (temp == '\r')
{
date[i] = '\0';
break;
}
if (i == 3)
{
goto TryAgainDate;
}
}
string str_date = date;
int_date = atol(str_date.c_str());
if ((int_date<1) || (int_date>31)){
cout<<"\n\t\t\t\t\tInvalid Date!";
goto TryAgainDate;
}
TryAgainYear:
cout<<"\n\n\t\t\t\t\tYear:\t\t\t";
for (int i = 0; i < 5;)
{
temp = getch();

if ((temp >= '0') and (temp <= '9'))


{
Year[i] = temp;
++i;
cout << temp;
}
if (temp == '\b' and i >= 1)
{
cout << "\b \b";
--i;
}
if (temp == '\r')
{
Year[i] = '\0';
break;
}
if (i == 5)
{
goto TryAgainYear;
}
}
cin.ignore();
string str_year = Year;
int_year = atol(str_year.c_str());
if ((int_year<1900) or (int_year>2019)){
cout<<"\n\t\t\t\t\tInvalid Year!";
goto TryAgainYear;
}
cout<<"\n\t\t\t\t\tSex\t";
cout<<"\n\t\t\t\t\t[M] Male\t\t[F] Female"<<endl;
cout<<"\n\t\t\t\t\tChoose sex:\t\t";
do {
getline(cin, Sex);
SexValid =((Sex== "M") || (Sex== "F"));
if (SexValid)
{break;}
else {cout << "\n\t\t\t\t\tInvalid input"<<"\n\t\t\t\t\tChoose sex:\t";}
} while (!SexValid);
cout<<"\n\t\t\t\t\tLocation:\t\t";
getline(cin, Location);
cout<<"\n\t\t\t\t\tContact Number:\t\t";
getline(cin, ContactNumber);
cout<< "\n\t\t\t\t\tWork Information"<< endl;
cout<<"\n\t\t\t\t\tSpecialization:\t"<<endl;
cout<<"\n\t\t\t\t\t[A] Pediatrics\t\t\t[F] Obstetrics \t\t\t[K] Ophthalmology"<<endl;
cout<<"\n\t\t\t\t\t[B] General Practice\t\t[G] Psychiatry \t\t\t[L] Ear, Nose, and Throat"<<endl;
cout<<"\n\t\t\t\t\t[C] Internal Medicine\t\t[H] Neurology \t\t\t[M] Urology"<<endl;
cout<<"\n\t\t\t\t\t[D] Cardiology\t\t\t[I] Orthopedics \t\t[N] Pulmonology"<<endl;
cout<<"\n\t\t\t\t\t[E] Surgeon\t\t\t[J] Dermatology\t\t\t[O] Endocrinology"<<endl;
TryAgainDepartment:
cout<<"\n\t\t\t\t\tSelect specialization:\t";
cin>>SpecializationSelection;
switch(SpecializationSelection){
case 'A':
Specialization="Pediatrics";
break;
case 'B':
Specialization="General Practice";
break;
case 'C':
Specialization="Internal Medicine";
break;
case 'D':
Specialization="Cardiology";
break;
case 'E':
Specialization="Surgery";
break;
case 'F':
Specialization="Obstetrics";
break;
case 'G':
Specialization="Psychiatry";
break;
case 'H':
Specialization="Neurology";
break;
case 'I':
Specialization="Orthopedics";
break;
case 'J':
Specialization="Dermatology";
break;
case 'K':
Specialization="Ophthalmology";
break;
case 'L':
Specialization="Ear, Nose, and Throat";
break;
case 'M':
Specialization="Urology";
break;
case 'N':
Specialization="Pulmonology";
break;
case 'O':
Specialization="Endocrinology";
break;
default :
cout<<"\n\t\t\t\t\tIncorrect Department!\n";
cout<<"\n\t\t\t\t\tTry Again!\n";
goto TryAgainDepartment;
break;}
cout<<"\n\t\t\t\t\t\t.--.----------.--.----------.ROOMS AVAILABLE------------.--.----------."<<endl;
cout<<"\n\t\t\t\t\t\t.--.----------.--.----------.--.----------.--.----------.--.----------."<<endl;
cout<<"\n\t\t\t\t\t\t| | 1stFloor | | 2ndFloor | | 3rdFloor | | 4thFloor | | 5thFloor |"<<endl;
cout<<"\n\t\t\t\t\t\t:--+----------+--+----------+--+----------+--+----------+--+----------:"<<endl;
cout<<"\n\t\t\t\t\t\t| | 110 | | 210 | | 310 | | 410 | | 510 |"<<endl;
cout<<"\n\t\t\t\t\t\t:--+----------+--+----------+--+----------+--+----------+--+----------:"<<endl;
cout<<"\n\t\t\t\t\t\t| | 120 | | 220 | | 320 | | 420 | | 520 |"<<endl;
cout<<"\n\t\t\t\t\t\t:--+----------+--+----------+--+----------+--+----------+--+----------:"<<endl;
cout<<"\n\t\t\t\t\t\t| | 130 | | 230 | | 330 | | 430 | | 530 |"<<endl;
cout<<"\n\t\t\t\t\t\t:--+----------+--+----------+--+----------+--+----------+--+----------:"<<endl;
cout<<"\n\t\t\t\t\t\t| | 140 | | 240 | | 340 | | 440 | | 540 |"<<endl;
cout<<"\n\t\t\t\t\t\t:--+----------+--+----------+--+----------+--+----------+--+----------:"<<endl;
cout<<"\n\t\t\t\t\t\t| | 150 | | 250 | | 350 | | 450 | | 550 |"<<endl;
cout<<"\n\t\t\t\t\t\t:--+----------+--+----------+--+----------+--+----------+--+----------:"<<endl;
cout<<"\n\t\t\t\t\t\t| | 160 | | 260 | | 360 | | 460 | | 560 |"<<endl;
cout<<"\n\t\t\t\t\t\t:--+----------+--+----------+--+----------+--+----------+--+----------:"<<endl;
cout<<"\n\t\t\t\t\t\t| | 170 | | 270 | | 370 | | 470 | | 570 |"<<endl;
cout<<"\n\t\t\t\t\t\t:--+----------+--+----------+--+----------+--+----------+--+----------:"<<endl;
cout<<"\n\t\t\t\t\t\t| | 180 | | 280 | | 380 | | 480 | | 580 |"<<endl;
cout<<"\n\t\t\t\t\t\t:--+----------+--+----------+--+----------+--+----------+--+----------:"<<endl;
cout<<"\n\t\t\t\t\t\t| | 190 | | 290 | | 390 | | 490 | | 590 |"<<endl;
cout<<"\n\t\t\t\t\t\t'--'----------'--'----------'--'----------'--'----------'--'----------'"<<endl;
TryRoom:
cout<<"\n\t\t\t\t\tSelect Room:\t\t";
cin>>Room;
cin.ignore();
if((Room>=100) && (Room<=600) && (Room%10==0)){cout<<"\n\t\t\t\t\tRoom Assigned!\n";}
else{cout <<"\n\t\t\t\t\tRoom does not exist! Try Again!\n";
goto TryRoom;}
cout<<"\n\t\t\t\t\tTime of Consulation\n";
cout<<"\n\t\t\t\t\t[A] - 08:00 AM - 12:00 PM\n";
cout<<"\n\t\t\t\t\t[B] - 01:00 PM - 05:00 PM\n";
cout<<"\n\t\t\t\t\t[C] - 06:00 PM - 10:00 PM\n";
TryAgainSchedule:
cout<<"\n\t\t\t\t\tSelect preferred time:\t\t";
cin>>ScheduleSelection;
switch(ScheduleSelection){
case 'A':
Schedule="08:00 AM - 12:00 PM";
break;
case 'B':
Schedule="01:00 PM - 05:00 PM";
break;
case 'C':
Schedule="06:00 PM - 10:00 PM";
break;
default :
cout<<"\n\t\t\t\t\tIncorrect Selection!\n";
cout<<"\n\t\t\t\t\tTry Again!\n";
goto TryAgainSchedule;
break;}

cout<<"\n\t\t\t\t\tDay of Consulation\n";
cout<<"\n\t\t\t\t\t[A] - MWF - Monday, Tuesday, and Friday\n";
cout<<"\n\t\t\t\t\t[B] - TTHS - Tuesday, Thursday, and Saturday\n";
cout<<"\n\t\t\t\t\t[C] - SS - Saturday & Sunday\n";
TryAgainDay:
cout<<"\n\t\t\t\t\tSelect preferred day:\t\t";
cin>>DaySelection;
switch(DaySelection){
case 'A':
Day="Monday, Tuesday, and Friday";
break;
case 'B':
Day="Tuesday, Thursday, and Saturday";
break;
case 'C':
Day="Saturday & Sunday";
break;
default :
cout<<"\n\t\t\t\t\tIncorrect Selection!\n";
cout<<"\n\t\t\t\t\tTry Again!\n";
goto TryAgainDay;
break;}
DoctorData <<"\n\t\t\t\t\t--Personal Information--\n"<<"\n\t\t\t\t\tLast Name:\t\t" <<LastName
<<"\n\t\t\t\t\tFirst Name:\t\t" <<FirstName << "\n\t\t\t\t\tMiddle Name:\t\t" << MiddleName <<
"\n\t\t\t\t\tAge:\t\t\t" << str_age << "\n\t\t\t\t\tBirthday:\t\t" <<Month<<" "<<str_date<<", "<< str_year
<<"\n\t\t\t\t\tSex:\t\t\t" << Sex << "\n\t\t\t\t\tLocation:\t\t" << Location << "\n\t\t\t\t\tContact Number:\t\t" <<
ContactNumber <<"\n\n\t\t\t\t\t--Work Information--\n"<< "\n\t\t\t\t\tSpecialization:\t\t" << Specialization <<
"\n\t\t\t\t\tRoom:\t\t\t" << Room << "\n\t\t\t\t\tTime:\t\t\t"<<Schedule << "\n\t\t\t\t\tDay:\t\t\t"<<Day<<endl;
DoctorData.close();
cout<<"\n\t\t\t\t\tSuccessfully Recorded!\n";
cout<<"\n\t\t\t\t\t"<<system("pause");
Selection();}
else {cout<<"\n\t\t\t\t\tError";}
main();
}
void DeleteRecord(){
string FileID;
TitleHeader();
cout<<"\t\t\t\t\tEnter name of file to delete: \t";
getline(cin>>ws, FileID);
if (remove(FileID.c_str( )) !=0){
cout<<"\t\t\t\t\tRemove operation failed\n\n"<<endl;}
else
{
cout<<"\t\t\t\t\t"<<FileID<<" has been removed.\n\n"<<endl;}
cout<<"\n\t\t\t\t\t"<<system("pause");
Selection();
}
void
WelcomeScreen(){cout<<"\n\n\n\n\n\n\t\t\t\t\t######################################################
#######################################\n";
cout<<"\t\t\t\t\t##
_______________________________________________________________________________________ ##\n";
cout<<"\t\t\t\t\t##| ( ) |##\n";
cout<<"\t\t\t\t\t##| ( )__ |##\n";
cout<<"\t\t\t\t\t##| ( ______) __ |##\n";
cout<<"\t\t\t\t\t##| (____________ ) _| |_ _______________________________ |##\n";
cout<<"\t\t\t\t\t##| ________|_ _|______| | |##\n";
cout<<"\t\t\t\t\t##| | |__| [][][][][][][]| |##\n";
cout<<"\t\t\t\t\t##| | WELCOME TO [][][][][][]| |##\n";
cout<<"\t\t\t\t\t##| | HEART OF MALOLOS HOSPITAL [ ] [ ] [ ] [ ] [ ] [ ] | |##\n";
cout<<"\t\t\t\t\t##| | RECORD MANAGEMENT SYSTEM [ ] [ ] [ ] [ ] [ ] [ ] | |##\n";
cout<<"\t\t\t\t\t##| ___________________|____________________________ [ ] [ ] [ ] [ ] [ ] [ ] | |##\n";
cout<<"\t\t\t\t\t##| | |[][][][][][]| |##\n";
cout<<"\t\t\t\t\t##| | [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] | [ ] [ ] [ ] [ ] [ ] [ ] | |##\n";
cout<<"\t\t\t\t\t##| | [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] | [ ] [ ] [ ] [ ] [ ] [ ] | |##\n";
cout<<"\t\t\t\t\t##| | [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] | [ ] [ ] [ ] [ ] [ ] [ ] | |##\n";
cout<<"\t\t\t\t\t##| | [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] | [ ] [ ] [ ] [ ] [ ] [ ] | |##\n";
cout<<"\t\t\t\t\t##|____|________________________________________________|_______________________
__|_______|##\n";
cout<<"\t\t\t\t\t################################################################################
#############\n\n\n\n\t\t\t\t\t";
}
void TitleHeader(){
cout<<"\n\t\t\t\t\t##############################################################################
###############\n";
cout<<"\t\t\t\t\t## ##\n";
cout<<"\t\t\t\t\t## HEART OF MALOLOS HOSPITAL ##\n";
cout<<"\t\t\t\t\t## RECORD MANAGEMENT SYSTEM ##\n";
cout<<"\t\t\t\t\t## ##\n";
cout<<"\t\t\t\t\t################################################################################
#############\n\n";
}
void UpdateRecord(){string getcontent, InformationID;
long int InformationNumber;
TitleHeader();
TryAgainEdit:
cout<<"\n\t\t\t\t\tEnter ID to Edit Information:\t";
cin>>InformationID;
ifstream Data (InformationID.c_str());
if(Data.is_open())
{
while(Data)
{
getline(Data, getcontent);
cout <<getcontent << endl;
}
}
else {cout<<"\n\t\t\t\t\tData does not exist.";
goto TryAgainEdit;}
InformationNumber = atol(InformationID.c_str());
if ((InformationNumber>=100000)&&(InformationNumber<=199999)){{cout<<"\n\t\t\t\t\t-----------Opened
successfully!-----------\n\n";}
int int_date, int_year;
char SelectMonth, SpecializationSelection,SelectionBloodType, Age[99], temp, Year[4], date[2];
double Height, Weight;
string ContactNumber,BloodType, Vaccination, Month, CurrentMedications,Allergies, str_age;
string FirstName,MiddleName,LastName,Sex,Location, Doctor, Specialization,Concern,PrescribedMedicine;
bool SexValid=false;
ofstream Data;
Data.open(InformationID.c_str());
if (Data.is_open())
{
cout<<"\n\t\t\t\t\tUpdate Information\n\n"<<endl;
cout<<"\n\t\t\t\t\tPatient Information"<<endl;
cout<<"\n\t\t\t\t\tPatient ID:\t\t"<<InformationID;
cout<<"\n\t\t\t\t\tLast Name:\t\t";
getline(cin >> ws, LastName);
cout<<"\n\t\t\t\t\tFirst Name:\t\t";
getline(cin, FirstName);
cout<<"\n\t\t\t\t\tMiddle Name:\t\t";
getline(cin, MiddleName);
cout<<"\n\t\t\t\t\tAge:\t\t\t";
for (int i = 0;;)
{
temp = getch();

if (temp >= '0' and temp <= '9')


{
Age[i] = temp;
++i;
cout << temp;
}
if (temp == '\b' and i >= 1)
{
cout << "\b \b";
--i;
}
if (temp == '\r' and i > 0)
{
Age[i] = '\0';
break;
}
}
string str_age = Age;
cout<<"\n\n\t\t\t\t\tBirthday\n";
cout<<"\n\t\t\t\t\tMonth\n";
cout<<"\n\t\t\t\t\t[A] Jan \t\t[E] May\t\t[I] Sep\n";
cout<<"\n\t\t\t\t\t[B] Feb \t\t[F] Jun\t\t[J] Oct\n";
cout<<"\n\t\t\t\t\t[C] Mar \t\t[G] Jul\t\t[K] Nov\n";
cout<<"\n\t\t\t\t\t[E] Apr \t\t[H] Aug\t\t[L] Dec\n";
TryAgainMonth1:
cout<<"\n\t\t\t\t\tSelect Month:\t\t";
cin>>SelectMonth;
switch (SelectMonth){
case 'A':
Month="January";
break;
case 'B':
Month="February";
break;
case 'C':
Month="March";
break;
case 'D':
Month="April";
break;
case 'E':
Month="May";
break;
case 'F':
Month="June";
break;
case 'G':
Month="July";
break;
case 'H':
Month="August";
break;
case 'I':
Month="September";
break;
case 'J':
Month="October";
break;
case 'K':
Month="November";
break;
case 'L':
Month="December";
break;
default:{cout<<"\n\t\t\t\t\tInvalid Input!";
goto TryAgainMonth1;
break;}
}
TryAgainDate1:
cout<<"\n\t\t\t\t\tDate:\t\t\t";
for (int i = 0; i < 3;)
{
temp = getch();

if ((temp >= '0') and (temp <= '9'))


{
date[i] = temp;
++i;
cout << temp;
}
if (temp == '\b' and i >= 1)
{
cout << "\b \b";
--i;
}
if (temp == '\r')
{
date[i] = '\0';
break;
}
if (i == 3)
{
goto TryAgainDate1;
}
}
string str_date = date;
int_date = atol(str_date.c_str());
if ((int_date<1) || (int_date>31)){
cout<<"\n\t\t\t\t\tInvalid Date!";
goto TryAgainDate1;
}
TryAgainYear1:
cout<<"\n\n\t\t\t\t\tYear:\t\t\t";
for (int i = 0; i < 5;)
{
temp = getch();

if ((temp >= '0') and (temp <= '9'))


{
Year[i] = temp;
++i;
cout << temp;
}
if (temp == '\b' and i >= 1)
{
cout << "\b \b";
--i;
}
if (temp == '\r')
{
Year[i] = '\0';
break;
}
if (i == 5)
{
goto TryAgainYear1;
}
}
cin.ignore();
string str_year = Year;
int_year = atol(str_year.c_str());
if ((int_year<1900) or (int_year>2019)){
cout<<"\n\t\t\t\t\tInvalid Year!";
goto TryAgainYear1;
}
cout<<"\n\n\t\t\t\t\tSex:\t";
cout<<"\n\t\t\t\t\t[M] Male\t\t[F] Female"<<endl;
cout<<"\n\t\t\t\t\tChoose sex:\t\t";
do {
getline(cin, Sex);
SexValid =((Sex== "M") || (Sex== "F"));
if (SexValid)
{break;}
else {cout << "\n\t\t\t\t\tInvalid input";
cout<<"\n\t\t\t\t\tChoose sex:\t\t";}
} while (!SexValid);
cout<<"\n\t\t\t\t\tLocation:\t\t";
getline(cin, Location);
cout<<"\n\t\t\t\t\tContact Number:\t\t";
getline(cin, ContactNumber);
cout<<"\n\t\t\t\t\tHeight (cm):\t\t";
cin>>Height;
cout<<"\n\t\t\t\t\tWeight (kg):\t\t";
cin>>Weight;
cout<<"\n\t\t\t\t\tBlood Type\n";
cout<<"\n\t\t\t\t\t[A] A+ [E] AB+\n";
cout<<"\n\t\t\t\t\t[B] A- [F] AB-\n";
cout<<"\n\t\t\t\t\t[C] B+ [G] O+\n";
cout<<"\n\t\t\t\t\t[D] B- [H] O-\n";
TryAgainBloodType:
cout<<"\n\t\t\t\t\tBlood Type:\t\t";
cin>> SelectionBloodType;
cin.ignore();
switch (SelectionBloodType){
case 'A':
BloodType="A+";
break;
case 'B':
BloodType="A-";
break;
case 'C':
BloodType="B+";
break;
case 'D':
BloodType="B-";
break;
case 'E':
BloodType="AB+";
break;
case 'F':
BloodType="AB-";
break;
case 'G':
BloodType="O+";
break;
case 'H':
BloodType="O-";
break;
default :
cout<<"\n\t\t\t\t\tIncorrect Blood Type! Try Again!\n";
goto TryAgainBloodType;
break;}
cout<<"\n\t\t\t\t\tCurrent Medication:\t";
getline(cin, CurrentMedications);
cout<<"\n\t\t\t\t\tAllergies:\t\t";
getline(cin, Allergies);
cout<<"\n\t\t\t\t\tVaccinations:\t\t";
getline(cin, Vaccination);
cout<<"\n\t\t\t\t\tConcern:\t\t";
getline(cin, Concern);
cout<<"\n\t\t\t\t\tPrescribed Medicine:\t";
getline(cin, PrescribedMedicine);
cout<<"\n\t\t\t\t\tDoctor:\t\t\t";
getline(cin, Doctor);
cout<<"\n\t\t\t\t\tSpecialization:\t"<<endl;
cout<<"\n\t\t\t\t\t[A] Pediatrics\t\t\t[F] Obstetrics \t\t\t[K] Ophthalmology"<<endl;
cout<<"\n\t\t\t\t\t[B] General Practice\t\t[G] Psychiatry \t\t\t[L] Ear, Nose, and Throat"<<endl;
cout<<"\n\t\t\t\t\t[C] Internal Medicine\t\t[H] Neurology \t\t\t[M] Urology"<<endl;
cout<<"\n\t\t\t\t\t[D] Cardiology\t\t\t[I] Orthopedics \t\t[N] Pulmonology"<<endl;
cout<<"\n\t\t\t\t\t[E] Surgeon\t\t\t[J] Dermatology\t\t\t[O] Endocrinology"<<endl;
TryAgainDepartment1:
cout<<"\n\t\t\t\t\tSelect specialization:\t";
cin>>SpecializationSelection;
switch(SpecializationSelection){
case 'A':
Specialization="Pediatrics";
break;
case 'B':
Specialization="General Practice";
break;
case 'C':
Specialization="Internal Medicine";
break;
case 'D':
Specialization="Cardiology";
break;
case 'E':
Specialization="Surgery";
break;
case 'F':
Specialization="Obstetrics";
break;
case 'G':
Specialization="Psychiatry";
break;
case 'H':
Specialization="Neurology";
break;
case 'I':
Specialization="Orthopedics";
break;
case 'J':
Specialization="Dermatology";
break;
case 'K':
Specialization="Ophthalmology";
break;
case 'L':
Specialization="Ear, Nose, and Throat";
break;
case 'M':
Specialization="Urology";
break;
case 'N':
Specialization="Pulmonology";
break;
case 'O':
Specialization="Endocrinology";
break;
default :
cout<<"\n\t\t\t\t\tIncorrect Department!\n";
cout<<"\n\t\t\t\t\tTry Again!\n";
goto TryAgainDepartment1;
break;}
Data <<"\n\n\t\t\t\t\t--Personal Information--\n"<<"\n\t\t\t\t\tLast Name:\t\t" <<LastName <<"\n\t\t\t\t\tFirst
Name:\t\t" <<FirstName << "\n\t\t\t\t\tMiddle Name:\t\t" << MiddleName << "\n\t\t\t\t\tAge:\t\t\t" << str_age
<< "\n\t\t\t\t\tBirthday:\t\t" <<Month<<" "<<str_date<<", "<< str_year <<"\n\t\t\t\t\tSex:\t\t\t" << Sex <<
"\n\t\t\t\t\tLocation:\t\t" << Location << "\n\t\t\t\t\tContact Number:\t\t" << ContactNumber <<"\n\n\t\t\t\t\t--
Body Information--\n"<<"\n\t\t\t\t\tHeight:\t\t\t" <<Height<<" cm"<< "\n\t\t\t\t\tWeight:\t\t\t" <<Weight <<"
kg" << "\n\t\t\t\t\tBlood Type:\t\t" << BloodType << "\n\t\t\t\t\tCurrent Medication:\t" << CurrentMedications <<
"\n\t\t\t\t\tAllergies:\t\t" << Allergies <<"\n\t\t\t\t\tVaccination:\t\t" << Vaccination<< "\n\n\t\t\t\t\t--Diagnosis
and Doctor Information--\n"<<"\n\t\t\t\t\tConcern:\t\t" << Concern << "\n\t\t\t\t\tPrescribed Medicine:\t" <<
PrescribedMedicine << "\n\t\t\t\t\tDoctor:\t\t\t" << Doctor << "\n\t\t\t\t\tSpecialization:\t\t" << Specialization <<
endl;
Data.close();
cout<<"\n\t\t\t\t\tInformation updated successfully!\n";
cout<<"\n\t\t\t\t\t"<<system("pause");
Selection();}}
if ((InformationNumber>=200000)&&(InformationNumber<=299999)){{cout<<"\n\t\t\t\t\t-----------Opened
successfully!-----------\n\n";}
int Room, int_date, int_year;
char ScheduleSelection, DaySelection, SpecializationSelection, SelectMonth, Age[99], temp, Year[4], date[2];
string ContactNumber, str_age;
string FirstName,MiddleName,LastName,Sex,Location, Specialization, Schedule, Day, Month;
bool SexValid=false;
ofstream DoctorData;
DoctorData.open(InformationID.c_str());
if (DoctorData.is_open())
{cout<<"\n\t\t\t\t\tDoctor Information"<<endl;
cout << "\n\t\t\t\t\tPersonal Information"<<endl;
cout<<"\n\t\t\t\t\tDoctor ID:\t\t"<<InformationID;
cout<<"\n\t\t\t\t\tLast Name:\t\t";
getline(cin >> ws, LastName);
cout<<"\n\t\t\t\t\tFirst Name:\t\t";
getline(cin, FirstName);
cout<<"\n\t\t\t\t\tMiddle Name:\t\t";
getline(cin, MiddleName);
cout<<"\n\t\t\t\t\tAge:\t\t\t";
for (int i = 0;;)
{
temp = getch();

if (temp >= '0' and temp <= '9')


{
Age[i] = temp;
++i;
cout << temp;
}
if (temp == '\b' and i >= 1)
{
cout << "\b \b";
--i;
}
if (temp == '\r' and i > 0)
{
Age[i] = '\0';
break;
}
}
string str_age = Age;
cout<<"\n\n\t\t\t\t\tBirthday\n";
cout<<"\n\t\t\t\t\tMonth\n";
cout<<"\n\t\t\t\t\t[A] Jan \t\t[E] May\t\t[I] Sep\n";
cout<<"\n\t\t\t\t\t[B] Feb \t\t[F] Jun\t\t[J] Oct\n";
cout<<"\n\t\t\t\t\t[C] Mar \t\t[G] Jul\t\t[K] Nov\n";
cout<<"\n\t\t\t\t\t[E] Apr \t\t[H] Aug\t\t[L] Dec\n";
TryAgainMonth2:
cout<<"\n\t\t\t\t\tSelect Month:\t\t";
cin>>SelectMonth;
switch (SelectMonth){
case 'A':
Month="January";
break;
case 'B':
Month="February";
break;
case 'C':
Month="March";
break;
case 'D':
Month="April";
break;
case 'E':
Month="May";
break;
case 'F':
Month="June";
break;
case 'G':
Month="July";
break;
case 'H':
Month="August";
break;
case 'I':
Month="September";
break;
case 'J':
Month="October";
break;
case 'K':
Month="November";
break;
case 'L':
Month="December";
break;
default:{cout<<"\n\t\t\t\t\tInvalid Input!";
goto TryAgainMonth2;
break;}
}
TryAgainDate2:
cout<<"\n\t\t\t\t\tDate:\t\t\t";
for (int i = 0; i < 3;)
{
temp = getch();

if ((temp >= '0') and (temp <= '9'))


{
date[i] = temp;
++i;
cout << temp;
}
if (temp == '\b' and i >= 1)
{
cout << "\b \b";
--i;
}
if (temp == '\r')
{
date[i] = '\0';
break;
}
if (i == 3)
{
goto TryAgainDate2;
}
}
string str_date = date;
int_date = atol(str_date.c_str());
if ((int_date<1) || (int_date>31)){
cout<<"\n\t\t\t\t\tInvalid Date!";
goto TryAgainDate2;
}
TryAgainYear2:
cout<<"\n\n\t\t\t\t\tYear:\t\t\t";
for (int i = 0; i < 5;)
{
temp = getch();

if ((temp >= '0') and (temp <= '9'))


{
Year[i] = temp;
++i;
cout << temp;
}
if (temp == '\b' and i >= 1)
{
cout << "\b \b";
--i;
}
if (temp == '\r')
{
Year[i] = '\0';
break;
}
if (i == 5)
{
goto TryAgainYear2;
}
}
cin.ignore();
string str_year = Year;
int_year = atol(str_year.c_str());
if ((int_year<1900) or (int_year>2019)){
cout<<"\n\t\t\t\t\tInvalid Year!";
goto TryAgainYear2;
}
cout<<"\n\t\t\t\t\tSex\t";
cout<<"\n\t\t\t\t\t[M] Male\t\t[F] Female"<<endl;
cout<<"\n\t\t\t\t\tChoose sex:\t\t";
do {
getline(cin, Sex);
SexValid =((Sex== "M") || (Sex== "F"));
if (SexValid)
{break;}
else {cout << "\n\t\t\t\t\tInvalid input"<<"\n\t\t\t\t\tChoose sex:\t\t";}
} while (!SexValid);
cout<<"\n\t\t\t\t\tLocation:\t\t";
getline(cin, Location);
cout<<"\n\t\t\t\t\tContact Number:\t\t";
getline(cin, ContactNumber);
cout<< "\n\t\t\t\t\tWork Information"<< endl;
cout<<"\n\t\t\t\t\tSpecialization:\t"<<endl;
cout<<"\n\t\t\t\t\t[A] Pediatrics\t\t\t[F] Obstetrics \t\t\t[K] Ophthalmology"<<endl;
cout<<"\n\t\t\t\t\t[B] General Practice\t\t[G] Psychiatry \t\t\t[L] Ear, Nose, and Throat"<<endl;
cout<<"\n\t\t\t\t\t[C] Internal Medicine\t\t[H] Neurology \t\t\t[M] Urology"<<endl;
cout<<"\n\t\t\t\t\t[D] Cardiology\t\t\t[I] Orthopedics \t\t[N] Pulmonology"<<endl;
cout<<"\n\t\t\t\t\t[E] Surgeon\t\t\t[J] Dermatology\t\t\t[O] Endocrinology"<<endl;
TryAgainDepartment2:
cout<<"\n\t\t\t\t\tSelect specialization:\t";
cin>>SpecializationSelection;
switch(SpecializationSelection){
case 'A':
Specialization="Pediatrics";
break;
case 'B':
Specialization="General Practice";
break;
case 'C':
Specialization="Internal Medicine";
break;
case 'D':
Specialization="Cardiology";
break;
case 'E':
Specialization="Surgery";
break;
case 'F':
Specialization="Obstetrics";
break;
case 'G':
Specialization="Psychiatry";
break;
case 'H':
Specialization="Neurology";
break;
case 'I':
Specialization="Orthopedics";
break;
case 'J':
Specialization="Dermatology";
break;
case 'K':
Specialization="Ophthalmology";
break;
case 'L':
Specialization="Ear, Nose, and Throat";
break;
case 'M':
Specialization="Urology";
break;
case 'N':
Specialization="Pulmonology";
break;
case 'O':
Specialization="Endocrinology";
break;
default :
cout<<"\n\t\t\t\t\tIncorrect Department!\n";
cout<<"\n\t\t\t\t\tTry Again!\n";
goto TryAgainDepartment2;
break;}
cout<<"\n\t\t\t\t\t\t.--.----------.--.----------.ROOMS AVAILABLE------------.--.----------."<<endl;
cout<<"\n\t\t\t\t\t\t.--.----------.--.----------.--.----------.--.----------.--.----------."<<endl;
cout<<"\n\t\t\t\t\t\t| | 1stFloor | | 2ndFloor | | 3rdFloor | | 4thFloor | | 5thFloor |"<<endl;
cout<<"\n\t\t\t\t\t\t:--+----------+--+----------+--+----------+--+----------+--+----------:"<<endl;
cout<<"\n\t\t\t\t\t\t| | 110 | | 210 | | 310 | | 410 | | 510 |"<<endl;
cout<<"\n\t\t\t\t\t\t:--+----------+--+----------+--+----------+--+----------+--+----------:"<<endl;
cout<<"\n\t\t\t\t\t\t| | 120 | | 220 | | 320 | | 420 | | 520 |"<<endl;
cout<<"\n\t\t\t\t\t\t:--+----------+--+----------+--+----------+--+----------+--+----------:"<<endl;
cout<<"\n\t\t\t\t\t\t| | 130 | | 230 | | 330 | | 430 | | 530 |"<<endl;
cout<<"\n\t\t\t\t\t\t:--+----------+--+----------+--+----------+--+----------+--+----------:"<<endl;
cout<<"\n\t\t\t\t\t\t| | 140 | | 240 | | 340 | | 440 | | 540 |"<<endl;
cout<<"\n\t\t\t\t\t\t:--+----------+--+----------+--+----------+--+----------+--+----------:"<<endl;
cout<<"\n\t\t\t\t\t\t| | 150 | | 250 | | 350 | | 450 | | 550 |"<<endl;
cout<<"\n\t\t\t\t\t\t:--+----------+--+----------+--+----------+--+----------+--+----------:"<<endl;
cout<<"\n\t\t\t\t\t\t| | 160 | | 260 | | 360 | | 460 | | 560 |"<<endl;
cout<<"\n\t\t\t\t\t\t:--+----------+--+----------+--+----------+--+----------+--+----------:"<<endl;
cout<<"\n\t\t\t\t\t\t| | 170 | | 270 | | 370 | | 470 | | 570 |"<<endl;
cout<<"\n\t\t\t\t\t\t:--+----------+--+----------+--+----------+--+----------+--+----------:"<<endl;
cout<<"\n\t\t\t\t\t\t| | 180 | | 280 | | 380 | | 480 | | 580 |"<<endl;
cout<<"\n\t\t\t\t\t\t:--+----------+--+----------+--+----------+--+----------+--+----------:"<<endl;
cout<<"\n\t\t\t\t\t\t| | 190 | | 290 | | 390 | | 490 | | 590 |"<<endl;
cout<<"\n\t\t\t\t\t\t'--'----------'--'----------'--'----------'--'----------'--'----------'"<<endl;
TryRoom:
cout<<"\n\t\t\t\t\tSelect Room:\t\t";
cin>>Room;
cin.ignore();
if((Room>=100) && (Room<=600) && (Room%10==0)){cout<<"\n\t\t\t\t\tRoom Assigned!\n";}
else{cout <<"\n\t\t\t\t\tRoom does not exist! Try Again!\n";
goto TryRoom;}
cout<<"\n\t\t\t\t\tTime of Consulation\n";
cout<<"\n\t\t\t\t\t[A] - 08:00 AM - 12:00 PM\n";
cout<<"\n\t\t\t\t\t[B] - 01:00 PM - 05:00 PM\n";
cout<<"\n\t\t\t\t\t[C] - 06:00 PM - 10:00 PM\n";
TryAgainSchedule:
cout<<"\n\t\t\t\t\tSelect preferred time:\t\t";
cin>>ScheduleSelection;
switch(ScheduleSelection){
case 'A':
Schedule="08:00 AM - 12:00 PM";
break;
case 'B':
Schedule="01:00 PM - 05:00 PM";
break;
case 'C':
Schedule="06:00 PM - 10:00 PM";
break;
default :
cout<<"\n\t\t\t\t\tIncorrect Selection!\n";
cout<<"\n\t\t\t\t\tTry Again!\n";
goto TryAgainSchedule;
break;}

cout<<"\n\t\t\t\t\tDay of Consulation\n";
cout<<"\n\t\t\t\t\t[A] - MWF - Monday, Tuesday, and Friday\n";
cout<<"\n\t\t\t\t\t[B] - TTHS - Tuesday, Thursday, and Saturday\n";
cout<<"\n\t\t\t\t\t[C] - SS - Saturday & Sunday\n";
TryAgainDay:
cout<<"\n\t\t\t\t\tSelect preferred day:\t\t";
cin>>DaySelection;
switch(DaySelection){
case 'A':
Day="Monday, Tuesday, and Friday";
break;
case 'B':
Day="Tuesday, Thursday, and Saturday";
break;
case 'C':
Day="Saturday & Sunday";
break;
default :
cout<<"\n\t\t\t\t\tIncorrect Selection!\n";
cout<<"\n\t\t\t\t\tTry Again!\n";
goto TryAgainDay;
break;}
DoctorData <<"\n\t\t\t\t\t--Personal Information--\n"<<"\n\t\t\t\t\tLast Name:\t\t" <<LastName
<<"\n\t\t\t\t\tFirst Name:\t\t" <<FirstName << "\n\t\t\t\t\tMiddle Name:\t\t" << MiddleName <<
"\n\t\t\t\t\tAge:\t\t\t" << str_age << "\n\t\t\t\t\tBirthday:\t\t" <<Month<<" "<<str_date<<", "<< str_year
<<"\n\t\t\t\t\tSex:\t\t\t" << Sex << "\n\t\t\t\t\tLocation:\t\t" << Location << "\n\t\t\t\t\tContact Number:\t\t" <<
ContactNumber <<"\n\n\t\t\t\t\t--Work Information--\n"<< "\n\t\t\t\t\tSpecialization:\t\t" << Specialization <<
"\n\t\t\t\t\tRoom:\t\t\t" << Room << "\n\t\t\t\t\tTime:\t\t\t"<<Schedule << "\n\t\t\t\t\tDay:\t\t\t"<<Day<<endl;
DoctorData.close();
cout<<"\n\t\t\t\t\tInformation updated successfully!\n";
cout<<"\n\t\t\t\t\t"<<system("pause");
Selection();}}
if ((InformationNumber>=300000)&&(InformationNumber<=399999)){cout<<"\n\t\t\t\t\t-----------Opened
successfully!-----------\n\n";}
char SelectMonth, DepartmentSelection, OfficeSelection, Age[99], temp, Year[4], date[2];
int int_year, int_date;
string ContactNumber, SelectionServices,Month, str_age;
string FirstName,MiddleName,LastName,Sex,Location, Department, Position, Office;
bool SexValid=false;
ofstream EmployeeData;
EmployeeData.open(InformationID.c_str());
if (EmployeeData.is_open())
{cout<<"\n\t\t\t\t\tEmployee Information"<<endl;
cout << "\n\t\t\t\t\tPersonal Information"<<endl;
cout<<"\n\t\t\t\t\tEmployee ID:\t\t"<<InformationID;
cout<<"\n\t\t\t\t\tLast Name:\t\t";
getline(cin >> ws, LastName);
cout<<"\n\t\t\t\t\tFirst Name:\t\t";
getline(cin, FirstName);
cout<<"\n\t\t\t\t\tMiddle Name:\t\t";
getline(cin, MiddleName);
cout<<"\n\t\t\t\t\tAge:\t\t\t";
for (int i = 0;;)
{
temp = getch();

if (temp >= '0' and temp <= '9')


{
Age[i] = temp;
++i;
cout << temp;
}
if (temp == '\b' and i >= 1)
{
cout << "\b \b";
--i;
}
if (temp == '\r' and i > 0)
{
Age[i] = '\0';
break;
}
}
string str_age = Age;
cout<<"\n\n\t\t\t\t\tBirthday\n";
cout<<"\n\t\t\t\t\tMonth\n";
cout<<"\n\t\t\t\t\t[A] Jan \t\t[E] May\t\t[I] Sep\n";
cout<<"\n\t\t\t\t\t[B] Feb \t\t[F] Jun\t\t[J] Oct\n";
cout<<"\n\t\t\t\t\t[C] Mar \t\t[G] Jul\t\t[K] Nov\n";
cout<<"\n\t\t\t\t\t[E] Apr \t\t[H] Aug\t\t[L] Dec\n";
TryAgainMonth3:
cout<<"\n\t\t\t\t\tSelect Month:\t\t";
cin>>SelectMonth;
switch (SelectMonth){
case 'A':
Month="January";
break;
case 'B':
Month="February";
break;
case 'C':
Month="March";
break;
case 'D':
Month="April";
break;
case 'E':
Month="May";
break;
case 'F':
Month="June";
break;
case 'G':
Month="July";
break;
case 'H':
Month="August";
break;
case 'I':
Month="September";
break;
case 'J':
Month="October";
break;
case 'K':
Month="November";
break;
case 'L':
Month="December";
break;
default:{cout<<"\n\t\t\t\t\tInvalid Input!";
goto TryAgainMonth3;
break;}
}
TryAgainDate3:
cout<<"\n\t\t\t\t\tDate:\t\t\t";
for (int i = 0; i < 3;)
{
temp = getch();

if ((temp >= '0') and (temp <= '9'))


{
date[i] = temp;
++i;
cout << temp;
}
if (temp == '\b' and i >= 1)
{
cout << "\b \b";
--i;
}
if (temp == '\r')
{
date[i] = '\0';
break;
}
if (i == 3)
{
goto TryAgainDate3;
}
}
string str_date = date;
int_date = atol(str_date.c_str());
if ((int_date<1) || (int_date>31)){
cout<<"\n\t\t\t\t\tInvalid Date!";
goto TryAgainDate3;
}
TryAgainYear3:
cout<<"\n\n\t\t\t\t\tYear:\t\t\t";
for (int i = 0; i < 5;)
{
temp = getch();

if ((temp >= '0') and (temp <= '9'))


{
Year[i] = temp;
++i;
cout << temp;
}
if (temp == '\b' and i >= 1)
{
cout << "\b \b";
--i;
}
if (temp == '\r')
{
Year[i] = '\0';
break;
}
if (i == 5)
{
goto TryAgainYear3;
}
}
cin.ignore();
string str_year = Year;
int_year = atol(str_year.c_str());
if ((int_year<1900) or (int_year>2019)){
cout<<"\n\t\t\t\t\tInvalid Year!";
goto TryAgainYear3;
}
cout<<"\n\n\t\t\t\t\tSex\n";
cout<<"\n\t\t\t\t\t[M] Male\t\t[F] Female"<<endl;
cout<<"\n\t\t\t\t\tChoose sex:\t\t";
do {
getline(cin, Sex);
SexValid =((Sex== "M") || (Sex== "F"));
if (SexValid)
{break;}
else {cout << "\n\t\t\t\t\tInvalid input";
cout<<"\n\t\t\t\t\tChoose sex:\t\t";}
} while (!SexValid);
cout<<"\n\t\t\t\t\tLocation:\t\t";
getline(cin, Location);
cout<<"\n\t\t\t\t\tContact Number:\t\t";
getline(cin, ContactNumber);
cout<< "\n\t\t\t\t\tWork Information\n"<< endl;
cout<<"\n\t\t\t\t\tDepartment:\t"<<endl;
cout<<"\n\t\t\t\t\t[A] Administrative"<<endl;
cout<<"\n\t\t\t\t\t[B] Information Department"<<endl;
cout<<"\n\t\t\t\t\t[C] Therapeutic Department"<<endl;
cout<<"\n\t\t\t\t\t[D] Diagnostic Department"<<endl;
cout<<"\n\t\t\t\t\t[E] Support Department"<<endl;
TryAgainDepartment3:
cout<<"\n\t\t\t\t\tSelect Department:\t";
cin >> DepartmentSelection;
switch (DepartmentSelection)
{
case 'A':
Department = "Administratrative";
Office = "Office of the Administrator";
cout<<"\n\t\t\t\t\tADMINISTRATIVE DEPARTMENT\n";
cout<< "\n\t\t\t\t\tEnter position: \t";
getline(cin>>ws, Position);
break;
case 'B':
Department = "Information";
cout <<"\n\t\t\t\t\tINFORMATION DEPARTMENT\n";
cout<< "\n\t\t\t\t\tOffice\n";
cout<<"\n\t\t\t\t\t[A] Admission"<<endl;
cout<<"\n\t\t\t\t\t[B] Billing and Collection"<<endl;
cout<<"\n\t\t\t\t\t[C] Health Education"<<endl;
cout<<"\n\t\t\t\t\t[D] Medical Records"<<endl;
cout<<"\n\t\t\t\t\t[E] Management Information System"<<endl;
cout<<"\n\t\t\t\t\t[F] Human Resource"<<endl;
TryAgainOfficeInformation:
cout<<"\n\t\t\t\t\tSelect Office:\t\t";
cin>>OfficeSelection;
switch (OfficeSelection)
{
case 'A':
Office = "Admission";
cout << "\n\t\t\t\t\tAdmission Office";;
cout <<"\n\t\t\t\t\tEnter Company Position:\t";
getline(cin>>ws, Position);
break;
case 'B':
Office = "Billing and Collection";
cout << "\n\t\t\t\t\tBilling and Collection Office";
cout <<"\n\t\t\t\t\tEnter Company Position:\t";
getline(cin>>ws, Position);
break;
case 'C':
Office = "Health Education";
cout << "\n\t\t\t\t\tHealth Education Office";
cout <<"\n\t\t\t\t\tEnter Company Position:\t";
getline(cin>>ws, Position);
break;
case 'D':
Office = "Medical Records";
cout << "\n\t\t\t\t\tMedical Records Offices";
cout <<"\n\t\t\t\t\tEnter Company Position:\t";
getline(cin>>ws, Position);
break;
case 'E':
Office = "Management Information System";
cout << "\n\t\t\t\t\tManagement Information System Office";
cout <<"\n\t\t\t\t\tEnter Company Position:\t";
getline(cin>>ws, Position);
break;
case 'F':
Office = "Human Resource";
cout << "\n\t\t\t\t\tHuman Resource Office";
cout <<"\n\t\t\t\t\tEnter Company Position:\t";
getline(cin>>ws, Position);
break;
default: cout<< "\n\t\t\t\t\tInvalid input!";
goto TryAgainOfficeInformation;
break;
}
break;
case 'C':
Department = "Therapeutic";
cout <<"\n\t\t\t\t\tTHERAPEUTIC DEPARTMENT\n";
cout<< "\n\t\t\t\t\tOffice\n";
cout<<"\n\t\t\t\t\t[A] Physical Therapy"<<endl;
cout<<"\n\t\t\t\t\t[B] Occupational Therapy"<<endl;
cout<<"\n\t\t\t\t\t[C] Language Pathology"<<endl;
cout<<"\n\t\t\t\t\t[D] Respiratory Therapy"<<endl;
cout<<"\n\t\t\t\t\t[E] Medical Psychology"<<endl;
cout<<"\n\t\t\t\t\t[F] Social Services"<<endl;
cout<<"\n\t\t\t\t\t[G] Pharmacy"<<endl;
cout<<"\n\t\t\t\t\t[H] Dietary"<<endl;
cout<<"\n\t\t\t\t\t[I] Nursing"<<endl;
TryAgainOfficeTherapeutic:
cout<<"\n\t\t\t\t\tSelect Office:\t\t";
cin>>OfficeSelection;
switch (OfficeSelection)
{
case 'A':
Office = "Physical Therapy";
cout << "\n\t\t\t\t\tPhysical Therapy Office";
cout <<"\n\t\t\t\t\tEnter Company Position:\t";
getline(cin>>ws, Position);
break;
case 'B':
Office = "Occupational Therapy";
cout << "\n\t\t\t\t\tOccupational Therapy Office";
cout <<"\n\t\t\t\t\tEnter Company Position:\t";
getline(cin>>ws, Position);
break;
case 'C':
Office = "Language Pathology";
cout << "\n\t\t\t\t\tLanguage Pathology Office";
cout <<"\n\t\t\t\t\tEnter Company Position:\t";
getline(cin>>ws, Position);
break;
case 'D':
Office = "Respiratory Therapy";
cout << "\n\t\t\t\t\tRespiratory Therapy Office";
cout <<"\n\t\t\t\t\tEnter Company Position:\t";
getline(cin>>ws, Position);
break;
case 'E':
Office = "Medical Psychology";
cout << "\n\t\t\t\t\tMedical Psychology Office";
cout <<"\n\t\t\t\t\tEnter Company Position:\t";
getline(cin>>ws, Position);
break;
case 'F':
Office = "Social Services";
cout << "\n\t\t\t\t\tSocial Services Office";
cout <<"\n\t\t\t\t\tEnter Company Position:\t";
getline(cin>>ws, Position);
break;
case 'G':
Office = "Pharmacy";
cout << "\n\t\t\t\t\tPharmacy Office";
cout <<"\n\t\t\t\t\tEnter Company Position:\t";
getline(cin>>ws, Position);
break;
case 'H':
Office = "Dietary";
cout << "\n\t\t\t\t\tDietary Office";
cout <<"\n\t\t\t\t\tEnter Company Position:\t";
getline(cin>>ws, Position);
break;
case 'I':
Office = "Nursing";
cout << "\n\t\t\t\t\tNursing Office";
cout <<"\n\t\t\t\t\tEnter Company Position:\t";
getline(cin>>ws, Position);
break;
default: cout<< "\n\t\t\t\t\tInvalid input!";
goto TryAgainOfficeTherapeutic;
break;
}
break;
case 'D':
Department = "Diagnostic";
cout <<"\n\t\t\t\t\tDIAGNOSTIC DEPARTMENT\n";
cout<< "\n\t\t\t\t\tOffice\n";
cout<<"\n\t\t\t\t\t[A] Medical Laboratory"<<endl;
cout<<"\n\t\t\t\t\t[B] Radiology"<<endl;
cout<<"\n\t\t\t\t\t[C] Emergency Medicine"<<endl;
TryAgainOfficeDiagnostic:
cout<<"\n\t\t\t\t\tSelect Office:\t\t";
cin>>OfficeSelection;
switch (OfficeSelection)
{
case 'A':
Office = "Medical Laboratory";
cout << "\n\t\t\t\t\tMedical Laboratory Office";;
cout <<"\n\t\t\t\t\tEnter Company Position:\t";
getline(cin>>ws, Position);
break;
case 'B':
Office = "Radiology";
cout << "\n\t\t\t\t\tRadiology Office";
cout <<"\n\t\t\t\t\tEnter Company Position:\t";
getline(cin>>ws, Position);
break;
case 'C':
Office = "Emergency Medicine";
cout << "\n\t\t\t\t\tEmergency Medicine Office";
cout <<"\n\t\t\t\t\tEnter Company Position:\t";
getline(cin>>ws, Position);
break;
default: cout<< "\n\t\t\t\t\tInvalid input!";
goto TryAgainOfficeDiagnostic;
break;
}
break;
case 'E':
Department = "Support";
cout <<"\n\t\t\t\t\tSUPPORT DEPARTMENT\n";
cout<< "\n\t\t\t\t\tOffice\n";
cout<<"\n\t\t\t\t\t[A] Central Supply"<<endl;
cout<<"\n\t\t\t\t\t[B] Biomedical Technology"<<endl;
cout<<"\n\t\t\t\t\t[C] Housekeeping and Maintenance"<<endl;
TryAgainOfficeSupport:
cout<<"\n\t\t\t\t\tSelect Office:\t\t";
cin>>OfficeSelection;
switch (OfficeSelection)
{
case 'A':
Office = "Central Supply";
cout << "\n\t\t\t\t\tCentral Supply Office";;
cout <<"\n\t\t\t\t\tEnter Company Position:\t";
getline(cin>>ws, Position);
break;
case 'B':
Office = "Biomedical Technology";
cout << "\n\t\t\t\t\tBiomedical Technology Office";
cout <<"\n\t\t\t\t\tEnter Company Position:\t";
getline(cin>>ws, Position);
break;
case 'C':
Office = "Housekeeping and Maintenance";
cout << "\n\t\t\t\t\tHousekeeping and Maintenance Office";
cout <<"\n\t\t\t\t\tEnter Company Position:\t";
getline(cin>>ws, Position);
break;
default: cout<< "\n\t\t\t\t\tInvalid input!";
goto TryAgainOfficeSupport;
break;
}
break;
default:
cout << "\n\t\t\t\t\tInvalid Input!";
goto TryAgainDepartment3;
break;
}
EmployeeData<<"\n\t\t\t\t\t--Personal Information--\n"<<"\n\t\t\t\t\tLast Name:\t\t" <<LastName
<<"\n\t\t\t\t\tFirst Name:\t\t" <<FirstName << "\n\t\t\t\t\tMiddle Name:\t\t" << MiddleName <<
"\n\t\t\t\t\tAge:\t\t\t" << str_age << "\n\t\t\t\t\tBirthday:\t\t" <<Month<<" "<<str_date<<", "<<str_year <<
"\n\t\t\t\t\tSex:\t\t\t" << Sex << "\n\t\t\t\t\tLocation:\t\t" << Location << "\n\t\t\t\t\tContact Number:\t" <<
ContactNumber <<"\n\t\t\t\t\t--Work Information--\n"<< "\n\t\t\t\t\tDepartment:\t\t" << Department <<
"\n\t\t\t\t\tOffice:\t\t\t" << Office << "\n\t\t\t\t\tPosition:\t\t" << Position <<endl;
EmployeeData.close();
cout<<"\n\t\t\t\t\tInformation updated successfully!\n";
cout<<"\n\t\t\t\t\t"<<system("pause");
Selection();}}

Potrebbero piacerti anche