<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="HVOOrganizationAffiliation" />
  <url value="http://electronichealth.se/fhir/hvo/StructureDefinition/HVOOrganizationAffiliation" />
  <version value="0.1.0" />
  <name value="HVOOrganizationAffiliation" />
  <status value="draft" />
  <description value="HVOOrganizationAffiliation contains information about an assignment which someone has been assigned to perform during a longer (often undecided) period of time." />
  <fhirVersion value="5.0.0" />
  <mapping>
    <identity value="HVOOrganizationAffiliationToHVOUppdragLogical" />
    <uri value="HVOUppdragLogical" />
  </mapping>
  <kind value="resource" />
  <abstract value="false" />
  <type value="OrganizationAffiliation" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/OrganizationAffiliation" />
  <derivation value="constraint" />
  <snapshot>
    <element id="OrganizationAffiliation">
      <path value="OrganizationAffiliation" />
      <short value="Defines an affiliation/association/relationship between 2 distinct organizations, that is not a part-of relationship/sub-division relationship" />
      <definition value="Defines an affiliation/association/relationship between 2 distinct organizations, that is not a part-of relationship/sub-division relationship." />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="OrganizationAffiliation" />
        <min value="0" />
        <max value="*" />
      </base>
      <constraint>
        <key value="dom-2" />
        <severity value="error" />
        <human value="If the resource is contained in another resource, it SHALL NOT contain nested Resources" />
        <expression value="contained.contained.empty()" />
        <source value="http://hl7.org/fhir/StructureDefinition/DomainResource" />
      </constraint>
      <constraint>
        <key value="dom-4" />
        <severity value="error" />
        <human value="If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated" />
        <expression value="contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()" />
        <source value="http://hl7.org/fhir/StructureDefinition/DomainResource" />
      </constraint>
      <constraint>
        <key value="dom-3" />
        <severity value="error" />
        <human value="If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource" />
        <expression value="contained.where((('#'+id in (%resource.descendants().reference | %resource.descendants().ofType(canonical) | %resource.descendants().ofType(uri) | %resource.descendants().ofType(url))) or descendants().where(reference = '#').exists() or descendants().where(ofType(canonical) = '#').exists() or descendants().where(ofType(canonical) = '#').exists()).not()).trace('unmatched', id).empty()" />
        <source value="http://hl7.org/fhir/StructureDefinition/DomainResource" />
      </constraint>
      <constraint>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice">
          <valueBoolean value="true" />
        </extension>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice-explanation">
          <valueMarkdown value="When a resource has no narrative, only systems that fully understand the data can display the resource to a human safely. Including a human readable representation in the resource makes for a much more robust eco-system and cheaper handling of resources by intermediary systems. Some ecosystems restrict distribution of resources to only those systems that do fully understand the resources, and as a consequence implementers may believe that the narrative is superfluous. However experience shows that such eco-systems often open up to new participants over time." />
        </extension>
        <key value="dom-6" />
        <severity value="warning" />
        <human value="A resource should have narrative for robust management" />
        <expression value="text.`div`.exists()" />
        <source value="http://hl7.org/fhir/StructureDefinition/DomainResource" />
      </constraint>
      <constraint>
        <key value="dom-5" />
        <severity value="error" />
        <human value="If a resource is contained in another resource, it SHALL NOT have a security label" />
        <expression value="contained.meta.security.empty()" />
        <source value="http://hl7.org/fhir/StructureDefinition/DomainResource" />
      </constraint>
      <mustSupport value="false" />
      <isModifier value="false" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="Entity. Role, or Act" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="Entity, Role, or Act" />
      </mapping>
      <mapping>
        <identity value="w5" />
        <map value="administrative.individual" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="Role" />
      </mapping>
    </element>
    <element id="OrganizationAffiliation.id">
      <path value="OrganizationAffiliation.id" />
      <short value="Logical id of this artifact" />
      <definition value="The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes." />
      <comment value="Within the context of the FHIR RESTful interactions, the resource has an id except for cases like the create and conditional update. Otherwise, the use of the resouce id depends on the given use case." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Resource.id" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type">
          <valueUrl value="id" />
        </extension>
        <code value="http://hl7.org/fhirpath/System.String" />
      </type>
      <mustSupport value="true" />
      <isModifier value="false" />
      <isSummary value="true" />
    </element>
    <element id="OrganizationAffiliation.meta">
      <path value="OrganizationAffiliation.meta" />
      <short value="Metadata about the resource" />
      <definition value="The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Resource.meta" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="Meta" />
      </type>
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <source value="http://hl7.org/fhir/StructureDefinition/Element" />
      </constraint>
      <mustSupport value="false" />
      <isModifier value="false" />
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="OrganizationAffiliation.implicitRules">
      <path value="OrganizationAffiliation.implicitRules" />
      <short value="A set of rules under which this content was created" />
      <definition value="A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc." />
      <comment value="Asserting this rule set restricts the content to be only understood by a limited set of trading partners. This inherently limits the usefulness of the data in the long term. However, the existing health eco-system is highly fractured, and not yet ready to define, collect, and exchange data in a generally computable sense. Wherever possible, implementers and/or specification writers should avoid using this element. Often, when used, the URL is a reference to an implementation guide that defines these special rules as part of its narrative along with other profiles, value sets, etc." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Resource.implicitRules" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="uri" />
      </type>
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <source value="http://hl7.org/fhir/StructureDefinition/Element" />
      </constraint>
      <mustSupport value="false" />
      <isModifier value="true" />
      <isModifierReason value="This element is labeled as a modifier because the implicit rules may provide additional knowledge about the resource that modifies its meaning or interpretation" />
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="OrganizationAffiliation.language">
      <path value="OrganizationAffiliation.language" />
      <short value="Language of the resource content" />
      <definition value="The base language in which the resource is written." />
      <comment value="Language is provided to support indexing and accessibility (typically, services such as text to speech use the language tag). The html language tag in the narrative applies  to the narrative. The language tag on the resource may be used to specify the language of other presentations generated from the data in the resource. Not all the content has to be in the base language. The Resource.language should not be assumed to apply to the narrative automatically. If a language is specified, it should it also be specified on the div element in the html (see rules in HTML5 for information about the relationship between xml:lang and the html lang attribute)." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Resource.language" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="code" />
      </type>
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <source value="http://hl7.org/fhir/StructureDefinition/Element" />
      </constraint>
      <mustSupport value="false" />
      <isModifier value="false" />
      <isSummary value="false" />
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="Language" />
        </extension>
        <strength value="required" />
        <description value="IETF language tag for a human language" />
        <valueSet value="http://hl7.org/fhir/ValueSet/all-languages|5.0.0" />
        <additional>
          <purpose value="starter" />
          <valueSet value="http://hl7.org/fhir/ValueSet/languages" />
        </additional>
      </binding>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="OrganizationAffiliation.text">
      <path value="OrganizationAffiliation.text" />
      <short value="Text summary of the resource, for human interpretation" />
      <definition value="A human-readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it &quot;clinically safe&quot; for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety." />
      <comment value="Contained resources do not have a narrative. Resources that are not contained SHOULD have a narrative. In some cases, a resource may only have text with little or no additional discrete data (as long as all minOccurs=1 elements are satisfied).  This may be necessary for data from legacy systems where information is captured as a &quot;text blob&quot; or where text is additionally entered raw or narrated and encoded information is added later." />
      <alias value="narrative" />
      <alias value="html" />
      <alias value="xhtml" />
      <alias value="display" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="DomainResource.text" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="Narrative" />
      </type>
      <condition value="dom-6" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <source value="http://hl7.org/fhir/StructureDefinition/Element" />
      </constraint>
      <mustSupport value="false" />
      <isModifier value="false" />
      <isSummary value="false" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="Act.text?" />
      </mapping>
    </element>
    <element id="OrganizationAffiliation.contained">
      <path value="OrganizationAffiliation.contained" />
      <short value="Contained, inline Resources" />
      <definition value="These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, nor can they have their own independent transaction scope. This is allowed to be a Parameters resource if and only if it is referenced by a resource that provides context/meaning." />
      <comment value="This should never be done when the content can be identified properly, as once identification is lost, it is extremely difficult (and context dependent) to restore it again. Contained resources may have profiles and tags in their meta elements, but SHALL NOT have security labels." />
      <alias value="inline resources" />
      <alias value="anonymous resources" />
      <alias value="contained resources" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="DomainResource.contained" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Resource" />
      </type>
      <condition value="dom-2" />
      <condition value="dom-4" />
      <condition value="dom-3" />
      <condition value="dom-5" />
      <mustSupport value="false" />
      <isModifier value="false" />
      <isSummary value="false" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="Entity. Role, or Act" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="OrganizationAffiliation.extension">
      <path value="OrganizationAffiliation.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 resource. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can 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="DomainResource.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <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()" />
        <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
      </constraint>
      <mustSupport value="false" />
      <isModifier value="false" />
      <isSummary value="false" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="OrganizationAffiliation.modifierExtension">
      <path value="OrganizationAffiliation.modifierExtension" />
      <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="Extensions that cannot be ignored" />
      <definition value="May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and managable, 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. Applications processing a resource are required to check for modifier extensions.&#xA;&#xA;Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself)." />
      <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." />
      <requirements value="Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored.  This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](extensibility.html#modifierExtension)." />
      <alias value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="DomainResource.modifierExtension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <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()" />
        <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
      </constraint>
      <mustSupport value="false" />
      <isModifier value="true" />
      <isModifierReason value="Modifier extensions are expected to modify the meaning or interpretation of the resource that contains them" />
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="OrganizationAffiliation.identifier">
      <path value="OrganizationAffiliation.identifier" />
      <short value="Business identifiers that are specific to this role" />
      <definition value="Business identifiers that are specific to this role." />
      <comment value="The rules of the identifier.type  determine if a check digit is part of the ID value or sent separately, such as through the checkDigit extension." />
      <requirements value="Often, specific identities are assigned for the agent." />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="OrganizationAffiliation.identifier" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Identifier" />
      </type>
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <source value="http://hl7.org/fhir/StructureDefinition/Element" />
      </constraint>
      <constraint>
        <key value="ident-1" />
        <severity value="warning" />
        <human value="Identifier with no value has limited utility.  If communicating that an identifier value has been suppressed or missing, the value element SHOULD be present with an extension indicating the missing semantic - e.g. data-absent-reason" />
        <expression value="value.exists()" />
        <source value="http://hl7.org/fhir/StructureDefinition/Identifier" />
      </constraint>
      <mustSupport value="false" />
      <isModifier value="false" />
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="CX / EI (occasionally, more often EI maps to a resource id or a URL)" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="II - The Identifier class is a little looser than the v3 type II because it allows URIs as well as registered OIDs or GUIDs.  Also maps to Role[classCode=IDENT]" />
      </mapping>
      <mapping>
        <identity value="servd" />
        <map value="Identifier" />
      </mapping>
      <mapping>
        <identity value="w5" />
        <map value="FiveWs.identifier" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".id" />
      </mapping>
    </element>
    <element id="OrganizationAffiliation.active">
      <path value="OrganizationAffiliation.active" />
      <short value="Whether this organization affiliation record is in active use" />
      <definition value="Whether this organization affiliation record is in active use." />
      <comment value="If this value is false, you may refer to the period to see when the role was in active use. If there is no period specified, no inference can be made about when it was active." />
      <requirements value="Need to be able to mark an organization affiliation record as not to be used because it was created in error, or otherwise no longer in active use." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="OrganizationAffiliation.active" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="boolean" />
      </type>
      <meaningWhenMissing value="This resource is generally assumed to be active if no value is provided for the active element" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <source value="http://hl7.org/fhir/StructureDefinition/Element" />
      </constraint>
      <mustSupport value="false" />
      <isModifier value="false" />
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="w5" />
        <map value="FiveWs.status" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".statusCode" />
      </mapping>
    </element>
    <element id="OrganizationAffiliation.period">
      <path value="OrganizationAffiliation.period" />
      <short value="The period during which the participatingOrganization is affiliated with the primary organization" />
      <definition value="The period during which the participatingOrganization is affiliated with the primary organization." />
      <comment value="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;).&#xA;&#xA;Period is not used for a duration (a measure of elapsed time). See [Duration](datatypes.html#Duration)." />
      <requirements value="An affiliation may be created ahead of time and only be active for a defined period of time. Once the affiliation is complete, the fact that it existed may still be required." />
      <min value="1" />
      <max value="1" />
      <base>
        <path value="OrganizationAffiliation.period" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="Period" />
      </type>
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <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 or equal value than end" />
        <expression value="start.hasValue().not() or end.hasValue().not() or (start.lowBoundary() &lt;= end.highBoundary())" />
        <source value="http://hl7.org/fhir/StructureDefinition/Period" />
      </constraint>
      <mustSupport value="true" />
      <isModifier value="false" />
      <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="w5" />
        <map value="FiveWs.done[x]" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".performance[@typeCode &lt;= 'PPRF'].ActDefinitionOrEvent.effectiveTime" />
      </mapping>
    </element>
    <element id="OrganizationAffiliation.period.id">
      <path value="OrganizationAffiliation.period.id" />
      <representation value="xmlAttr" />
      <short value="Unique id for inter-element referencing" />
      <definition value="Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.id" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type">
          <valueUrl value="string" />
        </extension>
        <code value="http://hl7.org/fhirpath/System.String" />
      </type>
      <condition value="ele-1" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="OrganizationAffiliation.period.extension">
      <path value="OrganizationAffiliation.period.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. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can 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>
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <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()" />
        <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="OrganizationAffiliation.period.start">
      <path value="OrganizationAffiliation.period.start" />
      <short value="The moment when the affiliation becomes active" />
      <definition value="The start of the period. The boundary is inclusive." />
      <comment value="If the low element is missing, the meaning is that the low boundary is not known." />
      <min value="1" />
      <max value="1" />
      <base>
        <path value="Period.start" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="dateTime" />
      </type>
      <condition value="per-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <source value="http://hl7.org/fhir/StructureDefinition/Element" />
      </constraint>
      <mustSupport value="true" />
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="DR.1" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./low" />
      </mapping>
      <mapping>
        <identity value="HVOOrganizationAffiliationToHVOUppdragLogical" />
        <map value="giltigFrom" />
      </mapping>
    </element>
    <element id="OrganizationAffiliation.period.end">
      <path value="OrganizationAffiliation.period.end" />
      <short value="The moment when the affiliation becomes inactive or completed. Do not use if it is unknown" />
      <definition value="The end of the period. If the end of the period is missing, it means no end was known or planned at the time the instance was created. The start may be in the past, and the end date in the future, which means that period is expected/planned to end at that time." />
      <comment value="The end value includes any matching date/time. i.e. 2012-02-03T10:00:00 is in a period that has an end value of 2012-02-03." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Period.end" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="dateTime" />
      </type>
      <meaningWhenMissing value="If the end of the period is missing, it means that the period is ongoing" />
      <condition value="per-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <source value="http://hl7.org/fhir/StructureDefinition/Element" />
      </constraint>
      <mustSupport value="true" />
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="DR.2" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./high" />
      </mapping>
      <mapping>
        <identity value="HVOOrganizationAffiliationToHVOUppdragLogical" />
        <map value="giltigTom" />
      </mapping>
    </element>
    <element id="OrganizationAffiliation.organization">
      <path value="OrganizationAffiliation.organization" />
      <short value="Organization which ordered the task" />
      <definition value="Organization where the role is available (primary organization/has members)." />
      <comment value="For example, a Spotless Cleaning Services (participatingOrganization) is a supplier (code) to General Hospital (organization).   Similarly, General Hospital (participatingOrganization) is a member (code) of Eastern HIE (organization).  If there are two organizations that do not have a directional relationship, there would normally be a third organization that represents the joint partnership, and the two organizations would have a relationship to that joint Organization via two OrganizationAffiliations." />
      <min value="1" />
      <max value="1" />
      <base>
        <path value="OrganizationAffiliation.organization" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="Reference" />
        <targetProfile value="http://electronichealth.se/fhir/hvo/StructureDefinition/HVOOrganization" />
      </type>
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <source value="http://hl7.org/fhir/StructureDefinition/Element" />
      </constraint>
      <constraint>
        <key value="ref-1" />
        <severity value="error" />
        <human value="SHALL have a contained resource if a local reference is provided" />
        <expression value="reference.exists()  implies (reference.startsWith('#').not() or (reference.substring(1).trace('url') in %rootResource.contained.id.trace('ids')) or (reference='#' and %rootResource!=%resource))" />
        <source value="http://hl7.org/fhir/StructureDefinition/Reference" />
      </constraint>
      <constraint>
        <key value="ref-2" />
        <severity value="error" />
        <human value="At least one of reference, identifier and display SHALL be present (unless an extension is provided)." />
        <expression value="reference.exists() or identifier.exists() or display.exists() or extension.exists()" />
        <source value="http://hl7.org/fhir/StructureDefinition/Reference" />
      </constraint>
      <mustSupport value="true" />
      <isModifier value="false" />
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="The target of a resource reference is a RIM entry point (Act, Role, or Entity)" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".scoper" />
      </mapping>
      <mapping>
        <identity value="HVOOrganizationAffiliationToHVOUppdragLogical" />
        <map value="harBestallare(HVOOrganisationLogical)" />
      </mapping>
    </element>
    <element id="OrganizationAffiliation.participatingOrganization">
      <path value="OrganizationAffiliation.participatingOrganization" />
      <short value="Organization which performs the task" />
      <definition value="The Participating Organization provides/performs the role(s) defined by the code to the Primary Organization (e.g. providing services or is a member of)." />
      <comment value="See comments for OrganizationAffiliation.organization above." />
      <min value="1" />
      <max value="1" />
      <base>
        <path value="OrganizationAffiliation.participatingOrganization" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="Reference" />
        <targetProfile value="http://electronichealth.se/fhir/hvo/StructureDefinition/HVOOrganization" />
      </type>
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <source value="http://hl7.org/fhir/StructureDefinition/Element" />
      </constraint>
      <constraint>
        <key value="ref-1" />
        <severity value="error" />
        <human value="SHALL have a contained resource if a local reference is provided" />
        <expression value="reference.exists()  implies (reference.startsWith('#').not() or (reference.substring(1).trace('url') in %rootResource.contained.id.trace('ids')) or (reference='#' and %rootResource!=%resource))" />
        <source value="http://hl7.org/fhir/StructureDefinition/Reference" />
      </constraint>
      <constraint>
        <key value="ref-2" />
        <severity value="error" />
        <human value="At least one of reference, identifier and display SHALL be present (unless an extension is provided)." />
        <expression value="reference.exists() or identifier.exists() or display.exists() or extension.exists()" />
        <source value="http://hl7.org/fhir/StructureDefinition/Reference" />
      </constraint>
      <mustSupport value="true" />
      <isModifier value="false" />
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="The target of a resource reference is a RIM entry point (Act, Role, or Entity)" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".player" />
      </mapping>
      <mapping>
        <identity value="HVOOrganizationAffiliationToHVOUppdragLogical" />
        <map value="harUtforare(HVOOrganisationLogical)" />
      </mapping>
    </element>
    <element id="OrganizationAffiliation.network">
      <path value="OrganizationAffiliation.network" />
      <short value="The network in which the participatingOrganization provides the role's services (if defined) at the indicated locations (if defined)" />
      <definition value="The network in which the participatingOrganization provides the role's services (if defined) at the indicated locations (if defined)." />
      <comment value="e.g. Commonly used for Health Insurance provider networks." />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="OrganizationAffiliation.network" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Organization" />
      </type>
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <source value="http://hl7.org/fhir/StructureDefinition/Element" />
      </constraint>
      <constraint>
        <key value="ref-1" />
        <severity value="error" />
        <human value="SHALL have a contained resource if a local reference is provided" />
        <expression value="reference.exists()  implies (reference.startsWith('#').not() or (reference.substring(1).trace('url') in %rootResource.contained.id.trace('ids')) or (reference='#' and %rootResource!=%resource))" />
        <source value="http://hl7.org/fhir/StructureDefinition/Reference" />
      </constraint>
      <constraint>
        <key value="ref-2" />
        <severity value="error" />
        <human value="At least one of reference, identifier and display SHALL be present (unless an extension is provided)." />
        <expression value="reference.exists() or identifier.exists() or display.exists() or extension.exists()" />
        <source value="http://hl7.org/fhir/StructureDefinition/Reference" />
      </constraint>
      <mustSupport value="false" />
      <isModifier value="false" />
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="The target of a resource reference is a RIM entry point (Act, Role, or Entity)" />
      </mapping>
    </element>
    <element id="OrganizationAffiliation.code">
      <path value="OrganizationAffiliation.code" />
      <short value="Definition of the role the participatingOrganization plays" />
      <definition value="Definition of the role the participatingOrganization plays in the association." />
      <comment value="Not all terminology uses fit this general pattern. In some cases, models should not use CodeableConcept and use Coding directly and provide their own structure for managing text, codings, translations and the relationship between elements and pre- and post-coordination." />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="OrganizationAffiliation.code" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="CodeableConcept" />
      </type>
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <source value="http://hl7.org/fhir/StructureDefinition/Element" />
      </constraint>
      <mustSupport value="true" />
      <isModifier value="false" />
      <isSummary value="true" />
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="OrganizationAffiliation" />
        </extension>
        <strength value="required" />
        <description value="The role the participating organization providing services to the primary organization." />
        <valueSet value="http://electronichealth.se/hvo/ValueSet/hvo-organization-affiliation-business-category" />
      </binding>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="CE/CNE/CWE" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="CD" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:CodeableConcept rdfs:subClassOf dt:CD" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".code" />
      </mapping>
      <mapping>
        <identity value="HVOOrganizationAffiliationToHVOUppdragLogical" />
        <map value="typ" />
      </mapping>
    </element>
    <element id="OrganizationAffiliation.code.id">
      <path value="OrganizationAffiliation.code.id" />
      <representation value="xmlAttr" />
      <short value="Unique id for inter-element referencing" />
      <definition value="Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.id" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type">
          <valueUrl value="string" />
        </extension>
        <code value="http://hl7.org/fhirpath/System.String" />
      </type>
      <condition value="ele-1" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="OrganizationAffiliation.code.extension">
      <path value="OrganizationAffiliation.code.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. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can 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>
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <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()" />
        <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="OrganizationAffiliation.code.coding">
      <path value="OrganizationAffiliation.code.coding" />
      <short value="Code defined by a terminology system" />
      <definition value="A reference to a code defined by a terminology system." />
      <comment value="Codes may be defined very casually in enumerations, or code lists, up to very formal definitions such as SNOMED CT - see the HL7 v3 Core Principles for more information.  Ordering of codings is undefined and SHALL NOT be used to infer meaning. Generally, at most only one of the coding values will be labeled as UserSelected = true." />
      <requirements value="Allows for alternative encodings within a code system, and translations to other code systems." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="CodeableConcept.coding" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Coding" />
      </type>
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <source value="http://hl7.org/fhir/StructureDefinition/Element" />
      </constraint>
      <constraint>
        <key value="cod-1" />
        <severity value="warning" />
        <human value="A Coding SHOULD NOT have a display unless a code is also present.  Computation on Coding.display alone is generally unsafe.  Consider using CodeableConcept.text" />
        <expression value="code.exists().not() implies display.exists().not()" />
        <source value="http://hl7.org/fhir/StructureDefinition/Coding" />
      </constraint>
      <mustSupport value="true" />
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="CE/CNE/CWE subset one of the sets of component 1-3 or 4-6" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="CV" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding rdfs:subClassOf dt:CDCoding" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.1-8, C*E.10-22" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="union(., ./translation)" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:CodeableConcept.coding rdfs:subPropertyOf dt:CD.coding" />
      </mapping>
    </element>
    <element id="OrganizationAffiliation.code.coding.id">
      <path value="OrganizationAffiliation.code.coding.id" />
      <representation value="xmlAttr" />
      <short value="Unique id for inter-element referencing" />
      <definition value="Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.id" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type">
          <valueUrl value="string" />
        </extension>
        <code value="http://hl7.org/fhirpath/System.String" />
      </type>
      <condition value="ele-1" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="OrganizationAffiliation.code.coding.extension">
      <path value="OrganizationAffiliation.code.coding.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. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can 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>
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <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()" />
        <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="OrganizationAffiliation.code.coding.system">
      <path value="OrganizationAffiliation.code.coding.system" />
      <short value="Identity of the terminology system" />
      <definition value="The identification of the code system that defines the meaning of the symbol in the code." />
      <comment value="The URI may be an OID (urn:oid:...) or a UUID (urn:uuid:...).  OIDs and UUIDs SHALL be references to the HL7 OID registry. Otherwise, the URI should come from HL7's list of FHIR defined special URIs or it should be an absolute reference to some definition that establishes the system clearly and unambiguously." />
      <requirements value="Need to be unambiguous about the source of the definition of the symbol." />
      <min value="1" />
      <max value="1" />
      <base>
        <path value="Coding.system" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="uri" />
      </type>
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <source value="http://hl7.org/fhir/StructureDefinition/Element" />
      </constraint>
      <mustSupport value="true" />
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.3" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./codeSystem" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding.system rdfs:subPropertyOf dt:CDCoding.codeSystem" />
      </mapping>
    </element>
    <element id="OrganizationAffiliation.code.coding.version">
      <path value="OrganizationAffiliation.code.coding.version" />
      <short value="Version of the system - if relevant" />
      <definition value="The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured, and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged." />
      <comment value="Where the terminology does not clearly define what string should be used to identify code system versions, the recommendation is to use the date (expressed in FHIR date format) on which that version was officially published as the version date." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Coding.version" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <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="C*E.7" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./codeSystemVersion" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding.version rdfs:subPropertyOf dt:CDCoding.codeSystemVersion" />
      </mapping>
    </element>
    <element id="OrganizationAffiliation.code.coding.code">
      <extension url="http://hl7.org/fhir/tools/StructureDefinition/no-binding">
        <valueBoolean value="true" />
      </extension>
      <path value="OrganizationAffiliation.code.coding.code" />
      <short value="Symbol in syntax defined by the system" />
      <definition value="A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination)." />
      <comment value="Note that FHIR strings SHALL NOT exceed 1,048,576 (1024*1024) characters in size" />
      <requirements value="Need to refer to a particular code in the system." />
      <min value="1" />
      <max value="1" />
      <base>
        <path value="Coding.code" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="code" />
      </type>
      <condition value="cod-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <source value="http://hl7.org/fhir/StructureDefinition/Element" />
      </constraint>
      <mustSupport value="true" />
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.1" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./code" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding.code rdfs:subPropertyOf dt:CDCoding.code" />
      </mapping>
    </element>
    <element id="OrganizationAffiliation.code.coding.display">
      <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true" />
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true" />
      </extension>
      <path value="OrganizationAffiliation.code.coding.display" />
      <short value="Representation defined by the system" />
      <definition value="A representation of the meaning of the code in the system, following the rules of the system." />
      <comment value="Note that FHIR strings SHALL NOT exceed 1,048,576 (1024*1024) characters in size" />
      <requirements value="Need to be able to carry a human-readable meaning of the code for readers that do not know  the system." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Coding.display" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="cod-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <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="C*E.2 - but note this is not well followed" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="CV.displayName" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding.display rdfs:subPropertyOf dt:CDCoding.displayName" />
      </mapping>
    </element>
    <element id="OrganizationAffiliation.code.coding.userSelected">
      <path value="OrganizationAffiliation.code.coding.userSelected" />
      <short value="If this coding was chosen directly by the user" />
      <definition value="Indicates that this coding was chosen by a user directly - e.g. off a pick list of available items (codes or displays)." />
      <comment value="Amongst a set of alternatives, a directly chosen code is the most appropriate starting point for new translations. There is some ambiguity about what exactly 'directly chosen' implies, and trading partner agreement may be needed to clarify the use of this element and its consequences more completely." />
      <requirements value="This has been identified as a clinical safety criterium - that this exact system/code pair was chosen explicitly, rather than inferred by the system based on some rules or language processing." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Coding.userSelected" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="boolean" />
      </type>
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <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="Sometimes implied by being first" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="CD.codingRationale" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding.userSelected fhir:mapsTo dt:CDCoding.codingRationale. fhir:Coding.userSelected fhir:hasMap fhir:Coding.userSelected.map. fhir:Coding.userSelected.map a fhir:Map;   fhir:target dt:CDCoding.codingRationale. fhir:Coding.userSelected\#true a [     fhir:source &quot;true&quot;;     fhir:target dt:CDCoding.codingRationale\#O   ]" />
      </mapping>
    </element>
    <element id="OrganizationAffiliation.code.text">
      <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true" />
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true" />
      </extension>
      <path value="OrganizationAffiliation.code.text" />
      <short value="Plain text representation of the concept" />
      <definition value="A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user." />
      <comment value="Very often the text is the same as a displayName of one of the codings." />
      <requirements value="The codes from the terminologies do not always capture the correct meaning with all the nuances of the human using them, or sometimes there is no appropriate code at all. In these cases, the text is used to capture the full meaning of the source." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="CodeableConcept.text" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <source value="http://hl7.org/fhir/StructureDefinition/Element" />
      </constraint>
      <mustSupport value="true" />
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.9. But note many systems use C*E.2 for this" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./originalText[mediaType/code=&quot;text/plain&quot;]/data" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:CodeableConcept.text rdfs:subPropertyOf dt:CD.originalText" />
      </mapping>
    </element>
    <element id="OrganizationAffiliation.specialty">
      <path value="OrganizationAffiliation.specialty" />
      <short value="Specific specialty of the participatingOrganization in the context of the role" />
      <definition value="Specific specialty of the participatingOrganization in the context of the role." />
      <comment value="Not all terminology uses fit this general pattern. In some cases, models should not use CodeableConcept and use Coding directly and provide their own structure for managing text, codings, translations and the relationship between elements and pre- and post-coordination." />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="OrganizationAffiliation.specialty" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="CodeableConcept" />
      </type>
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <source value="http://hl7.org/fhir/StructureDefinition/Element" />
      </constraint>
      <mustSupport value="false" />
      <isModifier value="false" />
      <isSummary value="true" />
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="OrganizationSpecialty" />
        </extension>
        <strength value="preferred" />
        <description value="Specific specialty associated with the participating organization." />
        <valueSet value="http://hl7.org/fhir/ValueSet/c80-practice-codes" />
      </binding>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="CE/CNE/CWE" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="CD" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:CodeableConcept rdfs:subClassOf dt:CD" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".player.HealthCareProvider[@classCode = 'PROV'].code" />
      </mapping>
    </element>
    <element id="OrganizationAffiliation.location">
      <path value="OrganizationAffiliation.location" />
      <short value="The location(s) at which the role occurs" />
      <definition value="The location(s) at which the role occurs." />
      <comment value="References SHALL be a reference to an actual FHIR resource, and SHALL be resolvable (allowing for access control, temporary unavailability, etc.). Resolution can be either by retrieval from the URL, or, where applicable by resource type, by treating an absolute reference as a canonical URL and looking it up in a local registry/repository." />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="OrganizationAffiliation.location" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Location" />
      </type>
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <source value="http://hl7.org/fhir/StructureDefinition/Element" />
      </constraint>
      <constraint>
        <key value="ref-1" />
        <severity value="error" />
        <human value="SHALL have a contained resource if a local reference is provided" />
        <expression value="reference.exists()  implies (reference.startsWith('#').not() or (reference.substring(1).trace('url') in %rootResource.contained.id.trace('ids')) or (reference='#' and %rootResource!=%resource))" />
        <source value="http://hl7.org/fhir/StructureDefinition/Reference" />
      </constraint>
      <constraint>
        <key value="ref-2" />
        <severity value="error" />
        <human value="At least one of reference, identifier and display SHALL be present (unless an extension is provided)." />
        <expression value="reference.exists() or identifier.exists() or display.exists() or extension.exists()" />
        <source value="http://hl7.org/fhir/StructureDefinition/Reference" />
      </constraint>
      <mustSupport value="false" />
      <isModifier value="false" />
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="The target of a resource reference is a RIM entry point (Act, Role, or Entity)" />
      </mapping>
      <mapping>
        <identity value="w5" />
        <map value="FiveWs.where[x]" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".performance.ActDefinitionOrEvent.ServiceDeliveryLocation[@classCode = 'SDLOC']" />
      </mapping>
    </element>
    <element id="OrganizationAffiliation.healthcareService">
      <path value="OrganizationAffiliation.healthcareService" />
      <short value="Healthcare services provided through the role" />
      <definition value="Healthcare services provided through the role." />
      <comment value="References SHALL be a reference to an actual FHIR resource, and SHALL be resolvable (allowing for access control, temporary unavailability, etc.). Resolution can be either by retrieval from the URL, or, where applicable by resource type, by treating an absolute reference as a canonical URL and looking it up in a local registry/repository." />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="OrganizationAffiliation.healthcareService" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Reference" />
        <targetProfile value="http://electronichealth.se/fhir/hvo/StructureDefinition/HVOService" />
      </type>
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <source value="http://hl7.org/fhir/StructureDefinition/Element" />
      </constraint>
      <constraint>
        <key value="ref-1" />
        <severity value="error" />
        <human value="SHALL have a contained resource if a local reference is provided" />
        <expression value="reference.exists()  implies (reference.startsWith('#').not() or (reference.substring(1).trace('url') in %rootResource.contained.id.trace('ids')) or (reference='#' and %rootResource!=%resource))" />
        <source value="http://hl7.org/fhir/StructureDefinition/Reference" />
      </constraint>
      <constraint>
        <key value="ref-2" />
        <severity value="error" />
        <human value="At least one of reference, identifier and display SHALL be present (unless an extension is provided)." />
        <expression value="reference.exists() or identifier.exists() or display.exists() or extension.exists()" />
        <source value="http://hl7.org/fhir/StructureDefinition/Reference" />
      </constraint>
      <mustSupport value="true" />
      <isModifier value="false" />
      <isSummary value="false" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="The target of a resource reference is a RIM entry point (Act, Role, or Entity)" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".player.QualifiedEntity[@classCode = 'QUAL'].code" />
      </mapping>
      <mapping>
        <identity value="HVOOrganizationAffiliationToHVOUppdragLogical" />
        <map value="omfattar(HVOTjanstLogical)" />
      </mapping>
    </element>
    <element id="OrganizationAffiliation.contact">
      <path value="OrganizationAffiliation.contact" />
      <short value="Official contact details at the participatingOrganization relevant to this Affiliation" />
      <definition value="The contact details of communication devices available at the participatingOrganization relevant to this Affiliation." />
      <comment value="This datatype may be sparsely populated, i.e. only contain a purpose and phone number or address, but other cases could be completed filled out." />
      <requirements value="Sometimes a participating organization provides dedicated contacts to handle enquiries specifically for the role provided to the affiliated organization." />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="OrganizationAffiliation.contact" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="ExtendedContactDetail" />
      </type>
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <source value="http://hl7.org/fhir/StructureDefinition/Element" />
      </constraint>
      <constraint>
        <key value="org-4" />
        <severity value="error" />
        <human value="The address of an organization can never be of use 'home'" />
        <expression value="address.where(use = 'home').empty()" />
        <source value="http://hl7.org/fhir/StructureDefinition/OrganizationAffiliation" />
      </constraint>
      <constraint>
        <key value="org-3" />
        <severity value="error" />
        <human value="The telecom of an organization can never be of use 'home'" />
        <expression value="telecom.where(use = 'home').empty()" />
        <source value="http://hl7.org/fhir/StructureDefinition/OrganizationAffiliation" />
      </constraint>
      <mustSupport value="true" />
      <isModifier value="false" />
      <isSummary value="false" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".contactParty" />
      </mapping>
    </element>
    <element id="OrganizationAffiliation.contact.id">
      <path value="OrganizationAffiliation.contact.id" />
      <representation value="xmlAttr" />
      <short value="Unique id for inter-element referencing" />
      <definition value="Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.id" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type">
          <valueUrl value="string" />
        </extension>
        <code value="http://hl7.org/fhirpath/System.String" />
      </type>
      <condition value="ele-1" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="OrganizationAffiliation.contact.extension">
      <path value="OrganizationAffiliation.contact.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. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can 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>
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <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()" />
        <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="OrganizationAffiliation.contact.purpose">
      <path value="OrganizationAffiliation.contact.purpose" />
      <short value="The type of contact" />
      <definition value="The purpose/type of contact." />
      <comment value="If no purpose is defined, then these contact details may be used for any purpose." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="ExtendedContactDetail.purpose" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="CodeableConcept" />
      </type>
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <source value="http://hl7.org/fhir/StructureDefinition/Element" />
      </constraint>
      <isSummary value="true" />
      <binding>
        <extension url="http://hl7.org/fhir/tools/StructureDefinition/binding-definition">
          <valueString value="The purpose for which an extended contact detail should be used." />
        </extension>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="Purpose" />
        </extension>
        <strength value="preferred" />
        <description value="The purpose for which an extended contact detail should be used." />
        <valueSet value="http://terminology.hl7.org/ValueSet/contactentity-type" />
      </binding>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="CE/CNE/CWE" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="CD" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:CodeableConcept rdfs:subClassOf dt:CD" />
      </mapping>
    </element>
    <element id="OrganizationAffiliation.contact.name">
      <path value="OrganizationAffiliation.contact.name" />
      <short value="Name of an individual to contact" />
      <definition value="The name of an individual to contact, some types of contact detail are usually blank." />
      <comment value="If there is no named individual, the telecom/address information is not generally monitored by a specific individual." />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="ExtendedContactDetail.name" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="HumanName" />
      </type>
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <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="XPN" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="EN (actually, PN)" />
      </mapping>
      <mapping>
        <identity value="servd" />
        <map value="ProviderName" />
      </mapping>
    </element>
    <element id="OrganizationAffiliation.contact.telecom">
      <path value="OrganizationAffiliation.contact.telecom" />
      <short value="Contact details (e.g.phone/fax/url)" />
      <definition value="The contact details application for the purpose defined." />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="ExtendedContactDetail.telecom" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="ContactPoint" />
      </type>
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <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()" />
        <source value="http://hl7.org/fhir/StructureDefinition/ContactPoint" />
      </constraint>
      <constraint>
        <key value="hvo-telecom-phone-2" />
        <severity value="warning" />
        <human value="If telecom.system = phone or fax, value should have max length of 32 characters" />
        <expression value="value.length() &lt;= 32 or (system != 'phone' and system != 'fax')" />
        <source value="http://electronichealth.se/fhir/hvo/StructureDefinition/HVOOrganizationAffiliation" />
      </constraint>
      <constraint>
        <key value="hvo-telecom-email-2" />
        <severity value="warning" />
        <human value="If telecom.system = email, value should have max length of 255 characters" />
        <expression value="value.length() &lt;= 255 or system != 'email'" />
        <source value="http://electronichealth.se/fhir/hvo/StructureDefinition/HVOOrganizationAffiliation" />
      </constraint>
      <constraint>
        <key value="hvo-telecom-url-1" />
        <severity value="warning" />
        <human value="If telecom.system = url, value should follow valid format. Example: https://example.com" />
        <expression value="value.matches('(https?|ftp)://(-\\.)?([^\\s/?\\.#-]+\\.?)+(/[^\\s]*)?$') or system != 'url'" />
        <source value="http://electronichealth.se/fhir/hvo/StructureDefinition/HVOOrganizationAffiliation" />
      </constraint>
      <constraint>
        <key value="hvo-telecom-url-2" />
        <severity value="warning" />
        <human value="If telecom.system = url, value should have max length of 2000 characters" />
        <expression value="value.length() &lt;= 2000 or system != 'url'" />
        <source value="http://electronichealth.se/fhir/hvo/StructureDefinition/HVOOrganizationAffiliation" />
      </constraint>
      <constraint>
        <key value="hvo-telecom-email-1" />
        <severity value="warning" />
        <human value="If telecom.system = email, value should follow valid format Example: test@test.com" />
        <expression value="value.matches('^[\\w.-]{1,64}@(?!.{254})[\\w.-]+\\.[A-Za-z]{2,4}$') or system != 'email'" />
        <source value="http://electronichealth.se/fhir/hvo/StructureDefinition/HVOOrganizationAffiliation" />
      </constraint>
      <constraint>
        <key value="hvo-telecom-phone-1" />
        <severity value="warning" />
        <human value="If telecom.system = phone or fax, value should follow format +46123456789" />
        <expression value="value.matches('^\\+[1-9][0-9]+$') or (system != 'phone' and system != 'fax')" />
        <source value="http://electronichealth.se/fhir/hvo/StructureDefinition/HVOOrganizationAffiliation" />
      </constraint>
      <mustSupport value="true" />
      <isSummary value="true" />
      <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>
      <mapping>
        <identity value="HVOOrganizationAffiliationToHVOUppdragLogical" />
        <map value="har(HVOTelekommunikationLogical)" />
      </mapping>
    </element>
    <element id="OrganizationAffiliation.contact.telecom.id">
      <path value="OrganizationAffiliation.contact.telecom.id" />
      <representation value="xmlAttr" />
      <short value="Unique id for inter-element referencing" />
      <definition value="Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.id" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type">
          <valueUrl value="string" />
        </extension>
        <code value="http://hl7.org/fhirpath/System.String" />
      </type>
      <condition value="ele-1" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="OrganizationAffiliation.contact.telecom.extension">
      <path value="OrganizationAffiliation.contact.telecom.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. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can 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>
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <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()" />
        <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="OrganizationAffiliation.contact.telecom.system">
      <path value="OrganizationAffiliation.contact.telecom.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 SHALL NOT exceed 1,048,576 (1024*1024) characters 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>
      <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() or (children().count() &gt; id.count())" />
        <source value="http://hl7.org/fhir/StructureDefinition/Element" />
      </constraint>
      <mustSupport value="true" />
      <isSummary value="true" />
      <binding>
        <extension url="http://hl7.org/fhir/tools/StructureDefinition/binding-definition">
          <valueString value="Telecommunications form for contact point." />
        </extension>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="ContactPointSystem" />
        </extension>
        <strength value="required" />
        <description value="Telecommunications form for contact point." />
        <valueSet value="http://hl7.org/fhir/ValueSet/contact-point-system" />
      </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="OrganizationAffiliation.contact.telecom.value">
      <path value="OrganizationAffiliation.contact.telecom.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="cpt-2" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <source value="http://hl7.org/fhir/StructureDefinition/Element" />
      </constraint>
      <constraint>
        <key value="hvo-telecom-value-1" />
        <severity value="warning" />
        <human value="A telecom value should have max length of 2000 characters" />
        <expression value="$this.length() &lt;= 2000" />
        <source value="http://electronichealth.se/fhir/hvo/StructureDefinition/HVOOrganizationAffiliation" />
      </constraint>
      <mustSupport value="true" />
      <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="OrganizationAffiliation.contact.telecom.use">
      <path value="OrganizationAffiliation.contact.telecom.use" />
      <short value="home | work | temp | old | mobile - purpose of this contact point" />
      <definition value="Identifies the purpose for the contact point." />
      <comment value="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="0" />
      <max value="1" />
      <base>
        <path value="ContactPoint.use" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="code" />
      </type>
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <source value="http://hl7.org/fhir/StructureDefinition/Element" />
      </constraint>
      <isModifier value="true" />
      <isModifierReason 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" />
      <isSummary value="true" />
      <binding>
        <extension url="http://hl7.org/fhir/tools/StructureDefinition/binding-definition">
          <valueString value="Use of contact point." />
        </extension>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="ContactPointUse" />
        </extension>
        <strength value="required" />
        <description value="Use of contact point." />
        <valueSet value="http://hl7.org/fhir/ValueSet/contact-point-use|5.0.0" />
      </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="OrganizationAffiliation.contact.telecom.rank">
      <path value="OrganizationAffiliation.contact.telecom.rank" />
      <short value="Specify preferred order of use (1 = highest)" />
      <definition value="Specifies a preferred order in which to use a set of contacts. ContactPoints with lower rank values are more preferred than those with higher rank values." />
      <comment value="Note that rank does not necessarily follow the order in which the contacts are represented in the instance.&#xA;&#xA;Ranks need not be unique.  E.g. it's possible to have multiple contacts with rank=1.  If the ranks have different systems or uses, this would be interpreted to mean &quot;X is my most preferred phone number, Y is my most preferred email address&quot; or &quot;X is my preferred home email and Y is my preferred work email&quot;.  If the system and use for equally-ranked contacts are the same, then the level of preference is equivalent for both repetitions. &#xA;&#xA;Ranks need not be sequential and not all repetitions must have a rank.  For example, it's possible to have 4 contacts with ranks of 2, 5 and two with no rank specified.  That would be interpreted to mean the first is preferred over the second and no preference stated for the remaining contacts." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="ContactPoint.rank" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="positiveInt" />
      </type>
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <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="OrganizationAffiliation.contact.telecom.period">
      <path value="OrganizationAffiliation.contact.telecom.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="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;).&#xA;&#xA;Period is not used for a duration (a measure of elapsed time). See [Duration](datatypes.html#Duration)." />
      <min value="1" />
      <max value="1" />
      <base>
        <path value="ContactPoint.period" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="Period" />
      </type>
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <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 or equal value than end" />
        <expression value="start.hasValue().not() or end.hasValue().not() or (start.lowBoundary() &lt;= end.highBoundary())" />
        <source value="http://hl7.org/fhir/StructureDefinition/Period" />
      </constraint>
      <mustSupport value="true" />
      <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>
    <element id="OrganizationAffiliation.contact.telecom.period.id">
      <path value="OrganizationAffiliation.contact.telecom.period.id" />
      <representation value="xmlAttr" />
      <short value="Unique id for inter-element referencing" />
      <definition value="Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.id" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type">
          <valueUrl value="string" />
        </extension>
        <code value="http://hl7.org/fhirpath/System.String" />
      </type>
      <condition value="ele-1" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="OrganizationAffiliation.contact.telecom.period.extension">
      <path value="OrganizationAffiliation.contact.telecom.period.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. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can 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>
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <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()" />
        <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="OrganizationAffiliation.contact.telecom.period.start">
      <path value="OrganizationAffiliation.contact.telecom.period.start" />
      <short value="Starting time with inclusive boundary" />
      <definition value="The start of the period. The boundary is inclusive." />
      <comment value="If the low element is missing, the meaning is that the low boundary is not known." />
      <min value="1" />
      <max value="1" />
      <base>
        <path value="Period.start" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="dateTime" />
      </type>
      <condition value="per-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <source value="http://hl7.org/fhir/StructureDefinition/Element" />
      </constraint>
      <mustSupport value="true" />
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="DR.1" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./low" />
      </mapping>
    </element>
    <element id="OrganizationAffiliation.contact.telecom.period.end">
      <path value="OrganizationAffiliation.contact.telecom.period.end" />
      <short value="End time with inclusive boundary, if not ongoing" />
      <definition value="The end of the period. If the end of the period is missing, it means no end was known or planned at the time the instance was created. The start may be in the past, and the end date in the future, which means that period is expected/planned to end at that time." />
      <comment value="The end value includes any matching date/time. i.e. 2012-02-03T10:00:00 is in a period that has an end value of 2012-02-03." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Period.end" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="dateTime" />
      </type>
      <meaningWhenMissing value="If the end of the period is missing, it means that the period is ongoing" />
      <condition value="per-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <source value="http://hl7.org/fhir/StructureDefinition/Element" />
      </constraint>
      <mustSupport value="true" />
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="DR.2" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./high" />
      </mapping>
    </element>
    <element id="OrganizationAffiliation.contact.address">
      <path value="OrganizationAffiliation.contact.address" />
      <short value="Address for the contact" />
      <definition value="Address for the contact." />
      <comment value="More than 1 address would be for different purposes, and thus should be entered as a different entry,." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="ExtendedContactDetail.address" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="Address" />
      </type>
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <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="XAD" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="AD" />
      </mapping>
      <mapping>
        <identity value="servd" />
        <map value="Address" />
      </mapping>
    </element>
    <element id="OrganizationAffiliation.contact.organization">
      <path value="OrganizationAffiliation.contact.organization" />
      <short value="This contact detail is handled/monitored by a specific organization" />
      <definition value="This contact detail is handled/monitored by a specific organization. If the name is provided in the contact, then it is referring to the named individual within this organization." />
      <comment value="References SHALL be a reference to an actual FHIR resource, and SHALL be resolvable (allowing for access control, temporary unavailability, etc.). Resolution can be either by retrieval from the URL, or, where applicable by resource type, by treating an absolute reference as a canonical URL and looking it up in a local registry/repository." />
      <requirements value="Some specific types of contact information can be an handled by an organization (eg legal council is via a specific firm)." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="ExtendedContactDetail.organization" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Organization" />
      </type>
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <source value="http://hl7.org/fhir/StructureDefinition/Element" />
      </constraint>
      <constraint>
        <key value="ref-1" />
        <severity value="error" />
        <human value="SHALL have a contained resource if a local reference is provided" />
        <expression value="reference.exists()  implies (reference.startsWith('#').not() or (reference.substring(1).trace('url') in %rootResource.contained.id.trace('ids')) or (reference='#' and %rootResource!=%resource))" />
        <source value="http://hl7.org/fhir/StructureDefinition/Reference" />
      </constraint>
      <constraint>
        <key value="ref-2" />
        <severity value="error" />
        <human value="At least one of reference, identifier and display SHALL be present (unless an extension is provided)." />
        <expression value="reference.exists() or identifier.exists() or display.exists() or extension.exists()" />
        <source value="http://hl7.org/fhir/StructureDefinition/Reference" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="The target of a resource reference is a RIM entry point (Act, Role, or Entity)" />
      </mapping>
    </element>
    <element id="OrganizationAffiliation.contact.period">
      <path value="OrganizationAffiliation.contact.period" />
      <short value="Period that this contact was valid for usage" />
      <definition value="Period that this contact was valid for usage." />
      <comment value="If the details have multiple periods, then enter in a new ExtendedContact with the new period." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="ExtendedContactDetail.period" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="Period" />
      </type>
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <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 or equal value than end" />
        <expression value="start.hasValue().not() or end.hasValue().not() or (start.lowBoundary() &lt;= end.highBoundary())" />
        <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>
    </element>
    <element id="OrganizationAffiliation.endpoint">
      <path value="OrganizationAffiliation.endpoint" />
      <short value="Technical endpoints providing access to services operated for this role" />
      <definition value="Technical endpoints providing access to services operated for this role." />
      <comment value="References SHALL be a reference to an actual FHIR resource, and SHALL be resolvable (allowing for access control, temporary unavailability, etc.). Resolution can be either by retrieval from the URL, or, where applicable by resource type, by treating an absolute reference as a canonical URL and looking it up in a local registry/repository." />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="OrganizationAffiliation.endpoint" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Endpoint" />
      </type>
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <source value="http://hl7.org/fhir/StructureDefinition/Element" />
      </constraint>
      <constraint>
        <key value="ref-1" />
        <severity value="error" />
        <human value="SHALL have a contained resource if a local reference is provided" />
        <expression value="reference.exists()  implies (reference.startsWith('#').not() or (reference.substring(1).trace('url') in %rootResource.contained.id.trace('ids')) or (reference='#' and %rootResource!=%resource))" />
        <source value="http://hl7.org/fhir/StructureDefinition/Reference" />
      </constraint>
      <constraint>
        <key value="ref-2" />
        <severity value="error" />
        <human value="At least one of reference, identifier and display SHALL be present (unless an extension is provided)." />
        <expression value="reference.exists() or identifier.exists() or display.exists() or extension.exists()" />
        <source value="http://hl7.org/fhir/StructureDefinition/Reference" />
      </constraint>
      <mustSupport value="false" />
      <isModifier value="false" />
      <isSummary value="false" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="The target of a resource reference is a RIM entry point (Act, Role, or Entity)" />
      </mapping>
    </element>
  </snapshot>
  <differential>
    <element id="OrganizationAffiliation.id">
      <path value="OrganizationAffiliation.id" />
      <mustSupport value="true" />
    </element>
    <element id="OrganizationAffiliation.period">
      <path value="OrganizationAffiliation.period" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="OrganizationAffiliation.period.start">
      <path value="OrganizationAffiliation.period.start" />
      <short value="The moment when the affiliation becomes active" />
      <min value="1" />
      <mustSupport value="true" />
      <mapping>
        <identity value="HVOOrganizationAffiliationToHVOUppdragLogical" />
        <map value="giltigFrom" />
      </mapping>
    </element>
    <element id="OrganizationAffiliation.period.end">
      <path value="OrganizationAffiliation.period.end" />
      <short value="The moment when the affiliation becomes inactive or completed. Do not use if it is unknown" />
      <mustSupport value="true" />
      <mapping>
        <identity value="HVOOrganizationAffiliationToHVOUppdragLogical" />
        <map value="giltigTom" />
      </mapping>
    </element>
    <element id="OrganizationAffiliation.organization">
      <path value="OrganizationAffiliation.organization" />
      <short value="Organization which ordered the task" />
      <min value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://electronichealth.se/fhir/hvo/StructureDefinition/HVOOrganization" />
      </type>
      <mustSupport value="true" />
      <mapping>
        <identity value="HVOOrganizationAffiliationToHVOUppdragLogical" />
        <map value="harBestallare(HVOOrganisationLogical)" />
      </mapping>
    </element>
    <element id="OrganizationAffiliation.participatingOrganization">
      <path value="OrganizationAffiliation.participatingOrganization" />
      <short value="Organization which performs the task" />
      <min value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://electronichealth.se/fhir/hvo/StructureDefinition/HVOOrganization" />
      </type>
      <mustSupport value="true" />
      <mapping>
        <identity value="HVOOrganizationAffiliationToHVOUppdragLogical" />
        <map value="harUtforare(HVOOrganisationLogical)" />
      </mapping>
    </element>
    <element id="OrganizationAffiliation.code">
      <path value="OrganizationAffiliation.code" />
      <mustSupport value="true" />
      <binding>
        <strength value="required" />
        <valueSet value="http://electronichealth.se/hvo/ValueSet/hvo-organization-affiliation-business-category" />
      </binding>
      <mapping>
        <identity value="HVOOrganizationAffiliationToHVOUppdragLogical" />
        <map value="typ" />
      </mapping>
    </element>
    <element id="OrganizationAffiliation.code.coding">
      <path value="OrganizationAffiliation.code.coding" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="OrganizationAffiliation.code.coding.system">
      <path value="OrganizationAffiliation.code.coding.system" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="OrganizationAffiliation.code.coding.code">
      <path value="OrganizationAffiliation.code.coding.code" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="OrganizationAffiliation.code.text">
      <path value="OrganizationAffiliation.code.text" />
      <mustSupport value="true" />
    </element>
    <element id="OrganizationAffiliation.healthcareService">
      <path value="OrganizationAffiliation.healthcareService" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://electronichealth.se/fhir/hvo/StructureDefinition/HVOService" />
      </type>
      <mustSupport value="true" />
      <mapping>
        <identity value="HVOOrganizationAffiliationToHVOUppdragLogical" />
        <map value="omfattar(HVOTjanstLogical)" />
      </mapping>
    </element>
    <element id="OrganizationAffiliation.contact">
      <path value="OrganizationAffiliation.contact" />
      <mustSupport value="true" />
    </element>
    <element id="OrganizationAffiliation.contact.telecom">
      <path value="OrganizationAffiliation.contact.telecom" />
      <constraint>
        <key value="hvo-telecom-phone-2" />
        <severity value="warning" />
        <human value="If telecom.system = phone or fax, value should have max length of 32 characters" />
        <expression value="value.length() &lt;= 32 or (system != 'phone' and system != 'fax')" />
        <source value="http://electronichealth.se/fhir/hvo/StructureDefinition/HVOOrganizationAffiliation" />
      </constraint>
      <constraint>
        <key value="hvo-telecom-email-2" />
        <severity value="warning" />
        <human value="If telecom.system = email, value should have max length of 255 characters" />
        <expression value="value.length() &lt;= 255 or system != 'email'" />
        <source value="http://electronichealth.se/fhir/hvo/StructureDefinition/HVOOrganizationAffiliation" />
      </constraint>
      <constraint>
        <key value="hvo-telecom-url-1" />
        <severity value="warning" />
        <human value="If telecom.system = url, value should follow valid format. Example: https://example.com" />
        <expression value="value.matches('(https?|ftp)://(-\\.)?([^\\s/?\\.#-]+\\.?)+(/[^\\s]*)?$') or system != 'url'" />
        <source value="http://electronichealth.se/fhir/hvo/StructureDefinition/HVOOrganizationAffiliation" />
      </constraint>
      <constraint>
        <key value="hvo-telecom-url-2" />
        <severity value="warning" />
        <human value="If telecom.system = url, value should have max length of 2000 characters" />
        <expression value="value.length() &lt;= 2000 or system != 'url'" />
        <source value="http://electronichealth.se/fhir/hvo/StructureDefinition/HVOOrganizationAffiliation" />
      </constraint>
      <constraint>
        <key value="hvo-telecom-email-1" />
        <severity value="warning" />
        <human value="If telecom.system = email, value should follow valid format Example: test@test.com" />
        <expression value="value.matches('^[\\w.-]{1,64}@(?!.{254})[\\w.-]+\\.[A-Za-z]{2,4}$') or system != 'email'" />
        <source value="http://electronichealth.se/fhir/hvo/StructureDefinition/HVOOrganizationAffiliation" />
      </constraint>
      <constraint>
        <key value="hvo-telecom-phone-1" />
        <severity value="warning" />
        <human value="If telecom.system = phone or fax, value should follow format +46123456789" />
        <expression value="value.matches('^\\+[1-9][0-9]+$') or (system != 'phone' and system != 'fax')" />
        <source value="http://electronichealth.se/fhir/hvo/StructureDefinition/HVOOrganizationAffiliation" />
      </constraint>
      <mustSupport value="true" />
      <mapping>
        <identity value="HVOOrganizationAffiliationToHVOUppdragLogical" />
        <map value="har(HVOTelekommunikationLogical)" />
      </mapping>
    </element>
    <element id="OrganizationAffiliation.contact.telecom.system">
      <path value="OrganizationAffiliation.contact.telecom.system" />
      <min value="1" />
      <mustSupport value="true" />
      <binding>
        <strength value="required" />
        <valueSet value="http://hl7.org/fhir/ValueSet/contact-point-system" />
      </binding>
    </element>
    <element id="OrganizationAffiliation.contact.telecom.value">
      <path value="OrganizationAffiliation.contact.telecom.value" />
      <min value="1" />
      <constraint>
        <key value="hvo-telecom-value-1" />
        <severity value="warning" />
        <human value="A telecom value should have max length of 2000 characters" />
        <expression value="$this.length() &lt;= 2000" />
        <source value="http://electronichealth.se/fhir/hvo/StructureDefinition/HVOOrganizationAffiliation" />
      </constraint>
      <mustSupport value="true" />
    </element>
    <element id="OrganizationAffiliation.contact.telecom.period">
      <path value="OrganizationAffiliation.contact.telecom.period" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="OrganizationAffiliation.contact.telecom.period.start">
      <path value="OrganizationAffiliation.contact.telecom.period.start" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="OrganizationAffiliation.contact.telecom.period.end">
      <path value="OrganizationAffiliation.contact.telecom.period.end" />
      <mustSupport value="true" />
    </element>
  </differential>
</StructureDefinition>