{
  "resourceType": "StructureDefinition",
  "url": "https://fhir.nhs.uk/StructureDefinition/NHSDigital-PractitionerRole-EPSLegal",
  "name": "NHSDigitalPractitionerRoleEPSLegal",
  "status": "draft",
  "purpose": "Constraint profile for EPS MedicationRequest which enforces the legal requirement for prescriptions",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "PractitionerRole",
  "baseDefinition": "https://fhir.nhs.uk/StructureDefinition/NHSDigital-PractitionerRole",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "PractitionerRole.identifier",
        "path": "PractitionerRole.identifier",
        "min": 1
      },
      {
        "id": "PractitionerRole.identifier:sdsRoleProfileID",
        "path": "PractitionerRole.identifier",
        "sliceName": "sdsRoleProfileID",
        "min": 1
      },
      {
        "id": "PractitionerRole.practitioner",
        "path": "PractitionerRole.practitioner",
        "min": 1,
        "constraint": [
          {
            "key": "nhsd-practitioner-references",
            "severity": "error",
            "human": "practitioner - An identifier reference or resource reference must be provided",
            "expression": "(reference.exists() or (identifier.exists()))",
            "source": "https://fhir.nhs.uk/StructureDefinition/NHSDigital-PractitionerRole-EPSLegal"
          }
        ]
      },
      {
        "id": "PractitionerRole.organization",
        "path": "PractitionerRole.organization",
        "min": 1,
        "constraint": [
          {
            "key": "nhsd-organization-references",
            "severity": "error",
            "human": "organisation - An identifier reference or resource reference must be provided",
            "expression": "(reference.exists() or (identifier.exists()))",
            "source": "https://fhir.nhs.uk/StructureDefinition/NHSDigital-PractitionerRole-EPSLegal"
          }
        ]
      },
      {
        "id": "PractitionerRole.code",
        "path": "PractitionerRole.code",
        "min": 1
      },
      {
        "id": "PractitionerRole.location",
        "path": "PractitionerRole.location",
        "type": [
          {
            "code": "Reference",
            "aggregation": [
              "bundled"
            ]
          }
        ]
      },
      {
        "id": "PractitionerRole.telecom",
        "path": "PractitionerRole.telecom",
        "min": 1
      }
    ]
  }
}