On this page

Access, customer isolation and audit

On a shared platform, the rules that protect charts cannot live in one app's backend: a third-party app is not trusted to keep customers apart or to record who read a chart. These rules say what the platform guarantees for every app, what it trusts each app to do, and what is recorded.

Terms used here are the server's: a project holds one customer's data; a ClientApplication is an app's credentials; a ProjectMembership gives a user or an app access to a project, through an AccessPolicy.

Customer isolation​

ISO-1 Each customer is one project​

Each customer (a clinic, or an organization of clinics) SHALL have its own project, and its charts SHALL live only in that project. Several apps MAY work on one customer's project; each app that a customer uses is a member of that customer's project.

  • Who: platform.
  • Enforced by: project scoping in the server's repository: every resource carries its project in meta.project, and every read, search and write is limited to the projects the caller is a member of.
  • Check: with an app's credentials for customer A, read and search for a resource of customer B by id and by search: the server returns not found.

ISO-2 Shared content holds no patient data​

The Canadian profiles, value sets and code systems MAY live in one shared project that customer projects link to, to read only. That project SHALL hold no patient data.

  • Who: platform.
  • Enforced by: project links in the server give read access only. Gap: nothing stops an operator from writing patient data into the shared project; the provisioning work (OPE-55) must keep it to conformance resources.
  • Check: search the shared project for resources in the Patient compartment: none.

Access​

ACC-1 No app has more access than its policy gives it​

Each app SHALL be a ClientApplication with a ProjectMembership in the customer's project, and that membership SHALL carry an AccessPolicy that lists the resource types and interactions the app needs. No app SHALL be a project administrator, and no app SHALL be a member of the super-administrator project.

  • Who: platform.
  • Enforced by: access policies in the server. Gap: a membership with no AccessPolicy gets read and write access to every non-administrative resource in the project (buildAccessPolicy in packages/server/src/fhir/accesspolicy.ts). Until the server refuses such a membership, provisioning (OPE-13, OPE-60) SHALL always attach a policy to an app's membership.
  • Check: list the project's memberships for ClientApplications; each has an AccessPolicy and admin is not true.

ACC-2 A person signs in as themselves​

When an app acts for a person, the person SHALL sign in through the app with their own account, using OAuth 2.0 authorization code with PKCE, so that the server knows both the person and the app. An app SHALL NOT act for a person with credentials of its own.

An app's backend job that acts for no person, such as a nightly import, MAY use the app's client credentials, and is then recorded as the app.

The server's X-Medplum-On-Behalf-Of header lets a caller act as another member, but only a project administrator may send it. Since no app is an administrator (ACC-1), an app SHALL NOT use it.

  • Who: app; the platform records what the app does (AUD-2).
  • Check: the AuditEvents for an app's requests name a person as the requestor, except for its declared backend jobs.

ACC-3 Scopes narrow access, they never widen it​

