Covid Management System 6

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 25

CERTIFICATE

This is to certify that Akshara Mishra of class 12th


PCM – ‘A’ of Semstar Global School has done her
project on Covid Management System under my
supervision. She has taken a keen interest and has
shown utmost sincerity in completing this project.
I certify that this project is up to my expectations
and as per the guidelines issued by CBSE, NEW
DELHI.

Internal Examiner External Examiner

Principal
ACKNOWLEDGEMENT

It is with pleasure that I acknowledge my sincere


gratitude to our teacher Mr. Anupras who taught me
Computer Science and guided me during the
development of this project. I have greatly benefited
from his classes.

I am especially indebted to our Principal Mrs. Cynthia


D’cruz who has always been a source of
encouragement and support and without whose
inspiration this project would not have been successful.
I would like to place on record my heartfelt thanks to
her.
TABLE OF CONTENTS
 Certificate

 Acknowledgement

 Project Title

 Introduction

 Objective

 Limitations

 System Implementation

 The Hardware used:

 The Software used:

 Database creation

 Connection between python and database

 Python Program Code

 Output screens

 References
Project Title
COVID Management system
Introduction
This software project is developed to automate the
functionalities of hospitals. The purpose of the software
project is to develop a program which provides a friendly
interface for the higher authority to manage the accounts of
clients and to know their information.

Objective
The objective of the software project is to develop the
functions of hospitals. This software project is also aimed to
enhance the current record keeping system, which will help
managers to retrieve the up-to-date information at right time
in right shape.
The proposed software system is expected to do the following
functionalities.

 To provide a user friendly.


 The proposed system should maintain all the reports
and transactions and should generate the required
reports and information when required.
 To provide graphical and user friendly interface to
interact with the centralized database based on client
server architecture.
 To identify the critical operation and possibilities of
simplification using modern IT tools and practices.
Limitations

Despite the best efforts of the developer, the following


limitations and functional boundaries are visible which limits
the scope of this application software.
 This software can store records and produce reports in pre-
designed format in soft copy. There is no facility yet to
produce customized reports. Only specified reports are
covered.
 There is no provision to calculate fine or penalty etc. for
defaulter members; however it can be developed easily with
the help of adding modules.
 Some application areas like updation along with late return
fine, Fees defaulters etc. are not implemented in the project.
This project is made by keeping in mind that it is to be used
only by Officers, which can facilitate ease control.
System Implementation
The Hardware used:
While developing the system, the used hardware are:
 A laptop with Operating System Windows 7
 4 GB RAM
 5 GB free disk space

The Software used:


 Python 3.12 as Front-end Development
environment.
 MySQL as Back-end Sever with Database for
Testing.
 MS-Word 2007 for documentation.
Database Creation

 Create database in MySQL named covid_management;


(‘create database if not exists covid_management’)
 Create a table named with the following field names and field types –

1. admin
(sno int not null AUTO_INCREMENT PRIMARY KEY, username varchar(255) not null,
password varchar(255) not null)
2. patients
(sno int not NULL AUTO_INCREMENT PRIMARY KEY, name varchar(255) not null,
age varchar(255) not null, gender char(1) not null, date date not null )
3. staff
(sno int not null AUTO_INCREMENT PRIMARY KEY, name varchar(255) not null, age
varchar(255) not null, gender char(1) not null, post varchar(255) not null, salary varchar(255)
not null )
Setting the Connection
The python module mysql.connector has been used in this
project to establish the connection with the MySQL database
with python.

Syntax:
import mysql.connector

The syntax to establish connection by providing username


and password is as follows:

mydb = mysql.connector.connect(host='127.0.0.1',user='root',
password='1234', auth_plugin='mysql_native_password')
if (mydb.is_connected()):
print(datetime.datetime.now())
print('Connected sucessfully with the database')
Python Program Code
#Project on covid management system
import mysql.connector

import datetime

import sys

# Connecting to database

mydb = mysql.connector.connect(

host='127.0.0.1', user='root', password='1234', auth_plugin='mysql_native_password')

if (mydb.is_connected()):

print(datetime.datetime.now())

print('Connected sucessfully with the database')

print('-------------------------------------------------------')

print('* *')

print('* Welcome To Covid Managment System *')

print('* *')

print('---------------------------------------------------------')

else:

print('Failed to connect to database')

# Creating database cursor to execute database commands

mycursor = mydb.cursor()

mycursor.execute('create database if not exists covid_management')

mycursor.execute('use covid_management')

mycursor.execute('create table if not exists staff(sno int not null AUTO_INCREMENT PRIMARY KEY,
name varchar(255) not null, age varchar(255) not null, gender char(1) not null, post varchar(255)
not null, salary varchar(255) not null )')

mycursor.execute('create table if not exists patients(sno int not NULL AUTO_INCREMENT


PRIMARY KEY, name varchar(255) not null, age varchar(255) not null, gender char(1) not null, date
date not null )')

