{
  "resourceType": "StructureDefinition",
  "id": "19aa8f3d-46b0-486a-bab8-056a383e0f88",
  "url": "https://fhir.nhs.uk/StructureDefinition/NHSDigital-Organization",
  "name": "NHSDigitalOrganization",
  "status": "draft",
  "purpose": "NHS Digital generic definintion of the data requirements for Organization.",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "Organization",
  "baseDefinition": "https://fhir.hl7.org.uk/StructureDefinition/UKCore-Organization",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Organization.extension",
        "path": "Organization.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        },
        "min": 0
      },
      {
        "id": "Organization.extension:relationships",
        "path": "Organization.extension",
        "sliceName": "relationships",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://fhir.nhs.uk/StructureDefinition/Extension-ODS-OrganisationRelationships"
            ]
          }
        ]
      },
      {
        "id": "Organization.identifier",
        "path": "Organization.identifier",
        "definition": "**MUST** contain an ANANA/ODS code. \r\n\r\n```json\r\n \"identifier\":  [\r\n        {\r\n            \"use\": \"official\",\r\n            \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\",\r\n            \"value\": \"RR805\"\r\n        }\r\n    ],\r\n```",
        "comment": "MUST contain an ANANA/ODS code.",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Organization.identifier:odsSiteCode",
        "path": "Organization.identifier",
        "sliceName": "odsSiteCode",
        "max": "0"
      },
      {
        "id": "Organization.type",
        "path": "Organization.type",
        "definition": "The Organisation types **MUST** be present and comes from the valueSet.\r\n`type` will also include details on when these roles applied, the current status and a boolean to indicate the Organisations primary role. These extensions are for API's produced by NHS Digital one, the are not expected to be present in resources created by NHS providers or suppliers.\r\n\r\n```json\r\n\r\n \"type\":  [\r\n        {\r\n            \"extension\":  [\r\n                {\r\n                    \"url\": \"https://fhir.nhs.uk/StructureDefinition/Extension-ODS-Organization-Role\",\r\n                    \"extension\":  [\r\n                        {\r\n                            \"url\": \"primaryRole\",\r\n                            \"valueBoolean\": true\r\n                        },\r\n                        {\r\n                            \"url\": \"status\",\r\n                            \"valueString\": \"Active\"\r\n                        }\r\n                    ]\r\n                },\r\n                {\r\n                    \"url\": \"https://fhir.nhs.uk/StructureDefinition/Extension-ODS-Organization-Role-ActivePeriod\",\r\n                    \"extension\":  [\r\n                        {\r\n                            \"url\": \"activePeriod\",\r\n                            \"valuePeriod\": {\r\n                                \"start\": \"2020-04-01\"\r\n                            }\r\n                        },\r\n                        {\r\n                            \"url\": \"dateType\",\r\n                            \"valueString\": \"Operational\"\r\n                        }\r\n                    ]\r\n                }\r\n            ],\r\n            \"coding\":  [\r\n                {\r\n                    \"system\": \"https://fhir.nhs.uk/CodeSystem/organisation-role\",\r\n                    \"code\": \"198\",\r\n                    \"display\": \"NHS TRUST SITE\"\r\n                }\r\n            ]\r\n        }\r\n    ],\r\n```",
        "binding": {
          "strength": "preferred",
          "valueSet": "https://fhir.nhs.uk/ValueSet/organisation-role"
        }
      },
      {
        "id": "Organization.type.extension",
        "path": "Organization.type.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        },
        "min": 0
      },
      {
        "id": "Organization.type.extension:activePeriod",
        "path": "Organization.type.extension",
        "sliceName": "activePeriod",
        "min": 0,
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://fhir.nhs.uk/StructureDefinition/Extension-ODS-Organization-Role-ActivePeriod"
            ]
          }
        ]
      },
      {
        "id": "Organization.type.extension:organisationRole",
        "path": "Organization.type.extension",
        "sliceName": "organisationRole",
        "min": 0,
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://fhir.nhs.uk/StructureDefinition/Extension-ODS-Organization-Role"
            ]
          }
        ]
      },
      {
        "id": "Organization.type.coding.system",
        "path": "Organization.type.coding.system",
        "min": 1,
        "fixedUri": "https://fhir.nhs.uk/CodeSystem/organisation-role"
      },
      {
        "id": "Organization.name",
        "path": "Organization.name",
        "definition": "The ODS/SDS name of the Organisation\r\n\r\n```json\r\n\r\n    \"name\": \"NHS NIGHTINGALE HOSPITAL YORKSHIRE AND THE HUMBER\"\r\n```",
        "mustSupport": true
      },
      {
        "id": "Organization.telecom",
        "path": "Organization.telecom",
        "definition": "Contact phone numbers and address of the organisation.\r\n\r\n```json\r\n\r\n    \"telecom\":  [\r\n        {\r\n            \"system\": \"fax\",\r\n            \"value\": \"0113 242 6496\",\r\n            \"use\": \"work\"\r\n        },\r\n        {\r\n            \"system\": \"phone\",\r\n            \"value\": \"0113 243 3144\",\r\n            \"use\": \"work\"\r\n        }\r\n    ],\r\n    \"address\":  [\r\n        {\r\n            \"line\":  [\r\n                \"KINGS ROAD\"\r\n            ],\r\n            \"city\": \"HARROGATE\",\r\n            \"postalCode\": \"HG1 5LA\",\r\n            \"country\": \"ENGLAND\"\r\n        }\r\n    ],\r\n    \"partOf\": {\r\n        \"reference\": \"https://directory.spineservices.nhs.uk/R4/Organization/RR805\",\r\n        \"identifier\": {\r\n            \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\",\r\n            \"value\": \"RR8\"\r\n        }\r\n    }\r\n```",
        "mustSupport": true
      },
      {
        "id": "Organization.telecom.value",
        "path": "Organization.telecom.value",
        "min": 1
      },
      {
        "id": "Organization.address",
        "path": "Organization.address",
        "definition": "Contact phone numbers and address of the organisation.\r\n\r\n```json\r\n\r\n    \"telecom\":  [\r\n        {\r\n            \"system\": \"fax\",\r\n            \"value\": \"0113 242 6496\",\r\n            \"use\": \"work\"\r\n        },\r\n        {\r\n            \"system\": \"phone\",\r\n            \"value\": \"0113 243 3144\",\r\n            \"use\": \"work\"\r\n        }\r\n    ],\r\n    \"address\":  [\r\n        {\r\n            \"line\":  [\r\n                \"KINGS ROAD\"\r\n            ],\r\n            \"city\": \"HARROGATE\",\r\n            \"postalCode\": \"HG1 5LA\",\r\n            \"country\": \"ENGLAND\"\r\n        }\r\n    ],\r\n    \"partOf\": {\r\n        \"reference\": \"https://directory.spineservices.nhs.uk/R4/Organization/RR805\",\r\n        \"identifier\": {\r\n            \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\",\r\n            \"value\": \"RR8\"\r\n        }\r\n    }\r\n```",
        "mustSupport": true
      },
      {
        "id": "Organization.partOf",
        "path": "Organization.partOf",
        "definition": "Recommended mandatory for primary care organisations.\r\n\r\n```json\r\n\r\n    \"telecom\":  [\r\n        {\r\n            \"system\": \"fax\",\r\n            \"value\": \"0113 242 6496\",\r\n            \"use\": \"work\"\r\n        },\r\n        {\r\n            \"system\": \"phone\",\r\n            \"value\": \"0113 243 3144\",\r\n            \"use\": \"work\"\r\n        }\r\n    ],\r\n    \"address\":  [\r\n        {\r\n            \"line\":  [\r\n                \"KINGS ROAD\"\r\n            ],\r\n            \"city\": \"HARROGATE\",\r\n            \"postalCode\": \"HG1 5LA\",\r\n            \"country\": \"ENGLAND\"\r\n        }\r\n    ],\r\n    \"partOf\": {\r\n        \"reference\": \"https://directory.spineservices.nhs.uk/R4/Organization/RR805\",\r\n        \"identifier\": {\r\n            \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\",\r\n            \"value\": \"RR8\"\r\n        }\r\n    }\r\n```",
        "constraint": [
          {
            "key": "nhsd-6",
            "severity": "warning",
            "human": "partOf.display - a display name should be provided",
            "expression": "display.exists()"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Organization.partOf.identifier",
        "path": "Organization.partOf.identifier",
        "min": 1
      },
      {
        "id": "Organization.partOf.identifier.system",
        "path": "Organization.partOf.identifier.system",
        "min": 1
      },
      {
        "id": "Organization.partOf.identifier.value",
        "path": "Organization.partOf.identifier.value",
        "min": 1
      }
    ]
  }
}