<?xml version="1.0" encoding="UTF-8"?>
<!-- 
 * #%L
 * org.hl7.fhir.r5
 * %%
 * Copyright (C) 2014 - 2019 Health Level 7
 * %%
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * #L%
 */

/*
  Copyright (c) 2011+, HL7, Inc.
  All rights reserved.
  
  Redistribution and use in source and binary forms, with or without modification, 
  are permitted provided that the following conditions are met:
  
   * Redistributions of source code must retain the above copyright notice, this 
     list of conditions and the following disclaimer.
   * Redistributions in binary form must reproduce the above copyright notice, 
     this list of conditions and the following disclaimer in the documentation 
     and/or other materials provided with the distribution.
   * Neither the name of HL7 nor the names of its contributors may be used to 
     endorse or promote products derived from this software without specific 
     prior written permission.
  
  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
  POSSIBILITY OF SUCH DAMAGE.
  

  Generated on Sat, Jun 13, 2026 16:03+0000 for FHIR v6.0.0-ballot4 

  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources
  valid. Implementers will still need to be familiar with the content of the specification and with
  any profiles that apply to the resources in order to make a conformant implementation.

-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://hl7.org/fhir" xmlns:xhtml="http://www.w3.org/1999/xhtml" targetNamespace="http://hl7.org/fhir" elementFormDefault="qualified" version="1.0">
  <xs:include schemaLocation="fhir-base.xsd"/>
  <xs:element name="Consent" type="Consent">
    <xs:annotation>
      <xs:documentation xml:lang="en">A record of a healthcare consumer’s  choices  or choices made on their behalf by a third party, which permits or denies identified recipient(s) or recipient role(s) to perform one or more actions within a given policy context, for specific purposes and periods of time.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Consent">
    <xs:annotation>
      <xs:documentation xml:lang="en">A record of a healthcare consumer’s  choices  or choices made on their behalf by a third party, which permits or denies identified recipient(s) or recipient role(s) to perform one or more actions within a given policy context, for specific purposes and periods of time.</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">Unique identifier for this copy of the Consent Statement.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="ConsentState">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates the current state of this Consent resource.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="category" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A classification of the type of consents found in the statement. This element supports indexing and retrieval of consent statements.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The patient, healthcare practitioner, research subject, or a group of persons to whom this consent applies.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="date" minOccurs="0" maxOccurs="1" type="date">
            <xs:annotation>
              <xs:documentation xml:lang="en">Date the consent instance was agreed to.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="period" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">Effective period for this Consent Resource and all provisions unless specified in that provision.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="grantor" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The entity responsible for granting the rights listed in a Consent Directive.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="grantee" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The entity responsible for complying with the Consent Directive, including any obligations or limitations on authorizations and enforcement of prohibitions.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="manager" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The actor that manages the consent through its lifecycle.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="controller" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The actor that controls/enforces the access according to the consent.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="sourceAttachment" minOccurs="0" maxOccurs="unbounded" type="Attachment">
            <xs:annotation>
              <xs:documentation xml:lang="en">The source on which this consent statement is based. The source might be a scanned original paper form.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="sourceReference" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A reference to a consent that links back to such a source, a reference to a document repository (e.g. XDS) that stores the original consent document.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="regulatoryBasis" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A set of codes that indicate the regulatory basis (if any) that this consent supports.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="policyBasis" type="Consent.PolicyBasis" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">A Reference or URL used to uniquely identify the policy the organization will enforce for this Consent. This Reference or URL should be specific to the version of the policy and should be dereferencable to a computable policy of some form.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="policyText" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A Reference to the human readable policy explaining the basis for the Consent.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="verification" type="Consent.Verification" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Whether the consent instructions/rules (e.g. artificial respiration: yes or no) have been verified with the patient, his/her family, or another authorized person.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="decision" minOccurs="0" maxOccurs="1" type="ConsentProvisionType">
            <xs:annotation>
              <xs:documentation xml:lang="en">Action to take - permit or deny - as default.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="provision" type="Consent.Provision" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Constraints and exceptions to the base policy that can add or remove some access permissions under specific conditions.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Consent.PolicyBasis">
    <xs:annotation>
      <xs:documentation xml:lang="en">A record of a healthcare consumer’s  choices  or choices made on their behalf by a third party, which permits or denies identified recipient(s) or recipient role(s) to perform one or more actions within a given policy context, for specific purposes and periods of time.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="reference" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A Reference that identifies the policy the organization will enforce for this Consent.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="uri" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">A URI that links to a computable version of the policy the organization will enforce for this Consent.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Consent.Verification">
    <xs:annotation>
      <xs:documentation xml:lang="en">A record of a healthcare consumer’s  choices  or choices made on their behalf by a third party, which permits or denies identified recipient(s) or recipient role(s) to perform one or more actions within a given policy context, for specific purposes and periods of time.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="verified" minOccurs="1" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">Has the instruction been verified.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Extensible list of verification type starting with verification and re-validation.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="verifiedBy" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The person who conducted the verification/validation of the Grantor decision.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="verifiedWith" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Who verified the instruction (Patient, Relative or other Authorized Person).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="date" minOccurs="0" maxOccurs="unbounded" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">Date(s) verification was collected.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Consent.Provision">
    <xs:annotation>
      <xs:documentation xml:lang="en">A record of a healthcare consumer’s  choices  or choices made on their behalf by a third party, which permits or denies identified recipient(s) or recipient role(s) to perform one or more actions within a given policy context, for specific purposes and periods of time.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="period" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">Time frame for this provision.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="actor" type="Consent.Actor" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Who or what is controlled by this provision. Use group to identify a set of actors by some property they share (e.g. 'admitting officers').</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="action" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Actions controlled by this provision.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="securityLabel" minOccurs="0" maxOccurs="unbounded" type="Coding">
            <xs:annotation>
              <xs:documentation xml:lang="en">A security label, comprised of 0..* security label fields (Privacy tags), which define which resources are controlled by this exception.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="purpose" minOccurs="0" maxOccurs="unbounded" type="Coding">
            <xs:annotation>
              <xs:documentation xml:lang="en">The context of the activities a user is taking - why the user is accessing the data - that are controlled by this provision.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="documentType" minOccurs="0" maxOccurs="unbounded" type="Coding">
            <xs:annotation>
              <xs:documentation xml:lang="en">The documentType(s) covered by this provision. The type can be a CDA document, or some other type that indicates what sort of information the consent relates to.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="resourceType" minOccurs="0" maxOccurs="unbounded" type="Coding">
            <xs:annotation>
              <xs:documentation xml:lang="en">The resourceType(s) covered by this provision. The type can be a FHIR resource type or a profile on a type that indicates what information the consent relates to.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">If this code is found in an instance, then the provision applies.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="dataPeriod" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">Clinical or Operational Relevant period of time that bounds the data controlled by this provision.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="data" type="Consent.Data" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The resources controlled by this provision if specific resources are referenced.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="expression" minOccurs="0" maxOccurs="1" type="Expression">
            <xs:annotation>
              <xs:documentation xml:lang="en">A computable (FHIRPath or other) definition of what is controlled by this consent.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="provision" type="Consent.Provision" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Nested provisions adding further constraints and exceptions to the parent provision.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Consent.Actor">
    <xs:annotation>
      <xs:documentation xml:lang="en">A record of a healthcare consumer’s  choices  or choices made on their behalf by a third party, which permits or denies identified recipient(s) or recipient role(s) to perform one or more actions within a given policy context, for specific purposes and periods of time.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="role" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">How the individual is involved in the resources content that is described in the exception.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="reference" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The resource that identifies the actor. To identify actors by type, use group to identify a set of actors by some property they share (e.g. 'admitting officers').</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Consent.Data">
    <xs:annotation>
      <xs:documentation xml:lang="en">A record of a healthcare consumer’s  choices  or choices made on their behalf by a third party, which permits or denies identified recipient(s) or recipient role(s) to perform one or more actions within a given policy context, for specific purposes and periods of time.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="meaning" minOccurs="1" maxOccurs="1" type="ConsentDataMeaning">
            <xs:annotation>
              <xs:documentation xml:lang="en">How the resource reference is interpreted when testing consent restrictions.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="reference" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A reference to a specific resource that defines which resources are covered by this consent.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ConsentProvisionTypeEnum">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="deny">
        <xs:annotation>
          <xs:documentation xml:lang="en">Deny</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="permit">
        <xs:annotation>
          <xs:documentation xml:lang="en">Permit</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ConsentProvisionType">
    <xs:annotation>
      <xs:documentation xml:lang="en"></xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:attribute name="value" type="ConsentProvisionTypeEnum" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ConsentDataMeaningEnum">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="instance">
        <xs:annotation>
          <xs:documentation xml:lang="en">Instance</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="related">
        <xs:annotation>
          <xs:documentation xml:lang="en">Related</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="dependents">
        <xs:annotation>
          <xs:documentation xml:lang="en">Dependents</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="authoredby">
        <xs:annotation>
          <xs:documentation xml:lang="en">AuthoredBy</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ConsentDataMeaning">
    <xs:annotation>
      <xs:documentation xml:lang="en"></xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:attribute name="value" type="ConsentDataMeaningEnum" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ConsentStateEnum">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="draft">
        <xs:annotation>
          <xs:documentation xml:lang="en">Pending</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="active">
        <xs:annotation>
          <xs:documentation xml:lang="en">Active</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="inactive">
        <xs:annotation>
          <xs:documentation xml:lang="en">Inactive</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="not-done">
        <xs:annotation>
          <xs:documentation xml:lang="en">Abandoned</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="entered-in-error">
        <xs:annotation>
          <xs:documentation xml:lang="en">Entered in Error</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="unknown">
        <xs:annotation>
          <xs:documentation xml:lang="en">Unknown</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ConsentState">
    <xs:annotation>
      <xs:documentation xml:lang="en"></xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:attribute name="value" type="ConsentStateEnum" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
</xs:schema>
