erDiagram
allergy {
emis_observation_guid VARCHAR PK
pseudo_registration_guid VARCHAR FK
pseudo_patient_id VARCHAR FK
emis_registration_organisation_guid VARCHAR FK
emis_authorising_userinrole_guid VARCHAR FK
emis_enteredby_userinrole_guid VARCHAR FK
emis_consultation_guid VARCHAR FK
emis_code_id VARCHAR FK
study_id VARCHAR FK
}
patient {
registration_guid VARCHAR PK
}
organisation {
emis_organisation_guid VARCHAR PK
}
user_in_role {
emis_userinrole_guid VARCHAR PK
}
consultation {
emis_consultation_guid VARCHAR PK
}
clinical_code {
emis_code_id VARCHAR PK
}
recruit_included_patients_view {
emis_patient_id VARCHAR PK
study_id VARCHAR
}
user_studies {
study_id VARCHAR PK
}
allergy }|--|{ patient : "registered_to"
allergy }|--|{ organisation : "recorded_at"
allergy }|--|{ user_in_role : "authorised_by"
allergy }|--|{ user_in_role : "entered_by"
allergy }|--|{ consultation : "noted_in"
allergy }|--|{ clinical_code : "uses_code"
allergy }|--|{ recruit_included_patients_view : "for_patient"
allergy }|--|{ user_studies : "in_study"