Documente Academic
Documente Profesional
Documente Cultură
E,
Odisha for the award of higher secondary certificate in
Computer Science.
1
CERTIFICATE
2
ACKNOWLEDGEMENT
Priyanka Sahoo
Class- XII, Science
Roll No. : IS18-230
Exam Roll No: 327MC217
Regd. No: MC27S18230
3
A PROJECT WORK ON
4
Name of the Guide
Mrs. Banishree
Mohapatra
DECLARATION
Priyanka Sahoo
5
Class- XII, Science
Roll No. : IS18-230
Exam Roll No: 327MC217
Regd. No: MC27S18230
CONTENTS
• INTRODUCTION TO C++
• OBJECTIVE
• SYSTEM DESIGN
6
• SYSTEM ANALYSIS
• CODING
• OUTPUT SCREENS
• SCOPE AND FUTURE
• BIBLIOGRAPHY
'
INTRODUCTION to C++
7
This project is based on the “HOSPITAL MANAGEMENT
SYSTEM”. More specifically it is a project based on patient’s
admission system in a hospital. The program gives many
options which help the user for an easier and faster access to
the records. It has many beneficial options like bed wise
report, within a few seconds. The output provided is easily
understandable.
8
OBJECTIVE:-
The main objective of this program is to provide:-
9
-: SYSTEM DESIGN:-
10
1TECHNICAL FEASIBILITY:
b MINIMUM SOFTWARE
REQUIREMENT:
A Windows/ dos based operating system with
Turbo C++
Compiler.
2 ECONOMIC FEASIBILITY:
Any company/ workstation platform can provide
this much technical feasibility. Therefore this project is
. technically feasible
3 OPERATION FEASIBILITY:
11
This project is very user friendly. One can handle this
very easily. The project itself guides the user. The
program itself interacts with the user by understandable
message. The user is only responsible for providing the
input data values and rest everything is the program’s
responsibility.
12
SYSTEM ANALYSIS
13
necessary details of the patient it will automatically
save the record.
4 Deletion of a Record :-
This option allows you to delete unwanted
records. In my program you will able to see all the
records one by one and then you can delete the
desired record.
5 Modification of a Record :-
In case of a mistake in the entire of a record, you
can edit the record this module.
14
8 Bed Wise Record :-
In this option you have to enter the bed number of
a patient and his whole record will appear on the
screen.
10 Menu :-
The complete program is run by a menu. When
you run the program, first you have to encounter
with the menu. There you have to insert a single
character such as ‘A’ for addition and that function
will start running.
15
DISPLAY
ENTIRE
PATIENT'S
LIST.
DISPLAY
UNIT WISE
ONLY A
RECORD.
PATIENT'S
LIST.
DOCTOR
WISE ADDITION OF
RECORD.
RECORD. MENU
DISEASE
WISE
DELEITION OF
RECORD.
RECORD.
16
BED WISE MODIFICATION
RECORD. OF RECORD.
17
-: FEASIBILITY STUDY:-
: CODING:-
#include<iostream.h>
#include<conio.h>
#include<ctype.h>
#include<iomanip>
#include<stdio.h>
#include<fstream>
#include<string.h>
struct hospital
char name[25];
char sex[6];
int age;
char add_date[20];
char address[50];
char phone[20];
18
char bed[20];
char doc[25];
char disease[20];
char doc_phone[20];
char release[20];
char doc_address[50];
char unit[10];
};
ifstream infile;
infile.open(fname,ios::in);
int n=0;
int i=0;
i=sizeof(patient);
infile.seekg(0,ios::end);
n=infile.tellg();
int j=0;
19
j=(n/i);
infile.seekg(0);
fflush(stdin);
char name11[20];
fflush(stdin);
gets(name11);
fflush(stdin);
for(int t=0;t<=j-1;++t)
infile.read((char*)&patient,sizeof(patient));
if(strcmp(name11,patient.name)==0)
cout<<"\nPatient Name->
"<<patient.name;
cout<<"\nAge->"<<patient.age;
cout<<"\nSex->"<<patient.sex;
cout<<"\nAddress-
>"<<patient.address;
cout<<"\nTelephone No-
>"<<patient.phone;
20
cout<<"\nDisease-
>"<<patient.disease;
cout<<"\nAddimision Data-
>"<<patient.add_date;
cout<<"\nDate of Release-
>"<<patient.release;
cout<<"\nBed No-
>"<<patient.bed;
cout<<"\nUnit->"<<patient.unit;
cout<<"\nDoctore
Name"<<patient.doc;
cout<<"\nDoctore Ph No->"
<<patient.doc_phone;
cout<<"\nDoctore Address-
>"<<patient.doc_address;
getch();
clrscr();
infile.close();
21
void addition(char fname[10])
ifstream infile;
fflush(stdin);
22
cin>>n;
cout<<"\n Name-->";
gets(patient[i].name);
cin>>patient[i].sex;
cout<<"\n Age-->";
cin>>patient[i].age;
cin>>patient[i].bed;
fflush(stdin);
gets(patient[i].doc);
fflush(stdin);
cout<<"\n Disease-->";
fflush(stdin);
gets(patient[i].disease);
fflush(stdin);
23
cout<<"\n DOCTOR's Phone Number-->";
fflush(stdin);
gets(patient[i].doc_phone);
fflush(stdin);
gets(patient[i].release);
fflush(stdin);
fflush(stdin);
gets(patient[i].doc_address);
fflush(stdin);
cout<<"\n Unit-->";
fflush(stdin);
gets(patient[i].unit);
fflush(stdin);
infile.open(fname,ios::app); cout<<"\n\n
Storing on to the file...\n\n";
infile.write((char*)&patient[i],sizeof(patient[i]));
24
infile.close();
25
{
ifstream infile;
infile.open(fname,ios::in);
int n=0,i=0;
i=sizeof(patient);
infile.seekg(0,ios::end);
n=infile.tellg();
int j=0;
j=(n/i);
infile.seekg(0);
fflush(stdin);
fflush(stdin);
char name1[30];
fflush(stdin);
gets(name1);
infile.read((char*)&patient,sizeof(patient));
if(strcmp(name1,patient.bed)==0)
26
{
cout<<"\nPatient Name->
"<<patient.name;
cout<<"\nAge->"<<patient.age;
cout<<"\nSex->"<<patient.sex;
cout<<"\nAddress-
>"<<patient.address;
cout<<"\nTelephone No-
>"<<patient.phone;
cout<<"\nDisease-
>"<<patient.disease;
cout<<"\nAddimision Data-
>"<<patient.add_date;
cout<<"\nDate of Release-
>"<<patient.release;
cout<<"\nBed No-
>"<<patient.bed;
cout<<"\nUnit->"<<patient.unit;
cout<<"\nDoctore
Name"<<patient.doc;
cout<<"\nDoctore Ph No->"
27
<<patient.doc_phone;
cout<<"\nDoctore Address-
>"<<patient.doc_address;
getch();
clrscr();
infile.close();
28
}
void menu(void)
cout<<"===========================================
=============\n";
cout<<" Q->Quit\n";
cout<<"===========================================
======\n";
29
{
ifstream infile;
fstream tfile;
infile.open(fname,ios::in);
int n=0,i=0;
i=sizeof(patient);
infile.seekg(0,ios::end);
n=infile.tellg();
int j=0;
j=(n/i);
infile.seekg(0);
fflush(stdin);
fflush(stdin);
char name1[30];
for(int t=0;t<=j-1;++t)
30
infile.read((char*)&patient,sizeof(patient));
cout<<" Record Number--> "<<(t+1);
cout<<"\n===============================\n"; cout<<"\nPatient
Name->
"<<patient.name;
cout<<"\nAge->"<<patient.age;
cout<<"\nSex->"<<patient.sex;
cout<<"\nAddress-
>"<<patient.address;
cout<<"\nTelephone No-
>"<<patient.phone;
cout<<"\nDisease-
>"<<patient.disease;
cout<<"\nAddimision Data-
>"<<patient.add_date;
cout<<"\nDate of Release-
>"<<patient.release;
cout<<"\nBed No-
>"<<patient.bed;
cout<<"\nUnit->"<<patient.unit;
cout<<"\nDoctore
Name"<<patient.doc;
31
cout<<"\nDoctore Ph No->"
<<patient.doc_phone;
cout<<"\nDoctore Address-
>"<<patient.doc_address;
getch();
clrscr();
infile.close();
infile.open(fname,ios::in);
tfile.open("temp1",ios::out);
";
fflush(stdin);
gets(name1);
fflush(stdin);
for(int t=0;t<=j-1;++t)
infile.read((char*)&patient,sizeof(patient));
if(strcmp(name1,patient.disease)!=0)
32
tfile.write((char*)&patient,sizeof(patient));
clrscr();
33
} infile.close(); tfile.close();
remove(fname);
rename("temp1",fname);
infile.open(fname,ios::app);
gets(patient[i].name);
cin>>patient[i].sex;
cout<<"\n Age-->";
cin>>patient[i].age;
cin>>patient[i].bed;
fflush(stdin);
gets(patient[i].doc);
fflush(stdin);
cout<<"\n Disease-->";
fflush(stdin);
gets(patient[i].disease);
fflush(stdin);
gets(patient[i].doc_phone);
fflush(stdin);
gets(patient[i].release);
fflush(stdin);
fflush(stdin);
gets(patient[i].doc_address);
fflush(stdin);
cout<<"\n Unit-->";
fflush(stdin);
gets(patient.unit);
fflush(stdin);
infile.write((char*)&patient,sizeof(patient));
infile.close();
35
ifstream infile;
36
infile.open(fname,ios::in);
int n=0,i=0;
i=sizeof(patient);
infile.seekg(0,ios::end);
n=infile.tellg();
int j=0;
j=(n/i);
infile.seekg(0);
fflush(stdin);
fflush(stdin);
char name1[30];
gets(name1);
fflush(stdin);
for(int t=0;t<=j-1;++t)
infile.read((char*)&patient,sizeof(patient));
if(strcmp(name1,patient.disease)==0)
cout<<"\nPatient Name->
37
"<<patient.name;
cout<<"\nAge->"<<patient.age;
cout<<"\nSex->"<<patient.sex;
cout<<"\nAddress-
>"<<patient.address;
cout<<"\nTelephone No-
>"<<patient.phone;
cout<<"\nDisease-
>"<<patient.diseae;
cout<<"\nAddimision Data-
>"<<patient.add_date;
cout<<"\nDate of Release-
>"<<patient.realease;
cout<<"\nBed No-
>"<<patient.bed;
cout<<"\nUnit->"<<patient.unit;
cout<<"\nDoctore
Name"<<patient.doc;
cout<<"\nDoctore Ph No->"
<<patient.doc_phone;
cout<<"\nDoctore Address-
38
>"<<patient.doc_address;
getch();
clrscr();
} infile.close();
39
}
ifstream infile;
infile.open(fname,ios::in);
int n=0,i=0;
i=sizeof(patient);
infile.seekg(0,ios::end);
n=infile.tellg();
int j=0;
j=(n/i);
infile.seekg(0);
fflush(stdin);
fflush(stdin);
char name1[30];
fflush(stdin);
gets(name1);
fflush(stdin);
40
for(int t=0;t<=j-1;++t)
infile.read((char*)&patient,sizeof(patient));
if(strcmp(name1,patient.disease)==0)
cout<<"\nPatient Name->
"<<patient.name;
cout<<"\nAge->"<<patient.age;
cout<<"\nSex->"<<patient.sex;
cout<<"\nAddress-
>"<<patient.address;
cout<<"\nTelephone No-
>"<<patient.phone;
cout<<"\nDisease-
>"<<patient.diseae;
cout<<"\nAddimision Data-
>"<<patient.add_date;
cout<<"\nDate of Release-
>"<<patient.realease;
cout<<"\nBed No-
>"<<patient.bed;
41
cout<<"\nUnit->"<<patient.unit;
cout<<"\nDoctore
Name"<<patient.doc;
cout<<"\nDoctore Ph No->"
<<patient.doc_phone;
cout<<"\nDoctore Address-
>"<<patient.doc_address;
42
getch();
clrscr();
infile.close();
fstream infile;
infile.open(fname,ios::in);
gets(patient[i].name);
cin>>patient[i].sex;
cout<<"\n Age-->";
cin>>patient[i].age;
43
cin>>patient[i].bed;
fflush(stdin);
gets(patient[i].doc);
fflush(stdin);
cout<<"\n Disease-->";
fflush(stdin);
gets(patient[i].disease);
fflush(stdin);
fflush(stdin);
gets(patient[i].doc_phone);
fflush(stdin);
gets(patient[i].release);
fflush(stdin);
fflush(stdin);
gets(patient[i].doc_address);
fflush(stdin);
cout<<"\n Unit-->";
44
fflush(stdin);
gets(patient.unit);
fflush(stdin);
infile.write((char*)&patient,sizeof(patient));
45
infile.close();
ifstream infile;
infile.open(fname,ios::in);
int n=0,i=0;
i=sizeof(patient);
infile.seekg(0,ios::end);
n=infile.tellg();
int j=0;
j=(n/i);
infile.seekg(0);
fflush(stdin);
char name1[30];
for(int t=0;t<=j-1;++t)
infile.read((char*)&patient,sizeof(patient));
cout<<" Record Number--> "<<(t+1);
46
cout<<"\n===============================\n" cout<<"\nPatient
Name->
"<<patient.name;
cout<<"\nAge->"<<patient.age;
cout<<"\nSex->"<<patient.sex;
cout<<"\nAddress-
>"<<patient.address;
cout<<"\nTelephone No-
>"<<patient.phone;
cout<<"\nDisease-
>"<<patient.diseae;
cout<<"\nAddimision Data-
>"<<patient.add_date;
cout<<"\nDate of Release-
>"<<patient.realease;
cout<<"\nBed No-
>"<<patient.bed;
cout<<"\nUnit->"<<patient.unit;
cout<<"\nDoctore
Name"<<patient.doc;
cout<<"\nDoctore Ph No->"
<<patient.doc_phone;
47
cout<<"\nDoctore Address-
>"<<patient.doc_address;
getch();
clrscr();
48
infile.close();
infile.open(fname,ios::in);
tfile.open("temp1",ios::out);
fflush(stdin);
gets(name1);
fflush(stdin);
for(int t=0;t<=j-1;++t)
infile.read((char*)&patient,sizeof(patient));
if(strcmp(name1,patient.disease)!=0)
tfile.write((char*)&patient,sizeof(patient));
clrscr();
} infile.close(); tfile.close();
remove(fname);
rename("temp1",fname);
49
gets(name1);
fflush(stdin);
for(int t=0;t<=j-1;++t)
infile.read((char*)&patient,sizeof(patient));
if(strcmp(name1,patient.disease)==0)
cout<<"\nPatient Name->
"<<patient.name;
cout<<"\nAge->"<<patient.age;
cout<<"\nSex->"<<patient.sex;
cout<<"\nAddress-
>"<<patient.address;
cout<<"\nTelephone No-
>"<<patient.phone;
cout<<"\nDisease-
>"<<patient.diseae;
cout<<"\nAddimision Data-
>"<<patient.add_date;
cout<<"\nDate of Release-
>"<<patient.realease;
50
cout<<"\nBed No-
>"<<patient.bed;
51
cout<<"\nUnit->"<<patient.unit;
cout<<"\nDoctore
Name"<<patient.doc;
cout<<"\nDoctore Ph No->"
<<patient.doc_phone;
cout<<"\nDoctore Address-
>"<<patient.doc_address;
getch();
clrscr();
infile.close();
ifstream infile;
fstream tfile;
infile.open(fname,ios::in);
52
int n=0,i=0;
i=sizeof(patient);
infile.seekg(0,ios::end);
n=infile.tellg();
int j=0;
j=(n/i);
infile.seekg(0);
fflush(stdin);
for(int t=0;t<=j-1;++t)
infile.read((char*)&patient,sizeof(patient));
cout<<" Record Number--> "<<(t+1);
cout<<"\n===============================\n" cout<<"\nPatient
Name->
"<<patient.name;
cout<<"\nAge->"<<patient.age;
cout<<"\nSex->"<<patient.sex;
cout<<"\nAddress-
>"<<patient.address;
cout<<"\nTelephone No-
>"<<patient.phone;
cout<<"\nDisease-
53
>"<<patient.diseae;
cout<<"\nAddimision Data-
>"<<patient.add_date;
cout<<"\nDate of Release-
>"<<patient.realease;
54
cout<<"\nBed No-
>"<<patient.bed;
cout<<"\nUnit->"<<patient.unit;
cout<<"\nDoctore
Name"<<patient.doc;
cout<<"\nDoctore Ph No->"
<<patient.doc_phone;
cout<<"\nDoctore Address-
>"<<patient.doc_address;
getch();
clrscr();
infile.close();
ifstream infile;
infile.open(fname,ios::in);
int n=0,i=0;
55
i=sizeof(patient);
infile.seekg(0,ios::end);
n=infile.tellg();
int j=0;
j=(n/i);
infile.seekg(0);
fflush(stdin);
fflush(stdin);
char name1[30];
fflush(stdin);
gets(name1);
infile.read((char*)&patient,sizeof(patient));
if(strcmp(name1,patient.bed)==0)
cout<<"\nPatient Name->
"<<patient.name;
cout<<"\nAge->"<<patient.age;
cout<<"\nSex->"<<patient.sex;
56
cout<<"\nAddress-
>"<<patient.address;
cout<<"\nTelephone No-
>"<<patient.phone;
cout<<"\nDisease-
>"<<patient.diseae;
57
cout<<"\nAddimision Data-
>"<<patient.add_date;
cout<<"\nDate of Release-
>"<<patient.realease;
cout<<"\nBed No-
>"<<patient.bed;
cout<<"\nUnit->"<<patient.unit;
cout<<"\nDoctore
Name"<<patient.doc;
cout<<"\nDoctore Ph No->"
<<patient.doc_phone;
cout<<"\nDoctore Address-
>"<<patient.doc_address;
getch();
clrscr();
infile.close();
void main()
{
58
clrscr();
char fname[20];
fflush(stdin);
gets(fname);
fflush(stdin);
clrscr();
char ch;
menu();
while((ch=toupper(getchar()))!='Q')
switch(toupper(ch))
modi(fname);
menu();
getch();
break;
display(fname);
menu();
getch();
break;
59
add12(fname);
menu();
getch();
break;
60
case 'R' : clrscr();
reading(fname);
menu();
getch();
break;
delete1(fname);
menu();
getch();
break;
unit1(fname);
menu();
getch();
break;
bed(fname);
menu();
getch();
break;
desease(fname);
menu();
getch();
break;
doc(fname);
menu();
getch();
} break;
61
}
62
REPORTS
OUTPUT SCREENS:-
MENU SCREEN:
SYSTEM:-
=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
=*=*=*=*=*=*=*=*=*=*=*
********MENU********
63
X -> Disease wise report.
Q -> Quit.
=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
=*=*=*=*=*=*=*=*=*=*=*=
ADDITION OF RECORD:
NAME ->
AGE ->
64
PHONE NUMBER OF THE PATIENT ->
RECORD NUMBER->
============================================
AGE ->
DISEASE ->
UNIT ->
65
Record Deleted ->
AGE ->
DISEASE ->
UNIT ->
66
67
Your Wanted Record Is Here ->
DISEASE ->
UNIT ->
============================================
==========
AGE ->
68
ADMISSION DATE OF THE PATIENT ->
DISEASE ->
AGE ->
DISEASE ->
69
DOCTOR’S ADDRESS ->
70
UNIT ->
MODIFICATION OF RECORDS:
============================================
==========
AGE ->
DISEASE ->
71
AGE ->
DISEASE ->
UNIT ->
DELETION OF RECORD
AGE ->
72
ADMISSION DATE OF THE PATIENT ->
DISEASE ->
AGE ->
73
ADMISSION DATE OF THE PATIENT ->
DISEASE ->
74
PATIENT’S NAME ->
AGE ->
DISEASE ->
UNIT ->
75
The project can be upgraded much more user friendly
and graphics oriented applications. Example -> V.C++
BIBLIOGRAPHY