<StructureDefinition xmlns="http://hl7.org/fhir">
  <url value="http://dips.no/fhir/structuredefintion/R4/DIPSPerson" />
  <name value="DIPSPerson" />
  <status value="draft" />
  <fhirVersion value="4.0.0" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="Person" />
  <baseDefinition value="http://hl7.no/fhir/StructureDefinition/no-basis-Person" />
  <derivation value="constraint" />
  <snapshot />
  <differential>
    <element id="Person">
      <path value="Person" />
      <comment value="The Person resource does justice to person registries that keep track of persons regardless of their role. The Person resource is also a primary resource to point to for people acting in a particular role such as SubjectofCare, Practitioner, and Agent. Very few attributes are specific to any role and so Person is kept lean. Most attributes are expected to be tied to the role the Person plays rather than the Person himself. Examples of that are Guardian (SubjectofCare), ContactParty (SubjectOfCare, Practitioner), and multipleBirthInd (SubjectofCare).&#xD;&#xA;&#xD;&#xA;database column - - dipscoredb.dwperson.personid" />
    </element>
    <element id="Person.meta.lastUpdated">
      <path value="Person.meta.lastUpdated" />
      <definition value="When the resource last changed - e.g. when the version changed.&#xD;&#xA;database column - - dipscoredb.dwperson.SISTENDRETTID" />
    </element>
    <element id="Person.extension">
      <path value="Person.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="Person.extension:language">
      <path value="Person.extension" />
      <sliceName value="language" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://dips.no/fhir/StructureDefinition/R4/DIPSPersonLanguage" />
      </type>
    </element>
    <element id="Person.extension:language.value[x].system">
      <path value="Person.extension.value[x].system" />
      <fixedUri value="urn: oid:2.16.578.1.12.4.1.1.3402" />
    </element>
    <element id="Person.extension:deathRegisteredTime">
      <path value="Person.extension" />
      <sliceName value="deathRegisteredTime" />
      <type>
        <code value="Extension" />
        <profile value="http://dips.no/fhir/StructureDefinition/R4/DIPSPersonDeathRegisteredTime" />
      </type>
    </element>
    <element id="Person.extension:hospitalSectorName">
      <path value="Person.extension" />
      <sliceName value="hospitalSectorName" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://dips.no/fhir/StructureDefinition/R4/DIPSPersonHospitalSectorName" />
      </type>
    </element>
    <element id="Person.extension:hospitalSectorId">
      <path value="Person.extension" />
      <sliceName value="hospitalSectorId" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://dips.no/fhir/StructureDefinition/R4/DIPSPersonHospitalSectorId" />
      </type>
    </element>
    <element id="Person.extension:deathRegisteredBy">
      <path value="Person.extension" />
      <sliceName value="deathRegisteredBy" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://dips.no/fhir/StructureDefinition/R4/DIPSPersonDeathRegisteredBy" />
      </type>
    </element>
    <element id="Person.extension:deathComment">
      <path value="Person.extension" />
      <sliceName value="deathComment" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://dips.no/fhir/StructureDefinition/R4/DIPSPersonDeathComment" />
      </type>
    </element>
    <element id="Person.identifier.use">
      <path value="Person.identifier.use" />
      <max value="0" />
    </element>
    <element id="Person.identifier.type">
      <path value="Person.identifier.type" />
      <max value="0" />
    </element>
    <element id="Person.identifier.value">
      <path value="Person.identifier.value" />
      <definition value="The Norwegian Fødselsnummer&#xD;&#xA;&#xD;&#xA;database column - - dipscoredb.dwperson.Foedselsnr" />
    </element>
    <element id="Person.identifier.period">
      <path value="Person.identifier.period" />
      <max value="0" />
    </element>
    <element id="Person.identifier.assigner">
      <path value="Person.identifier.assigner" />
      <max value="0" />
    </element>
    <element id="Person.identifier.use">
      <path value="Person.identifier.use" />
      <min value="0" />
      <max value="0" />
    </element>
    <element id="Person.identifier.type">
      <path value="Person.identifier.type" />
      <min value="0" />
      <max value="0" />
    </element>
    <element id="Person.identifier.period">
      <path value="Person.identifier.period" />
      <min value="0" />
      <max value="0" />
    </element>
    <element id="Person.identifier:PersonID">
      <path value="Person.identifier" />
      <sliceName value="PersonID" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Person.identifier:PersonID.use">
      <path value="Person.identifier.use" />
      <max value="0" />
    </element>
    <element id="Person.identifier:PersonID.type">
      <path value="Person.identifier.type" />
      <max value="0" />
    </element>
    <element id="Person.identifier:PersonID.system">
      <path value="Person.identifier.system" />
      <min value="1" />
      <fixedUri value="http://dips.no/fhir/namingsystem/dips-personid" />
    </element>
    <element id="Person.identifier:PersonID.value">
      <path value="Person.identifier.value" />
      <definition value="The portion of the identifier typically relevant to the user and which is unique within the context of the system.&#xD;&#xA;&#xD;&#xA;database column - - dipscoredb.dwperson.personid" />
      <min value="1" />
    </element>
    <element id="Person.identifier:PersonID.period">
      <path value="Person.identifier.period" />
      <max value="0" />
    </element>
    <element id="Person.identifier:PersonID.assigner">
      <path value="Person.identifier.assigner" />
      <max value="0" />
    </element>
    <element id="Person.name.id">
      <path value="Person.name.id" />
      <max value="0" />
    </element>
    <element id="Person.name.use">
      <path value="Person.name.use" />
      <max value="0" />
    </element>
    <element id="Person.name.family">
      <path value="Person.name.family" />
      <definition value="Ref. &quot;lov om personnavn&quot; for further details about Norwegian HumanNames.&#xD;&#xA;&#xD;&#xA;The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father.&#xD;&#xA;&#xD;&#xA;database column - - dipscoredb.dwperson.Etternavn" />
    </element>
    <element id="Person.name.given">
      <path value="Person.name.given" />
      <definition value="Given name. In Norway Given name does not include middlenames according to the regulation for norwegian names. Multiple given names are however legal. Ref. &quot;Lov om personnavn&quot; for further details about Norwegian HumanNames.&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;database column - - dipscoredb.dwperson.fornavn" />
    </element>
    <element id="Person.name.prefix">
      <path value="Person.name.prefix" />
      <max value="0" />
    </element>
    <element id="Person.name.suffix">
      <path value="Person.name.suffix" />
      <max value="0" />
    </element>
    <element id="Person.name.period">
      <path value="Person.name.period" />
      <max value="0" />
    </element>
    <element id="Person.gender">
      <path value="Person.gender" />
      <definition value="Administrative Gender.&#xD;&#xA;&#xD;&#xA;derive from database column - - dipscoredb.dwperson.Foedselsnr" />
    </element>
    <element id="Person.birthDate">
      <path value="Person.birthDate" />
      <definition value="The birth date for the person.&#xD;&#xA;&#xD;&#xA;database column - - dipscoredb.dwperson.Foedselsdato" />
    </element>
    <element id="Person.address.id">
      <path value="Person.address.id" />
      <definition value="Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;database column -- dipscoredb.dwadresse.adresseid" />
    </element>
    <element id="Person.address.extension">
      <path value="Person.address.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="Person.address.extension:stateName">
      <path value="Person.address.extension" />
      <sliceName value="stateName" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://dips.no/fhir/StructureDefinition/R4/DIPSPersonStateName" />
      </type>
    </element>
    <element id="Person.address.extension:stateName.value[x].system">
      <path value="Person.address.extension.value[x].system" />
    </element>
    <element id="Person.address.extension:stateName.value[x].version">
      <path value="Person.address.extension.value[x].version" />
      <max value="0" />
    </element>
    <element id="Person.address.extension:stateName.value[x].userSelected">
      <path value="Person.address.extension.value[x].userSelected" />
      <max value="0" />
    </element>
    <element id="Person.address.extension:urbanDistrict.value[x].system">
      <path value="Person.address.extension.value[x].system" />
      <fixedUri value="http://dips.no/fhir/namingsystem/dips-urbandistrict" />
    </element>
    <element id="Person.address.extension:urbanDistrict.value[x].version">
      <path value="Person.address.extension.value[x].version" />
      <max value="0" />
    </element>
    <element id="Person.address.extension:urbanDistrict.value[x].userSelected">
      <path value="Person.address.extension.value[x].userSelected" />
      <max value="0" />
    </element>
    <element id="Person.address.use">
      <path value="Person.address.use" />
      <definition value="The purpose of this address.&#xD;&#xA;&#xD;&#xA;Mapping of values to other Norwegian CodeSystems is documented in the implementation guide. In general the address used for visiting the person should have use &quot;home&quot; and type &quot;physical&quot; or &quot;both&quot;. The &quot;official&quot; flag can be either true or false.&#xD;&#xA;&#xD;&#xA;derive from database column -- dipscoredb.dwadresse.dipscadresse and dipscoredb.dwkodeverkverdier.Kode" />
    </element>
    <element id="Person.address.line">
      <path value="Person.address.line" />
      <definition value="This component contains the house number, apartment number, street name, street direction,  P.O. Box number, delivery hints, and similar address information.&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;database column --  dipscoredb.dwadresse.dipscadresse" />
    </element>
    <element id="Person.address.city">
      <path value="Person.address.city" />
      <definition value="When a postalcode is given the name of the city must be according to the official list of postalcodes used in Norway.&#xD;&#xA;&#xD;&#xA;The name of the city, town, village or other community or delivery center.&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;database column -- dipscoredb.dwkodeverkverdier.langtnavn" />
    </element>
    <element id="Person.address.district">
      <path value="Person.address.district" />
      <definition value="Name of the county (norwegian &quot;kommune&quot;). If kommune number is required &quot;eiendomsinformasjon&quot; should be used.&#xD;&#xA;&#xD;&#xA;The name of the administrative area (county).&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;database column -- dipscoredb.dwkodeverkverdier.langtnavn" />
    </element>
    <element id="Person.address.district.extension">
      <path value="Person.address.district.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="Person.address.district.extension:muniplaity">
      <path value="Person.address.district.extension" />
      <sliceName value="muniplaity" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://dips.no/fhir/StructureDefinition/R4/DIPSPersonMunicipality" />
      </type>
    </element>
    <element id="Person.address.district.extension:muniplaity.value[x].system">
      <path value="Person.address.district.extension.value[x].system" />
      <fixedUri value="urn:oid:2.16.578.1.12.4.1.1.3402" />
    </element>
    <element id="Person.address.district.extension:muniplaity.value[x].version">
      <path value="Person.address.district.extension.value[x].version" />
      <max value="0" />
    </element>
    <element id="Person.address.district.extension:muniplaity.value[x].userSelected">
      <path value="Person.address.district.extension.value[x].userSelected" />
      <max value="0" />
    </element>
    <element id="Person.address.state">
      <path value="Person.address.state" />
      <definition value="Name of the norwegian &quot;fylke&quot;). If fylkes-number is required &quot;eiendomsinformasjon&quot; should be used with koded kommune-number.&#xD;&#xA;&#xD;&#xA;Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes).&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;database column -- dipscoredb.dwkodeverkverdier.kode" />
    </element>
    <element id="Person.address.postalCode">
      <path value="Person.address.postalCode" />
      <definition value="A postal code designating a region defined by the postal service.&#xD;&#xA;&#xD;&#xA;In Norway this is af four digit number defined by the norwegian postal service.&#xD;&#xA;&#xD;&#xA;database column -- dipscoredb.dwkodeverkverdier.Kode" />
    </element>
    <element id="Person.address.country">
      <path value="Person.address.country" />
      <definition value="Country - a nation as commonly understood or generally accepted.&#xD;&#xA;&#xD;&#xA;database column -- dipscoredb.dwkodeverkverdier.langtnavn" />
    </element>
    <element id="Person.address.period.start">
      <path value="Person.address.period.start" />
      <definition value="The start of the period. The boundary is inclusive.&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;database column -- dipscoredb.dwadresse.Gyldigfradato" />
    </element>
    <element id="Person.photo">
      <path value="Person.photo" />
      <max value="0" />
    </element>
    <element id="Person.managingOrganization">
      <path value="Person.managingOrganization" />
      <max value="0" />
    </element>
    <element id="Person.link">
      <path value="Person.link" />
      <min value="1" />
      <max value="1" />
    </element>
  </differential>
</StructureDefinition>