Anda di halaman 1dari 70

A Project Report

ON

HOSPITAL MANAGEMENT SYSTEM


Submitted in partial fulfillment of the requirement for the award of the

BACHELOR OF COMPUTER APPLICATION I.C.E INSTITUTE OF COMPUTER EDUCAITON BILASPUR CHHATTISGARH

Session 2010-2011

Guided by:By:-

Submitted

ABOUT THE UNIVERSITY

Eradication of illiteracy has been identified as one of the major mission for raising the quality of life of the people development of vocational skill and professional competence is essential for employment of the youth. Researches are necessary for developing the need based programs for community and social development & economy of the people. Only a special type of university can meet such educational expedience, that will test his or her creative at all levels and also that student has the opportunity to develop personality and intellectually and to nourish and concern for the making. For all these needs there was a constant demand for the establishment of a central university of Bilaspur, specially to promote the educational interest of the members of scheduled castes and tribes and other segments of the population, which apart from improving their educational back wardens of majority of the population. The state government for establishing the education and economics interest of the weaker section of the people as per requirement of the article-46 of the constitution our longstanding as fulfilled, when state legislation assembly amended Madhya Pradhesh Vishwavidyalaya Adhiniyam (1983), which was inaugurated by to honorable chief minister of MP in order to perpetuate the memory of satnami saint Guru Ghasidas, the University was named other him. The president jurisdiction of the University is conterminous with Bilaspur reroute, diners composing, Raigar, Sarguna and Bilaspur, Korba, Jangir-Champa Dissts. It is situated ina peaceful area 6 KM apart from the city. At present it is on affiliated and teaching University, There are 71 Colleges affiliated to the University and 6 autonomous college.

ABOUT THE BCA COURSE Computer has come to stay as the most face of the man. As on industry it has been making long strides. The young girls have had challenge opportunities have been thrown open for them by computer. The expected large number of computer professional required in the last decade of center. To direct and control the human life, is about 4 lakhs. This course that we offered at the university, is a meaningful contribution toward the enormous manpower that will be required to man almost every human activity in the present time, setting the pattern the pattern of our further in the 21th century. The BCA course almost the whole computer application to every discipline. Apart from programming language like C and COBOL, modern package for database management, spreadsheets and word processing, this course has very significantly made us familiar with two separate operating system platforms a multi-user system and DOS a single user system. Our well equipped instructors have told us also about as how the menace of viruses surfaces before the computer user. The project work has provide to be most. Important source of knowledge to us. It was during this period of project that we had an opportunity to the development work at organization we were at the practical aspects of the use of computer. Undoubtedly, this course opened new avenues for the enhancement of our carriers. We hope to face the present and future with a grater self-confidence, armed as we are with the key to open up and tackle the challenging situations thrown up by the standing achievements of the modern science and technology. Infact, the generation of computer has provided us with the knowledge of the great. Potentiality that computer has inherent within. We know we have to ready to face the explosion already set in rection.

CONTENTS 1. PROJECT WORK EVALUATION 2. CRETIFICATE 3. SEIF-CRETIFICATE 4. ACKNOWLEDGEMENT 5. DECLARATION 6. SCOPE OF PROJECT 7. USER REQUIREMENT 8. THEORY ABOUT DATA CENTERED ARCHITECTURE 9. OBJECT ORIENTED DATA CENTERED APPROACH 10. PRODUCT PRESPECTIVE 11. SYSTEM REQUIREMENT 12. DATA FLOW DIAGRAM 13. HISTORY/INTRODUCTION OF C++ 14. COADING 15. OUTPUT 16. LIMITATION 17. CONCLUSION 18. BIBLIOGRAPHY

GURU GHASIDAS UNIVERSITY, BILASPUR, CHHATTISGARH PROJECT WORK EVALUATION 1. Candidate 2. Project Title 3. Software Base 4. Study Center Code, Name & Address 5. Submitted fro Course & Year 6. Group Evalution (Project Reports & CD Evaluation marks) Particulars Marks out of Mark Awarded Internal Examiners Name & Signature --------------------------------------Hospital Management System Progamming in C++ --------------------------------------BCA 2010-2011

7. Forwarding by HOD -----------------------------(Signature, Name, Study Center Seal) 8. Remarks of Study Center 9. Remark of University Examiner -------------------------------------------------------------

CRETIFICATE This is to certify that the project report work HOSPITAL MANAGEMENT SYSTEM for Jai Ambe Nursing Home, Bilaspur (CG) is done by Radhika Shukla, Shraddha Sarna and Nikita Kumar in Partial fulfillment of Bachelor of Computer Application Examination under the Guru Ghasidas University, Bilsapur, CG. This project report or similar report on the topic has not been submitted for any other examination and does not form part of any other course undergone by the student.

Date: --------------------

Guide ------------------------------------

SEIF-CRETIFICATE This is to certify that the project report work HOSPITAL MANAGEMENT SYSTEM for Jai Ambe Nursing Home, Bilaspur (CG) is done by us is an authentic work carried out for the partial fulfillment of the requirement of the award of the Bachelor of Computer Application under the guidance of Mr. Vishwash Victor the matter embodied in this project work has not been submitted earlier for award of any degree/diploma to the best of my knowledge and belief.

Signature of the Student --------------------------------------

ACKNOWLEDGEMENT I owe a great many thanks to a great many people who helped and supported me during the writing of this book. My deepest thanks to Lecturer, -----------------, HOD the Guide of the project for guiding and correcting various documents of mine with attention and care. He has taken pain to go through the project and make necessary correction as and when needed. I express my thanks to the Principal of-------------------University, Bilaspur, (CG), for extending his support. Jai Ambe Nursing Home, Bilaspur, (CG), support and guidance. Thanks and appreciation to the helpful people at Jai Ambe Nursing Home for their support. I would also thank my Institution and my faculty members without whom this project would have been a distant reality. I also extend my heartfelt thanks to my family and well wishers.

Name: ---------------------------

Signature

