From 97d916ca98c8145397eb6444e623a8daa93faa74 Mon Sep 17 00:00:00 2001 From: mo khan Date: Sun, 1 Mar 2020 14:47:51 -0700 Subject: Create EER diagram --- assignments/final/README.md | 84 ++++++++++++++++------- assignments/final/module-1.png | Bin 0 -> 71492 bytes assignments/final/module-1.puml | 143 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 204 insertions(+), 23 deletions(-) create mode 100644 assignments/final/module-1.png create mode 100644 assignments/final/module-1.puml (limited to 'assignments/final') diff --git a/assignments/final/README.md b/assignments/final/README.md index bf8f91e..ce61fd9 100644 --- a/assignments/final/README.md +++ b/assignments/final/README.md @@ -31,29 +31,65 @@ physicians have a specialty and a pager number, and patients have a contact date (date of the first contact with the hospital). Some people may belong to two or more of these groups at a given time (e.g., patient and volunteer). -Patient: A person who is either admitted to the hospital, or is registered in an outpatient program. One, and only one, physician is responsible for each patient. Patients are divided into two groups: resident and outpatient. Each outpatient is scheduled for zero or more visits. The entity visit has two attributes: date (partial identifier), and comments. Note that an instance of visit cannot exist without an outpatient owner entity. Only resident patients are assigned to a bed, and a bed may or may not be assigned to a patient. - -Physician: A member of the hospital staff who may admit patients to the hospital, and who can administer medical treatments. A given physician can be responsible for zero or more patients at a given time. - -A patient must be referred to the hospital by exactly one physician. A physician can refer any number of patients, or may not refer any patient. - -Physicians may perform any number of treatments on behalf of any number of patients, or may not perform any treatment. A patient may have treatments performed by any number of physicians. For each treatment performed on behalf of a given patient by a particular physician, the hospital records the treatment date, treatment time, and results. - -Employee: Any person employed as part of the hospital staff. Employees are subdivided into three groups: nurse, staff, and technician. Only nurse has the attribute certificate, which indicates a qualification (RN, LPN, etc.). Only staff has the attribute job class, and only technician has the attribute skill. Each nurse is assigned to one (and only one) care centre. Each technician is assigned to one or more laboratories. - -Care centre: A treatment centre within the hospital. Examples of care centres are maternity, emergency, and cardiology. Attributes of care centre are name (identifier) and location. A care centre may have one or more nurses assigned to it. Also, one of the nurses assigned to each care centre is appointed nurse-in-charge. A nurse cannot be appointed nurse-in-charge of a care centre unless s/he has an RN certificate. - -Each hospital employee is assigned to work in one or more care centre. Each care centre has at least one employee, and may have any number of employees. The hospital records the number of hours per week that a given employee works in a particular care centre. Each physician can be assigned to one or more care centres, and a care centre can have one or more physicians assigned to it. - -Laboratory: A unit in the hospital where clinical tests (i.e., blood, urine, tissue, etc.) are performed to obtain information about the health of a patient. Attributes of laboratory include name (identifier) and location. A laboratory must have one or more technicians assigned to it. - -Bed: A hospital bed that may be assigned to a resident patient who is admitted to the hospital. Each bed has a bed number, a room number, and a care centre ID. There may be no bed assigned to a care centre, or a care centre may have one or more beds assigned to it. - -Item: Any medical or surgical item that is used in treating a patient. Each item has an item number, description, and unit cost. - -A patient may optionally consume any number of items. A given item may be consumed by one or more patients, or may not be consumed. For each item consumed by a patient, the hospital records the date, time, quantity, and total cost (which can be computed by multiplying quantity by unit cost). - -Treatment: Any test or procedure performed by a physician on behalf of a patient. Each treatment has a treatment ID, which consists of a treatment number and a treatment name. +Patient: A person who is either admitted to the hospital, or is registered in an outpatient program. +One, and only one, physician is responsible for each patient. +Patients are divided into two groups: resident and outpatient. +Each outpatient is scheduled for zero or more visits. +The entity visit has two attributes: date (partial identifier), and comments. +Note that an instance of visit cannot exist without an outpatient owner entity. +Only resident patients are assigned to a bed, and a bed may or may not be assigned to a patient. + +Physician: A member of the hospital staff who may admit patients to the hospital, +and who can administer medical treatments. +A given physician can be responsible for zero or more patients at a given time. + +A patient must be referred to the hospital by exactly one physician. +A physician can refer any number of patients, or may not refer any patient. + +Physicians may perform any number of treatments on behalf of any number of patients, +or may not perform any treatment. +A patient may have treatments performed by any number of physicians. +For each treatment performed on behalf of a given patient by a particular physician, +the hospital records the treatment date, treatment time, and results. + +Employee: Any person employed as part of the hospital staff. +Employees are subdivided into three groups: nurse, staff, and technician. +Only nurse has the attribute certificate, which indicates a qualification (RN, LPN, etc.). +Only staff has the attribute job class, and only technician has the attribute skill. + +Each nurse is assigned to one (and only one) care centre. +Each technician is assigned to one or more laboratories. + +Care centre: A treatment centre within the hospital. +Examples of care centres are maternity, emergency, and cardiology. +Attributes of care centre are name (identifier) and location. +A care centre may have one or more nurses assigned to it. +Also, one of the nurses assigned to each care centre is appointed nurse-in-charge. +A nurse cannot be appointed nurse-in-charge of a care centre unless s/he has an RN certificate. + +Each hospital employee is assigned to work in one or more care centre. +Each care centre has at least one employee, and may have any number of employees. +The hospital records the number of hours per week that a given employee works in a particular care centre. +Each physician can be assigned to one or more care centres, +and a care centre can have one or more physicians assigned to it. + +Laboratory: A unit in the hospital where clinical tests (i.e., blood, urine, tissue, etc.) are performed to obtain information about the health of a patient. +Attributes of laboratory include name (identifier) and location. +A laboratory must have one or more technicians assigned to it. + +Bed: A hospital bed that may be assigned to a resident patient who is admitted to the hospital. +Each bed has a bed number, a room number, and a care centre ID. +There may be no bed assigned to a care centre, or a care centre may have one or more beds assigned to it. + +Item: Any medical or surgical item that is used in treating a patient. +Each item has an item number, description, and unit cost. + +A patient may optionally consume any number of items. +A given item may be consumed by one or more patients, or may not be consumed. +For each item consumed by a patient, the hospital records the date, time, quantity, and total cost (which can be computed by multiplying quantity by unit cost). + +Treatment: Any test or procedure performed by a physician on behalf of a patient. +Each treatment has a treatment ID, which consists of a treatment number and a treatment name. **Is the ability to model subtype/supertype relationships likely to be important in a hospital environment such as the RVH?** @@ -81,6 +117,8 @@ requiring an associated outpatient owner entity. **Draw an EER diagram to accurately represent this set of requirements. State any assumption you had to make in developing the diagram.** + ![EER](./module-1.png) + **Are there any universal data models that can be reused as a starting point for modeling RVH’s data requirements?** ## Project Module 2 diff --git a/assignments/final/module-1.png b/assignments/final/module-1.png new file mode 100644 index 0000000..85ea86f Binary files /dev/null and b/assignments/final/module-1.png differ diff --git a/assignments/final/module-1.puml b/assignments/final/module-1.puml new file mode 100644 index 0000000..95c2ac3 --- /dev/null +++ b/assignments/final/module-1.puml @@ -0,0 +1,143 @@ +@startuml +!define Table(name,desc) class name as "desc" << (T,#FFAAAA) >> +!define primary_key(x) x +!define foreign_key(x) x +!define unique(x) x +!define not_null(x) x +hide methods +hide stereotypes + +' entities +Table(beds, "beds") { + primary_key(id) + foreign_key(patient_id) + bed_number + room_number + care_centre_id +} + +Table(care_centres, "care_centres") { + primary_key(id) + name + location +} + +Table(care_centres_employees, "care_centres_employees") { + primary_key(care_centre_id) + primary_key(employee_id) + in_charge +} + +Table(consumptions, "consumptions") { + primary_key(id) + foreign_key(item_id) + foreign_key(patient_id) + consumed_at + quantity + total_cost +} + +Table(employees, "employees") { + primary_key(person_id) + type + hired_at +} + +Table(items, "items") { + primary_key(id) + foreign_key(patient_id) + number + description + unit_cost +} + +Table(laboratories, "laboratories") { + primary_key(id) + location +} + +Table(laboratories_technicians, "laboratories_technicians") { + foreign_key(technician_id) + foreign_key(laboratory_id) +} + +Table(nurses, "nurses") { + primary_key(employee_id) + certificate +} + +Table(patients, "patients") { + primary_key(person_id) + contacted_at + foreign_key(referred_by_physician_id) + foreign_key(physician_id) +} + +Table(people, "people") { + primary_key(id) + not_null(name) + address + birth_date + phone_number +} + +Table(physicians, "physicians") { + primary_key(employee_id) + specialty + pager_number +} + +Table(staff, "staff") { + primary_key(employee_id) + job_class +} + +Table(technicians, "technicians") { + primary_key(employee_id) + skill +} + +Table(treatments, "treatments") { + primary_key(id) + number, + name, + foreign_key(patient_id) + foreign_key(physician_id) + occurred_at + results +} + +Table(visits, "visits") { + primary_key(id) + foreign_key(patient_id) + comments + scheduled_at +} + +Table(volunteers, "volunteers") { + primary_key(person_id) + skill +} + +' relationships +beds --> patients : "belongs to" +care_centres_employees --> care_centres : "belongs to" +care_centres_employees --> employees : "belongs to" +consumptions --> items : "belongs to" +consumptions --> patients : "belongs to" +employees --> people : "is a" +items --> patients : "belongs to" +laboratories_technicians --> laboratories : "belongs to" +laboratories_technicians --> technicians : "belongs to" +nurses --> employees : "is a" +patients --> people : "is a" +patients --> physicians : "belongs to" +physicians --> employees : "is a" +staff --> employees : "is a" +technicians --> employees : "is a" +treatments --> patients : "belongs to" +treatments --> physicians : "belongs to" +visits --> patients : "belongs to" +volunteers --> people : "is a" + +@enduml -- cgit v1.2.3