Skip to main content

Core Organization & User Models

Carium has four primary data types which underpin the entire system. These are:

  1. Organizations
  2. Users
  3. Individuals
  4. Individual Groups

All other data types are owned by one or more of these four types.

Organization

An object representing a care provider organization. Healthcare workflow management objects are owned by an Organization. Typically are Carium installation only has a single organization, but multiple organizations are sometimes used for better isolation between groups.

Organizations have associated Users of the Provider type, which are considered the Organization's care team members. The Organization may delegate its access, in whole or in part, to its care team members.

Organizations are defined in the identity_core_organization table.

User

An object representing the primary acting principle. An end-user will log into their user account. A User performs actions against other data objects through the Carium API. A User has at least one "primary Individual" that the User owns.

Users are one of two types: Patient or Provider.

Users are defined in the identity_core_user table.

Provider Users

Provider Users ("Providers") are the subset of Users which are associated with an Organization. Typically, these are employees of the healthcare provider. Providers user accounts are managed by their Organization, which has ultimate control over all Provider accounts.

Provider users are associated with an organization by mapping through the identity_core_organization_users table.

Individual

An object representing and owning all healthcare data for a person. All details on a healthcare record reference an Individual. All Individuals have a single owning User. Individuals may be shared with additional Users or Organizations. An individual will created for a User on sign up. In the typical sign up flow, the created Individual will automatically be shared with the associated Organization.

Individuals are defined in the identity_core_individual table. A user can be associated with an individual through the primary_individual_id attribute in the identity_core_user table.

Individuals are associated (shared) with an organization by mapping through the identity_core_sharedindividual table.

Individual Groups

An object representing a collection of Individuals and Users. An organization has many groups. IndividualGroups consists of leaders (Provider Users), members (Provider Users), and Individuals (Patient Individuals). Organizations may delegate access to Individuals to leaders of an IndividualGroup. These are typically used to segment Patient Individuals and connect them with their Provider Users in an Organization. IndividualGroups are also used for functionality other than access delegation.

The identity_core_individualgroup table defines the group itself, while the identity_core_individualgroupindividuals table maps individuals to the group.

Relationship Diagram

Example Query

The example below provides a list of all users in the system with their user type and group membership. The users group membership is contained in the groups column where all group names are combined into a single comma delimited list.

SELECT
grp_indv.individual_id AS individual_id,
usr.id AS user_id,
CASE
WHEN org_usr.id IS NOT NULL THEN 'Organization User'
ELSE 'Provider User'
END AS user_type,
usr.first_name AS first_name,
usr.last_name AS last_name,
LISTAGG(grp.name, ',') AS groups
FROM identity_core_individualgroup AS grp
JOIN identity_core_individualgroupindividuals AS grp_indv
ON grp.id = grp_indv.individual_group_id
JOIN identity_core_user as usr
ON grp_indv.individual_id = usr.primary_individual_id
LEFT JOIN identity_core_organization_users AS org_usr
ON usr.id = org_usr.user_id
GROUP BY 1, 2, 3, 4, 5
LIMIT 50