Declaration
I hereby declare that the project report entitled Hospital Management System submitted in partial fulfillments of the BCA is the record of my original work under the guidance of Prof. Ramesh Pratap Singh Parihar, HOD, Department of Computer Science, D.P. Vipra PG Colllege, Bilaspur, (CG) Name: Radhika Shukla Sharaddha Sarna Nikita Kumar Signature -----------------------------------------------------------

This project report or similar report on the topic has not been submitted for any other examination and does not form part of any other course undergone by the student.

(Signature of Internal Guide) Date: Guide ----------------------

Scope of Project
1.1 IMPROVED SERVICES An objective of the proposed system is to improve the existing system's services, in order to: Increase employer and employee satisfaction Provide the quality Create a controlled information management environment 1.2 BETTER PERFORMANCE It is an objective of our proposed system to provide better performance which is managed by providing Desired flexibility Fast response Ability to support changes. Ability to maintain the quality of services. 1.3 EFFICIENT GUI One of the objectives of the proposed system is to provide a user friendly GUI, that will enable the user to work on clicks and make the information transfer possible with the most common I/O devices. 1.4 MORE INFORMATION An objective of our proposed system is to develop a system that will eliminate the problem of insufficient and incomplete information. 1.5 DECISION SUPPORT By providing the facility of what-if analysis, we will make a decision support system. 1.6 STRONGER CONTROLS The proposed system will have stronger controls. Controls like passwords, various levels of user access and option will be added. 1.7 ELIMINATION OF RUNNING COST We are going to develop the proposed system with an objective to eliminate the running cost by overcoming the continuous stationery expenses, manual storage need, and extra staff in the information resource department of the Organization .

User Requirement
In the above proposed system single category of authenticated users are there that is the Hospital staff.

After the product has been delivered the staff will be trained by our development team. We also propose to provide a help document for the pathent which will help them in using the product efficiently.

Theory about Data centered architecture:


A Data store resides at the center of this architecture and is accessed frequently by other components that modify info, checks availability of room, allocate room, bill function, create bill or otherwise get function info within the Hospital Management System. A data-centered architecture promotes integrability.

Object oriented Data centered approach


The components of a system encapsulate data and the operations that must be applied to manipulate data. Communication and coordination between components is accomplished via message passing.

PRODUCT PRESPECTIVE
This project helps to define internal boundaries achieving the appropriate balance between the general and the specific, Hospital management giving a positive and efficient workflow to the staff of the Hospital, thereby helping the business model of the Hospital to expand. In principle the product exposes a simple and general interface and hides the specific and complex implementation based. In our example, we want our Hospital design to hide detail that is too complex or unnecessary, thereby reducing paperwork and increasing efficiency. Also through this project we aim to reduce operating costs and increase throughput of the staff.

SYSTEM REQUIREMENT
HARDWARE AND SOFTWARE REQUIREMENTS The platform used is C++. Hence we decided to use Microsoft Visual Studio 2008 edition (Professional Edition). Since BGI graphics arent supported in the Visual studio so for actually running the software we used Borland C++ compiler 3.0 which was recently made free by Borland Inc. For optional coding and easy debugging we used Microsoft Visual Studio 2008 edition and made explicit .cpp files. Henceforth for optimal usage of such a software a windows based operating system preferably Windows vista must be there. Also on the hardware part any system having Windows Vista installed will suffice.

DATA FLOW DIAGRAM


JAI AMBE NURSING HOME Registration Process Data Store

Doctor Details

Call By Data

Process

Show Details

Reports

Print Bill

Process

To Exit

To Exit

Process

Close the program

History/Introduction of C++
Bjarne Stroustrup began work on "C with Classes" in 1979. The idea of creating a new language originated from Structures experience in programming for his Ph.D. thesis. Structure found that Simula had features that were very helpful for large software development, but the language was too slow for practical use, while BCPL was fast but too low-level to be suitable for large software development. When Structure started working in AT&T Bell Labs, he had the problem of analyzing the UNIX kernel with respect to distributed computing. Remembering his Ph.D. experience, Structure set out to enhance the C language with Simula-like features. C was chosen because it was general-purpose, fast, portable and widely used. Besides C and Simula, some other languages that inspired him were ALGOL 68, Ada, CLU and ML. At first, the class, derived class, strong type checking, inclining, and default argument features were added to C via Structures C++ to C compiler, Front. The first commercial implementation of C++ was released on October 14, 1985

COADING
/* ************************************************** * Project: * * Simulation of hospital Management Software * ************************************************** */ #include<iostream.h> //for input and output stream regulation #include<process.h> //for exit() #include<string.h> //for strlen() and strcmp() #include<conio.h> //for getch() and clrscr() #include<stdio.h> #include<fstream.h> #include<graphics.h> ///// ///// ///// class all //declaration for class "all" { private: struct address { int house; char city[30]; char dist[30]; char state[30]; char street[30]; char country[30]; }; struct doctor { char name[20],div[20],add[40],cn[10]; int age,ii; }doc; struct age { int day; int month; int year; }; struct patient_info

{ age A1; //nested structure inplemented address AD1; //nested structure implemented int sex; int reg_no; int bld_group; char name[50]; int martial_status; }PI[100]; int task; protected: //functions declared void search_menu(); void search_city(); void exit_function(); void search_show_info(); void search_blood_group(); void enter_patient_info(); void show_patient_detail(); void after_search_options(); void after_restore(); public: void tasks(); void recycle_bin(); void delete_entry(); void billing(); void after_delete_options(); void showdata(); void putdata(); void rn(); int s_group; int s_choice; int en_del_index; int delete_choice; char ch; char answer; char answer1; char s_city[30]; char exit_answer; char delete_confirm; char after_search_answer; }d; //end of class "all" class date //declaration for class "date" { private: int date; int month;

int year; public: void enter_date(); void show_date(); }; //end of class "date" class dob //declaration for class "dob" { private: struct dob1 { int date; int month; int year; int rem; }DOB11[100]; public: char birth_answer; void show_date(); void enter_date(); void search_show_date(); }; //end of class "dob" class temp //declaration for class "temp" { public: int m; //temporary variables declared with global scope int i; int j; int k; int d; int e; int f; int rem; int temp; int count; int regis; int index; int entry; int serial; int attempt; int current; int d_index; int ssi_count; int show_count; int delete_show;

