You are on page 1of 11

11th.April.

2008

The WellMeadows Hospital Case Study


Design by Michael, Chan and Xenophon

Assumptions for Case Study


Follow the information from the hospital to build up a draft conceptual model
without attributes. It has these entities and relationships: Staff, Qualification,
Experience, Contact, Ward, Surgical and non-surgical supplies, Pharmaceutical
supplies, Patient, Next-of-kin, In-Patient, Out-Patient, Local doctor, Supplier,
Staff allocation, Requisition, Ward required, Staff has, Appointment, Medication,
Supplies offer, Patient has, etc.
In relation to In and Out patient, they seem to be separated by examination
result. Because there are only 240 beds in the ward, so there is a need to set up
a waiting list for patients. We add Entity and Relationship: Examination Result
and Waiting List between Appointment and In-Patient, Out-Patient.
Every patient can have many local doctors, for that local doctor and patients
relation could be many to many. But because of this system is for hospital, local
doctors just being a patients case history, user just needs to know about the
patient have which local doctor . So we put one local doctor to many
patients.
The draft conceptual model has one relationship Staff has between Staff and
Qualification, Contact, Experience. Because not every staff member needs to
have experience before. So that we add more 2 relationship in there, make entity
and relationships can be an independent relation.
Due to In-patients and Out-patients having Next-of-kin, and similar attributes we
try to put them into a BIG patient area. Add attribute Waiting List Time to InPatient. That would be easier to understand the relation.
We assumed that one staff can have many appointments.
For the purpose of this case, In-patients medication should have pharmaceutical
and surgical or non-surgical supplies. Same as medication, requisition also
should have those entities. In draft Conceptual Model, 2 entities are separate;
we feel this is too messy, and confusing. So we decided to put them into a BIG
Supplies area. They have some attributes that are the same, but
Pharmaceutical supplies also have dosage and method.

Conceptual Data Model


We design this conceptual model base on CHEN Entity-Relationship Model (ER Model),
developed by Dr Peter Pin-Shan Chen. The diagram in below that is an appropriate
conceptual model after discussion and modify.

Logical Data Model


A Logical Data Model (LDM) is platform independent, not specific to any products. In the
diagram below, we transform from conceptual model to LDM with some rules.
Diagram (See Attachment 1)

Data Dictionary

Table

column name

keys

Appointment

Staff_ID

FK

Contract

Appointment_Tim
e
Appointment_NO

PK

Patient_NO

FK

Type
work_hrs
Salary_payment

Staff_ID
Experience

PK,FK

Position

Organization
Start_Date

Finish_Date

Staff_ID

Qualification

PK,FK

Date
type
Institute

Requisition

Staff_ID

PK,FK

Date_Order
Staff_ID

FK

Req_NO

PK

Drug_NO

FK

Surgical_ID

FK

Description/Alia
ses
Code relating to
the Staff table
The appointment
time
The ID for the
Appointment
record
Code relating to
the Patient table

Data
type
int
datetime
int
int

Type of contract,
permanent or
temporary
how many time
did they work
Money that
employees
receive for doing
their job
Code relating to
the Staff identifier

varchar(1
0)

Code relating to
the Position
identifier for the
position held by
the staff member
for this work
experience entry
The name of work
place
The date the staff
member
commenced
employment for
this work
experience entry
The date the staff
member finished
employment for
this work
experience entry
Code relating to
the Staff identifier
to whom this
work experience
record relates
When the
qualification is
got
Type of
qualification
The name of work
place
Code relating to
the Staff table

varchar(2
0)

Order date
Code relating to
the Staff table
The ID for the
Requisition record
that this item is
requisitioned on
Code relating to
the
Pharmaceutical
table
Code relating to

datetime
int

int
int

int

varchar(5
0)
datetime

datetime

int

datetime
varchar(2
0)
varchar(5
0)
int

int

Physical Model
The decision was made to build the database in SQL. This Physical Model is in the 3NF
normalization and its according to LDM rules.

Diagram:

