Multi-tenancy role system
This chapter provides a role system that's suitable for an organization hosting a system that enables other organizations to provide care or providing a service for multiple customers. Examples are B2B2C systems such as providers of clinical study tools for multiple research hospitals or providers of outpatient services for hospitals and insurances.
The key criteria for this setup are that there is a single organization which has multiple organizations as customers, where each of the customer organizations provide care or related services to patients.
Role chart
Note: RootOrganization is an Organization and AdminRole is a PractitionerRole in the chart above. They have been given different names to improve visual clarity.
The setup is characterized as following:
- There is a single root
Organizationat the top (calledRootOrganizationin the chart) which represents the business itself. - Each customer organization is also represented by an
Organizationresource. - Each customer is linked to the root organization through the
partOfproperty. - Optionally, customer organizations can be partitioned further by creating department
Organizationentities that again link to the main customerOrganizationvia thepartOfproperty. - Every patient user is represented by a
Patientresource. Each patient'smanagingOrganizationproperty points its corresponding care providing customerOrganization. - Every practitioner user is represented by a
Practitionerresource. Every practitioner has at least onePractitionerRoleat the customerOrganization. - Administrative staff working at the business and helping to run the entire system are represented as
Practitionerresources in the system, having aPractitionerRoleat the root organization (calledAdminPractitionerandAdminRolein the chart)
Use of role codes
The use of role codes in PractitionerRole entities allows to establish different access privileges for different users. The code system in FHIR is bound to the Practitioner Role System which is based on SNOMED.
For the validation strategies below, the following values can be used:
ictrepresents a technical user, someone who may add or removePractitionerusers but who must not be able to see patient data.doctorrepresents a medical user, someone who may access patient data but who must not be able to add or removePatientusers from the system.
Validation strategies
LegitimateInterest is the primary validator for this setup. The parameter role_inheritance_levels must be set to 1 or greater so that roles can be inherited from the root organization down to customer organizations:
{
// ...
"validators": {
"legitimate_interest": {
"role_inheritance_levels": 1
}
},
}
- For patients, each patient-specific resource can be validated using the
PatientCompartmentvalidator orLegitimateInterest, enabling every patient to access their own data but nothing else in the database. - For practitioners, every resource can be validated using the
LegitimateInterestvalidator, assuming that the resource is either tied to aPatientor to theOrganization. Practitioners can see any resource in the database this way. - Customer-specific admin users shall be given the
ictrole in their customer organization. - Care-providing users shall be given the
doctorrole in their customer organization. - Business-wide global admin users shall be given the
ictrole in the root organization. - Do not assign a
doctorrole in the root organization to prevent users having global visibility to personal health data.