<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="Address-v1-0-0" />
  <meta>
    <versionId value="1" />
    <lastUpdated value="2021-08-31T17:15:37.052+00:00" />
  </meta>
  <url value="http://spms.min-saude.pt/iop/fhir/StructureDefinition/Address-v1-0-0" />
  <name value="AddressIOP" />
  <status value="draft" />
  <date value="2021-08-31T17:15:35.2866398+00:00" />
  <fhirVersion value="3.0.2" />
  <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="servd" />
    <uri value="http://www.omg.org/spec/ServD/1.0/" />
    <name value="ServD" />
  </mapping>
  <mapping>
    <identity value="vcard" />
    <uri value="http://w3.org/vcard" />
    <name value="vCard Mapping" />
  </mapping>
  <kind value="complex-type" />
  <abstract value="false" />
  <type value="Address" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Address" />
  <derivation value="constraint" />
  <snapshot>
    <element id="Address">
      <path value="Address" />
      <short value="An address expressed using postal conventions (as opposed to GPS or other location definition formats)" />
      <definition value="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." />
      <comment value="Note: address is for postal addresses, not physical locations." />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Element" />
        <min value="0" />
        <max value="*" />
      </base>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="XAD" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="AD" />
      </mapping>
      <mapping>
        <identity value="servd" />
        <map value="Address" />
      </mapping>
    </element>
    <element id="Address.id">
      <path value="Address.id" />
      <representation value="xmlAttr" />
      <short value="xml:id (or equivalent in JSON)" />
      <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.id" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="Address.extension">
      <path value="Address.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <description value="Extensions are always sliced by (at least) url" />
        <rules value="open" />
      </slicing>
      <short value="Additional Content defined by implementations" />
      <definition value="May be used to represent additional information that is not part of the basic definition of the element. In order to make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension." />
      <comment value="There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone." />
      <alias value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="Address.extension:preferred-address">
      <path value="Address.extension" />
      <sliceName value="preferred-address" />
      <short value="Optional Extensions Element" />
      <definition value="Optional Extension Element - found in all resources." />
      <comment value="There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone." />
      <alias value="extensions" />
      <alias value="user content" />
      <min value="1" />
      <max value="*" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
        <profile value="http://spms.min-saude.pt/fhir/iop/extensions/preferred-address-v1-0-0" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mustSupport value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="Address.extension:address-type">
      <path value="Address.extension" />
      <sliceName value="address-type" />
      <short value="Optional Extensions Element" />
      <definition value="Optional Extension Element - found in all resources." />
      <comment value="There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone." />
      <alias value="extensions" />
      <alias value="user content" />
      <min value="1" />
      <max value="*" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
        <profile value="http://spms.min-saude.pt/fhir/iop/extensions/address-type-v1-0-0" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mustSupport value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="Address.extension:geolocation">
      <path value="Address.extension" />
      <sliceName value="geolocation" />
      <short value="Optional Extensions Element" />
      <definition value="Optional Extension Element - found in all resources." />
      <comment value="There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone." />
      <alias value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
        <profile value="http://spms.min-saude.pt/fhir/iop/extensions/geolocation-v1-0-0" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="Address.use">
      <path value="Address.use" />
      <short value="home | work | temp | old - purpose of this address" />
      <definition value="The purpose of this address." />
      <comment value="This is labeled as &quot;Is Modifier&quot; because applications should not mistake a temporary or old address etc.for a current/permanent one. Applications can assume that an address is current unless it explicitly says that it is temporary or old." />
      <requirements value="Allows an appropriate address to be chosen from a list of many." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Address.use" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="code" />
      </type>
      <example>
        <label value="General" />
        <valueCode value="home" />
      </example>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isModifier value="true" />
      <isSummary value="true" />
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="AddressUse" />
        </extension>
        <strength value="required" />
        <description value="The use of an address" />
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/address-use" />
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="XAD.7" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="unique(./use)" />
      </mapping>
      <mapping>
        <identity value="servd" />
        <map value="./AddressPurpose" />
      </mapping>
    </element>
    <element id="Address.type">
      <path value="Address.type" />
      <short value="postal | physical | both" />
      <definition value="Distinguishes between physical addresses (those you can visit) and mailing addresses (e.g. PO Boxes and care-of addresses). Most addresses are both." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Address.type" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="code" />
      </type>
      <example>
        <label value="General" />
        <valueCode value="both" />
      </example>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="AddressType" />
        </extension>
        <strength value="required" />
        <description value="The type of an address (physical / postal)" />
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/address-type" />
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="XAD.18" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="unique(./use)" />
      </mapping>
      <mapping>
        <identity value="vcard" />
        <map value="address type parameter" />
      </mapping>
    </element>
    <element id="Address.text">
      <path value="Address.text" />
      <short value="Text representation of the address" />
      <definition value="A full text representation of the address." />
      <comment value="Can provide both a text representation and parts." />
      <requirements value="A renderable, unencoded form." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Address.text" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <example>
        <label value="General" />
        <valueString value="137 Nowhere Street, Erewhon 9132" />
      </example>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="XAD.1 + XAD.2 + XAD.3 + XAD.4 + XAD.5 + XAD.6" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./formatted" />
      </mapping>
      <mapping>
        <identity value="vcard" />
        <map value="address label parameter" />
      </mapping>
    </element>
    <element id="Address.line">
      <path value="Address.line" />
      <short value="Street name, number, direction &amp; P.O. Box etc." />
      <definition value="This component contains the house number, apartment number, street name, street direction,  P.O. Box number, delivery hints, and similar address information." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <requirements value="home | work | temp | old - purpose of this address." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Address.line" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="string" />
      </type>
      <orderMeaning value="The order in which lines should appear in an address label" />
      <example>
        <label value="General" />
        <valueString value="137 Nowhere Street" />
      </example>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="XAD.1 + XAD.2 (note: XAD.1 and XAD.2 have different meanings for a company address than for a person address)" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="AD.part[parttype = AL]" />
      </mapping>
      <mapping>
        <identity value="vcard" />
        <map value="street" />
      </mapping>
      <mapping>
        <identity value="servd" />
        <map value="./StreetAddress (newline delimitted)" />
      </mapping>
    </element>
    <element id="Address.line.id">
      <path value="Address.line.id" />
      <representation value="xmlAttr" />
      <short value="xml:id (or equivalent in JSON)" />
      <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.id" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="Address.line.extension">
      <path value="Address.line.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <description value="Extensions are always sliced by (at least) url" />
        <rules value="open" />
      </slicing>
      <short value="Additional Content defined by implementations" />
      <definition value="May be used to represent additional information that is not part of the basic definition of the element. In order to make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension." />
      <comment value="There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone." />
      <alias value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="Address.line.extension:door-number">
      <path value="Address.line.extension" />
      <sliceName value="door-number" />
      <short value="Optional Extensions Element" />
      <definition value="Optional Extension Element - found in all resources." />
      <comment value="There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone." />
      <alias value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
        <profile value="http://spms.min-saude.pt/fhir/iop/extensions/door-number-v1-0-0" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="Address.line.extension:floor">
      <path value="Address.line.extension" />
      <sliceName value="floor" />
      <short value="Optional Extensions Element" />
      <definition value="Optional Extension Element - found in all resources." />
      <comment value="There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone." />
      <alias value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
        <profile value="http://spms.min-saude.pt/fhir/iop/extensions/floor-v1-0-0" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="Address.line.extension:place">
      <path value="Address.line.extension" />
      <sliceName value="place" />
      <short value="Optional Extensions Element" />
      <definition value="Optional Extension Element - found in all resources." />
      <comment value="There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone." />
      <alias value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
        <profile value="http://spms.min-saude.pt/fhir/iop/extensions/place-v1-0-0" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="Address.line.extension:locality">
      <path value="Address.line.extension" />
      <sliceName value="locality" />
      <short value="Optional Extensions Element" />
      <definition value="Optional Extension Element - found in all resources." />
      <comment value="There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone." />
      <alias value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
        <profile value="http://spms.min-saude.pt/fhir/iop/extensions/locality-v1-0-0" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="Address.line.extension:building-type">
      <path value="Address.line.extension" />
      <sliceName value="building-type" />
      <short value="Optional Extensions Element" />
      <definition value="Optional Extension Element - found in all resources." />
      <comment value="There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone." />
      <alias value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
        <profile value="http://spms.min-saude.pt/fhir/iop/extensions/building-type-v1-0-0" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="Address.line.extension:parish">
      <path value="Address.line.extension" />
      <sliceName value="parish" />
      <short value="Optional Extensions Element" />
      <definition value="Optional Extension Element - found in all resources." />
      <comment value="There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone." />
      <alias value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
        <profile value="http://spms.min-saude.pt/fhir/iop/extensions/parish-v1-0-0" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="Address.line.extension:door-side">
      <path value="Address.line.extension" />
      <sliceName value="door-side" />
      <short value="Optional Extensions Element" />
      <definition value="Optional Extension Element - found in all resources." />
      <comment value="There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone." />
      <alias value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
        <profile value="http://spms.min-saude.pt/fhir/iop/extensions/door-side-v1-0-0" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="Address.line.extension:street">
      <path value="Address.line.extension" />
      <sliceName value="street" />
      <short value="Optional Extensions Element" />
      <definition value="Optional Extension Element - found in all resources." />
      <comment value="There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone." />
      <alias value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
        <profile value="http://spms.min-saude.pt/fhir/iop/extensions/street-v1-0-0" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="Address.line.extension:street-type">
      <path value="Address.line.extension" />
      <sliceName value="street-type" />
      <short value="Optional Extensions Element" />
      <definition value="Optional Extension Element - found in all resources." />
      <comment value="There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone." />
      <alias value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
        <profile value="http://spms.min-saude.pt/fhir/iop/extensions/street-type-v1-0-0" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="Address.line.value">
      <path value="Address.line.value" />
      <representation value="xmlAttr" />
      <short value="Primitive value for string" />
      <definition value="Primitive value for string" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="string.value" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code>
          <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-json-type">
            <valueString value="string" />
          </extension>
          <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-xml-type">
            <valueString value="xsd:string" />
          </extension>
          <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-rdf-type">
            <valueString value="xsd:string" />
          </extension>
        </code>
      </type>
      <maxLength value="1048576" />
    </element>
    <element id="Address.city">
      <path value="Address.city" />
      <short value="Name of city, town etc." />
      <definition value="The name of the city, town, village or other community or delivery center." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <alias value="Municpality" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Address.city" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <example>
        <label value="General" />
        <valueString value="Erewhon" />
      </example>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="XAD.3" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="AD.part[parttype = CTY]" />
      </mapping>
      <mapping>
        <identity value="vcard" />
        <map value="locality" />
      </mapping>
      <mapping>
        <identity value="servd" />
        <map value="./Jurisdiction" />
      </mapping>
    </element>
    <element id="Address.district">
      <path value="Address.district" />
      <short value="District name (aka county)" />
      <definition value="The name of the administrative area (county)." />
      <comment value="District is sometimes known as county, but in some regions 'county' is used in place of city (municipality), so county name should be conveyed in city instead." />
      <alias value="County" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Address.district" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <example>
        <label value="General" />
        <valueString value="Madison" />
      </example>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="XAD.9" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="AD.part[parttype = CNT | CPA]" />
      </mapping>
    </element>
    <element id="Address.district.id">
      <path value="Address.district.id" />
      <representation value="xmlAttr" />
      <short value="xml:id (or equivalent in JSON)" />
      <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.id" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="Address.district.extension">
      <path value="Address.district.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <description value="Extensions are always sliced by (at least) url" />
        <rules value="open" />
      </slicing>
      <short value="Additional Content defined by implementations" />
      <definition value="May be used to represent additional information that is not part of the basic definition of the element. In order to make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension." />
      <comment value="There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone." />
      <alias value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="Address.district.extension:county">
      <path value="Address.district.extension" />
      <sliceName value="county" />
      <short value="Optional Extensions Element" />
      <definition value="Optional Extension Element - found in all resources." />
      <comment value="There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone." />
      <alias value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
        <profile value="http://spms.min-saude.pt/fhir/iop/extensions/county-v1-0-0" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mustSupport value="false" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="Address.district.value">
      <path value="Address.district.value" />
      <representation value="xmlAttr" />
      <short value="Primitive value for string" />
      <definition value="Primitive value for string" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="string.value" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code>
          <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-json-type">
            <valueString value="string" />
          </extension>
          <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-xml-type">
            <valueString value="xsd:string" />
          </extension>
          <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-rdf-type">
            <valueString value="xsd:string" />
          </extension>
        </code>
      </type>
      <maxLength value="1048576" />
    </element>
    <element id="Address.state">
      <path value="Address.state" />
      <short value="Sub-unit of country (abbreviations ok)" />
      <definition value="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)." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <alias value="Province" />
      <alias value="Territory" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Address.state" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="XAD.4" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="AD.part[parttype = STA]" />
      </mapping>
      <mapping>
        <identity value="vcard" />
        <map value="region" />
      </mapping>
      <mapping>
        <identity value="servd" />
        <map value="./Region" />
      </mapping>
    </element>
    <element id="Address.state.id">
      <path value="Address.state.id" />
      <representation value="xmlAttr" />
      <short value="xml:id (or equivalent in JSON)" />
      <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.id" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="Address.state.extension">
      <path value="Address.state.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <description value="Extensions are always sliced by (at least) url" />
        <rules value="open" />
      </slicing>
      <short value="Additional Content defined by implementations" />
      <definition value="May be used to represent additional information that is not part of the basic definition of the element. In order to make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension." />
      <comment value="There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone." />
      <alias value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="Address.state.extension:state">
      <path value="Address.state.extension" />
      <sliceName value="state" />
      <short value="Optional Extensions Element" />
      <definition value="Optional Extension Element - found in all resources." />
      <comment value="There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone." />
      <alias value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
        <profile value="http://spms.min-saude.pt/fhir/iop/extensions/state-v1-0-0" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="Address.state.value">
      <path value="Address.state.value" />
      <representation value="xmlAttr" />
      <short value="Primitive value for string" />
      <definition value="Primitive value for string" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="string.value" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code>
          <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-json-type">
            <valueString value="string" />
          </extension>
          <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-xml-type">
            <valueString value="xsd:string" />
          </extension>
          <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-rdf-type">
            <valueString value="xsd:string" />
          </extension>
        </code>
      </type>
      <maxLength value="1048576" />
    </element>
    <element id="Address.postalCode">
      <path value="Address.postalCode" />
      <short value="Postal code for area" />
      <definition value="A postal code designating a region defined by the postal service." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <alias value="Zip" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Address.postalCode" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <example>
        <label value="General" />
        <valueString value="9132" />
      </example>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="XAD.5" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="AD.part[parttype = ZIP]" />
      </mapping>
      <mapping>
        <identity value="vcard" />
        <map value="code" />
      </mapping>
      <mapping>
        <identity value="servd" />
        <map value="./PostalIdentificationCode" />
      </mapping>
    </element>
    <element id="Address.postalCode.id">
      <path value="Address.postalCode.id" />
      <representation value="xmlAttr" />
      <short value="xml:id (or equivalent in JSON)" />
      <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.id" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="Address.postalCode.extension">
      <path value="Address.postalCode.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <description value="Extensions are always sliced by (at least) url" />
        <rules value="open" />
      </slicing>
      <short value="Additional Content defined by implementations" />
      <definition value="May be used to represent additional information that is not part of the basic definition of the element. In order to make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension." />
      <comment value="There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone." />
      <alias value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="Address.postalCode.extension:postal-code">
      <path value="Address.postalCode.extension" />
      <sliceName value="postal-code" />
      <short value="Optional Extensions Element" />
      <definition value="Optional Extension Element - found in all resources." />
      <comment value="There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone." />
      <alias value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
        <profile value="http://spms.min-saude.pt/fhir/iop/extensions/postal-code-v1-0-0" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="Address.postalCode.value">
      <path value="Address.postalCode.value" />
      <representation value="xmlAttr" />
      <short value="Primitive value for string" />
      <definition value="Primitive value for string" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="string.value" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code>
          <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-json-type">
            <valueString value="string" />
          </extension>
          <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-xml-type">
            <valueString value="xsd:string" />
          </extension>
          <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-rdf-type">
            <valueString value="xsd:string" />
          </extension>
        </code>
      </type>
      <maxLength value="1048576" />
    </element>
    <element id="Address.country">
      <path value="Address.country" />
      <short value="Country (e.g. can be ISO 3166 2 or 3 letter code)" />
      <definition value="Country - a nation as commonly understood or generally accepted." />
      <comment value="ISO 3166 3 letter codes can be used in place of a full country name." />
      <min value="1" />
      <max value="1" />
      <base>
        <path value="Address.country" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <mustSupport value="true" />
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="XAD.6" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="AD.part[parttype = CNT]" />
      </mapping>
      <mapping>
        <identity value="vcard" />
        <map value="country" />
      </mapping>
      <mapping>
        <identity value="servd" />
        <map value="./Country" />
      </mapping>
    </element>
    <element id="Address.country.id">
      <path value="Address.country.id" />
      <representation value="xmlAttr" />
      <short value="xml:id (or equivalent in JSON)" />
      <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.id" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="Address.country.extension">
      <path value="Address.country.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <description value="Extensions are always sliced by (at least) url" />
        <rules value="open" />
      </slicing>
      <short value="Additional Content defined by implementations" />
      <definition value="May be used to represent additional information that is not part of the basic definition of the element. In order to make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension." />
      <comment value="There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone." />
      <alias value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="Address.country.extension:country">
      <path value="Address.country.extension" />
      <sliceName value="country" />
      <short value="Optional Extensions Element" />
      <definition value="Optional Extension Element - found in all resources." />
      <comment value="There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone." />
      <alias value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
        <profile value="http://spms.min-saude.pt/fhir/iop/extensions/country-v1-0-0" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="Address.country.value">
      <path value="Address.country.value" />
      <representation value="xmlAttr" />
      <short value="Primitive value for string" />
      <definition value="Primitive value for string" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="string.value" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code>
          <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-json-type">
            <valueString value="string" />
          </extension>
          <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-xml-type">
            <valueString value="xsd:string" />
          </extension>
          <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-rdf-type">
            <valueString value="xsd:string" />
          </extension>
        </code>
      </type>
      <maxLength value="1048576" />
    </element>
    <element id="Address.period">
      <path value="Address.period" />
      <short value="Time period when address was/is in use" />
      <definition value="Time period when address was/is in use." />
      <comment value="This is not a duration - that's a measure of time (a separate type), but a duration that occurs at a fixed value of time. A Period specifies a range of time; the context of use will specify whether the entire range applies (e.g. &quot;the patient was an inpatient of the hospital for this time range&quot;) or one value from the range applies (e.g. &quot;give to the patient between these two times&quot;). If duration is required, specify the type as Interval|Duration." />
      <requirements value="Allows addresses to be placed in historical context." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Address.period" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="Period" />
      </type>
      <example>
        <label value="General" />
        <valuePeriod>
          <start value="2010-03-23" />
          <end value="2010-07-01" />
        </valuePeriod>
      </example>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="per-1" />
        <severity value="error" />
        <human value="If present, start SHALL have a lower value than end" />
        <expression value="start.empty() or end.empty() or (start &lt;= end)" />
        <xpath value="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value &lt;= f:end/@value)" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="DR" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="IVL&lt;TS&gt;[lowClosed=&quot;true&quot; and highClosed=&quot;true&quot;] or URG&lt;TS&gt;[lowClosed=&quot;true&quot; and highClosed=&quot;true&quot;]" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="XAD.12 / XAD.13 + XAD.14" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./usablePeriod[type=&quot;IVL&lt;TS&gt;&quot;]" />
      </mapping>
      <mapping>
        <identity value="servd" />
        <map value="./StartDate and ./EndDate" />
      </mapping>
    </element>
  </snapshot>
  <differential>
    <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:preferred-address">
      <path value="Address.extension" />
      <sliceName value="preferred-address" />
      <min value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://spms.min-saude.pt/fhir/iop/extensions/preferred-address-v1-0-0" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Address.extension:address-type">
      <path value="Address.extension" />
      <sliceName value="address-type" />
      <min value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://spms.min-saude.pt/fhir/iop/extensions/address-type-v1-0-0" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Address.extension:geolocation">
      <path value="Address.extension" />
      <sliceName value="geolocation" />
      <type>
        <code value="Extension" />
        <profile value="http://spms.min-saude.pt/fhir/iop/extensions/geolocation-v1-0-0" />
      </type>
    </element>
    <element id="Address.line">
      <path value="Address.line" />
      <max value="1" />
    </element>
    <element id="Address.line.extension">
      <path value="Address.line.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="Address.line.extension:door-number">
      <path value="Address.line.extension" />
      <sliceName value="door-number" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://spms.min-saude.pt/fhir/iop/extensions/door-number-v1-0-0" />
      </type>
    </element>
    <element id="Address.line.extension:floor">
      <path value="Address.line.extension" />
      <sliceName value="floor" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://spms.min-saude.pt/fhir/iop/extensions/floor-v1-0-0" />
      </type>
    </element>
    <element id="Address.line.extension:place">
      <path value="Address.line.extension" />
      <sliceName value="place" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://spms.min-saude.pt/fhir/iop/extensions/place-v1-0-0" />
      </type>
    </element>
    <element id="Address.line.extension:locality">
      <path value="Address.line.extension" />
      <sliceName value="locality" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://spms.min-saude.pt/fhir/iop/extensions/locality-v1-0-0" />
      </type>
    </element>
    <element id="Address.line.extension:building-type">
      <path value="Address.line.extension" />
      <sliceName value="building-type" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://spms.min-saude.pt/fhir/iop/extensions/building-type-v1-0-0" />
      </type>
    </element>
    <element id="Address.line.extension:parish">
      <path value="Address.line.extension" />
      <sliceName value="parish" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://spms.min-saude.pt/fhir/iop/extensions/parish-v1-0-0" />
      </type>
    </element>
    <element id="Address.line.extension:door-side">
      <path value="Address.line.extension" />
      <sliceName value="door-side" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://spms.min-saude.pt/fhir/iop/extensions/door-side-v1-0-0" />
      </type>
    </element>
    <element id="Address.line.extension:street">
      <path value="Address.line.extension" />
      <sliceName value="street" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://spms.min-saude.pt/fhir/iop/extensions/street-v1-0-0" />
      </type>
    </element>
    <element id="Address.line.extension:street-type">
      <path value="Address.line.extension" />
      <sliceName value="street-type" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://spms.min-saude.pt/fhir/iop/extensions/street-type-v1-0-0" />
      </type>
    </element>
    <element id="Address.district.extension">
      <path value="Address.district.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="Address.district.extension:county">
      <path value="Address.district.extension" />
      <sliceName value="county" />
      <type>
        <code value="Extension" />
        <profile value="http://spms.min-saude.pt/fhir/iop/extensions/county-v1-0-0" />
      </type>
      <mustSupport value="false" />
    </element>
    <element id="Address.state.extension">
      <path value="Address.state.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="Address.state.extension:state">
      <path value="Address.state.extension" />
      <sliceName value="state" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://spms.min-saude.pt/fhir/iop/extensions/state-v1-0-0" />
      </type>
    </element>
    <element id="Address.postalCode.extension">
      <path value="Address.postalCode.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="Address.postalCode.extension:postal-code">
      <path value="Address.postalCode.extension" />
      <sliceName value="postal-code" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://spms.min-saude.pt/fhir/iop/extensions/postal-code-v1-0-0" />
      </type>
    </element>
    <element id="Address.country">
      <path value="Address.country" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Address.country.extension">
      <path value="Address.country.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="Address.country.extension:country">
      <path value="Address.country.extension" />
      <sliceName value="country" />
      <type>
        <code value="Extension" />
        <profile value="http://spms.min-saude.pt/fhir/iop/extensions/country-v1-0-0" />
      </type>
    </element>
  </differential>
</StructureDefinition>