• Non ci sono risultati.

Database Design:Use case requirements

N/A
N/A
Protected

Academic year: 2021

Condividi "Database Design:Use case requirements"

Copied!
29
0
0

Testo completo

(1)

DB M G

Conceptual design

Database Design:

Use case requirements

(2)

DB M G

2

Problem requirements

It is needed to design a database for the

management of a system of booking medical

examinations within a Local Health Company (LHC), taking into account the following information.

Each patient is characterized by a Social Secure

Number (SSN), first name, last name, address, date of birth, place of birth and age.

Each hospital is characterized by a numeric code, a name and an address.

(3)

DB M G

3

ER schema

SSN Name Surname

Address

PlaceB.

DateB.

Age

Patient

Hospital

HCode Name Address

(4)

DB M G

4

Problem requirements

Each hospital is organized in wards identified by a numeric code unique within the hospital. Each ward is also characterized by the name and

phone number.

The ward's staff is identified through the SSN.

The first name, last name and home address are also known. Among the staff, in the case of the doctors, the list of specializations achieved is

known, while for the volunteer staff the name of the association of belonging is known (if

available).

(5)

DB M G

5

ER schema

SSN Name Surname

Address

PlaceB.

DateB.

Age

Patient

Hospital Ward

HCode Name Address

Name Phone#

(1,1) (1,N)

Has

Ward Code (p,e)

Staff

Doctor Volunteer

Works in

SSN Surname Name Address Association

(0,1)

Specialization (0,N)

(1,1)

(1,N)

(6)

DB M G

6

Problem requirements

Medical examinations that can be performed are characterized by a numeric code and a textual

description (e.g. X-ray, etc.). In the case of specialist examinations, the doctor who makes the visit and the description of the diet to be followed (if

necessary) is also stored.

The laboratories that perform the examinations are identified by a code unique within the hospital and are characterized by the laboratory name, location plan and room number.

(7)

DB M G

7

ER schema

SSN Name Surname

Address

PlaceB.

DateB.

Age

(p,e)

Patient

Hospital

Exam

Ward Specialistic

Exam

HCode Name Address

Name Phone#

(1,1) (1,N)

Has

Ward Code (p,e)

Staff

Doctor Volunteer

Works in

SSN Surname Name Address Association

(0,1)

Specialization (0,N)

(1,1)

(1,N) Description

ExamCode Diet description

(0,1)

(1,1)

(0,N)

Made by

Room#

Floor

Has

Laboratory

(1,1)

(0,N) LabCod

LabName

(8)

DB M G

8

Problem requirements (time representation)

For each member of the laboratory staff, the

days and laboratories in which he/she serves are stored. Keep in mind that each member of staff can serve in multiple laboratories during the same day.

(9)

DB M G

9

A reservation is required to make an examination.

For each booking of an examination done by a patient, the database stores the date and time of the examination, the laboratory where it is

performed, the cost of the ticket and whether such an examination is prescribed urgently. Keep in

mind that each patient can make multiple bookings of the same exam on different dates. Also note

that the same examination cannot be repeated on the same day by the same patient, even in

different laboratories.

Problem requirements (time representation)

(10)

DB M G

10

Each doctor can take on different roles during his career (e.g. assistant, primary, etc.). You want to keep track of the roles taken by each doctor

throughout their career and the time periods in which they took on those roles (start date, end date). Keep in mind that each doctor cannot take on multiple roles at the same time, while he can assume the same role at different time periods.

Problem requirements (time representation)

(11)

DB M G

Conceptual design

Design example:

time representation

(12)

DB M G

12

Time representation

It is necessary to explicitly represent the elapsing of time in the case of

representation of events

variation of entity or attribute information over time

Several representations are possible N-ary relationship with a time entity A time history entity

binary relationship with a time entity

(13)

DB M G

Conceptual design

Design example:

Time representation (I)

N-ary relationship with a time entity

(14)

DB M G

14

Problem requirements (time representation)

For each member of the laboratory staff, the

days and laboratories in which he/she serves are stored. Keep in mind that each member of staff can serve in multiple laboratories during the same day.

(15)

DB M G

15

Relationship Working in

SSN Name Surname

Address

PlaceB.

DateB.

Age

(p,e)

Patient

Hospital

Exam

Ward Specialistic

Exam

HCode Name Address

Name Phone#

(1,1) (1,N)

Has

Ward Code (p,e)

Staff

Doctor Volunteer

Works in

SSN Surname Name Address Association

(0,1)

Specialization (0,N)

(1,1)

(1,N) Description

ExamCode Diet description

(0,1)

(1,1)

(0,N)

Made by

Room#

Floor

Has

Laboratory

(1,1)

(0,N) LabCod

LabName (0,N) (0,N)

Working in

Duration Start Time

Date

(1,N)

Time

(16)

DB M G

Conceptual design

Design example:

Time representation (II)

Time history entity

