{
  "resourceType": "StructureDefinition",
  "id": "DataStandardsWales-Organization",
  "url": "https://fhir.nhs.wales/StructureDefinition/DataStandardsWales-Organization",
  "version": "1.2.0",
  "name": "DataStandardsWalesOrganization",
  "title": "Data Standards Wales Organization",
  "status": "active",
  "experimental": false,
  "date": "2026-05-29",
  "publisher": "NHS Wales",
  "copyright": "2026 NHS Wales.",
  "fhirVersion": "4.0.1",
  "mapping": [
    {
      "identity": "v2",
      "uri": "http://hl7.org/v2",
      "name": "HL7 v2 Mapping"
    },
    {
      "identity": "rim",
      "uri": "http://hl7.org/v3",
      "name": "RIM Mapping"
    },
    {
      "identity": "servd",
      "uri": "http://www.omg.org/spec/ServD/1.0/",
      "name": "ServD"
    },
    {
      "identity": "w5",
      "uri": "http://hl7.org/fhir/fivews",
      "name": "FiveWs Pattern Mapping"
    }
  ],
  "kind": "resource",
  "abstract": false,
  "type": "Organization",
  "baseDefinition": "https://fhir.hl7.org.uk/StructureDefinition/UKCore-Organization",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Organization.identifier",
        "path": "Organization.identifier",
        "comment": "Identifiers for the organization SHOULD be populated if the data exists"
      },
      {
        "id": "Organization.identifier:odsOrganisationCode",
        "path": "Organization.identifier",
        "sliceName": "odsOrganisationCode",
        "mustSupport": true
      },
      {
        "id": "Organization.identifier:odsSiteCode",
        "path": "Organization.identifier",
        "sliceName": "odsSiteCode",
        "max": "0"
      },
      {
        "id": "Organization.identifier:gpClusterCode",
        "path": "Organization.identifier",
        "sliceName": "gpClusterCode",
        "short": "Deprecated. Identifies a Wales GP Cluster organization across multiple systems",
        "definition": "Deprecated. Identifier for a Wales GP Cluster organization that is used to identify the organization across multiple disparate systems. This slice will be removed at a future version of this profile. It applies to a small number of organization resources that are more accurately named primary care clusters.  It can be stored as a generic identifier using the applicable naming system.",
        "requirements": "This identifier is shown as Must Support, only because it is an inherited property of the identifier element in the base definition.  The flag cannot be cleared because it is, through inheritance, applicable to all slices added by the profile.  Given that this identifier slice is deprecated, it should not be considered as Must Support by implementers."
      },
      {
        "id": "Organization.identifier:gpClusterCode.system",
        "path": "Organization.identifier.system",
        "min": 1,
        "fixedUri": "https://fhir.nhs.wales/Id/gpcluster-code"
      },
      {
        "id": "Organization.identifier:gpClusterCode.value",
        "path": "Organization.identifier.value",
        "min": 1
      },
      {
        "id": "Organization.active",
        "path": "Organization.active",
        "comment": "A status of the organization (i.e., whether is still active ) SHOULD be populated if the data exists.\r\n\r\nThis active flag is not intended to be used to mark an organization as temporarily closed or under construction. Instead the Location(s) within the Organization should have the suspended status. If further details of the reason for the suspension are required, then an extension on this element should be used.\n\nThis element is labeled as a modifier because it may be used to mark that the resource was created in error."
      },
      {
        "id": "Organization.type",
        "path": "Organization.type",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "coding.system"
            }
          ],
          "description": "Slices to support a structured organization type, including values from a hierarchical organization type code system, with appropriately filtered value sets.",
          "rules": "open"
        },
        "comment": "A structured organization type comprising sector, domain, classification and subclassification should be provided for known organizations, especially where these form part of the organization hierarchy for domains relevant to the delivery of health and care within Wales.",
        "requirements": "For type-specific retrieval of organization resources in operational use cases and to enhance secondary data analysis.",
        "binding": {
          "strength": "extensible",
          "description": "A set of concepts indicating the organization type, derived from the base CodeSystem, and Genomics specific concepts.  Extended for organizations involved in the delivery of health and care in Wales by a structured organization type hierarchy, represented by dedicated slices and code systems",
          "valueSet": "https://fhir.nhs.wales/ValueSet/DataStandardsWales-OrganizationTypeExtended"
        }
      },
      {
        "id": "Organization.type:sector",
        "path": "Organization.type",
        "sliceName": "sector",
        "short": "Distinguishes public, private and third sector organizations",
        "definition": "The sector of the economy in which the organization operates, based on its funding and control models: public, private or third sector.",
        "comment": "A structured organization type comprising sector, domain, classification and subclassification should be provided for known organizations, especially where these form part of the organization hierarchy for domains relevant to the delivery of health and care within Wales.",
        "requirements": "For type-specific retrieval of organization resources in operational use cases and to enhance secondary data analysis.",
        "mustSupport": true,
        "binding": {
          "strength": "extensible",
          "description": "A set of concepts indicating the organization sector.",
          "valueSet": "https://fhir.nhs.wales/ValueSet/DataStandardsWales-OrganizationSector"
        }
      },
      {
        "id": "Organization.type:sector.coding",
        "path": "Organization.type.coding",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Organization.type:sector.coding.system",
        "path": "Organization.type.coding.system",
        "min": 1,
        "fixedUri": "https://fhir.nhs.wales/CodeSystem/DataStandardsWales-OrganizationSector"
      },
      {
        "id": "Organization.type:sector.coding.code",
        "path": "Organization.type.coding.code",
        "min": 1
      },
      {
        "id": "Organization.type:sector.coding.display",
        "path": "Organization.type.coding.display",
        "min": 1
      },
      {
        "id": "Organization.type:sector.text",
        "path": "Organization.type.text",
        "max": "0"
      },
      {
        "id": "Organization.type:domain",
        "path": "Organization.type",
        "sliceName": "domain",
        "short": "The domain or industry in which the organization operates",
        "definition": "The domain or industry in which the organization operates. In addition to health this includes for example education, social care and justice.",
        "comment": "A structured organization type comprising sector, domain, classification and subclassification should be provided for known organizations, especially where these form part of the organization hierarchy for domains relevant to the delivery of health and care within Wales.",
        "requirements": "For type-specific retrieval of organization resources in operational use cases and to enhance secondary data analysis.",
        "max": "1",
        "mustSupport": true,
        "binding": {
          "strength": "extensible",
          "description": "A set of concepts indicating the organization domain.",
          "valueSet": "https://fhir.nhs.wales/ValueSet/DataStandardsWales-OrganizationDomain"
        }
      },
      {
        "id": "Organization.type:domain.coding",
        "path": "Organization.type.coding",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Organization.type:domain.coding.system",
        "path": "Organization.type.coding.system",
        "min": 1,
        "fixedUri": "https://fhir.nhs.wales/CodeSystem/DataStandardsWales-OrganizationDomain"
      },
      {
        "id": "Organization.type:domain.coding.code",
        "path": "Organization.type.coding.code",
        "min": 1
      },
      {
        "id": "Organization.type:domain.coding.display",
        "path": "Organization.type.coding.display",
        "min": 1
      },
      {
        "id": "Organization.type:domain.text",
        "path": "Organization.type.text",
        "max": "0"
      },
      {
        "id": "Organization.type:classification",
        "path": "Organization.type",
        "sliceName": "classification",
        "short": "A high level classification of the organization type",
        "definition": "A high level classification of the organization type within the applicable domain e.g. Primary care within the Health domain.",
        "comment": "A structured organization type comprising sector, domain, classification and subclassification should be provided for known organizations, especially where these form part of the organization hierarchy for domains relevant to the delivery of health and care within Wales.",
        "requirements": "For type-specific retrieval of organization resources in operational use cases and to enhance secondary data analysis.",
        "max": "1",
        "mustSupport": true,
        "binding": {
          "strength": "extensible",
          "description": "A set of concepts indicating the organization classification.  Within the organization type hierarchy, a set of classification entries is defined for each domain.",
          "valueSet": "https://fhir.nhs.wales/ValueSet/DataStandardsWales-OrganizationClassification"
        }
      },
      {
        "id": "Organization.type:classification.coding",
        "path": "Organization.type.coding",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Organization.type:classification.coding.system",
        "path": "Organization.type.coding.system",
        "min": 1,
        "fixedUri": "https://fhir.nhs.wales/CodeSystem/DataStandardsWales-OrganizationClassification"
      },
      {
        "id": "Organization.type:classification.coding.code",
        "path": "Organization.type.coding.code",
        "min": 1
      },
      {
        "id": "Organization.type:classification.coding.display",
        "path": "Organization.type.coding.display",
        "min": 1
      },
      {
        "id": "Organization.type:classification.text",
        "path": "Organization.type.text",
        "max": "0"
      },
      {
        "id": "Organization.type:subclassification",
        "path": "Organization.type",
        "sliceName": "subclassification",
        "short": "A lower level classification of the organization type",
        "definition": "A lower level classification of the organization type within the applicable domain and classification e.g. Dental practice as a specific type of Primary care organization.",
        "comment": "A structured organization type comprising sector, domain, classification and subclassification should be provided for known organizations, especially where these form part of the organization hierarchy for domains relevant to the delivery of health and care within Wales.",
        "requirements": "For type-specific retrieval of organization resources in operational use cases and to enhance secondary data analysis.",
        "max": "1",
        "mustSupport": true,
        "binding": {
          "strength": "extensible",
          "description": "A set of concepts indicating the organization subclassification.  Within the organization type hierarchy, a set of subclassification entries is defined for each classification within each domain.",
          "valueSet": "https://fhir.nhs.wales/ValueSet/DataStandardsWales-OrganizationSubclassification"
        }
      },
      {
        "id": "Organization.type:subclassification.coding",
        "path": "Organization.type.coding",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Organization.type:subclassification.coding.system",
        "path": "Organization.type.coding.system",
        "min": 1,
        "fixedUri": "https://fhir.nhs.wales/CodeSystem/DataStandardsWales-OrganizationSubclassification"
      },
      {
        "id": "Organization.type:subclassification.coding.code",
        "path": "Organization.type.coding.code",
        "min": 1
      },
      {
        "id": "Organization.type:subclassification.coding.display",
        "path": "Organization.type.coding.display",
        "min": 1
      },
      {
        "id": "Organization.type:subclassification.text",
        "path": "Organization.type.text",
        "max": "0"
      },
      {
        "id": "Organization.name",
        "path": "Organization.name",
        "definition": "A name associated with the organization (e.g. ODS name).",
        "comment": "Organization name SHALL be populated. If the name of an organization changes, consider putting the old name in the alias column so that it can still be located through searches.",
        "min": 1
      },
      {
        "id": "Organization.alias.extension:aliasType",
        "path": "Organization.alias.extension",
        "sliceName": "aliasType",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://fhir.nhs.wales/StructureDefinition/Extension-DataStandardsWales-AliasType"
            ]
          }
        ],
        "isModifier": false
      },
      {
        "id": "Organization.telecom.value",
        "path": "Organization.telecom.value",
        "min": 1
      },
      {
        "id": "Organization.address.extension:addressKey",
        "path": "Organization.address.extension",
        "sliceName": "addressKey",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-AddressKey"
            ]
          }
        ],
        "isModifier": false
      },
      {
        "id": "Organization.partOf",
        "path": "Organization.partOf",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://fhir.nhs.wales/StructureDefinition/DataStandardsWales-Organization"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Organization.partOf.identifier.system",
        "path": "Organization.partOf.identifier.system",
        "min": 1
      },
      {
        "id": "Organization.partOf.identifier.value",
        "path": "Organization.partOf.identifier.value",
        "min": 1
      },
      {
        "id": "Organization.contact.address.extension:addressKey",
        "path": "Organization.contact.address.extension",
        "sliceName": "addressKey",
        "definition": "An extension carrying the address key and type.  This extension should be used to store the Unique Property Reference Number (UPRN) associated with the address (https://location.data.gov.uk).",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-AddressKey"
            ]
          }
        ],
        "isModifier": false
      },
      {
        "id": "Organization.endpoint",
        "path": "Organization.endpoint",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://fhir.nhs.wales/StructureDefinition/DataStandardsWales-Endpoint"
            ]
          }
        ]
      }
    ]
  }
}