0% found this document useful (0 votes)
56 views19 pages

Thapar Dispensary Management System

Uploaded by

8vc9k2x952
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
56 views19 pages

Thapar Dispensary Management System

Uploaded by

8vc9k2x952
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

THAPAR DIPSENSARY

MANAGEMENT SYSTEM

DBMS PROJECT REPORT

Submitted to: Ms. Palak Goyal

Submitted By:
Abhishek Gupta – 102103346
Krishna Verma - 102103459
Tisya Pawar – 102103251
Sakshi Goyal - 102103451

Group: 2CO17
INDEX

SR.NO CONTENTS PAGE NO.


1. INTODUCTION 1

2. REQUIREMENT ANALYSIS 2

3. ER-DAIGRAM 3

4. ER TO TABLE 4

5. NORMALIZATION 5

6. QUERIES 8

7. CONCLUSION 17
INTRODUCTION

In today's fast-paced world, efficient management of data has become increasingly important for
organizations of all sizes and across all industries. The healthcare industry, in particular, relies heavily
on the effective management of data to provide patients with high-quality care. One critical
component of the healthcare industry is dispensary systems, which provide medical supplies,
including medications, to patients.
At Thapar University, the dispensary system plays a vital role in the healthcare services provided to
students and staff. Keeping records of all prescriptions issued through the dispensary is essential for
maintaining accurate records and ensuring that patients receive the correct medications.
We are creating a Thapar Dispensary Management System to fulfil the requirement for effective data
management. A centralised database will be part of the system, which will be used to keep all
prescription records that the dispensary issues. An easy-to-use user interface will make it possible for
authorised users to access and navigate the system with ease.
Students, faculty, and staff will have access to the Thapar Dispensary Management System, making
it simpler to maintain their prescription history for leave records and other uses.
The database will be split into three different sorts of views:

 Student: The only records they can see about their visits to the dispensary are their own.
 Teachers: They have access to information on every student's trip to the pharmacy.
 Staff members: They have access to view, update, insert and delete any prescription and
medicine record. This will ensure high accuracy and availability of medicines and equipment
at all times.
Moreover, the system will provide analytics and reporting features, making it possible to generate
insights and reports based on the data collected. This functionality will enable administrators to make
data-driven decisions and improve the quality of care provided by the dispensary system.
Overall, the Thapar Dispensary Management System will offer a comprehensive solution for the
efficient management of prescription records at Thapar University. The system will enhance patient
care, reduce errors, and increase operational efficiency, ensuring that the dispensary system continues
to meet the healthcare needs of the Thapar community.
REQUIREMENT ANALYSIS

Requirement analysis is a crucial step in the development of a dispensary management system, as it


helps to identify the needs and expectations of the stakeholders involved. Below are some of the
requirements that are considered in the project:
1. Patient Management: The system should be able to store and manage patient records,
including personal information, medical history, and prescription details.
2. Inventory Management: The system should be able to track and manage the dispensary's
inventory, including medical supplies, equipment, and medication.
3. Security: The system should have robust security features to protect patient and business
data. It should have authentication and access control mechanisms to ensure only authorized
personnel can access the system.
4. User-Friendliness: The system should be user-friendly and easy to navigate. It should have
a simple and intuitive interface, with clear instructions and guidance.
5. Scalability: The system should be scalable and able to accommodate future growth and
expansion. It should be able to handle increased patient volume and inventory levels without
compromising performance.
6. Integration: The system should be able to integrate with other healthcare systems, such as
Electronic Health Records (EHRs), to facilitate seamless information exchange.
Overall, the dispensary management system should be designed to streamline operations, improve
patient care, and increase efficiency. It should be adaptable to changing requirements and provide the
necessary features to meet the needs of the dispensary and its stakeholders.
ER-DIAGRAM

The ER diagram depicts the relationship between various entities in the Thapar Dispensary database.
The diagram includes the tables Doctor, Prescription, Medicine and Student, along with the attributes
and relationships between them. The Doctor entity includes details about the doctors such as their
name, phone number, and qualification. Prescription entity includes details of prescriptions given to
students by doctors. Medicine entity includes details of all the medicines available. Student entity
includes details about the students such as their name, phone number, and year of study.
ER to Table

