0% found this document useful (0 votes)
80 views24 pages

Class12 CS Project Hospital Management System Bhavan New (1) Button

Uploaded by

raguramsangupani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
80 views24 pages

Class12 CS Project Hospital Management System Bhavan New (1) Button

Uploaded by

raguramsangupani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 24

VELAMMAL VIDHYASHRAM

SURAPET

COMPUTER SCIENCE

Topic: HOSPITAL MANAGEMENT SYSTEM

NAME:RAGURAM S
CLASS: 12 A2
ROLL NUMBER:

SSCE 2024 - 2025


BONAFIDE CERTIFICATE

This is to certify that this COMPUTER SCIENCE Project on the topic

"HOSPITAL MANAGENEMT SYSTEM” has been successfully completed by

RAGURAM S of class XII A2, Roll.no…………………... at Velammal Vidhyashram,

Surapet, for the partial fulfilment of Computer science Practical examination conducted

by Senior School Certificate Examination-CBSE, New Delhi for the academic Year

2024- 2025.

Date: ……………………..

Signature of Principal Teacher incharge

Signature of the Signature of the


Internal examiner External examiner
ACKNOWLEDGEMENT

Apart from the efforts taken by me, the success of the project depends largely on the
encouragement and guidelines of many others. I take this opportunity to express my
gratitude to the people who have been instrumental in the successful completion of this
project.

I express deep sense of gratitude to almighty God for giving me the strength to
complete the project successfully.

I express my heartfelt gratitude to my parents for the constant encouragement while


carrying out this project.

I express my deep sense of gratitude to the luminary, the Principal of Velammal


Vidhyashram, who has been continuously motivating and extending a helping hand to us.

My sincere thanks to Ms. Sowmiya a guide, mentor, above all a friend, who
critically reviewed my project and guided me during the implementation of the project.

The guidance and support received from all the members who contributed, was vital
for the success of the project. I am grateful for their constant support and help.

Signature of the Student


TABLE OF CONTENT:

1. ABSTRACT
2. SYSTEM CONFIGURATION
3. INTRODUCTION
4. OBJECTIVES OF THE PROJECT
5. PROPOSED SYSTEM
6. LIBRARIES AND FUNCTIONS USED
7. MYSQL QUERIES USED IN THIS PROJECT
8. SOURCE CODE
9. OUTPUT (SCREENSHOT)
10. CONCLUSION
11.BIBILOGRAPHY
ABSTRACT:

Hospital Management System project is developed using Python and MySQL Database.
This application provides an easy way to the admin in searching the details of the patients,
doctors, nurses and complete history of the patient. Hospital Management system project
in Python is a simple console application. In this project, users can perform typical report
card related functions like adding a new patient record and displaying and deleting it.

SYSTEM CONFIGURATION:

HARDWARE CONFIGURATION
Microsoft windows 7 professional/windows 8/windows 8.2:
 Processor : Intel Core i3 or equivalent
 Memory : 2 GB (32-bit), 4 GB (64-bit)
 Disk space : 1.5 GB of free disk space

SOFTWARE REQUIREMENTS
 1 GB RAM (2 GB+ recommended)
 9-58 GB free hard disk space depending on edition and configuration, including
space required for temporary files
 DVD-ROM drive (if installing from a Media Kit DVD)
 Basic GPU – Any vendor DirectX 9.0 class or better (Pixel Shader Level 2)
 Intel® Pentium® or compatible, 1.6 GHz minimum (2GHz+ recommended)
 1024x768 or higher-resolution monitor

 MOUSE OR OTHER POINTING DEVICE


INTRODUCTION

What is Hospital Management System Project in Python?


A Hospital Management System Project in Python is a computer system based
program that helps keep track of health care information and helps health care providers do
their jobs better.
Hospital Management System in Python: Project Information:

OBJECTIVES OF THE PROJECT

1. Manage Appointments
• Appointment widgets will be built into the sites of hospitals

 Appointment widgets will be built into the sites of hospitals that have their own. When
people go to the hospital’s website, they can easily appointment Bookings online.

2. Manage Doctors
• In this feature manage all the information’s of the Doctors /

 In this feature manage all the information’s of the Doctors/Nurses and each Doctor
Patients inside the hospital
3. Manage Patients
• HMS makes it possible to get all of a patient’s information

 HMS makes it possible to get all of a patient’s information through a system with just
a few clicks.
• The user can see information like the patient’s medical history,

 The user can see information like the patient’s medical history, current illness, doctors
involved, test results, billing information, and much more.
• These pieces of information will help put together what we

 These pieces of information will help put together what we know about the patient,
such as their specific diagnosis, treatment, and medications.

PROPOSED SYSTEM

