PackagesCanonicalsLogsProblems
    Packages
    uk.nhsdigital.r4.test@2.16.0-prerelease
    https://fhir.nhs.uk/StructureDefinition/NHSDigital-Task
description: This profile defines the NHS England constraints and extensions on the International FHIR resource [Task](https://hl7.org/fhir/R4/task.html).
package_name: uk.nhsdigital.r4.test
derivation: constraint
name: NHSDigitalTask
type: Task
elements:
  restriction:
    mustSupport: true
    index: 39
    elements:
      period:
        elements:
          end: {mustSupport: true, index: 40}
  reasonCode:
    mustSupport: true
    index: 31
    elements:
      coding:
        index: 32
        elements:
          system: {index: 33}
          code: {index: 34}
          display: {index: 35}
        required: [display, system, code]
        slicing:
          rules: open
          discriminator:
          - {path: system, type: value}
          min: null
          slices:
            SNOMED:
              match: {system: 'http://snomed.info/sct'}
              schema:
                index: 36
                elements:
                  system:
                    pattern: {type: Uri, value: 'http://snomed.info/sct'}
                    index: 37
  statusReason: {index: 6}
  authoredOn: {mustSupport: true, index: 24}
  businessStatus:
    short: The new business status of the prescription, as a result of update activity.
    binding: {strength: preferred, valueSet: 'https://fhir.nhs.uk/ValueSet/DM-prescription-task-status-reason'}
    index: 7
  note: {mustSupport: true, index: 38}
  extension:
    type: Extension
    short: Provenance of the resource
    mustSupport: true
    url: https://fhir.nhs.uk/StructureDefinition/Extension-Provenance-agent
    index: 0
    slicing:
      slices:
        agent:
          match: {}
          schema: {type: Extension, short: Provenance of the resource, mustSupport: true, url: 'https://fhir.nhs.uk/StructureDefinition/Extension-Provenance-agent', index: 0}
          max: 1
        prescription:
          match: {}
          schema: {type: Extension, short: EPS Patient Tracker extension, mustSupport: true, url: 'https://fhir.nhs.uk/StructureDefinition/Extension-EPS-Prescription', index: 1}
          max: 1
        repeatInformation:
          match: {}
          schema: {type: Extension, short: Used in the EPS Prescription Tracker, mustSupport: true, url: 'https://fhir.nhs.uk/StructureDefinition/Extension-EPS-RepeatInformation', index: 2}
          max: 1
  for:
    constraint:
      patient-reference: {human: An identifier reference or resource reference must be provided, severity: error, expression: (reference.exists() or identifier.exists())}
      patient-nhs: {human: Length of the supplied NHS Number is wrong., severity: error, expression: 'identifier.where(system=''https://fhir.nhs.uk/Id/nhs-number'').exists().not() or (identifier.where(system=''https://fhir.nhs.uk/Id/nhs-number'').exists()  and identifier.where(system=''https://fhir.nhs.uk/Id/nhs-number'').value.matches(''^([0-9]{10})$''))'}
    mustSupport: true
    index: 20
    elements:
      identifier:
        index: 21
        elements:
          system:
            pattern: {type: Uri, value: 'https://fhir.nhs.uk/Id/nhs-number'}
            index: 22
          value: {index: 23}
        required: [value, system]
    required: [identifier]
  requester:
    type: Reference
    mustSupport: true
    refers: ['https://fhir.nhs.uk/StructureDefinition/NHSDigital-PractitionerRole']
    index: 25
    elements:
      identifier:
        elements:
          system: {index: 26}
          value: {index: 27}
        required: [value, system]
  status: {mustSupport: true, index: 5}
  groupIdentifier: {mustSupport: true, index: 4}
  code:
    mustSupport: true
    index: 9
    elements:
      coding:
        index: 10
        elements:
          system: {index: 11}
          code: {index: 12}
        required: [system, code]
        slicing:
          rules: open
          discriminator:
          - {path: system, type: value}
          min: null
          slices:
            SNOMED:
              match: {system: 'http://snomed.info/sct'}
              schema:
                binding: {strength: extensible, valueSet: 'https://fhir.nhs.uk/ValueSet/NHSDigital-action-code'}
                index: 13
                elements:
                  system:
                    pattern: {type: Uri, value: 'http://snomed.info/sct'}
                    index: 14
            Fulfilment:
              match: {system: 'http://hl7.org/fhir/CodeSystem/task-code'}
              schema:
                binding: {strength: extensible, valueSet: 'https://fhir.nhs.uk/ValueSet/NHSDigital-task-code'}
                index: 15
                elements:
                  system:
                    pattern: {type: Uri, value: 'http://hl7.org/fhir/CodeSystem/task-code'}
                    index: 16
            Worflow:
              match: {system: 'https://fhir.nhs.uk/CodeSystem/Workflow-Code'}
              schema:
                binding: {strength: extensible, valueSet: 'https://fhir.nhs.uk/ValueSet/NHSDigital-workflow-code'}
                index: 17
                elements:
                  system:
                    pattern: {type: Uri, value: 'https://fhir.nhs.uk/CodeSystem/Workflow-Code'}
                    index: 18
  identifier: {mustSupport: true, index: 3}
  intent: {mustSupport: true, index: 8}
  focus:
    type: Reference
    constraint:
      nhsd-taskfocus: {human: focus - An identifier reference or resource reference must be provided, severity: error, expression: (reference.exists() or identifier.exists())}
    mustSupport: true
    refers: ['https://fhir.hl7.org.uk/StructureDefinition/UKCore-Patient', 'https://fhir.nhs.uk/StructureDefinition/NHSDigital-Appointment', 'https://fhir.nhs.uk/StructureDefinition/NHSDigital-Bundle-FHIRMessage', 'https://fhir.nhs.uk/StructureDefinition/NHSDigital-MedicationRequest', 'https://fhir.nhs.uk/StructureDefinition/NHSDigital-Questionnaire', 'https://fhir.nhs.uk/StructureDefinition/NHSDigital-ServiceRequest']
    index: 19
  input: {mustSupport: true, index: 41}
  owner:
    type: Reference
    short: Responsible organisation
    mustSupport: true
    refers: ['https://fhir.nhs.uk/StructureDefinition/NHSDigital-Organization', 'https://fhir.nhs.uk/StructureDefinition/NHSDigital-PractitionerRole']
    index: 28
    elements:
      identifier:
        elements:
          system: {index: 29}
          value: {index: 30}
        required: [value, system]
package_version: 2.16.0-prerelease
extensions:
  agent: {url: 'https://fhir.nhs.uk/StructureDefinition/Extension-Provenance-agent', max: 1, type: Extension, short: Provenance of the resource, mustSupport: true, index: 0}
  prescription: {url: 'https://fhir.nhs.uk/StructureDefinition/Extension-EPS-Prescription', max: 1, type: Extension, short: EPS Patient Tracker extension, mustSupport: true, index: 1}
  repeatInformation: {url: 'https://fhir.nhs.uk/StructureDefinition/Extension-EPS-RepeatInformation', max: 1, type: Extension, short: Used in the EPS Prescription Tracker, mustSupport: true, index: 2}
class: profile
kind: resource
url: https://fhir.nhs.uk/StructureDefinition/NHSDigital-Task
base: https://fhir.hl7.org.uk/StructureDefinition/UKCore-Task
version: 1.1.0
required: [for, code]