int search_index; int search_count; int current_year; int delete_count; int search_number; int restore_serial; int delete_attempt; int restore_attempt; int entry_index[100]; int after_search_choice; int after_restore_choice; char enter_now; char restore_confirm; char duplicate_answer; char delete_all_confirm; char restore_all_confirm; char after_search_answer; temp() //constructor for temp invoked { i=0; j=0; d=0; e=0; f=0; serial=0; current=0; d_index=0; ssi_count=0; show_count=0; delete_show=0; delete_count=0; delete_attempt=0; restore_attempt=0; }; //end of constructor for temp }; all A1; date D1; dob DOB1; temp T1; void main() { T1.count=0; //destructor for temp invoked //end of class "temp" //object for class "all" declared //object for class "date" declared //object for class "dob" declared //object for class "temp" declared //main function

for(T1.m=1;T1.m<=100;T1.m++) //default index value set to -1 for each entry { T1.entry_index[T1.m]=-1; } cout<<"Welcome to..."<<"\n"; cout<<"\n\n\t\t\t***HOSPITAL MANAGEMENT SOFTWARE***"<<"\n"; cout<<"\n\t\t\t By Radhika Shukla, Shraddha Sarna, Nikita Kumar "<<"\n"; D1.enter_date(); A1.tasks(); } //end of main function void all::putdata() { cout <<"\n Name = "; cin >>doc.name; cout <<"\n Age = "; cin >>doc.age; cout <<"\n Specialist = ";cin>>doc.div; cout <<"\n Contact No.= ";cin>>doc.cn; cout <<"\n Address = ";cin>>doc.add; //** } void all::showdata() { //** cout << "\n Name = " <<doc.name; cout << "\n Age = " <<doc.age; cout<< "\n Specialist="<<doc.div; cout<< "\n Contact No= "<< doc.cn; cout<< "\n Address = " << doc.add; } void all::rn() { clrscr(); all per; cout<<"\n\n\t\t1. add"; cout<<"\n\n\t\t2. view"; cout<<"\n\n\t\t3. Back"; cout<<"\n\n\t\t\tEnter Choice:\t"; cin>>doc.ii; switch(doc.ii) { case 1: per.putdata(); ofstream outfile("all.txt"); // Open the file in output mode outfile.write((char*)&per, sizeof(per)); // Write the object into the file tasks(); break; case 2:

ifstream infile; // create input file infile.open("all.txt"); // open the file infile.seekg(0, ios::end); // go to end from 0 byte int endposition = infile.tellg(); // find where we are int n = endposition/sizeof(all); // number of persons int position = (n-1) * sizeof(all); // number times size infile.seekg(position); infile.read( (char*)&per, sizeof(per) ); per.showdata(); // display the person cout<<"press any key to back......"; int rr=getch(); tasks(); break; case 3: tasks(); break; default: cout<<"\n\nInvalid Choice"; break; } getch(); }

void all::tasks() { clrscr(); T1.attempt=0; T1.d_index=0; T1.delete_attempt=0; D1.show_date(); textcolor(2); cout<<"\n\n\t\t\t***HOSPITAL MANAGEMENT SOFTWARE***"<<"\n"; cout<<"\t\t\t By Radhika Shukla, Shraddha Sarna, Nikita Kumar "<<"\n"; cout<<"\t\t\t Guided By Ramesh Singh Parihar"; cout<<"\n\n\t\t\t ***Hospital Management Tasks***"<<"\n"; cout<<"\t\t\t *******************************"<<"\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. Doctor Information"<<"\n"; cout<<"\t8. 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:{ rn(); break; } case 8:{ exit(0); } default:{ clrscr(); 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(); clrscr(); A1.tasks(); }

} }

//end of switch for task //end of function

