<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="DataStandardsWales-PSOM-ReferralIdentifier" />
  <url value="https://fhir.nhs.wales/StructureDefinition/DataStandardsWales-PSOM-ReferralIdentifier" />
  <name value="DataStandardsWalesPSOMReferralIdentifier" />
  <title value="Data Standards Wales PSOM ReferralIdentifier" />
  <status value="active" />
  <publisher value="NHS Wales" />
  <contact>
    <name value="Data Standards" />
    <telecom>
      <system value="email" />
      <value value="data.standards@wales.nhs.uk" />
      <use value="work" />
    </telecom>
  </contact>
  <description value="A locally-produced identifier which uniquely identifies the referral record. All PROMs questionnaires associated with the same referral must have the same Referral Identifier." />
  <copyright value="© 2023 NHS Wales." />
  <fhirVersion value="4.0.1" />
  <mapping>
    <identity value="PROMs-Metadata-2024004" />
    <name value="NHS Wales DSCN Metadata Mapping" />
  </mapping>
  <kind value="complex-type" />
  <abstract value="false" />
  <type value="Identifier" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Identifier" />
  <derivation value="constraint" />
  <differential>
    <element id="Identifier.system">
      <path value="Identifier.system" />
      <short value="Referral Identifier Origination" />
      <definition value="The issuing system's OID for the Referral Identifier." />
      <constraint>
        <key value="PSOM-ReferralIdentifier-01" />
        <severity value="error" />
        <human value="The issuing system should be an ApplicationInstanceOID that starts with the '2.16.840.1.113883.2.1.8.1.5.' sequence." />
        <expression value="startsWith('urn:oid:2.16.840.1.113883.2.1.8.1.5.')" />
      </constraint>
      <mapping>
        <identity value="PROMs-Metadata-2024004" />
        <map value="MPRPX004A" />
        <comment value="Referral Identifier Origination" />
      </mapping>
    </element>
    <element id="Identifier.value">
      <path value="Identifier.value" />
      <short value="Referral Identifier" />
      <definition value="A locally-produced identifier which uniquely identifies the referral record. All PROMs questionnaires associated with the same referral must have the same Referral Identifier." />
      <min value="1" />
      <mapping>
        <identity value="PROMs-Metadata-2024004" />
        <map value="MPRPX004X" />
        <comment value="Referral Identifier" />
      </mapping>
    </element>
  </differential>
</StructureDefinition>