<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="ContactPointIOP-v1-0-0" />
  <url value="http://spms.min-saude.pt/iop/fhir/StructureDefinition/ContactPoint" />
  <name value="ContactPointIOP" />
  <status value="draft" />
  <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>
  <kind value="complex-type" />
  <abstract value="false" />
  <type value="ContactPoint" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/ContactPoint" />
  <derivation value="constraint" />
  <snapshot>
    <element id="ContactPoint">
      <path value="ContactPoint" />
      <short value="Details of a Technology mediated contact point (phone, fax, email, etc.)" />
      <definition value="Details for all kinds of technology mediated contact points for a person or organization, including telephone, email, etc." />
      <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" />
        <source value="http://hl7.org/fhir/StructureDefinition/Element" />
      </constraint>
      <constraint>
        <key value="cpt-2" />
        <severity value="error" />
        <human value="A system is required if a value is provided." />
        <expression value="value.empty() or system.exists()" />
        <xpath value="not(exists(f:value)) or exists(f:system)" />
        <source value="http://hl7.org/fhir/StructureDefinition/ContactPoint" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="XTN" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="TEL" />
      </mapping>
      <mapping>
        <identity value="servd" />
        <map value="ContactPoint" />
      </mapping>
    </element>
    <element id="ContactPoint.id">
      <path value="ContactPoint.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="1" />
      <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" />
        <source value="http://hl7.org/fhir/StructureDefinition/Element" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="ContactPoint.extension">
      <path value="ContactPoint.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" />
        <source value="http://hl7.org/fhir/StructureDefinition/Element" />
      </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')])" />
        <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="ContactPoint.system">
      <path value="ContactPoint.system" />
      <short value="phone | fax | email | pager | url | sms | other" />
      <definition value="Telecommunications form for contact point - what communications system is required to make use of the contact." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <min value="1" />
      <max value="1" />
      <base>
        <path value="ContactPoint.system" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="code" />
      </type>
      <fixedCode value="http://hl7.org/fhir/contact-point-system" />
      <condition value="ele-1" />
      <condition value="cpt-2" />
      <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" />
        <source value="http://hl7.org/fhir/StructureDefinition/Element" />
      </constraint>
      <isSummary value="true" />
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="ContactPointSystem" />
        </extension>
        <strength value="required" />
        <description value="Telecommunications form for contact point" />
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/contact-point-system" />
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="XTN.3" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./scheme" />
      </mapping>
      <mapping>
        <identity value="servd" />
        <map value="./ContactPointType" />
      </mapping>
    </element>
    <element id="ContactPoint.value">
      <path value="ContactPoint.value" />
      <short value="The actual contact point details" />
      <definition value="The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address)." />
      <comment value="Additional text data such as phone extension numbers, or notes about use of the contact are sometimes included in the value." />
      <requirements value="Need to support legacy numbers that are not in a tightly controlled format." />
      <min value="1" />
      <max value="1" />
      <base>
        <path value="ContactPoint.value" />
        <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" />
        <source value="http://hl7.org/fhir/StructureDefinition/Element" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="XTN.1 (or XTN.12)" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./url" />
      </mapping>
      <mapping>
        <identity value="servd" />
        <map value="./Value" />
      </mapping>
    </element>
    <element id="ContactPoint.use">
      <path value="ContactPoint.use" />
      <short value="home | work | temp | old | mobile - purpose of this contact point" />
      <definition value="Identifies the purpose for the contact point." />
      <comment value="This is labeled as &quot;Is Modifier&quot; because applications should not mistake a temporary or old contact etc.for a current/permanent one. Applications can assume that a contact is current unless it explicitly says that it is temporary or old." />
      <requirements value="Need to track the way a person uses this contact, so a user can choose which is appropriate for their purpose." />
      <min value="1" />
      <max value="1" />
      <base>
        <path value="ContactPoint.use" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="code" />
      </type>
      <fixedCode value="http://hl7.org/fhir/contact-point-use" />
      <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" />
        <source value="http://hl7.org/fhir/StructureDefinition/Element" />
      </constraint>
      <isModifier value="true" />
      <isSummary value="true" />
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="ContactPointUse" />
        </extension>
        <strength value="required" />
        <description value="Use of contact point" />
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/contact-point-use" />
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="XTN.2 - but often indicated by field" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="unique(./use)" />
      </mapping>
      <mapping>
        <identity value="servd" />
        <map value="./ContactPointPurpose" />
      </mapping>
    </element>
    <element id="ContactPoint.rank">
      <path value="ContactPoint.rank" />
      <short value="Specify preferred order of use (1 = highest)" />
      <definition value="Specifies a preferred order in which to use a set of contacts. Contacts are ranked with lower values coming before higher values." />
      <comment value="Note that rank does not necessarily follow the order in which the contacts are represented in the instance." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="ContactPoint.rank" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="positiveInt" />
      </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" />
        <source value="http://hl7.org/fhir/StructureDefinition/Element" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="ContactPoint.period">
      <path value="ContactPoint.period" />
      <short value="Time period when the contact point was/is in use" />
      <definition value="Time period when the contact point 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." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="ContactPoint.period" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="Period" />
      </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" />
        <source value="http://hl7.org/fhir/StructureDefinition/Element" />
      </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)" />
        <source value="http://hl7.org/fhir/StructureDefinition/Period" />
      </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="N/A" />
      </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="ContactPoint.id">
      <path value="ContactPoint.id" />
      <min value="1" />
    </element>
    <element id="ContactPoint.system">
      <path value="ContactPoint.system" />
      <min value="1" />
      <fixedCode value="http://hl7.org/fhir/contact-point-system" />
    </element>
    <element id="ContactPoint.value">
      <path value="ContactPoint.value" />
      <min value="1" />
    </element>
    <element id="ContactPoint.use">
      <path value="ContactPoint.use" />
      <min value="1" />
      <fixedCode value="http://hl7.org/fhir/contact-point-use" />
    </element>
  </differential>
</StructureDefinition>