Hospital Management System 4.0
Hospital Management System 4.0
HOSPITAL MANAGEMENT
By
P.SHIVA RAM SIDHU XI-MPC R.NO 11
For the award of the AISSCE(All India Senior School Certificate
Examination 2023-2024)
In
COMPUTER SCIENCE (New_083)
CERTIFICATE
We, student of first year MPC/BiPC, DON BOSCO SCHOOL, declare that the project
entitled “Rank analysis” has been carried out by me and submitted in partial
fulfillment of the course requirements for the award of the senior secondary school
from,
DON BOSCO SCHOOL(Affiliated to C.B.S.E, New Delhi) during the academic year
2023-2024.Further, the matter embodied in the dissertation has not been submitted
previously by anybody for the award of any degree or diploma to any other university.
PAGE NO: 1
OBJECTIVE
PAGE NO:2
HARDWARE REQUIREMENTS
❖Windows OS
PAGE NO:4
SIMILAR SOFTWARES
PAGE NO:5
SOURCE CODE
PAGE NO:6
##creating database connectivity
import mysql.connector
passwd=str(input("ENTER THE DATABASE
PASSWORD;"))
mysql=mysql.connector.connect(host="localhost",
user= "root",passwd="ADMINISTRATOR12345")
mycursor=mysql.cursor()
#creating database
mycursor.execute("create database if not exists
SP_hospitals")
mycursor.execute("use SP_hospitals")
#creating the tables we need
mycursor.execute("create table if not exists
patient_details(name varchar(30) primary key, age
int(3),address varchar(50),doctor_recommended
varchar(30))") 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))")
PAGE NO:7
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
mycursor.execute("createint(10))")
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
mycursor.execute("create table if not exists
user
user_data(username varchar(30) primary
key,password varchar(30) default'000')")
#printing option
while(True):
print("""
1. SIGN IN (LOGIN)
2. SIGN UP (REGISTER) """)
r=int(input("enter your choice:"))
#IF USER WANTS TO REGISTER
if r==2:
print("""
PAGE NO:8
==============================
======================
============================= !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!PLEASE REGISTER
YOURSELF!!!!!!!!!!!!!!!!!!!!!!!!!!!
==============================
======================
""")
=============================
u=input("ENTER YOUR PREFERRED USERNAME!!:")
p=input("ENTER YOUR PREFERRED PASSWORD
(PASSWORD SHOULD BE STRONG!!!:")
PAGE NO:9
print("""
==============================
======================
============================= !!
!!!!!!!!!!!!!!!!!!!!!!!!!REGISTERED
SUCCESSFULLY!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
==============================
======================
=============================
x=input("enter any key to continue:")
""")
#IF USER WANTS TO LOGIN
elif r==1:
#PRINTING THE SINGIN OPTION AGAIN TO THE
USER AFTER REGISTRATION
print("""
==============================
======================
============================= !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!! {{SIGN
==============================
IN }} !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! PAGE NO:10
======================
=============================
""")
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
""")
PAGE NO:11
##asking for the task from user
a=int(input("ENTER YOUR CHOICE:"))
if a==1:
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 b==1:
print(""" 1. DOCTOR DETAILS
2. NURSE DETAILS
3. OTHER WORKERS
""")
PAGE NO:12
#ASKING USER'S 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","C
ONTACT" ,"FEES","MONTHLY_SALARY"]
d=dict(zip(k,v))
print(d)
PAGE NO:13
#if user wants to see the details of nurses
elif c==2:
mycursor.execute("select * from nurse_details")
row=mycursor.fetchall()
for i in row:
v=list(i)
k=["NAME","AGE","ADDRESS","CONTACT","MONTH
LY_SALARY" ]
d=dict(zip(k,v))
print(d)
v=list(i)
k=["NAME","AGE","ADDRESS","CONTACT
NO","MONTHLY_SALARY"]
d=dict(zip(k,v))
print(d)
PAGE NO:15
#FOR ENTERING DETAILS OF DOCTORS
if c==1:
#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+"',
'"+c ont+"','"+fees+"','"+ms+"')")
mysql.commit() print("SUCCESSFULLY ADDED")
PAGE NO:16
#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:"))
PAGE NO:17
#for entering workers details
elif c==3:
PAGE NO:18
#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:"))
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):")
PAGE NO:19
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:")
if p=="y":
mycursor.execute("delete from nurse_details
where name='"+name+"'")
mysql.commit()
print("SUCCESSFULLY DELETED!!")
else:
print("NOT DELETED")
elif c==3:
name=input("ENTER THE WORKER NAME:")
mycursor.execute("select * from workers_details
where name=='"+name+"'")
row=mycursor.fetchall()
print(row) PAGE NO:21
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:
PAGE NO:22
#entering the patient details table
elif a==2:
print(""" 1. SHOW PATIENT DETAILS
2. ADD NEW PATIENT
3. DISCHARGE PATIENT
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")
row=mycursor.fetchall()
PAGE NO:23
for i in row:
b=0
v=list(i)
k=["NAME","GENDER","AGE","ADDRESS","CONTACT"]
d=dict(zip(k,v))
print(d)
PAGE NO:24
("insert into patient_details
values('"+name+"','"+age+"','"+address+"','"+do
c_r+" ')")
mysql.commit()
for i in mycursor:
v=list(i)
print(dict(zip(k,v)))
print("""
==============================
======================
=============================
!!!!!!!!!!!!!!!!!!!!!!!!!!!REGISTERED
SUCCESSFULLY!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
==============================
====================== PAGE NO:25
=============================
""")
#dischare process
elif b==3:
name=input("ENTER THE PATIENT NAME:")
PAGE NO:26
#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:
print("The Entered Username and Password does
not match with the accounts stored in the
Database")
break
PAGE NO:27
OUTPUT
PAGE NO:28
PAGE NO:29
PAGE NO:30
BIBILOGRAPHY
https://www.w3resource.com
https://cbsetoday.com
https://www.academia.edu/
PAGE NO:31