(17)

DB M G

17

Booking representation

A reservation is required to make an examination.

For each booking of an examination done by a patient, the database stores the date and time of the examination, the laboratory where it is

performed, the cost of the ticket and whether such an examination is prescribed urgently. Keep in mind that each patient can make multiple bookings of the same exam on different dates. Also note that the same examination cannot be repeated on the same day by the same patient, even in different

laboratories.

(18)

DB M G

18

Cardinality of relationship Books

SSN Name Surname

Address

PlaceB.

DateB.

Age

(p,e)

Patient

Hospital

Exam

Ward Specialistic

Exam

HCode Name Address

Name Phone#

(1,1) (1,N)

Has

Ward Code (p,e)

Staff

Doctor Volunteer

Works in

SSN Surname Name Address Association

(0,1)

Specialization (0,N)

(1,1)

(1,N) Description

ExamCode Diet description

(0,1)

(1,1)

(0,N)

Made by

Room#

Floor

Dispone di

Laboratory

(1,1)

(0,N) LabCod

LabName (0,N) (0,N)

Working in

Duration Start Time

Date

(1,N)

Time Time

Date

Books

(1,N) (0,N)

(0,N) (1,?)

(19)

DB M G

19

Constraints on booking

A reservation is required to make an

examination. For each booking of an examination by a patient you want to store the date and time of the examination, the laboratory where it is

performed, the cost of the ticket and whether such an examination is prescribed urgently. Keep in mind that each patient can make multiple

bookings of the same exam on different dates.

Also note that the same examination cannot be

repeated on the same day by the same patient,

even in different laboratories.

(20)

DB M G

20

Booking representation

SSN Name Surname

Address

PlaceB.

DateB.

Age

(p,e)

Patient

Hospital

Exam

Ward Specialistic

Exam

HCode Name Address

Name Phone#

(1,1) (1,N)

Has

Ward Code (p,e)

Staff

Doctor Volunteer

Works in

SSN Surname Name Address Association

(0,1)

Specialization (0,N)

(1,1)

(1,N) Description

ExamCode Diet description

(0,1)

(1,1)

(0,N)

Made by

Room#

Floor

Dispone di

Laboratory

(1,1)

(0,N) LabCod

LabName (0,N) (0,N)

Working in

Duration Start Time

Date

(1,N)

Time Time

Date

Books

(1,N) (0,N)

(0,N) (1,1)

(21)

DB M G

21

Introduction of the entity Booking

SSN Name Surname

Address

PlaceB.

DateB.

Age

(p,e)

Patient

Hospital

Exam

Ward Specialistic

Exam

HCode Name Address

Name Phone#

(1,1) (1,N)

Has

Ward Code (p,e)

Staff

Doctor Volunteer

Works in

SSN Surname Name Address Association

(0,1)

Specialization (0,N)

(1,1)

(1,N) Description

ExamCode Diet description

(0,1)

(1,1)

(0,N)

Made by

Room#

Floor

Dispone di

Laboratory

(1,1)

(0,N) LabCod

LabName (0,N) (0,N)

Working in

Duration Start Time

Date

(1,N)

Time Booking

(22)

DB M G

22

Refinement of the entity Booking

SSN Name Surname

Address

PlaceB.

DateB.

Age

(p,e)

Patient

Hospital

Exam

Ward Specialistic

Exam

HCode Name Address

Name Phone#

(1,1) (1,N)

Has

Ward Code (p,e)

Staff

Doctor Volunteer

Works in

SSN Surname Name Address Association

(0,1)

Specialization (0,N)

(1,1)

(1,N) Description

ExamCode Diet description

(0,1)

(1,1)

(0,N)

Made by

Room#

Floor

Dispone di

Laboratory

(1,1)

(0,N) LabCod

LabName (0,N) (0,N)

Working in

Duration Start Time

Date

(1,N)

Time Booking

Hour Cost Urgent

Per

Date

(23)

DB M G

23

Refinement of the entity Booking

SSN Name Surname

Address

PlaceB.

DateB.

Age

(p,e)

Patient

Hospital

Exam

Ward Specialistic

Exam

HCode Name Address

Name Phone#

(1,1) (1,N)

Has

Ward Code (p,e)

Staff

Doctor Volunteer

Works in

SSN Surname Name Address Association

(0,1)

Specialization (0,N)

(1,1)

(1,N) Description

ExamCode Diet description

(0,1)

(1,1)

(0,N)

Made by

Room#

Floor

Dispone di

Laboratory

(1,1)

(0,N) LabCod

LabName (0,N) (0,N)

Working in

Duration Start Time

Date

(1,N)

Time Booking

Hour Cost

Urgent (1,1)

(1,1)

Makes

Per

Made

(0,N)

(1,N) (0,N)

(1,1) Date

(24)

DB M G

Conceptual design

Design example:

Time representation (III)

Binary relationship with a time entity

(25)

