Professional Documents
Culture Documents
Bitwise Team Project Final Report
Bitwise Team Project Final Report
Bitwise Team Project Final Report
Miscellaneous Info:
● Default Logins:
○ Username: admin
○ Password: secret
● Jake:
○ Handled back end work with the external API we used for address
validation and implemented account creation for both the patient and
doctors. Also completed the initial project plan document.
● Chris:
○ Created the log in system for both patient and doctor, which included
implementing Bcrypt. Also contributed to the SQL implementation of our
database, including functions that grab patient and doctor data directly, or
several local APIs that serve the same information.
● Jeremiah:
○ Primarily completed the front end’s design for all pages. Implemented the
homepages for both doctor and patient, which includes the viewing, and
modification of prescriptions.
Changes from original design: Our original design initially included a pharmacy
technician and the pharmacies which would have handled filling prescriptions, but we
reduced the scope of the project to just patient and doctor interactions in order to bring
the complexity down to a manageable level. Beyond this our project has stayed very
CST336 Final Team Project Documentation
similar to our original design. Our database initially included tables for the pharmacies –
which have since been removed. We also altered the patient and doctor databases to
rely on a userInformation table which includes login information and core personal data
such as SSN.
CST336 Final Team Project Documentation
Rubric:
● Project allows user interaction with at least three different types of form elements
(text box, select, radio, checkbox, etc).
○ Various pages will use text inputs, such as account creation and login
portals. Some data, such as doctor names, drug names, etc., will be
presented in pre-filled dropdown lists. Radio options are also shown
during patient account creation for a user to select their gender.
○ The project uses sessions in order to store and pass around useful data.
Beyond this we also use sessions to store the login information of the
current user and whether or not that specific user is authorized to access
different pages.
● Project allows users to update existing records in the database, in a friendly way
(data is pre-filled). Must update at least three fields.
○ Patients can update their primary address. This will update four fields to
one record in the patient table: patientState, patientZip, patientCity, and
patientStreet.
○ Doctors will be able to add new prescriptions in the system that are tied to
patient accounts. This will create a new record in the prescription table.
The creation of user accounts also adds records to the database.
● Project must have at least 50 lines of client-side JavaScript code (e.g. form data
validation, API calls, etc.)
● Project includes at least two local or external Web APIs. As part of your
submission, please explain where the Fetch calls are.
● doctorCreateAccount.js:
● patientCreateAccount.js:
● doctorHomepage.js:
● patientHomepage.js:
● index.js:
● Project has a nice, professional and consistent design, free of typos. Uses at
least 50 CSS properties or Bootstrap.
Screenshots:
Patient Login:
CST336 Final Team Project Documentation
Patient Homepage:
CST336 Final Team Project Documentation
Doctor Login:
Doctor Homepage:
No Current Prescriptions:
No Patient Selected:
CST336 Final Team Project Documentation
-- -----------------------------------------------------
-- Schema r9p4z1hjmljpenkt
-- -----------------------------------------------------
DROP SCHEMA IF EXISTS `r9p4z1hjmljpenkt`;
CREATE SCHEMA IF NOT EXISTS `r9p4z1hjmljpenkt` DEFAULT CHARACTER SET
utf8mb3 ;
USE `r9p4z1hjmljpenkt` ;
-- -----------------------------------------------------
-- Table `r9p4z1hjmljpenkt`.`userInformation`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `r9p4z1hjmljpenkt`.`userInformation` (
`loginId` INT NOT NULL AUTO_INCREMENT,
`userType` INT NOT NULL,
`username` VARCHAR(45) NOT NULL,
`passwordHash` VARCHAR(255) NOT NULL,
`firstName` VARCHAR(45) NOT NULL,
`lastName` VARCHAR(45) NOT NULL,
`SSN` CHAR(9) NOT NULL,
PRIMARY KEY (`loginId`))
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `r9p4z1hjmljpenkt`.`doctor`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `r9p4z1hjmljpenkt`.`doctor` (
`doctorId` INT NOT NULL AUTO_INCREMENT,
`loginId` INT NOT NULL,
CST336 Final Team Project Documentation
-- -----------------------------------------------------
-- Table `r9p4z1hjmljpenkt`.`drug`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `r9p4z1hjmljpenkt`.`drug` (
`drugId` INT NOT NULL AUTO_INCREMENT,
`drugName` VARCHAR(45) NOT NULL,
`drugInfo` VARCHAR(100) NULL,
PRIMARY KEY (`drugId`))
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8mb3;
-- -----------------------------------------------------
-- Table `r9p4z1hjmljpenkt`.`patient`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `r9p4z1hjmljpenkt`.`patient` (
`patientId` INT NOT NULL AUTO_INCREMENT,
`primaryDoctorId` INT NOT NULL,
`loginId` INT NOT NULL,
`patientBirthdate` DATE NOT NULL,
`patientState` VARCHAR(45) NOT NULL,
`patientZip` CHAR(5) NOT NULL,
`patientCity` VARCHAR(45) NOT NULL,
`patientStreet` VARCHAR(45) NOT NULL,
`patientGender` CHAR(1) NOT NULL,
PRIMARY KEY (`patientId`),
INDEX `fk_patient_doctor1_idx` (`primaryDoctorId` ASC) VISIBLE,
INDEX `fk_patient_loginCredentials1_idx` (`loginId` ASC) VISIBLE,
CONSTRAINT `fk_patient_doctor1`
FOREIGN KEY (`primaryDoctorId`)
REFERENCES `r9p4z1hjmljpenkt`.`doctor` (`doctorId`)
ON DELETE CASCADE,
CST336 Final Team Project Documentation
CONSTRAINT `fk_patient_loginCredentials1`
FOREIGN KEY (`loginId`)
REFERENCES `r9p4z1hjmljpenkt`.`userInformation` (`loginId`)
ON DELETE CASCADE)
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8mb3;
-- -----------------------------------------------------
-- Table `r9p4z1hjmljpenkt`.`prescription`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `r9p4z1hjmljpenkt`.`prescription` (
`rxNum` INT NOT NULL AUTO_INCREMENT,
`doctorId` INT NOT NULL,
`patientId` INT NOT NULL,
`drugId` INT NOT NULL,
PRIMARY KEY (`rxNum`),
INDEX `fk_prescription_drug1_idx` (`drugId` ASC) VISIBLE,
INDEX `fk_prescription_patient1_idx` (`patientId` ASC) VISIBLE,
INDEX `fk_prescription_doctor1_idx` (`doctorId` ASC) VISIBLE,
CONSTRAINT `fk_prescription_doctor1`
FOREIGN KEY (`doctorId`)
REFERENCES `r9p4z1hjmljpenkt`.`doctor` (`doctorId`)
ON DELETE CASCADE,
CONSTRAINT `fk_prescription_drug1`
FOREIGN KEY (`drugId`)
REFERENCES `r9p4z1hjmljpenkt`.`drug` (`drugId`)
ON DELETE CASCADE,
CONSTRAINT `fk_prescription_patient1`
FOREIGN KEY (`patientId`)
REFERENCES `r9p4z1hjmljpenkt`.`patient` (`patientId`)
ON DELETE CASCADE)
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8mb3;
-- -----------------------------------------------------
-- Insert values into userInformation table
-- -----------------------------------------------------
VALUES
(1, 1, 'admin',
'$2b$10$ZvdOe5/Np68EnSNuMvJ78ugK1FkxeB6YxBDwkTwk2YPYcEzF0yYDC',
'Jane', 'Doe', '987654321'),
(2, 0, 'admin',
'$2b$10$ZvdOe5/Np68EnSNuMvJ78ugK1FkxeB6YxBDwkTwk2YPYcEzF0yYDC',
'John', 'Doe', '123456789');
-- -----------------------------------------------------
-- Insert values into doctor table
-- -----------------------------------------------------
-- -----------------------------------------------------
-- Insert values into patient table
-- -----------------------------------------------------
-- -----------------------------------------------------
-- Insert values into drug table
-- -----------------------------------------------------
-- -----------------------------------------------------
-- Insert values into prescription table
-- -----------------------------------------------------
SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;