One cannot rely on flawed people in today’s fierce competition, where “to err is human” is
no longer true. Furthermore, it is no longer appropriate to excuse one’s mistakes. To keep up
with the times, achieve the best results without any issues, and increase productivity, the
endless heaps of flies have been replaced with a computer’s hard drive.
Use of the data management tool is required. More and more businesses have failed as a
result of software. With so many technological options available, businesses could operate
more quickly and effectively. Data administration used to require a lot of ledger upkeep and
paper work, but software technologies have made their work more productive and labour-
intensive. The only tool required to complete work on the computer at the moment is this
application.
This results in significant time and financial savings. All business-related information is
accessible by pressing a button, and the process is fully automated. Moreover, automating a
business improves its reputation because we live in a technological age.
About Hospital Management System Project Python
The Hospital Management System Project is a system project console-based system
which is easy to use. In This Article you will learn step-by-step process on how to create
a Hospital Management System Project.
A Project for Hospital Management System is a education purposes only.
Importance of Hospital Management System
Hospital management is important because it allows healthcare to run in a structured
way and makes it easier to offer many different services.
It lets large hospitals that offer a wide range of services keep better track of their finances
by better planning the flow of money, making better investments, and controlling costs.
LIBRARIES USED:

1. mysqlconnector - MySQL Connector/Python enables Python programs to access


MySQL databases, using an API that is compliant with the Python Database API
Specification v2.0 (PEP 249). It is written in pure Python and does not have any
dependencies except for the Python Standard Library.

FUNCTIONS USED:
The following are custom functions used to manage various operations within the
system:
1. patient_detail():
o Purpose: Collects the data entered in the patient fields and inserts a new patient
record into the Patients table in the MySQL database and also view or modify
or delete the details of the patient.

2. doctor_details():
o Purpose: Collects the data entered in the doctor fields and inserts a new doctor
record into the Doctors table in the MySQL database and also view or modify
or delete the details of the doctor.

3. nurse_details():
o Purpose: Collects the data entered in the nurse fields and inserts a new nurse
record into the Nurses table in the MySQL database and also view or modify or
delete the details of the nurse.

4. other_workers_details():
o Purpose: Collects the data entered in the nurse fields and inserts a new worker
record into the Other Workers table in the MySQL database and also view or
modify or delete the details of the worker.
Purpose: Clears all input fields in the GUI to allow for new entries after an operation is
completed.
MYSQL QUERIES USED:
1. Creating Tables

 Creating the Doctor Table:


create table if not exists doctor_details(name varchar(30) primary key,specialisation
varchar(40),age int(2),address varchar(30),contact varchar(15),fees
int(10),monthly_salary int(10));
 Creating the Patient Table:
create table if not exists patient_detail(name varchar(30) primary key, sex varchar(15),
age int(3), address varchar(50), contact varchar(15));
 Creating the Nurse Table:
create table if not exists nurse_details(name varchar(30) primary key,age
int(2),address varchar(30),contact varchar(15),monthly_salary int(10));
 Creating the Other workers Table:
create table if not exists other_workers_details(name varchar(30) primary key,age
int(2),address varchar(30),contact varchar(15),monthly_salary int(10));
2. Inserting Data

 Inserting a New Patient:


mycursor.execute("insert into patient_detail values('" + name + "','" + sex + "','" +
age + "','" + address + "','" + contact + "')")
 Inserting a Doctor Details:
mycursor.execute("insert into doctor_details values('" + name + "','" + spe + "','" +
age + "','" + add + "','" + cont + "','" + fees + "','" + ms + "')")
 Inserting a Nurse Details:
mycursor.execute("insert into nurse_details values('" + name + "','" + age + "','" +
add + "','" + cont + "','" + str(ms) + "')")
 Inserting a other worker Details:
mycursor.execute("insert into other_workers_details values('" + name + "','" + age
+ "','" + add + "','" + cont + "','" + ms + "')")

3. Retrieving Data
 Retrieving All Patients/Doctors/Nurses/Other workers:
select * from doctor_details;
select * from nurse_details;
select * from other_workers_details;
select * from patient_detail;
4. Deleting Data
 Delete the Patient/Doctor/Nurse/Other worker:
delete from doctor_details where name='" + name + "';
delete from nurse_details where name='" + name + "';
delete from other_workers_details where name='" + name + "';
delete from patient_detail where name='" + name + "';

SOURCE CODE:

while (True):
print("""
================================
Welcome To CityHospital
================================
""")
# creating database connectivity
import mysql.connector
passwd = str(input("Enter the Password Please!!:"))

