0% found this document useful (0 votes)
37 views

Computer Science Project File (HMS)

This document describes a hospital management system project created by four students. It includes an introduction describing the project goals and division of labor. It also provides system requirements for the project such as recommended hardware, software including Python versions, and prerequisites for installing MySQL Connector. The document lists Python programs used in the project including code for database connectivity, creating tables, login/registration functionality, and displaying task options.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views

Computer Science Project File (HMS)

This document describes a hospital management system project created by four students. It includes an introduction describing the project goals and division of labor. It also provides system requirements for the project such as recommended hardware, software including Python versions, and prerequisites for installing MySQL Connector. The document lists Python programs used in the project including code for database connectivity, creating tables, login/registration functionality, and displaying task options.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 39

HOSPITAL

MANAGEMENT
SYSTEM

IN-
COMPUTER SCIENCE
2023-24 (XII-B)

BY-
1. DHRUV KUMAR MISHRA
2. ADITYA SINGH
3. ANSHUMAN AHIRWAR
4. ADHIRAJ YADAV
UNDERTAKING
We declare that the work presented in this project titled

“HOSPITAL MANAGEMENT SYSTEM”, submitted to Mr. Praveen

Kumar Pawaiya (computer science) of PM SHRI KENDRIYA

VIDYALAYA ORDANANCE FACTORY KHAMARIA for the award of

the CBSE - class XII certificate. We have not plagiarized or

submitted the same work for the award of any other examination.

In case this undertaking is found incorrect, we accept that our

Certificates may be unconditionally withdrawn.

January, 2024
Place : PM SHRI KENDRIYA VIDYALAYA O F KHAMARIA

1. Dhruv Kumar Mishra - XII-B – Roll no: 16


2. Aditya Singh - XII-B – Roll no:
3. Anshuman Ahirwar - XII-B – Roll no:
4. Adhiraj Yadav - XII-B – Roll no:

REPORT TITLE 2
CERTIFICATE

Certified that the work contained in the project titled

“ HOSPITAL MANAGEMENT SYSTEM ”, by: “DHRUV , ADITYA ,

ANSHUMAN, ADHIRAJ”, has been carried out under my supervision

And that this work has not been submitted elsewhere for Any

Certificate.

Praveen kumar pawaiya


PGT-Computer Science - PM SHRI
KENDRIYA VIDYALAYA O F
KHAMARIA JABALPUR

REPORT TITLE 3
ACKNOWLEDGEMENT

We would like to thank Sh. Amit Shriwastav Principal PM Shri

Kendriya Vidyalaya O F Khamaria. We are deeply indebted to our

mentor Sh. Praveen Kumar Pawaiya. We further thank to all the

staff members of PM Shri Kendriya Vidyalaya . We owe our sincere

gratitude towards Kendriya Vidyalaya Sangathan. Our heartfelt

thanks to CBSE. We also express our deepest gratitude to our

parents. Finally, we would like to wind up by paying our heartfelt

thanks to all our near and dear ones.


Contents

1. INTRODUCTION TO THE PROJECT

2. SYSTEM REQUIREMENTS OF THE PROJECT

3. PYTHON PROGRAMS LISTING

4. OUTPUT OF THE PYTHON CODE

5. SQL TABLES USED AND BACKEND STORED DATA

6. CONCLUSION

7. REFERENCES

REPORT TITLE 5
INTRODUCTION TO
THE PROJECT
We the students of CLASS XII B of PM KENDRIYA VIDYALAYA O
F KHAMARIA have been assigned for the work of HOSPITAL
MANAGEMENT SYSTEM.

To perform this task the students were divided into the group of
four students named as ADITYA, DHRUV, ANSHUMAN, ADHIRAJ.

DHRUV, ADITYA, ANSHUMAN, ADHIRAJ has been assigned for the


work of coding and programming ADITYA, ANSHUMAN have been
assigned for the work of analyzing the overall mistakes and have
done the conclusion work.

The project starts with -


Enter 1 – SIGN IN (LOG IN)
Enter 2 – SIGN UP (REGISTER)
Enter 3 – C L O S E ( D A T A B A S E )

Then tasks user can perform -


Enter 1 - ADMINISTRATION
Enter 2 - PATIENT (ADMISSION AND DISCHARGE PROCESS)
Enter 3- SIGN OUT

Then asking the tasks of the user - IF THE CHOICE IS(ADMINISTRATION)


Enter 1 – SHOW DETAILS
Enter 2 – ADD NEW MEMBER
Enter 3 – DELETE EXISTING ONE
Enter 4 – EXIT

~And the program continues~

REPORT TITLE 6
We are so glad that this work have been assigned to us, yet we

haven’t done this work before .SH. PRAVEEN KUMAR PAWAIYA

our subject teacher have also helped us a lot to complete this project.

We feel so blessed that we have learnt all this work with the help

of our sir, we are also thankful to our respected principal SH. AMIT

SHRIWASTAV for providing us various facilities to complete this

project. As we are the students of CLASS XII B and we haven’t done

this type of project before, we have performed all that which we

