John Moehrke Element Labeling
0.2.0 - ci-build International flag

John Moehrke Element Labeling, published by John Moehrke (Moehrke Research LLC). This guide is not an authorized publication; it is the continuous build for version 0.2.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/JohnMoehrke/ElementLabeling/ and changes regularly. See the Directory of published versions

Home

Official URL: http://johnmoehrke.github.io/ElementLabeling/ImplementationGuide/johnmoehrke.elementlabeling.example Version: 0.2.0
Draft as of 2026-12-03 Computable Name: JohnMoehrkeElementLabeling
Other Identifiers: OID:1.3.6.1.4.1.66281.2.20

This is an experimental IG. The content is fully from the perspective of the author, and is not endorsed by HL7 or any other organization. It is intended to be a discussion starter, and to solicit feedback from the community.

An experimental FHIR implementation guide showing how Element Labeling of data can be done and how a Consent can permit or deny access to that data. This also includes example of use of a rule based on a region outside a given Location, and use of consent limits.


This IG is founded on HL7 FHIR Revision 4.0.1 found at http://hl7.org/fhir/R4/

This IG is founded on the CURRENT/LATEST version of the FHIR Extension Registry.

Scope

Other scenarios have shown Resource level labeling of data, with the assistance of a Security Labeling Service (SLS). However there are some use-cases where Resource level labeling is too gross:

  • Patient resource can contain more specifically sensitive information such as a specific address (staying at a protective services address), or specific name (such as historic name that should not be disclosed)
  • Composition resource that can have some sections that are specifically sensitive, such a mental health procedure or abortion procedure.

For these there is an extension in the FHIR extension registry http://hl7.org/fhir/StructureDefinition/element-securityLabel that can be used to identify these elements.

Element Level labeling is not something that can be automated such as the Resource level labeling applied by a Security Labeling Service (SLS). As the elements to be labeled are labeled specifically with a given human need. This does not mean it can never be automated, but rather to indicate that it is more likely to be something applied manually by either the patient, their caregiver, or another authorized individual.

Consent can then indicate that these element level labeled data must be redacted in specific situations. In this case the Consent is setting a rule against allowing the sensitive data outside of the state http://hl7.org/fhir/StructureDefinition/consent-notLocation. There is an alternative that uses http://hl7.org/fhir/StructureDefinition/consent-provision-limit to have a rule that requires redaction of the sensitive topics.

Actors

The technical actors involved in element labeling and consent enforcement are defined by this guide:

  • Consent Author: The technical system that records the data subject's decisions as Consent resources, including element-level permit and deny rules.
  • Access Control: The abstract technical system responsible for enforcing applicable Consents. It retrieves and evaluates Consent provisions, including the declared PurposeOfUse, requesting actor, and element-security-label limits.
  • Data Requester: The system that directly requests and accesses data. It declares the applicable PurposeOfUse code for an access, and attributes the access to a specific organization or individual.
    • EnforcementPoint: The Data Requester includes an enforcement point responsible for applying the access control decisions to the actual data access.

The actor responsibilities are summarized by the Data Requester CapabilityStatement, Consent Author CapabilityStatement, and Access Control CapabilityStatement.

Consent authoring and data labeling are separate activities that use a shared interpretation of security labels. The Consent records the rule; the labels identify the information to which that rule applies. Access Control first determines authorization, then enforces the decision against the requested data before releasing a response.

sequenceDiagram
    participant Author as Consent Author
    participant Store as Labeled Data Store
    participant AC as Access Control
    participant Requester as Data Requester

    Note over Author,Requester: Preparation
    Author->>Store: Record or update the data subject's Consent
    Note over Store: Independently, an authorized person or service<br/>labels and stores clinical data

    Note over Author,Requester: Access request
    Requester->>AC: Request data with purpose, identity and location context
    AC->>Store: Retrieve applicable Consent and requested data
    Store-->>AC: Consent and data with resource and element labels
    AC->>AC: Determine authorization using Consent,<br/>labels, verified context and governing policy
    AC->>AC: Enforce decision and required obligations<br/>against the requested data

    alt Access denied or required enforcement cannot be completed
        AC-->>Requester: Denial or error - no protected data
    else Redacted disclosure authorized and enforcement completed
        AC-->>Requester: Permitted data only, with updated labels<br/>and redaction indicators
    else Full disclosure authorized and enforcement completed
        AC-->>Requester: Full data with applicable labels
    end
    Note over Requester: Honor restrictions on received data