DB M G

25

Relashionship between Doctor and Role

Each doctor can take on different roles during his career (e.g. assistant, primary, etc.). The

database keeps track of the roles taken by each doctor throughout their career and the time

periods in which the doctor took on each role (start date, end date). Keep in mind that each doctor cannot take on multiple roles at the same time, while he can assume the same role at

different time periods.

(26)

DB M G

26

Refinement of relationship Take on

SSN Name Surname

Address

PlaceB.

DateB.

Age

(p,e)

Patient

Hospital

Exam

Ward Specialistic

Exam

HCode Name Address

Name Phone#

(1,1) (1,N)

Has

Ward Code (p,e)

Staff

Doctor Volunteer

Works in

SSN Surname Name Address Association

(0,1)

Specialization (0,N)

(1,1)

(1,N) Description

ExamCode Diet description

(0,1)

(1,1)

(0,N)

Made by

Room#

Floor

Dispone di

Laboratory

(1,1)

(0,N) LabCod

LabName (0,N) (0,N)

Working in

Duration Start Time

Date

(1,N)

Time Booking

Hour Cost

Urgent (1,1)

(1,1)

Makes

Per

Made

(0,N)

(1,N) (0,N)

(1,1) Date

(1,N)

Time

Stop Date (0,1) Start Date

Role

Takes on Role

(0,N) (1,N)

(27)

DB M G

27

Constraints on relationship Takes on

Each doctor can take on different roles during his career (e.g. assistant, primary, etc.). You want to keep track of the roles taken by each doctor

throughout their career and the time periods in which they took on those roles (start date, end date).

Keep in mind that each doctor cannot take

on multiple roles at the same time, while he can

assume the same role at different time periods.

(28)

DB M G

28

Data history of relationship Take on

SSN Name Surname

Address

PlaceB.

DateB.

Age

(p,e)

Patient

Hospital

Exam

Ward Specialistic

Exam

HCode Name Address

Name Phone#

(1,1) (1,N)

Has

Ward Code (p,e)

Staff

Doctor Volunteer

Works in

SSN Surname Name Address Association

(0,1)

Specialization (0,N)

(1,1)

(1,N) Description

ExamCode Diet description

(0,1)

(1,1)

(0,N)

Made by

Room#

Floor

Dispone di

Laboratory

(1,1)

(0,N) LabCod

LabName (0,N) (0,N)

Working in

Duration Start Time

Date

(1,N)

Time Booking

Hour Cost

Urgent (1,1)

(1,1)

Makes

Per

Made

(0,N)

(1,N) (0,N)

(1,1) Date

(1,N)

Time

Stop Date (0,1) Start Date

Role

Takes on Role

(0,N) (1,N)

(29)

DB M G

29

Refinement of relationship Take on

SSN Name Surname

Address

PlaceB.

DateB.

Age

(p,e)

Patient

Hospital

Exam

Ward Specialistic

Exam

HCode Name Address

Name Phone#

(1,1) (1,N)

Has

Ward Code (p,e)

Staff

Doctor Volunteer

Works in

SSN Surname Name Address Association

(0,1)

Specialization (0,N)

(1,1)

(1,N) Description

ExamCode Diet description

(0,1)

(1,1)

(0,N)

Made by

Room#

Floor

Dispone di

Laboratory

(1,1)

(0,N) LabCod

LabName (0,N) (0,N)

Working in

Duration Start Time

Date

(1,N)

Time Booking

Hour Cost

Urgent (1,1)

(1,1)

Makes

Per

Made

(0,N)

(1,N) (0,N)

(1,1) Date

(1,N)

Time

Stop Date (0,1) Start Date

Takes on

(1,N)

Role

Riferimenti

Documenti correlati

Come si è visto il giudice penale, investito dell’azione civile, laddove abbia gli elementi per decidere anche sul quantum del risarcimento, deve provvedere in questo

transition to vocational schools (PTU) where the term of study significantly increased (up to 3-4 years), based on 8 years of school education, allowed to train specialists that

Then we have studied the abundance gradients along the Galactic disk produced by our best cosmological model and their dependence upon several parameters: a threshold in the surface

We prepared a series of N-substituted tryptamines and identified two compounds acting, respectively, as an activator (21) or an inhibitor (12) of calcium influx in

THEN I START TO ANALYSIS THE GROWTH OF THE PALACE ITSELF, I FIND THAT IT ALWAYS STARTS FROM A SPECIFIC POINT, WHEN FEW POINTS ARE FINISHED, PEOPLE START TO

Case #1 and Case #2 occurred one week apart and shared other clinical features: laboratory tests confirmed COVID-19 exposure and high inflammatory activation with

Highest share of workers contacted several times during leisure time with direct action required in Finland In 2019, the majority of the employed (59%) in the EU reported not

2) compute the transposed matrix of a given input matrix of size NxN 3) given a rectangular input matrix M, write a function