have learnt from our CBSE PROGRAMMING .Hence, we know that

this programming would be further done on a big platform. Since

we have started this programming from November month ,we

believe that this programming would further help us a lot in our

future.

We are also thankful to our group mates for cooperating with each
other while performing this task we have also polished the skills of
group activity.

REPORT TITLE 7
PROCESS
FIRSTLY, we have done the planning in a paper work regarding what

have to do on the assigned project HOSPITAL MANAGEMENT

SYSTEM.

SECONDLY, we discussed our planning with our subject teacher

and then he provided us the right path to perform the work.

NEXT, we started our project on foot paths of our subject teacher.

THEN, we started our coding, coding took around 1 and half

months for completion.

NEXT, we analyzed the mistakes done and then we corrected them.

THEN, we prepared the project format as shown above.

~THANKS TO ALL OF WORTHY TEACHERS AND PRINCIPAL AND

MY DEAR GROUP MATES ALSO A GREAT THANKS TO KENDRIYA

VIDYALAYA SANGATHAN FOR PROVIDING US THIS GOLDEN

OPPORTUNITY~

REPORT TITLE 8
SYSTEM REQUIREMENTS OF THE
PROJECT
Recommended System Requirements

Processors: Intel® Core™ i3 processor 4300M at 2.60 GHz.

Disk space: 2 to 4 GB.

Operating systems: Windows® 10, MACOS, and UBUNTU.

Python Versions: 3.X.X or Higher.

Minimum System Requirements


Processors: Intel Atom® processor or Intel® Core™ i3 processor.

Disk space: 1 GB.

Operating systems: Windows 7 or later, MACOS, and UBUNTU.

Python Versions: 2.7.X, 3.6.X.

Prerequisites before installing MySQL Connector


Python

You need root or administrator privileges to perform the


installation process.

Python must be installed on your machine.

Note: – MySQL Connector Python requires python to be in the


system’s PATH. Installation fails if it doesn’t find Python.

REPORT TITLE 9
PYTHON PROGRAMS LISTING

## PRINTING WELCOME NOTE ##

print("""
=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
| WELCOME TO MY HOSPITAL |
+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
""")

## creating database connectivity ##

import mysql.connector
passwd=str(input("ENTER THE DATABASE PASSWORD:"))

mysql=mysql.connector.connect(host="localhost",user="root",passwd="dark@
knight23")
mycursor=mysql.cursor()

# creating database #

mycursor.execute("create database if not exists my_hospitals")


mycursor.execute("use my_hospitals")

# creating the tables we need #

mycursor.execute("create table if not exists patient_details(name varchar(30)


primary key,sex varchar(10),age int(2),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))")

REPORT TITLE 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))")

# login or signup option #

# 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')")

# printing options #
while(True):
print("""
+======================+
| 1. SIGN IN (LOGIN) |
| 2. SIGN UP (REGISTER)|
| 3. CLOSE (DATABASE)|
+======================+
""")

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

# IF USER WANTS TO REGISTER #

if r==2:
print("""

=========================================
|!!!!!! PLEASE REGISTER YOURSELF !!!!!!!|
=========================================

REPORT TITLE 11
""")

u=input("ENTER YOUR PREFERRED USERNAME !!: ")


p=input("ENTER YOUR PREFERRED PASSWORD (PASSWORD SHOULD
BE STRONG) !!!: ")

# ENTERING THE ENTERED VALUE TO THE USER_DATA TABLE #

mycursor.execute("insert into user_data values('"+u+"','"+p+"')")


mysql.commit()

print("""
=========================================
|!!!!!!! REGISTERED SUCCESSFULLY !!!!!!!|
=========================================
""")
x=input("enter any key to continue:")

# IF USER WANTS TO CLOSE THE DATABASE #

# IF USER WANTS TO LOGIN #

elif r==1:

# PRINTING THE SINGIN OPTION AGAIN TO THE USER AFTER


REGISTRATION #

print("""
====================================
|!!!!!!!! SIGN IN !!!!!!!!!!|
====================================
""")