The Labeled Data Store represents logical storage for Consents and clinical data, not a requirement to use one physical repository. It and the labeling activity are not additional actors defined by this guide. Resource-level labeling can be assisted by a Security Labeling Service, while element-level choices may need an authorized person's input. Neither applying a label nor recording a Consent grants access on its own. A permit subject to redaction results in disclosure only after the required redaction has been enforced; inability to enforce an applicable rule does not result in unrestricted access.

Use-cases

Use-cases in this guide demonstrate that a resource can contain mixed-sensitivity data and that the access decision can be made against an element's inline security label rather than against the whole resource.

The requirements within these use-cases apply to systems claiming conformance to this experimental guide. SHALL indicates a mandatory requirement, SHOULD indicates a recommendation from which an implementation may depart with a justified reason, and MAY indicates an optional capability. They supplement the CapabilityStatements without prescribing a particular authentication protocol or policy engine.

Resource-level and inline labels

Each code applied to an element with element-securityLabel is also included in the resource's meta.security. The resource-level code signals that the resource contains information with that classification; PROCESSINLINELABEL signals that inline labels need to be processed. Without support for inline labeling, the resource-level code must be considered when deciding access to the whole resource. With inline labeling, the corresponding inline labels identify the elements to which that classification applies, allowing a more precise decision.

This assures that access control that can only evaluate resource-level labels will not inadvertently grant access to sensitive elements that are individually labeled.

A resource-level sensitivity code that is found as an element level label only applies at the element level. Therefore if all elements labeled with that sensitivity code are removed then the resource is no longer considered to have that sensitivity.

By replicating inline labels at the .meta.security level, the Access Control can quickly determine the Resources that need special handling. Further to find the PROCESSINLINELABEL code indicates that there are still inline labels that require processing.

Before disclosing a resource containing inline security labels, Access Control SHALL ensure that each inline label code is also present in the resource's meta.security.§reflect-inline-labels When all content associated with an inline label code has been redacted, Access Control SHALL remove that code from the returned resource's meta.security if it is not otherwise applicable or required by policy.§remove-obsolete-inline-codes

PROCESSINLINELABEL is a handling instruction, not a sensitivity code: it remains appropriate when any inline labels still need processing, but should be removed when none remain and no other policy requires it. Other applicable labels remain, and REDACTED can indicate that information was withheld.

For each access, the Data Requester SHALL declare the applicable PurposeOfUse and identify the organization or individual on whose behalf the request is made.§request-context Access Control SHALL retrieve and evaluate the applicable Consents and other governing policies before releasing information, taking account of Consent status, applicable periods, purposes, requesting parties, location conditions, and obligations.§evaluate-consents Access Control SHALL use a defined policy for combining applicable rules, including conflicting provisions.§combine-rules

Labeled data within a Patient

The Patient with element-level security labels example shows how a historic name, protective-services address, medical identifier, gender identity, and recorded sex or gender can be individually labeled. The resource uses meta.security with PROCESSINLINELABEL, restricted confidentiality, and resource-level sensitivity codes. The element-securityLabel extension marks the historic name as unreliable, the address as a living arrangement or protected location, the identifier as an identity identifier, and the gender-related extensions with the GENDER code. The official name remains unlabeled, illustrating that element labeling does not require all data in a Patient to be affected.

When PROCESSINLINELABEL is present, Access Control SHALL process the inline labels before disclosure or withhold information whose release it cannot establish is permitted.§process-inline-labels

The Consent Author MAY assist an authorized person in selecting elements and labels or previewing a redacted view.§assist-label-selection Recording a Consent does not itself apply labels to clinical data or enforce the decision.

The gender identity and recorded sex or gender examples are intentionally separate:

  • The gender identity extension identifies the individual's personal gender identity.
  • The recorded sex or gender extension records the male sex assigned at birth, its 1923-07-25 effective period, acquisition information, Wisconsin jurisdiction, source field, and a clarifying comment.

Depending on the applicable Consent and policy, a request to access the Patient can have three outcomes:

  1. No access is granted at all.
  2. Access is granted only to the extent that the element-level security labels COULD be used to redact that data leaving a nominal view of the resource.
  3. The requesting system is authorized to receive the sensitive data and trusted to enforce the applicable restrictions, so it receives the full resource with all sensitive elements included and labeled.

Access Control SHALL enforce the resulting decision.§enforce-decision Access Control SHALL NOT allow trust in a recipient to override an applicable denial or otherwise substitute for authorization.§require-authorization The Data Requester MAY request a redacted view when it cannot receive the full resource; that request does not require disclosure of information that the applicable Consent or policy prohibits.§request-redacted-view

