← Portfolio
Entity-Relationship Diagram
EER Diagram — Hospital Clinical Trials
Table Definitions
studies
study_idINTPK
study_codeVARCHAR(50)UNIQUE
titleVARCHAR(255)
descriptionTEXT
start_dateDATE
end_dateDATE
statusENUMdraft|recruiting…
created_atDATETIME
participants
participant_idINTPK
pseudonymVARCHAR(50)UNIQUE · no PII
year_of_birthYEAR
sexENUMM|F|other|unknown
created_atDATETIME
enrollments
enrollment_idINTPK
study_idINTFK
participant_idINTFK
enrollment_dateDATE
statusENUMactive|withdrawn…
variables
variable_idINTPK
study_idINTFK
nameVARCHAR(100)
unitVARCHAR(50)e.g. mmHg
data_typeENUMnumeric|text…
is_requiredTINYINT(1)
timepoints
timepoint_idINTPK
study_idINTFK
nameVARCHAR(100)e.g. Baseline
day_offsetINTdays from enrolment
measurements
measurement_idINTPK
enrollment_idINTFK
variable_idINTFK
timepoint_idINTFK
value_numericDOUBLE
value_textTEXT
collected_byINTFK
data_files
file_idINTPK
enrollment_idINTFK
timepoint_idINTFK · nullable
filenameVARCHAR(255)
file_typeVARCHAR(50)MIME type
file_pathVARCHAR(500)
uploaded_byINTFK
users
user_idINTPK
usernameVARCHAR(50)UNIQUE
password_hashVARCHAR(255)
emailVARCHAR(150)UNIQUE
full_nameVARCHAR(150)
is_activeTINYINT(1)
roles
role_idINTPK
nameVARCHAR(50)UNIQUE
descriptionTEXT
user_roles
user_role_idINTPK
user_idINTFK
role_idINTFK
study_idINTFK · nullable
granted_atDATETIME
Relationships
FromToCardinalityDescription
studiesenrollments1 : NA study has many enrolled participants
participantsenrollments1 : NA participant can be enrolled in multiple studies
studiesvariables1 : NEach study defines its own set of measurement variables
studiestimepoints1 : NEach study has scheduled assessment timepoints
enrollmentsmeasurements1 : NLongitudinal data items collected per enrolled participant
enrollmentsdata_files1 : NFile attachments associated with an enrolment
variablesmeasurements1 : NEach measurement records a value for a defined variable
timepointsmeasurements1 : NMeasurements are taken at a specific visit/timepoint
timepointsdata_files1 : N (optional)Files may be associated with a timepoint
usersmeasurements1 : NRecords who collected the measurement
usersdata_files1 : NRecords who uploaded the file
usersuser_roles1 : NRole assignments per user
rolesuser_roles1 : NA role can be assigned to many users
studiesuser_roles1 : N (optional)study_id NULL = global role; set = study-scoped role
MySQL Schema

    
Download schema.sql