<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="e9a39f01-c3de-400f-87cb-15819a13adee" />
  <meta>
    <lastUpdated value="2018-12-20T11:19:12.969+00:00" />
  </meta>
  <url value="http://ehalsomyndigheten.se/fhir/Patient/nll" />
  <name value="swe-patient-nll-alt1" />
  <status value="draft" />
  <date value="2018-12-20T11:19:12.7967121+00:00" />
  <description value="v1:" />
  <fhirVersion value="3.0.1" />
  <mapping>
    <identity value="nll-info-model" />
    <name value="NLL Information model" />
  </mapping>
  <mapping>
    <identity value="or-service" />
    <name value="Corresponding concept in OR" />
  </mapping>
  <kind value="resource" />
  <abstract value="false" />
  <type value="Patient" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Patient" />
  <derivation value="constraint" />
  <differential>
    <element id="Patient.extension">
      <path value="Patient.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="Patient.extension:managingDoseDispensePharmacy">
      <path value="Patient.extension" />
      <sliceName value="managingDoseDispensePharmacy" />
      <type>
        <code value="Extension" />
        <profile value="http://example.org/fhir/StructureDefinition/orgRef" />
      </type>
    </element>
    <element id="Patient.identifier">
      <path value="Patient.identifier" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="system" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <definition value="An identifier for this patient. Should be personnummer (personal identity number) or samordningsnummer (co-ordination number). Note that two identifier can't be active during the same period. &#xD;&#xA;&#xD;&#xA;When a patient doesn't have any of the defined identifiers, it is still possible to create e.g. a MedicationRequest for the patient by creating a patient inline (contained) in the MedicationRequest resource." />
      <mustSupport value="true" />
    </element>
    <element id="Patient.identifier:PNR">
      <path value="Patient.identifier" />
      <sliceName value="PNR" />
      <short value="Personnummer (personal identifier number) for the patient" />
      <definition value="Personnummer (personal identifier number) for the patient. Personnummer is one of the possible identifiers of a patient. This identifier should primarily be used and only if there is a clear reason that a personnumer doesn't exist for the patient the alternate identifiers can be used" />
      <mapping>
        <identity value="nll-info-model" />
        <map value="Patient.Person-id" />
      </mapping>
      <mapping>
        <identity value="or-service" />
        <map value="Patient.personnummer" />
      </mapping>
    </element>
    <element id="Patient.identifier:PNR.system">
      <path value="Patient.identifier.system" />
      <min value="1" />
      <fixedUri value="urn:oid:1.2.752.129.2.1.3.1" />
      <mapping>
        <identity value="nll-info-model" />
        <map value="Person-id typ" />
      </mapping>
    </element>
    <element id="Patient.identifier:PNR.value">
      <path value="Patient.identifier.value" />
      <min value="1" />
      <constraint>
        <key value="swe-id-rule" />
        <severity value="error" />
        <human value="Personal id must have 12 digits" />
        <expression value="$this.matches('^\\d{12}$')" />
      </constraint>
    </element>
    <element id="Patient.identifier:SNR">
      <path value="Patient.identifier" />
      <sliceName value="SNR" />
      <short value="Samordningsnummer (co-ordination number) identifier for the patient" />
      <definition value="Samordningsnummer (co-ordination number)  for the patient. Samordningsnummer is one of the possible identifiers of a patient. This identifier is used when the person hasn't yet received a personnummer but can be kept as a historical identifier once patient has received a personnummer." />
      <max value="1" />
    </element>
    <element id="Patient.identifier:SNR.system">
      <path value="Patient.identifier.system" />
      <definition value="Establishes the namespace for the value - that is, a URL that describes a set values that are unique.&#xD;&#xA;OID" />
      <min value="1" />
      <fixedUri value="urn:oid:1.2.752.129.2.1.3.3" />
    </element>
    <element id="Patient.identifier:SNR.value">
      <path value="Patient.identifier.value" />
      <min value="1" />
      <constraint>
        <key value="swe-id-rule" />
        <severity value="error" />
        <human value="Identifier must have 12 digits" />
        <expression value="$this.matches('^\\d{12}$')" />
      </constraint>
    </element>
    <element id="Patient.name.family">
      <path value="Patient.name.family" />
      <mustSupport value="true" />
      <mapping>
        <identity value="nll-info-model" />
        <map value="Patient.Efternamn" />
      </mapping>
      <mapping>
        <identity value="or-service" />
        <map value="Patient.efternamn" />
      </mapping>
    </element>
    <element id="Patient.name.given">
      <path value="Patient.name.given" />
      <mustSupport value="true" />
      <mapping>
        <identity value="nll-info-model" />
        <map value="Patient.Förnamn" />
      </mapping>
      <mapping>
        <identity value="or-service" />
        <map value="Patient.fornamn" />
      </mapping>
    </element>
  </differential>
</StructureDefinition>