You are on page 1of 6

Running head: WK4PROJP1HALLA

Health First EMR Project: CMIS 3002


Aaron Hall
Group A 1
Walden University

Analysis
Once we began entering data into the tables, I realized there was a design flaw in
our database. When we first created the RECORD entity, we had chosen foreign keys for
HISTORY, VITALS, LAB, and MEDICATION. Upon further examination, we realized
this created data integrity issues since each client could have multiple entries in each of
these tables, and the RECORD foreign keys could only reference a single instance. We
decided the best solution was adding a master record for each of these entities which
could provide access to the many records. We added HISTORY_RECORD,
VITALS_RECORD, LAB_RECORD, and MEDICATION_RECORD as the bridge

WK4PROJP1HALLA
tables. Each of the entities HISTORY, VITALS, LAB, and MEDICATION were then
adapted by adding a new primary key and the foreign key to the master record. Another
problem arose from a similar referential integrity issue with claims which were linked to
RECORD using the CLAIM_ID foreign key. A correction was made by adding an
ACCOUNT entity and ACCT_ID as a foreign key in RECORD to replace claim. The
ACCT_NUMBER foreign key was then added to CLAIM which allowed many claims to
be associated with a single account. The final change used to correct referential and data
integrity issues was associated with the PAYER table. The PAYER table was referenced
from the RECORD using the foreign key PAYER_ID. Patients may have a primary and
a secondary payer, and the foreign key only allowed a single association to PAYER. To
correct the situation, two attributes were added to the ACCOUNT entity to support the
situation, PRIMARY_PAYER and SECONDARY_PAYER which are both foreign keys
related to PAYER_ID.
The constraint violations identified that led to this conclusion are listed in the
chart on the next page. Once all of the corrections and additions were made, there were
no further constraint or data integrity violations. I have also added an updated UML
diagram for the database on the last page.

WK4PROJP1HALLA
Project Name: Health First EMR database project
Version No.: 1.0
Submitted By: Aaron Hall

CONSTRAINT
NAME
PAT_REC_FK

CONSTRAINT
TYPE
FOREIGN KEY

VIOLATION ERROR

REC_PAT_FK

FOREIGN KEY

Integrity constraint
(SYSTEM.SYS_C000757)
violated Parent key not
found

Integrity constraint
(SYSTEM.PAT_REC_FK)
violated - Parent key not
found

SOLUTION
APPLIED.
Removed foreign
key from Patient
table for
REC_ID, and
added PAT_ID as
foreign key to
RECORD table.
This allows the
patient to be
created before
they are assigned
a clinical record
in the database.
There was an
error in my script
that kept the
object from being
created and
caused the
reference to fail.

WK4PROJP1HALLA
DATA TYPE

VARCHAR2(20)

Value larger than specified


precision allowed for this
column.

DATA TYPE

NUMBER(3,2)

Value larger than specified


precision allowed for this
column.

Verified By: Kimberly Roberts, Eric Saff


Constraint Violation Document Template

I had entered one


too many
numbers for the
job code.
Corrected in my
script and ran it
again.
I needed 5,2 for
the numeric
value to
accommodate a
number in the
hundreds with a
decimal place of
two. I used
ALTER TABLE
to correct.

Running head: WK4PROJP1HALLA

WK4PROJP1HALLA

You might also like