Peer Graded Assignment Data Analytics

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

Table of Contents

Part 1:

Conceptual Model:.....................................................................................................................................1
Part 2: Relational Data Model.....................................................................................................................3
Normalization of Database......................................................................................................................3
Primary Keys , Foreign Keys and Data......................................................................................................4
Part 3: SQL Queries......................................................................................................................................4
Query 1:...................................................................................................................................................5
Query 2:...................................................................................................................................................5
Part 4: Sensitive Data and Data Quality Issues............................................................................................5
Conceptual Model:
A conceptual model describes how an industry / business functions. It identifies important
concepts in a business and map them with the relationship between them. We have selected a
Hospital system for our business model with following assumptions.
The hospital has different wards and each ward has different number of beds. Patients are
referred to the hospital through their local doctors. Bio data of patients including of their next
to kin will be captured. Local Doctors will refer Patients to the Hospital. Patients will take
appointment with the hospital staff who will refer them to a ward if required. Hospital staff is
of different types with different qualification and contract period including special staff with
different specialties. Staff is assigned to different wards as per their duty roster. For security
reasons, all the activities of staff on the system will be logged.
In the following diagram, we have drawn a conceptual business model for a hospital system
meeting above requirements. We have shown the cardinality information among different
concepts in this model :-

Figure: Shows the conceptual model of hospital system


Part 2: Relational Data Model
Following ER diagram, models the above conceptual business model.

Figure: Shows the Relational Data Model (ER Diagram) for our proposed system.

In this ER Diagram, different entities and the relationsips between them are modeled, different
attributes and cardinality relationships are also mentioned.
A LocalDoctor may refer many patients to the hospital, but a patient will be referred by only
one LocalDoctor. Patient may refer one of his/her nextofkin. A Patient may take many
appointments but one appointment will be for one patient only. A staff may give many
appointments but one appointment will be given by one staff only.An appointment may be
associated with one bed but one bed can be linked with many appointments. A ward may have
many patients but one patient will be assigned one ward. A ward may have many have beds but
one bed will lie in one ward only. A staff may be the part of many duty rosters at different
wards at different times but a roster may have many staff. A staff will have one to many
qualifications. And one qualification may be common for many staff. Therefore, a many to
many relationship exists, which has been converted to one to many and many to one by
introducing a new table QualificationStaff. A staff may contain many number of special staff but
each special staff will be a staff. Each staff will have one contract and each contract will be for
one staff only. Each staff will have one user_log for all of its activities and one log will be for one
staff.
Normalization of Database

The above model is normalized and is in 3NF.

All the tables have primary keys , no duplicate values so are in 1NF. All the tables have no
partial dependencies, most of the tables have single attribute primary key, while some has
composite primary key with out any non-key attributes. While some table, which have
composite primary key like Staff Roster, it has non-key attribute is_present which is fully
dependent on the primary key. Therefor, the whole schema is in 2 NF too.
Furthermore, there is no transitive dependency in any table because all non-key attributes are
directly dependent on primary key and all the tables are already in 2NF, therefor, all the tables
in the above model are in 3NF.

Primary Keys , Foreign Keys and Data

In all the tables, Primary Keys are labeled as PK. All these primary keys are natural primary keys.
Tables are linked with each other through Foreign Key constraint, which is shown through FK.
All the local doctors will be registered with central health agency, and the hospital will fetch
their records from government central database and will store them in LocalDoctor table.
Patients record will be stored in Patient table and this data will come from Patient. Patient will
inform about their Next of Kin, this data will be stored in NextofKin table.
Patients will get appointment from staff, this appointment related information will be stored in
Appointment table. Hospital has different wards and associated number of beds with them. All
this information about wards and beds will be stored in ward and bed tables.
The hospital will enter the information about all staff members, in Staff table, their qualification
information in Qualification table, their experience information in Experience table, their job
contract related information in Contract table, while information about specialist doctor with
their specialty will be stored in SpecialStaff table. For security reasons, all the activities of staff
will be logged in User_log table by the system automatically. Staff will be assigned to duty
roster, staff assigned duty roster information will be stored in StaffRoster and Roster tables.

Part 3: SQL Queries

In the following, we have defined two queries to fetch data from this data model.
Query 1:

Which Staff is currently allocated to each ward, grouped by ward. The sub query used above is
for getting latest data from the roster. This is a very useful and most used query in such model.
This query will be needed to assess the need of each ward and for the suitable allocation of
each staff.

Following query, provides this information.

SELECT COUNT(STAFF_NUMBER) AS ALLOCATED_STAFF ,WARD_NUMBER

FROM STAFFROSTER,ROSTER

WHERE

STAFFROSTER.ROSTER_NUMBER=ROSTER.ROSTER_NUMBER

and

ROSTER.ROSTERBEGINNING_DATE= (SELECT MAX(ROSTER.ROSTERBEGINNING_DATE)FROM


ROSTER )

GROUP BY WARD_NUMBER;

Query 2:

List of all patients referred to the hospital in the current month. This is also very important
query to assess the load, performance and working capacity of the hospital.

SELECT PATIENT_NUMBER, FIRST_NAME, LAST_NAME

FROM PATIENT

WHERE EXTRACT(month FROM DATE_REGISTERED) = EXTRACT(month FROM SYSDATE);


Part 4:
Following are issues which describe the sensitivity and quality of our data.

Sensitive data is protected by making sure the data privacy. Data privacy is ensured through
proper users authentication and access control. For this purpose, staffLogin table is created for
authenticating each user against has password. Furthermore, different rights are assigned to
different users for ensuring access control. In this regard, rights field is created in StaffLogin
table for assigning proper rights to each user for making sure, they can do what they are
allowed to do in the database, this leads to a proper access control mechanism. Moreover, in
order to keep on each user activity, User_log table is created to log activities of each table. All
these steps make sure data privacy and access control of sensitive data in our database through
our designed model.

Quality of data in each table is ensured through proper constraints, each table has unique
primary key, which ensures no duplication of data in each table. Not Null constraints will be
applied on each attribute whose value is must in the database. Foreign key constraints are
applied to link different tables with delete cascade effect. All data in our database will be
encrypted by default, in order to avoid from any leakage of data. All these steps will lead to
better quality and protection of data.

Further sensitive data is marked through identifying PII, CFI, CPNI, or PHI. In the following, we
have described the sensitivity of our data.

Personally Identifiable Information (PII)


Personally identifiable information (PII) is any data that can identify a person. In our model
following data lies in this category:-

In Patient table, first_name, last_name, dob, address(street_address,suburb,state,postcode),


t_number showing the telephone number.

In LocalDoctor table, full_name,address(street,suburb,state_code,post_code),t_number.

In NextofKin table,
first_name,last_name,address(street_address,suburb,state_code,post_code) and t_number.

In Staff table, first_name,last_name,address(street_address,suburb,state_code,post_code)


,t_number, tax_file_number .
Protected Health Information (PHI)
PHI refers to the protected data. PHI includes anything used in a medical context that can
identify patients. Following data lies in PHI:-

In Patient table, first_name, last_name, dob address(street_address,suburb,state,postcode),


t_number , health_condition.

Consumer Financial Information (CFI)


In Staff table, tax_file_number shows the tax number of staff. It lies in the category of CFI.

Customer Proprietary Network Information (CPNI)


 t_number field showing telephone number in Patient, Staff and LocalDoctor tables lies in the
category of CPNI information as it can tell what company network a user is using, what network
is mostly being used by people and other related questions.

You might also like