Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 63

HOSPITAL MANAGEMNT SYSTEM

Project work submitted to PM Shri Kendriya Vidyalaya,


Dharwad in partial fulfillment of the requirements for the
award of
HIGHER SECONDARY – SECOND YEAR
Submitted by
SAIKUMAR TALWAR
Under the guidance of

MRS. K. SIVACHITRA M.Sc., B.Ed.


PGT (COMPUTER SCIENCE)

Someshwar Temple Road


Dharwad – 580002
2023-2024

1
BONAFIDE CERTIFICATE

This is to certify that the project work was done under the
guidance and this work entitled as “HOSPITAL
MANAGEMENT SYSTEM” submitted by SAIKUMAR
TALWAR to PM Shri Kendriya Vidyalaya, Dharwad in partial
fulfillment of the requirements for the award of Higher
Secondary- Second year during the year 2023-2024. Also
certified that this work has not been submitted in full or in part
to this school or any other institution.

Mr. Rakesh Kumar Goyal Ms. K. Sivachitra


PRINCIPAL GUIDE

EXTERNAL EXAMINER

2
DECLARATION

I hereby declare that the dissertation entitled “STUDENT’S


MONEY MANAGEMENT SYSTEM” is an original work
done by me and that it has not previously formed the basis for
the award of any higher degree.

Place: PM Shri Kendriya Vidyalaya, Dharwad


Date:

SAIKUMAR TALWAR

3
ACKNOWLEDGEMENT
I wish to express my sincere thanks to all my teachers for
encouragement and the management for providing all
facilities to successfully complete the project work.

I express my deepest sense of gratitude to Mrs. K.Sivachitra

M.Sc., B.Ed., Computer Science Teacher, for her valuable


guidance and for her constant encouragement with timely
advice throughout this project work.

I wish to express my sincere thanks to Mr. Rakesh Kumar Goyal

Principal, PM Shri Kendriya Vidyalaya for his kind encouragement in


completing this project work.

I extend my gratitude to my parents and classmates for their


valuable support and time

I thank CBSE for providing me with an opportunity to


undertake this project.

Finally I thank the almighty, the beloved who lit education


in my life.

4
CONTENTS

5
CONTENTS
S.N PAGE
TITLE NO.
O
1. ABSTRACT
2. INTRODUCTION
SYSTEM ENIVRONMENT
3. Hardware Specification
Software Specification
PYTHON
PROGRAMMING
4. Overview of python
Features of python
Libraries in python
STUDY AND ANALYSIS
5. OF HOSPITAL MANAGEMENT
SYSTEM
DESIGN AND DEVELOPMENT OF
6. HOSPITAL MANAGEMENT
SYSTEM
7. CONCLUSION
8. BIBLIOGRAPHY

6
ABSTRACT

7
ABSTRACT

The target of this project "HOSPITAL MANAGEMENT SYSTEM" is


to digitise the hospital's front office management and produce software
that is user-friendly, fast, and cost-effective. It is related with the
gathering of patient information, patient tests, and so on. Before, it was
done by hand. The system's principal job is to register and maintain
patient and doctor data, as well as to access and meaningfully change
this data. Patient data and diagnosis data are entered into the system,
and the system output is used to show these facts on the screen. A
username and password are needed to enter the Hospital Management
System. It can be used by a receptionist or an administrator.They're the
only ones have access to the information. Key Words: Hospital
Management; database; Interface

8
INTRODUCTIO

9
INTRODUCTION

Workers' health is the nation's wealth. Ayurveda, the world's oldest


medical science, was given to the world by India, and other medicinal
sciences. All of the portions of this field had seen a quick change. In the
fields of clinical process analysis and activity-based cost, the Hospital
Management System is aimed to improve the quality and management
of clinics. The Hospital Management System allows you to grow your
business and increase the efficiency and quality of your work.
Managing critical processes effectively is critical to the hospital's
success. This book will help you in managing your processes. A
username and password are needed to enter the Hospital Management
System. An admin, a doctor, and a receptionist have access to it. They
are the only one who have access to the data. The data might be useful.

10
SYSTEM
ENVIRONMENT

11
SYSTEM ENVIRONMENT

HARDWARE SPECIFICATION

The hardware used to run the project is:


1. Intel® Pentium® CPU G3220 @ 3.00GHz Processor
2. 4 GB RAM
3. 1 TB HDD
4. Monitor with VGA of 1024x768 Screen Resolution.

SOFTWARE SPECIFICATION

The Software used to run the Python program is:


1. Windows 8.1 or later
2. Python version 3.7 or later

12
PYTHON
PROGRAMMING

13
Overview of Python
Python is a widely used general-purpose, high level
programming language. It was initially designed by Guido van
Rossum in 1991 and developed by Python Software
Foundation. It was mainly developed for emphasis on code
readability, and its syntax allows programmers to express
concepts in fewer lines of code.
Python is a programming language that lets you work quickly
and integrate systems more efficiently. There are two major
Python versions- Python 2 and Python 3. Both are quite
different. Python 3 is used for this project.
Reasons for increasing popularity are as follows
1. Emphasis on code readability, shorter codes, eases of
writing
2. Programmers can express logical concepts in fewer lines of
code in comparison to languages such as C++ or Java.
3. Python supports multiple programming paradigms, like
object-oriented, imperative and functional
programming or procedural
4. There exists an inbuilt function for almost all of the
frequently used concepts.
5. Philosophy is “Simplicity is the best”.

14
Features of Python
 Interpreted

•There are no separate compilation and execution steps like


C and C++.

•Directly run the program from the source code.

•Internally, Python converts the source code into an


intermediate form called byte codes which is then
translated into native language of specific computer to run
it.

•No need to worry about linking and loading with libraries,


etc.
 Platform Independent

•Python programs can be developed and executed on


multiple operating system platforms.

•Python can be used on Linux, Windows, Macintosh,


Solaris and many more.
 Free and Open Source; Redistributable
 High-level Language

•In Python, no need to take care about low-level details


such as managing the memory used by the program.
Simple

15
•Closer to English language; Easy to Learn
•More emphasis on the solution to the problem rather than
the syntax
 Embeddable

•Python can be used within C/C++ program to give


scripting capabilities for the program’s student’s
Robust
•Exceptional handling features

•Memory management techniques in built


 Rich Library Support

•The Python Standard Library is varying vast.

•Known as the “batteries included” philosophy of


Python ;It can help do various things involving regular
expressions, documentation generation, unit testing,
threading, databases, web browsers, CGI, email, XML,
HTML, WAV files, cryptography, GUI and many
more.

•Besides the standard library, there are various other high-


quality libraries such as the Python Imaging Library which
is an amazingly simple image manipulation library.

16
Libraries in python
• Python's large standard library, commonly cited as one
of its greatest strengths, provides tools suited too many
tasks.
• For Internet-facing programs, many standard formats and
protocols such as MIME and HTTP are supported.
• It includes modules for creating graphical student
interfaces, connecting to relational databases, generating
pseudorandom numbers, arithmetic with arbitrary-
precision decimals, manipulating regular expressions,
and unit testing.
• They are specified by their code, internal documentation,
and test suites. However, because most of the standard
library is cross-platform Python code, only a few
modules need altering or rewriting for variant
implementations.

They serve as cross-compilers to other languages


There are several compilers to high-level object languages,
with unrestricted Python, a restricted subset of Python, or a
language similar to Python as the source language:

• Cython compiles Python to C and C++.


• Google's Grumpy compiles Python 2 to GO.

17
• IronPython follows a similar approach in order to run
Python programs on the .NET Common Language
Runtime.
• Jython enables the use of the Java class library from a
Python program.
• MyHDL compiles Python to VDHL.
• Nuitka compiles Python into C++.
• Numba uses LLVM to compile Python to machine
code.
• Pyjs compiles Python to JavaScript.
• Pyrex and Shed Skin compile to C and C++
respectively.
• Pythran compiles Python to C++.
• RPython can be compiled to C, and is used to build
the PyPy interpreter of Python.

18
STUDY AND ANALYSIS OF
HODPITAL MANAGEMENT
SYSTEM

19
Features and Benefits of Hospital
Management System in Python

 Here as we are using MySQL for database creation in Hospital


Management, we are able to
o Register new patient
o View the staff, patient information, discharge, and bill payment
summary details.
o Delete the details.
o We can add, delete and modify and view the details of the doctors,
nurses, and workers.

Use of Pycharm IDE for Project creation


of Hospital Management System in python

1. First Install PyCharm Community Edition. 2023.3.1 (community edition


is to be installed)
2. Create New Project and enter “Create”.

20
3. Right-click on the project name you have created and Create a New
Python File as “hospitalmanage.py”

Write the code in the file and Perform the MySQL


database connectivity.

21
4. Execute the Python Program for hospital management system in
python

Installing MySQL Server Database and mysql-


connector-python

1. Download mysql-installer community 8.0.29.0 and install MySQL Database.


2. Complete Guide to install MySQL Server Database and mysql-connector-
python
3. Before Importing the mysql.connector in the program install the
connector using the command “ pip3 install mysql-connector-
python” in the terminal or command prompt to perform
the database connectivity.

Now as we have performed all the database connectivity activity we will


understand the code in detail of the Hospital Management System in Python.

22
Program of Hospital Management system in
python with source code and Output

Import the module and perform database


connectivity

##creating database connectivity


