<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="gd-Address" />
  <url value="http://ehelse.no/fhir/StructureDefinition/gd-Address" />
  <version value="2.3.1" />
  <name value="GdAddress" />
  <title value="GdAddress" />
  <status value="draft" />
  <date value="2019-12-20" />
  <description value="Grunndata adresse&#xD;&#xA;Contains information and metadata for addresses defined in Norwegian Master Person Index and Norwegian Directorate of e-Health's health related Master Person Index." />
  <fhirVersion value="4.0.0" />
  <kind value="complex-type" />
  <abstract value="false" />
  <type value="Address" />
  <baseDefinition value="http://hl7.no/fhir/StructureDefinition/no-basis-Address" />
  <derivation value="constraint" />
  <differential>
    <element id="Address">
      <path value="Address" />
      <short value="Grunndata adresse fra FREG" />
      <definition value="Grunndata adresse&#xD;&#xA;Contains information and metadata for addresses defined in Norwegian Master Person Index and Norwegian Directorate of e-Health's health related Master Person Index.&#xD;&#xA;&#xD;&#xA;An address expressed using postal conventions (as opposed to GPS or other location definition formats).  This data type may be used to convey addresses for use in delivering mail as well as for visiting locations which might not be valid for mail delivery.  There are a variety of postal address formats defined around the world." />
    </element>
    <element id="Address.extension">
      <path value="Address.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="Address.extension:urbanDistrict">
      <path value="Address.extension" />
      <sliceName value="urbanDistrict" />
      <short value="Urban district of this address" />
      <definition value="Simple extension containing information about what part of a norwegian city the patient is a resident. Administrative purpose. Five Norwegian cities have defined administrative districts called bydel. This is Oslo, Bergen, Trondheim, Stavanger og Drammen. &#xD;&#xA;&#xD;&#xA;There are still some uncertainty on what is the official source of bydel information. TBD" />
    </element>
    <element id="Address.extension:urbanDistrict.value[x].code">
      <path value="Address.extension.value[x].code" />
      <alias value="bydelsnummer" />
      <mustSupport value="true" />
    </element>
    <element id="Address.extension:urbanDistrict.value[x].display">
      <path value="Address.extension.value[x].display" />
      <short value="The name of the urban district" />
      <definition value="The name of the urban district" />
      <alias value="bydelsnavn" />
      <mustSupport value="true" />
    </element>
    <element id="Address.extension:fregMetadata">
      <path value="Address.extension" />
      <sliceName value="fregMetadata" />
      <definition value="fregmetadata (registermetadata) describes metadata about resources available from the norwegian person index (folkeregisteret, freg), all resources containing metadata from folkeregisteret will include registermetadata" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://ehelse.no/fhir/StructureDefinition/gd-fregmetadata" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Address.extension:addressMetadata">
      <path value="Address.extension" />
      <sliceName value="addressMetadata" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://ehelse.no/fhir/StructureDefinition/gd-address-metadata" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Address.use">
      <path value="Address.use" />
      <definition value="Grunndata don't use this element&#xD;&#xA;&#xD;&#xA;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." />
      <mustSupport value="false" />
    </element>
    <element id="Address.type">
      <path value="Address.type" />
      <definition value="Grunndata don't use this element&#xD;&#xA;&#xD;&#xA;Distinguishes between physical addresses (those you can visit) and mailing addresses (e.g. PO Boxes and care-of addresses). Most addresses are both.&#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." />
      <mustSupport value="false" />
    </element>
    <element id="Address.city">
      <path value="Address.city" />
      <definition value="gd-Address: All Norwegian addresses are from Master Person Index uses this element for &quot;poststed&quot; or &quot;postedsnavn&quot;. International addresses uses this element to communicate the name of the city.&#xD;&#xA;&#xD;&#xA;The name of the poststed or city. 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." />
      <alias value="poststedsnavn" />
    </element>
    <element id="Address.district">
      <path value="Address.district" />
      <short value="name of &quot;kommune&quot; or district" />
      <definition value="gd-Address: Norwegian addresses uses district for the norwegian &quot;kommune&quot;, international addresses uses district for any other applicable district in that country.&#xD;&#xA;&#xD;&#xA;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)." />
    </element>
    <element id="Address.period">
      <path value="Address.period" />
      <definition value="Grunndata uses this element to represent flyttedato, oppholdsadressedato and startdatoForKontrakt/sluttdatoForKontrakt&#xD;&#xA;&#xD;&#xA;Time period when address was/is in use." />
      <alias value="flyttedato" />
      <alias value="oppholdsadressedato" />
      <alias value="startdatoForKontrakt" />
      <alias value="sluttdatoForKontrakt" />
    </element>
    <element id="Address.period.start">
      <path value="Address.period.start" />
      <definition value="Grunndata uses this element to represent flyttedato, oppholdsadressedato and startdatoForKontrakt&#xD;&#xA;&#xD;&#xA;The start of the period. The boundary is inclusive." />
      <alias value="flyttedato" />
      <alias value="oppholdsadressedato" />
      <alias value="startdatoForKontrakt" />
      <mapping>
        <identity value="freg.Bostedsadresse" />
        <map value="flyttedato" />
      </mapping>
      <mapping>
        <identity value="freg.Oppholdsadresse" />
        <map value="oppholdsadressedato" />
      </mapping>
      <mapping>
        <identity value="freg.DeltBosted" />
        <map value="startdatoForKontrakt" />
      </mapping>
    </element>
    <element id="Address.period.end">
      <path value="Address.period.end" />
      <definition value="Grunndata uses this element to represent sluttdatoForKontrakt&#xD;&#xA;&#xD;&#xA;The end of the period. If the end of the period is missing, it means no end was known or planned at the time the instance was created. The start may be in the past, and the end date in the future, which means that period is expected/planned to end at that time." />
      <alias value="sluttdatoForKontrakt" />
      <mapping>
        <identity value="freg.DeltBosted" />
        <map value="sluttdatoForKontrakt" />
      </mapping>
    </element>
  </differential>
</StructureDefinition>