0% found this document useful (0 votes)
30 views14 pages

Class 12 Cs Project File

The Hospital Management System is designed to automate and streamline various administrative tasks in healthcare, such as patient billing, employee management, and appointment tracking, making it user-friendly and efficient. It requires specific hardware and software configurations, including a MySQL database for storing patient and staff information. The project highlights the importance of technology in improving healthcare management and patient care.

Uploaded by

raganshika09
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)
30 views14 pages

Class 12 Cs Project File

The Hospital Management System is designed to automate and streamline various administrative tasks in healthcare, such as patient billing, employee management, and appointment tracking, making it user-friendly and efficient. It requires specific hardware and software configurations, including a MySQL database for storing patient and staff information. The project highlights the importance of technology in improving healthcare management and patient care.

Uploaded by

raganshika09
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/ 14

Introduction to Project

The "Hospital Management System" has been


developed to override the problems prevailing in
practicing manual system. The project is totally built at
administrative end and thus only the administrator is
guaranteed the access.
Moreover this system is designed for the particular
need of the management to carry out operations in as
smooth and effective manner. The application is
reduced as much as possible to avoid errors while
entering the data.
It also provides error message while entering invalid
data. No formal knowledge is needed for the user to
use this system. Thus by this all it proves it is user-
friendly. Hospital Management System, as described
above, can lead to error free, secure, reliable and fast
management system.
The main purpose of the project is to build an
application program to reduce the manual work of the
managing tasks like patient billing, doctor's salary,
employee management, keeping track of
appointments, track of patient record etc.
Hardware Requirements
 Processor : Intel Pentium G2030 @ 3.00GHz

 Processor Speed : 533 MHz

 RAM : 2 GB or more

 Hard Disk : 2.00 GB


Software Requirements
 Operating System : Windows 10
 IDE : IDLE Python
 Front End : Python 3.6 or above
 Back End : MySQL Server 5.0 or above
Files used
1. Database Configuration File:
o A file containing database connection details, making
o it easier to manage and update
o File name:- Database_configuration.txt
2. SQL Script:
o A separate file containing SQL statements for creating the
database and tables, though this could also be embedded in
the code
o File name:- Sql_script.txt
3. Configuration File:
o Files storing configuration settings for the project
o Modules used:-
• mysql.connector
4. Documentation:
o Files and folders containing documentation
o File name:- Cs_project.docx
5. Testing scripts:
o Separate scripts for testing different aspects of the project
o File name:- Python_mysqlconnection_run.txt
o File names:-
 patient_details_run.txt
 doctor_details_run.txt
 nurse_details_run.txt
 doctor_details_run.txt
 nurse_details_run.txt
 other_workers_details_run.txt
 user_data_details_run.txt
Database Information - Tables used
Database Information:-
Database Name: my_hospitals
Purpose: This is the main database created by the code.
Functions:
o It serves as the central storage for various tables
that organize information related to the hospital
o management system.
o Tables within this database store details about
patients, doctors, nurses, other workers, and user
authentication.

Tables used:-
1. Patient_Details:
Purpose: Stores information about patients.
Columns:
 puid (Primary Key): Patient ID
 Name: Patient name
 Age: Patient age
 Address: Patient address
 doctor_recommended: Doctor recommended for the
patient

2. Doctor_Details:
Purpose: Stores details about doctors.
Columns:
 Name (Primary Key): Doctor's name
 Specialisation: Doctor's area of specialization
 Age: Doctor's age
 Address: Doctor's address
 Contact: Doctor's contact number
 Fees: Doctor's fees
 Monthly_salary: Doctor's monthly salary

3. Nurse_Details:
Purpose: Stores information about nurses.
Columns:
 Name (Primary Key): Nurse's name
 Age: Nurse's age
 Address: Nurse's address
 Contact: Nurse's contact number
 Monthly_salary: Nurse's monthly salary

