You are on page 1of 20

BRACT’s

Vishwakarma Institute of Information Technology,


Kondhwa(BK), Pune-48
Department of Computer Engineering

IT Workshop (Python)
Project Report
On
Covid Patient’s Information Management System
SY B-Tech Computer Engineering
Group Members:

Name Roll No. GR No.


Siddhant Jain 221027 21910811
Anish Kataria 221034 21911105
Anjali More 221082 22020114
Shraddha Mulay 221083 22020260

Year: 2020-21
Index

Sr. No. Topic Page


No.
1 Problem Description 1
2 Database Selection 2
3 Database Description 3
4 Database Design 4
5 Table Structure 5
6 Connecting to database and fetching database 6
into python
7 Implementation Details 7
8 Sample Output 12
1. PROBLEM DESCRIPTION
Covid Patient Information Management System:
This project consists of a python script and a database file. This
information management system is primarily based on Tkinter. The
undertaking has a graphical user interface supplied by using the python
programming language and SQLite3.

It provides a graphical user interface wherein the user can input the
details of a patient so that it would act as a document within the database. The
user can also perform various operations on the data.

He/she can add a new report, update, search and moreover the admin
can delete the report and also display all the records within the database. The
application design is simple so that user won’t find it tough to use.

1
2. DATABASE SELECTION
We have chosen SQLite database in our project because:
SQLite is an embeddable open source database, written in C and
queryable with conventional SQL. SQLite is designed to be fast, portable, and
reliable.

One of SQLite’s greatest advantages is that it can run nearly anywhere.


SQLite has been ported to a wide variety of platforms: Windows, MacOS, Linux,
iOS, Android, and more.

Many languages have high-level bindings for SQLite as a library, and can
use that in conjunction with other database access layers for the language.
Python, for instance, bundles the SQLite library as a standard-issue element
with the stock version of the Python interpreter.

2
3. DATABASE DESCRIPTION(ER DIAGRAM)

3
4. DATABASE DESIGN(CLASS DIAGRAM)

4
5. TABLE STRUCTURE
Patient_t:

Sr.no Column Name Type Description


1 id int Primary key eg: 1
2 firstname text
3 lastname text
4 dateOfBirth date
5 gender text
6 address text
7 contactNumber text
8 emailAddress text
9 covidStatus text
10 history text
11 doctor text

Vaccine:

Sr.no Column Name Type Description


1 id int Primary key eg: 001
2 firstname text Apply NOT NULL Constraint
3 lastname text
4 age text
5 bloodgrp text
6 gender text
7 dose1 text
8 dose2 text

5
6. CONNECTING TO DATABASE AND FETCHING THE DATABASE
INTO PYTHON
To query data in a SQLite database from Python, you use these steps:

1. First, establish a connection to the SQLite database by creating


a Connection object.

To open a connection to an SQLite database file:

import sqlite3

conn = sqlite3.connect(sqlite_file)

where the database file (sqlite_file) can reside anywhere on our disk

2. Next, create a Cursor object using the cursor method of


the Connection object.

c = conn.cursor()

3. Then, execute a SELECT statement.

c.execute('SELECT * FROM TABLE_NAME)

4. After that, call the fetchall() method of the cursor object to fetch the data.

Records=c.fetchall()

5. Finally, loop the cursor and process each row individually.

for record in data:

print(Records)

6
7. IMPLEMENTATION DETAILS
Class MainPage:
Add code to MainPage class based on the class diagram. Wherever needed, the
additional implementation details are given below.

Display():

• This function displays covid patient’s information when “View Covid


Patients” button is clicked.

Display2():

• This function displays vaccinated patient’s information when “View


Vaccinated Patients” button is clicked.

Passwin():

• This function creates a window to take password entry when “Add Patients
Data” button is clicked.

HomePage():

• This function authenticates whether the user is doctor by checking


password when “Submit” button is clicked. When password is
authenticated this function is called. It creates object of “HomePage” class.

Class HomePage:
Constructor:

• Use default constructor to initialize and configure Home Page window. Add
widgets for needed operations.

insert():

• Create object of InsertWindow Class.

update():

7
• Creates a window with required widgets for taking id of patient for
updating its information.

updateID():

• This function creates object of Update Window class and passes patient’s
id.

Search():

• This function creates object of SearchDelete class and passes “Search”


string.

Delete():

• This function creates object of SearchDelete class and passes “Delete”


string.

Display():

• Creates object of Database class, calls Display() function from Database


class stores the returned value in a variable and passes it by creating
constructor of DatabaseView class.

Vaccine():

• This function creates object of VaccineWindow class

Class VaccineWindow:
Constructor:

• Use default constructor to initialize and configure vaccine details insertion


window. Add widgets for needed operations.

Insert():

• Insert data in the database.

Reset():

• Reset all the entries from the form.

8
Class DatabaseView:
Constructor:

• Creates a window with tabular structure to view the entries from database
and displays entries from patient_t table.

Class Database2View:
Constructor:

• Creates a window with tabular structure to view the entries from database2
and displays entries from vaccine table.

Class Database:
Constructor:

• Creates table patient_t.

Destructor:

• Closes database connection.

Insert():

• Inserts data of covid patients in patient_t table.

Update():

• Performs update operation.

Search():

• Performs searching operation.

Delete():

• Deletes the particular row.

Display():

9
• Fetches all the entries and returns all the records

Class Database2:
Constructor:

• Creates table vaccine.

Destructor:

• Closes database connection.

Insert():

• Inserts data of vaccinated patients in vaccine table.

Display():

• Fetches all the entries and returns all the records

Class Values:
Validate():

• Validates entries from insert form.

Class Values2:
Validate2():

• Validate entries from insert vaccinated patient form.

Class InsertWindow:
Constructor :

• Creates a window having insertion form.

Insert():

• Passes the entries to insert in patient_t table.

Reset():

10
• Reset all the entries from the form.

Class UpdateWindow:
Constructor:

• Creates a window with an update form.

Update():

• Passes entries to update entries in table.

Reset():

• Resets all the entries in the form.

Class SearchDeleteWindow:
Constructor:

• Creates a common window which is used for search and delete operation.

Search():

• Passes id to search data in database.

Delete():

• Deletes the data from database matching the provided id.

11
8. SAMPLE OUTPUT

MAIN PAGE:

DATABASE 1 VIEW:

12
DATABASE 2 VIEW:

AUTHENTICATION WINDOW:

13
HOME PAGE: (AFTER CLICKING ON ADD DATA BUTTON ON MAIN
PAGE)

INSERT OPERATION:

AFTER SUCCESSFUL INSERTION:

14
UPDATE WINDOW:

15
UPDATE DATA:

DELETE WINDOW:

16
AFTER SUCCESSFUL DELETION:

SEARCH WINDOW:

17
REFERENCES
A thorough guide to SQLite database operations in Python (sebastianraschka.com)

SQLite Python: Select Data from A Table (sqlitetutorial.net)

Python - GUI Programming (Tkinter) - Tutorialspoint

18

You might also like