When producing a redacted Patient, Access Control SHALL remove disallowed content from structured elements and narrative, including repeated details and references that would disclose the withheld information.§redact-content Access Control SHALL ensure that the result remains valid for the conformance claims made in the response.§valid-redacted-resource If necessary redaction would make the resource invalid, Access Control SHALL withhold the affected resource rather than return it as a conformant resource.§withhold-invalid-resource These redaction requirements also apply to the Composition use-case below.

The Data Requester SHALL NOT represent a view known to be redacted as a complete record.§do-not-claim-completeness The Data Requester SHOULD make the possibility of withheld information apparent to users making clinical decisions, without revealing the withheld content (related to do-not-claim-completeness).§show-incompleteness

Labeled sections within a Composition

The Composition with element-level security labels example applies the same approach to a clinical summary. It includes both ordinary summary sections and specially labeled sensitive sections:

  • Problems link to hypertension, right-knee osteoarthritis, and depressive disorder Conditions. The section itself is unlabeled; the depressive disorder Condition carries resource-level BH and restricted confidentiality labels. The nominal view retains the ordinary problems but omits the depression reference. Its section narrative does not repeat the sensitive diagnosis.
  • Allergies link to an active aspirin allergy and an active penicillin allergy.
  • Medications link to multivitamin and lisinopril medication statements.
  • Immunizations link to MMR, COVID-19, and seasonal influenza records.
  • The mental-health assessment section is labeled BH and links to a PHQ-9 depression observation and an outpatient psychotherapy procedure. These supporting resources use resource-level BH and restricted confidentiality labels, but do not add element-level labels.
  • The reproductive-health section is labeled SEX and links to a historical pregnancy observation and an abortion procedure. These supporting resources use resource-level SEX and restricted confidentiality labels, but do not add element-level labels.

The overall Composition carries PROCESSINLINELABEL, restricted confidentiality, SEX, and BH resource-level security metadata. It demonstrates that ordinary sections can remain available while access control evaluates the separately labeled sensitive sections and supporting resources.

Access Control SHALL evaluate referenced resources independently and enforce the same applicable restrictions when those resources are requested directly or included in a response.§protect-referenced-resources Removing a Composition section alone is not protection for the resources it references. In the Problems section, this includes removing the disallowed depression reference while retaining the permitted entries and ensuring that the narrative does not repeat the withheld diagnosis.

Depending on the applicable Consent and policy, a request to access the Composition can have three outcomes:

  1. No access is granted at all.
  2. The element-level security labels and referenced resources' security labels are used to remove disallowed sections and references, leaving a nominal view of the Composition.
  3. The requesting system is authorized to receive the sensitive data and trusted to enforce the applicable restrictions, so it receives the full resource with all sensitive elements included and labeled.

Trust alone does not override Consent or authorize disclosure to a recipient without the appropriate permissions.

For a redacted data, Access Control SHALL ensure that security metadata describes the resulting view, retaining labels for content that remains and changing confidentiality only as authorized by policy.§update-security-metadata Access Control SHOULD mark redacted views with REDACTED in meta.security and indicate that information has been withheld without revealing that information.§mark-redacted-view

The Data Requester SHALL enforce restrictions and obligations applicable to information it receives, including subsequent use or disclosure.§enforce-received-obligations The Data Requester SHOULD preserve applicable security labels and redaction indicators when storing or forwarding information.§preserve-security-metadata The Data Requester SHALL ensure that any changes it makes to the security metadata are authorized by the applicable policy.§authorize-metadata-changes Being able to process labels does not itself authorize receipt of sensitive information.

Deny for out of state

The Deny out of state access to sensitive elements Consent is a deny example for the TREAT purpose of use from out-of-state locations. Its provision targets the BH and SEX sensitivity labels, covering the matching sensitive sections and supporting resources. These topic labels are distinct from the R and V confidentiality levels; this Consent does not express a blanket restriction on sensitive Patient names, addresses, or identifiers. This demonstrates how labels are evaluated when a Consent prohibits access for a specific purpose.

To record such a decision, the Consent Author SHALL create Consent resources associated with the correct patient, including the status and provisions needed to express the data subject's decisions.§record-consent The Consent Author SHALL support updating those resources when the decisions change.§update-consent The Consent Author SHALL represent permit or deny decisions, applicable purposes, label criteria, and location conditions without changing their intended meaning.§preserve-consent-meaning The Consent Author SHALL provide methods for the patient to label resources or elements within resources according to the applicable classification scheme.§provide-labeling-methods

