<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="DataStandardsWales-Organization" />
  <url value="https://fhir.nhs.wales/StructureDefinition/DataStandardsWales-Organization" />
  <version value="1.2.0" />
  <name value="DataStandardsWalesOrganization" />
  <title value="Data Standards Wales Organization" />
  <status value="active" />
  <experimental value="false" />
  <date value="2026-05-29" />
  <publisher value="NHS Wales" />
  <copyright value="2026 NHS Wales." />
  <fhirVersion value="4.0.1" />
  <mapping>
    <identity value="v2" />
    <uri value="http://hl7.org/v2" />
    <name value="HL7 v2 Mapping" />
  </mapping>
  <mapping>
    <identity value="rim" />
    <uri value="http://hl7.org/v3" />
    <name value="RIM Mapping" />
  </mapping>
  <mapping>
    <identity value="servd" />
    <uri value="http://www.omg.org/spec/ServD/1.0/" />
    <name value="ServD" />
  </mapping>
  <mapping>
    <identity value="w5" />
    <uri value="http://hl7.org/fhir/fivews" />
    <name value="FiveWs Pattern Mapping" />
  </mapping>
  <kind value="resource" />
  <abstract value="false" />
  <type value="Organization" />
  <baseDefinition value="https://fhir.hl7.org.uk/StructureDefinition/UKCore-Organization" />
  <derivation value="constraint" />
  <differential>
    <element id="Organization.identifier">
      <path value="Organization.identifier" />
      <comment value="Identifiers for the organization SHOULD be populated if the data exists" />
    </element>
    <element id="Organization.identifier:odsOrganisationCode">
      <path value="Organization.identifier" />
      <sliceName value="odsOrganisationCode" />
      <mustSupport value="true" />
    </element>
    <element id="Organization.identifier:odsSiteCode">
      <path value="Organization.identifier" />
      <sliceName value="odsSiteCode" />
      <max value="0" />
    </element>
    <element id="Organization.identifier:gpClusterCode">
      <path value="Organization.identifier" />
      <sliceName value="gpClusterCode" />
      <short value="Deprecated. Identifies a Wales GP Cluster organization across multiple systems" />
      <definition value="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 value="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." />
    </element>
    <element id="Organization.identifier:gpClusterCode.system">
      <path value="Organization.identifier.system" />
      <min value="1" />
      <fixedUri value="https://fhir.nhs.wales/Id/gpcluster-code" />
    </element>
    <element id="Organization.identifier:gpClusterCode.value">
      <path value="Organization.identifier.value" />
      <min value="1" />
    </element>
    <element id="Organization.active">
      <path value="Organization.active" />
      <comment value="A status of the organization (i.e., whether is still active ) SHOULD be populated if the data exists.&#xD;&#xA;&#xD;&#xA;This 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.&#xA;&#xA;This element is labeled as a modifier because it may be used to mark that the resource was created in error." />
    </element>
    <element id="Organization.type">
      <path value="Organization.type" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="coding.system" />
        </discriminator>
        <description value="Slices to support a structured organization type, including values from a hierarchical organization type code system, with appropriately filtered value sets." />
        <rules value="open" />
      </slicing>
      <comment value="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 value="For type-specific retrieval of organization resources in operational use cases and to enhance secondary data analysis." />
      <binding>
        <strength value="extensible" />
        <description value="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 value="https://fhir.nhs.wales/ValueSet/DataStandardsWales-OrganizationTypeExtended" />
      </binding>
    </element>
    <element id="Organization.type:sector">
      <path value="Organization.type" />
      <sliceName value="sector" />
      <short value="Distinguishes public, private and third sector organizations" />
      <definition value="The sector of the economy in which the organization operates, based on its funding and control models: public, private or third sector." />
      <comment value="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 value="For type-specific retrieval of organization resources in operational use cases and to enhance secondary data analysis." />
      <mustSupport value="true" />
      <binding>
        <strength value="extensible" />
        <description value="A set of concepts indicating the organization sector." />
        <valueSet value="https://fhir.nhs.wales/ValueSet/DataStandardsWales-OrganizationSector" />
      </binding>
    </element>
    <element id="Organization.type:sector.coding">
      <path value="Organization.type.coding" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Organization.type:sector.coding.system">
      <path value="Organization.type.coding.system" />
      <min value="1" />
      <fixedUri value="https://fhir.nhs.wales/CodeSystem/DataStandardsWales-OrganizationSector" />
    </element>
    <element id="Organization.type:sector.coding.code">
      <path value="Organization.type.coding.code" />
      <min value="1" />
    </element>
    <element id="Organization.type:sector.coding.display">
      <path value="Organization.type.coding.display" />
      <min value="1" />
    </element>
    <element id="Organization.type:sector.text">
      <path value="Organization.type.text" />
      <max value="0" />
    </element>
    <element id="Organization.type:domain">
      <path value="Organization.type" />
      <sliceName value="domain" />
      <short value="The domain or industry in which the organization operates" />
      <definition value="The domain or industry in which the organization operates. In addition to health this includes for example education, social care and justice." />
      <comment value="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 value="For type-specific retrieval of organization resources in operational use cases and to enhance secondary data analysis." />
      <max value="1" />
      <mustSupport value="true" />
      <binding>
        <strength value="extensible" />
        <description value="A set of concepts indicating the organization domain." />
        <valueSet value="https://fhir.nhs.wales/ValueSet/DataStandardsWales-OrganizationDomain" />
      </binding>
    </element>
    <element id="Organization.type:domain.coding">
      <path value="Organization.type.coding" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Organization.type:domain.coding.system">
      <path value="Organization.type.coding.system" />
      <min value="1" />
      <fixedUri value="https://fhir.nhs.wales/CodeSystem/DataStandardsWales-OrganizationDomain" />
    </element>
    <element id="Organization.type:domain.coding.code">
      <path value="Organization.type.coding.code" />
      <min value="1" />
    </element>
    <element id="Organization.type:domain.coding.display">
      <path value="Organization.type.coding.display" />
      <min value="1" />
    </element>
    <element id="Organization.type:domain.text">
      <path value="Organization.type.text" />
      <max value="0" />
    </element>
    <element id="Organization.type:classification">
      <path value="Organization.type" />
      <sliceName value="classification" />
      <short value="A high level classification of the organization type" />
      <definition value="A high level classification of the organization type within the applicable domain e.g. Primary care within the Health domain." />
      <comment value="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 value="For type-specific retrieval of organization resources in operational use cases and to enhance secondary data analysis." />
      <max value="1" />
      <mustSupport value="true" />
      <binding>
        <strength value="extensible" />
        <description value="A set of concepts indicating the organization classification.  Within the organization type hierarchy, a set of classification entries is defined for each domain." />
        <valueSet value="https://fhir.nhs.wales/ValueSet/DataStandardsWales-OrganizationClassification" />
      </binding>
    </element>
    <element id="Organization.type:classification.coding">
      <path value="Organization.type.coding" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Organization.type:classification.coding.system">
      <path value="Organization.type.coding.system" />
      <min value="1" />
      <fixedUri value="https://fhir.nhs.wales/CodeSystem/DataStandardsWales-OrganizationClassification" />
    </element>
    <element id="Organization.type:classification.coding.code">
      <path value="Organization.type.coding.code" />
      <min value="1" />
    </element>
    <element id="Organization.type:classification.coding.display">
      <path value="Organization.type.coding.display" />
      <min value="1" />
    </element>
    <element id="Organization.type:classification.text">
      <path value="Organization.type.text" />
      <max value="0" />
    </element>
    <element id="Organization.type:subclassification">
      <path value="Organization.type" />
      <sliceName value="subclassification" />
      <short value="A lower level classification of the organization type" />
      <definition value="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 value="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 value="For type-specific retrieval of organization resources in operational use cases and to enhance secondary data analysis." />
      <max value="1" />
      <mustSupport value="true" />
      <binding>
        <strength value="extensible" />
        <description value="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 value="https://fhir.nhs.wales/ValueSet/DataStandardsWales-OrganizationSubclassification" />
      </binding>
    </element>
    <element id="Organization.type:subclassification.coding">
      <path value="Organization.type.coding" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Organization.type:subclassification.coding.system">
      <path value="Organization.type.coding.system" />
      <min value="1" />
      <fixedUri value="https://fhir.nhs.wales/CodeSystem/DataStandardsWales-OrganizationSubclassification" />
    </element>
    <element id="Organization.type:subclassification.coding.code">
      <path value="Organization.type.coding.code" />
      <min value="1" />
    </element>
    <element id="Organization.type:subclassification.coding.display">
      <path value="Organization.type.coding.display" />
      <min value="1" />
    </element>
    <element id="Organization.type:subclassification.text">
      <path value="Organization.type.text" />
      <max value="0" />
    </element>
    <element id="Organization.name">
      <path value="Organization.name" />
      <definition value="A name associated with the organization (e.g. ODS name)." />
      <comment value="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 value="1" />
    </element>
    <element id="Organization.alias.extension:aliasType">
      <path value="Organization.alias.extension" />
      <sliceName value="aliasType" />
      <type>
        <code value="Extension" />
        <profile value="https://fhir.nhs.wales/StructureDefinition/Extension-DataStandardsWales-AliasType" />
      </type>
      <isModifier value="false" />
    </element>
    <element id="Organization.telecom.value">
      <path value="Organization.telecom.value" />
      <min value="1" />
    </element>
    <element id="Organization.address.extension:addressKey">
      <path value="Organization.address.extension" />
      <sliceName value="addressKey" />
      <type>
        <code value="Extension" />
        <profile value="https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-AddressKey" />
      </type>
      <isModifier value="false" />
    </element>
    <element id="Organization.partOf">
      <path value="Organization.partOf" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.nhs.wales/StructureDefinition/DataStandardsWales-Organization" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Organization.partOf.identifier.system">
      <path value="Organization.partOf.identifier.system" />
      <min value="1" />
    </element>
    <element id="Organization.partOf.identifier.value">
      <path value="Organization.partOf.identifier.value" />
      <min value="1" />
    </element>
    <element id="Organization.contact.address.extension:addressKey">
      <path value="Organization.contact.address.extension" />
      <sliceName value="addressKey" />
      <definition value="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 value="Extension" />
        <profile value="https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-AddressKey" />
      </type>
      <isModifier value="false" />
    </element>
    <element id="Organization.endpoint">
      <path value="Organization.endpoint" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.nhs.wales/StructureDefinition/DataStandardsWales-Endpoint" />
      </type>
    </element>
  </differential>
</StructureDefinition>