void date::enter_date() { clrscr(); cout<<"\n\nFirst of all I need the current date ..."<<"\n"; cout<<"\nYear : "; cin>>year; while(year<2000||year>10000) { clreol(); cout<<"\aInvalid input for year !!!"<<"\n"; clreol(); cout<<"Please enter the year correctly : "<<"\n"; cin>>year; } T1.current_year=year; cout<<"Month : "; clreol(); cin>>month; while(month<=0||month>12) //if month is greater then 12 or less then 1 { clreol(); cout<<"\nInvalid input for month !!!"<<"\n"; clreol(); cout<<"Please enter the month correctly : \a"<<"\n"; clreol(); cin>>month; } cout<<"Date : "; clreol(); switch(month) { case 1: case 3: case 5: case 7: case 8: case 10: case 12:{ cin>>date; while(date<1||date>31) //for months with 31 days { cout<<"\aInvalid date !!!"<<"\n"; cout<<"Again enter the date : "<<"\n";

clreol(); cin>>date; } break; } case 2:{ cin>>date; //for february if(year%4==0) { while(date<0||date>29) //for leap year { cout<<"\aInvalid date !!!"<<"\n"; cout<<"Again enter the date : "<<"\n"; clreol(); cin>>date; } } else { while(date<0||date>28) //for non-leap year { cout<<"\aInvalid date !!!"<<"\n"; cout<<"Again enter the date : "<<"\n"; clreol(); cin>>date; } } break; } default:{ //for other months with 30 days cin>>date; while(date<1||date>30) { cout<<"\aInvalid date !!!"<<"\n"; cout<<"Again enter the date : "<<"\n"; clreol(); cin>>date; } break; } } //end of switch } //end of function void date::show_date() { clrscr();

cout<<"Hello....\n It's "; cout<<date; T1.rem=date%10; switch(date) { case 11: case 12: case 13: case 14: case 15: case 16: case 17: case 18: case 19: case 20:{ cout<<"th "; goto over; } } switch(T1.rem) { case 1:{ cout<<"st "; break; } case 2:{ cout<<"nd "; break; } case 3:{ cout<<"rd "; break; } default:{ cout<<"th "; break; } } //end of switch over: //label for jump statement switch(month) { case 1:{ cout<<"January , "; break; } case 2:{

cout<<"February , "; break; } case 3:{ cout<<"March , "; break; } case 4:{ cout<<"April , "; break; } case 5:{ cout<<"May , "; break; } case 6:{ cout<<"June , "; break; } case 7:{ cout<<"July , "; break; } case 8:{ cout<<"August , "; break; } case 9:{ cout<<"September , "; break; } case 10:{ cout<<"October , "; break; } case 11:{ cout<<"November , "; break; } case 12:{ cout<<"December , "; break; } } //end of switch cout<<year<<" \n";

} //end of function void all::enter_patient_info() { clrscr(); 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; clrscr(); 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 : "; clreol(); 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 netering 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 clreol(); 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_answer! ='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 ) : "; clreol(); 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 : "; clreol(); cin>>PI[T1.i].sex; } cout<<"\nMartial status( 1-Married , 2-Single ) : "; clreol(); 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"; clreol(); cin>>PI[T1.i].martial_status; } cin.get(ch); clreol(); clreol(); cout<<"\n *** Blood group ***"<<"\n"; clreol(); cout<<" 1. A+ "<<"\n"; clreol(); cout<<" 2. A- "<<"\n"; clreol(); cout<<" 3. B+ "<<"\n"; clreol(); cout<<" 4. B- "<<"\n"; clreol(); cout<<" 5. AB+ "<<"\n"; clreol(); cout<<" 6. AB- "<<"\n"; clreol(); cout<<" 7. O+ "<<"\n"; clreol(); cout<<" 8. O- "<<"\n"; clreol(); cout<<"\nEnter a blood group : "; clreol(); cin>>PI[T1.i].bld_group; switch(PI[T1.i].bld_group) { case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8:{ break; } default:{ while(PI[T1.i].bld_group!=1&&PI[T1.i].bld_group!=2&& PI[T1.i].bld_group!=3&&PI[T1.i].bld_group!=4&&

PI[T1.i].bld_group!=5&&PI[T1.i].bld_group!=6&& PI[T1.i].bld_group!=7&&PI[T1.i].bld_group!=8) { clreol(); cout<<"\aInvalid input !!!"<<"\n"; clreol(); cout<<"Please enter a valid Blood Group : "<<"\n"; clreol(); cin>>PI[T1.i].bld_group; } //end of while break; } } //end of switch cin.get(ch); clreol(); cout<<"\n\n ***ENTERING ADDRESS**"<<"\n\n"; clreol(); cout<<"House number : "; clreol(); cin>>PI[T1.i].AD1.house; while(PI[T1.i].AD1.house<=0) { clreol(); cout<<"\a\nInvalid input for house number !!!"; clreol(); cout<<"\nAgain enter the house number : "; clreol(); cin>>PI[T1.i].AD1.house; } cin.get(ch); clreol(); cout<<"Street : "; clreol(); cin.getline(PI[T1.i].AD1.street,30); while(strlen(PI[T1.i].AD1.street)==0) { clreol(); cout<<"\a\nPlease enter a street : "; //if enter is pressd before input for street clreol(); cin.getline(PI[T1.i].AD1.street,50); cout<<"\n"; } cout<<"City : "; clreol(); cin.getline(PI[T1.i].AD1.city,30); while(strlen(PI[T1.i].AD1.city)==0)

{ clreol(); cout<<"\a\nPlease enter a city : "; //if enter is pressd before input for city clreol(); cin.getline(PI[T1.i].AD1.city,50); cout<<"\n"; } cout<<"District : "; clreol(); cin.getline(PI[T1.i].AD1.dist,30); while(strlen(PI[T1.i].AD1.dist)==0) { clreol(); cout<<"\a\nPlease enter a district : "; //if enter is pressed before input for district clreol(); cin.getline(PI[T1.i].AD1.dist,30); cout<<"\n"; } cout<<"State : "; clreol(); cin.getline(PI[T1.i].AD1.state,30); while(strlen(PI[T1.i].AD1.state)==0) { clreol(); cout<<"\a\nPlease enter a state : "; //if enter is pressed before input for state clreol(); cin.getline(PI[T1.i].AD1.state,50); cout<<"\n"; } cout<<"Country : "; clreol(); cin.getline(PI[T1.i].AD1.country,30); while(strlen(PI[T1.i].AD1.country)==0) { clreol(); cout<<"\a\nPlease enter a country : "; //if enter is pressd before input for country clreol(); cin.getline(PI[T1.i].AD1.country,50); cout<<"\n"; } DOB1.enter_date(); cin.get(ch); clreol(); clreol(); cout<<"\n\nWant to enter information for another patient (Y/N) ? "; clreol();

cin>>answer; while(answer!='Y'&&answer!='y'&&answer!='N'&&answer!='n') { clrscr(); cout<<"\a\nPease re-enter a correct option (Y/N) : "; clreol(); cin>>answer; } cout<<"\n"; T1.count++; T1.serial++; } //end of "for loop" for entering information clrscr(); clrscr(); A1.tasks(); } //end of function void dob::enter_date() { clreol(); cout<<"\n\n *** Date of birth ***"<<"\n"; clreol(); cout<<"\nYear : "; clreol(); clreol(); cin>>DOB11[T1.temp].year; while(DOB11[T1.temp].year>T1.current_year) //to ensure that the year of birth { //gets entered correctly clreol(); cout<<"\aInvalid input for year !!!"; cout<<"\nThe date of birth cannot be after the current system date !!! "; cout<<"\nPlease enter the year correctly : "; clreol(); cin>>DOB11[T1.temp].year; cout<<"\n"; } while(DOB11[T1.temp].year<1000) { clreol(); cout<<"Invalid input for year !!! "; clreol(); cout<<"\nThe year of birth must be of 4 digits!!!"; clreol(); cout<<"\nPlease enter the year correctly : \a"; clreol(); cin>>DOB11[T1.temp].year;

