PackagesCanonicalsLogsProblems
    Packages
    uk.nhsdigital.r4.test@2.8.16-prerelease
    https://fhir.nhs.uk/StructureDefinition/NHSDigital-Claim
description: null
package_name: uk.nhsdigital.r4.test
derivation: constraint
name: NHSDigitalClaim
type: Claim
elements:
  patient:
    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: 13
    elements:
      identifier:
        index: 14
        elements:
          system:
            pattern: {type: Uri, value: 'https://fhir.nhs.uk/Id/nhs-number'}
            index: 15
          value: {index: 16}
        required: [value, system]
    required: [identifier]
  insurance:
    mustSupport: true
    index: 45
    elements:
      coverage:
        elements:
          identifier:
            index: 46
            elements:
              system:
                pattern: {type: Uri, value: 'https://fhir.nhs.uk/Id/ods-organization-code'}
                index: 47
              value:
                pattern: {type: String, value: T1450}
                index: 48
            required: [value, system]
        required: [identifier]
  use:
    pattern: {type: Code, value: claim}
    index: 12
  item:
    mustSupport: true
    index: 49
    extensions:
      prescriptionStatus: {url: 'https://fhir.nhs.uk/StructureDefinition/Extension-EPS-TaskBusinessStatus', min: 1, max: 1, type: Extension, mustSupport: true, index: 51}
      prescriptionStatusReason: {url: 'https://fhir.nhs.uk/StructureDefinition/Extension-EPS-TaskBusinessStatusReason', min: 0, max: 1, short: Prescription Status Reason, type: Extension, mustSupport: true, index: 52}
    elements:
      extension:
        index: 50
        slicing:
          rules: open
          discriminator:
          - {path: url, type: value}
          min: 1
          slices:
            prescriptionStatus:
              match: {url: null}
              schema: {type: Extension, mustSupport: true, url: 'https://fhir.nhs.uk/StructureDefinition/Extension-EPS-TaskBusinessStatus', index: 51}
              min: 1
              max: 1
            prescriptionStatusReason:
              match: {url: null}
              schema: {short: Prescription Status Reason, type: Extension, mustSupport: true, url: 'https://fhir.nhs.uk/StructureDefinition/Extension-EPS-TaskBusinessStatusReason', index: 52}
              min: 0
              max: 1
      sequence:
        pattern: {type: PositiveInt, value: 1}
        index: 53
      productOrService:
        index: 54
        elements:
          coding:
            index: 55
            elements:
              system:
                pattern: {type: Uri, value: 'http://snomed.info/sct'}
                index: 56
              code:
                pattern: {type: Code, value: '16076005'}
                index: 57
              display:
                pattern: {type: String, value: Prescription}
                index: 58
            required: [display, system, code]
        required: [coding]
      programCode:
        short: PrescriptionChargeExemption
        mustSupport: true
        index: 59
        elements:
          coding:
            index: 60
            elements:
              system: {index: 61}
              code: {index: 62}
            required: [system, code]
        required: [coding]
        slicing:
          rules: open
          discriminator:
          - {path: coding.system, type: value}
          min: null
          slices:
            exemptionEvidence:
              match:
                coding: {system: 'https://fhir.nhs.uk/CodeSystem/DM-exemption-evidence'}
              schema:
                binding: {strength: extensible, valueSet: 'https://fhir.nhs.uk/ValueSet/DM-vs-exemption-evidence'}
                mustSupport: true
                index: 63
                elements:
                  coding:
                    elements:
                      system:
                        pattern: {type: Uri, value: 'https://fhir.nhs.uk/CodeSystem/DM-exemption-evidence'}
                        index: 64
                      code: {index: 65}
                    required: [system, code]
            prescriptionChargeExemption:
              match:
                coding: {system: 'https://fhir.nhs.uk/CodeSystem/prescription-charge-exemption'}
              schema:
                binding: {strength: required, valueSet: 'https://fhir.nhs.uk/ValueSet/DM-prescription-charge-exemption'}
                mustSupport: true
                _required: true
                index: 66
                elements:
                  coding:
                    elements:
                      system:
                        pattern: {type: Uri, value: 'https://fhir.nhs.uk/CodeSystem/prescription-charge-exemption'}
                        index: 67
                      code: {index: 68}
                    required: [system, code]
      detail:
        mustSupport: true
        index: 69
        extensions:
          medicationRequest: {url: 'https://fhir.nhs.uk/StructureDefinition/Extension-ClaimMedicationRequestReference', min: 1, max: 1, short: MedicationRequest reference, type: Extension, mustSupport: true, index: 71}
          sequenceIdentifier: {url: 'https://fhir.nhs.uk/StructureDefinition/Extension-ClaimSequenceIdentifier', min: 1, max: 1, type: Extension, mustSupport: true, index: 72}
          repeatInformation: {url: 'https://fhir.nhs.uk/StructureDefinition/Extension-EPS-RepeatInformation', min: 0, max: 1, type: Extension, index: 73}
          taskBusinessStatusReason: {url: 'https://fhir.nhs.uk/StructureDefinition/Extension-EPS-TaskBusinessStatusReason', min: 0, max: 1, type: Extension, isModifier: false, index: 74}
        elements:
          extension:
            array: true
            min: 2
            index: 70
            slicing:
              rules: open
              discriminator:
              - {path: url, type: value}
              min: 2
              slices:
                medicationRequest:
                  match: {url: null}
                  schema: {short: MedicationRequest reference, type: Extension, mustSupport: true, url: 'https://fhir.nhs.uk/StructureDefinition/Extension-ClaimMedicationRequestReference', index: 71}
                  min: 1
                  max: 1
                sequenceIdentifier:
                  match: {url: null}
                  schema: {type: Extension, mustSupport: true, url: 'https://fhir.nhs.uk/StructureDefinition/Extension-ClaimSequenceIdentifier', index: 72}
                  min: 1
                  max: 1
                repeatInformation:
                  match: {url: null}
                  schema: {type: Extension, url: 'https://fhir.nhs.uk/StructureDefinition/Extension-EPS-RepeatInformation', index: 73}
                  min: 0
                  max: 1
                taskBusinessStatusReason:
                  match: {url: null}
                  schema: {type: Extension, isModifier: false, url: 'https://fhir.nhs.uk/StructureDefinition/Extension-EPS-TaskBusinessStatusReason', index: 74}
                  min: 0
                  max: 1
          sequence: {mustSupport: true, index: 75}
          productOrService:
            binding: {strength: required, valueSet: 'https://fhir.nhs.uk/ValueSet/NHSDigital-MedicationRequest-Code'}
            mustSupport: true
            index: 76
          modifier:
            binding: {strength: required, valueSet: 'https://fhir.nhs.uk/ValueSet/DM-medicationdispense-type'}
            mustSupport: true
            index: 77
          programCode:
            short: Dispensing Endorsement and Charge Payment
            mustSupport: true
            index: 78
            elements:
              coding:
                mustSupport: true
                index: 79
                elements:
                  system: {index: 80}
                  code: {index: 81}
                required: [system, code]
            required: [coding]
            slicing:
              rules: open
              discriminator:
              - {path: coding.system, type: value}
              min: null
              slices:
                prescriptionCharge:
                  match:
                    coding: {system: 'https://fhir.nhs.uk/CodeSystem/DM-prescription-charge'}
                  schema:
                    binding: {strength: required, valueSet: 'https://fhir.nhs.uk/ValueSet/DM-vs-prescription-charge'}
                    mustSupport: true
                    _required: true
                    index: 82
                    elements:
                      coding:
                        elements:
                          system:
                            pattern: {type: Uri, value: 'https://fhir.nhs.uk/CodeSystem/DM-prescription-charge'}
                            index: 83
                dispensingEndorsement:
                  match:
                    coding: {system: 'https://fhir.nhs.uk/CodeSystem/medicationdispense-endorsement'}
                  schema:
                    binding: {strength: required, valueSet: 'https://fhir.nhs.uk/ValueSet/DM-dispensing-endorsement'}
                    mustSupport: true
                    index: 84
                    elements:
                      coding:
                        elements:
                          system:
                            pattern: {type: Uri, value: 'https://fhir.nhs.uk/CodeSystem/medicationdispense-endorsement'}
                            index: 85
                      text: {short: Additional Information for Dispensing Endorsements, index: 86}
          quantity: {mustSupport: true, index: 87}
          subDetail:
            mustSupport: true
            index: 88
            extensions:
              medicationDispense: {url: 'https://fhir.nhs.uk/StructureDefinition/Extension-ClaimMedicationDispenseReference', min: 0, max: 1, type: Extension, index: 90}
              repeatInformation: {url: 'https://fhir.nhs.uk/StructureDefinition/Extension-EPS-RepeatInformation', min: 0, max: 1, type: Extension, index: 91}
            elements:
              extension:
                index: 89
                slicing:
                  rules: open
                  discriminator:
                  - {path: url, type: value}
                  min: 0
                  slices:
                    medicationDispense:
                      match: {url: null}
                      schema: {type: Extension, url: 'https://fhir.nhs.uk/StructureDefinition/Extension-ClaimMedicationDispenseReference', index: 90}
                      min: 0
                      max: 1
                    repeatInformation:
                      match: {url: null}
                      schema: {type: Extension, url: 'https://fhir.nhs.uk/StructureDefinition/Extension-EPS-RepeatInformation', index: 91}
                      min: 0
                      max: 1
              sequence: {mustSupport: true, index: 92}
              productOrService:
                binding: {strength: extensible, valueSet: 'https://fhir.nhs.uk/ValueSet/NHSDigital-MedicationDispense-Code'}
                mustSupport: true
                index: 93
              quantity:
                mustSupport: true
                index: 94
                extensions:
                  runningTotal: {url: 'https://fhir.nhs.uk/StructureDefinition/Extension-DM-RunningTotal', min: 0, max: 1, type: Extension, index: 96}
                elements:
                  extension:
                    index: 95
                    slicing:
                      rules: open
                      discriminator:
                      - {path: url, type: value}
                      min: 0
                      slices:
                        runningTotal:
                          match: {url: null}
                          schema: {type: Extension, url: 'https://fhir.nhs.uk/StructureDefinition/Extension-DM-RunningTotal', index: 96}
                          min: 0
                          max: 1
            required: [quantity]
        required: [modifier]
    required: [detail, extension]
  type:
    mustSupport: true
    index: 8
    elements:
      coding:
        index: 9
        elements:
          system:
            pattern: {type: Uri, value: 'http://terminology.hl7.org/CodeSystem/claim-type'}
            index: 10
          code:
            pattern: {type: Code, value: pharmacy}
            index: 11
        required: [system, code]
    required: [coding]
  created: {mustSupport: true, index: 17}
  extension:
    index: 0
    slicing:
      rules: open
      discriminator:
      - {path: url, type: value}
      min: 0
      slices:
        replacementOf:
          match: {url: null}
          schema: {short: Used to reference a previous Claim, type: Extension, mustSupport: true, url: 'https://fhir.nhs.uk/StructureDefinition/Extension-replacementOf', index: 1}
          min: 0
          max: 1
        agent:
          match: {url: null}
          schema: {short: Provenance of the resource, type: Extension, mustSupport: true, url: 'https://fhir.nhs.uk/StructureDefinition/Extension-Provenance-agent', index: 2}
          min: 0
          max: 1
        supplyHeaderIdentifier:
          match: {url: null}
          schema: {short: Identifier for the SupplyHeader, type: Extension, mustSupport: true, url: 'https://fhir.nhs.uk/StructureDefinition/Extension-EPS-SupplyHeaderIdentifier', index: 3}
          min: 0
          max: 1
  priority:
    mustSupport: true
    index: 22
    elements:
      coding:
        index: 23
        elements:
          system:
            pattern: {type: Uri, value: 'http://terminology.hl7.org/CodeSystem/processpriority'}
            index: 24
          code:
            pattern: {type: Code, value: normal}
            index: 25
        required: [system, code]
    required: [coding]
  status: {mustSupport: true, index: 7}
  payee:
    mustSupport: true
    index: 37
    elements:
      type:
        elements:
          coding:
            index: 38
            elements:
              system:
                pattern: {type: Uri, value: 'http://terminology.hl7.org/CodeSystem/payeetype'}
                index: 39
              code:
                pattern: {type: Code, value: provider}
                index: 40
              display:
                pattern: {type: String, value: Provider}
                index: 41
            required: [display, system, code]
        required: [coding]
      party:
        type: Reference
        constraint:
          nhsd-claim-party: {human: party - An identifier reference or resource reference must be provided, severity: error, expression: (reference.exists() or (identifier.exists()))}
        refers: ['https://fhir.nhs.uk/StructureDefinition/NHSDigital-Organization']
        index: 42
        elements:
          identifier:
            elements:
              system:
                pattern: {type: Uri, value: 'https://fhir.nhs.uk/Id/ods-organization-code'}
                index: 43
              value: {index: 44}
            required: [value, system]
    required: [party]
  prescription:
    mustSupport: true
    index: 26
    extensions:
      groupIdentifier: {url: 'https://fhir.nhs.uk/StructureDefinition/Extension-DM-GroupIdentifier', min: 1, max: 1, type: Extension, index: 28}
    elements:
      extension:
        index: 27
        slicing:
          rules: open
          discriminator:
          - {path: url, type: value}
          min: 1
          slices:
            groupIdentifier:
              match: {url: null}
              schema: {type: Extension, url: 'https://fhir.nhs.uk/StructureDefinition/Extension-DM-GroupIdentifier', index: 28}
              min: 1
              max: 1
      reference: {index: 29}
      identifier:
        index: 30
        elements:
          system:
            pattern: {type: Uri, value: 'https://fhir.nhs.uk/Id/prescription-order-item-number'}
            index: 31
          value: {index: 32}
        required: [value, system]
    required: [extension]
  identifier:
    mustSupport: true
    index: 4
    elements:
      system: {index: 5}
      value: {index: 6}
    required: [value, system]
  provider:
    type: Reference
    mustSupport: true
    refers: ['https://fhir.nhs.uk/StructureDefinition/NHSDigital-PractitionerRole-SDS']
    index: 18
    elements:
      reference: {index: 19}
      identifier:
        elements:
          system: {index: 20}
          value: {index: 21}
        required: [value, system]
    required: [reference]
  originalPrescription:
    extensions:
      groupIdentifier: {url: 'https://fhir.nhs.uk/StructureDefinition/Extension-DM-GroupIdentifier', min: 1, max: 1, type: Extension, index: 34}
    elements:
      extension:
        index: 33
        slicing:
          rules: open
          discriminator:
          - {path: url, type: value}
          min: 1
          slices:
            groupIdentifier:
              match: {url: null}
              schema: {type: Extension, url: 'https://fhir.nhs.uk/StructureDefinition/Extension-DM-GroupIdentifier', index: 34}
              min: 1
              max: 1
      identifier:
        elements:
          system: {index: 35}
          value: {index: 36}
        required: [value, system]
    required: [extension]
package_version: 2.8.16-prerelease
extensions:
  replacementOf: {url: 'https://fhir.nhs.uk/StructureDefinition/Extension-replacementOf', min: 0, max: 1, short: Used to reference a previous Claim, type: Extension, mustSupport: true, index: 1}
  agent: {url: 'https://fhir.nhs.uk/StructureDefinition/Extension-Provenance-agent', min: 0, max: 1, short: Provenance of the resource, type: Extension, mustSupport: true, index: 2}
  supplyHeaderIdentifier: {url: 'https://fhir.nhs.uk/StructureDefinition/Extension-EPS-SupplyHeaderIdentifier', min: 0, max: 1, short: Identifier for the SupplyHeader, type: Extension, mustSupport: true, index: 3}
class: profile
kind: resource
url: https://fhir.nhs.uk/StructureDefinition/NHSDigital-Claim
base: http://hl7.org/fhir/StructureDefinition/Claim
version: null
required: [prescription, payee, identifier, item]