1-Hospital Management System

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

Hospital management

system

PROJECT OF COMPUTER
SCIENCE

1|Page
HOSPITAL MANAGEMENT
SYSTEM

JAWAHAR NAVODAYA VIDYALAYA


PEKHUBELA UNA (H.P.)

SUBMITTED BY: GROUP B

(NIKITA, ARSHITA, TANIYA, SIMRAN


BHARDWAJ, TARUNDEEP KAUR)

CLASS: 12 SCIENCE

SUBMITTED TO: MR.AMIT MEHTA

(P.G.T. COMPUTER SCIENCE)

CERTIFICATE

2|Page
This is to certify that the project entitled

“Hospital Management System”, Which

contain menu driven program for General

Operation at Hospital. This project is being

submitted by GROUP B. This project is as per

CBSE guidelines carried out by us with the

consultation of supervisor.

Teacher’s sign:

Principal’s sign:

ACKNOWLEDGMEN
T
3|Page
It is with great pleasure that we find ourselves
penning down these lines to express our sincere thanks
to various people who helped us a long way in
completing this project.

The harmonious climate in our school provided


proper guide for preparing the same project to him. It
was a privilege to have been guided by Mr. AMIT
MEHTA.

Thanks to all our classmates who helped us during


the development of this project with their constructive
criticism and advice.

Group members sign:

Nikita: Arshita: Taniya:

Simran bhardwaj: Tarundeep kaur:

SOFTWARE LANGUAGES
USED
4|Page
In the development of a project the selection of an

appropriate programming language and a platform is of

primary importance. The major part of credit of success

of a project goes to the software environment chosen by

the developer. Selecting a language from the ocean of

the languages is very difficult. A developer has to

consider the various features and functionalities that a

particular language can provide him/her how easily and

successfully the requirements of a user can be fulfilled

depend on the s/w language chosen. More over the

developer also has to take care of the various facilities,

he can use. In the development of this application, it has

been taken into great consideration that server overhead

should be low as far as possible.

5|Page
Python 3.0 :

Python is an interpreted, object-oriented, high-level

programming language with dynamic semantics. Its

high-level built in data structures, combined with

dynamic typing and dynamic binding, make it very

attractive for Rapid Application Development, as well

as for use as a scripting or glue language to connect

existing components together. Python's simple, easy to

learn syntax emphasizes readability and therefore

reduces the cost of program maintenance. Python


6|Page
supports modules and packages, which encourages

program modularity and code reuse. The Python

interpreter and the extensive standard library are

available in source or binary form without charge for all

major platforms, and can be freely distributed.

Often, programmers fall in love with Python because of

the increased productivity it provides. Since there is no

compilation step, the edit-test-debug cycle is incredibly

fast. Debugging Python programs is easy: a bug or bad

input will never cause a segmentation fault. Instead,

when the interpreter discovers an error, it raises an

exception. When the program doesn't catch the

exception, the interpreter prints a stack trace. A source

level debugger allows inspection of local and global

variables, evaluation of arbitrary expressions, setting

7|Page
breakpoints, stepping through the code a line at a time,

and so on. The debugger is written in Python itself,

testifying to Python's introspective power. On the other

hand, often the quickest way to debug a program is to

add a few print statements to the source: the fast edit-

test-debug cycle makes this simple approach very

effective.

MY SQL

A DATABASE Management System (DBMS) is a

software application that interacts with the user,

applications and the database itself to capture and

analyze data. The data stored in the database can be

modified, retrieved and deleted, and can be of any type

like strings, numbers, images etc.

8|Page
Types of DBMS

There are mainly 4 types of DBMS, which are

Hierarchical, Relational, Network, and Object-Oriented

DBMS.

Hierarchical DBMS: As the name suggests, this

type of DBMS has a style of predecessor-successor type

of relationship. So, it has a structure similar to that of a

tree, wherein the nodes represent records and the

branches of the tree represent fields.

Relational DBMS (RDBMS): This type of DBMS, uses

a structure that allows the users to identify and access

data in relation to another piece of data in the database.

9|Page
Network DBMS: This type of DBMS supports many to

many relations wherein multiple member records can be

linked.

Object-oriented DBMS: This type of DBMS uses

small individual software called objects. Each object

contains a piece of data, and the instructions for the

actions to be done with the data.

Structured Query Language (SQL)

SQL is the core of a relational database which is used

for accessing and managing the database. By using

SQL, you can add, update or delete rows of data,

retrieve subsets of information, modify databases and

perform many actions. The different subsets of SQL are

as follows:

10 | P a g e
DDL (Data Definition Language) – It allows you to

perform various operations on the database such as

CREATE, ALTER and DELETE objects.

DML (Data Manipulation Language) – It allows you

to access and manipulate data. It helps you to insert,

update, delete and retrieve data from the database.

DCL (Data Control Language) – It allows you to

control access to the database. Example – Grant or

Revoke access permissions.

TCL (Transaction Control Language) – It allows you


to deal with the transaction of the database. Example –

Commit, Rollback, Savepoint, Set Transaction.

MySQL is an open-source relational database

management system that works on many platforms. It


11 | P a g e
provides multi-user access to support many storage

engines and is backed by Oracle. MySQL is a freely

available open source Relational Database Management

System (RDBMS) that uses Structured Query Language

(SQL).

SQL is the most popular language for adding,


accessing and managing content in a database. It is most

noted for its quick processing, proven reliability, ease

and flexibility of use. MySQL is an essential part of

almost every open source PHP application.

