Question

In: Computer Science

Typically, a hospital patient receives medications that have been ordered by a particular doctor. Because the...

Typically, a hospital patient receives medications that have been ordered by a particular doctor. Because the patient often receives several medications per day, there is a 1:M relationship between PATIENT and ORDER. Similarly, each order can include several medications, creating a 1:M relationship between ORDER and MEDICATION.

REQUIREMENTS:

A. Screenshot of the ERD diagrams showing the PK and FK

B. SQL commands used.

C. Screenshot of the Table structure

Solutions

Expert Solution

A. Screenshot of the ERD diagrams showing the PK and FK

PATIENT(Pid, Pname, Paddress,Pphone)

Attribute:-Pid, Pname, Paddress,Pphone

Primary Key:- Pid

ORDER(Oid, Oname, Oaddress,Pid)

Attribute:-Oid, Oname, Oaddress,Pid

Primary Key:- Oid

Foreign Key:- Pid

MEDICATION(Mid, Mname,Mtype)

Attribute:-Mid, Mname,Mtype

Primary Key:- Mid

B. SQL commands used

1.CREATE TABLE PATIENT ( Pid int AUTO_INCREMENT, Pname varchar(255) NOT NULL, Paddress varchar(255), Pphone int, PRIMARY KEY (Pid) )

  1. CREATE TABLE PATIENT ( Pid int AUTO_INCREMENT, Pname varchar(255) NOT NULL, Paddress varchar(255), Pphone int, PRIMARY KEY (Pid) )
  2. CREATE TABLE Orders ( Oid int AUTO_INCREMENT, Oname varchar(20) NOT NULL, Oaddress varchar(50) NOT NULL, Pid int, PRIMARY KEY (Oid), FOREIGN KEY (Pid) REFERENCES patient(Pid) )

  3. CREATE TABLE MEDICATION ( Mid int AUTO_INCREMENT, Mname varchar(20), Mtype varchar(10), PRIMARY KEY (Mid) )

C. Screenshot of the Table structure

PATIENT Table Structure

ORDER Table Structure

MEDICATION Table Structure


Related Solutions

Court-ordered medications have just been granted for your patient. Historically he has done well on chlorpromazine....
Court-ordered medications have just been granted for your patient. Historically he has done well on chlorpromazine. You would like to order an oral dose with an equivalent IM dose if the oral dose is refused. Which pharmacokinetic parameter affects this conversion? Bioavailability Elimination Anticholinergic side effects Frequency of the patient’s behavioral emergencies
A patient is in the hospital with bacterial meningitis. The doctor needs to determine whether the...
A patient is in the hospital with bacterial meningitis. The doctor needs to determine whether the patient has an infection with Neisseria meningitis or Haemophilus influenzae. 1. What is the problem (scenario) that you're asked to solve? 2. What is your hypothesis for the solution to the problem? What organism do you think caused the problem? 3. What are the experiments that are required to answer your hypothesis? (The stains, biochemical, and media for each organism and the expected results)...
A young patient is brought to the doctor because of failure to thrive and is diagnosed...
A young patient is brought to the doctor because of failure to thrive and is diagnosed with lissencephaly. Disruption in what signals, involved in what process, would cause this diagnosis.
A doctor working in the Emergency department receives an 83 year old female patient named Judy....
A doctor working in the Emergency department receives an 83 year old female patient named Judy. Judy is underweight, confused and appears dishevelled. After examining the patient, the practitioner is immediately concerned about an ulcer that has developed on the sacrum, and asks Judy’s sister, Kathleen, how it developed. She explained that her sibling sits in a wheelchair most of the time, or lies on her bed, and that she lives with her daughter Kerry and her grandson. Her sister...
What should the nurse anticipate regarding dosages when 2 highly protein bound medications are ordered for a patient?
Place the following modes of delivery in order from fastest absorption (1) to slowest absorption rate (4).__Tablet__Enteric-coated pill__Liquid suspension__IntramuscularWhat should the nurse anticipate regarding dosages when 2 highly protein bound medications are ordered for a patient?
A university hospital is researching the effects of doctor attractiveness on patient satisfaction. Three doctors were...
A university hospital is researching the effects of doctor attractiveness on patient satisfaction. Three doctors were recruited: a middle aged male and 30 year old male and female. Each doctor gave every patient an eye exam. The patients were asked to rate their satisfaction level on a survey after being examined. The data are presented below. What can researchers conclude with α = 0.01? Middle age male 30 year old male 30 year old female 4 5 3 9 4...
The probability that a doctor correctly diagnose a particular illness is 0.7. Given that the doctor makes an incorrect diagnosis, the probability that the patient enter a lawsuit is 0.90.
The probability that a doctor correctly diagnose a particular illness is 0.7. Given that the doctor makes an incorrect diagnosis, the probability that the patient enter a lawsuit is 0.90. What is the probability that the doctor makes an incorrect diagnosis and the patients sues?A town has 2 fire engines operating independently. The probability that a specific engine is available when needed is 0.96.What is the probability that neither is available when needed?What is the probability that a fire engine...
You have been a patient in a hospital. After you recover you receive a bill which...
You have been a patient in a hospital. After you recover you receive a bill which you feel has excessive charges. Write a one-page essay describing how you would make use of a hospital Ombuds to seek an adjustment of the charges.
A patient is upset because he has been placed on a special therapeutic diet because of...
A patient is upset because he has been placed on a special therapeutic diet because of his high b/p. He is concerned that he will not be successful with his diet change. How can you encourage him to follow the physicians orders to improve his health?
Gastrointestinal Infections: The patient was a 1-year-old male admitted to the hospital because of fever and...
Gastrointestinal Infections: The patient was a 1-year-old male admitted to the hospital because of fever and dehydration. The day before, he had a fever and diarrhea. The only notable feature of his physical examination was hyperactive bowel sounds. Stool, blood, and urine samples were sent for culture. The stool sample was also checked for parasites. All cultures gave negative results, but a viral test was positive. Upon rehydration, he was released. a) What is the most likely cause of his...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT