You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
currently a default "user" is a practitioner, but a patient also becomes a user when they are invited to a study so that the oauth mechanism can be used
a better model for this is to have users only concerned with account functions (email, password, django system fields eg is_superuser etc) and have Practitioners and Patients reference a specific user
also, rather than have a patient reference one organization_id, there should be a break out table for many to many
TBD
(we will keep first_name and last_name in core_jheuser to maintain compatibility with standard Django user libs like OAuth)
create a new table core_practitioner with fields below (use jhe_user_id instead of user_id)
remove organization_id from core_patient
remove the table core_jheuserorganization
add core_patientorganizations with fields below
add core_practitionerorganizations with fields below
update app logic
erDiagram
"users" ||--|{ "DELETEuser_organizations": ""
"users" {
int id
jsonb identifer
varchar email
DELETE first_name
DELETE last_name
various django_standard_user_fields
}
"organizations (FHIR Organization)" ||--|{ "organizations (FHIR Organization)": ""
"organizations (FHIR Organization)" ||--|{ "DELETEuser_organizations": ""
"organizations (FHIR Organization)" ||--|{ "smart_client_configs": ""
"organizations (FHIR Organization)" ||--|{ "studies (FHIR Group)": ""
"organizations (FHIR Organization)" {
int id
jsonb identifer
varchar name
enum type
int part_of
}
"smart_client_configs" {
int id
int organization_id
varchar well_known_uri
varchar client_id
varchar scopes
}
"DELETEuser_organizations" {
int id
int user_id
int organization_id
}
"patients (FHIR Patient)" ||--|| "users": ""
"patients (FHIR Patient)" ||--|{ "observations (FHIR Observation)": ""
"patients (FHIR Patient)" ||--|{ "study_patients": ""
"patients (FHIR Patient)" {
int id
int user_id
DELETE organization_id
varchar identifer
varchar name_family
varchar name_given
date birth_date
varchar telecom_cell
}
"patient_organizations" ||--|{ "patients (FHIR Patient)": ""
"patient_organizations" ||--|{ "organizations (FHIR Organization)": ""
"patient_organizations" {
int id
int patient_id
int organization_id
}
"practitioners (FHIR Practitioner)" ||--|| "users": ""
"practitioners (FHIR Practitioner)" {
int id
int user_id
varchar identifer
varchar name_family
varchar name_given
date birth_date
varchar telecom_cell
}
"practitioner_organizations" ||--|{ "practitioners (FHIR Practitioner)": ""
"practitioner_organizations" ||--|{ "organizations (FHIR Organization)": ""
"practitioner_organizations" {
int id
int practitioner_id
int organization_id
}
"studies (FHIR Group)" ||--|{ "study_patients": ""
"studies (FHIR Group)" ||--|{ "study_scope_requests": ""
"studies (FHIR Group)" ||--|{ "study_data_sources": ""
"studies (FHIR Group)" {
int id
int organization_id
jsonb identifer
varchar name
varchar description
}
"study_patients" ||--|{ "study_patient_scope_consents": ""
"study_patients" {
int id
int study_id
int pateint_id
}
"study_scope_requests" ||--|{ "codeable_concepts (FHIR CodeableConcept)": ""
"study_scope_requests" {
int id
int study_id
enum scope_action
int scope_code_id
}
"observations (FHIR Observation)" ||--|| "codeable_concepts (FHIR CodeableConcept)": ""
"observations (FHIR Observation)" ||--|{ "observation_identifiers": ""
"observations (FHIR Observation)" ||--|| "data_sources": ""
"observations (FHIR Observation)" {
int id
int subject_patient_id
int codeable_concept_id
jsonb value_attachment_data
timestamp transaction_time
}
"observation_identifiers" {
int id
int observation_id
varchar system
varchar value
}
"studies (FHIR Group)" ||--|{ "study_patients": ""
"codeable_concepts (FHIR CodeableConcept)" {
int id
varchar coding_system
varchar coding_code
varchar text
}
"study_patient_scope_consents" ||--|| "codeable_concepts (FHIR CodeableConcept)": ""
"study_patient_scope_consents" {
int id
int study_patient_id
enum scope_action
int scope_code_id
bool consented
timestamp consented_time
}
"data_sources" ||--|{ "data_source_supported_scopes": ""
"data_sources" ||--|{ "study_data_sources": ""
"data_sources" {
int id
varchar name
enum type
}
"data_source_supported_scopes" ||--|| "codeable_concepts (FHIR CodeableConcept)": ""
"data_source_supported_scopes" {
int id
int data_source_id
int scope_code_id
}
"study_data_sources" {
int id
int study_id
int data_source_id
}
Loading
The text was updated successfully, but these errors were encountered:
s1monj
changed the title
Model non-patient users as FHIR Practitioners
Model non-patient users as FHIR Practitioners and allow Patients to belong to multiple Organizations
Apr 5, 2025
Background
is_superuser
etc) and have Practitioners and Patients reference a specific userTBD
first_name
andlast_name
incore_jheuser
to maintain compatibility with standard Django user libs like OAuth)core_practitioner
with fields below (usejhe_user_id
instead ofuser_id
)organization_id
fromcore_patient
core_jheuserorganization
core_patientorganizations
with fields belowcore_practitionerorganizations
with fields belowThe text was updated successfully, but these errors were encountered: