Skip to content

Architecture / Decision records / ADR-HIS-127

ADR-HIS-127 Consent-aware decisions and privacy labels: one decision service, a privacy stage that only narrows, consent evaluated in process, and governed label and consent content

Status Accepted
Decided 2026-12-02 by session RC-5-S03
Record Drafted 2026-12-02; awaiting approval by the Enterprise Architecture Board
Where the rule lives services/ess-runtime-decision/ (MOD-ESS-002 decision/PrivacyStage, labels/; MOD-ESS-003 api/ConsentEvaluation, decision/); the starter content in mod-ess-002/src/main/resources/policy/privacy-label-taxonomy.v1.json and mod-ess-003/src/main/resources/consent/

Context

FR-ESS-AUZ-003 asks the decision service to enforce privacy labels on resources and fields for reading, export and exchange, and to treat an unknown label as most restrictive. FR-ESS-CNS-002 asks it to take the patient's consent directives, the purpose and the recipient into the same decision, and to record an emergency or legal exception with its legal basis. Contract session RC-5-S01 added these fields to policy-decision.v1 (1.2). The decision service is MOD-ESS-002 (ADR-HIS-065), and the directives are kept by MOD-ESS-003 (ADR-HIS-073), in the same unit.

The questions left to this session: - where consent is evaluated; - how labels and consent combine with the rules evaluated in OPA; - what form the label taxonomy, the consent policy and the exception catalogue take; - how the recipient is checked; - which emergency session can carry an exception.

Options considered

  1. Where consent is evaluated. (1a) In MOD-ESS-003, behind an in-process interface that MOD-ESS-002 calls; (1b) by copying the directives into OPA's data; (1c) by an HTTP call between the two modules.
  2. How it combines with the rules. (2a) A privacy stage in Java after the OPA rules, which can only narrow their outcome; (2b) label and consent rules written in the rego evaluator.
  3. Content. (3a) Each of the label taxonomy, the consent policy and the exception catalogue is a configuration item of its own, governed by the privacy officer; (3b) all three inside the access policy.

Decision

  1. Consent is evaluated in MOD-ESS-003 (1a). MOD-ESS-002 calls ConsentEvaluation of MOD-ESS-003's api package in process, within the decision. MOD-ESS-003 alone reads the directives, so the directives are not copied and the module boundary holds. Copying them into OPA (1b) would make each withdrawal wait for a load. An HTTP call (1c) would add a network hop inside the 200 ms budget for no gain. When the evaluation fails, the decision is Deny with "Consent could not be confirmed." (fail closed).
  2. A privacy stage after the rules, which only narrows (2a). PrivacyStage runs after OPA has decided. It can turn a Permit into a Deny, or add obligations, but it never turns a Deny into a Permit. The one exception is the emergency override that the rules already offer. Its steps, in order:
  3. The recipient. For an export, exchange or disclosure, it checks the recipient:
    • an organization is checked against ess-reference readOrganization (it must be active; the answer is cached for a minute);
    • a role or application is checked against MOD-ESS-001;
    • anything else, or an unknown answer, gives Deny ("Recipient is not recognized.").
  4. Consent. It asks for consent only when the request names a patient:
    • a Deny of consent gives Deny, or Deny with override available where the rules offer one;
    • a Permit that rests on a directive or an exception is never cached (cacheLifetimeSeconds 0).
  5. Labels. It applies the label rules:
    • a resource the rules withhold for a read becomes a redact obligation, not a Deny, so that the domain shows the rest of the record and says that something is withheld (discloseRedaction);
    • a deny rule, or an unknown code on the resource, gives Deny;
    • an unknown code on a field redacts that field.
  6. Audit. It adds elevated-audit where an exception applied.

Keeping these steps in Java keeps the evaluator of ADR-HIS-065 unchanged. It also keeps the established outcomes of the enterprise test pack. 3. Governed content of its own (3a). Each item is versioned through the configuration lifecycle like the access policy: - The label taxonomy, item type ess.privacy-label-taxonomy, held by MOD-ESS-002. It carries: - the labels and their levels (open, sensitive, restricted); - category rules that label unlabelled data by service, record category or code. A rule by value set is refused until the terminology service can expand one; - ordered label rules, each selecting by label or level, action class, purpose and emergency, with the effect release, release-with-consent, redact, mask or deny; - the labels that accompany a release; - mappings for superseded codes; - discloseRedaction. - The consent policy, item type ess.consent-policy, held by MOD-ESS-003. Its rules say, for each action class, purpose and record category, whether a consent directive or a legal basis governs, and whether a recipient is required. - The exception catalogue, item type ess.consent-exception-catalogue, held by MOD-ESS-003. Each entry gives: - the exception's legal basis; - what it requires (an emergency session, or an attribute such as legalObligationRef); - which outcomes it overrides; - the privacy and legal approvals. An entry without both approvals is refused at intake.

The unapproved starter content of each item is installed only where seed-enabled is set, outside production (ADR-HIS-065 point 3). Where no consent policy is in force, consent is not governed, and the metric his.consent.policy.missing counts each such decision. 4. The action class comes from the verb. read, export, exchange, disclose or other, from the action code (LabelEvaluator.actionClass). Units therefore need no new attribute. 5. The emergency session. The request's emergencySessionId counts only when it names an Active session of the subject for the request's patient. Otherwise the subject's active session for the patient is used, if there is one. A session never crosses patients or subjects. 6. Time and audit. - Consent is evaluated at the later of the request's environment.time and the present, so a request dated in the past cannot rely on a withdrawn directive. - ess.auz.label-enforcement and ess.cns.decision name: - the recipient (subject/<id> for a read); - the legal basis: the directive's, the exception's, or label-policy/<taxonomy version>; - the resource, or ess.PolicyDecision/<decisionId> when the request names none. 7. Service sharing scope. A service identity that exports, exchanges or discloses clinical records needs the scope cli.clinical-record:share (rule clinical-record-exchange-service). Its purposes are only the uses that DEC-ESS-009 point 3 names for data leaving the facility: care through the national exchange (TREAT, COC), claims (HPAYMT), statutory reporting (PUBHLTH), release to third parties (PATRQT) and identifiable secondary use (HRESCH). Whether a given request may go ahead is then for the consent and label policies. No person is granted export or disclosure of a clinical record here: release of information is D06-HIM's (MOD-HIM-008), whose sessions name its roles. 8. The emergency override is offered only for reads. A Deny is offered as Deny with emergency override available only when the action is a read (view, read, query, list, search). Emergency access widens the patient scope for treatment and never grants an action the role lacks (FR-ESS-AUZ-002 part 13). An override offered for an export, exchange or disclosure would open an audited session that still denies. On the consent side, consent-absent is offered the override only for a permitted role reading for treatment (PR-CNS-002-1).

Consequences

  • A domain that sends labels, a recipient or an emergency session gets label and consent enforcement with no change of its own. A domain that sends none gets the decisions it got before.
  • Domains must enforce the redact, mask and accompany-labels obligations they receive; the CLI build sessions of RC-5 do so on the clinical record, and send recipient and emergencySessionId where they exchange or act under emergency access.
  • The privacy officer and legal must approve the starter taxonomy, consent policy and exception catalogue before any production use. ess-governance must register the three item types and their validation hooks.
  • The unknown label codes met in decisions become stewardship items. The privacy officer closes them through resolveUnknownLabel, and decisions keep treating a code as most restrictive until a taxonomy version that carries it is in force.