Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

What is the best way to connect everything together? Would I need to create a table for Patient, Medications, Demographic about Patients, and Treatment Plan?

What is the best way to connect everything together? Would I need to create a table for Patient, Medications, Demographic about Patients, and Treatment Plan?

Part A: Create the database from your last assignment (Week4 Lab). Name the database doctorWho. Then create a page that allows Doctor Whos assistant to add a new patient record. You will need to give the assistant rights to this database. The assistants username is 'helper' and the password is 'feelBetter'. For this to work, you will need to create several pages so be sure to include all of them when submitting your work. Name the main page addPatient.php.

Part B: Add at least five records to the patients table in the doctorWho database you created in PartA. Now create a page that will display three or more fields from each of these records. The display should consist of, at a minimum, the patients first and last names and a unique identifier. Name the page getPatient.php and be sure to include the necessary accompanying files when you submit your work.

Here is my sketch from last week:

image text in transcribed

addPatient.html

Add Patient

Patient ID: First Name: Last Name: Gender: Treatment Plan:

addPatient.php

$patientid=$_POST["patientid"]; $firstname=$_POST["firstname"]; $lastname=$_POST["lastname"]; $gender=$_POST["gender"]; $treatmentplan=$_POST["treatmentplan"];

//sql query $sql="INSERT INTO patients (patientid, firstname, lastname, gender, treatmentplan) Values('$patientid', '$firstname', '$lastname', '$gender', '$treatmentplan';

if($conn->query($sql)===TRUE){ echo "Patient added successfully"; } else { echo "Error:" .$sql. " " .$conn->error; }

//close connection $conn->close(); ?>

database.php

//Connection $conn = new mysquli($servername, $username, $password, $dbname);

//Check Connection if($conn->connect_error){ die("Connection failed:" .$conn->connect_error); }

?>

viewPatients.php

//sql query $sql="SELECT * FROM PATIENTS";

//execute $result = $conn->query($sql);

//if any result if($result->num_rows>0){ echo"

"; while($row=$result->fetch_assoc()){ echo""; } }else{ echo"0 results"; }

//close connection_aborted $conn->close(); ?>

Dalice Hudson 2-8-21 Lab 4 Doctor's Office I have sketched out 4 different tables. 1) Patient includes patientid, firstName, lastName, gender, and treatmentPlan. 2) Patient_Demographic_Info includes patientID, age, address, marital Status, and treatmentID. 3) Medications includes treatmentID, startDate, endDate, productName, and productQuanity. 4) Billing includes treatmentID, amountBilled, amountPaid, datePaid, and insurancelnfo. Patient Medications patientlD int treatmentID int firstName varchar (20) startDate timestamp lastName varchar (20) endDate timestamp gender varchar (10) productName varchar (25) treatment Plan varchar (50) productQuanity int Patient Demographic Info Billing patientID int treatmentID int age int amount Billed int address varchar (50) amount Paid int maritalStatus varchar (10) datePaid timestamp treatmentID int insuranceinfo varchar (75)
Patient IDFirst NameLast NameGenderTreatment Plan
".$row["patientid"]." ".$row['firstname']."".$row['lastname']." ".$".row['gender']."".$row['treatmentplan']."

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions