Professional Documents
Culture Documents
MANAGEMENT SYSTEM
SUBMITTED BY:
Meghana P S
Medha D K
Lavdeep
ACKNOWLEDGEMENT
Meghana P S
Medha D K
Lavdeep
CERTIFICATE
1. Introduction
• Purpose
• Scope
• Advantages
• Disadvantages
2. History of C
3. Advantages of C
4. Source code
INTRODUCTION
The project Hospital Management system includes registration of
patients, storing their details into the system. The software has the
facility to give a unique id for every patient and stores the details of
every patient and the staff automatically User can search availability
of a doctor and the details of a patient using the id.
The purpose of the project entitled as “HOSPITAL MANAGEMENT
SYSTEM” is to computerize the Front Office Management of Hospital
to develop software which is user friendly, simple, fast, and cost –
effective. It deals with the collection of patient’s information,
diagnosis details, etc.
Traditionally, it was done manually. The main function of the system
is to register and store patient details and doctor details and retrieve
these details as and when required, and also to manipulate these
details meaningfully System input contains patient details, diagnosis
details; while system output is to get these details on to the CRT
screen.
Purpose:
This software will help the company to be more efficient in
registration of their patients and manage appointments, records of
patients. It enables doctors and admin to view and modify
appointments schedules if required. The purpose of this project is to
computerize all details regarding patient details and hospital details.
SCOPE :
The system will be used as the application that serves hospitals,
clinic, dispensaries or other health institutions. The intention of the
system is to increase the number of patients that can be treated and
managed properly.
Disadvantages:
• Requires large database.
• The admin has to manually keep updating the information
by entering the details in the system.
• Need Internet connection
HISTORY OF C
struct patient{
int id;
char patientName[50];
char patientAddress[50];
char disease[50];
char date[12];
}p;
struct doctor{
int id;
char name[50];
char address[50];
char specialize[50];
char date[12];
}d;
FILE *fp;
int main(){
int ch;
while(1){
system("cls");
printf("<== Hospital Management System ==>\n");
printf("1.Admit Patient\n");
printf("2.Patient List\n");
printf("3.Discharge Patient\n");
printf("4.Add Doctor\n");
printf("5.Doctors List\n");
printf("0.Exit\n\n");
printf("Enter your choice: ");
scanf("%d", &ch);
switch(ch){
case 0:
exit(0);
case 1:
admitPatient();
break;
case 2:
patientList();
break;
case 3:
dischargePatient();
break;
doctorList();
break;
default:
case 4:
addDoctor();
break;
case 5:
printf("Invalid Choice...\n\n");
}
printf("\n\nPress Any Key To Continue...");
getch();
}
return 0;
}
void admitPatient(){
char myDate[12];
time_t t = time(NULL);
struct tm tm = *localtime(&t);
sprintf(myDate, "%02d/%02d/%d", tm.tm_mday, tm.tm_mon+1,
tm.tm_year + 1900);
strcpy(p.date, myDate);
fp = fopen("patient.txt", "ab");
void patientList(){
system("cls");
printf("<== Patient List ==>\n\n");
printf("%-10s %-30s %-30s %-20s %s\n", "Id", "Patient Name",
"Address", "Disease", "Date");
printf("-------------------------------------------------------------------------------
---------------------------\n");
fp = fopen("patient.txt", "rb");
while(fread(&p, sizeof(p), 1, fp) == 1){
printf("%-10d %-30s %-30s %-20s %s\n", p.id, p.patientName,
p.patientAddress, p.disease, p.date);
}
fclose(fp);
}
void dischargePatient(){
int id, f=0;
system("cls");
printf("<== Discharge Patient ==>\n\n");
printf("Enter Patient id to discharge: ");
scanf("%d", &id);
FILE *ft;
fp = fopen("patient.txt", "rb");
ft = fopen("temp.txt", "wb");
if(id == p.id){
f=1;
}else{
fwrite(&p, sizeof(p), 1, ft);
}
}
if(f==1){
printf("\n\nPatient Discharged Successfully.");
}else{
printf("\n\nRecord Not Found !");
}
fclose(fp);
fclose(ft);
remove("patient.txt");
rename("temp.txt", "patient.txt");
void addDoctor(){
char myDate[12];
time_t t = time(NULL);
struct tm tm = *localtime(&t);
sprintf(myDate, "%02d/%02d/%d", tm.tm_mday, tm.tm_mon+1,
tm.tm_year + 1900);
strcpy(d.date, myDate);
int f=0;
system("cls");
printf("<== Add Doctor ==>\n\n");
fp = fopen("doctor.txt", "ab");
void doctorList(){
system("cls");
printf("<== Doctor List ==>\n\n");
fp = fopen("doctor.txt", "rb");
while(fread(&d, sizeof(d), 1, fp) == 1){
printf("%-10d %-30s %-30s %-30s %s\n", d.id, d.name, d.address,
d.specialize, d.date);
}
fclose(fp);
}
OUTPUT OF THE PROJECT :