You are on page 1of 21

A MINI PROJECT ON HOSPITAL

MANAGEMENT SYSTEM

CMR INSTITUTE OF TECHNOLOGY


B.E ARTIFICIAL INTELLIGENCE AND DATA SCIENCE

SUBMITTED BY:
Meghana P S
Medha D K
Lavdeep
ACKNOWLEDGEMENT

Apart from the efforts of team, the success of any project


depends largely on the encouragement and guidelines of
many others. We take this opportunity to express our
gratitude to the people who have been instrumental in the
successful completion of this project.
The completion of any inter-disciplinary project depends
upon cooperation, co-ordination and combined efforts of
several sources of knowledge.
We are eternally grateful to our teacher Dr.Ayyappa for her
even willingness to give us valuable advice and direction
under which we executed this project. Her constant guidance
and willingness to share her vast knowledge made us
understand this project and its manifestations in great
depths and helped us to complete the assigned tasks.

Meghana P S
Medha D K
Lavdeep
CERTIFICATE

DEPARTMENT OF ARTIFICIAL INTELLIGENCE


AND DATA SCIENCE
CMR INSTITUE OF TECHNOLOGY
#132 AECS LAYOUT ITPL MAIN ROAD, KUNDALAHALLI
BANGALORE -560037

This is to certify that Software Engineering project report entitled


"Hospital Management System" is the work carried out by Meghana
P S ,Medha D K ,Lavdeep Tiwari students of B.E Artificial intelligence
and data science Ist semester ,CMR INSTITUTE OF TECHNOLOGY
under the supervision of Dr.Ayyappa sir, Assistant Professor,
Department of Computer Science, CMR Institute of technology . This
report has not been submitted to any other organization/institution
for the award any other degree/diploma .

PROJECT COORDINATOR: HEAD OF THE DEPARTMENT:


ABSTRACT

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 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 screen. It is
accessible either by an administrator or receptionist. The data can be
retrieved easily. The data are well protected for personal use and makes
the data processing very fast.
INDEX
CONTENT

1. Introduction
• Purpose
• Scope
• Advantages
• Disadvantages

2. History of C

3. Advantages of C

4. Source code

5. Output of the project


Hospital Management system

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.

Advantages of HMS in hospitals:

Following benefits of hospital management system are:

➢ Improved clinical care & patient safety


➢ Quick & coordinated care
➢ Reduced readmissions
➢ Reduced waiting times
➢ Reduced cost.

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

C seems strange name for a programming language. But this


strange sounding language is one of the most popular
computer languages today because it is a structured, high
level machine independent language. It allows software
deposers program without worrying about the hardware
platform where they will be implemented.

The root of all modern language is ALGOL, introduced in the


early 1960s. ALGOL waste first computer language to use a
block structure. Although it never becomes popular in USA, it
was widely used in Europe. ALGOL gave the concept of
structured programming to the computer since community.
Computer scientist likes Corred Bohm, Guiseppe Jacopin and
Edsger Dijkstra popularized this concept during
1960s.subseqentaly, several languages were announced.

C is evolved from ALGOL, BCPL and B by DennisRitchie at the


Bell Laboratories in 1972.the language becomes more
popular after publication of the book ‘THE C PROGRAMMING
LANGAUGE’ by B.KERNINGHAM and DENNIS RITCHIE in
1978.
Advantages of C

 The C compiler combines the capabilities of an assembly


language with the future of a high level language.

 This due to its variety of data types and powerful


operators.

 It is many times faster than BASIC.

 C is highly portable. This means that C programs written


for
one computer can be run on another with little or no
modification.
SORCE CODE:
#include<stdio.h>
#include<stdlib.h>
#include<time.h>

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");

printf("Enter Patient id: ");


scanf("%d", &p.id);

printf("Enter Patient name: ");


fflush(stdin);
gets(p.patientName);

printf("Enter Patient Address: ");


fflush(stdin);
gets(p.patientAddress);

printf("Enter Patient Disease: ");


fflush(stdin);
gets(p.disease);

printf("\nPatient Added Successfully");

fwrite(&p, sizeof(p), 1, fp);


fclose(fp);
}

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");

while(fread(&p, sizeof(p), 1, fp) == 1){

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");

printf("Enter Doctor id: ");


scanf("%d", &d.id);

printf("Enter Doctor Name: ");


fflush(stdin);
gets(d.name);

printf("Enter Doctor Address: ");


fflush(stdin);
gets(d.address);

printf("Doctor Specialize in: ");


fflush(stdin);
gets(d.specialize);

printf("Doctor Added Successfully\n\n");

fwrite(&d, sizeof(d), 1, fp);


fclose(fp);
}

void doctorList(){
system("cls");
printf("<== Doctor List ==>\n\n");

printf("%-10s %-30s %-30s %-30s %s\n", "id", "Name", "Address",


"Specialize","Date");
printf("-------------------------------------------------------------------------------
------------------------------------\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 :

You might also like