{
  "resourceType": "StructureDefinition",
  "id": "Extension-DM-PrescriptionStatusHistory",
  "url": "https://fhir.nhs.uk/StructureDefinition/Extension-DM-PrescriptionStatusHistory",
  "version": "0.2.0",
  "name": "ExtensionDMPrescriptionStatusHistory",
  "title": "Extension DM Prescription Status History",
  "status": "draft",
  "date": "2025-04-03",
  "publisher": "NHS England",
  "contact": [
    {
      "name": "NHS England",
      "telecom": [
        {
          "system": "email",
          "value": "interoperabilityteam@nhs.net",
          "use": "work",
          "rank": 1
        }
      ]
    }
  ],
  "description": "An extension use to record the status of a prescription.",
  "purpose": "An extension use to record the status of a prescription.",
  "copyright": "Copyright &#169; 2025+ 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&#174; FHIR&#174; standard Copyright &#169; 2011+ HL7 The HL7&#174; FHIR&#174; 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"
    }
  ],
  "kind": "complex-type",
  "abstract": false,
  "context": [
    {
      "type": "element",
      "expression": "MedicationRequest"
    },
    {
      "type": "element",
      "expression": "RequestGroup"
    }
  ],
  "type": "Extension",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Extension",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Extension.extension",
        "path": "Extension.extension",
        "min": 1
      },
      {
        "id": "Extension.extension:statusDate",
        "path": "Extension.extension",
        "sliceName": "statusDate",
        "max": "1"
      },
      {
        "id": "Extension.extension:statusDate.extension",
        "path": "Extension.extension.extension",
        "max": "0"
      },
      {
        "id": "Extension.extension:statusDate.url",
        "path": "Extension.extension.url",
        "fixedUri": "statusDate"
      },
      {
        "id": "Extension.extension:statusDate.value[x]",
        "path": "Extension.extension.value[x]",
        "type": [
          {
            "code": "dateTime"
          }
        ]
      },
      {
        "id": "Extension.extension:status",
        "path": "Extension.extension",
        "sliceName": "status",
        "min": 1,
        "binding": {
          "strength": "required",
          "description": "An extension use to record the status of a prescription.",
          "valueSet": "https://fhir.nhs.uk/ValueSet/DM-prescription-task-status-reason"
        }
      },
      {
        "id": "Extension.extension:status.extension",
        "path": "Extension.extension.extension",
        "max": "0"
      },
      {
        "id": "Extension.extension:status.url",
        "path": "Extension.extension.url",
        "fixedUri": "status"
      },
      {
        "id": "Extension.extension:status.value[x]",
        "path": "Extension.extension.value[x]",
        "type": [
          {
            "code": "Coding"
          }
        ]
      },
      {
        "id": "Extension.extension:status.value[x].system",
        "path": "Extension.extension.value[x].system",
        "min": 1
      },
      {
        "id": "Extension.extension:status.value[x].code",
        "path": "Extension.extension.value[x].code",
        "min": 1
      },
      {
        "id": "Extension.url",
        "path": "Extension.url",
        "fixedUri": "https://fhir.nhs.uk/StructureDefinition/Extension-DM-PrescriptionStatusHistory"
      },
      {
        "id": "Extension.value[x]",
        "path": "Extension.value[x]",
        "max": "0"
      }
    ]
  }
}