Tenant Isolation Approaches in Medplum
In healthcare applications, practitioners often work across multiple organizational boundaries. A doctor might work at multiple clinics, a nurse might be part of several care teams, or a care coordinator might manage patients across different healthcare services. Each of these—clinics, care teams, and healthcare services—represents a distinct tenant in your system: a collection of resources (patients, observations, encounters, etc.) that should be logically grouped together.
In Medplum, you can build your tenancy model around any FHIR resource type. Common examples include:
Organization: Different clinics, practices, or healthcare organizationsHealthcareService: Different departments or services (e.g., Cardiology Department, Oncology Department)CareTeam: Different care teams (e.g., Diabetes Care Team, Hypertension Care Team)
For a comprehensive guide on how to set up multi-tenancy in Medplum—including data modeling, compartments, propagation, and user enrollment—see our Multi-Tenant Access Control documentation.
This blog post focuses on a specific challenge: What happens when a user belongs to multiple tenants? And more importantly, how can you ensure your application restricts access to only one tenant at a time?
