Professional Documents
Culture Documents
CS Project
CS Project
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.
EXTERNAL EXAMINER
2
DECLARATION
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.
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
8
INTRODUCTIO
9
INTRODUCTION
10
SYSTEM
ENVIRONMENT
11
SYSTEM ENVIRONMENT
HARDWARE SPECIFICATION
SOFTWARE SPECIFICATION
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
15
•Closer to English language; Easy to Learn
•More emphasis on the solution to the problem rather than
the syntax
Embeddable
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.
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
20
3. Right-click on the project name you have created and Create a New
Python File as “hospitalmanage.py”
21
4. Execute the Python Program for hospital management system in
python
22
Program of Hospital Management system in
python with source code and Output
23
Output
24
Output
#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
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
Output
28
print(d)
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()
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))")
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
""")
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")
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)
====================================
!!!!!!!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
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
63