REPORT TITLE 12
un=input("ENTER THE USERNAME!!:")
ps=input("ENTER THE 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):

##displaying the task you can perform

print("""
+============================================+
| 1.ADMINISTRATION |
| 2.PATIENT (ADMISSION AND DISCHARGE PROCESS)|
| 3.SIGN OUT |
+============================================+
""")

##asking for the task from user##

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

# if user wants to enter administration option #

if a==1:
print("""
+=======================+
| 1. SHOW DETAILS |
| 2. ADD NEW MEMBER |
| 3. DELETE EXISTING ONE|
| 4. EXIT |
+=======================+ """)

REPORT TITLE 13
b=int(input("ENTER YOUR CHOICE:"))

# showing the existing details #

if b==1:
print("""
+==================+
| 1. DOCTOR DETAILS|
| 2. NURSE DETAILS |
| 3. OTHER WORKERS |
+==================+ """)

# ASKING USER'S CHOICE #

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

# if user wants to see the details of doctors #

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","MONTH
LY_SALARY"]
d=dict(zip(k,v))
print(d)

# if user wants to see the details of nurses #

elif c==2:
mycursor.execute("select * from nurse_details")
row=mycursor.fetchall()

REPORT TITLE 14
for i in row:
v=list(i)

k=["NAME","SPECIALISATION","AGE","ADDRESS","CONTACT","MONTHLY_SAL
ARY"]
d=dict(zip(k,v))
print(d)

# if user wants to see the details of other_workers #

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_SAL
ARY"]
d=dict(zip(k,v))
print(d)

# IF USER WANTS TO ENTER DETAILS #

elif b==2:
print("""
+==================+
| 1. DOCTOR DETAILS|
| 2. NURSE DETAILS |
| 3. OTHER WORKERS |
+==================+ """)

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

# FOR ENTERING DETAILS OF DOCTORS #

if c==1:

REPORT TITLE 15
# ASKING THE DETAILS #

name=input("ENTER DR. NAME:")


spe=input("ENTER SPECIALISATION:")
age=input("ENTER AGE:")
add=input("ENTER ADDRESS:")
cont=input("ENTER CONTACT NO.:")
fees=input("ENTER FEES:")
ms=input("ENTER MONTHLY_SALARY:")

# INSERTING VALUES ENTERED INTO THE


DOCTORS_TABLE #

mycursor.execute("insert into doctor_details


values('"+name+"','"+spe+"','"+age+"','"+add+"','"+cont+"','"+fees+"','"+ms+"')"
)
mysql.commit()
print("SUCCESSFULLY ADDED")

# for entering 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)+"')")

REPORT TITLE 16
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")

# if unser wants to delete data #

elif b==3:
print("""
+==================+
| 1. DOCTOR DETAILS|
| 2. NURSE DETAILS |
| 3. OTHER WORKERS |
+==================+
""")
c=int(input("ENTER YOUR CHOICE:"))

# deleting doctor's details #

REPORT TITLE 17
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 * 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:

REPORT TITLE 18
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 DETAILS |
| 2. ADD NEW MEMBER |
| 3. DELETE EXISTING ONE|
| 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_details")

REPORT TITLE 19
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=str(input("ENTER NAME: "))
sex=str(input("ENTER SEX: "))
age=str(input("ENTER AGE: "))
address=str(input("ADDRESS: "))
contact=str(input("CONTACT NUMBER: "))
mycursor.execute ("insert into patient_details
values('"+str(name)+"','"+str(sex)+"','"+str(age)+"','"+str(address)+"','"+str(co
ntact)+"')")
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)))
print("""
+=====================================+
|!!!!!! REGISTERED SUCCESSFULLY !!!!!!|
+=====================================+
""")

# dischare process #

elif b==3:
name=input("ENTER THE PATIENT NAME:")

REPORT TITLE 20
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()

# if user wants to exit #

elif b==4:
break

### SIGN OUT ###

elif a==3:
break
elif r==3:

print("""
+====================+
| DATABASE IS CLOSED |
+====================+
""")
print("""
+=====================+
| THANKS FOR VISITING |
+=====================+
""")
break

# IF THE USERNAME AND PASSWORD IS NOT IN THE DATABASE #


else:
break

REPORT TITLE 21
OUTPUT OF THE PYTHON CODE

MAIN SCREEN & LOGIN PAGE

REPORT TITLE 22
USER LOGIN-IN

REPORT TITLE 23
DOCTOR DETAILS

REPORT TITLE 24
NURSE DETAILS

REPORT TITLE 25
OTHER WORKERS DETAILS

REPORT TITLE 26
ENTER DOCTOR DETAILS

REPORT TITLE 27
ENTER NURSE DETAILS

REPORT TITLE 28
ENTER OTHER WORKERS
DETAILS

REPORT TITLE 29
PATIENT DETAILS

REPORT TITLE 30
LOGOUT & DATABASE CLOSING

REPORT TITLE 31
SQL TABLES USED AND BACKEND
STORED DATA

DATABASE

TABLES

REPORT TITLE 32
TABLE STRUCTURE 1 AND 2

TABLE STRUCTURE 3 AND 4

REPORT TITLE 33
TABLE STRUCTURE 5

BACKEND DATA GENERATED


THROUGH SOFTWARE

REPORT TITLE 34
BACKEND DATA GENERATED
THROUGH SOFTWARE

BACKEND DATA GENERATED


THROUGH SOFTWARE

REPORT TITLE 35
CONCLUSION

This Hospital Management System is a simple desktop

based applic ation basically suitable for small Hospital.

It has all basic elements which are used for managing a small

Hospital . We are successful in making the application where

we can insert , delete, update, search and analyze details as

per need. This application is easy to use and various modifications

can be done on it easily for a higher level of use.

~We strongly believe that the implementation of this system


will surely benefit the Hospitals~

REPORT TITLE 36
REFERENCES
1. python.org

2. cbsepython.com

3. tutorialsPoint.com

4. PythonChallenge.com

5. Google.com

6. LearnPython.org

7. textbook class 12 (Sumita arora)

REPORT TITLE 37
REPORT TITLE 39

You might also like