cout<<"\n"; } while(DOB11[T1.temp].year<1900) { clreol(); cout<<"\a\nAre you sure (Y/N) ? "; cin>>birth_answer; cout<<"\n"; while(birth_answer!='Y'&&birth_answer!='y'&&birth_answer!='N'&&birth_answer!='n') { clreol(); cout<<"\a\nInvalid input !!! "<<"\n"; clreol(); cout<<"Please enter a correct option (Y/N) : "; cout<<"\n"; clreol(); cin>>birth_answer; } if(birth_answer=='n'||birth_answer=='N') { clreol(); cout<<"\nPlease enter the year again : "; clreol(); cin>>DOB11[T1.temp].year; clreol(); while(DOB11[T1.temp].year>T1.current_year) { clreol(); cout<<"Invalid input for year !!! "; clreol(); cout<<"\nThe date of birth cannot be after the current system date !!! "; clreol(); cout<<"\nPlease enter the year correctly : \a"; clreol(); cin>>DOB11[T1.temp].year; cout<<"\n"; } while(DOB11[T1.temp].year<1000) { clreol(); cout<<"\aInvalid input for year !!! "; clreol(); cout<<"\nThe year of birth must be of 4 digits!!!\a"; clreol(); cout<<"\nPlease enter the year correctly : "; clreol();

cin>>DOB11[T1.temp].year; cout<<"\n"; } } //end of inner while while(birth_answer=='y'||birth_answer=='Y') { goto jump; } //end of inner while } //end of outer while jump: clreol(); cout<<"Month : "; clreol(); cin>>DOB11[T1.temp].month; while(DOB11[T1.temp].month<=0||DOB11[T1.temp].month>12) { clreol(); cout<<"\a\nInvalid input for month !!!"<<"\n"; cout<<"Again enter the month : "; clreol(); clreol(); cin>>DOB11[T1.temp].month; } cout<<"Date : "; clreol(); switch(DOB11[T1.temp].month) { case 1: case 3: case 5: case 7: case 8: case 10: case 12:{ cin>>DOB11[T1.temp].date; //for months with 31 days while(DOB11[T1.temp].date<1||DOB11[T1.temp].date>31) { clreol(); cout<<"\aInvalid date !!!"<<"\n"; cout<<"Again enter the date : "; clreol(); cin>>DOB11[T1.temp].date; cout<<"\n"; } break; }

case 2:{ //for february cin>>DOB11[T1.temp].date; if(DOB11[T1.temp].year%4==0) { while(DOB11[T1.temp].date<0||DOB11[T1.temp].date>29) //for leap year { clreol(); cout<<"\aInvalid date !!!"<<"\n"; cout<<"Again enter the date : "; clreol(); cin>>DOB11[T1.temp].date; cout<<"\n"; } } else { while(DOB11[T1.temp].date<0||DOB11[T1.temp].date>28) //for non-leap year { clreol(); cout<<"\aInvalid date !!!"<<"\n"; cout<<"Again enter the date : "; clreol(); cin>>DOB11[T1.temp].date; cout<<"\n"; } } break; } default:{ cin>>DOB11[T1.temp].date; //for other months while(DOB11[T1.temp].date<1||DOB11[T1.temp].date>30) { clreol(); cout<<"\aInvalid date !!!"<<"\n"; cout<<"Again enter the date : "; clreol(); cin>>DOB11[T1.temp].date; cout<<"\n"; } break; } } //end of switch clreol(); } //end of function void all::show_patient_detail()

{ clrscr(); if(T1.d_index==1) { T1.d_index=0; cout<<"\n\n"; goto direct; } if(T1.current==0) { cout<<"\n\n\n"; cout<<"\tDatabase in 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\n\tEnter registration number : "; clreol(); cin>>T1.regis;

clrscr(); 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) { T1.attempt++; if(T1.attempt==3) { cout<<"\n\n\tYou have entered wrong registration number 3 times ."<<"\n"; cout<<"\tAccess Denied!!! "<<"\n"; cout<<"\tPlease try again later. "<<"\n"; cout<<"\tPress any key to exit to main task menu..."<<"\n"; getch(); clrscr(); A1.tasks(); } 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."; T1.attempt++; if(T1.attempt==3) { cout<<"\n\n\tYou have entered wrong registration number 3 times ."<<"\n"; cout<<"\tAccess Denied!!! "<<"\n"; cout<<"\tPlease try again later. "<<"\n"; cout<<"\tPress any key to exit to main task menu..."<<"\n"; getch(); clrscr(); A1.tasks(); } cout<<"\n\tPress any key to continue..."<<"\n"; getch(); } if((T1.regis<0||T1.regis>=T1.serial)&&T1.entry_index[T1.regis]==-1)

{ T1.attempt++; clreol(); if(T1.attempt!=3) { 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.attempt==3) { cout<<"\n\n\tYou have entered wrong registration number 3 times ."<<"\n"; cout<<"\tAccess Denied!!! "<<"\n"; cout<<"\tPlease try again later. "<<"\n"; cout<<"\tPress any key to exit to main task menu..."<<"\a\n"; getch(); clrscr(); A1.tasks(); } cout<<"\n\n\n\tPress any key to continue....."; getch(); A1.show_patient_detail(); } if(T1.regis>0&&T1.regis<T1.serial&&T1.entry_index[T1.regis]==1) { T1.attempt=0; clreol(); cout<<"\n\t ***INFORMATION FOR PATIENT REGISTRATION "<<T1.regis<<"***\n\n"; clreol(); cout<<"\tName : "<<PI[T1.regis].name<<"\n"; clreol(); cout<<"\tSex : "; clreol(); if(PI[T1.regis].sex==1) { cout<<"Male "<<"\n"; clreol(); }

NUMBER

if(PI[T1.regis].sex==2) { cout<<"Female "<<"\n"; clreol(); } cout<<"\tBlood Group : "; clreol(); switch(PI[T1.regis].bld_group) { case 1:{ clreol(); cout<<"A+\n"; break; } case 2:{ clreol(); cout<<"A-\n"; break; } case 3:{ clreol(); cout<<"B+\n"; break; } case 4:{ clreol(); cout<<"B-\n"; break; } case 5:{ clreol(); cout<<"AB+\n"; break; } case 6:{ clreol(); cout<<"AB-\n"; break; } case 7:{ clreol(); cout<<"O+\n"; break; } case 8:{ clreol();

cout<<"O-\n"; break; } } //end of switch clreol(); cout<<"\tDate of birth : "; clreol(); DOB1.show_date(); cout<<"\tMartial Status : "; clreol(); if(PI[T1.regis].martial_status==1) { cout<<"Married "<<"\n"; clreol(); } else { cout<<"Single "<<"\n"; clreol(); } clreol(); cout<<"\n\t **ADDRESS**"<<"\n"; clreol(); cout<<"\n\tHouse no. : "<<PI[T1.regis].AD1.house; clreol(); cout<<"\n\tStreet : "<<PI[T1.regis].AD1.street; clreol(); cout<<"\n\tCity : "<<PI[T1.regis].AD1.city; clreol(); cout<<"\n\tDistrict : "<<PI[T1.regis].AD1.dist; clreol(); cout<<"\n\tState : "<<PI[T1.regis].AD1.state; clreol(); cout<<"\n\tCountry : "<<PI[T1.regis].AD1.country; clreol(); } T1.d_index=0; clreol(); clreol(); cout<<"\n\n\n\n\tWant to view detail of another patient : "; clreol(); cin>>answer1; while(answer1!='Y'&&answer1!='y'&&answer1!='N'&&answer1!='n') { clreol(); cout<<"\a\tPease re-enter a correct option (Y/N) ? ";

clreol(); cin>>answer1; } clrscr(); if(answer1=='Y'||answer1=='y') { A1.show_patient_detail(); } else { A1.tasks(); } } //end of function void dob::show_date() { cout<<DOB11[T1.regis].date; T1.rem=DOB11[T1.regis].date%10; switch(DOB11[T1.regis].date) { case 11: case 12: case 13: case 14: case 15: case 16: case 17: case 18: case 19: case 20:{ cout<<"th "; goto over; } } //end of switch switch(T1.rem) { case 1:{ cout<<"st "; break; } case 2:{ cout<<"nd "; break; } case 3:{ cout<<"rd ";

break; } default:{ cout<<"th "; break; } } //end of switch over: switch(DOB11[T1.regis].month) { case 1:{ cout<<"January , "; break; } case 2:{ cout<<"February , "; break; } case 3:{ cout<<"March , "; break; } case 4:{ cout<<"April , "; break; } case 5:{ cout<<"May , "; break; } case 6:{ cout<<"June , "; break; } case 7:{ cout<<"July , "; break; } case 8:{ cout<<"August , "; break; } case 9:{ cout<<"September , "; break; }

case 10:{ cout<<"October , "; break; } case 11:{ cout<<"November , "; break; } case 12:{ cout<<"December , "; break; } } //end of switch cout<<DOB11[T1.regis].year<<" \n"; } //end of function void all::billing() { clrscr(); char pn[25]; int bc,tc,oc,tot; cout<<"\nPatient Name :\t"; gets(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) { clrscr(); cout<<"\n\n\n"; cout<<"\tDatabase in 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; clrscr(); clreol(); cout<<"\n\n\t\t ***SEARCH MENU***"<<"\n"; clreol(); cout<<"\n\n\t\t 1. Search by city "<<"\n"; clreol(); cout<<"\t\t 2. Search by blood group "<<"\n"; clreol(); cout<<"\t\t 3. Return to main menu "<<"\n"; clreol(); cout<<"\n\n\t Enter your choice : \a"; clreol(); cin>>s_choice; cin.get(ch); cout<<"\n\n\n"; clrscr(); switch(s_choice) { case 1:{ T1.search_index=1; clreol(); cout<<"\n\n\t\t***SEARCHING BY CITY***\n"; clreol(); cout<<"\n\n\tEnter city : "; clreol(); cin.getline(s_city,30); clreol(); cout<<"\n\n\n"; while(strlen(s_city)==0) //if enter is pressed before input for city

