PackagesCanonicalsLogsProblems
    Packages
    uk.nhsdigital.r4.test@2.10.0-prerelease
    https://fhir.nhs.uk/StructureDefinition/Extension-Provenance-agent
description: null
package_name: uk.nhsdigital.r4.test
derivation: constraint
name: ExtensionProvenanceAgent
type: Extension
elements:
  url:
    pattern: {type: Uri, value: 'https://fhir.nhs.uk/StructureDefinition/Extension-Provenance-agent'}
    index: 0
  value:
    constraint:
      usercode-reference: {human: An identifier reference or resource reference must be provided, source: 'https://fhir.nhs.uk/StructureDefinition/Extension-Provenance-agent', severity: error, expression: (reference.exists() or identifier.exists())}
      usercode-nmc: {human: NMC must be of the format NNANNNNA, source: 'https://fhir.nhs.uk/StructureDefinition/Extension-Provenance-agent', severity: error, expression: 'identifier.exists().not() or identifier.where(system=''https://fhir.hl7.org.uk/Id/nmc-number'').exists().not() or (identifier.where(system=''https://fhir.hl7.org.uk/Id/nmc-number'').exists()  and identifier.where(system=''https://fhir.hl7.org.uk/Id/nmc-number'').value.matches(''^[0-9]{2}[A-Z]{1}[0-9]{4}[A-Z]{1}$''))'}
      usercode-gmp: {human: GMP must be of the format GNNNNNNN and not be a spurious code (starts with G6 or G7), source: 'https://fhir.nhs.uk/StructureDefinition/Extension-Provenance-agent', severity: error, expression: 'identifier.exists().not() or identifier.where(system=''https://fhir.hl7.org.uk/Id/gmp-number'').exists().not() or (identifier.where(system=''https://fhir.hl7.org.uk/Id/gmp-number'').exists()  and identifier.where(system=''https://fhir.hl7.org.uk/Id/gmp-number'').value.matches(''^[G]{1}[01234589]{1}[0-9]{6}$''))'}
      usercode-gmc: {human: GMC must be of the format CNNNNNNN, source: 'https://fhir.nhs.uk/StructureDefinition/Extension-Provenance-agent', severity: error, expression: 'identifier.exists().not() or identifier.where(system=''https://fhir.hl7.org.uk/Id/gmc-number'').exists().not() or (identifier.where(system=''https://fhir.hl7.org.uk/Id/gmc-number'').exists()  and identifier.where(system=''https://fhir.hl7.org.uk/Id/gmc-number'').value.matches(''^[C]{1}[0-9]{7}$''))'}
      usercode-gphc: {human: GPHC must be of the format NNNNNNN, source: 'https://fhir.nhs.uk/StructureDefinition/Extension-Provenance-agent', severity: error, expression: 'identifier.exists().not() or identifier.where(system=''https://fhir.hl7.org.uk/Id/gphc-number'').exists().not() or (identifier.where(system=''https://fhir.hl7.org.uk/Id/gphc-number'').exists()  and identifier.where(system=''https://fhir.hl7.org.uk/Id/gphc-number'').value.matches(''^[0-9]{7}$''))'}
      usercode-hcpc: {human: HCPC must be of the format AANNNNNN, source: 'https://fhir.nhs.uk/StructureDefinition/Extension-Provenance-agent', severity: error, expression: 'identifier.exists().not() or identifier.where(system=''https://fhir.hl7.org.uk/Id/hcpc-number'').exists().not() or (identifier.where(system=''https://fhir.hl7.org.uk/Id/hcpc-number'').exists()  and identifier.where(system=''https://fhir.hl7.org.uk/Id/hcpc-number'').value.matches(''^[A-Z]{2}[0-9]{6}$''))'}
      usercode-din: {human: DIN format must be NNNNNN, source: 'https://fhir.nhs.uk/StructureDefinition/Extension-Provenance-agent', severity: error, expression: 'identifier.exists().not() or identifier.where(system=''https://fhir.hl7.org.uk/Id/din-number'').exists().not() or (identifier.where(system=''https://fhir.hl7.org.uk/Id/din-number'').exists()  and identifier.where(system=''https://fhir.hl7.org.uk/Id/din-number'').value.matches(''^[0-9]{6}$''))'}
      role-sds-role-profile: {human: SDS Role Profile Id must be 12 digits, severity: error, expression: 'identifier.where(system=''https://fhir.nhs.uk/Id/sds-role-profile-id'').exists().not() or (identifier.where(system=''https://fhir.nhs.uk/Id/sds-role-profile-id'').exists()  and identifier.where(system=''https://fhir.nhs.uk/Id/sds-role-profile-id'').value.matches(''^[0-9]{12}$''))'}
    choices: [valueReference]
    index: 2
  valueReference:
    type: Reference
    constraint:
      usercode-reference: {human: An identifier reference or resource reference must be provided, source: 'https://fhir.nhs.uk/StructureDefinition/Extension-Provenance-agent', severity: error, expression: (reference.exists() or identifier.exists())}
      usercode-nmc: {human: NMC must be of the format NNANNNNA, source: 'https://fhir.nhs.uk/StructureDefinition/Extension-Provenance-agent', severity: error, expression: 'identifier.exists().not() or identifier.where(system=''https://fhir.hl7.org.uk/Id/nmc-number'').exists().not() or (identifier.where(system=''https://fhir.hl7.org.uk/Id/nmc-number'').exists()  and identifier.where(system=''https://fhir.hl7.org.uk/Id/nmc-number'').value.matches(''^[0-9]{2}[A-Z]{1}[0-9]{4}[A-Z]{1}$''))'}
      usercode-gmp: {human: GMP must be of the format GNNNNNNN and not be a spurious code (starts with G6 or G7), source: 'https://fhir.nhs.uk/StructureDefinition/Extension-Provenance-agent', severity: error, expression: 'identifier.exists().not() or identifier.where(system=''https://fhir.hl7.org.uk/Id/gmp-number'').exists().not() or (identifier.where(system=''https://fhir.hl7.org.uk/Id/gmp-number'').exists()  and identifier.where(system=''https://fhir.hl7.org.uk/Id/gmp-number'').value.matches(''^[G]{1}[01234589]{1}[0-9]{6}$''))'}
      usercode-gmc: {human: GMC must be of the format CNNNNNNN, source: 'https://fhir.nhs.uk/StructureDefinition/Extension-Provenance-agent', severity: error, expression: 'identifier.exists().not() or identifier.where(system=''https://fhir.hl7.org.uk/Id/gmc-number'').exists().not() or (identifier.where(system=''https://fhir.hl7.org.uk/Id/gmc-number'').exists()  and identifier.where(system=''https://fhir.hl7.org.uk/Id/gmc-number'').value.matches(''^[C]{1}[0-9]{7}$''))'}
      usercode-gphc: {human: GPHC must be of the format NNNNNNN, source: 'https://fhir.nhs.uk/StructureDefinition/Extension-Provenance-agent', severity: error, expression: 'identifier.exists().not() or identifier.where(system=''https://fhir.hl7.org.uk/Id/gphc-number'').exists().not() or (identifier.where(system=''https://fhir.hl7.org.uk/Id/gphc-number'').exists()  and identifier.where(system=''https://fhir.hl7.org.uk/Id/gphc-number'').value.matches(''^[0-9]{7}$''))'}
      usercode-hcpc: {human: HCPC must be of the format AANNNNNN, source: 'https://fhir.nhs.uk/StructureDefinition/Extension-Provenance-agent', severity: error, expression: 'identifier.exists().not() or identifier.where(system=''https://fhir.hl7.org.uk/Id/hcpc-number'').exists().not() or (identifier.where(system=''https://fhir.hl7.org.uk/Id/hcpc-number'').exists()  and identifier.where(system=''https://fhir.hl7.org.uk/Id/hcpc-number'').value.matches(''^[A-Z]{2}[0-9]{6}$''))'}
      usercode-din: {human: DIN format must be NNNNNN, source: 'https://fhir.nhs.uk/StructureDefinition/Extension-Provenance-agent', severity: error, expression: 'identifier.exists().not() or identifier.where(system=''https://fhir.hl7.org.uk/Id/din-number'').exists().not() or (identifier.where(system=''https://fhir.hl7.org.uk/Id/din-number'').exists()  and identifier.where(system=''https://fhir.hl7.org.uk/Id/din-number'').value.matches(''^[0-9]{6}$''))'}
      role-sds-role-profile: {human: SDS Role Profile Id must be 12 digits, severity: error, expression: 'identifier.where(system=''https://fhir.nhs.uk/Id/sds-role-profile-id'').exists().not() or (identifier.where(system=''https://fhir.nhs.uk/Id/sds-role-profile-id'').exists()  and identifier.where(system=''https://fhir.nhs.uk/Id/sds-role-profile-id'').value.matches(''^[0-9]{12}$''))'}
    choiceOf: value
    refers: ['https://fhir.nhs.uk/StructureDefinition/NHSDigital-HealthcareService', 'https://fhir.nhs.uk/StructureDefinition/NHSDigital-Practitioner', 'https://fhir.nhs.uk/StructureDefinition/NHSDigital-PractitionerRole']
    index: 3
  value[x]:
    elements:
      identifier:
        index: 4
        elements:
          system: {index: 5}
          value: {index: 6}
        required: [value, system]
    required: [identifier]
package_version: 2.10.0-prerelease
class: extension
kind: complex-type
url: https://fhir.nhs.uk/StructureDefinition/Extension-Provenance-agent
base: http://hl7.org/fhir/StructureDefinition/Extension
version: 1.0.1
required: [valueReference, value]