An app SHALL ask for the narrowest SMART on FHIR scopes it needs, such as patient/*.rs for an app that only reads one patient's chart.

  • Who: platform.
  • Enforced by: the server intersects SMART scopes with the member's AccessPolicy (applySmartScopes), so a scope can only remove access the policy gives.
  • Check: sign in with patient/Observation.rs and try to read a Condition: the server refuses.

ACC-4 An outside system gets read-only access to the patients it asks about​

An outside system, such as a CA:FeX Data Consumer at another organization, SHALL be let in only like this:

  1. The customer's administrator registers it as a ClientApplication in the customer's project, created with status off and turned on only when the exchange is agreed. The administrator can turn it off at any time.
  2. It authenticates with SMART Backend Services: client credentials with a signed JWT (private_key_jwt). The ClientApplication has a jwksUri and no secret the system is given.
  3. Its AccessPolicy allows only the read and search interactions, on the resource types the exchange needs. It never allows create, update or delete; a patch counts as an update. An AccessPolicy names interactions on resource types, not operations: an operation such as $summary is allowed when the reads and searches it makes are.
  4. Each request is limited to one patient, named by the request.
  5. Every read is recorded with the outside system as the requestor (AUD-1, AUD-2).

The server's Patient/$summary searches 16 fixed resource types, including Encounter, Procedure, CarePlan, Goal, Coverage and Account, and refuses the whole summary when the policy denies any one of them. A policy for an outside system that uses $summary therefore has to allow all 16; a policy limited to the Patient Summary's own types (Patient, AllergyIntolerance, Condition, MedicationStatement, MedicationRequest, Immunization, Observation, DiagnosticReport) has to read them with plain searches instead.

  • Who: platform, given that the administrator sets the ClientApplication up as above.
  • Enforced by: AccessPolicy interactions and JWT client authentication in the server, and the ClientApplication status. Gaps, for the Phase 3 server work (OPE-4):
    • A ClientApplication with no status counts as active, so step 1 holds only if the client is created with status off.
    • Client credentials accept the client's secret even when it has a jwksUri, so nothing stops a system that was given the secret from using it. A ClientApplication for an outside system should have its secret withheld until the server can refuse it.
    • The server has no policy that limits a backend client to the one patient a request names; OPE-64 builds it, with this rule as its test.
    • $summary leaves out MedicationStatement, so oo-medicationstatement records never appear in the summary the server builds.
  • Check: with the outside system's credentials, a write is refused, and a search across patients is refused.

ACC-5 Every connection is encrypted​

Every connection to the platform SHALL use TLS 1.2 or later, with certificate validation.

  • Who: platform.
  • Enforced by: the load balancer's TLS policy (loadBalancerSslPolicy in the deployment, default RECOMMENDED_TLS). The hosted service's configuration needs checking against this rule before launch.
  • Check: a TLS 1.1 handshake to the API is refused.

ACC-6 What the platform enforces, and what each app must​

The platform enforces, for every app: customer isolation (ISO-1), authentication, access policies and scopes (ACC-1, ACC-3), the profiles a project requires (REC-1, once OPE-71 ships), and the audit record (AUD-1).

Each app must enforce what only it can see: which of its users may open which charts within the access its policy gives, the patient's consent directives where the app manages them, a reason when a user overrides a restriction ("break the glass"), and the rules in identity and records.

Audit​

AUD-1 The platform records every access to a chart​

The platform SHALL record an AuditEvent for every create, read, version read, history read, update, patch, delete and search through the FHIR API, whatever the app. That includes reads made inside operations such as Patient/$everything and Patient/$summary, because those run through the same access-controlled repository as a plain read. An app's own access log is not the record.

  • Who: platform.
  • Enforced by: the server's repository writes an AuditEvent for each interaction (logEvent in packages/server/src/fhir/repo.ts). It saves the event when the saveAuditEvents setting is on, and writes it to the audit log stream when logAuditEvents is on. The hosted service SHALL run with both on. Gaps, for the Phase 3 server work (OPE-4):
    • The server saves an event only when it holds the record itself. A search names no one record, so searches, including those inside $everything and $summary, reach the log stream only, never the saved record.
    • A version read passes a reference rather than the record, so version reads are never saved either. Neither are failed or refused interactions, nor history reads of a deleted record.
    • An event names the record read, not its patient. AuditEvent?patient= finds reads of the Patient record only, so "who read this patient's chart" cannot be answered from the saved record.
    • Reads the server makes as the system, for itself, are not recorded. That is intended, but no rule yet says which system reads may touch patient data.
    • Sign-ins are written to the log stream only, and only when logAuditEvents is on.
  • Check: read a Condition, search Observations and call $summary for one patient; then search AuditEvents for that patient and find all three.

AUD-2 The record names the person and the app​

Each AuditEvent SHALL name the person who acted as the requestor agent, the app as a second agent, the network address the request came from, the time, the action, the outcome, and what was touched.

  • Who: platform, given that the app keeps ACC-2.
  • Enforced by: createAuditEvent in packages/server/src/util/auditevent.ts records the signed-in profile as requestor and the ClientApplication as a second agent, with the network address and the request's trace id.
  • Check: an AuditEvent for a read through an app names a Practitioner as requestor and the app's ClientApplication as the second agent.

AUD-3 Apps record what the platform cannot see​

An app SHALL record an AuditEvent, with POST AuditEvent, for each access to patient data the platform cannot see: printing, exporting to a file or sending outside the platform. It SHALL name the person as requestor and the patient as an entity.

  • Who: app.
  • Check: print a chart from the app; an AuditEvent for the print names the person and the patient.

AUD-4 The record is kept as long as the chart​

AuditEvents about a patient SHALL be kept for as long as that patient's chart is kept. When a customer leaves OpenOrchid, their AuditEvents SHALL be handed over with their charts.

This follows the decision Meet made on 2026-12-05. A minimum period that meets each province's law is not yet set: a privacy lawyer needs to confirm it before launch. CA:Aud leaves retention to local policy.

  • Who: platform.
  • Enforced by: AuditEvents are stored in the database with the charts and are not deleted on a schedule. A project archive can include them: Project/$archive with includeAuditEvents, run by a project administrator on a project with the archive feature. Gaps: bulk $export never includes AuditEvents, and deleting a chart does not delete or keep its AuditEvents by rule; the server work needs to decide which.
  • Check: archive a project with includeAuditEvents; the archive holds the events for every chart.

AUD-5 The record cannot be changed, and few can see it​

An AuditEvent SHALL NOT be changed or deleted once recorded. Only the customer's privacy officer or administrators, and OpenOrchid operators acting under the customer's agreement, SHALL read the customer's AuditEvents. An app SHALL NOT be given access to AuditEvents unless reading them is its purpose.

  • Who: platform.
  • Enforced by: AccessPolicy (an app whose policy does not list AuditEvent cannot read them). Gap: the server lets anyone with write access to AuditEvent, such as a project administrator, update or delete one. The server needs to make AuditEvents append-only (OPE-4).
  • Check: as a project administrator, try to update and delete an AuditEvent: both are refused.

AUD-6 The record can be searched the way CA:Aud expects​

The platform acts as CA:Aud's Audit Record Repository: it stores AuditEvents and answers searches on them (CA:Aud's Retrieve Audit Event, ITI-81) with a date range and the search parameters CA:Aud lists. An app MAY send its own AuditEvents (CA:Aud's Record Audit Event, ITI-20), as AUD-3 requires for prints and exports.

  • Who: platform.
  • Enforced by: FHIR search on AuditEvent in the server. Gap: CA:Aud's ITI-81 asks for patient.identifier, entity.identifier, agent.identifier and source.identifier; the server supports patient, entity, agent and source by reference. Searches on audit records are themselves not yet recorded as "audit log used" events.

Alignment with Infoway CA:Aud and CA:Sec​

These rules were checked on 2026-12-05 against Infoway's CA:Aud pages, which are at Reference Architecture v0.2.0 DFT-Ballot. Version 0.2.2, cited in the Linear issue, was not found. CA:Aud requires an Audit Record Repository to store events and answer ITI-81 searches, leaves retention and immutability to local policy, and asks that patient record events (created, changed or read), queries, sign-ins, security events and exports of patient data be recorded. AUD-1 to AUD-6 meet that, with the gaps each lists. The CA:Sec pages were not read; ACC-5 comes from the Linear issue's note that CA:Sec requires TLS 1.2 or later.