import mysql.connector
passwd = str(input("Enter the Password Please!!:"))
mysql = mysql.connector.connect(host="localhost", user="root", passwd="your
password")
mycursor = mysql.cursor()
mycursor.execute("create database if not exists city_hospitals")
mycursor.execute("use city_hospitals")

Here, we are importing the module mysql.connector to perform all


the database connectivity. Use the while loop while writing the code.

The connect() function accepts connection credentials and returns an


object of type MySQLConnection for database connection.
The mysql.cursor() to communicate with the MySQL database.
The mysql.execute() executes the database operations for such as
patient details, doctors details, nurse details, and other worker details.

23
Output

Perform New Registration

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()

In this code block, the patients register themselves by providing a


username and password.

24
Output

Display the list of options the user could select in


the Hospital

#enter the username and password of the user whose data is to display
a = int(input("ENTER YOUR CHOICE:"))
# if user wants to enter administration option
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:"))
if b == 1:
print("""
1. Doctors Details
2. Nurse Details
3. Others
""")

25
In this code block, as we provide the choice option, we can select which
service to choose from the list of options.

Output

Adding the data of the administration staff for the


Hospital Management System in Python
c = int(input("ENTER YOUR CHOICE:"))
# FOR ENTERING DETAILS OF DOCTORS
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:")
26
ms = input("Enter Monthly Salary:")
mycursor.execute(
"insert into doctor_details values('" + name + "','" + spe + "','" + age
+ "','" + add + "','" + cont + "','" + fees + "','" + ms + "')")
mysql.commit()
print("SUCCESSFULLY ADDED")
ct No.:")

Selecting the add the member choice, the system asks to choose from
the administration staff whose information wants to add the doctor, the
nurse, or the worker. Similarly, we can add the details of the other staff
members

Output

Deleting the details of the administration staff


#if unser wants to delete data
""")
c = int(input("Enter your Choice:")
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):")
27
if p == "y":
mycursor.execute("delete from doctor_details where name='" + name + "'")
mysql.commit()
print("SUCCESSFULLY DELETED!!")
else:
print("NOT DELETED")
Here after entering the name of the staff MySQL executes the queries
and fetches data from the databases of name using
the fetchall() function deletes the details and prints the message
successfully deleted else not deleted.

Output

Displaying the patient’s information and adding the


new patient

#Display thee details of the patient by selecting the option


b = int(input("Enter your Choice:"))
if b == 1:
mycursor.execute("select * from patient_details")
row = mycursor.fetchall()
for i in row:
b = 0
v = list(i)
k = ["NAME", "SEX", "AGE", "ADDRESS", "CONTACT"]
d = dict(zip(k, v))

28
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_details values('" + name + "','" + sex + "','" +
age + "','" + address + "','" + contact + "')")
mysql.commit()
mycursor.execute("select * from patient_details")
for i in mycursor:
v = list(i)
k = ['NAME', 'SEX', 'AGE', 'ADDRESS', 'CONTACT']
print(dict(zip(k, v)))

In this code, we are able to display the information of the patient. The
system executes the query and fetches the patient’s information using the
fetchall() function.

We are able to add new patient details to the database and complete the
information with the commit operation.

29
Output

30
Discharge process of the patient and accounting of
the bills
name = input("Enter the Patient Name:")
mycursor.execute("select * from patient_details 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_details where name='" +
name + "'")
mysql.commit()

Here we are completing the discharge process of the patient by confirming


the bill payment in the hospital management system in python.
If the username and password are not present in the database the system
will not perform any further operations.

Output

31
DESIGN AND
DEVELOPMENTOF
HOSPITAL MANAGEMENT
SYSTEM

32
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()

33
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(

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

35
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()

36
print("""

=========================================
===
!!Well Done!!Registration Done Successfully!!

=========================================
===
""")
x = input("enter any key to continue:")
# IF USER WANTS TO LOGIN
elif r == 1:
print("""

==================================
!!!!!!!! {{Sign In}} !!!!!!!!!!

==================================
""")
37
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

""")
38
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
39
""")

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

41
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

42
""")
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:")

43
# 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:")

44
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:")

45
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

46
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(

47
"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(
48
"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 + "'")
49
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

50
# 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()
51
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 + "','" +
52
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!!!!!!

====================================
""")
53
# 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

54
elif b == 4:
break
# SIGN OUT

elif a == 3:
break

# IF THE USERNAME AND PASSWORD IS


NOT IN THE DATABASE
else:
break

55
DESIGN

56
57
58
59
CONCLUSION

60
CONCLUSION:

asking into account all the mentioned details, we can make the
conclusion that the hospital management system is the inevitable part of
the lifecycle of the modern medical institution. It automates numerous
daily operations and enables smooth interactions of the users.
Developing the hospital system software is a great opportunity to create
the distinct, efficient and fast delivering healthcare model.
Implementation of hospital management system project helps to store
all the kinds of records, provide coordination and user communication,
implement policies, improve day-to-day operations, arrange the supply
chain, manage financial and human resources, and market hospital
services. This beneficial decision covers the needs of the patients, staff
and hospital authorities and simplifies their interactions. It has become
the usual approach to manage the hospital. Many clinics have already
experienced its advantages and continue developing new hospital
management system project modules.

61
BIBLIOGRAPHY

62
BIBLIOGRAPHY

❖ To develop this project many references were used:

1. INFORMATICS PRACTICES Class XII: PREETI ARORA


2. https://www.google.com
3. https://www.youtube.com
4. https://bharatlogic.com

63

You might also like