{
  "resourceType": "StructureDefinition",
  "id": "England-Flag-PatientFlag-Adjustment",
  "url": "https://fhir.nhs.uk/England/StructureDefinition/England-Flag-PatientFlag-Adjustment",
  "version": "0.2.0",
  "name": "EnglandFlagPatientFlagAdjustment",
  "title": "England Flag Patient Flag Adjustment",
  "status": "draft",
  "date": "2024-09-27",
  "publisher": "NHS England",
  "contact": [
    {
      "name": "NHS England",
      "telecom": [
        {
          "system": "email",
          "value": "interoperabilityteam@nhs.net",
          "use": "work",
          "rank": 1
        }
      ]
    }
  ],
  "description": "Record an individual flag for an NHS England programme.",
  "purpose": "This profile is made available to record an individual flag for an NHS England programme.",
  "copyright": "Copyright © 2023+ NHS England Licensed under the Apache License, Version 2.0 (the \\&quot;License\\&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 \\&quot;AS IS\\&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.",
  "fhirVersion": "4.0.1",
  "mapping": [
    {
      "identity": "rim",
      "uri": "http://hl7.org/v3",
      "name": "RIM Mapping"
    },
    {
      "identity": "w5",
      "uri": "http://hl7.org/fhir/fivews",
      "name": "FiveWs Pattern Mapping"
    }
  ],
  "kind": "resource",
  "abstract": false,
  "type": "Flag",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Flag",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Flag.contained",
        "path": "Flag.contained",
        "slicing": {
          "discriminator": [
            {
              "type": "type",
              "path": "$this"
            }
          ],
          "rules": "open"
        },
        "mustSupport": true
      },
      {
        "id": "Flag.contained:provenance",
        "path": "Flag.contained",
        "sliceName": "provenance",
        "max": "1",
        "type": [
          {
            "code": "Resource",
            "profile": [
              "https://fhir.nhs.uk/England/StructureDefinition/England-Provenance-Flag"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Flag.extension:extensionEnglandFlagNotes",
        "path": "Flag.extension",
        "sliceName": "extensionEnglandFlagNotes",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://fhir.nhs.uk/England/StructureDefinition/Extension-England-FlagNotes"
            ]
          }
        ],
        "isModifier": false
      },
      {
        "id": "Flag.status",
        "path": "Flag.status",
        "mustSupport": true
      },
      {
        "id": "Flag.category",
        "path": "Flag.category",
        "slicing": {
          "discriminator": [
            {
              "type": "pattern",
              "path": "$this"
            }
          ],
          "rules": "open"
        },
        "min": 2,
        "mustSupport": true
      },
      {
        "id": "Flag.category:patientFlag",
        "path": "Flag.category",
        "sliceName": "patientFlag",
        "max": "1",
        "mustSupport": true,
        "binding": {
          "strength": "required",
          "valueSet": "https://fhir.nhs.uk/England/ValueSet/England-FlagCategoryPatient"
        }
      },
      {
        "id": "Flag.category:programmeFlag",
        "path": "Flag.category",
        "sliceName": "programmeFlag",
        "max": "1",
        "mustSupport": true,
        "binding": {
          "strength": "required",
          "valueSet": "https://fhir.nhs.uk/England/ValueSet/England-FlagCategoryProgramme"
        }
      },
      {
        "id": "Flag.code",
        "path": "Flag.code",
        "mustSupport": true,
        "binding": {
          "strength": "extensible",
          "valueSet": "https://fhir.nhs.uk/England/ValueSet/England-FlagCodeProgramme"
        }
      },
      {
        "id": "Flag.subject",
        "path": "Flag.subject",
        "mustSupport": true
      }
    ]
  }
}