<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="cf075664-89f6-49d6-bc3d-cfc7176b9ac6" />
  <url value="https://fhir.nhs.uk/StructureDefinition/NHSDigital-Practitioner" />
  <name value="NHSDigitalPractitioner" />
  <status value="draft" />
  <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="w5" />
    <uri value="http://hl7.org/fhir/fivews" />
    <name value="FiveWs Pattern Mapping" />
  </mapping>
  <kind value="resource" />
  <abstract value="false" />
  <type value="Practitioner" />
  <baseDefinition value="https://fhir.hl7.org.uk/StructureDefinition/UKCore-Practitioner" />
  <derivation value="constraint" />
  <differential>
    <element id="Practitioner">
      <path value="Practitioner" />
      <constraint>
        <key value="prac-nmc" />
        <severity value="warning" />
        <human value="NMC must be of the format NNANNNNA" />
        <expression value="identifier.where(system='https://fhir.hl7.org.uk/Id/nmc-number').exists().not() or (identifier.where(system='https://fhir.hl7.org.uk/Id/nmc-number').exists()  and identifier.where(system='https://fhir.hl7.org.uk/Id/nmc-number').value.matches('^[0-9]{2}[A-Z]{1}[0-9]{4}[A-Z]{1}$'))" />
        <source value="https://fhir.nhs.uk/StructureDefinition/NHSDigital-Practitioner" />
      </constraint>
      <constraint>
        <key value="prac-gmp" />
        <severity value="warning" />
        <human value="GMP must be of the format GNNNNNNN and not be a spurious code (starts with G6 or G7)" />
        <expression value="identifier.where(system='https://fhir.hl7.org.uk/Id/gmp-number').exists().not() or (identifier.where(system='https://fhir.hl7.org.uk/Id/gmp-number').exists()  and identifier.where(system='https://fhir.hl7.org.uk/Id/gmp-number').value.matches('^[G]{1}[01234589]{1}[0-9]{6}$'))" />
        <source value="https://fhir.nhs.uk/StructureDefinition/NHSDigital-Practitioner" />
      </constraint>
      <constraint>
        <key value="prac-gmc" />
        <severity value="warning" />
        <human value="GMC must be of the format CNNNNNNN" />
        <expression value="identifier.where(system='https://fhir.hl7.org.uk/Id/gmc-number').exists().not() or (identifier.where(system='https://fhir.hl7.org.uk/Id/gmc-number').exists()  and identifier.where(system='https://fhir.hl7.org.uk/Id/gmc-number').value.matches('^[C]{1}[0-9]{7}$'))" />
        <source value="https://fhir.nhs.uk/StructureDefinition/NHSDigital-Practitioner" />
      </constraint>
      <constraint>
        <key value="prac-gphc" />
        <severity value="warning" />
        <human value="GPHC must be of the format NNNNNNN" />
        <expression value="identifier.where(system='https://fhir.hl7.org.uk/Id/gphc-number').exists().not() or (identifier.where(system='https://fhir.hl7.org.uk/Id/gphc-number').exists()  and identifier.where(system='https://fhir.hl7.org.uk/Id/gphc-number').value.matches('^[0-9]{7}$'))" />
        <source value="https://fhir.nhs.uk/StructureDefinition/NHSDigital-Practitioner" />
      </constraint>
      <constraint>
        <key value="prac-gmcreferencenumber" />
        <severity value="error" />
        <human value="GMC Reference Number must be of the format NNNNNNN" />
        <expression value="identifier.where(system='https://fhir.hl7.org.uk/Id/gmc-reference-number').exists().not() or (identifier.where(system='https://fhir.hl7.org.uk/Id/gphc-number').exists()  and identifier.where(system='https://fhir.hl7.org.uk/Id/gmc-reference-number').value.matches('^[0-9]{7}$'))" />
        <source value="https://fhir.nhs.uk/StructureDefinition/NHSDigital-Practitioner" />
      </constraint>
      <constraint>
        <key value="prac-hcpc" />
        <severity value="warning" />
        <human value="HCPC must be of the format AANNNNNN" />
        <expression value="identifier.where(system='https://fhir.hl7.org.uk/Id/hcpc-number').exists().not() or (identifier.where(system='https://fhir.hl7.org.uk/Id/hcpc-number').exists()  and identifier.where(system='https://fhir.hl7.org.uk/Id/hcpc-number').value.matches('^[A-Z]{2}[0-9]{6}$'))" />
        <source value="https://fhir.nhs.uk/StructureDefinition/NHSDigital-Practitioner" />
      </constraint>
      <constraint>
        <key value="prac-din" />
        <severity value="warning" />
        <human value="DIN format must be NNNNNN" />
        <expression value="identifier.where(system='https://fhir.hl7.org.uk/Id/din-number').exists().not() or (identifier.where(system='https://fhir.hl7.org.uk/Id/din-number').exists()  and identifier.where(system='https://fhir.hl7.org.uk/Id/din-number').value.matches('^[0-9]{6}$'))" />
        <source value="https://fhir.nhs.uk/StructureDefinition/NHSDigital-Practitioner" />
      </constraint>
      <constraint>
        <key value="prac-sds-user-numeric" />
        <severity value="error" />
        <human value="sds-user-id must be numeric" />
        <expression value="identifier.where(system='https://fhir.nhs.uk/Id/sds-user-id').exists().not() or (identifier.where(system='https://fhir.nhs.uk/Id/sds-user-id').exists()  and identifier.where(system='https://fhir.nhs.uk/Id/sds-user-id').value.matches('^[0-9]+$'))" />
        <source value="https://fhir.nhs.uk/StructureDefinition/NHSDigital-Practitioner" />
      </constraint>
      <constraint>
        <key value="nacs-code-retired" />
        <severity value="warning" />
        <human value="NACS (/ODS) Practitioner Identifier is retired in NHS FHIR and should not be used. Please use the actual naming system instead (e,g, https://fhir.hl7.org.uk/Id/gmc-number, https://fhir.hl7.org.uk/Id/gmp-number, etc)." />
        <expression value="identifier.where(system='https://fhir.hl7.org.uk/Id/professional-code').exists().not()" />
        <source value="https://fhir.nhs.uk/StructureDefinition/NHSDigital-Practitioner" />
      </constraint>
    </element>
    <element id="Practitioner.identifier">
      <path value="Practitioner.identifier" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="system" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <definition value="**SHOULD** contain a professional code.&#xD;&#xA;&#xD;&#xA;The inclusion of a professional code is strongly recommended. For consultants and doctors a prescribing code should be present. Please see [NHS Data Model and Dictionary](https://datadictionary.nhs.uk/) for details on these code.&#xD;&#xA;&#xD;&#xA;The *SDS User Id* should be sourced from NHS Identity (SmartCard), this is also held within the Spine Directory Service LDAP database. &#xD;&#xA;&#xD;&#xA;&#xD;&#xA;| FHIR identifier | OID/HL7v3 | HL7v2 ITK | Format | Description | Professional Code  | Prescribing Code | &#xD;&#xA;|--&#xD;&#xA;| https://fhir.hl7.org.uk/Id/gmp-number | 2.16.840.1.113883.2.1.3.2.4.16.62 | GMP | G[1234589]NNNNNN | General Medical Practitioner Code [GENERAL MEDICAL PRACTITIONER PPD CODE](https://datadictionary.nhs.uk/attributes/general_medical_practitioner_ppd_code.html). Formerly called GP General National Code (GNC).  | Yes | No, also include DIN |&#xD;&#xA;| https://fhir.hl7.org.uk/Id/gmc-number | 2.16.840.1.113883.2.1.3.2.4.16.63 | GMC | CNNNNNNN |General Medical Council Code [CONSULTANT_CODE](https://datadictionary.nhs.uk/attributes/consultant_code.html) | Yes | Yes |&#xD;&#xA;| https://fhir.hl7.org.uk/Id/nmc-number | | | NNANNNNA |Nursing and Midwifery Council Code | Yes | Yes |&#xD;&#xA;| https://fhir.hl7.org.uk/Id/gphc-number | | | NNNNNNN |General Pharmaceutical Council Code |Yes | Yes  |&#xD;&#xA;| https://fhir.hl7.org.uk/Id/hcpc-number | | | AANNNNNN(*) |Health and Care Professional Council Code |Yes | Yes  |&#xD;&#xA;| https://fhir.hl7.org.uk/Id/din-number | | | NNNNNN | [DOCTOR INDEX NUMBER](https://datadictionary.nhs.uk/attributes/doctor_index_number.html)  | No | Yes |&#xD;&#xA;| https://fhir.nhs.uk/Id/sds-user-id | 1.2.826.0.1285.0.2.0.65 | | N(*)  | SDS User ID | No | No | &#xD;&#xA;| https://fhir.nhs.uk/Id/gmc-reference-number | 2.16.840.1.113883.2.1.3.2.4.18.29 | | NNNNNNN | [GMC Reference Number](https://www.datadictionary.nhs.uk/attributes/general_medical_council_reference_number.html)  | No | No | &#xD;&#xA;| https://fhir.hl7.org.uk/Id/professional-code | 1.2.826.0.1285.0.2.1.54 | | A(*) | ODS/NACS Practitioner Code (retired). Included for backwards compatibility | No | No | &#xD;&#xA;&#xD;&#xA;Format&#xD;&#xA;&#xD;&#xA;- N = any number&#xD;&#xA;- A = any alpha&#xD;&#xA;&#xD;&#xA;(*) NHS Prescription Services systems require these prescriber codes to be 8 characters&#xD;&#xA;long. Additional zeroes (0) should be inserted immediately following the first 2 alpha&#xD;&#xA;characters to extend the code to 8 characters as necessary.&#xD;&#xA;&#xD;&#xA;| Code | Format | Example |&#xD;&#xA;|--&#xD;&#xA;| GP/medical prescriber (DIN) | NNNNNN | 954000 |&#xD;&#xA;| Nurse prescriber (NMC) | NNANNNNA | 71A2998E | &#xD;&#xA;| Pharmacist prescriber (GPHC) | NNNNNNN | 2033467 |&#xD;&#xA;| Optometrist prescriber | NN-NNNNN | 01-09491 |&#xD;&#xA;| Podiatrist prescriber (HCPC) | CHNNNNNN | CH029821 | &#xD;&#xA;| Physiotherapist prescriber (HCPC) | PHNNNNNN |PH095159&#xD;&#xA;| Radiographer prescriber (HCPC) | RANNNNNN | RA088262 | &#xD;&#xA;| Dietician prescriber (HCPC) | DTNNNNNN | DT012345 | &#xD;&#xA;| Paramedic prescriber (HCPC) | PANNNNNN | PA054321 |&#xD;&#xA;&#xD;&#xA;The *Doctor Index Number (DIN)* will be present in the resource even if they are prescribing using a different prescribing code. This code is called the *spurious code* is held within the `NHSDigital-PractitionerRole` resource and **MUST NOT** be contained in the Practitioner resource. &#xD;&#xA;&#xD;&#xA;In the example below, the practitioner (GP as they have a GMP Code) has a SDS User Id of 3415870201, GMP code of G1234567 and DIN code of 123456. If the GP was in a role, prescribing using a spurious code this would be found in the `PractitionerRole`.&#xD;&#xA;&#xD;&#xA;```json&#xD;&#xA;{&#xD;&#xA;  &quot;resourceType&quot;: &quot;Practitioner&quot;,&#xD;&#xA;  ...&#xD;&#xA;  &quot;identifier&quot;: [&#xD;&#xA;          {&#xD;&#xA;            &quot;system&quot;: &quot;https://fhir.nhs.uk/Id/sds-user-id&quot;,&#xD;&#xA;            &quot;value&quot;: &quot;3415870201&quot;&#xD;&#xA;          },&#xD;&#xA;          {&#xD;&#xA;            &quot;system&quot;: &quot;https://fhir.hl7.org.uk/Id/gmp-number&quot;,&#xD;&#xA;            &quot;value&quot;: &quot;G1234567&quot;&#xD;&#xA;          },&#xD;&#xA;          {&#xD;&#xA;            &quot;system&quot;: &quot;https://fhir.hl7.org.uk/Id/din-number&quot;,&#xD;&#xA;            &quot;value&quot;: &quot;123456&quot;&#xD;&#xA;          }&#xD;&#xA;        ]&#xD;&#xA;  ...&#xD;&#xA;}&#xD;&#xA;```&#xD;&#xA;&#xD;&#xA;In the example below, the practitioner (Consultant as they have a GMC Code) has a SDS User Id of 1415870201, GMC code of C2134567.&#xD;&#xA;&#xD;&#xA;```json&#xD;&#xA;{&#xD;&#xA;  &quot;resourceType&quot;: &quot;Practitioner&quot;,&#xD;&#xA;  ...&#xD;&#xA;  &quot;identifier&quot;: [&#xD;&#xA;          {&#xD;&#xA;            &quot;system&quot;: &quot;https://fhir.nhs.uk/Id/sds-user-id&quot;,&#xD;&#xA;            &quot;value&quot;: &quot;1415870201&quot;&#xD;&#xA;          },&#xD;&#xA;          {&#xD;&#xA;            &quot;system&quot;: &quot;https://fhir.hl7.org.uk/Id/gmc-number&quot;,&#xD;&#xA;            &quot;value&quot;: &quot;C2134567&quot;&#xD;&#xA;          }&#xD;&#xA;        ]&#xD;&#xA;  ...&#xD;&#xA;}&#xD;&#xA;```&#xD;&#xA;&#xD;&#xA;### Professional Code System (Unspecified/Unknown System)&#xD;&#xA;&#xD;&#xA;In cases where the profession code is present but it is not certain what type of code this is, the `https://fhir.hl7.org.uk/Id/professional-code` system should be used. It is also used for backwards compatibilty with EPS HL7 v3 ODS/NACS Practitioner Identifiers. &#xD;&#xA;This system may include codes from different codes and this may lead to identfication issues, for example GPhC and GMC Reference Number have the same format (7 digits), if one of these is receieved it is not known if this is a doctor and or a pharmacist.&#xD;&#xA;&#xD;&#xA;E.g. in the example below, 2134567 is probably a GMC Reference Number but we are not certain.&#xD;&#xA;&#xD;&#xA;```json&#xD;&#xA;{&#xD;&#xA;  &quot;resourceType&quot;: &quot;Practitioner&quot;,&#xD;&#xA;  ...&#xD;&#xA;  &quot;identifier&quot;: [&#xD;&#xA;          {&#xD;&#xA;            &quot;system&quot;: &quot;https://fhir.nhs.uk/Id/sds-user-id&quot;,&#xD;&#xA;            &quot;value&quot;: &quot;1415870201&quot;&#xD;&#xA;          },&#xD;&#xA;          {&#xD;&#xA;            &quot;system&quot;: &quot;https://fhir.hl7.org.uk/Id/professional-code&quot;,&#xD;&#xA;            &quot;value&quot;: &quot;2134567&quot;&#xD;&#xA;          }&#xD;&#xA;        ]&#xD;&#xA;  ...&#xD;&#xA;}&#xD;&#xA;```" />
      <comment value="SHOULD contain a professional code or SDS-user-id." />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Practitioner.identifier:gmcCode">
      <path value="Practitioner.identifier" />
      <sliceName value="gmcCode" />
      <short value="General Medical Council Consultant Code" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Practitioner.identifier:gmcCode.system">
      <path value="Practitioner.identifier.system" />
      <fixedUri value="https://fhir.hl7.org.uk/Id/gmc-number" />
    </element>
    <element id="Practitioner.identifier:gmpCode">
      <path value="Practitioner.identifier" />
      <sliceName value="gmpCode" />
      <short value="General Medical Practitioner Code" />
      <definition value="Formerly called GP General National Code (GNC)." />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Practitioner.identifier:gmpCode.system">
      <path value="Practitioner.identifier.system" />
      <fixedUri value="https://fhir.hl7.org.uk/Id/gmp-number" />
    </element>
    <element id="Practitioner.identifier:dinCode">
      <path value="Practitioner.identifier" />
      <sliceName value="dinCode" />
      <short value="Doctor Index Number" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Practitioner.identifier:dinCode.system">
      <path value="Practitioner.identifier.system" />
      <fixedUri value="https://fhir.hl7.org.uk/Id/din-number" />
    </element>
    <element id="Practitioner.identifier:gphcCode">
      <path value="Practitioner.identifier" />
      <sliceName value="gphcCode" />
      <short value="General Pharmaceutical Council Code" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Practitioner.identifier:gphcCode.system">
      <path value="Practitioner.identifier.system" />
      <fixedUri value="https://fhir.hl7.org.uk/Id/gphc-number" />
    </element>
    <element id="Practitioner.identifier:hcpcNumber">
      <path value="Practitioner.identifier" />
      <sliceName value="hcpcNumber" />
      <short value="Health and Care Professional Council Code" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Practitioner.identifier:hcpcNumber.system">
      <path value="Practitioner.identifier.system" />
      <fixedUri value="https://fhir.hl7.org.uk/Id/hcpc-number" />
    </element>
    <element id="Practitioner.identifier:nmcNumber">
      <path value="Practitioner.identifier" />
      <sliceName value="nmcNumber" />
      <short value="Nursing and Midwifery Council Code" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Practitioner.identifier:nmcNumber.system">
      <path value="Practitioner.identifier.system" />
      <fixedUri value="https://fhir.hl7.org.uk/Id/nmc-number" />
    </element>
    <element id="Practitioner.identifier:professionalNumber">
      <path value="Practitioner.identifier" />
      <sliceName value="professionalNumber" />
      <short value="ODS/NACS Practitioner Code (retired)" />
      <definition value="A legacy system to support conversion of NPfIT/v3 CodeSysem to FHIR.&#xD;&#xA;This should not be used on new implementations. More accurate systems such as https://fhir.hl7.org.uk/Id/gmp-number and https://fhir.hl7.org.uk/Id/gmc-number&#xD;&#xA;&#xD;&#xA;Although this system was intended to only be ODS/NACS Practitioner Identifiers, it has been used as a general purpose system. Therefore the codes can't be trusted e.g. 1234567 could be referring to a GPhC (pharmacist) or GMC Reference Number (doctor). These codes on their won should not be considered safe for the purposes of Practitioner identification." />
      <mustSupport value="false" />
    </element>
    <element id="Practitioner.identifier:professionalNumber.system">
      <path value="Practitioner.identifier.system" />
      <fixedUri value="https://fhir.hl7.org.uk/Id/professional-code" />
    </element>
    <element id="Practitioner.identifier:gmcReferenceNumber">
      <path value="Practitioner.identifier" />
      <sliceName value="gmcReferenceNumber" />
      <short value="GMC Reference Number" />
      <definition value="This should not be confused with https://fhir.hl7.org.uk/Id/gmc-number which is the Consultants CONSULTANT_CODE. &#xD;&#xA;&#xD;&#xA;This is considered a supplemental code and the official English NHS identifiers (https://fhir.hl7.org.uk/Id/gmc-number or https://fhir.hl7.org.uk/Id/gmp-number) should also be provided." />
      <max value="1" />
      <mustSupport value="false" />
    </element>
    <element id="Practitioner.identifier:gmcReferenceNumber.system">
      <path value="Practitioner.identifier.system" />
      <fixedUri value="https://fhir.hl7.org.uk/Id/gmc-reference-number" />
    </element>
    <element id="Practitioner.identifier:sdsUserId">
      <path value="Practitioner.identifier" />
      <sliceName value="sdsUserId" />
      <short value="SDS User Id" />
      <definition value="Used with CIS2 and Spine" />
      <max value="1" />
    </element>
    <element id="Practitioner.identifier:sdsUserId.system">
      <path value="Practitioner.identifier.system" />
      <fixedUri value="https://fhir.nhs.uk/Id/sds-user-id" />
    </element>
    <element id="Practitioner.name">
      <path value="Practitioner.name" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Practitioner.telecom">
      <path value="Practitioner.telecom" />
      <mustSupport value="true" />
    </element>
    <element id="Practitioner.telecom.value">
      <path value="Practitioner.telecom.value" />
      <min value="1" />
    </element>
    <element id="Practitioner.telecom.use">
      <path value="Practitioner.telecom.use" />
      <min value="1" />
    </element>
  </differential>
</StructureDefinition>