Documente Academic
Documente Profesional
Documente Cultură
On
Submitted to:-
Prepared by:-
HOSPITAL
A hospital is a health care institution providing patient treatment with specialized
staff and equipment. Hospitals are usually funded by public sector by health
organisations (for profit or non-profit), by health insurance companies, or by
charities, including direct charitable donations. Hospitals have a range of
departments (e.g., surgery, and urgent care etc).
HOSPITAL MANAGEMENT SYSTEM
A hospital management system is an information system that manages the aspects
of a hospital. This may include the administrative, financial, and medical
processing. It is an integrated end-to-end Hospital Management System that
provides relevant information across the hospital to support effective decision
making for patient care, hospital administration and critical financial accounting, in
a seamless flow. This program can look after Inpatients, OPD patients, records,
database treatments, status illness, billings etc. it also maintains their hospital info
such as ward id, Doctor in Charge, Department administering etc. Now with a
laboratory module to handle all lab operations...!!! Not only has this it also looked
after doctor and staff records and payments. Now with advanced features like LAN
connectivity, ICD10 disease database, Webcam support.
NEED OF HMS
1. Minimized documentation and no duplication of records.
2. Reduced paper work.
3. Improved Patient Care
4. Better Administration Control
5. Faster information flow between various departments
6. Smart Revenue Management
7. Effective billing of various services
8. Exact stock information
Software Requirement Specification (SRS)
1.6. Overview:-
Hospital Management System is a process of implementing all the activities
of the hospital in a computerized automated way to fasten the performance.
This project is to maintain the patient details, lab reports and to calculate the
bill of the patient. You can also manually edit any patient details and issue bill receipt
to patient within few seconds.
2. OVERALL DESCRIPTION
2.1. Product perspectives:-
This project gives the procedural approach how a patient gets treatment,
details about date of treatment and finally depending on different criteria like room
allocated, lab reports, treatment and medicine taken…..etc,how billing is calculated.
During billing health card facility is also considered.
2.2. Product Function:-
The data represented in hospital management application will perform the
following major function:-
Patient Details: - It includes inpatient and outpatient details.
Billing Details:-This software will help to calculate the bill much quicker and
simpler way. This enables the organization to keep the information in efficient
and systematic way.
3. SPECIFIC REQUIREMENTS
It describes all the details that the software developer need to know for designing
and developing the system. This is typically the largest and most important part of
the document.
3.1. External Interface Requirements:-
3.1.1. User Interface:-
User interface is designed in a user friendly manner and the user, in
another end he has to give the order, for that he will interface with keyboard and
mouse.
3.1.2. Hardware Interface:-
1) OS – windows
2) Hard disk – 80 GB
3) RAM – 1 GB
4) Keyboard – Standard QWERTY keyboard for interface
5) Mouse – Standard mouse with 2 buttons
3.1.3. Software Interface:-
1) Front end – OOP using C++
2) OS – Net Beans IDE 6.9.1
3) .Net Firmware
View Details :- This module is used to view the details of a previously admitted
patient.
Search :- This module searches the record of desired patient using his ID,
Name, City or Blood Group.
Patient ID ,Patient Name, Treatment Charges, Bed Charges and Other Charges
Total Amount which gives the total amount which the patient has to pay.
3.2.5. Updation module:-
This module used to store or produce the patient reports .This updates
patient info after each task.
4. SYSTEM FEATURES:
The users of the system should be provided the surety that their account is
secure. This is possible by following:
User authentication and validation of members using their member ID.
5.1
Reliability:
This application is a reliable product that produces fast and verified output of all its
processes.
Availability:
This application will be available to use and help them to carry out their operations
conveniently.
Security:
The application will be password protected. User will have to enter correct
username, password and role in order to access the application.
Maintainability:
The application will be designed in a maintainable manner. It will be easy to to
incorporate new requirements in the individual modules.
Portability:
The application will be easily portable on any windows-based system that has
oracle installed.
5.2 Data Dictionary:-
task()
PATIENT:
Add_patient()
View_details()
Search()
Discharge()
Prepare_bill()
ADDRESS:
House_no: int
Street: int
City: string
State: string
Country: string
BILL:
WEB REFERENCES:
1 .www.google.com
2. www.stackoverflow.com
CODE FOR HMS:::
void all::tasks()
{
T1.attempt=0;
T1.d_index=0;
cout<<"\n\n\t\t\t ***Hospital Management Tasks***"<<"\n";
cout<<"\n";
cout<<"\n\n\tPlease select a task to do..."<<"\n";
cout<<"\n\n\t1. Enter a new patient information "<<"\n";
cout<<"\t2. View detail of existing patient "<<"\n";
cout<<"\t3. Search by city or blood group"<<"\n";
cout<<"\t4. Delete entry "<<"\n";
cout<<"\t5. Recycle Bin "<<"\n";
cout<<"\t6. Prepare Bill "<<"\n";
cout<<"\t7. Exit "<<"\n\n\n";
cout<<"\a Enter your task serial : ";
cin>>task;
switch(task)
{
case 1:{
A1.enter_patient_info();
break;
}
case 2:{
A1.show_patient_detail();
break;
}
case 3:{
A1.search_menu();
break;
}
case 4:{
A1.delete_entry();
break;
}
case 5:{
A1.recycle_bin();
break;
}
case 6:{
A1.billing();
break;
}
case 7:{
A1.exit_function();
break;
}
default:
cout<<"\n\n\n\n\n\tInvalid task serial !!!"<<"\n";
cout<<"\tValid options are 1-6 !!!"<<"\n";
cout<<"\tPress any key to return to the main task menu....\a"<<"\n";
getch();
A1.tasks();
}
return ; //end of switch for task
} //end of function
void all::enter_patient_info()
{
if(T1.current==100) //to avoid overflow of data in the database
{
cout<<"\n\n\n\t Database is full !!! ";
cout<<"\n\t Sorry, you cannot enter any more information !!! ";
cout<<"\n\t Information of maximum 100 patients can be entered !!!! ";
cout<<"\n\t Press any key to return to the main menu....\a ";
getch();
A1.tasks();
}
answer='y';
if(T1.count==0)
T1.serial=1;
else
T1.i=T1.serial;
for(T1.i=T1.serial;answer=='y'||answer=='Y';T1.i++)
{
cout<<"\a";
T1.current++;
PI[T1.i].reg_no=T1.i;
T1.temp=T1.serial;
T1.entry_index[T1.i]=1;
cout<<"\n\n\t ***ENTERING INFORMATION FOR PATIENT SERIAL
NUMBER "<<T1.i<<" ***"<<"\n";
cin.get(ch);
cout<<"\nRegistration Number : "<<PI[T1.i].reg_no<<"\n\n";
cout<<"Enter the name of patient : ";
cin.getline(PI[T1.i].name,50);
while(strlen(PI[T1.i].name)==0)
{
cout<<"\a\nPlease enter a name : "; //if enter is pressed before entering a name
cin.getline(PI[T1.i].name,50);
cout<<"\n";
}
for(T1.k=1;T1.k<T1.serial;T1.k++) //loop to avoid duplicate entries
{
if(strcmp(PI[T1.i].name,PI[T1.k].name)==0) //if match is found
{
if(T1.entry_index[T1.k]==0) //if entry is already deleted
continue;
else //if entry still exists
{
T1.current-=1; //current no. of entries remains same
cout<<"\n\n\n\tThe patient is already admitted in the hospital !!!";
cout<<"\n\tWant to view info of this registration number in detail (Y/N) : \a";
cin>>T1.duplicate_answer;
while(T1.duplicate_answer!='Y'&&T1.duplicate_answer!='y'&&T1.duplicate_ans
wer!='N'&&T1.duplicate_answer!='n')
{
cout<<"\n\t\aPlease re enter a correct option (Y/N) : ";
cin>>T1.duplicate_answer;
}
if(T1.duplicate_answer=='y'||T1.duplicate_answer=='Y')
{
T1.entry_index[T1.i]=-1;
T1.regis=T1.k;
T1.d_index=1;
A1.show_patient_detail();
}
else
{
A1.tasks();
}
}
}
} //end of "for loop" to prevent duplicate entries
cout<<"\nSex ( 1-Male , 2-Female ) : ";
cin>>PI[T1.i].sex;
while(PI[T1.i].sex!=1&&PI[T1.i].sex!=2)
{
cout<<"\a\nInvalid input for sex of patient !!!";
cout<<"\nSex : ";
cin>>PI[T1.i].sex;
}
cout<<"\nMartial status( 1-Married , 2-Single ) : ";
cin>>PI[T1.i].martial_status;
while(PI[T1.i].martial_status<1||PI[T1.i].martial_status>2)
{
cout<<"\a\nInvalid input for martial status !!!"<<"\n";
cout<<"Enter a valid martial status : "<<"\n";
cin>>PI[T1.i].martial_status;
}
cin.get(ch);
cin>>PI[T1.i].bld_group;
} //end of while loop
} //end of switch
cin.get(ch);
void all::show_patient_detail()
{
if(T1.d_index==1)
{
T1.d_index=0;
cout<<"\n\n";
goto direct;
}
if(T1.current==0)
{
cout<<"\n\n\n";
cout<<"\tDatabase is empty !!!"<<"\n";
cout<<"\tPlease enter some information first. "<<"\n";
cout<<"\n\n\tDo you want to enter now (Y/N) : \a";
cin>>T1.enter_now;
while(T1.enter_now!='Y'&&T1.enter_now!='y'&&T1.enter_now!='N'&&T1.enter
_now!='n')
{
cout<<"\a\n\tPlease enter a correct option (Y/N) : ";
cin>>T1.enter_now;
}
if(T1.enter_now=='y'||T1.enter_now=='Y')
A1.enter_patient_info();
else
A1.tasks();
}
cout<<"\n\t\t****** CURRENT DATEBASE ENTRIES ******\n\n";
cout<<"\t\tRegistration no. Name of patient\n\n";
for(T1.j=1;T1.j<100;T1.j++)
{
if(T1.entry_index[T1.j]==1)
cout<<"\t\t "<<T1.j<<" "<<PI[T1.j].name<<"\n";
else
continue;
}
cout<<"\n\n\t\tPress 0 to return to main menu.... ";
cout<<"\n\n\nEnter registration number whose details you want to see : ";
cin>>T1.regis;
cout<<"\n\n";
cin.get(ch);
if(T1.regis==0)
A1.tasks();
T1.show_count++;
direct: //label for "goto" jump statement
if(T1.regis<=0)
{
cout<<"\n\n\tSorry, invalid registration number ";
cout<<"\n\tRegistration number starts from 1. ";
cout<<"\n\n\tPress any key to continue..... \a";
getch();
A1.show_patient_detail();
}
if(T1.regis>0&&T1.regis<T1.serial&&T1.entry_index[T1.regis]==0)
{
cout<<"\n\tSorry, the patient has left the hospital.";
cout<<"\n\tPress any key to continue..."<<"\n";
getch();
}
if((T1.regis<0||T1.regis>=T1.serial)&&T1.entry_index[T1.regis]==-1)
{
cout<<"\n\n\tSorry, the registration number is invalid ."<<"\n";
T1.entry=T1.serial-1;
if(T1.entry==1)
cout<<"\tOnly 1 record has been added .\n";
else
cout<<"\tOnly "<<T1.entry<<" records have been added .\n";
}
if(T1.regis>0&&T1.regis<T1.serial&&T1.entry_index[T1.regis]==1)
{
cout<<"\n\t ***INFORMATION FOR PATIENT REGISTRATION NUMBER
"<<T1.regis<<"***\n\n";
cout<<"\tName : "<<PI[T1.regis].name<<"\n";
cout<<"\tSex : ";
if(PI[T1.regis].sex==1)
cout<<"Male "<<"\n";
if(PI[T1.regis].sex==2)
cout<<"Female "<<"\n";
cout<<"\tBlood Group : ";
switch(PI[T1.regis].bld_group)
{
case 1:
cout<<"A+\n";
break;
case 2:
cout<<"A-\n";
break;
case 3:
cout<<"B+\n";
break;
case 4:
cout<<"B-\n";
break;
case 5:
cout<<"AB+\n";
break;
case 6:
cout<<"AB-\n";
break;
case 7:
cout<<"O+\n";
break;
case 8:
cout<<"O-\n";
} //end of switch
void all::billing()
{
char pn[25];
float bc,tc,oc,tot;
cout<<"\nPatient Name :\t";
cin>>pn;
cout<<"\nBed Charge :\t";
cin>>bc;
cout<<"\nTreatment Charge:\t";
cin>>tc;
cout<<"\nOther Charges :\t";
cin>>oc;
tot=bc+tc+oc;
cout<<"\n\n\nTotal Billing Charges :\t"<<tot;
cout<<"\a\n\n\n\tPress any key to return to the main task menu......."<<"\n";
getch();
A1.tasks();
} //end of function
void all::search_menu()
{
T1.ssi_count=0;
if(T1.current==0)
{
cout<<"\n\n\n";
cout<<"\tDatabase is empty !!!"<<"\n";
cout<<"\tPlease enter some information first. "<<"\n";
cout<<"\n\n\tDo you want to enter now (Y/N) : \a";
cin>>T1.enter_now;
while(T1.enter_now!='Y'&&T1.enter_now!='y'&&T1.enter_now!='N'&&T1.enter
_now!='n')
{
cout<<"\a\n\tPlease enter a correct option (Y/N) : ";
cin>>T1.enter_now;
}
if(T1.enter_now=='y'||T1.enter_now=='Y')
A1.enter_patient_info();
else
A1.tasks();
}
T1.search_number=0;
case 3:
A1.tasks();
break;
default:
cout<<"\a\n\n Invalid search criteria !!!"<<"\n";
cout<<" Valid options are 1 and 2 !!!"<<"\n";
cout<<" Press any key to return to the main searching menu....."<<"\n";
getch();
A1.search_menu();
} //end of switch
} //end of function
void all::search_city()
{
T1.search_count=0;
T1.search_number++;
cout<<"\n\n\n";
for(T1.index=1;T1.index<T1.serial;T1.index++)
{
if((strcmp(PI[T1.index].AD1.city,s_city))==0)
{
if(T1.entry_index[T1.index]==0)
continue;
if(T1.search_count==0)
cout<<"\t\tRegistration no. Name of patient\n\n";
cout<<"\n\t\t "<<T1.index<<"\t\t"<<PI[T1.index].name;
T1.search_count++;
}
}
if(T1.search_number==1)
{
cout<<"\a\n\n\n\t\t Search is complete !!! "<<"\n";
if(T1.search_count==0)
{
cout<<"\t\t No result found !!!"<<"\n\n\n";
cout<<"\t\t Press any key to continue.....";
getch();
A1.after_search_options();
}
if(T1.search_count>1)
cout<<"\t\t "<<T1.search_count<<" results found !!! "<<"\n\n\n";
if(T1.search_count==1)
cout<<"\t\t "<<T1.search_count<<" result found !!! "<<"\n\n\n";
}
if(T1.search_number==1)
{
cout<<"\n\n\t\tWant to view in detail : ";
cin>>after_search_answer;
while(after_search_answer!='y'&&after_search_answer!='Y'&&after_search_answ
er!='N'&&after_search_answer!='n')
{
cout<<"\a\n\n\t\tPlease enter a correct option .";
cout<<"\n\t\tDo you want to view in detail (Y/N): ";
cin>>after_search_answer;
}
if(after_search_answer=='y'||after_search_answer=='Y')
{
cout<<"\n\n\n\t\tWhich registration number : ";
cin>>T1.index;
A1.search_show_info();
}
else
A1.after_search_options();
}
else
{
cout<<"\n\n\n\t\tWhich registration number : ";
cin>>T1.index;
A1.search_show_info();
}
} //end of function
void all::search_blood_group()
{
T1.search_count=0;
T1.search_number++;
cout<<"\n\n\n";
for(T1.index=1;T1.index<T1.serial;T1.index++)
{
if(s_group==PI[T1.index].bld_group)
{
if(T1.entry_index[T1.index]==0)
continue;
if(T1.search_count==0)
cout<<"\t\tRegistration no. Name of patient\n\n";
cout<<"\n\t\t "<<T1.index<<"\t\t"<<PI[T1.index].name;
T1.search_count++;
}
}
if(T1.search_number==1)
{
cout<<"\a\n\n\n\t\t Search is complete !!! "<<"\n";
if(T1.search_count==0)
{
cout<<"\t\t No matching result found !!!"<<"\n\n\n";
cout<<"\t\t Press any key to continue.....";
getch();
A1.after_search_options();
}
if(T1.search_count>1)
cout<<"\t\t "<<T1.search_count<<" results found !!! "<<"\n\n\n";
if(T1.search_count==1)
cout<<"\t\t "<<T1.search_count<<" result found !!! "<<"\n\n\n";
}
if(T1.search_number==1)
{
cout<<"\n\n\t\tWant to view in detail (y/n): ";
cin>>after_search_answer;
while(after_search_answer!='y'&&after_search_answer!='Y'&&after_search_answ
er!='N'&&after_search_answer!='n')
{
cout<<"\a\n\n\t\tPlease enter a correct option (y/n)";
cout<<"\n\t\tDo you want to view in detail : ";
cin>>after_search_answer;
}
if(after_search_answer=='y'||after_search_answer=='Y')
{
cout<<"\n\n\n\t\tWhich registration number : ";
cin>>T1.index;
A1.search_show_info();
}
else
A1.after_search_options();
}
else
{
cout<<"\n\n\n\t\tWhich registration number : ";
cin>>T1.index;
A1.search_show_info();
}
} //end of function
void all::search_show_info()
{
T1.ssi_count++;
cout<<"\n\n";
if(T1.index<=0)
{
cout<<"\n\n\tSorry, invalid registration number !!!";
cout<<"\n\tRegistration number starts from 1 ";
cout<<"\n\tPress any key to continue.........\n";
getch();
switch(T1.search_index)
{
case 1:
A1.search_city();
break;
case 2:
A1.search_blood_group();
break;
} //end of switch
}
if(T1.entry_index[T1.index]==0)
{
cout<<"\n\n\tSorry, the patient has left the hospital ."<<"\n";
cout<<"\tPress any key to continue ....\a"<<"\n";
getch();
switch(T1.search_index)
{
case 1:
A1.search_city();
break;
case 2:
A1.search_blood_group();
break;
} //end of switch
}
if(T1.entry_index[T1.index]==-1||T1.index>=T1.serial)
{
cout<<"\n\n\t\tSorry, the registration number in invalid ."<<"\n";
T1.entry=T1.serial-1;
if(T1.entry==1)
cout<<"\t\tOnly 1 record has been added .\n";
else
cout<<"\t\tOnly "<<T1.entry<<" records have been added .\n";
cout<<"\t\tPress any key to continue....\a"<<"\n";
getch();
switch(T1.search_index)
{
case 1:
A1.search_city();
break;
case 2:
A1.search_blood_group();
break;
} //end of switch
}
cout<<"\n";
T1.ssi_count=0;
cout<<"\n\t ***INFORMATION FOR PATIENT REGISTRATION NUMBER
"<<T1.index<<"***\n\n";
cout<<"\tName : "<<PI[T1.index].name<<"\n";
cout<<"\tSex : ";
if(PI[T1.index].sex==1)
cout<<"Male "<<"\n";
if(PI[T1.index].sex==2)
cout<<"Female "<<"\n";
cout<<"\tBlood Group : ";
switch(PI[T1.index].bld_group)
{
case 1:
cout<<"A+\n";
break;
case 2:
cout<<"A-\n";
break;
case 3:
cout<<"B+\n";
break;
case 4:
cout<<"B-\n";
break;
case 5:
cout<<"AB+\n";
break;
case 6:
cout<<"AB-\n";
break;
case 7:
cout<<"O+\n";
break;
case 8:
cout<<"O-\n";
break;
} //end of switch
while(after_search_answer!='Y'&&after_search_answer!='y'&&after_search_answ
er!='N'&&after_search_answer!='n')
{
cout<<"\a\n\tPlease enter a correct option (Y/N) : ";
cin>>after_search_answer;
}
if(after_search_answer=='y'||after_search_answer=='Y')
{
switch(T1.search_index)
{
case 1:
A1.search_city();
break;
case 2:
A1.search_blood_group();
} //end of switch
}
else
A1.after_search_options();
} //end of function
void all::after_search_options()
{
cout<<"\n\n\n\n\t\tWHAT DO U WANT TO DO NOW ?"<<"\n";
cout<<"\t\t1. Search again "<<"\n";
cout<<"\t\t2. Return to main task menu "<<"\n";
cout<<"\n\tEnter your choice : ";
cin>>T1.after_search_choice;
cout<<"\n";
switch(T1.after_search_choice)
{
case 1:
T1.ssi_count=0;
A1.search_menu();
break;
case 2:
T1.ssi_count=0;
A1.tasks();
break;
default:
cout<<"\a\n\n\tInvalid option requested !!!"<<"\n";
cout<<"\tPress any key to return to the main searching menu..."<<"\n";
getch();
A1.search_menu();
} //end of switch
} //end of function
void all::delete_entry()
{
if(T1.current==0)
{
cout<<"\n\n\n";
cout<<"\tDatabase is empty !!!"<<"\n";
cout<<"\tPlease enter some information first. "<<"\n";
cout<<"\n\n\tDo you want to enter now (Y/N) : \a";
cin>>T1.enter_now;
while(T1.enter_now!='Y'&&T1.enter_now!='y'&&T1.enter_now!='N'&&T1.enter
_now!='n')
{
cout<<"\a\n\tPlease re-enter a correct option (Y/N) : ";
cin>>T1.enter_now;
}
if(T1.enter_now=='y'||T1.enter_now=='Y')
A1.enter_patient_info();
else
A1.tasks();
}
cout<<"\n\t\t ***CURRENT DATABASE ENTRIES***\n\n";
cout<<"\t\tRegistration no. Name of patient\n\n";
for(T1.j=1;T1.j<T1.serial;T1.j++)
{
if(T1.entry_index[T1.j]==0)
continue; //to ignore deleted items
if(T1.entry_index[T1.j]==1)
{
T1.delete_show++;
cout<<"\t\t "<<T1.j<<" "<<PI[T1.j].name<<"\n";
}
}
if(T1.delete_show==0)
{
cout<<"\n\tDatabase is currently empty!!!\a";
cout<<"\n\tPress any key to continue....";
getch();
A1.tasks();
}
cout<<"\n\n\tPress 0 to return to main menu and 101 to delete all entries... ";
cout<<"\n\n\n\t Or enter the registration no. from 1 to 100 you want to delete ? ";
cin>>en_del_index;
if(en_del_index==101)
{
cout<<"\n\tWarning : You are about to delete all entries !!!\a";
cout<<"\n\tAre you sure you want to do this : ";
cin>>T1.delete_all_confirm;
while(T1.delete_all_confirm!='Y'&&T1.delete_all_confirm!='y'&&T1.delete_all_c
onfirm!='N'&&T1.delete_all_confirm!='n')
{
cout<<"\n\tSorry, wrong input !!!";
cout<<"\n\tPlease enter a valid choice (Y/N) : \a";
cin>>T1.delete_all_confirm;
}
if(T1.delete_all_confirm=='y'||T1.delete_all_confirm=='Y')
{
for(T1.f=1;T1.f<=100;T1.f++)
{
if(T1.entry_index[T1.f]==1)
{
T1.current--;
T1.entry_index[T1.f]=0;
}
}
cout<<"\n\n\tAll entries have been succesfully deleted!!!";
cout<<"\n\tPress any key to return to the main menu...\a";
getch();
A1.tasks();
}
else
{
cout<<"\n\tNo entries have been deleted.";
cout<<"\n\tPress any key for more options....";
getch();
A1.after_delete_options();
}
}
if(en_del_index==0)
A1.tasks();
if(en_del_index>0&&en_del_index<T1.serial&&T1.entry_index[en_del_index]==
1)
{
cout<<"\n\n\tAre you sure you want to delete entry "<<en_del_index<<" (Y/N) ?
";
cin>>delete_confirm;
while(delete_confirm!='Y'&&delete_confirm!='y'&&delete_confirm!='N'&&delet
e_confirm!='n')
{
cout<<"\a\n\tPease re-enter a correct option (Y/N) ? ";
cin>>delete_confirm;
}
if(delete_confirm=='y'||delete_confirm=='Y')
{
T1.entry_index[en_del_index]=0; //entry now deleted. index value set to 0
T1.current--;
cout<<"\n\tEntry succesfully deleted.\n";
cout<<"\tPress any key to continue.....\a";
getch();
A1.after_delete_options();
}
else
{
T1.entry_index[en_del_index]=1; //entry not deleted. default index value(1) kept
cout<<"\n\tEntry not deleted ";
cout<<"\n\tPress any key to continue.......";
getch();
A1.after_delete_options();
}
}
if(en_del_index>0&&en_del_index<T1.serial&&T1.entry_index[en_del_index]==
0)
{
cout<<"\n\n\tSorry, the patient has already left the hospital ."<<"\n";
cout<<"\n\tPress any key to continue...\a"<<"\n";
getch();
A1.delete_entry();
}
else
{
cout<<"\n\n\tSorry, Invalid registration number ."<<"\a\n";
T1.entry=T1.serial-1;
if(T1.entry==1)
cout<<"\tOnly 1 record has been added .\n";
else
cout<<"\tOnly "<<T1.entry<<" records were added and "<<T1.current<<" are
present now.\n";
cout<<"\tPress any key to continue..."<<"\n";
getch();
A1.delete_entry();
}
} //end of function
void all::after_delete_options()
{
cout<<"\n\t\tWHAT DO YOU WANT TO DO NOW ?";
cout<<"\n\t\t1. Delete more entries ";
cout<<"\n\t\t2. Return to main menu "<<"\n";
cout<<"\n\t\tPlease enter your choice : ";
cin>>delete_choice;
while(delete_choice!=1&&delete_choice!=2)
{
cout<<"\a\n\n\tSorry, wrong choice .";
cout<<"\n\tValid choices are 1 and 2. ";
cout<<"\n\tPlease re-enter your choice : ";
cin>>delete_choice;
}
switch(delete_choice)
{
case 1:
A1.delete_entry();
break;
case 2:
A1.tasks();
} //end of switch
} //end of function
void all::recycle_bin()
{
T1.delete_count=0;
if(T1.serial==0)
{
cout<<"\n\n\n";
cout<<"\tDatabase is empty !!!"<<"\n";
cout<<"\tPlease enter some information first. "<<"\n";
cout<<"\n\n\tDo you want to enter now (Y/N) : \a";
cin>>T1.enter_now;
while(T1.enter_now!='Y'&&T1.enter_now!='y'&&T1.enter_now!='N'&&T1.enter
_now!='n')
{
cout<<"\a\n\tPlease enter a correct option (Y/N) : ";
cin>>T1.enter_now;
}
if(T1.enter_now=='y'||T1.enter_now=='Y')
A1.enter_patient_info();
else
A1.tasks();
}
cout<<"\n\t\t ****** DELETED ENTRIES ******\n\n";
cout<<"\t\tRegistration no. Name of patient\n\n";
for(T1.d=1;T1.d<T1.serial;T1.d++)
{
if(T1.entry_index[T1.d]==0)
{
cout<<"\t\t "<<T1.d<<" "<<PI[T1.d].name<<"\n";
T1.delete_count++;
}
else
continue;
}
if(T1.delete_count==0)
{
T1.delete_count=0;
cout<<"\n\n\n\tNo entry is currently in recycle bin.";
cout<<"\n\tPress any key to return to the main menu...\a";
getch();
A1.tasks();
}
cout<<"\n\n\tPress 0 to return to main menu and 101 to restore all items... ";
cout<<"\n\n\n\tWhich item to restore : ";
cin>>T1.restore_serial;
if(T1.restore_serial==0)
A1.tasks();
if(T1.restore_serial==101)
{
cout<<"\n\n\tAre you sure you want to restore all the entries : ";
cin>>T1.restore_all_confirm;
while(T1.restore_all_confirm!='Y'&&T1.restore_all_confirm!='y'&&T1.restore_al
l_confirm!='N'&&T1.restore_all_confirm!='n')
{
cout<<"\n\n\tPlease re-enter a corrent option : ";
cin>>T1.restore_all_confirm;
}
if(T1.restore_all_confirm=='y'||T1.restore_all_confirm=='Y')
{
for(T1.e=1;T1.e<=100;T1.e++)
if(T1.entry_index[T1.e]==0)
{
T1.current++;
T1.entry_index[T1.e]=1;
}
cout<<"\n\tAll deleted items have been succesfully restored.";
cout<<"\n\tPress any key to return to the main menu...";
getch();
A1.tasks();
}
else
{
cout<<"\n\n\tNo entry has been restored.";
cout<<"\n\tPress any key to view the recycle bin...\a";
getch();
A1.recycle_bin();
}
}
if(T1.entry_index[T1.restore_serial]==0)
{
cout<<"\n\tAre you sure you want to restore entry "<<T1.restore_serial<<" : ";
cin>>T1.restore_confirm;
while(T1.restore_confirm!='Y'&&T1.restore_confirm!='y'&&T1.restore_confirm!
='N'&&T1.restore_confirm!='n')
{
cout<<"\n\n\tInvalid input !!! ";
cout<<"\n\tPease re-enter a correct option (Y/N) : \a";
cin>>T1.restore_confirm;
}
if(T1.restore_confirm=='Y'||T1.restore_confirm=='y')
{
T1.current++;
T1.delete_count=0;
T1.entry_index[T1.restore_serial]=1; //index value set to 1
cout<<"\n\tEntry succesfully restored!!!";
cout<<"\n\tPress any key to continue....\a";
getch();
A1.after_restore();
}
else
{
cout<<"\n\tEntry not restored!!!"; //index value kept 0
cout<<"\n\tPress any key to continue...\n\a";
getch();
A1.after_restore();
}
}
if(T1.entry_index[T1.restore_serial]==1)
{
cout<<"\n\tThe entry is already present in the database.";
cout<<"\n\tPress any key to continue...";
getch();
A1.recycle_bin();
}
if(T1.restore_serial<0||T1.restore_serial>100||T1.entry_index[T1.restore_serial]==-
1)
{
cout<<"\n\tInvalid serial number";
cout<<"\n\tPress any key to continue...";
getch();
A1.recycle_bin();
}
} //end of function
void all::after_restore()
{
cout<<"\n\n\n\t\tWHAT DO YOU WANT TO DO NOW? ";
cout<<"\n\t\t1. Restore more entries ";
cout<<"\n\t\t2. Return to main manu ";
cout<<"\n\n\t\tPlease enter your choice : ";
cin>>T1.after_restore_choice;
switch(T1.after_restore_choice)
{
case 1:
A1.recycle_bin();
break;
case 2:
A1.tasks();
break;
default:
cout<<"\n\n\n\tSorry, wrong choice ";
cout<<"\n\tValid choices are 1 and 2 ";
cout<<"\n\tPress any key to continue......";
getch();
A1.after_restore();
}
} //end of function
void all::exit_function()
{
if(T1.serial==0)
{
cout<<"\n\n\n\n\tYou have not used the software.";
cout<<"\n\tIt is recommended that you should not exit.";
cout<<"\n\tPress any key to continue......\a";
getch();
cout<<"\n\n\n\tAre you sure you want to exit (Y/N) ? ";
cin>>exit_answer;
while(exit_answer!='Y'&&exit_answer!='y'&&exit_answer!='N'&&exit_answer!='
n')
{
cout<<"\n\n\tInvalid input !!! ";
cout<<"\n\tPease re-enter a correct option (Y/N) : \a";
cin>>exit_answer;
}
if(exit_answer=='y'||exit_answer=='Y')
{
cout<<"\a";
exit ;
}
else
A1.tasks();
}
cout<<"\n\n\n\t\t\t ***SOFTWARE DETAILS***\n";
cout<<"\n\n\tDeveloper : Sakshi , Shweta , Sanjit "<<"\n";
cout<<”\n NATIONAL INSTITUTE OF TECHNOLOGY KURUKSHETRA\n”;
cout<<"\tProgramming Language : C++ "<<"\n";
cout<<"\n\tHope you like it..."<<"\n";
cout<<"\n\n\tThanks for trying this "<<"\n";
cout<<"\n\n\n\tPress any key to continue........"<<"\n";
getch();
exit(0);
} //end of function