mysql = mysql.connector.connect(
host="localhost", user="root", passwd=passwd)
mycursor = mysql.cursor()
mycursor.execute("create database if not exists city_hospitals")
mycursor.execute("use city_hospitals")
# creating the tables we need
mycursor.execute(
"create table if not exists patient_detail(name varchar(30) primary key,sex
varchar(15),age int(3),address varchar(50),contact varchar(15))")
mycursor.execute("create table if not exists doctor_details(name varchar(30) primary
key,specialisation varchar(40),age int(2),address varchar(30),contact varchar(15),fees
int(10),monthly_salary int(10))")
mycursor.execute(
"create table if not exists nurse_details(name varchar(30) primary key,age int(2),address
varchar(30),contact varchar(15),monthly_salary int(10))")
mycursor.execute(
"create table if not exists other_workers_details(name varchar(30) primary key,age
int(2),address varchar(30),contact varchar(15),monthly_salary int(10))")

# creating table for storing the username and password of the user
mycursor.execute(
"create table if not exists user_data(username varchar(30) primary key,password
varchar(30) default'000')")

while (True):
print("""
1. Sign In
2. Registration
""")

r = int(input("enter your choice:"))


if r == 2:
print("""

=======================================
!!!!!!!!!!Register Yourself!!!!!!!!
=======================================
""")
u = input("Input your username!!:")
p = input("Input the password (Password must be strong!!!:")
mycursor.execute(
"insert into user_data values('" + u + "','" + p + "')")
mysql.commit()

print("""
============================================
!!Well Done!!Registration Done Successfully!!
============================================
""")
x = input("enter any key to continue:")
# IF USER WANTS TO LOGIN
elif r == 1:
print("""
==================================
!!!!!!!! {{Sign In}} !!!!!!!!!!
==================================
""")
un = input("Enter Username!!:")
ps = input("Enter Password!!:")

mycursor.execute(
"select password from user_data where username='" + un + "'")
row = mycursor.fetchall()
for i in row:
a = list(i)
if a[0] == str(ps):
while (True):
print("""
1.Administration
2.Patient(Details)
3.Sign Out
""")

a = int(input("ENTER YOUR CHOICE:"))


if a == 1:
print("""
1. Display the details
2. Add a new member
3. Delete a member

4. Make an exit
""")
b = int(input("Enter your Choice:"))
# details
if b == 1:
print("""
1. Doctors Details
2. Nurse Details
3. Others
""")

c = int(input("Enter your Choice:"))


if c == 1:
mycursor.execute(
"select * from doctor_details")
row = mycursor.fetchall()
for i in row:
b=0
v = list(i)
k = ["NAME", "SPECIALISATION", "AGE", "ADDRESS",
"CONTACT", "FEES",
"MONTHLY_SALARY"]
d = dict(zip(k, v))
print(d)
# displays nurses details
elif c == 2:
mycursor.execute(
"select * from nurse_details")
row = mycursor.fetchall()
for i in row:
v = list(i)
k = ["NAME", "SPECIALISATION", "AGE",
"ADDRESS", "CONTACT", "MONTHLY_SALARY"]
d = dict(zip(k, v))
print(d)
# displays worker details
elif c == 3:
mycursor.execute(
"select * from other_workers_details")
row = mycursor.fetchall()
for i in row:
v = list(i)
k = ["NAME", "SPECIALISATION", "AGE",
"ADDRESS", "CONTACT""MONTHLY_SALARY"]
d = dict(zip(k, v))
print(d)
# IF USER WANTS TO ENTER DETAILS
elif b == 2:
print("""

1. Doctor Details
2. Nurse Details
3. Others
""")
c = int(input("ENTER YOUR CHOICE:"))
# enter doctor details
if c == 1:
# ASKING THE DETAILS
name = input("Enter the doctor's name")
spe = input("Enter the specilization:")
age = input("Enter the age:")
add = input("Enter the address:")
cont = input("Enter Contact Details:")

fees = input("Enter the fees:")


ms = input("Enter Monthly Salary:")
# Inserting values in doctors details
mycursor.execute("insert into doctor_details values('" + name + "','" + spe
+
"','" + age + "','" + add + "','" + cont + "','" + fees + "','" + ms +
"')")
mysql.commit()
print("SUCCESSFULLY ADDED")
# for nurse details
elif c == 2:
# ASKING THE DETAILS
name = input("Enter Nurse name:")
age = input("Enter age:")
add = input("Enter address:")
cont = input("Enter Contact No:")
ms = int(input("Enter Monthly Salary"))
# INSERTING VALUES ENTERED TO THE TABLE
mycursor.execute("insert into nurse_details values('" + name + "','" + age +
"','" + add + "','" + cont + "','" + str(
ms) + "')")
mysql.commit()
print("SUCCESSFULLY ADDED")
# for entering workers details
elif c == 3:
# ASKING THE DETAILS
name = input("Enter worker name:")
age = input("Enter age:")
add = input("Enter address:")
cont = input("Enter Contact No.:")
ms = input("Enter Monthly Salary:")
# INSERTING VALUES ENTERED TO THE TABLE