{ clreol(); cout<<"\n\tPlease enter a city : \a"; clreol(); cin.getline(s_city,30); } A1.search_city(); break; } case 2:{ T1.search_index=2; clreol(); cout<<"\n\n\t\t***SEARCHING BY BLOOD GROUP***\n"; clreol(); cout<<"\n\n\t\t ***BLOOD GROUP MENU***\n\n"; clreol(); cout<<"\t1. A+ "<<"\n"; clreol(); cout<<"\t2. A- "<<"\n"; clreol(); cout<<"\t3. B+ "<<"\n"; clreol(); cout<<"\t4. B- "<<"\n"; clreol(); cout<<"\t5. AB+ "<<"\n"; clreol(); cout<<"\t6. AB- "<<"\n"; clreol(); cout<<"\t7. O+ "<<"\n"; clreol(); cout<<"\t8. O- "<<"\n"; clreol(); cout<<"\n\n Enter the serial of your required group : "; clreol(); cin>>s_group; while(s_group!=1&&s_group!=2&&s_group!=3&&s_group!=4&& s_group!=5&&s_group!=6&&s_group!=7&&s_group!=8) { cout<<"\n"; cout<<"\tInvalid search criteria !!!"<<"\n"; cout<<"\tValid serials are 1 to 8."<<"\n"; cout<<"\tEnter a valid blood group : \a"; cin>>s_group; } cout<<"\n\n\n"; A1.search_blood_group();

break; } case 3:{ A1.tasks(); break; } default:{ clreol(); cout<<"\a\n\n Invalid search criteria !!!"<<"\n"; clreol(); cout<<" Valid options are 1 and 2 !!!"<<"\n"; clreol(); cout<<" Press any key to return to the main searching menu....."<<"\n"; clreol(); getch(); A1.search_menu(); break; } } //end of switch } //end of function void all::search_city() { T1.search_count=0; T1.search_number++; clrscr(); 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"; } clreol(); cout<<"\n\t\t "<<T1.index<<"\t\t"<<PI[T1.index].name; clreol(); T1.search_count++; } } clreol();

