{
  "resourceType": "StructureDefinition",
  "id": "DataStandardsWales-OrganizationAffiliation",
  "url": "https://fhir.nhs.wales/StructureDefinition/DataStandardsWales-OrganizationAffiliation",
  "version": "0.1.0",
  "name": "DataStandardsWalesOrganizationAffiliation",
  "title": "Data Standards Wales Organization Affiliation",
  "status": "draft",
  "date": "2026-08-26",
  "publisher": "NHS Wales",
  "contact": [
    {
      "name": "FHIR Standards",
      "telecom": [
        {
          "system": "email",
          "value": "fhir.standards@wales.nhs.uk",
          "use": "work",
          "rank": 1
        }
      ]
    }
  ],
  "copyright": "2026 NHS Wales",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "OrganizationAffiliation",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/OrganizationAffiliation",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "OrganizationAffiliation.identifier",
        "path": "OrganizationAffiliation.identifier",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "system"
            }
          ],
          "rules": "open"
        },
        "comment": "Identifiers for the organisation affiliation SHOULD be populated if the data exists"
      },
      {
        "id": "OrganizationAffiliation.identifier:wrtsAffiliationIdentifier",
        "path": "OrganizationAffiliation.identifier",
        "sliceName": "wrtsAffiliationIdentifier",
        "short": "WRTS Affiliation Identifier",
        "definition": "An identifier concatenating the WRTS organization identifiers of the grouping organization (e.g. region or cluster) and the participating member organization, with a hyphen (-) separator",
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "OrganizationAffiliation.identifier:wrtsAffiliationIdentifier.system",
        "path": "OrganizationAffiliation.identifier.system",
        "min": 1,
        "fixedUri": "https://fhir.nhs.wales/Id/wrts-affiliation-identifier"
      },
      {
        "id": "OrganizationAffiliation.organization",
        "path": "OrganizationAffiliation.organization",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://fhir.nhs.wales/StructureDefinition/DataStandardsWales-Organization"
            ]
          }
        ]
      },
      {
        "id": "OrganizationAffiliation.participatingOrganization",
        "path": "OrganizationAffiliation.participatingOrganization",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://fhir.nhs.wales/StructureDefinition/DataStandardsWales-Organization"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "OrganizationAffiliation.network",
        "path": "OrganizationAffiliation.network",
        "max": "0"
      },
      {
        "id": "OrganizationAffiliation.code",
        "path": "OrganizationAffiliation.code",
        "mustSupport": true
      },
      {
        "id": "OrganizationAffiliation.location",
        "path": "OrganizationAffiliation.location",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://fhir.nhs.wales/StructureDefinition/DataStandardsWales-Location"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "OrganizationAffiliation.healthcareService",
        "path": "OrganizationAffiliation.healthcareService",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://fhir.nhs.wales/StructureDefinition/DataStandardsWales-HealthcareService"
            ]
          }
        ]
      }
    ]
  }
}