A starter application for building a MSO platform on Medplum. It shows how to control clinician access where clinicians and patients can be enrolled at multiple clinics.
- Operations to enroll and unenroll clinicians and patients across different clinics with automatic access policy updates - see src/components/utils/enrollment.ts
- Fetching all patients and clinicians enrolled in a clinic - see src/components/utils/enrollment.ts
- Clinician and Patient management interface - see src/components/ClinicianList.tsx and src/components/PatientList.tsx
- MSO Access Policy - see src/data/access-policy.ts
It is recommended that you create a new Medplum project to run this demo. Follow the instructions in this tutorial.
Clone the repo to your local machine.
If you want to change any environment variables from the defaults, copy the .env.defaults
file to .env
cp .env.defaults .env
And make the changes you need.
Next, install the dependencies.
npm install
Then, run the app
npm run dev
This app will run on http://localhost:3000
and connect to a hosted Medplum project at https://api.medplum.com/
by default. The server url can be changed in main.tsx
What is a Managed Service Organization (MSO)?
A Managed Service Organization (MSO) is a healthcare organization that provides services to multiple different healthcare organizations.
For Managed Service Organizations (MSOs), complexity stems from practitioners potentially working across multiple tenants and patients potentially receiving care from multiple healthcare partners.
This demo implements a solution where:
- Tenants are separated as Organizations (clinics) within a single Medplum Project
- Patients and clinicians can each be enrolled in multiple clinics
- AccessPolicy controls limit clinician access to resources only within shared clinics
- Create new clinics (Organizations)
- Create new clinicians (Practitioners)
- Enroll practitioners in one or more clinics
- Enroll patients in one or more clinics
- Manage access policies
- View patients, observations, diagnostic reports, encounters, and communications affiliated with their clinics - simulating what they would see in their EHR
This repo is organized into several main directories:
src/pages
: Contains the React components for each page in the applicationsrc/components
: Contains reusable UI componentssrc/data
: Contains the AccessPolicy definition and other core FHIR resources that can be uploadedsrc/utils
: Contains utility functions for MSO enrollment methods and admin status checking
- Creating a new clinic: Admins can create new Clinics to represent clinics
- Creating a new clinician: Admins can create new Practitioners and assign them to Clinics
- Enrolling a practitioner in a clinic: Configures access policies for that Practitioner to be able to read/write to all Patients in that Clinic
- Enrolling a patient in a clinic: Configures access policies for Clinicians in that Clinic to be able to read/write to that Patient
- Viewing patient data: Practitioners can only see patients and their clinical data if they share an organizational affiliation
This demo uses the following FHIR and Medplum resources:
- AccessPolicy: Defines the access rules for clinicians to resources across the project
- Organization: Represents a clinic
- Practitioner: Represents a clinician
- ProjectMembership: Stores references to the clinics that the clinician can access
- Patient: Represents an individual receiving care
- Observation: Represents clinical measurements and findings
- DiagnosticReport: Represents diagnostic test results
- Encounter: Represents patient visits
- Communication: Represents communications between clinicians
Medplum is an open-source, API-first EHR. Medplum makes it easy to build healthcare apps quickly with less code.
Medplum supports self-hosting and provides a hosted service. Medplum MSO Demo uses the hosted service as a backend.
- Read our documentation
- Browse our react component library
- Join our Discord