SQL statements for creation:


USE [WellMeadow]
GO
/****** Object: Table [dbo].[Appointment]
******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Appointment](
[Staff_ID] [int] NOT NULL,

Script Date: 04/11/2008 12:04:11

[Appointment_Time] [datetime] NOT NULL,


[Appointment_NO] [int] NOT NULL,
[Patient_NO] [int] NOT NULL,
CONSTRAINT [PK_Appointment] PRIMARY KEY CLUSTERED
(
[Appointment_NO] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
USE [WellMeadow]
GO
ALTER TABLE [dbo].[Appointment]
WITH CHECK
[FK_Appointment_Staff] FOREIGN KEY([Staff_ID])
REFERENCES [dbo].[Staff] ([Staff_ID])

ADD

CONSTRAINT

USE [WellMeadow]
GO
/****** Object: Table [dbo].[Contract]
Script Date: 04/11/2008 12:04:35
******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Contract](
[Type] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
[Work_Hrs] [int] NULL,
[Salary_Payment] [int] NULL,
[Staff_ID] [int] NOT NULL,
CONSTRAINT [PK_Contract] PRIMARY KEY CLUSTERED
(
[Staff_ID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
USE [WellMeadow]
GO
ALTER TABLE [dbo].[Contract]
WITH
[FK_Contract_Staff] FOREIGN KEY([Staff_ID])

CHECK

ADD

CONSTRAINT

REFERENCES [dbo].[Staff] ([Staff_ID])


USE [WellMeadow]
GO
/****** Object: Table [dbo].[Experience]
Script Date: 04/11/2008 12:04:50
******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Experience](
[Position] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
[Organization] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
[Start_Date] [datetime] NULL,
[Finish_Date] [datetime] NULL,
[Staff_ID] [int] NOT NULL,
CONSTRAINT [PK_Experience] PRIMARY KEY CLUSTERED
(
[Staff_ID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
USE [WellMeadow]
GO
ALTER TABLE [dbo].[Experience]
WITH CHECK
[FK_Experience_Staff] FOREIGN KEY([Staff_ID])
REFERENCES [dbo].[Staff] ([Staff_ID])
USE [WellMeadow]
GO
/****** Object: Table [dbo].[Qualification]
******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Qualification](

ADD

CONSTRAINT

Script Date: 04/11/2008 12:05:25

[Date] [datetime] NULL,


[Type] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
[Institute] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
[Staff_ID] [int] NOT NULL,
CONSTRAINT [PK_Qualification] PRIMARY KEY CLUSTERED
(
[Staff_ID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
USE [WellMeadow]
GO
ALTER TABLE [dbo].[Qualification]
WITH CHECK
[FK_Qualification_Staff] FOREIGN KEY([Staff_ID])
REFERENCES [dbo].[Staff] ([Staff_ID])

ADD

CONSTRAINT

USE [WellMeadow]
GO
/****** Object: Table [dbo].[Requisition]
Script Date: 04/11/2008 12:05:36
******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Requisition](
[Date_Order] [datetime] NULL,
[Staff_ID] [int] NULL,
[Req_NO] [int] NOT NULL,
CONSTRAINT [PK_Requisition] PRIMARY KEY CLUSTERED
(
[Req_NO] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
USE [WellMeadow]
GO
ALTER TABLE [dbo].[Requisition]
WITH CHECK
[FK_Requisition_Staff] FOREIGN KEY([Staff_ID])
REFERENCES [dbo].[Staff] ([Staff_ID])

ADD

CONSTRAINT

USE [WellMeadow]
GO
/****** Object: Table [dbo].[Staff] Script Date: 04/11/2008 12:05:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Staff](
[Staff_ID] [int] NOT NULL,
[Sex] [real] NULL,
[Last_name] [varchar](15) COLLATE Chinese_PRC_CI_AS NULL,
[First_name] [varchar](15) COLLATE Chinese_PRC_CI_AS NULL,
[NIN] [int] NULL,
[Position] [varchar](10) COLLATE Chinese_PRC_CI_AS NULL,
[DOB] [datetime] NULL,
[Address] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
[Salary_Scale] [int] NULL,
[Current_Salary] [int] NULL,
[Phone] [int] NULL,
CONSTRAINT [PK_Staff] PRIMARY KEY CLUSTERED
(
[Staff_ID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
USE [WellMeadow]
GO
/****** Object: Table [dbo].[Staff_Allocation]
Script Date: 04/11/2008
12:06:03 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Staff_Allocation](
[Shift] [varchar](5) COLLATE Chinese_PRC_CI_AS NULL,
[Staff_ID] [int] NULL,
[Ward_NO] [int] NOT NULL,

CONSTRAINT [PK_Staff_Allocation] PRIMARY KEY CLUSTERED


(
[Ward_NO] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
USE [WellMeadow]
GO
ALTER TABLE [dbo].[Staff_Allocation]
WITH CHECK ADD
[FK_Staff_Allocation_Staff] FOREIGN KEY([Staff_ID])
REFERENCES [dbo].[Staff] ([Staff_ID])

CONSTRAINT

Possible Enterprise Constraints


For this case, we should consider about the total numbers of bed in ward. There are 240
beds in ward. No more than 240 patients can be In-patient at any of time. When there
are over 240 patients, the system should put them into waiting list.

Transaction Analysis
Transaction/

(a)

(b)

(c)

Insert

Read

Read

Relation
Staff
Requisition
Staff_Allocation
Qualification

Read
Insert

Read

Appointment
Contract

Insert

Experience

Insert

Read

(a) Create and maintain records recording the details of members of staff ( Personnel
Officer )
(b) Search for staff who have particular qualifications or previous work experience
( Personnel Officer )
(c) Produce a report listing the details of staff allocated to each ward ( Personnel
Officer )

Security
For consideration of security in this RDBMS will set these Users to manage it:

SUPERVISOR
This user have global authority can operate whole RDBMS.
e.g. (sa at mssql, root at mysql)

BACKUP OPERATOR
This user has responsibility to backup the whole system, so this user can readonly all tables in this RDBMS.

PERSONAL OFFICER
This user has responsible for ensuring that the appropriate staffs are allocated
to each ward. For that this user can operate this table: staff_allocation.

MEDICAL DIRECTOR
This user has overall responsibility for the management of the hospital, including
staff, beds and supplies. Therefore this user can operate these tables: staff,
ward, requisition, surgical Non-Surgical supplies and Pharmaceutical supplies.

CHARGE NURSE
This user is responsible to manage all resources (staff, beds, and supplies) are
used effectively in the care of patients. So this user can operate these tables:
staff_allocation, surgical Non-surgical supplies, pharmaceutical supplies,
requisition, ward_required.

Comment on the design decision that we made

Area

Appropriate Decisions

Justification Provided

Securit

There are 5 different secretly

Different stuff can operate different

level in the database

tables. For the security reason. If just


have one security level will cause

security problem.
Staff

Experience, Contract,

At the beginning, we connect Staff

Qualification have their own

with the Experience, Contract,

relationship

Qualification, and during the design,

connect to Staff.

we found that there are three


relationships between them, so we
modify there to have 3 relationships.
That would be more comprehensible.

Patient

On conceptual Model, we put

As Conceptual Model, it should easy to

In-patient and out-patient into

understand and can express clearly

a big Patient area. Most of

the meaning of the diagram. Follow

attributes are link to this big

the information, in this system should

Patient area. Relationship

have at least 3 patients: In-patient,

Ward_Required and

Out-patient and normal patient. If put

medication are link

this 3 parts in different places, that

to In-patient. And there is

would make reader confuse, and the

some relationship link to the

relation of the system will getting

big Patient area.

messy. Because of they have some


same attributes, so we put them in
one Patient area to share some
public attributes and some
relationships. But some special
attributes and relationships still link to
the right Entity. That solution would be
easier to understand this diagram.

You might also like