Total 5 tables are required:


1. Doctor (DID, First_name, Last_name, Date_of_birth, Phone_no, Year_of_joining, In_time, Out_time, Gender,
Qualification, House_no, Street_no, City, State, Pincode)
2. Prescription (PID, Date_and_Time, RollNo, DID)
3. Medicine (MID, Name, Quantity)
4. Student (RollNo, First_name, Last_name, Branch, Gender, Date_of_Birth, Phone no, Year,
Hostel_room)
5. Prescribed (PID, MID, Dose)
NORMALIZATION

1. Table 1: Doctor
Attributes: DID (primary key), First_name, Last_name, Age, Date_of_birth, Phone_no,
Year_of_joining, In_time, Out_time, Gender, Qualification, House_no, Street_no, City, State,
Pincode
Prime Attribute: DID (Primary key)
Non-prime Attribute: First_name, Last_name, Age, Date_of_birth, Phone_no,
Year_of_joining, In_time, Out_time, Gender, Qualification, House_no, Street_no, City, State,
Pincode
FD: None

1NF:
Qualification is a multi-valued attribute. Therefore, Doctor table is not in 1NF.

Doctor (DID, First_name, Last_name, Date_of_birth, Phone_no, Year_of_joining, In_time,


Out_time, Gender, House_no, Street_no, City, State, Pincode)
Doctor_Qualification (DID, Qualification)

2NF:
Doctor table is in 2NF as there is only one Primary Key (DID) and all the attributes are fully
dependent on DID.
3NF:
Doctor table is in 3NF as there no transitive dependency.
2. Table 2: Prescription
Attributes: PID (primary key), Dose, Date_and_Time, RollNo, DID
Prime Attribute: PID
Non-prime Attribute: Date_and_Time
FD: DID and RollNo

1NF:
Prescription table is in 1NF.
2NF:
Prescription table is in 2NF as there is only one Primary Key (PID) and all the attributes are
fully dependent on PID.
3NF:
Prescription table is in 3NF as there no transitive dependency.

3. Table 3: Medicine
Attributes: MID (Primary key), Name, Quantity
Prime Attribute: MID
Non-prime Attribute: Name and Quantity
FD: None

1NF:
Medicine table is in 1NF.
2NF:
Medicine table is in 2NF as there is only one Primary Key (MID) and all the attributes are
fully dependent on MID.
3NF:
Medicine table is in 3NF as there no transitive dependency.
4. Table 4: Student
Attributes: RollNo (primary key), First_name, Last_name, Branch, Gender, Age, Phone no,
Year, Hostel_room
Prime Attribute: RollNo
Non-prime Attribute: First_name, Last_name, Branch, Gender, Age, Phone no, Year,
Hostel_room
FD: None

1NF:
Student table is in 1NF.
2NF:
Student table is in 2NF as there is only one Primary Key (RollNo) and all the attributes are
fully dependent on RollNo.
3NF:
Student table is in 3NF as there no transitive dependency.

5. Table 5: Prescribed
Attributes: PID, MID (primary keys)
Prime Attribute: PID, MID
Non-prime Attribute: Dose
FD: PID, MID

1NF:
Prescribed table is in 1NF.
2NF:
Prescribed table is in 2NF.
3NF:
Prescribed table is in 3NF.
QUERIES

