PackagesCanonicalsLogsProblems
    Packages
    uk.nhsdigital.r4.test@2.8.21-prerelease
    https://fhir.nhs.uk/StructureDefinition/Extension-Provenance-agent
{
  "description": null,
  "_filename": "Extension-NHSDigital-Provenance-agent.StructureDefinition.json",
  "package_name": "uk.nhsdigital.r4.test",
  "date": "2024-08-14T13:51:00+00:00",
  "derivation": "constraint",
  "publisher": null,
  "fhirVersion": "4.0.1",
  "name": "ExtensionProvenanceAgent",
  "mapping": [ {
    "uri": "http://hl7.org/v3",
    "name": "RIM Mapping",
    "identity": "rim"
  } ],
  "abstract": false,
  "type": "Extension",
  "experimental": null,
  "resourceType": "StructureDefinition",
  "title": null,
  "package_version": "2.8.21-prerelease",
  "status": "draft",
  "id": "cb917260-8573-4074-83b0-07710199fceb",
  "kind": "complex-type",
  "url": "https://fhir.nhs.uk/StructureDefinition/Extension-Provenance-agent",
  "context": [ {
    "type": "element",
    "expression": "Task"
  }, {
    "type": "element",
    "expression": "Claim"
  }, {
    "type": "element",
    "expression": "Appointment"
  } ],
  "version": "1.0.1",
  "differential": {
    "element": [ {
      "id": "Extension.url",
      "path": "Extension.url",
      "fixedUri": "https://fhir.nhs.uk/StructureDefinition/Extension-Provenance-agent"
    }, {
      "id": "Extension.value[x]",
      "min": 1,
      "path": "Extension.value[x]",
      "type": [ {
        "code": "Reference",
        "targetProfile": [ "https://fhir.nhs.uk/StructureDefinition/NHSDigital-PractitionerRole", "https://fhir.nhs.uk/StructureDefinition/NHSDigital-Practitioner", "https://fhir.nhs.uk/StructureDefinition/NHSDigital-HealthcareService" ]
      } ],
      "constraint": [ {
        "key": "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())"
      }, {
        "key": "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}$'))"
      }, {
        "key": "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}$'))"
      }, {
        "key": "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}$'))"
      }, {
        "key": "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}$'))"
      }, {
        "key": "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}$'))"
      }, {
        "key": "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}$'))"
      }, {
        "key": "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}$'))"
      } ]
    }, {
      "id": "Extension.value[x].identifier",
      "min": 1,
      "path": "Extension.value[x].identifier"
    }, {
      "id": "Extension.value[x].identifier.system",
      "min": 1,
      "path": "Extension.value[x].identifier.system"
    }, {
      "id": "Extension.value[x].identifier.value",
      "min": 1,
      "path": "Extension.value[x].identifier.value"
    } ]
  },
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Extension"
}