Skip to main content

Organization

An Organization is a user that represents a company or clinic rather than a person โ€” a hospital, a practice, your own company. It plays two distinct roles in Cockpit:

  1. it's a user type you can create alongside HCPs, patients, and devices; and
  2. it's typically the parent organization โ€” the entity that holds the key used to share data between your users.
info

In the Cardinal SDK, an Organization is a HealthcareParty โ€” the same entity type as an HCP, with the same permissions. The only difference is that it stands for a non-person party. Cockpit tags it as an organization and gives it its own create/edit form, list icon, and the "is organisation" flag.

Organization vs HCPโ€‹

They're the same underlying entity, created from two different buttons on the Users page (Add โ†’ Organization or Add โ†’ Healthcare professional):

OrganizationHCP
Representsa company / clinic (non-person)an individual healthcare professional
Name fieldsa single NameFirst name + Last name
Other fieldsEmail, Mobile phone, Parent organization, RolesEmail, Mobile phone, Parent organization, Roles
Typical usethe parent organization that holds the sharing keyan end user who reads/writes data
info

Choose Organization for non-person entities (hospitals, clinics, companies) and HCP for individual practitioners. An Organization is not a mandatory parent of your other users โ€” it's just another user type that happens to be well-suited to the parent role.

The parent organization (data sharing)โ€‹

iCure data is end-to-end encrypted, so for one user to read another's data they must share through a common key. The parent organization is the party that holds that key. Point your users at a parent organization and Cardinal Sdk wires up the secure sharing between them automatically.

  • Assigning a parent is done per user: every user form (HCP, patient, device, and even an organization) has a Parent organization field.
  • For a patient it's required โ€” you can't create a patient without choosing a parent organization, since a patient needs one to share their data through. For HCPs, devices, and organizations the field is optional.

This is why the create-project wizard offers to create a parent organization for you whenever your questionnaire answers imply users share data (the Responsible organization step) โ€” see Create Your First Project.

The parent organization's private key must be initializedโ€‹

iCure data is end-to-end encrypted, so every user that reads or writes data is a data owner with its own key pair. Having a private key is what the SDK calls initializing the key โ€” until a data owner's key pair exists, that owner can't encrypt or decrypt anything.

This matters most for the parent organization, because its users share data through it. Until the parent organization's private key is initialized, every user that has this organization as their parent cannot create or access any encrypted data โ€” with auto-delegation, the users are registered under a parent that has no key to decrypt their data. As Cockpit puts it:

caution

The parent HCP does not have an initialized private key. Auto delegation will not work until the private key is set up. In addition, users created through this process will not be able to create or access encrypted data. Please initialize the private key of this HCP in the Users section, or ask the HCP to log in to the application โ€” their keys will be initialized automatically.

This is exactly why the create-project wizard initializes the parent organization's private key automatically when it creates the organization for you โ€” so the users you go on to create can work right away.

Initializing keys from Cockpitโ€‹

You can also initialize an HCP's keys manually in Cockpit: Users โ†’ the user's row โ†’ overflow menu โ†’ Initialize Private Key. You may optionally generate a recovery key at the same time.

caution

Only do this for an HCP account you use yourself (e.g. a test or admin HCP). Cockpit warns: "Real doctors and other HCPs must generate and keep their own private keys when they start using your application." For real end users, don't generate keys here โ€” let them initialize their own keys through your application's interface; their keys are created automatically the first time they log in.

(Initializing fails with a clear error if the HCP has no valid parent organization โ€” fix the parent first.)

Private key vs recovery keyโ€‹

  • Private key โ€” required for the data owner to access encrypted data and create new data. It's generated automatically for the parent organization during project creation. It is not stored by Cardinal, is shown only once, is downloadable (*.pem), and cannot be displayed again โ€” lose it with no recovery key and the encrypted data is unrecoverable.
  • Recovery key โ€” an optional backup that lets you restore the private key if it's lost (the SDK stores the key pair encrypted on the iCure server so it can be recovered later). It can only be generated at the same time as the private key, is also shown only once, and is downloadable (*.txt). Because a recovery key can give access to the private key, keep it secret; Cockpit notes recovery keys are best used for demo purposes โ€” production apps should use a workflow that doesn't expose them to intermediaries.

The parent organization's keys also appear on the wizard's Ready to go step (and in Download all as *.json) โ€” save them there. See Initialize the Cardinal SDK and Recovery & Private Keys.

Finding the organization's IDโ€‹

When your app references a parent organization, it uses the organization's HCP ID (its Healthcare party ID) as the parentOrganizationId. You'll find it:

  • on the wizard's Ready to go step, in the Parent organization table (labelled HCP ID); and
  • later, by expanding the organization's row in the Users table (Healthcare party ID).

A user that points at a parent shows that value as its Parent ID.

caution

Broken reference warning. If a user references a parent organization ID that no longer exists, Cockpit flags it with a red critical issue tag in the Users table: "This user references a parent organization that doesn't exist in this environment. Edit the user and set a valid parent organization."

Where it fitsโ€‹

ConceptWhat it isIn the Cardinal SDK
Organizationa company/clinic user; usually the parent that holds the sharing keya HealthcareParty (tagged as an organisation)
HCPan individual healthcare professionala HealthcareParty
Patient / Deviceend users / subjects of carePatient / Device

Where to go nextโ€‹

Cardinal SDK reference: an Organization is a HealthcareParty in the Cardinal data model.