MINI PROJECT REPORT
MINI PROJECT REPORT
ON
“Hospital Management System”
(Database Management)
SUBMITTED BY
Shreyash Kamble (TE201)
Abhi Kharatmol (TE206)
Akash Khiste (TE208)
Vedant Londhe (TE220)
2022-23
T.E. (Electronics & Telecommunication Engineering)
Semester - I
Under the Guidance Of
Mr. NIKHIL DHAVASE
DEPARTMENT OF ELECTRONICS & TELECOMMUNICATION
ENGINEERING
MARATHWADA MITRA MANDAL’S COLLEGE OF ENGINEERING,
KARVENAGAR, PUNE.
2022-2023
Marathwada Mitra Mandal’s College of Engineering, Dept of E&TC Page 1
MINI PROJECT REPORT
MARATHWADA MITRA MANDAL’S
COLLEGE OF ENGINEERING, PUNE.
Accredited with ‘A’ Grade by NAAC
DEPARTMENT OF ELECTRONICS & TELECOMMUNICATION
ENGINEERING
CERTIFICATE
This is to certify that student Shreyash Kamble, Abhi Kharatmol, Akash Khiste,
Vedant Londhe, Roll No:-TE201,TE206,TE208,TE220 is studying in TE2 E&TC
course in SEM I and he has successfully completed and submitted the Mini Project
Report under the subject Database Management, entitled “HOSPITAL
MANAGEMENT SYSTEM” .This study is a partial fulfillment of the degree of
Bachelor of Engineering in Electronics & Telecommunication of Savitribai Phule
Pune University, PUNE during the academic year 2022-2023.
Mr. NIKHIL DHAVASE Dr. G. S. GAWANDE
Guide H.O.D.
Marathwada Mitra Mandal’s College of Engineering, Dept of E&TC Page 2
MINI PROJECT REPORT
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 like add patient, update patient, delete patient, search patient,
view patient diagnosis, 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. The Hospital Management System can be entered using a username
and password. It is accessible by an Admin, Doctor & Receptionist. Only they can
add data into the database. The data can be retrieved easily. The data are well
protected for personal use and makes the data processing very fast.
Government of India has still aimed at providing medical facilities by establishing
hospital. The basic working of various hospitals in India is still on paper as
compared to hospitals in European countries where computers have been put in to
assist the hospital personals their work. The concept of automation of the
administration and management of hospital is now being implemented in India
also, with large hospitals like APPOLO and AIIMS in Delhi, ESCORTS in
Chennai, having automated their existing system.
Marathwada Mitra Mandal’s College of Engineering, Dept of E&TC Page 3
MINI PROJECT REPORT
INDEX
TOPIC PAGE NO.
1. Introduction… .............................................................................5
1.1 Scope of Project .................................................................... 7
1.2 Application Of Project .......................................................... 7
2. Requirements
2.1 Software Requirements .......................................................... 8
2.2 Hardware Requirements ........................................................ 8
3. Sample Source Code .................................................................. 10
4. Graphical User Interface ............................................................ 19
5. Future Enhancement ................................................................... 22
6. Conclusion… .............................................................................. 23
7. References / Bibliography…......................................................... 24
Marathwada Mitra Mandal’s College of Engineering, Dept of E&TC Page 4
MINI PROJECT REPORT
1. Introduction
Health of citizen is the wealth of Nation. India has contributes the most ancient
Medical science "AYURVEDA" to the world besides other medical sciences. This
field had witnessed a rapid metamorphosis in all of its sections. Hospital
Management System is designed to improve the quality and management of hospital
in the areas of clinical process analysis and activity-based costing. Hospital
Management System enables you to develop your organization and improve its
effectiveness and quality of work. Managing the key processes efficiently is critical
to the success of the hospital helps you manage your processes.
The Hospital Management System can be entered using a username and password.
It is accessible by an Admin, Doctor & Receptionist. Only they can add data into the
database. The data can be retrieved easily. The data are well protected for personal
use and makes the data processing very fast. Hospital Management System is
powerful, flexible, and easy to use and is designed and developed to deliver real
conceivable benefits to hospitals.
The project Hospital Management system includes registration of patients, storing
their details into the system by using database. The software has the facility to give
a unique id for every patient and stores the details of every patient and the staff
manually. Admin can view Health of citizen is the wealth of Nation. India has
contributes the most ancient Medical science "AYURVEDA" to the world besides
other medical sciences. This field had witnessed a rapid metamorphosis in all of its
sections. Hospital Management System is designed to improve the quality and
management of hospital in the areas of clinical process analysis and activity-based
costing. Hospital Management System enables you to develop your organization and
improve its effectiveness and quality of work. Managing the key processes efficiently
is critical to the success of the hospital helps you manage your processes.
Marathwada Mitra Mandal’s College of Engineering, Dept of E&TC Page 5
MINI PROJECT REPORT
The Hospital Management System can be entered using a username and password.
It is accessible by an Admin, Doctor & Receptionist. Only they can add data into the
database. The data can be retrieved easily. The data are well protected for personal
use and makes the data processing very fast. Hospital Management System is
powerful, flexible, and easy to use and is designed and developed to deliver real
conceivable benefits to hospitals.
The project Hospital Management system includes registration of patients, storing
their details into the system by using database. The software has the facility to give
a unique id for every patient and stores the details of every patient and the staff
manually. Admin can view availability of a doctor and the details of a patient using
the name, id, Hospital Management System is designed for multi specialist hospitals,
to cover a wide range of hospital administration and management processes. It also
aims at providing low-cost reliable automation of the existing systems. The system
also provides excellent security of data at every level of user-system interaction and
also provides robust & reliable storage facilities.
Marathwada Mitra Mandal’s College of Engineering, Dept of E&TC Page 6
MINI PROJECT REPORT
1.1 Scope of Project
All this work is done manually by the receptionist and other operational staff and lot
of papers are needed to be handled and taken care of. Doctors have to remember
various medicines available for diagnosis and sometimes miss better alternatives as
they can't remember them at that time. The limited time and resources have restricted
us to incorporate, in this project, only main activities that are performed in a Hospital
Management System, but utmost care has been taken to make the system efficient
and user friendly.
Most of the analysis and interpretations, made for this report, are based on secondary
data obtained. This data could have some inherent mistakes and errors. Finally,
although due care has been taken those can be typing and compilation errors in the
report itself. The tasks specified were not well defined because nothing was
mentioned regarding validations in the project. Though we gave maximum effort to
check the software. But it in no way alters the ultimate aim of the project and because
it's highly USER FRIENDLY, it would be the choice of all kinds of personnel.
1.2 Application Of Project
Hospital Management System is a web-based application developed using Python,
HTML, and SQL server database. This project is fully automated and aims at
providing effective management services in hospitals by controlling information such
as patient details, staff schedules, operating room schedules, room availability, and
patient invoices.
Marathwada Mitra Mandal’s College of Engineering, Dept of E&TC Page 7
MINI PROJECT REPORT
2. Requirements
2.1 Software Requirements
Operating system: Windows 7, 10
Front-end: Python
Back-end: MySQL
Development environment/tools: NetBeans IDE 8.2 & Xampp
2.2 Hardware Requirements
The most common set of requirements defined by any operating system or software
application is the physical computer resources, also known as hardware. A hardware
requirements list is often accompanied by a hardware compatibility list (HCL),
especially in case of operating systems. An HCL lists tested, compatibility and
sometimes incompatible hardware devices for a particular operating system or
application. The following sub-sections discuss the various aspects of hardware
requirements.
Hardware requirements for present project:
Processor: Intel core i3
RAM : 4GB
Hard disk: 1TB (Minimum 80GB)
Marathwada Mitra Mandal’s College of Engineering, Dept of E&TC Page 8
MINI PROJECT REPORT
ER Diagram
Marathwada Mitra Mandal’s College of Engineering, Dept of E&TC Page 9
MINI PROJECT REPORT
3. Sample Source Code
from flask import Flask,render_template,request,session,redirect,url_for,flash
from flask_sqlalchemy import SQLAlchemy
from flask_login import UserMixin
from werkzeug.security import generate_password_hash,check_password_hash
from flask_login import login_user,logout_user,login_manager,LoginManager
from flask_login import login_required,current_user
from flask_mail import Mail
import json
with open('config.json','r') as c:
params = json.load(c)["params"]
# MY db connection
local_server= True
app = Flask( name )
app.secret_key='aneeqah'
# this is for getting unique user access
login_manager=LoginManager(app)
login_manager.login_view='login'
# SMTP MAIL SERVER SETTINGS
app.config.update(
MAIL_SERVER='smtp.gmail.com',
MAIL_PORT='465',
MAIL_USE_SSL=True,
MAIL_USERNAME=params['gmail-user'],
MAIL_PASSWORD=params['gmail-password']
Marathwada Mitra Mandal’s College of Engineering, Dept of E&TC Page 10
MINI PROJECT REPORT
mail = Mail(app)
@login_manager.user_loader
def load_user(user_id):
return User.query.get(int(user_id))
# app.config['SQLALCHEMY_DATABASE_URL']='mysql://username:password@localhost/databas_table_name'
app.config['SQLALCHEMY_DATABASE_URI']='mysql://root:@localhost/hmdbms'
db=SQLAlchemy(app)
# here we will create db models that is tables
class Test(db.Model):
id=db.Column(db.Integer,primary_key=True)
name=db.Column(db.String(100))
email=db.Column(db.String(100))
class User(UserMixin,db.Model):
id=db.Column(db.Integer,primary_key=True)
username=db.Column(db.String(50))
usertype=db.Column(db.String(50))
email=db.Column(db.String(50),unique=True)
password=db.Column(db.String(1000))
class Patients(db.Model):
pid=db.Column(db.Integer,primary_key=True)
Marathwada Mitra Mandal’s College of Engineering, Dept of E&TC Page 11
MINI PROJECT REPORT
email=db.Column(db.String(50))
name=db.Column(db.String(50))
gender=db.Column(db.String(50))
slot=db.Column(db.String(50))
disease=db.Column(db.String(50))
time=db.Column(db.String(50),nullable=False)
date=db.Column(db.String(50),nullable=False)
dept=db.Column(db.String(50))
number=db.Column(db.String(50))
class Doctors(db.Model):
did=db.Column(db.Integer,primary_key=True)
email=db.Column(db.String(50))
doctorname=db.Column(db.String(50))
dept=db.Column(db.String(50))
class Trigr(db.Model):
tid=db.Column(db.Integer,primary_key=True)
pid=db.Column(db.Integer)
email=db.Column(db.String(50))
name=db.Column(db.String(50))
action=db.Column(db.String(50))
timestamp=db.Column(db.String(50))
# here we will pass endpoints and run the fuction
@app.route('/')
def index():
a=params['gmail-user']
Marathwada Mitra Mandal’s College of Engineering, Dept of E&TC Page 12
MINI PROJECT REPORT
return render_template('index.html')
@app.route('/doctors',methods=['POST','GET'])
def doctors():
if request.method=="POST":
email=request.form.get('email')
doctorname=request.form.get('doctorname')
dept=request.form.get('dept')
query=db.engine.execute(f"INSERT INTO `doctors` (`email`,`doctorname`,`dept`) VALUES
('{email}','{doctorname}','{dept}')")
flash("Information is Stored","primary")
return render_template('doctor.html')
@app.route('/patients',methods=['POST','GET'])
@login_required
def patient():
doct=db.engine.execute("SELECT * FROM `doctors`")
if request.method=="POST":
email=request.form.get('email')
name=request.form.get('name')
gender=request.form.get('gender')
slot=request.form.get('slot')
disease=request.form.get('disease')
time=request.form.get('time')
Marathwada Mitra Mandal’s College of Engineering, Dept of E&TC Page 13
MINI PROJECT REPORT
date=request.form.get('date')
dept=request.form.get('dept')
number=request.form.get('number')
subject="HOSPITAL MANAGEMENT SYSTEM"
query=db.engine.execute(f"INSERT INTO `patients` (`email`,`name`,
`gender`,`slot`,`disease`,`time`,`date`,`dept`,`number`) VALUES
('{email}','{name}','{gender}','{slot}','{disease}','{time}','{date}','{dept}','{number}')")
# mail starts from here
# mail.send_message(subject, sender=params['gmail-user'], recipients=[email],body=f"YOUR bOOKING
IS CONFIRMED THANKS FOR CHOOSING US \nYour Entered Details are :\nName: {name}\nSlot: {slot}")
flash("Booking Confirmed","info")
return render_template('patient.html',doct=doct)
@app.route('/bookings')
@login_required
def bookings():
em=current_user.email
if current_user.usertype=="Doctor":
query=db.engine.execute(f"SELECT * FROM `patients`")
return render_template('booking.html',query=query)
else:
query=db.engine.execute(f"SELECT * FROM `patients` WHERE email='{em}'")
return render_template('booking.html',query=query)
Marathwada Mitra Mandal’s College of Engineering, Dept of E&TC Page 14
MINI PROJECT REPORT
@app.route("/edit/<string:pid>",methods=['POST','GET'])
@login_required
def edit(pid):
posts=Patients.query.filter_by(pid=pid).first()
if request.method=="POST":
email=request.form.get('email')
name=request.form.get('name')
gender=request.form.get('gender')
slot=request.form.get('slot')
disease=request.form.get('disease')
time=request.form.get('time')
date=request.form.get('date')
dept=request.form.get('dept')
number=request.form.get('number')
db.engine.execute(f"UPDATE `patients` SET `email` = '{email}', `name` = '{name}', `gender` =
'{gender}', `slot` = '{slot}', `disease` = '{disease}', `time` = '{time}', `date` = '{date}', `dept` =
'{dept}', `number` = '{number}' WHERE `patients`.`pid` = {pid}")
flash("Slot is Updates","success")
return redirect('/bookings')
return render_template('edit.html',posts=posts)
@app.route("/delete/<string:pid>",methods=['POST','GET'])
@login_required
def delete(pid):
db.engine.execute(f"DELETE FROM `patients` WHERE `patients`.`pid`={pid}")
flash("Slot Deleted Successful","danger")
return redirect('/bookings')
Marathwada Mitra Mandal’s College of Engineering, Dept of E&TC Page 15
MINI PROJECT REPORT
@app.route('/signup',methods=['POST','GET'])
def signup():
if request.method == "POST":
username=request.form.get('username')
usertype=request.form.get('usertype')
email=request.form.get('email')
password=request.form.get('password')
user=User.query.filter_by(email=email).first()
if user:
flash("Email Already Exist","warning")
return render_template('/signup.html')
encpassword=generate_password_hash(password)
new_user=db.engine.execute(f"INSERT INTO `user` (`username`,`usertype`,`email`,`password`) VALUES
('{username}','{usertype}','{email}','{encpassword}')")
# this is method 2 to save data in db
# newuser=User(username=username,email=email,password=encpassword)
# db.session.add(newuser)
# db.session.commit()
flash("Signup Succes Please Login","success")
return render_template('login.html')
return render_template('signup.html')
@app.route('/login',methods=['POST','GET'])
def login():
if request.method == "POST":
email=request.form.get('email')
Marathwada Mitra Mandal’s College of Engineering, Dept of E&TC Page 16
MINI PROJECT REPORT
password=request.form.get('password')
user=User.query.filter_by(email=email).first()
if user and check_password_hash(user.password,password):
login_user(user)
flash("Login Success","primary")
return redirect(url_for('index'))
else:
flash("invalid credentials","danger")
return render_template('login.html')
return render_template('login.html')
@app.route('/logout')
@login_required
def logout():
logout_user()
flash("Logout SuccessFul","warning")
return redirect(url_for('login'))
@app.route('/test')
def test():
try:
Test.query.all()
return 'My database is Connected'
except:
Marathwada Mitra Mandal’s College of Engineering, Dept of E&TC Page 17
MINI PROJECT REPORT
return 'My db is not Connected'
@app.route('/details')
@login_required
def details():
# posts=Trigr.query.all()
posts=db.engine.execute("SELECT * FROM `trigr`")
return render_template('trigers.html',posts=posts)
@app.route('/search',methods=['POST','GET'])
@login_required
def search():
if request.method=="POST":
query=request.form.get('search')
dept=Doctors.query.filter_by(dept=query).first()
name=Doctors.query.filter_by(doctorname=query).first()
if name:
flash("Doctor is Available","info")
else:
flash("Doctor is Not Available","danger")
return render_template('index.html')
app.run(debug=True)
Marathwada Mitra Mandal’s College of Engineering, Dept of E&TC Page 18
MINI PROJECT REPORT
4. Graphical User Interface
Marathwada Mitra Mandal’s College of Engineering, Dept of E&TC Page 19
MINI PROJECT REPORT
Marathwada Mitra Mandal’s College of Engineering, Dept of E&TC Page 20
MINI PROJECT REPORT
Marathwada Mitra Mandal’s College of Engineering, Dept of E&TC Page 21
MINI PROJECT REPORT
5. Future Enhancement
The proposed system is Hospital Management System. We can
enhance this system by including more facilities like pharmacy
system for the stock details of medicines in the pharmacy.
Providing such features enable the users to include more
Marathwada Mitra Mandal’s College of Engineering, Dept of E&TC Page 22
MINI PROJECT REPORT
6. Conclusion
The project Hospital Management System (HMS) is for computerizing the
working in a hospital. The software takes care of all the requirements of an
average hospital and is capable to provide easy and effective storage of
information related to patients that come up to the hospital.
Marathwada Mitra Mandal’s College of Engineering, Dept of E&TC Page 23
MINI PROJECT REPORT
7. References
• https://www.slideshare.net/
• https://www.coursehero.com/
• https://mocdoc.in/
• https://m.mu.edu.sa/
Marathwada Mitra Mandal’s College of Engineering, Dept of E&TC Page 24