if(T1.search_number==1) { cout<<"\a\n\n\n\t\t Search is complete !!! "<<"\n"; clreol(); 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) { clreol(); cout<<"\n\n\t\tWant to view in detail : "; cin>>after_search_answer; while(after_search_answer!='y'&&after_search_answer!='Y'&&after_search_answer! ='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 : "; 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++; clrscr(); 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"; } clreol(); cout<<"\n\t\t "<<T1.index<<"\t\t"<<PI[T1.index].name; clreol(); T1.search_count++; } } clreol(); if(T1.search_number==1) { cout<<"\a\n\n\n\t\t Search is complete !!! "<<"\n"; clreol(); 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) { clreol(); cout<<"\n\n\t\tWant to view in detail : "; cin>>after_search_answer; while(after_search_answer!='y'&&after_search_answer!='Y'&&after_search_answer! ='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 : "; 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++; clrscr(); cout<<"\n\n"; if(T1.index<=0) { if(T1.ssi_count==3) { clrscr(); cout<<"\n\n\tYou have entered wrong choice 3 times!!!!";

cout<<"\n\tPress any key for more options......\a"; getch(); A1.after_search_options(); } 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) { if(T1.ssi_count==3) { clrscr(); cout<<"\n\n\tYou have entered wrong choice 3 times!!!!"; cout<<"\n\tPress any key for more options......\a"; getch(); A1.after_search_options(); } 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)

{ if(T1.ssi_count==3) { clrscr(); cout<<"\n\n\tYou have entered wrong choice 3 times!!!!"; cout<<"\n\tPress any key for more options......\a"; getch(); A1.after_search_options(); } 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 } clreol(); cout<<"\n"; T1.ssi_count=0; cout<<"\n\t ***INFORMATION FOR PATIENT REGISTRATION "<<T1.index<<"***\n\n"; clreol(); cout<<"\tName : "<<PI[T1.index].name<<"\n"; clreol(); cout<<"\tSex : "; clreol(); if(PI[T1.index].sex==1) { cout<<"Male "<<"\n";

NUMBER

clreol(); } if(PI[T1.index].sex==2) { cout<<"Female "<<"\n"; clreol(); } cout<<"\tBlood Group : "; clreol(); switch(PI[T1.index].bld_group) { case 1:{ clreol(); cout<<"A+\n"; break; } case 2:{ clreol(); cout<<"A-\n"; break; } case 3:{ clreol(); cout<<"B+\n"; break; } case 4:{ clreol(); cout<<"B-\n"; break; } case 5:{ clreol(); cout<<"AB+\n"; break; } case 6:{ clreol(); cout<<"AB-\n"; break; } case 7:{ clreol(); cout<<"O+\n"; break; }

case 8:{ clreol(); cout<<"O-\n"; break; } } //end of switch clreol(); cout<<"\tDate of birth : "; clreol(); DOB1.search_show_date(); cout<<"\tMartial Status : "; clreol(); if(PI[T1.index].martial_status==1) { cout<<"Married "<<"\n"; clreol(); } else { cout<<"Single "<<"\n"; clreol(); } cout<<"\n\t **ADDRESS**"<<"\n"; clreol(); cout<<"\n\tHouse no. : "<<PI[T1.index].AD1.house; clreol(); cout<<"\n\tStreet : "<<PI[T1.index].AD1.street; clreol(); cout<<"\n\tCity : "<<PI[T1.index].AD1.city; clreol(); cout<<"\n\tDistrict : "<<PI[T1.index].AD1.dist; clreol(); cout<<"\n\tState : "<<PI[T1.index].AD1.state; clreol(); cout<<"\n\tCountry : "<<PI[T1.index].AD1.country; clreol(); clreol(); clreol(); cout<<"\n\n\n\tWant to view info of another patient within search results (Y/N) ? "; cin>>after_search_answer; while(after_search_answer!='Y'&&after_search_answer!='y'&&after_search_answer! ='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(); break; } } //end of switch } else { A1.after_search_options(); } } //end of function void dob::search_show_date() { cout<<DOB11[T1.index].date; T1.rem=DOB11[T1.index].date%10; switch(DOB11[T1.index].date) { case 11: case 12: case 13: case 14: case 15: case 16: case 17: case 18: case 19: case 20:{ cout<<"th "; goto over; } } //end of switch switch(T1.rem) { case 1:{ cout<<"st "; break; }

case 2:{ cout<<"nd "; break; } case 3:{ cout<<"rd "; break; } default:{ cout<<"th "; break; } } //end of switch over: switch(DOB11[T1.index].month) { case 1:{ cout<<"January , "; break; } case 2:{ cout<<"February , "; break; } case 3:{ cout<<"March , "; break; } case 4:{ cout<<"April , "; break; } case 5:{ cout<<"May , "; break; } case 6:{ cout<<"June , "; break; } case 7:{ cout<<"July , "; break; } case 8:{ cout<<"August , ";