For location-based decisions, the Data Requester SHALL provide the request context required by the applicable policy, including access location.§provide-location-context The Data Requester SHALL NOT misrepresent purpose, identity, or location to obtain access.§accurate-request-context Access Control SHALL establish a trustworthy basis for the requester's identity, declared purpose, and any location used in the decision.§verify-request-context Access Control SHALL NOT treat an unverified location assertion as sufficient evidence that a location-based restriction does not apply.§verify-location

An alternative Redact sensitive elements for access from out of state Consent allows out-of-state access once the sensitive elements have been redacted, ensuring that only non-sensitive information is accessible to actors without the appropriate permissions.

When recording the element level redaction alternative, the Consent Author SHALL represent the redaction obligation in the Consent.§record-redaction-obligation The Consent Author SHOULD explain the effect of the rules in terms understandable to the data subject or authorized representative, including the difference between denying access and permitting access subject to redaction.§explain-consent-rules The Consent Author SHOULD check that the intended enforcement system can interpret the rules and surface unsupported or ambiguous provisions rather than implying that they will be enforced.§check-enforceability

Access Control SHALL NOT release information when an applicable rule or modifier extension cannot be interpreted or its required obligation cannot be fulfilled.§withhold-unenforceable-content Access Control SHALL make access denied explicit through an appropriate error or denial response without exposing protected content.§report-enforcement-failure Access Control MAY delegate evaluation or redaction to a recipient trusted to enforce the applicable restrictions and obligations.§delegate-enforcement When delegating, Access Control SHALL ensure that the applicable restrictions and obligations are enforced before disclosure.§ensure-delegated-enforcement These requirements apply to both the deny and redaction alternatives.

For each access decision, Access Control SHOULD retain an audit record of the applicable Consent or policy and whether information was denied, redacted, or disclosed, while protecting sensitive information in that record.§audit-access-decision

Conclusion

The above examples are showing simply how element-level labeling and consent management can be applied in practice, highlighting the need for fine-grained control over sensitive data elements within FHIR resources. Note that use of element level labeling is only useful when there are enforcement mechanisms in place to respect and act upon these labels correctly by redacting them when necessary.

Requirements

The following requirements are not new, but are specifically relevant to the handling of element-level security labels and consent management within FHIR resources. These requirements are not limited to interoperability concerns but include both functional and non functional systems design requirements. They emphasize the need for proper enforcement, auditing, and adherence to the defined rules and obligations.

IdExpectationActorsRule
 SHALL
 MAY
 SHALL NOT
 SHOULD
 Access Control
 Consent Author
 Data Requester
