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

Lab 19 – Web App SQL (group project)

CST363 Introduction to Database

Scott Lam and Laura Hackman


Professor Wisneski
February 13, 2024
ER Diagram – Prescription Database

ER Description:
The Prescription database is an efficient and comprehensive system for pharmacies. It
manages patient prescriptions, information for both doctors and patients, and tracks prescription
transactions. This allows accurate tracking and managing of many prescriptions. In the above
ER diagram, the doctor table has a one to many non-identifying relationship with both the
prescription and patient tables. This allows the tracking of multiple prescriptions and patients by
a single doctor. The patient table has a one-to-many non-identifying relationship with the
prescription table which shows that a single patient can have multiple prescriptions. The drug
table has a one-to-many non-identifying relationship with the prescription table and has a one to
many identifying relationship with the drug_cost table. The drug_cost table has a composite
primary key of pharmacy_ID and drug_ID and is used to determine cost of medication by
pharmacy. The pharmacy table has a one to many non-identifying relationship with the
prescription_fill table and a one to many identifying relationship with the drug_cost table. The
prescription table has a one to many identifying relationship with the prescription_fill table
because one prescription can have multiple fills. The organization of the data was designed to
maintain data integrity and reduce redundancy through normalization.
SQL SCHEMA
Screen shots of the working web application:

1). Register as a new patient with last name “Simpson”, city “Rockville”, zip code
62701 and a doctor with name “Spock”. Show a successful registration.
2). Attempt to register as a new patient with last name “Burns” but with a doctor
name that does not exist. Show a screenshot of the patient register form with the
error message.
3). Create a prescription for the patient “Simpson” and doctor “Spock” for a drug
“lisinopril” and quantity 90. Show the screen with the success message and
prescription display.
4). Attempt to create a prescription with an invalid drug name. Show a screen
with the create prescription form and error message.
5). Attempt to fill a prescription with an invalid pharmacy name.
6). Attempt to fill a prescription with an invalid rxid.
7). Fill the prescription with success.
8). Get the profile for patient “Simpson” and edit the patient record for “Simpson”
and change city to Springfield and zip code to 61705. Show the web page of the
successful update.
Before Update
After Update
9). Edit the patient record for “Simpson”. Attempt to change the doctor’s name to
a doctor that does not exist. Show the error message and edit doctor form.

You might also like