mycursor.execute(
'create table if not exists admin(sno int not null AUTO_INCREMENT PRIMARY KEY, username
varchar(255) not null, password varchar(255) not null)')

mycursor.execute(

'create table if not exists sno(patients varchar(255) not null, staff varchar(255) not null)')

z=0

for i in mycursor:

z=1

if z == 0:

mycursor.execute("insert into sno values ('0', '0')")

# Committing above database commands

mydb.commit()

j=0

mycursor.execute('select * from admin')

for i in mycursor:

j=1

if (j == 0):

mycursor.execute(

'insert into admin(username, password) values("admin", "123400")')

mydb.commit()

loop1 = 'y'

# Business code logic

while (loop1 == "y" or loop1 == 'Y'):

print('_________________')

print("1.Admin: ")

print('2.Patients: ')

print('3.staff: ')
print('__________________')

ch1 = int(input("Enter your Choice: "))

if (ch1 == 1):

pas = input('Enter your password: ')

mycursor.execute('select username, password from admin')

for i in mycursor:

username, password = i

if (pas == password):

loop2 = 'n'

while (loop2 == 'n' or loop2 == "N"):

print("_________________")

print("1.Add Patients")

print("2.Add Staff")

print("3.Display Patients Record")

print('4.Display Staff Record')

print('5.Change Password')

print('6.Remove Patients')

print('7.Remove Staff')

print('8.Display all patients Records')

print('9.Display all Staff Records')

print('10.Logout')

ch2 = int(input("Enter the Input : "))

if (ch2 == 1):

loop3 = 'y'

while (loop3 == 'y' or loop3 == "Y"):

name = input("Enter the pateints name: ")

age = input("Enter the pateints age:")

gender = input('Enter the patients gender(m/f): ')

date = input('Enter date of conformation of covid: ')

mycursor.execute('select * from sno')


for i in mycursor:

patient, staff = i

patient = int(patient) + 1

mycursor.execute(

'update sno set patients= "'+str(patient)+'"')

mydb.commit()

query = 'Insert into patients(name, age, gender, date) Values (%s,%s,%s,%s)'

mycursor.execute(query, [name, age, gender, date])

mydb.commit()

print('data of pateints saved sucessfully....')

mycursor.execute('select * from patients')

t=0

for i in mycursor:

t += 1

t_id1, name1, age1, gender1, date1 = i

print(

f"Total no of corona infected patients---> {patient}")

print(f"Active Corona Cases->>> {t}")

print(f"this patient with id {

t_id1} will be quarentien for 14 days from {date1}")

loop3 = input(

'Do You Want To Enter More Patient Records (y/n): ')

elif (ch2 == 2):

loop3 = 'y'

while (loop3 == "y" or loop3 == "Y"):

name = input("Enter staff name:")

age = input('Enter Age:')

gender = input("Enter Gender(m/f): ")

post = input("Enter His/Her Post : ")


salary = input("Enter His/Her salary: ")

mycursor.execute('select * from sno ')

for i in mycursor:

patient, staff = i

staff = int(staff) + 1

query = 'insert into staff(name, age, gender, post, salary) values(%s,%s,%s,%s,%s)'

mycursor.execute(

query, [name, age, gender, post, salary])

mycursor.execute(

'update sno set staff= "'+str(staff)+'"')

mydb.commit()

print('staff with id {staff} added sucessfully....')

mycursor.execute('select * from staff')

t=0

for i in mycursor:

t += 1

print(f"Active Staff Member---> {t}")

loop3 = input("Do you want to add more Staff(y/n): ")

loop2 = input("Do you want to LogOut(y/n) :")

elif (ch2 == 3):

idd = int(input("Enter pateins Id : "))

t_id2, name2, age2, gender2, date2 = ["", "", "", "", ""]

query = "select * from patients where sno= %s"

mycursor.execute(query, [idd])

for i in mycursor:

t_id2, name2, age2, gender2, date2 = i

print("| ID | NAME | AGE | GENDER | CORONA POSITIVE DATE")


print(f"| {t_id2} | {name2} | {

age2} | {gender2} | {date2}")

elif (ch2 == 4):

idd = int(input("Enter Staff ID : "))

t_id3, name3, age3, gender3, post3, salary3 = [

"", "", "", "", "", ""]

query = "select * from staff where sno= %s"

mycursor.execute(query, [idd])

for i in mycursor:

t_id3, name3, age3, gender3, post3, salary3 = i

print("| ID | NAME | AGE | GENDER | POST | SALARY")

print(f"| {t_id3} | {name3} | {age3} | {

gender3} | {post3} | {salary3}")

elif (ch2 == 5):

pas = input("Enter the old password: ")

mycursor.execute("select username,password from admin")

for i in mycursor:

username, password = i

if (pas == password):

npas = input("Enter the new password: ")

mycursor.execute(

"update admin set password = '"+npas+"'")

mydb.commit()

else:

print("Wrong Password......")

elif (ch2 == 6):

loop3 = "y"

while (loop3 == 'y' or loop3 == "Y"):

idd = int(input("Enter the Patiensts Id: "))

query = "DELETE from patients where sno = %s"

mycursor.execute(query, [idd])
print('Patient delete sucessfully....')

loop3 = input(

"Do You want to remove more patients(y/n) :")

elif (ch2 == 7):

loop3 = "y"

while (loop3 == 'y' or loop3 == "Y"):

idd = int(input("Enter the Staff Id: "))

query = "DELETE from staff where sno = %s"

mycursor.execute(query, [idd])

print('staff delete sucessfully....')

loop3 = input(

"Do You want to remove more staff(y/n) :")

elif (ch2 == 8):

t_id2, name2, age2, gender2, date2 = ["", "", "", "", ""]

query = "select * from patients"

mycursor.execute(query)

rows = mycursor.fetchall()

print("| ID | NAME | AGE | GENDER | CORONA POSITIVE DATE")

for i in rows:

t_id2, name2, age2, gender2, date2 = i

print(f"| {t_id2} | {name2} | {

age2} | {gender2} | {date2}")

elif (ch2 == 9):

t_id3, name3, age3, gender3, post3, salary3 = [

"", "", "", "", "", ""]

query = "select * from staff"

mycursor.execute(query)

rows = mycursor.fetchall()

print("| ID | NAME | AGE | GENDER | POST | SALARY")

for i in rows:

t_id3, name3, age3, gender3, post3, salary3 = i


print(f"| {t_id3} | {name3} | {age3} | {

gender3} | {post3} | {salary3}")

elif (ch2 == 10):

print('Successful logout')

break

elif (ch1 == 2):

print("Thank You for coming forward to take your test....")

icough = input("Are you feeeling Cough(y/n) : ").lower()

dry_cough = 'n'

cough = 'n'

if (icough == 'y' or icough == "Y"):

dry_cough = input("Are you feeling dry cough? (y/n): ").lower()

cough = input("Are you feeling normal Cough? (y/n): ").lower()

snneze = input("Are you feeling sneeze? (y/n): ").lower()

pain = input("Are ypu feeling pain in your body? (y/n): ").lower()

weakness = input("Are you feeling any weakness? (y/n): ").lower()

mucus = input('Are you feeling any mucus? (y/n): ').lower()

itemp = int(input('please Enter into your temperature: '))

if (itemp <= 100):

temp = "low"

else:

temp = 'high'

breath = input('Are you having difficulty breathing?(y/n): ').lower()

if (dry_cough == 'y' and snneze == 'y' and weakness == 'y' and temp == 'high' and breath ==
'y'):

print(

'Sorry to say but According to guidelines You are suffering from corona...')

name = input("Enter your name: ")

age = input("Enter your age:")

gender = input('Enter your gender(m/f): ')


mycursor.execute('select * from sno')

for i in mycursor:

patient, staff = i

patient = int(patient) + 1

query = 'Insert into patients(name, age, gender, date) Values (%s,%s,%s,%s)'

mycursor.execute(

query, [name, age, gender, datetime.datetime.now()])

mycursor.execute('update sno set patients= "'+str(patient)+'"')

mydb.commit()

print('data of patient save sucessfully....')

print(f"Total no of patients is--->>> {patient}")

t=0

mycursor.execute('select * from patients')

for i in mycursor:

t += 1

t_id5, name5, age5, gender5, date5 = i

print(f"Total Active corona Cases->> {t}")

print(f"This patient with id {

t_id5} will be quarentine upto 14 days from {date5}")

elif (cough == 'y' and snneze == 'y' and pain == 'n' and weakness == 'n' and temp == 'low' and
breath == 'n'):

print('noting to worry just a normal cold you have')

else:

print(

'you are not infected from corona, if you are feeling wrong you just need to rest...')

print('if then also you are not feeling better, consult you doctor.....')

elif (ch1 == 3):

print('Staffs are not allowed to access the covid management system')

break
Output Screen

Screen 1

Screen 2
Screen 3

Screen 4
Screen 5

Screen 6
Screen 7

Screen 8
Screen 9

Screen 10

Screen 11
Screen 12

Screen 13
References
In order to work on this project titled – Covid
Management System, the following books and literature
are referred by me during the various phases of
development of the project.

 The Complete Reference python -by Shildit


 http://www.mysql.org/
 Computer Science with python kips class XII -
by Chetna Singh
 Various Websites of Discussion Forum and
software development activities.

Other than the above-mentioned books, the suggestions


and supervision of my teacher and my class experience
also helped me to develop this software project.

You might also like