<StructureDefinition xmlns="http://hl7.org/fhir">
  <url value="https://vvis.gov.lv/fhir/StructureDefinition/Identifier/UnverifiedPersonIdentifier" />
  <version value="1" />
  <name value="UnverifiedPersonIdentifier" />
  <status value="active" />
  <fhirVersion value="4.3.0" />
  <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">
      <path value="Identifier" />
      <short value="Verified personal identifier" />
      <definition value="An identifier of the patient whose identity is not proved by person identity document. This identifier is used when a patient is unconscious, when a person for any reason cannot prove his or her identity, when a baby is found in the baby-box. Identifier is being assigned by a medical institution providing health care services to the patient." />
      <mustSupport value="true" />
    </element>
    <element id="Identifier.use">
      <path value="Identifier.use" />
      <max value="0" />
    </element>
    <element id="Identifier.type">
      <path value="Identifier.type" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Identifier.type.coding">
      <path value="Identifier.type.coding" />
      <min value="1" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Identifier.type.coding.system">
      <path value="Identifier.type.coding.system" />
      <max value="0" />
    </element>
    <element id="Identifier.type.coding.version">
      <path value="Identifier.type.coding.version" />
      <max value="0" />
    </element>
    <element id="Identifier.type.coding.code">
      <path value="Identifier.type.coding.code" />
      <min value="1" />
      <fixedCode value="1.3.6.1.4.1.38760.3.1.7" />
      <mustSupport value="true" />
    </element>
    <element id="Identifier.type.coding.display">
      <path value="Identifier.type.coding.display" />
      <min value="1" />
      <fixedString value="Nedroša LV iedzīvotāja identifikācija" />
      <mustSupport value="true" />
    </element>
    <element id="Identifier.type.coding.userSelected">
      <path value="Identifier.type.coding.userSelected" />
      <max value="0" />
    </element>
    <element id="Identifier.type.text">
      <path value="Identifier.type.text" />
      <max value="0" />
    </element>
    <element id="Identifier.system">
      <path value="Identifier.system" />
      <min value="1" />
      <mustSupport value="true" />
      <binding>
        <strength value="required" />
        <valueSet value="https://vvis.gov.lv/fhir/ValueSet/1.3.6.1.4.1.38760.2.21" />
      </binding>
    </element>
    <element id="Identifier.value">
      <path value="Identifier.value" />
      <short value="Identifier value" />
      <definition value="Person identity number - //EHR has no validation * portal side not clear" />
      <min value="1" />
      <maxLength value="50" />
      <constraint>
        <key value="IdValueUnverified-con1" />
        <severity value="error" />
        <human value="Allowed symbols: [a-zA-Z0-9_/-]" />
        <expression value="matches('[a-zA-Z0-9_/-]+')" />
      </constraint>
      <mustSupport value="true" />
    </element>
    <element id="Identifier.period">
      <path value="Identifier.period" />
      <max value="0" />
    </element>
    <element id="Identifier.assigner">
      <path value="Identifier.assigner" />
      <max value="0" />
    </element>
    <element id="Identifier.assigner.reference">
      <path value="Identifier.assigner.reference" />
      <short value="Reference to medical institution" />
    </element>
  </differential>
</StructureDefinition>