Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Submitted by:
Team Leader:
Members:
BSIT – 1KG2
Submitted to:
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.
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.
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.
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.
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
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)
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.
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>
}
}
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();
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;
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<<"\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();
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();