Pharmacy Management System Database Flow
Pharmacy Management System Database Flow
Master of Technology
Computer Science & Technology
Submitted By
Anisha Singh
Ankit Kumar
Aqsha Aftab
The main aim of this system is to apply technology to support the pharmacists
and the stores to reduce the human effort on searching and automation of the
billing.
This system can be used by any store to automate the process of manually
maintaining pharmacy related records.
The system uses insurance of patients and can also notify employee of events
performed in pharmacy.
2.REQUIREMENT ANALYSIS
After studying and analysing the needs of pharmacy management and its use,
we put forward the following requirements and proceeded to the design stage
according to these requirements
Patient
When patients arrive at the store, we will obtain their health ID and identify
them based on their health ID. If they are a new patient, we will collect data
such as name, date of birth, address, health ID, phone number, gender, and
insurance Id. The patient will have a prescription using which order will be
created and the patient will then pay the bill.
Employees
An employee has an employee id, role, license, phone no, salary and name
employee can be a cashier or pharmacist. If an employee is preparing the order
then his/her ID will be used in the order. The employee authorizes the disposal
of medicines. Employees will be notified of orders and disposals.
1|Page
Prescription
Each patient should have one or more prescriptions with them, since most
medicines cannot be sold without a prescription. A prescription contains the
prescription identification number, the patient's health ID, the doctor's name,
the type of illness and the date of the prescription. Prescription includes
prescribed drugs and is used to create the order.
Prescribed Drug
Insurance
Order
Ordered Drugs
Bill (Invoice)
2|Page
calculated automatically by the system using insurance, customer and drug
data.
Medicine (Inventory)
Disposal
Employees will be notified and will authorize the disposal of the drug that is
marked for disposal as per the expiry date. So that the expired medicines can
be disposed of. Disposal will include the expiration date, manufacturer, batch
number, name and quantity of the drug.
Notification
2. There are drugs that will expire within the next 60 days.
3|Page
3. E-R Diagram
4|Page
A patient can claim one insurance and insurance can only insure one patient.
Thus the relationship between Insurance and Patient is one to one. A patient
may not have insurance so patient participation in insures is partial. However,
each insurance belongs to a patient so insurance participation is total in
insures.
A patient can pay several bills, but a bill will only be paid by a single patient.
Thus, the relationship between Patient and Bill is one to many. Each patient
pays for his bill and each bill is paid by a patient so the participation is Total of
both sides.
A prescription may have several prescribed drugs but a drug with order id will
be on only one prescription so the relationship between prescription and
prescribed drug is one to many. Each prescription will have prescribed drug on
it and each prescribed drug will be on a prescription so the participation is
Total of both sides.
An order can only generate one bill and a bill be generated for only one order
so the relationship between order and bill is one to one. Each order will
generate a bill and each bill will be generated for an order so the participation
is Total of both sides.
An order can contain multiple ordered drugs but an ordered drug with its order
ID and drug name will be only be in an order. Thus the relationship between
5|Page
order and ordered drugs is one to many. Each order will contain some drugs
and each ordered drugs will be in some order. So the participation is Total of
both sides.
An employee can prepare many orders but an order will be prepared by only
one employee. Thus, the relationship between order and ordered drugs is one
to many. Each order will be prepared by some employee but not every
employee prepares order so the order participation is Total in prepares and
the employee participation is partial in prepares.
A medicine will be fetched by an ordered drug and an ordered drug will fetch
only one medicine. So the relationship between ordered drugs and medicine is
one to one. Each ordered drug will fetch some medicine but every medicine
will not be fetched so the participation of ordered drugs in fetched is Total but
participation of medicine in fetched is partial.
6|Page
every employee receives notification but every notification is sent to some
employee so the participation of employee in isNotified is partial and the
participation of notification in isNotified is Total.
5.1 Insurance
Insurance (InsuranceID,CompanyName,StartDate,EndDate,InsurancePer)
Functional Dependencies –
5.2 Patient
Patient (HealthID, FirstName, LastName, Phone, Gender, Address, DOB,
InsuranceID)
7|Page
Foreign key: Patient (InsuranceID)-> Insurance(InsuranceID)
Functional Dependencies –
HealthID ->InsuranceID
Inserting separate sub attribute for composite attribute and separate attribute
for multi-valued attribute.
5.3 Prescription
Prescription ( PrescriptionID, HealthID, DoctorID, PrescriptionDate)
Functional Dependencies –
8|Page
PrescriptionID -> PrescriptionDate
5.4 PrescribedDrug
PrescribedDrug ( PrescriptionID, DrugName, DrugQuantity, RifillLimit)
Functional Dependencies –
5.5 Employee
Employee (EmployeeID, FirstName, LastName, DOB, License, StartDate,
EndDate, Salary, Phone)
9|Page
Primary key: EmployeeID
Functional Dependencies –
StartDate and EndDate are non-key attribute and they are transitively
dependent on primary key Employee because of License Attribute.
Functional dependencies
10 | P a g e
Both Relation Employee and License are in BCNF as it is in 3NF and no prime
attribute is transitively dependent on primary key.
5.6 Order
Order (OrderID, PrescriptionID, EmployeeID, OrderDate)
Functional Dependencies –
OrderID -> PrescriptionID, OrderID -> EmployeeID , OrderID -> OrderDate
5.7 Bill
Bill (HealthID, OrderID, PymMode, TotalAmount,BillNo)
Functional Dependencies –
11 | P a g e
BillNo-> HealthID, BillNo-> OrderID, BillNo-> PymMode
5.8 OrderedDrugs
OrderedDrugs (OrderID, DrugName,BatchNo,Price,Quantity)
OrderedDrugs (Drugname,BatchNo)->Medicine(Drugname,BatchNo)
Functional Dependencies –
12 | P a g e
5.9 Medicine
Medicine (DrugName,
Manufacturer,BatchNo,Price,Expirydate,MedType,StockQuantity)
Functional Dependencies –
DrugName, BatchNo -> Manufacturer, DrugName, BatchNo -> Price
5.10 DisposedDrugs
DisposedDrugs (DrugName, BatchNo, DrugQuantity, Manufacturer)
Functional Dependencies –
13 | P a g e
Relation DisposedDrugs is in 3NF as it is in 2NF and no attribute is transitively
dependent on primary key.
5.11 Authorizes
Authorizes(EmpId,DrugName,BatchNo,DisposalDate)
Functional Dependencies –
5.12 Notification
Notification (NotificationID, Message, Type)
Functional Dependencies –
14 | P a g e
Relation Notification is in 2NF as it is in 1NF and no non key attribute is
partially dependent on primary key.
5.13 IsNotified
IsNotified (NotificatioID, EmpID)
Functional Dependencies –
15 | P a g e