Access control in openEHR: a settings model for EHR_ACCESS

Hi all,

SPECRM-133 proposes to deprecate EHR_ACCESS, VERSIONED_EHR_ACCESS and ACCESS_CONTROL_SETTINGS, and to make EHR.ehr_access optional. @ian.mcnicoll brought it up in the SEC, and I’d like to make the case for keeping it. I’ve also been building something in FerroEHR that might help, so I’ll share that too. Ian, very curious what you think.

Why I’d keep it

The ticket says nobody has specified a settings class since 2015, and that implementers handle access control outside the EHR anyway. I agree with the first part. I just don’t think it means the class is wrong. It means the work was never done.

The EHR IM is quite clear about what EHR_ACCESS is for: “All access decisions to data in the EHR must be made in accordance with the policies and rules in this object” (EHR_ACCESS class). It’s versioned with the record, so you can always see which settings applied at a given moment (EHR Access). And the Architecture Overview already describes what should go in it: an access list, a gate-keeper who controls it (usually the patient), and the idea that “data sharing must be controlled by patient consent”, including limited access to things like sexual or mental health data (Access Control, Privacy, Confidentiality and Consent).

This has come up here before. Back in 2020 @thomas.beale wrote:

(Where is the security information model?, and see also EHR_ACCESS is left as an exercise for the reader and access control for openEHR ‘resources’.)

That’s pretty much what I tried to do.

What we lose if it goes

If EHR_ACCESS is deprecated, consent and restrictions stay in whatever IAM or policy product each vendor uses. A patient who moves to another CDR, or whose record is sent as an EHR Extract, loses their consent along the way.

That gets harder to defend with the EHDS coming. Regulation (EU) 2025/327 gives patients the right to restrict which health professionals can see their data (Art. 8) and to opt out (Art. 10), and it allows emergency access to restricted data (Art. 11(5)). Those decisions belong to the patient’s record. If every vendor stores them their own way, none of it can be exchanged.

There’s also a practical side. A policy engine outside the CDR doesn’t know what a template, an archetype or a composition is. So a simple wish like “hide my mental health notes, except from my psychiatrist” has to be modelled again in some other language, outside openEHR.

The idea: ABAC in the CDR as well

The RBAC side can already live in the CDR. The Demographic IM has ROLE and CAPABILITY, so who someone is and what they may do can be openEHR content today. What’s not there is the patient’s side and the organisation’s side.

If those go into the CDR too, the whole access decision is made from openEHR data. Any openEHR system can read it, and it moves with the record.

What I’m building in FerroEHR

I wrote this up as a small RM package. It only adds classes, nothing existing changes.

The patient’s part goes in EHR_ACCESS.settings, as a new subtype ACCESS_DIRECTIVE_SETTINGS. It holds their directives (permit or deny, with exceptions), the gate-keepers, and sensitivity labels on specific entries. A directive can be narrowed to certain people or roles, certain data (by template, archetype, category or sensitivity), certain operations, a purpose and a time window.

For the person asking for access I didn’t add anything. It uses ROLE, CAPABILITY credentials (coded: what they may do, which sensitivities they’re cleared for) and PARTY_RELATIONSHIP for care teams and “under care of”.

The organisation’s rules go in a separate, versioned ACCESS_POLICY: how data is classified, whether a care relationship and a purpose are required, and a set of standard consents a patient can sign up to.

I deliberately left out a rule language like XACML. The settings only record what the patient and the organisation decided, and the CDR always evaluates them the same way: if any directive says no, the answer is no. Because the CDR knows which directive made the call, it can write that into the access log, which helps when a patient asks why someone was or wasn’t able to see their data. I’ve also worked out how it maps to FHIR Consent and to IHE BPPC and APPC, since that’s how most other systems exchange consent today.

The access log side is in my earlier topic, with its own BMM.

It’s an early draft and I’m sure there’s plenty to improve. Mostly I’d like to find out if others also think EHR_ACCESS is worth keeping and filling in, before we deprecate it.

Ruben