Académique Documents
Professionnel Documents
Culture Documents
Page 2 of 48
I- Database Requirements
1) Background
The pharmaceutical manufacturing company uses different type of solvents (alcohols) for
the preparation of polymer solutions or suspensions, which are then sprayed into the solid
dosage form (i.e. pellets, powders) for the proper coating. These solvents are dispensed
from a central tank farm to a number of different PSP (polymer solution preparation)
rooms throughout the company. Within those rooms, there are tanks that receive the
solvents and where the solution is then prepared according to a manufacturing recipe.
The existing PSP rooms have an obsolete control platform and the solvent dispensing
data and records are not electronically stored. Also, the solution preparation process is
manually driven, as all required process parameter setpoint are manually entered. A
project is currently underway to upgrade and network the control systems for the PSP
Rooms. The scope of this project is to design the central database that will store and
maintain the relevant PSP Room information under the new controls architecture.
1. Users: Users of the system can perform functions within the control
application depending on their assigned access role. These roles are;
operator, mechanic, supervisor, engineer, administrator. Every user belongs
to a specific department. Information to be kept and maintained for users
includes the userid, name, role, department information. It is also important
to maintain the Status of the user account as Active (meaning the user can
access or use the system) or Inactive which could mean that the employee
has lost access or is no longer with the company.
2. Room: It is important to keep track of which rooms can be used for solution
preparation and the capabilities of each room. For these purposes, the
database should store the room identification, type of solvent dispensing
capabilities within each room and building location. Many of the rooms with
fixed tanks have two tanks that are controlled by the system.
3. Tanks: A tank can be fixed in a particular room or can be portable and used
in different rooms. It is important to keep track of the tank identification, size
and the room at which the tank is located (if the tank is fixed).
4. Solvent: It is important to keep track of all possible solvents needed for the
manufacturing operations (e.g. ethanol, isopropyl alcohol) and the cost per
unit of each solvent. A tank can be installed with the capacity to use more
than one solvent. However, only one solvent can be used for processing at
the same time.
Page 3 of 48
5. Recipes: In order to further automate and improve the process productivity,
the database is to store process preparation recipe setpoints to be then loaded
and used by the room equipment control system. Once the recipe is selected
and started by the operator, the equipment will be controlled automatically to
the recipe setpoints. Each recipe should uniquely identified and the stored
information should include, the recipe identification, description, date
created, user that created it, version, rooms in which the recipe can be used,
and recipe setpoints. Some of these setpoints can include; solvent type,
solvent quantity, mixer speed, mixing time, and tank purging pressure.
Page 4 of 48
II- Pharmaceutical Plant Organizational Chart
Technical
Manufacturing Engineering
Services HR Manager Quality Manager
Manager Manager
Manager
Technical Technical
Equipment
Services Services
Supervisor
Scientists Scientists Supervisor I
Quality Engineers
Production
Operators Equipment
Mechanics/ Calibration
Technicians Technicians
Quality Auditors
Supervisor II
Facilities
Supervisor
Production
Operators
Facilities
Fluid Bed Area Mechanics/
Manager Technicians
Production
Operators
Page 5 of 48
III- PSP Room Control Database Universal Schema and Functional Dependencies
1) User Relation
Transitive Dependency
Transitive dependency (Dept_ID → Dept_Name)
Page 6 of 48
2) Solvent Relation
3) Room Relation
Page 7 of 48
4) Tank Relation
5) Recipe Relation
Page 8 of 48
Even though there does not appears to be partial or transitive dependencies, the Room_Used attribute is a multivalued attribute which
can have more than one value since the same recipe can be enabled or distributed to be used in multiple rooms. For better data
integrity and consistency, this design will include a referencial integrity to the ROOM relation Room_ID attribute. This, in turns,
results in a M:N many-to-many potential relationship between the ROOM and RECIPE relations. This will be analyzed further and
resolved in the next section.
6) Alarm Relation
Page 9 of 48
7) Audit (Recipe Changes) Relation
Page 10 of 48
IV- PSP Room Control Database Normalization, Dependencies and Entity Analysis
User Identification → First Name, Last Name, Access Role, Department ID, Status
USER(user identification, first name, last name, access role, department ID, status)
Page 11 of 48
Relation Primary Key Foreign Key
User User Identification Department ID
Department Department ID
The new composite Room_Solvent and Room relation schemas are as follows;
Page 12 of 48
ROOM(Room Identification, Building Location)
Page 13 of 48
5 Recipe ID • The recipe ID can be a unique three
Recipe Description character field to uniquely identify the
Date Created recipe
Creation User ID • In order to assure that only valid users
Version can create recipe for existing solvent
Rooms Where Can be Used types, Creation User ID and Solvent
Solvent Type Type attribute should be foreign key
Solvent Quantity relationships to the corresponding entity
Mixer Speed sets User and Solvent
Mixing Time • The attribute Rooms Where Can Be Used
Purging Pressure was originally planned to maintain the
information about which rooms each
recipe is validated or approved to be
used on (to be enforced or maintained by
the application). This results in a M:N or
many-to-many relationship to the Room
table. In order to resolve this, a
composite Recipe_Room relation will be
created to link the recipes and the rooms
and remove the M:N relationship
• The Version attribute will be
automatically increased by the
application whenever changes to the
recipes are saved by the user
RECIPE(Recipe ID, Recipe Description, Date Created, Creation User ID, Version,
Solvent Type, Solvent Quantity, Mixer Speed, Mixing Time,
Purge Pressure)
Page 14 of 48
6 Audit Trail ID • An alarm log ID attribute was added
Alarm Description here as a candidate key in order to
Control Device Identification uniquely identify all relation records.
Time/Date Stamp This could be a surrogate key
Room Identification automatically generated by the internal
Tank Identification model
Batch ID • The alarm description and control device
identification information are to be
generated by the application software
and store in the relation as alarms are
triggered
• The Batch ID information is to be
entered by the user before the solvent
dispensing process begins
• In order to assure data integrity and
prevent anomalies, Room Identification
and Tank Identification attributes should
be foreign keys pointing to the related
records on the corresponding relations
Page 15 of 48
7 Audit Trail ID • An audit trail ID attribute is a candidate
Recipe ID key in order to uniquely identify all
User ID records related to recipe changes. This
Date/Time Change could be a surrogate key automatically
Parameter Changed generated by the internal model
Value Before • This relation or entity set is needed in
Value After order to save and keep an audit trail of
all recipe changes
• Recipe ID and User ID attributes should
be implemented as foreign keys in order
to assure that only valid recipe and user
IDs are entered into the relation
• The Parameter Changed, Value Before
and Value After attribute values will be
loaded by the application based on the
user entries and after recipe changes are
saved from the application
Audit Trail ID → Recipe ID, User ID, Time/Date Change, Parameter Changed,
Value Before, Value After
AUDIT(Audit Trail ID, Recipe ID, User ID, Time/Date Change, Parameter Changed,
Value Before, Value After)
Page 16 of 48
8 Solvent Usage Record ID • A solvent usage record ID attribute is a
Solvent ID candidate key in order to uniquely
Quantity Dispensed identify all records related to dispensed
Operator ID solvent usage history. This could be a
Room ID surrogate key automatically generated by
Date and Time Stamp the internal model
Batch ID • This relation or entity set is needed in
Cost order to save and keep a record of all
solvents dispensed in all rooms and
generate costs information. For naming
convenience, the relation will be named
HISTORY.
• Solvent ID, Operator ID and Room ID
attributes should be implemented as
foreign keys in order to assure that only
valid solvents rooms and user IDs are
entered into the relation
• The Cost attribute values will be
calculated by the application at the time
that the dispensing is done based on the
quantity of solvent that was dispensed
and the current cost per unit (Solvent
relation) at that particular time. It is
recommended to calculate and store the
cost in order to preserve historical
accuracy since the solvent cost could
change over time and only the current
prices will be kept in the Solvent
relation.
Solvent Usage ID → Solvent ID, Quantity Dispensed, Operator ID, Room ID,
Date/Time Stamp, Batch Id, Cost
HISTORY(Solvent Usage ID, Solvent ID, Quantity Dispensed, Operator ID, Room
ID, Date/Time Stamp, Batch Id, Cost)
Page 17 of 48
V – PSP Room Controls Database Conceptual Schema
1) DEPARTMENT Entity
2) USER Entity
Page 18 of 48
Relationship/Entities Connectivity Attributes
USER belongs to DEPARTMENT M:1 User_DeptID, Dept_ID
3) SOLVENT Entity
4) ROOM Entity
Page 19 of 48
4) ROOM_SOLVENT (Composite) Entity
5) TANK Entity
Page 20 of 48
Relationship/Entities Connectivity Attributes
ROOM contains TANK 1:M Room_ID, Tank_RID
6) RECIPE Entity
Page 21 of 48
Relationship/Entities Connectivity Attributes
USER creates RECIPE 1:M User_ID, Recipe_RID
SOLVENT is used in RECIPE 1:M Sol_ID, Recipe_ID
Page 22 of 48
8) ALARM Entity
Page 23 of 48
9) AUDIT (Recipe Changes History) Entity
Page 24 of 48
10) HISTORY Entity
Page 25 of 48
Relationship/Entities Connectivity Attributes
USER generates HISTORY 1:M User_ID, His_User
ROOM appears in HISTORY 1:M Room_ID, His_Room
SOLVENT was used in HISTORY 1:M Sol_ID, His_SolID
Page 26 of 48
VI- Entity Relational Diagram
DEPARTMENT
SOLVENT
PK Dept_ID
PK Sol_ID
u:R
d:R Dept_Name
Sol_Desc RECIPE
is used in
Sol_Cost
PK Recipe_ID
Recipe_Desc contains
Recipe_Date u:R
is used d:R
u:R Recipe_Ver
d:R FK1 Recipe_Sol
USER
Recipe_Qty
ROOM_SOLVENT Recipe_Speed PK User_ID
Recipe_Time creates
PK,FK2 RS_RID u:R
Recipe_Press User_Fname
PK,FK1 RS_SolID d:R
FK2 Recipe_User User_Lname
User_Role
FK1 User_DeptID
User_Status
u:R is used in
d:R u:R
was used ind:R
recorded in listed in
shows on RECIPE_ROOM u:R
d:R
PK,FK1 RR_RecID
PK,FK2 RR_RoomID AUDIT
u:R
d:R generates
RR_Count PK Audit_ID
ROOM can run u:R
d:R FK1 Audit_User
PK Room_ID
Audit_Date
appears in Audit_Param
Room_Bldg
Audit_Bef
Audit_After
u:R FK2 Audit_RecID
is listed in d:R u:R
d:R u:R
contains u:R d:R
d:R
u:R ALARM
d:R
PK Alarm_ID
HISTORY
TANK
u:R Alarm_Desc PK His_ID
PK Tank_ID d:R Alarm_Device
is tracked in Alarm_Date His_Qty
Tank_Size FK1 Alarm_Room FK1 His_User
Tank_Type FK2 Alarm_Tank FK2 His_Room
FK1 Tank_RID Alarm_Batch His_Date
His_Batch
His_Cost
FK3 His_SolID
Page 27 of 48
VII- Implementation of Relational Schema – Creation of Tables by
Using Access SQL Data Definition Queries
1) DEPARTMENT Table
2) USER Table
Page 28 of 48
3) SOLVENT table
Page 29 of 48
4) ROOM Table
5) ROOM_SOLVENT Table
Page 30 of 48
6) TANK Table
Page 31 of 48
7) RECIPE Table
Page 32 of 48
8) RECIPE_ROOM Table
Page 33 of 48
9) ALARM Table
Page 34 of 48
10) AUDIT Table
Page 35 of 48
11) HISTORY Table
Page 36 of 48
VIII- Population of Tables
In order to populate the tables with a base set of records for query purposes, an Access
form was created and edited for each table. Within the forms, drop-down box fields were
generally created for data entry of foreign key fields. This was done to enhance the
records entry productivity and to assure that referencial integrity data entry errors at the
form level were prevented. Here are print screen examples of a few of these forms. For
more details, please open and review the Carlos_Bruzos_Final_Project Access database.
Page 37 of 48
IX- Queries and Reports
1) List all PSP Equipment users information (including department name) only for active
users
Page 38 of 48
2) List room and building information for room that can be used with Acetone
Page 39 of 48
3) List all solvents which current cost per Kilogram is greater than $20
Page 40 of 48
4) List all recipe changes made by user ID ‘cbruzos’ between July 1st 2008 and today
Page 41 of 48
5) List all existing recipe names that can be used for Aspirin and the rooms in which they
can be run
Page 42 of 48
6) Provide a summary listing showing the number of alarms by room that occurred
between May 1st, 2008 and today. Show listing in descending order with the room having
the greatest number of alarms first.
Page 43 of 48
7) List solvents for which an investment of more than $5,000 has been used since June 1st
2008
Page 44 of 48
8) Show listing of alarms (ordered by the room) for rooms that have more than three
alarms within 2008
Page 45 of 48
9) SQL Update Query- Increase solvent prices by 10% for all solvents which current cost
is less than $20
UPDATE SOLVENT
SET Sol_Cost=(Sol_Cost*1.10)
WHERE Sol_Cost<20;
Page 46 of 48
10) SQL Delete Query- Delete portable tanks from the Tank table since the user
requested not to track the use of these type of tanks
Page 47 of 48
11) SQL Modify Query- As part of maintenance, it was requested to increase the length
of the Alarm Description (Alarm_Desc) field so that more descriptive and complete
alarm information can be saved.
Page 48 of 48