SQL statements used to create and insert data into the database:
1. DOCTOR
CREATE TABLE Doctor (DID NUMBER(10) PRIMARY KEY, First_name VARCHAR2(50), Last_name
VARCHAR2(50), Date_of_birth DATE, Phone_no VARCHAR2(0820), Year_of_joining NUMBER(4),
In_time TIMESTAMP, Out_time TIMESTAMP, Gender CHAR(1), House_no VARCHAR2(10),Street_no
VARCHAR2(10),City VARCHAR2(50),State VARCHAR2(50),Pincode VARCHAR2(10));
INSERT INTO Doctor (DID, First_name, Last_name, Date_of_birth, Phone_no, Year_of_joining, In_time,
Out_time, Gender, House_no, Street_no, City, State, Pincode)VALUES (1, 'Dr. Amit', 'Shaw', to_date('1980-
01-01','YYYY-MM-DD'), '1234567890', 2005, to_timestamp('08:00:00','HH24:MI:SS'),
TO_TIMESTAMP('12:00:00','HH24:MI:SS'), 'M', '123', '456', 'Jamshedpur', 'Jharkhand', '831009');

2. DOCTOR_QUALIFICATION
CREATE TABLE Doctor_Qualification ( DID NUMBER(10), Qualification VARCHAR2(50), PRIMARY
KEY (DID, Qualification), FOREIGN KEY (DID) REFERENCES Doctor(DID));
INSERT INTO Doctor_Qualification (DID, Qualification) VALUES (1, 'MD');
3. STUDENT
CREATE TABLE Student ( RollNo NUMBER(10) PRIMARY KEY, First_name VARCHAR2(50),
Last_name VARCHAR2(50), Branch VARCHAR2(50), Gender CHAR(1), Date_of_birth DATE, Phone_no
VARCHAR2(20), Year NUMBER(4), Hostel_room VARCHAR2(10));
INSERT INTO Student (RollNo, First_name, Last_name, Branch, Gender, Date_of_birth, Phone_no, Year,
Hostel_room) VALUES (102103346, 'Abhishek', 'Gupta', 'COE', 'M', to_date('2003-04-08', 'YYYY-MM-
DD'), '9304291547', 2, 'B122');

4. MEDICINE
CREATE TABLE Medicine (MID INT PRIMARY KEY, Name VARCHAR(50), Quantity INT);
INSERT INTO Medicine (MID, Name, Quantity) VALUES (1, 'Aspirin', 50);
5. PRESCRIPTION
CREATE TABLE Prescription ( PID NUMBER(10) PRIMARY KEY, Date_and_Time TIMESTAMP,
RollNo NUMBER(10), DID NUMBER(10), FOREIGN KEY (RollNo) REFERENCES Student(RollNo),
FOREIGN KEY (DID) REFERENCES Doctor(DID));
INSERT INTO Prescription (PID, Date_and_Time, RollNo, DID) VALUES (1, TO_TIMESTAMP('2023-04-
30 10:00:00', 'YYYY-MM-DD HH24:MI:SS'), 102103251, 1);

6. PRESCRIBED
CREATE TABLE Prescribed ( PID NUMBER(10), MID INT, Dose VARCHAR(50) PRIMARY KEY (PID,
MID), FOREIGN KEY (PID) REFERENCES Prescription(PID), FOREIGN KEY (MID) REFERENCES
Medicine(MID));
INSERT INTO Prescribed (PID, MID, Dose) VALUES (1, 1, '1 tablet daily');
INSERT INTO Prescribed (PID, MID, Dose) VALUES (1, 3, '2 tablets twice a day');
INSERT INTO Prescribed (PID, MID, Dose) VALUES (1, 6, '1 capsule every 8 hours');
PL/SQL queries used to create the three views in the database:

1. STUDENT VIEW
CREATE VIEW student_view AS SELECT Prescription.RollNo, Prescription.PID,
Prescription.Date_and_Time, Doctor.First_name || ' ' || Doctor.Last_name AS Doctor_name, Medicine.Name
AS Medicine_name, Prescribed.Dose FROM Prescription JOIN Prescribed ON Prescription.PID =
Prescribed.PID JOIN Medicine ON Prescribed.MID = Medicine.MID JOIN Doctor ON Prescription.DID =
Doctor.DID ;

This view selects the PID, Date_and_Time, Doctor_name, Medicine_name, and Dose columns
from the Prescription, Doctor, Medicine, and Prescribed tables. It joins these tables on their
respective foreign keys to create a view that displays the prescription details for a given roll
number.
To use this view for a specific roll number, we need to add ‘where’ condition in select statement.
For example, to retrieve the prescription details for roll number 102103346, you can run the
following query:
SELECT * FROM student_view WHERE student_view.RollNo= 102103346
PL/SQL block that takes a roll number as input, checks if it's a valid roll number and if there
are any prescriptions associated with that roll number. If the roll number is invalid, it outputs
"Invalid Roll Number". If there are no prescriptions associated with the roll number, it outputs
"NO DATA". Otherwise, it outputs the prescriptions for the given roll number in a table
format.

Roll number-102103346

Roll number-102103459

Roll number-102013343
2. TEACHER VIEW
CREATE OR REPLACE VIEW teacher_view AS
SELECT Prescription.PID, Prescription.Date_and_Time, Student.RollNo, Student.First_name || ' ' ||
Student.Last_name AS Student_name, Doctor.First_name || ' ' || Doctor.Last_name AS Doctor_name
FROM Prescription
JOIN Doctor ON Prescription.DID = Doctor.DID
JOIN Student ON Prescription.RollNo = Student.RollNo;

This view selects data from the Prescription, Doctor, and Student tables, joining them on their
respective IDs. It includes the RollNo of the student to identify which student the prescription
belongs to, and concatenates the first and last names of both the student and doctor to create
readable name strings.
To use this view, a teacher can simply query it with the RollNo of the student they want to see
prescriptions for:
SELECT * FROM teacher_prescriptions WHERE RollNo = :roll_number;

A teacher can view all the prescriptions which he/she want depending upon the need to add
this functionality we can enter a user choice (here a teacher) to view all the record or not. If
not then enter the roll number of the student whose prescription need to be viewed.
PL/SQL block that takes a character Y/N as input to check whether a user want to view all the
record or not. If N the takes roll number as input, checks if it's a valid roll number and if there
are any prescriptions associated with that roll number. If the roll number is invalid, it outputs
"Invalid Roll Number". If there are no prescriptions associated with the roll number, it outputs
"NO DATA". Otherwise, it outputs the prescriptions for the given roll number in a table
format.

View prescription of Roll number 102103346

View all the prescriptions


3. STAFF VIEW

A Staff has a full privilege of inserting, deleting and updating data from table Prescription,
Medicine and Prescribed. In staff view a user can view all the data entries. To view the entries
of tables we can run these queries:
SELECT * FROM Doctor JOIN Prescription ON Doctor.DID = Prescription.DID JOIN
Prescribed ON Prescription.PID = Prescribed.PID JOIN Medicine ON Prescribed.MID =
Medicine.MID JOIN Student ON Prescription.RollNo = Student.RollNo JOIN
Doctor_Qualification ON Doctor.DID = Doctor_Qualification.DID;

Update a record in the Medicine table:


UPDATE Medicine SET Quantity = 50 WHERE MID = 1;
Trigger to check the validity of time in the prescription:

Query to add a new Prescription:


Conclusion

The Thapar Dispensary Management System will provide Thapar University with a comprehensive
solution for the effective management of prescription records. The system will ensure that the
dispensary system continues to satisfy the healthcare needs of the Thapar community by improving
patient care, reducing errors, and increasing operational efficiency.

As there are three distinct viewpoints, each has a role to play in achieving the project's objectives
➢ Student: If given the opportunity to edit their or anyone else's records, there are many chances
that students will create fake medical issues as an excuse to miss classes. Therefore, students
can only review their own records.
➢ Teachers: They have access to all student records, so they may verify whether or not students
are being truthful about missing regular lessons or tests.
➢ Staff members: Because they are aware of every student's visit to the dispensary, only the
staff is permitted to modify the database.

There is always room for improvement even after the primary objectives for the efficient operation of
the dispensary management system have been met. Some suggestions that could be made for
improving the project's efficiency include:
✓ Implement a system for electronic health records: The dispensary should implement a system
for electronic records that can hold all patient data in a single database. The accuracy and
accessibility of patient data would increase as a result, and the time required to retrieve
medical records would decrease.
✓ Implement a prescription management system: The dispensary needs to put in place a system
that will make it easier to generate and handle prescriptions. By doing this, mistakes would
be decreased and the proper patient would receive the appropriate medication.
✓ Boost inventory control: The dispensary should think about putting in place a system that can
monitor the availability of medicines and medical supplies. By doing this, the dispensary
would be well-stocked and capable of giving patients prompt care.

The Thapar dispensary management system, in conclusion, is a tremendous step towards the efficient
operation of the dispensary. The success of the project is indicated by the effective and efficient
growth of the dispensary management system. As technology advances, healthcare facilities must
adapt to these changes and incorporate them into their routine operations.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy