<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="CDR-Patient-Silver" />
  <url value="https://fhir.nhs.wales/StructureDefinition/CDR-Patient-Silver" />
  <name value="CDRPatientSilver" />
  <status value="draft" />
  <description value="Defines the CDR Silver Patient profile, derived from the Data Standards Wales Patient profile, for representing a patient record that does not have an NHS number. This profile is used when a submitting system needs to create a patient record within the CDR in order to submit associated patient record items, and where a corresponding Gold Patient record is not available from the Welsh Demographic Service." />
  <purpose value="The purpose of this profile is to constrain the Data Standards Wales Patient profile for use in the CDR patient submit message. It supports the controlled creation of Silver Patient records in the CDR where the patient cannot be identified by NHS number at the point of submission. Silver Patient records must only be used where a Gold Patient record does not already exist and must not be used as a substitute for records created and maintained from the Welsh Demographic Service." />
  <fhirVersion value="4.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="Patient" />
  <baseDefinition value="https://fhir.nhs.wales/StructureDefinition/DataStandardsWales-Patient" />
  <derivation value="constraint" />
  <differential>
    <element id="Patient">
      <path value="Patient" />
      <constraint>
        <key value="cdr-patient-1" />
        <requirements value="The Patient SHALL contain exactly one local PAS patient identifier. This identifier provides the business identifier used by the CDR to uniquely identify and link Silver Patient records that do not have an NHS Number. The identifier SHALL be supplied using one of the approved PAS identifier slices defined by this profile." />
        <severity value="error" />
        <human value="Exactly one local PAS patient identifier SHALL be provided." />
        <expression value="identifier.where( system in ('https://fhir.abuhb.nhs.wales/Id/pas-identifier' | 'https://fhir.bcuhb.nhs.wales/Id/pas-identifier' | 'https://fhir.cavuhb.nhs.wales/Id/pas-identifier' | 'https://fhir.ctmuhb.nhs.wales/Id/pas-identifier' | 'https://fhir.hduhb.nhs.wales/Id/pas-identifier' | 'https://fhir.pthb.nhs.wales/Id/pas-identifier' | 'https://fhir.sbuhb.nhs.wales/Id/pas-identifier' | 'https://fhir.vunhst.nhs.wales/Id/pas-identifier'  ) ).count() = 1" />
      </constraint>
    </element>
    <element id="Patient.identifier">
      <path value="Patient.identifier" />
      <slicing>
        <rules value="open" />
      </slicing>
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Patient.identifier:nhsNumber">
      <path value="Patient.identifier" />
      <sliceName value="nhsNumber" />
      <max value="0" />
    </element>
    <element id="Patient.identifier:vunhstCaniscIdentifier">
      <path value="Patient.identifier" />
      <sliceName value="vunhstCaniscIdentifier" />
      <max value="0" />
    </element>
    <element id="Patient.generalPractitioner">
      <path value="Patient.generalPractitioner" />
      <max value="0" />
    </element>
    <element id="Patient.managingOrganization">
      <path value="Patient.managingOrganization" />
      <max value="0" />
    </element>
  </differential>
</StructureDefinition>