<?xml version="1.0" encoding="US-ASCII"?>
<?xml-stylesheet type='text/xsl' href='http://xml2rfc.tools.ietf.org/authoring/rfc2629.xslt' ?>
<!DOCTYPE rfc PUBLIC "-//IETF//DTD RFC 2629//EN"
"http://xml2rfc.tools.ietf.org/authoring/rfc2629.dtd">
<!--
  NOTE:  This XML file is input used to produce the authoritative copy of an
  OpenID Foundation specification.  The authoritative copy is the HTML output.
  This XML source file is not authoritative.  The statement ipr="none" is
  present only to satisfy the document compilation tool and is not indicative
  of the IPR status of this specification.  The IPR for this specification is
  described in the "Notices" section.  This is a public OpenID Foundation
  document and not a private document, as the private="..." declaration could
  be taken to indicate.
-->
<rfc category="std" docName="openid-heart-fhir-oauth2" ipr="none">
  <?rfc toc="yes" ?>

  <?rfc tocdepth="5" ?>

  <?rfc symrefs="yes" ?>

  <?rfc sortrefs="yes"?>

  <?rfc strict="yes" ?>

  <?rfc iprnotified="no" ?>

  <?rfc private="Final" ?>

  <front>
    <title abbrev="HEART FHIR OAuth 2.0">Health Relationship Trust Profile for
    Fast Healthcare Interoperability Resources (FHIR) OAuth 2.0 Scopes</title>

    <author fullname="Justin Richer" initials="J." role="editor"
            surname="Richer">
      <address>
        <email>openid@justin.richer.org</email>

        <uri/>
      </address>
    </author>

    <author fullname="Josh Mandel" initials="J." surname="Mandel">
      <organization>Harvard Medical School Department of Biomedical
      Informatics</organization>

      <address>
        <postal>
          <street/>

          <city/>

          <region/>

          <code/>

          <country/>
        </postal>

        <phone/>

        <facsimile/>

        <email>Joshua.Mandel@childrens.harvard.edu</email>

        <uri/>
      </address>
    </author>

    <date day="25" month="May" year="2017"/>

    <workgroup>OpenID Heart Working Group</workgroup>

    <abstract>
      <t>FHIR is an HTTP-based, resource-oriented RESTful API based on a set
      of clinical, administrative, financial, and infrastructure resource
      definitions. The API supports create, read, update, delete, and search
      operations, as well as a framework for ad-hoc operations.</t>

      <t>The OAuth 2.0 protocol framework defines a mechanism to allow a
      resource owner to delegate access to a protected resource for a client
      application, optionally limited by a set of scopes.</t>

      <t>This specification profiles the OAuth 2.0 protocol scopes to be used
      with the FHIR protocol to increase baseline security, provide greater
      interoperability, and structure deployments in a manner specifically
      applicable to (but not limited to) the healthcare domain.</t>
    </abstract>
  </front>

  <middle>
    <section anchor="Introduction" title="Introduction">
      <t>This document profiles the OAuth 2.0 web authorization framework for
      use in the context of securing Representational State Transfer (RESTful)
      interfaces using the Fast Health Interoperable Resources (FHIR)
      protocol. The FHIR OAuth 2.0 profile defined in this document serve to
      define a baseline set of FHIR OAuth scopes suitable for a wide range of
      use cases, while maintaining reasonable ease of implementation and
      functionality.</t>

      <section anchor="rnc" title="Requirements Notation and Conventions">
        <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
        "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
        "OPTIONAL" in this document are to be interpreted as described in
        <xref target="RFC2119">RFC 2119</xref>.</t>

        <t>All uses of <xref target="RFC7517">JSON Web Signature (JWS)</xref>
        and <xref target="RFC7518">JSON Web Encryption (JWE)</xref> data
        structures in this specification utilize the JWS Compact Serialization
        or the JWE Compact Serialization; the JWS JSON Serialization and the
        JWE JSON Serialization are not used.</t>
      </section>

      <section anchor="Terminology" title="Terminology">
        <t>This specification uses the terms "Access Token", "Authorization
        Code", "Authorization Endpoint", "Authorization Grant", "Authorization
        Server", "Client", "Client Authentication", "Client Identifier",
        "Client Secret", "Grant Type", "Protected Resource", "Redirection
        URI", "Refresh Token", "Resource Owner", "Resource Server", "Response
        Type", and "Token Endpoint" defined by <xref target="RFC6749">OAuth
        2.0</xref>, the terms "Claim Name", "Claim Value", and "JSON Web Token
        (JWT)" defined by <xref target="RFC7519">JSON Web Token (JWT)</xref>,
        and the terms defined by <xref target="OpenID.Core">OpenID Connect
        Core 1.0</xref>.</t>
      </section>
    </section>

    <section anchor="Scopes" title="Resource Access Scopes">
      <t>In this specification, scope values are a composite string describing
      the type of permission, the type of resource, and the type of access to
      that resource being requested. These scopes are plain strings made by
      combining the permission type, followed by a single forward slash "/"
      character, followed by the resource type, followed by a single period
      character ".", followed by the access type. The asterisk character "*"
      is reserved as a special value to stand in for any valid value within a
      category.</t>

      <t>The entire scope definition is:</t>

      <t><spanx style="verb">scope := permission/resource.access</spanx></t>

      <t><spanx style="verb">permission, resource, access := any string (without space, period, slash, or asterisk) | asterisk</spanx></t>

      <t>Strings within each category MUST NOT include the space " ", period
      ".", forward slash "/", or asterisk "*" character.</t>

      <t>Implementation of these scope strings is a matter of choice for the
      OAuth system. The authorization server and protected resource MAY decide
      to pre-compute all viable combinations within the system as simple
      strings as shown in <xref target="ComputedScopeValues"/>, or they MAY
      decide to parse the values within the strings at run time.</t>

      <t>Protected resources MUST define and document which scopes are
      required for access to the resource, listing all appropriate scope
      component combinations including wildcards.</t>

      <t>Authorization servers SHOULD define and document default scope values
      that will be used if an authorization request does not specify a
      requested set of scopes.</t>

      <section anchor="Permission" title="Permission type">
        <t>The permission type component of a scope definition indicates
        whether the access being requested is for a single patient record or a
        bulk set of patient records. This specification defines two possible
        values.</t>

        <t><list style="hanging">
            <t hangText="patient">The scope is for a single patient's record,
            either for the current user or someone else that they have been
            given access to.</t>

            <t hangText="user">The scope is for a bulk set of records or for
            aggregate data not representing a single patient, based on what is
            available to the current user.</t>
          </list></t>

        <t>Extensions to this specification MAY define additional permission
        types using the registry defined in <xref target="iana"/>.</t>

        <t>The patient permission type SHOULD be used only with user-delegated
        access client types as defined in <xref target="HEART.OAuth2"/>. The
        user permission type SHOULD be used only with bulk-access client types
        as defined in <xref target="HEART.OAuth2"/>. This specification does
        not define a wildcard (asterisk, "*") general permission type
        definition.</t>
      </section>

      <section anchor="Resource" title="Resource type">
        <t>The resource type indicates the kind of FHIR resource and
        consequently the kind of information available at it. Any FHIR
        resource MAY be used, and in particular this specification defines
        scopes for resources based on FHIR resource type designation for the
        Patient compartment as found on <spanx style="verb">http://www.hl7.org/fhir/compartmentdefinition-patient.html</spanx>.</t>

        <t>This document specifically lists the following common resources
        from FHIR version STU3. Full normative definitions for each type can
        be found at <spanx style="verb">http://www.hl7.org/fhir/stu3/compartmentdefinition-patient.html</spanx>.</t>

        <t><list style="hanging">
            <t hangText="Patient">Demographic information about the patient,
            http://www.hl7.org/fhir/stu3/patient.html</t>

            <t hangText="MedicationRequest">Information about requests for
            medications for patients,
            http://www.hl7.org/fhir/stu3/medicationrequest.html</t>

            <t hangText="MedicationDispense">Information about supply of
            medications to a patient,
            http://www.hl7.org/fhir/stu3/medicationdispense.html</t>

            <t hangText="MedicationAdministration">Information about
            medications consumption or other administration,
            http://www.hl7.org/fhir/stu3/medicationadministration.html</t>

            <t hangText="MedicationStatement">Information about the believed
            state of a medication,
            http://www.hl7.org/fhir/stu3/medicationstatement.html</t>

            <t hangText="Observation">Information about observations performed
            by a healthcare provider,
            http://www.hl7.org/fhir/stu3/observation.html</t>

            <t hangText="Appointment">Information about scheduled
            appointments, http://www.hl7.org/fhir/stu3/appointment.html</t>

            <t hangText="AllergyIntolerance">Information about allergies and
            drug intolerance,
            http://www.hl7.org/fhir/stu3/allergyintolerance.html</t>

            <t hangText="Condition">Information about a patient's condition,
            http://www.hl7.org/fhir/stu3/condition.html</t>

            <t hangText="Immunization">Information about a patient's
            immunizations, http://www.hl7.org/fhir/stu3/immunization.html</t>

            <t hangText="CarePlan">Information about a patient's care plan,
            http://www.hl7.org/fhir/stu3/careplan.html</t>

            <t hangText="*">Wildcard representing all available resources
            under the given context.</t>
          </list></t>

        <t>A protected resource MUST document which version of FHIR applies to
        the resources it offers.</t>
      </section>

      <section anchor="Access" title="Access type">
        <t>The access type defines the kinds of actions that can be taken on a
        particular resource. This specification defines the following access
        types.</t>

        <t><list style="hanging">
            <t hangText="read">Allows information to be read from the resource
            in a way that does not directly modify the resource. These
            interactions MAY include <spanx style="verb">read</spanx>, <spanx
            style="verb">vread</spanx>, <spanx style="verb">history</spanx>,
            <spanx style="verb">search</spanx>, and <spanx style="verb">capabilities</spanx>
            as defined at <spanx style="verb">https://www.hl7.org/fhir/http.html</spanx>.</t>

            <t hangText="write">Allows information to be written to the
            resource. These interactions MAY include <spanx style="verb">update</spanx>,
            <spanx style="verb">patch</spanx>, <spanx style="verb">delete</spanx>,
            <spanx style="verb">create</spanx>, and <spanx style="verb">batch/transaction</spanx>
            as defined at <spanx style="verb">https://www.hl7.org/fhir/http.html</spanx>.</t>

            <t hangText="*">Wildcard representing all possible actions under
            the given context. These interactions include those defined by the
            <spanx style="verb">read</spanx> and <spanx style="verb">write</spanx>
            scopes as well as any additional interactions supported by the
            resource.</t>
          </list></t>

        <t>Extensions to this specification MAY define additional specific
        resource types using the registry defined in <xref
        target="iana"/>.</t>
      </section>
    </section>

    <section anchor="ConfidentialitySensitivity"
             title="Confidentiality and Sensitivity">
      <t>In addition to the scopes listed above, a client MAY request and an
      authorization server MAY issue tokens with the following scopes
      indicating that the token has been authorized by the AS for accessing
      information of a particular confidentiality level.</t>

      <t><list style="hanging">
          <t hangText="conf/N">Normal confidentiality</t>

          <t hangText="conf/R">Restricted confidentiality</t>

          <t hangText="conf/V">Very Restricted confidentiality</t>
        </list></t>

      <t>An absence of a confidentiality scope makes no indication of the
      confidentiality of information therein.</t>

      <t>A client MAY request access to and an authorization server MAY issue
      tokens allowing access to data with particular sensitivities.</t>

      <t><list style="hanging">
          <t hangText="sens/ETH">Substance abuse</t>

          <t hangText="sens/PSY">Psychiatry</t>

          <t hangText="sens/GDIS">Genetic disease</t>

          <t hangText="sens/HIV">HIV/AIDS</t>

          <t hangText="sens/SCA">Sickle cell anemia</t>

          <t hangText="sens/SOC">Social services</t>

          <t hangText="sens/SDV">Sexual assault, abuse, or domestic
          violence</t>

          <t hangText="sens/SEX">Sexuality and reproductive health</t>

          <t hangText="sens/STD">Sexually transmitted disease</t>

          <t hangText="sens/DEMO">All demographic information</t>

          <t hangText="sens/DOB">Date of birth</t>

          <t hangText="sens/GENDER">Gender and sexual orientation</t>

          <t hangText="sens/LIVARG">Living arrangement</t>

          <t hangText="sens/MARST">Marital status</t>

          <t hangText="sens/RACE">Race</t>

          <t hangText="sens/REL">Religion</t>

          <t hangText="sens/B">Business information</t>

          <t hangText="sens/EMPL">Employer</t>

          <t hangText="sens/LOCIS">Location</t>

          <t hangText="sens/SSP">Sensitive service provider</t>

          <t hangText="sens/ADOL">Adolescent</t>

          <t hangText="sens/CEL">Celebrity</t>

          <t hangText="sens/DIAG">Diagnosis</t>

          <t hangText="sens/DRGIS">Drug information</t>

          <t hangText="sens/EMP">Employee</t>
        </list></t>

      <t>Additional sensitivity scopes MAY be defined by using codes any of
      the FHIR Information Sensitivity Policy labels at
      http://hl7.org/fhir/v3/InformationSensitivityPolicy/vs.html.</t>

      <t>This specification makes no assumptions regarding the ability of
      resource servers to tag and filter data. A resource server that is
      capable of filtering information MUST advertise this capability through
      the use of these scopes. Resource servers SHOULD use this access
      information to filter out data being returned to a client, if possible.
      If an access token does not contain a given confidentiality or
      sensitivity marker, the resource server SHOULD assume that the client
      does not have access to that information and SHOULD apply appropriate
      filters to the data, where possible.</t>
    </section>

    <section anchor="break-the-glass" title="Break the glass">
      <t>A special scope is used to indicate that access is requested when the
      resource owner is unavailable. This scope is in addition to any of the
      resource-marked identifications above.</t>

      <t><list style="hanging">
          <t hangText="btg">The resource is intended to be accessed when the
          resource owner is unavailable.</t>
        </list></t>

      <t>The means by which the authorization server determines which clients
      are allowed access to the <spanx style="verb">btg</spanx> scope is
      outside the scope of this document.</t>

      <t>If the resource server receives a token that includes the <spanx
      style="verb">btg</spanx> scope, the resource server MUST log such access
      in an auditable format available to the resource owner.</t>
    </section>

    <section title="Resource selection">
      <t>In many OAuth transactions, the client does not need to indicate to
      the authorization server the protected resource that it is trying to
      access, as that information is discernible from the context of the
      scopes and the resource owner present during authorization. For example,
      a patient authorizing access to their own record would not need to
      specify which record is theirs since the resource server would
      presumably be able to find the record based on the identity of the
      resource owner. In other transactions, the resource owner will need to
      specify to the authorization server and resource server which protected
      resource is to be accessed. For example, a user with access to not only
      their own patient record but also that of their children would need to
      specify which record is to be accessed by the client.</t>

      <t>If the client knows the protected resource that it is trying to gain
      access to, it can indicate this protected resource to the authorization
      server during the request to the authorization endpoint (for the
      authorization code and implicit flow) or the token endpoint (for the
      client credentials flow) using the OPTIONAL <spanx style="verb">aud</spanx>
      (audience) parameter.</t>

      <t><list style="hanging">
          <t hangText="aud">A URI string representing the protected resource
          which this authorization request is directed toward. This URI MUST
          be a patient's record, consisting of many resources or a specific
          FHIR resource for a given patient.</t>
        </list></t>

      <t>If the client does not provide an <spanx style="verb">aud</spanx>
      parameter in its request, the authorization server MUST perform one of
      these three actions:</t>

      <t><list style="symbols">
          <t>Select a default resource based on the resource owner's identity,
          such as selecting the resource representing the resource owner
          themselves. This is anticipated to be the default behavior in most
          cases.</t>

          <t>Return an <spanx style="verb">invalid_request</spanx> error
          response, indicating it was unable to determine which resource the
          client is requesting.</t>

          <t>Allow the resource owner to interactively select or specify an
          appropriate resource on the authorization page.</t>
        </list></t>

      <t>The authorization server SHOULD either select a default resource or
      give the resource owner an opportunity to specify the resource if none
      is selected, reserving the error response for cases in which neither of
      these are possible.</t>

      <t>If a specific resource is selected, the authorization server MUST
      return an <spanx style="verb">aud</spanx> parameter in the token
      response to the client containing the audience identifier value. For
      example, when using the authorization code grant type the response would
      be as follows.</t>

      <figure>
        <artwork><![CDATA[HTTP/1.1 200 OK
Date: Tue, 16 Dec 2014 03:00:14 GMT
Access-Control-Allow-Origin: *
Content-Type: application/json;charset=ISO-8859-1
Connection: close

{
   "access_token": "eyJhbGciOiJSUzI1NiJ9.ew0KICAgImV4cCI6IDE0MTg3MDIzODgsDQogICAiYXpwIjo
gIjU1ZjlmNTU5LTI0OTYtNDlkNC1iNmMzLTM1MWE1ODZiNzQ4NCIsDQogICAiaXNzIjo
gImh0dHBzOi8vaWRwLXAuZXhhbXBsZS5jb20vIiwNCiAgICJqdGkiOiAiMjQwMmY4N2M
tYjZjZS00NWM0LTk1YjAtN2EzZjI5MDQ5OTdmIiwNCiAgICJpYXQiOiAxNDE4Njk4Nzg
4LA0KICAgImtpZCI6ICJyc2ExIg0KfQ.iB6Ix8Xeg-L-nMStgE1X75w7zgXabzw7znWU
ECOsXpHfnYYqb-CET9Ah5IQyXIDZ20qEyN98UydgsTpiO1YJDDcZV4f4DgY0ZdG3yBW3
XqwUQwbgF7Gwza9Z4AdhjHjzQx-lChXAyfL1xz0SBDkVbJdDjtXbvaSIyfF7ueWF3M1C
M70-GXuRY4iucKbuytz9e7eW4Egkk4Aagl3iTk9-l5V-tvL6dYu8IlR93GKsaKE8bng0
EZ04xcnq8s4V5Yykuc_NARBJENiKTJM8w3wh7xWP2gvMp39Y0XnuCOLyIx-J1ttX83xm
pXDaLyyY-4HT9XHT9V73fKF8rLWJu9grrA",
   "scope": "patient/*.* sens/ETH sens/PSY btg",
   "token_type": "Bearer",
   "aud": "https://resource.example.net/patient/123141/"
}
]]></artwork>
      </figure>
    </section>

    <section anchor="iana" title="IANA Considerations">
      <t>This specification creates two registries for the values in the two
      of the three different components of the resource access scope.</t>

      <section title="HEART Permission Type Registry">
        <t>This specification establishes the HEART Permission Type
        Registry.</t>

        <t>Permission types are registered by <xref
        target="RFC5226">Specification Required</xref> after a two-week review
        period on the openid-specs-heart@openid.net mailing list, on the
        advice of one or more Designated Experts.</t>

        <t>Criteria that should be applied by the Designated Experts includes
        determining whether the proposed registration duplicates existing
        functionality, whether it is likely to be of general applicability or
        whether it is useful only for a single application, and whether the
        registration description is clear.</t>

        <t>Registration requests sent to the mailing list for review should
        use an appropriate subject (e.g., "Request to register HEART
        Permission Type: example"). Within the review period, the Designated
        Expert(s) will either approve or deny the registration request,
        communicating this decision to the review list and IANA. Denials
        should include an explanation and, if applicable, suggestions as to
        how to make the request successful. IANA must only accept registry
        updates from the Designated Expert(s) and should direct all requests
        for registration to the review mailing list.</t>

        <section title="Registration Template">
          <t><list style="hanging">
              <t hangText="Permission Type"><vspace/>A string representation
              of the permission being registered, to be used in scope
              construction.</t>

              <t hangText="Description:"><vspace/> Brief description of the
              permission (e.g., "Example description").</t>

              <t hangText="Change controller:"><vspace/> For Standards Track
              RFCs, state "IESG". For other documents, give the name of the
              responsible party. Other details (e.g., postal address, email
              address, home page URI) may also be included.</t>

              <t hangText="Specification document(s):"><vspace/> Reference to
              the document(s) that specify the token endpoint authorization
              method, preferably including a URI that can be used to retrieve
              a copy of the document(s). An indication of the relevant
              sections may also be included but is not required.</t>
            </list></t>
        </section>

        <section title="Initial Registry Contents">
          <t>The HEART Permission Type Registry contains the following
          definitions of scope components for permission types.</t>

          <t><list style="symbols">
              <t>Scope Value: patient</t>

              <t>Description: Access to a single patient record</t>

              <t>Change Controller: OpenID Foundation (http://openid.net/)</t>

              <t>Specification document(s):: [[ this document ]]</t>
            </list><list style="symbols">
              <t>Scope Value: user</t>

              <t>Description: Access to all records accessible to the current
              user</t>

              <t>Change Controller: OpenID Foundation (http://openid.net/)</t>

              <t>Specification document(s):: [[ this document ]]</t>
            </list></t>
        </section>
      </section>

      <section title="HEART Access Type Registry">
        <t>This specification establishes the HEART Access Type Registry.</t>

        <t>Access types are registered by <xref target="RFC5226">Specification
        Required</xref> after a two-week review period on the
        openid-specs-heart@openid.net mailing list, on the advice of one or
        more Designated Experts.</t>

        <t>Criteria that should be applied by the Designated Experts includes
        determining whether the proposed registration duplicates existing
        functionality, whether it is likely to be of general applicability or
        whether it is useful only for a single application, and whether the
        registration description is clear.</t>

        <t>Registration requests sent to the mailing list for review should
        use an appropriate subject (e.g., "Request to register HEART
        Permission Type: example"). Within the review period, the Designated
        Expert(s) will either approve or deny the registration request,
        communicating this decision to the review list and IANA. Denials
        should include an explanation and, if applicable, suggestions as to
        how to make the request successful. IANA must only accept registry
        updates from the Designated Expert(s) and should direct all requests
        for registration to the review mailing list.</t>

        <section title="Registration Template">
          <t><list style="hanging">
              <t hangText="Access Type"><vspace/>A string representation of
              the access being registered, to be used in scope
              construction.</t>

              <t hangText="Description:"><vspace/> Brief description of the
              access (e.g., "Example description").</t>

              <t hangText="Change controller:"><vspace/> For Standards Track
              RFCs, state "IESG". For other documents, give the name of the
              responsible party. Other details (e.g., postal address, email
              address, home page URI) may also be included.</t>

              <t hangText="Specification document(s):"><vspace/> Reference to
              the document(s) that specify the token endpoint authorization
              method, preferably including a URI that can be used to retrieve
              a copy of the document(s). An indication of the relevant
              sections may also be included but is not required.</t>
            </list></t>
        </section>

        <section title="Initial Registry Contents">
          <t>The HEART Access Type Registry contains the definitions of scope
          components for access types.</t>

          <t><list style="symbols">
              <t>Scope Value: read</t>

              <t>Description: Read access</t>

              <t>Change Controller: OpenID Foundation (http://openid.net/)</t>

              <t>Specification document(s):: [[ this document ]]</t>
            </list><list style="symbols">
              <t>Scope Value: write</t>

              <t>Description: Write access</t>

              <t>Change Controller: OpenID Foundation (http://openid.net/)</t>

              <t>Specification document(s):: [[ this document ]]</t>
            </list><list style="symbols">
              <t>Scope Value: *</t>

              <t>Description: All access</t>

              <t>Change Controller: OpenID Foundation (http://openid.net/)</t>

              <t>Specification document(s):: [[ this document ]]</t>
            </list></t>
        </section>
      </section>

      <section title="Additions to the OAuth Parameters Registry">
        <t>This specification adds the following values to the OAuth
        Parameters Registry established by <xref target="RFC6749"/>.</t>

        <t><list style="symbols">
            <t>Name: aud</t>

            <t>Parameter usage location: authorization request, token
            request</t>

            <t>Change Controller: IESG</t>

            <t>Document: [[ this document ]]</t>
          </list></t>
      </section>
    </section>

    <section title="Security Considerations">
      <t>Access tokens MAY have multiple scopes of potentially different types
      associated with them. Each additional scope is additive to the
      capabilities of the token. An authorization token containing multiple
      scopes MUST be treated as appropriate for all combinations of scopes in
      the token. For example, if an access token contains <spanx style="verb">patient/Observation.*</spanx>,
      <spanx style="verb">patient/MedicationOrder.read</spanx>, and <spanx
      style="verb">ETH</spanx>, then the <spanx style="verb">ETH</spanx> scope
      SHOULD be applied by the RS to both the <spanx style="verb">patient/Observation.*</spanx>
      and <spanx style="verb">patient/MedicationOrder.read</spanx> record
      types. Use cases requiring more fine grained access for combinations
      SHOULD use multiple tokens with only the appropriate rights associated
      with them.</t>
    </section>

    <section title="Privacy Considerations">
      <t>Resource servers should register or advertise scopes as a statement
      of capabilities, not as an indication of the absence or presence of
      particular kinds of data. This is especially pertinent with regard to
      the <xref target="ConfidentialitySensitivity">confidentiality and
      sensitivity</xref> scopes. Namely, if a resource server is associated
      with the <spanx style="verb">sens/PSY</spanx> scope, it is indicating
      that it has the capability to filter out psychiatry information, not
      that it currently holds any psychiatry information. Likewise, if a
      resource server is not associated with the <spanx style="verb">sens/PSY</spanx>
      scope, it is indicating that it does not have the ability to process or
      filter out psychiatry information, not that it contains no information
      that is psychiatric in nature.</t>
    </section>
  </middle>

  <back>
    <references title="Normative References">
      <?rfc include="http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2119"?>

      <?rfc include="http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2246"?>

      <?rfc include='http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.3986'?>

      <?rfc include="http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.5226"?>

      <?rfc include="http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.5246"?>

      <?rfc include="http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.5322"?>

      <?rfc include="http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.5646"?>

      <?rfc include="http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.5785"?>

      <?rfc include="http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6125"?>

      <?rfc include="http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6749"?>

      <?rfc include="http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6750"?>

      <?rfc include="http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6819"?>

      <?rfc include="http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.7033"?>

      <?rfc include="http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.7517"?>

      <?rfc include="http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.7518"?>

      <?rfc include="http://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.7519"?>

      <reference anchor="OpenID.Core">
        <front>
          <title>OpenID Connect Core 1.0</title>

          <author fullname="Nat Sakimura" initials="N." surname="Sakimura">
            <organization abbrev="NRI">Nomura Research Institute,
            Ltd.</organization>
          </author>

          <author fullname="John Bradley" initials="J." surname="Bradley">
            <organization abbrev="Ping Identity">Ping Identity</organization>
          </author>

          <author fullname="Michael B. Jones" initials="M.B." surname="Jones">
            <organization abbrev="Microsoft">Microsoft</organization>
          </author>

          <author fullname="Breno de Medeiros" initials="B."
                  surname="de Medeiros">
            <organization abbrev="Google">Google</organization>
          </author>

          <author fullname="Chuck Mortimore" initials="C." surname="Mortimore">
            <organization abbrev="Salesforce">Salesforce</organization>
          </author>

          <date day="8" month="November" year="2014"/>
        </front>

        <format target="http://openid.net/specs/openid-connect-core-1_0.html"
                type="HTML"/>
      </reference>

      <reference anchor="HEART.OAuth2"
                 target="http://openid.net/specs/openid-heart-oauth2-1_0.html">
        <front>
          <title>Health Relationship Trust Profile for OAuth 2.0</title>

          <author fullname="Justin Richer" initials="J." role="editor"
                  surname="Richer">
            <address>
              <email>openid@justin.richer.org</email>

              <uri>http://justin.richer.org/</uri>
            </address>
          </author>

          <date day="15" month="February" year="2016"/>
        </front>
      </reference>
    </references>

    <section anchor="Acknowledgements" title="Acknowledgements">
      <t>The OpenID Community would like to thank the following people for
      their contributions to this specification:</t>

      <t>Sarah Squire, Nancy Lush, Debbie Bucci, Eve Maler, Luis Maas, Thomas
      Sullivan</t>
    </section>

    <section anchor="ComputedScopeValues" title="Fully computed scope values">
      <t>The resource access scopes in this specification are composed from
      individual components, but scopes in OAuth are treated as string by many
      parts of the system. Clients, authorization servers, and protected
      resources should not be expected to compose these strings from parts,
      merely be able to understand the rights associated with a given string.
      Consequently, we are providing here a table of pre-computed values for
      all possible scope string combinations defined form the components in
      this document, along with their meaning.</t>

      <t><list style="hanging">
          <t hangText="patient/Patient.read">Read access to a single patient's
          demographic information.</t>

          <t hangText="patient/Patient.write">Read and write access to a
          single patient's demographic information.</t>

          <t hangText="patient/Patient.*">Full access to a single patient's
          demographic information.</t>

          <t hangText="patient/MedicationRequest.read">Read access to a single
          patient's requests for medications.</t>

          <t hangText="patient/MedicationRequest.write">Read and write access
          to a single patient's requests for medications.</t>

          <t hangText="patient/MedicationRequest.*">Full access to a single
          patient's requests for medications.</t>

          <t hangText="patient/MedicationDispense.read">Read access to supply
          of medications to a single patient.</t>

          <t hangText="patient/MedicationDispense.write">Read and write access
          to supply of medications to a single patient.</t>

          <t hangText="patient/MedicationDispense.*">Full access to supply of
          medications to a single patient.</t>

          <t hangText="patient/MedicationAdministration.read">Read access to a
          single patient's medications consumption or other
          administration.</t>

          <t hangText="patient/MedicationAdministration.write">Read and write
          access to a single patient's medications consumption or other
          administration.</t>

          <t hangText="patient/MedicationAdministration.*">Full access to a
          single patient's medications consumption or other
          administration.</t>

          <t hangText="patient/MedicationStatement.read">Read access to the
          believed state of a medication for a single patient.</t>

          <t hangText="patient/MedicationStatement.write">Read and write
          access to the believed state of a medication for a single
          patient.</t>

          <t hangText="patient/MedicationStatement.*">Full access to the
          believed state of a medication for a single patient.</t>

          <t hangText="patient/Observation.read">Read access to a single
          patient's observations performed by a healthcare provider.</t>

          <t hangText="patient/Observation.write">Read and write access to a
          single patient's observations performed by a healthcare
          provider.</t>

          <t hangText="patient/Observation.*">Full access to a single
          patient's observations performed by a healthcare provider.</t>

          <t hangText="patient/Appointment.read">Read access to a single
          patient's scheduled appointments.</t>

          <t hangText="patient/Appointment.write">Read and write access to a
          single patient's scheduled appointments.</t>

          <t hangText="patient/Appointment.*">Full access to a single
          patient's scheduled appointments.</t>

          <t hangText="patient/*.read">Read access to a single patient's
          complete records.</t>

          <t hangText="patient/*.write">Read and write access to a single
          patient's complete records.</t>

          <t hangText="patient/*.*">Full access to a single patient's complete
          records.</t>

          <t hangText="user/Patient.read">Read access to all authorized
          demographic information.</t>

          <t hangText="user/Patient.write">Read and write access to all
          authorized demographic information.</t>

          <t hangText="user/Patient.*">Full access to all authorized
          demographic information.</t>

          <t hangText="user/MedicationRequest.read">Read access to all
          authorized requests for medications.</t>

          <t hangText="user/MedicationRequest.write">Read and write access to
          all authorized requests for medications.</t>

          <t hangText="user/MedicationRequest.*">Full access to all authorized
          requests for medications.</t>

          <t hangText="user/MedicationDispense.read">Read access to all
          authorized supply of medications.</t>

          <t hangText="user/MedicationDispense.write">Read and write access to
          all authorized supply of medications.</t>

          <t hangText="user/MedicationDispense.*">Full access to all
          authorized supply of medications.</t>

          <t hangText="user/MedicationAdministration.read">Read access to all
          authorized medications consumption or other administration.</t>

          <t hangText="user/MedicationAdministration.write">Read and write
          access all authorized medications consumption or other
          administration.</t>

          <t hangText="user/MedicationAdministration.*">Full access to all
          authorized medications consumption or other administration.</t>

          <t hangText="user/MedicationStatement.read">Read access to all
          authorized believed states of medication.</t>

          <t hangText="user/MedicationStatement.write">Read and write access
          to all authorized believed states of medication.</t>

          <t hangText="user/MedicationStatement.*">Full access to all
          authorized believed states of medication.</t>

          <t hangText="user/Observation.read">Read access to all authorized
          observations performed by a healthcare provider.</t>

          <t hangText="user/Observation.write">Read and write access to all
          authorized observations performed by a healthcare provider.</t>

          <t hangText="user/Observation.*">Full access to all authorized
          observations performed by a healthcare provider.</t>

          <t hangText="user/Appointment.read">Read access to all authorized
          scheduled appointments.</t>

          <t hangText="user/Appointment.write">Read and write access to all
          authorized scheduled appointments.</t>

          <t hangText="user/Appointment.*">Full access to all authorized
          scheduled appointments.</t>

          <t hangText="user/*.read">Read access to all authorized complete
          records.</t>

          <t hangText="user/*.write">Read and write access to all authorized
          complete records.</t>

          <t hangText="user/*.*">Full access to all authorized complete
          records.</t>
        </list></t>
    </section>

    <section title="Purpose of Use">
      <t>The ability to specify information be made available for a specific
      purpose of use is key to many different medical information use cases.
      For example, a patient might determine that some things are available
      for research, while others are only available for treatment. At this
      time, these specifications do not define methods for indicating purpose
      of use beyond the "break the glass" mechanism defined in <xref
      target="break-the-glass"/>. The working group anticipates that expansion
      of this mechanism in implementations, which could lead to expansions of
      this protocol going forward.</t>
    </section>

    <section anchor="Notices" title="Notices">
      <t>Copyright (c) 2017 The OpenID Foundation.</t>

      <t>The OpenID Foundation (OIDF) grants to any Contributor, developer,
      implementer, or other interested party a non-exclusive, royalty free,
      worldwide copyright license to reproduce, prepare derivative works from,
      distribute, perform and display, this Implementers Draft or Final
      Specification solely for the purposes of (i) developing specifications,
      and (ii) implementing Implementers Drafts and Final Specifications based
      on such documents, provided that attribution be made to the OIDF as the
      source of the material, but that such attribution does not indicate an
      endorsement by the OIDF.</t>

      <t>The technology described in this specification was made available
      from contributions from various sources, including members of the OpenID
      Foundation and others. Although the OpenID Foundation has taken steps to
      help ensure that the technology is available for distribution, it takes
      no position regarding the validity or scope of any intellectual property
      or other rights that might be claimed to pertain to the implementation
      or use of the technology described in this specification or the extent
      to which any license under such rights might or might not be available;
      neither does it represent that it has made any independent effort to
      identify any such rights. The OpenID Foundation and the contributors to
      this specification make no (and hereby expressly disclaim any)
      warranties (express, implied, or otherwise), including implied
      warranties of merchantability, non-infringement, fitness for a
      particular purpose, or title, related to this specification, and the
      entire risk as to implementing this specification is assumed by the
      implementer. The OpenID Intellectual Property Rights policy requires
      contributors to offer a patent promise not to assert certain patent
      claims against other contributors and against implementers. The OpenID
      Foundation invites any interested party to bring to its attention any
      copyrights, patents, patent applications, or other proprietary rights
      that may cover technology that may be required to practice this
      specification.</t>
    </section>

    <section title="Document History">
      <t>-2017-05-25</t>

      <t><list style="symbols">
          <t>Changed purpose of use examples from roles to actions</t>
        </list></t>

      <t>-2017-05-15</t>

      <t><list style="symbols">
          <t>Added note on purpose of use</t>

          <t>Cleaned up IANA copy-paste errors</t>
        </list></t>

      <t>-2017-04-29</t>

      <t><list style="symbols">
          <t>Added FHIR resource type references</t>

          <t>Clarified that FHIR is canonical for resource types</t>

          <t>Explicitly defined "read" and "write" as mapped to FHIR
          actions</t>
        </list></t>

      <t>-2017-04-25</t>

      <t><list style="symbols">
          <t>Added additional FHIR resource types</t>

          <t>Strengthened normative requirement for cross-resource scopes to
          be applied to all resources</t>
        </list></t>

      <t>-2017-04-18</t>

      <t><list style="symbols">
          <t>Clarified that the resource types in scopes can be any valid FHIR
          resource but we're using examples from STU3</t>

          <t>Changed "MedicationOrder" to "MedicationRequest"</t>

          <t>Removed introductory material about OAuth scopes</t>

          <t>Clarified that "aud" is generally for single-patient uses</t>

          <t>Added IANA registry templates</t>
        </list></t>

      <t>-2017-04-10</t>

      <t><list style="symbols">
          <t>Added additional sensitivity category information from
          http://hl7.org/fhir/v3/InformationSensitivityPolicy/vs.html</t>
        </list></t>

      <t>-2017-04-03</t>

      <t><list style="symbols">
          <t>Added clarifying information regarding sensitivity scopes.</t>
        </list></t>

      <t>-2017-03-20</t>

      <t><list style="symbols">
          <t>Added confidentiality and sensitivity scopes</t>
        </list></t>

      <t>-2017-02-27</t>

      <t><list style="symbols">
          <t>Added break the glass scope</t>
        </list></t>

      <t>-2015-09-16</t>

      <t><list style="symbols">
          <t>Created first semantic scope profile</t>
        </list></t>
    </section>
  </back>
</rfc>