break; } case 9:{ cout<<"September , "; break; } case 10:{ cout<<"October , "; break; } case 11:{ cout<<"November , "; break; } case 12:{ cout<<"December , "; break; } } //end of switch cout<<DOB11[T1.index].year<<" \n"; clreol(); } //end of function void all::after_search_options() { clrscr(); clreol(); cout<<"\n\n\n\n\t\tWHAT DO U WANT TO DO NOW ?"<<"\n"; clreol(); cout<<"\t\t1. Search again "<<"\n"; clreol(); cout<<"\t\t2. Return to main task menu "<<"\n"; clreol(); cout<<"\n\tEnter your choice : "; clreol(); clreol(); cin>>T1.after_search_choice; clreol(); 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:{ clreol(); cout<<"\a\n\n\tInvalid option requested !!!"<<"\n"; clreol(); cout<<"\tPress any key to return to the main searching menu..."<<"\n"; clreol(); getch(); A1.search_menu(); break; } } //end of switch } //end of function void all::delete_entry() { clrscr(); if(T1.current==0) { cout<<"\n\n\n"; cout<<"\tDatabase in 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) { clrscr(); 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\tWhich registration no. 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_confirm! ='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) { clrscr(); A1.tasks(); } if(en_del_index>0&&en_del_index<T1.serial&&T1.entry_index[en_del_index]==1) { T1.delete_attempt=0; 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'&&delete_confirm!='n') { clreol(); cout<<"\a\n\tPease re-enter a correct option (Y/N) ? "; clreol(); 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)

{ T1.delete_attempt++; if(T1.delete_attempt==3) { cout<<"\n\n\tSorry, you have entered wrong registration number 3 times. "; cout<<"\n\tAccess denied !!!"; cout<<"\n\tPlease try again later !!!"; cout<<"\n\tPress any key to return to the main task menu....\a"; getch(); A1.tasks(); } 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 { T1.delete_attempt++; if(T1.delete_attempt==3) { cout<<"\n\n\tSorry, you have entered wrong registration number 3 times. "; cout<<"\n\tAccess denied !!!"; cout<<"\n\tPlease try again later !!! "; cout<<"\n\tPress any key to return to the main task menu....\a"; getch(); A1.tasks(); } 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 was added and "<<T1.current<<" are present .\n"; } cout<<"\tPress any key to continue..."<<"\n"; getch(); A1.delete_entry(); } clrscr(); } //end of function void all::after_delete_options()

{ clrscr(); 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(); break; } } //end of switch } //end of function void all::recycle_bin() { clrscr(); T1.delete_count=0; if(T1.serial==0) { cout<<"\n\n\n"; cout<<"\tDatabase in 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; clrscr(); 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) { clrscr(); 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_all_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(); clrscr(); A1.tasks(); } else { cout<<"\n\n\tNo entry has been restored."; cout<<"\n\tPress any key to view the recycle bin...\a"; getch(); clrscr(); A1.recycle_bin(); } } if(T1.entry_index[T1.restore_serial]==0) { T1.restore_attempt=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') { clreol(); cout<<"\n\n\tInvalid input !!! "; cout<<"\n\tPease re-enter a correct option (Y/N) : \a"; clreol(); 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) { T1.restore_attempt++; if(T1.restore_attempt==3) { clrscr(); cout<<"\n\n\tYou have unsuccesfully tried to restore 3 times."; cout<<"\n\tPress any key to return to the main task menu..."; A1.tasks(); } 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) { T1.restore_attempt++; if(T1.restore_attempt==3) { clrscr(); cout<<"\n\n\tYou have unsuccesfully tried to restore 3 times."; cout<<"\n\tPress any key to return to the main task menu..."; getch(); A1.tasks(); } cout<<"\n\tInvalid serial number"; cout<<"\n\tPress any key to continue..."; getch(); A1.recycle_bin(); } } //end of function void all::after_restore()

{ clrscr(); 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() { clrscr(); if(T1.serial==0) { cout<<"\n\n\n\n\tYou have not used the software."; cout<<"\n\tIt is recommended that you do not exit."; cout<<"\n\tPress any key to continue......\a"; getch(); clrscr(); 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') { clreol(); cout<<"\n\n\tInvalid input !!! "; cout<<"\n\tPease re-enter a correct option (Y/N) : \a"; clreol(); cin>>exit_answer;

} if(exit_answer=='y'||exit_answer=='Y') { cout<<"\a"; exit(0); } else { A1.tasks(); } } cout<<"\n\n\n\t\t\t ***SOFTWARE DETAILS***\n"; cout<<"\n\n\tDeveloper : Mustafizur Rohman "<<"\n"; cout<<"\tProgramming Language : C++ "<<"\n"; cout<<"\tCompiler version : Borland 5.02 "<<"\n"; cout<<"\tAim : Simulation of Hospital Management Software"<<"\n"; cout<<"\n\tHope you like it..."<<"\n"; cout<<"\n\n\tSend your comments to : mustafizur_04@sify.com "<<"\n"; cout<<"\n\n\tThank You for trying this program. "<<"\n"; cout<<"\n\n\n\tPress any key to continue........"<<"\n"; getch(); clrscr(); 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') { clreol(); cout<<"\n\n\tInvalid input !!! "; cout<<"\n\tPease re-enter a correct option (Y/N) : \a"; clreol(); cin>>exit_answer; } if(exit_answer=='y'||exit_answer=='Y') { cout<<"\a"; exit(0); } else { A1.tasks(); } } //end of function

Output
Welcome Screen

Main menu

Patient Details Input

View Patient details

Limitation
Though we have completed this project with all our effort but has certain limitation like it cannot be operated in networking. the working of project is slow in windows operating system.

CONCLUSION
This project is very useful in preparing hospital management. this project meets our requirements and complete in all sense. this software is really of great use for Hospital Management, who want their hospital Mnagement to be computerized.

BIBLIOGRAPHY
The C++ Programming Language 3e , Bjarne Stroustrup , Addison-Wesley , 1997 ISBN: 0-201-88954-4 The C++ Standard Library , Nicolai Josuttis , Addison-Wesley , 1999 ISBN: 0-201-37926-0 The C++ Standard , , John Wiley and Sons , 2003 ISBN: 0470846747 Accelerated C++ , Andrew Koenig and Barbara Moo , Addison-Wesley , 2000 ISBN: 0-201-70353-X C++ by Example: UnderC Learning Edition , Steve Donovan , Que , 2001 ISBN: 0-7897-2676-9 Teach Yourself C++ 7e , Al Stevens , Wiley , 2003 ISBN: 0-7645-2644-8

Anda mungkin juga menyukai