<CapabilityStatement xmlns="http://hl7.org/fhir">
  <id value="England-PatientFlag-Server-Requirements" />
  <url value="https://fhir.nhs.uk/England/CapabilityStatement/England-PatientFlag-Server-Requirements" />
  <version value="0.1.0" />
  <name value="EnglandPatientFlagServerRequirements" />
  <title value="England Patient Flag Server Requirements" />
  <status value="draft" />
  <experimental value="false" />
  <date value="2024-09-20" />
  <publisher value="NHS England" />
  <contact>
    <name value="NHS England" />
    <telecom>
      <system value="email" />
      <value value="interoperabilityteam@nhs.net" />
      <use value="work" />
      <rank value="1" />
    </telecom>
  </contact>
  <contact>
    <name value="National Service Desk" />
    <telecom>
      <system value="email" />
      <value value="ssd.nationalservicedesk@nhs.net" />
      <use value="work" />
    </telecom>
    <telecom>
      <system value="phone" />
      <value value="0300 303 5035" />
      <use value="work" />
    </telecom>
  </contact>
  <description value="Requirements for NHS England PatientFlag FHIR API Implementation Guide" />
  <jurisdiction>
    <coding>
      <system value="urn:iso:std:iso:3166:-2" />
      <code value="GB-ENG" />
      <display value="England" />
    </coding>
  </jurisdiction>
  <purpose value="Requirements for NHS England PatientFlag FHIR API Implementation Guide, to specify the RESTFul interactions, supported profiles, and expected minimum SearchParamneters." />
  <copyright value="Copyright © 2024+ NHS England Licensed under the Apache License, Version 2.0 (the &amp;quot;License&amp;quot;); 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 &amp;quot;AS IS&amp;quot; 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. HL7® FHIR® standard Copyright © 2011+ HL7 The HL7® FHIR® standard is used under the FHIR license. You may obtain a copy of the FHIR license at  https://www.hl7.org/fhir/license.html." />
  <kind value="requirements" />
  <fhirVersion value="4.0.1" />
  <format value="application/fhir+json" />
  <implementationGuide value="https://simplifier.net/guide/patient-flag-implementation-guide-beta?version=current" />
  <rest>
    <mode value="server" />
    <security>
      <cors value="true" />
      <description value="1. app-restricted-signed-jwt\r\n\r\nAuthenticate your application by sending a signed JSON Web Token (JWT) to our OAuth 2.0 authorisation server. You provide us with your public key and sign the JWT with your private key. In return, we give you an access token, which you then include with each API request.\r\n\r\n2. user-restricted-nhs-cis2\r\n\r\nAuthentication and authorisation are done together. Authentication is done by NHS CIS2 Care Identity Authentication API but we co-ordinate that under the covers behind our OAuth2.0 authorisation server. Your application only needs to be registered with the API Platform, not NHS CIS2." />
    </security>
    <resource>
      <extension url="http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination">
        <extension url="required">
          <valueString value="patient" />
        </extension>
        <extension url="optional">
          <valueString value="code" />
        </extension>
      </extension>
      <type value="Flag" />
      <profile value="https://fhir.nhs.uk/England/StructureDefinition/England-Flag-PatientFlag" />
      <supportedProfile value="https://fhir.nhs.uk/England/StructureDefinition/England-Flag-PatientFlag" />
      <supportedProfile value="https://fhir.nhs.uk/England/StructureDefinition/England-Flag-PatientFlag-Adjustment" />
      <interaction>
        <extension url="http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation">
          <valueCode value="SHALL" />
        </extension>
        <code value="create" />
      </interaction>
      <interaction>
        <extension url="http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation">
          <valueCode value="SHALL" />
        </extension>
        <code value="read" />
      </interaction>
      <interaction>
        <extension url="http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation">
          <valueCode value="MAY" />
        </extension>
        <code value="update" />
      </interaction>
      <interaction>
        <extension url="http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation">
          <valueCode value="SHALL" />
        </extension>
        <code value="delete" />
      </interaction>
      <interaction>
        <extension url="http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation">
          <valueCode value="SHALL" />
        </extension>
        <code value="search-type" />
        <documentation value="Search/Read all top-level patient flags associated with a patient\r\nGET ~/Flag?patient=[Patient#]\r\nreturn: searchset bundle of top-level patientflags\r\nSearchParameter: [Patient]" />
      </interaction>
      <interaction>
        <extension url="http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation">
          <valueCode value="SHALL" />
        </extension>
        <code value="search-type" />
        <documentation value="Search/Read for a specific type of patient flag and supporting resources associated with a patient\r\nGET ~/Flag?patient=[Patient#]&amp;code=[FlagType]\r\nreturn: searchset bundle of Flag resources of type [FlagType] and any supporting resources\r\nSearchParameter: combo [Patient] &amp; [FlagType]" />
      </interaction>
      <versioning value="no-version" />
      <readHistory value="false" />
      <updateCreate value="false" />
      <conditionalCreate value="false" />
      <conditionalRead value="not-supported" />
      <conditionalUpdate value="false" />
      <conditionalDelete value="not-supported" />
      <searchParam>
        <name value="patient" />
        <type value="token" />
      </searchParam>
      <searchParam>
        <name value="code" />
        <type value="token" />
      </searchParam>
    </resource>
    <resource>
      <type value="Condition" />
      <profile value="https://fhir.nhs.uk/England/StructureDefinition/England-Condition-Flag" />
      <supportedProfile value="https://fhir.nhs.uk/England/StructureDefinition/England-Condition-Flag" />
      <interaction>
        <extension url="http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation">
          <valueCode value="SHALL" />
        </extension>
        <code value="create" />
      </interaction>
      <interaction>
        <extension url="http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation">
          <valueCode value="MAY" />
        </extension>
        <code value="update" />
      </interaction>
      <interaction>
        <extension url="http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation">
          <valueCode value="SHALL" />
        </extension>
        <code value="delete" />
      </interaction>
      <versioning value="no-version" />
      <readHistory value="false" />
      <updateCreate value="false" />
      <conditionalCreate value="false" />
      <conditionalRead value="not-supported" />
      <conditionalUpdate value="false" />
      <conditionalDelete value="not-supported" />
    </resource>
    <interaction>
      <extension url="http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation">
        <valueCode value="SHALL" />
      </extension>
      <code value="transaction" />
      <documentation value="Transaction handler for transaction bundles supplying sequence of atomic FHIR ReST resource interactions, fulfilled as per %2FCapabilityStatement%2Fimplementation%2Frest%2Fresource%2Finteraction definitions above" />
    </interaction>
  </rest>
</CapabilityStatement>