mycursor.execute("insert into other_workers_details values('" +


name + "','" + age + "','" + add + "','" + cont + "','" + ms +
"')")
mysql.commit()
print("SUCCESSFULLY ADDED")
# to delete data
elif b == 3:
print("""
1. Doctor Details
2. Nurse Details
3. Others
""")
c = int(input("Enter your Choice:"))
# deleting doctor's details
if c == 1:
name = input("Enter Doctor's Name:")
mycursor.execute(
"select * from doctor_details where name='" + name + "'")
row = mycursor.fetchall()
print(row)
p = input(
"you really wanna delete this data? (y/n):")
if p == "y":
mycursor.execute(
"delete from doctor_details where name='" + name + "'")
mysql.commit()
print("SUCCESSFULLY DELETED!!")
else:
print("NOT DELETED")
# deleting nurse details
elif c == 2:
name = input("Enter Nurse Name:")
mycursor.execute(
"select * from nurse_details where name='" + name + "'")
row = mycursor.fetchall()
print(row)
p = input(
"you really wanna delete this data? (y/n):")
if p == "y":
mycursor.execute(
"delete from nurse_details where name='" + name + "'")
mysql.commit()
print("SUCCESSFULLY DELETED!!")
else:
print("NOT DELETED")
# deleting other_workers details
elif c == 3:
name = input("Enter the worker Name")
mycursor.execute(
"select * from workers_details where name='" + name + "'")
row = mycursor.fetchall()
print(row)
p = input(
"you really wanna delete this data? (y/n):")
if p == "y":
mycursor.execute(
"delete from other_workers_details where name='" + name + "'")
mysql.commit()
print("SUCCESSFULLY DELETED!!")
else:
print("NOT DELETED")
elif b == 4:

break

# entering the patient details table


elif a == 2:

print("""
1. Show Patients Info
2. Add New Patient
3. Discharge Summary
4. Exit
""")
b = int(input("Enter your Choice:"))
# showing the existing details
# if user wants to see the details of PATIENT
if b == 1:
mycursor.execute(
"select * from patient_detail")
row = mycursor.fetchall()
for i in row:
b=0
v = list(i)
k = ["NAME", "SEX", "AGE",
"ADDRESS", "CONTACT"]
d = dict(zip(k, v))
print(d)

# adding new patient


elif b == 2:
name = input("Enter your name ")
sex = input("Enter the gender: ")
age = input("Enter age: ")

address = input("Enter address: ")


contact = input("Contact Details: ")
mycursor.execute("insert into patient_detail values('" + name + "','" + sex + "','"
+
age + "','" + address + "','" + contact + "')")
mysql.commit()
mycursor.execute(
"select * from patient_detail")
for i in mycursor:
v = list(i)
k = ['NAME', 'SEX', 'AGE',
'ADDRESS', 'CONTACT']
print(dict(zip(k, v)))
print("""
====================================
!!!!!!!Registered Successfully!!!!!!
====================================
""")
# dischare process
elif b == 3:
name = input("Enter the Patient Name:")
mycursor.execute(
"select * from patient_detail where name='" + name + "'")
row = mycursor.fetchall()
print(row)
bill = input(
"Has he paid all the bills? (y/n):")
if bill == "y":
mycursor.execute(
"delete from patient_detail where name='" + name + "'")
mysql.commit()

# if user wants to exit


elif b == 4:
break
# SIGN OUT

elif a == 3:
break

# IF THE USERNAME AND PASSWORD IS NOT IN THE DATABASE


else:
break

OUTPUT:
CONCLUSION:

Hospital management system is an environment where all the process of the


patients/doctors/other workers in the institution is managed. It is done through the
automated computerized method. Conventionally this system is done using papers, file and
binders.

This system saves the time of the administrator. It includes process like Patient/Doctor
addition, displaying, deleting.

This makes the system easy to handle and feasible for finding the omission with updating
at the same time.
If filed a query to search or update in a manual system, it will take a lot of time to process
the query and make a report which is a tedious job.

This computerized system store all the data in the database which makes it easy to fetch
and update whenever needed.
BIBILOGRAPHY:

Computer Science With Python by Sumita Arora for Class 11& 12

HTTPS://WWW.W3SCHOOLS.COM/PYTHON/

PYTHON_MYSQL_GETSTARTED.ASP

HTTPS://WWW.TUTORIALSPOINT.COM/PYTHON/PYTHON_DATABASE

_ACCESS.HTM HTTPS://PYTHONSPOT.COM/MYSQL-WITH-PYTHON/

You might also like