4. Other_Workers_Details:
Purpose: Stores information about other workers (non-
doctor/non-nurse staff).
Columns:
 Name (Primary Key): Worker's name
 Age: Worker's age
 Address: Worker's address
 Contact: Worker's contact number
 Monthly_salary: Worker's monthly salary

5. User_Data:
Purpose: Stores usernames and passwords for user
authentication.
Columns:
 Username (Primary Key): User's chosen username
 Password: User's chosen password (default value is set
to '000')
Various functions performed by the
project
➤User Registration/Login:
 Presents the user with options to either register a new
account or log in.
 Captures user-provided credentials (username and
password) during the registration process.
 Validates user login by comparing entered credentials
with those stored in the 'user_data' table.

➤ Administration Options:
For authenticated administrators-
 Displays a menu with options to manage staff details.
Allows viewing existing staff details (doctors, nurses,
other workers).
 Facilitates the addition of new staff members with
specified details.
 Supports the deletion of existing staff members based
on user input.

➤ Patient Management:
Offers functionality related to patient data-
 Displays existing patient details.
 Enables the addition of new patient records, including
personal information.
 Provides a process for discharging patients, including
bill payment verification.

➤ User Logout:
 Allows users to gracefully exit the system, terminating
the active session.
PROGRAM CODE
##hospital management software
##PRINTING WELCOME NOTE
while(True):
print("""
========================
WELCOME TO MYHOSPITAL
========================
""")
#creating database connectivity import mysql.connector
import mysql.connector
password=str(input("ENTER THE DATABASE PASSWORD:"))
mysql=mysql.connector.connect(host="localhost", user="root",passwd="password")
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(puid int(10) primary key,name varchar(30) not null,sex
varchar(10),age int(3), address varchar(50), contact varchar(10))")
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))")
#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 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("""

=================================
!!!!!!!PLEASE REGISTER YOURSELF!!!!!!!
=================================
""")
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 LOGIN
elif r==1:
#PRINTING THE SINGIN OPTION AGAIN TO THE USER AFTER REGISTRATION
print("""
=================================
!!!!!!!! {{SIGN IN }} !!!!!!!!!!
=================================
""")
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
""")
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", "MONTHLY_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()
for i in row:
v=list(i)
k=["NAME", "AGE","ADDRESS","CONTACT", "MONTHLY_SALARY"]
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", "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. OTHER WORKERS
""")

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


#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+" "+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)+"')")
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
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":
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 other_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 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()
for i in row:
b=0
v=list(i)
k=["PUID", "NAME","SEX","AGE","ADDRESS","CONTACT"]
d=dict(zip(k,v))
print(d)
#adding new patient
elif b==2:
puid=int(input("ENTER PUID:"))
name=input("ENTER NAME: ")
sex-input("ENTER SEX: ")
age=int(input("ENTER AGE: ")) address=input("ADDRESS: ")
contact-input("CONTACT NUMBER: ")
sql="insert into patient_details
values(0,'0','0.0.0.0")".format(puid,name,sex,age, address,contact)
mycursor.execute(sql)
mysql.commit()
print("""
======================================
!!!!!!!REGISTERED SUCCESSFULLY!!!!!!
======================================
""")
#discharge process
elif b==3:
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()
#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
print("SIGNED OUT SUCCESSFULLY")

-----------------------
Conclusion & Bibliography

In conclusion, the Hospital Management


System developed serves as an effective solution
for streamlining healthcare processes. This
system integrates patient records, appointments,
and billing, promoting efficient management. The
project not only showcases technical skills but
also addresses real-world challenges in
healthcare
administration. As technology continues to
play a crucial role in healthcare, this project
demonstrates the potential for innovation in
hospital management, contributing to the
enhancement of healthcare services and overall
patient care.
Sources:
Computer Science with Python by Preeti
Arora, Sultan Chand Publications
www.cbsepython.in
www.tutorialspoint.com

You might also like