12 | P a g e
SOURCE CODE
from sys import exit
import mysql.connector as sql
conn=sql.connect(host='localhost',user='root',passwd='',database='proj
ect')
if conn.is_connected():
print('successfully connected')
c1=conn.cursor()
print('---------------------------------------------')
print("HOSPITAL MANAGEMENT SYSTEM")
print('---------------------------------------------')
print('"GOD WISHES YOU"')
print("1.LOGIN")
print("2.EXIT")
choice=int(input("ENTER YOUR CHOICE:"))
if choice==1:
u1=input("enter user name:")
pwd1=input("enter the password:")
while u1=='proj'and pwd1=='proj123':
print('connected')
print("WELCOME TO HOSPITAL")
print("successfully connected")
print('1.RegisteringPatient details')
print('2.RegisteringDoctor details')
print('3.RegisteringWorker details')
print("4.total patient details")
print("5.total doctor details")
print("6.total worker details")
print('7.Patient detail')
print('8.Doctor detail')
print('9.Worker detail')
print('10.Exit')
choice=int(input('ENTER YOUR CHOICE:'))
if choice==1:
p_name=input('Enter Patient Name:')
13 | P a g e
p_age=int(input('Enter Age:'))
p_problems=input('Enter the Problem/Disease:')
p_phono=int(input('Enter Phone number:'))
sql_insert="insert into patient_details
values(""'"+p_name+"',"+str(p_age)
+",'"+p_problems+"',"+str(p_phono)+")"
c1.execute(sql_insert)
print('SUCCESSFULLY REGISTERED')
conn.commit()
elif choice==2:
d_name=input('Enter Doctor Name:')
d_age=int(input('Enter Age:'))
d_department=input('Enter the Department:')
d_phono=int(input('Enter Phone number:'))
sql_insert="insert into doctor_details
values(""'"+d_name+"',"+str(d_age)
+",'"+d_department+"',"+str(d_phono)+")"
c1.execute(sql_insert)
print('successfully registered')
conn.commit()
elif choice==3:
w_name=input('Enter Worker Name:')
w_age=int(input('Enter Age:'))
w_workname=input('Enter type of work:')
w_phono=int(input('Enter Phone number:'))
sql_insert="insert into worker_details
values(""'"+w_name+"',"+str(w_age)
+",'"+w_workname+"',"+str(w_phono)+")"
c1.execute(sql_insert)
print('successfully registered')
conn.commit()
elif choice==4:
sql_w='select*from patient_details '
c1.execute(sql_w)
r = c1.fetchall()

14 | P a g e
for i in r :
print(i)
elif choice==5:
sql_x="select*from doctor_details"
c1.execute(sql_x)
s=c1.fetchall()
for i in s:
print(i)
elif choice==6:
sql_y="select*from worker_details"
c1.execute(sql_y)
t=c1.fetchall()
for i in t:
print(i)
elif choice==7:
h=input("Enter the name:")
sql_w='select*from patient_details where
p_name=("{}")'.format(h)
c1.execute(sql_w)
u = c1.fetchall()
for i in u:
print(i)
elif choice==8:
d=input("Enter the name:")
sql_d='select*from doctor_details where
p_name=("{}")'.format(d)
c1.execute(sql_d)
v=c1.fetchall()
for i in v:
print(i)
elif choice==9:
f=input("Enter the name:")
sql_f='select*from worker_details where
p_name=("{}")'.format(f)
15 | P a g e
c1.execute(sql_f)
w=c1.fetchall()
for i in w:
print(i)
elif choice==10:
exit()
break
else:
print('wrong username&password')
if choice==2:
exit()

#Table Creation#
import mysql.connector as sql
conn=sql.connect(host='localhost',user='root',passwd='',database='pro
1')
if conn.is_connected():
print('successfully connected')
c1=conn.cursor()
#c1.execute('create table patient_details(p_name varchar(25) primary
key,p_age int(3),p_problems varchar(40),p_phono int(15))')
#print('table created')
if choice==1:
p_name=input('Enter Patient Name:')
p_age=int(input('Enter Age:'))
p_problems=input('Enter the Problem/Disease:')
p_phono=int(input('Enter Phone number:'))
sql_insert="insert into patient_details
values(""'"+p_name+"',"+str(p_age)
+",'"+p_problems+"',"+str(p_phono)+")"
c1.execute(sql_insert)
print('SUCCESSFULLY REGISTERED')
conn.commit()
#c1.execute('create table doctor_details(d_name varchar(25) primary
key,d_age int(3),d_department varchar(40),d_phono int(15))')
16 | P a g e
#print('table created')

if choice==2:
d_name=input('Enter Doctor Name:')
d_age=int(input('Enter Age:'))
d_department=input('Enter the Department:')
d_phono=int(input('Enter Phone number:'))
sql_insert="insert into doctor_details
values(""'"+d_name+"',"+str(d_age)
+",'"+d_department+"',"+str(d_phono)+")"
c1.execute(sql_insert)
print('ok')
conn.commit()
#c1.execute('create table worker_details(w_name varchar(25) primary
key,w_age int(3),w_workname varchar(40),w_phono int(15))')
#print('table created')
if choice==3:
w_name=input('Enter Worker Name:')
w_age=int(input('Enter Age:'))
w_workname=input('Enter type of work:')
w_phono=int(input('Enter Phone number:'))
sql_insert="insert into worker_details
values(""'"+w_name+"',"+str(w_age)
+",'"+w_workname+"',"+str(w_phono)+")"
c1.execute(sql_insert)
print('ok')
conn.commit()

#Output Screen#

17 | P a g e
18 | P a g e
19 | P a g e
Thankyou
Group members:
Nikita
Taniya
Arshita
Simran bhardwaj
Tarundeep kaur

20 | P a g e

You might also like