<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="DataStandardsWales-RelatedPerson" />
  <url value="https://fhir.nhs.wales/StructureDefinition/DataStandardsWales-RelatedPerson" />
  <version value="1.0.0" />
  <name value="DataStandardsWalesRelatedPerson" />
  <title value="Data Standards Wales Related Person" />
  <status value="active" />
  <date value="2025-01-01" />
  <publisher value="NHS Wales" />
  <copyright value="2024 NHS Wales." />
  <fhirVersion value="4.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="RelatedPerson" />
  <baseDefinition value="https://fhir.hl7.org.uk/StructureDefinition/UKCore-RelatedPerson" />
  <derivation value="constraint" />
  <differential>
    <element id="RelatedPerson.identifier.assigner">
      <path value="RelatedPerson.identifier.assigner" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.nhs.wales/StructureDefinition/DataStandardsWales-Organization" />
      </type>
    </element>
    <element id="RelatedPerson.patient">
      <path value="RelatedPerson.patient" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.nhs.wales/StructureDefinition/DataStandardsWales-Patient" />
      </type>
    </element>
    <element id="RelatedPerson.name.prefix">
      <path value="RelatedPerson.name.prefix" />
      <binding>
        <strength value="extensible" />
        <description value="Data Standards Wales Title" />
        <valueSet value="https://fhir.nhs.wales/ValueSet/DataStandardsWales-Title" />
      </binding>
    </element>
    <element id="RelatedPerson.address.postalCode">
      <path value="RelatedPerson.address.postalCode" />
      <definition value="A postal code designating a region defined by the postal service.&#xD;&#xA;&#xD;&#xA;Format: 8 character alphanumeric&#xD;&#xA;The specific code format as specified by the Office of National statistics (ONS)&#xD;&#xA;&#xD;&#xA;Data description&#xD;&#xA;Unit postcode – 8 character version&#xD;&#xA;&#xD;&#xA;Range of codes/ Entity code&#xD;&#xA;AB1 Δ Δ 1AA - ZE99 Δ 9ZZ (maximum range)&#xD;&#xA;&#xD;&#xA;Comments&#xD;&#xA;2, 3 or 4-character outward code - left aligned;&#xD;&#xA;3-character inward code - right aligned;&#xD;&#xA;5th character always blank and&#xD;&#xA;3rd and 4th characters may be blank (Δ)" />
      <requirements value="This guidance is based upon the published Data Standards Wales (DSW) recommendation for representing the postal code in systems.  While this is the preferred representation it is understood that some systems may not currently comply to the standard.  As such, this should be taken as guidance only. No software constraints have been placed on the data element to reject certain patterns therefore any string value sent is acceptable. However, it is best practice to follow the standard set out below for any new implementation or if a current system is being updated to conform to DSW standards.&#xD;&#xA;&#xD;&#xA;Please reference https://www.datadictionary.wales.nhs.uk/#!WordDocuments/informationspecification65.htm for full details on this data standard." />
    </element>
  </differential>
</StructureDefinition>