§accurate-request-contextSHALL NOTData RequesterThe Data Requester SHALL NOT misrepresent purpose, identity, or location to obtain access.
§assist-label-selectionMAYConsent AuthorThe Consent Author MAY assist an authorized person in selecting elements and labels or previewing a redacted view.
§audit-access-decisionSHOULDAccess ControlFor each access decision, Access Control SHOULD retain an audit record of the applicable Consent or policy and whether information was denied, redacted, or disclosed, while protecting sensitive information in that record.
§authorize-metadata-changesSHALLData RequesterThe Data Requester SHALL ensure that any changes it makes to the security metadata are authorized by the applicable policy.
§check-enforceabilitySHOULDConsent AuthorThe Consent Author SHOULD check that the intended enforcement system can interpret the rules and surface unsupported or ambiguous provisions rather than implying that they will be enforced.
§combine-rulesSHALLAccess ControlAccess Control SHALL use a defined policy for combining applicable rules, including conflicting provisions.
§delegate-enforcementMAYAccess ControlAccess Control MAY delegate evaluation or redaction to a recipient trusted to enforce the applicable restrictions and obligations.
§do-not-claim-completenessSHALL NOTData RequesterThe Data Requester SHALL NOT represent a view known to be redacted as a complete record.
§enforce-decisionSHALLAccess ControlAccess Control SHALL enforce the resulting decision.
§enforce-received-obligationsSHALLData RequesterThe Data Requester SHALL enforce restrictions and obligations applicable to information it receives, including subsequent use or disclosure.
§ensure-delegated-enforcementSHALLAccess ControlWhen delegating, Access Control SHALL ensure that the applicable restrictions and obligations are enforced before disclosure.
§evaluate-consentsSHALLAccess ControlAccess Control SHALL retrieve and evaluate the applicable Consents and other governing policies before releasing information, taking account of Consent status, applicable periods, purposes, requesting parties, location conditions, and obligations.
§explain-consent-rulesSHOULDConsent AuthorThe Consent Author SHOULD explain the effect of the rules in terms understandable to the data subject or authorized representative, including the difference between denying access and permitting access subject to redaction.
§mark-redacted-viewSHOULDAccess ControlAccess Control SHOULD mark redacted views with REDACTED in meta.security and indicate that information has been withheld without revealing that information.
§preserve-consent-meaningSHALLConsent AuthorThe Consent Author SHALL represent permit or deny decisions, applicable purposes, label criteria, and location conditions without changing their intended meaning.
§preserve-security-metadataSHOULDData RequesterThe Data Requester SHOULD preserve applicable security labels and redaction indicators when storing or forwarding information.
§process-inline-labelsSHALLAccess ControlWhen PROCESSINLINELABEL is present, Access Control SHALL process the inline labels before disclosure or withhold information whose release it cannot establish is permitted.
§protect-referenced-resourcesSHALLAccess ControlAccess Control SHALL evaluate referenced resources independently and enforce the same applicable restrictions when those resources are requested directly or included in a response.
§provide-labeling-methodsSHALLConsent AuthorThe Consent Author SHALL provide methods for the patient to label resources or elements within resources according to the applicable classification scheme.
§provide-location-contextSHALLData RequesterFor location-based decisions, the Data Requester SHALL provide the request context required by the applicable policy, including access location.
§record-consentSHALLConsent AuthorTo record such a decision, the Consent Author SHALL create Consent resources associated with the correct patient, including the status and provisions needed to express the data subject's decisions.
§record-redaction-obligationSHALLConsent AuthorWhen recording the element level redaction alternative, the Consent Author SHALL represent the redaction obligation in the Consent.
§redact-contentSHALLAccess ControlWhen producing a redacted Patient, Access Control SHALL remove disallowed content from structured elements and narrative, including repeated details and references that would disclose the withheld information.
§reflect-inline-labelsSHALLAccess ControlBefore disclosing a resource containing inline security labels, Access Control SHALL ensure that each inline label code is also present in the resource's meta.security.
§remove-obsolete-inline-codesSHALLAccess ControlWhen all content associated with an inline label code has been redacted, Access Control SHALL remove that code from the returned resource's meta.security if it is not otherwise applicable or required by policy.
§report-enforcement-failureSHALLAccess ControlAccess Control SHALL make access denied explicit through an appropriate error or denial response without exposing protected content.
§request-contextSHALLData RequesterFor each access, the Data Requester SHALL declare the applicable PurposeOfUse and identify the organization or individual on whose behalf the request is made.
§request-redacted-viewMAYData RequesterThe Data Requester MAY request a redacted view when it cannot receive the full resource; that request does not require disclosure of information that the applicable Consent or policy prohibits.
§require-authorizationSHALL NOTAccess ControlAccess Control SHALL NOT allow trust in a recipient to override an applicable denial or otherwise substitute for authorization.
§show-incompletenessSHOULDData RequesterThe Data Requester SHOULD make the possibility of withheld information apparent to users making clinical decisions, without revealing the withheld content (related to do-not-claim-completeness).
§update-consentSHALLConsent AuthorThe Consent Author SHALL support updating those resources when the decisions change.
§update-security-metadataSHALLAccess ControlFor a redacted data, Access Control SHALL ensure that security metadata describes the resulting view, retaining labels for content that remains and changing confidentiality only as authorized by policy.
§valid-redacted-resourceSHALLAccess ControlAccess Control SHALL ensure that the result remains valid for the conformance claims made in the response.
§verify-locationSHALL NOTAccess ControlAccess Control SHALL NOT treat an unverified location assertion as sufficient evidence that a location-based restriction does not apply.
§verify-request-contextSHALLAccess ControlAccess Control SHALL establish a trustworthy basis for the requester's identity, declared purpose, and any location used in the decision.
§withhold-invalid-resourceSHALLAccess ControlIf necessary redaction would make the resource invalid, Access Control SHALL withhold the affected resource rather than return it as a conformant resource.
§withhold-unenforceable-contentSHALL NOTAccess ControlAccess Control SHALL NOT release information when an applicable rule or modifier extension cannot be interpreted or its required obligation cannot be fulfilled.