Trillium II Implementation Guide Implementation Guide CI Build

Publish Box goes here

XML Format: StructureDefinition-Encounter-uv-trillium2

Raw xml


<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="Encounter-uv-trillium2"/>
  <text>
    <status value="generated"/>
    <div xmlns="http://www.w3.org/1999/xhtml">This profile represents the constraints applied to the Encounter resource by the Trillium II project based on FHIR STU3.</div>
  </text>
  <url
       value="http://hl7.eu/fhir/trillium2/StructureDefinition/Encounter-uv-trillium2"/>
  <version value="0.1.0"/>
  <name value="Encounter-uv-trillium2"/>
  <title value="Encounter (Trillium II)"/>
  <status value="draft"/>
  <date value="2019-07-02T16:44:00+02:00"/>
  <publisher value="Trillium II Project"/>
  <description
               value="This profile represents the constraints applied to the Encounter resource by the Trillium II project based on FHIR STU3."/>
  <jurisdiction>
    <coding>
      <system value="http://unstats.un.org/unsd/methods/m49/m49.htm"/>
      <code value="001"/>
      <display value="World"/>
    </coding>
  </jurisdiction>
  <fhirVersion value="3.0.1"/>
  <mapping>
    <identity value="rim"/>
    <uri value="http://hl7.org/v3"/>
    <name value="RIM Mapping"/>
  </mapping>
  <mapping>
    <identity value="w5"/>
    <uri value="http://hl7.org/fhir/w5"/>
    <name value="W5 Mapping"/>
  </mapping>
  <mapping>
    <identity value="v2"/>
    <uri value="http://hl7.org/v2"/>
    <name value="HL7 v2 Mapping"/>
  </mapping>
  <kind value="resource"/>
  <abstract value="false"/>
  <type value="Encounter"/>
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Encounter"/>
  <derivation value="constraint"/>
  <snapshot>
    <element id="Encounter">
      <path value="Encounter"/>
      <short
             value="An interaction during which services are provided to the patient"/>
      <definition
                  value="An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient."/>
      <alias value="Visit"/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="Encounter"/>
        <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()"/>
        <xpath value="not(parent::f:contained and f:contained)"/>
        <source value="DomainResource"/>
      </constraint>
      <constraint>
        <key value="dom-1"/>
        <severity value="error"/>
        <human
               value="If the resource is contained in another resource, it SHALL NOT contain any narrative"/>
        <expression value="contained.text.empty()"/>
        <xpath value="not(parent::f:contained and f:text)"/>
        <source value="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()"/>
        <xpath
               value="not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))"/>
        <source value="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"/>
        <expression
                    value="contained.where((&#39;#&#39;+id in %resource.descendants().reference).not()).empty()"/>
        <xpath
               value="not(exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat(&#39;#&#39;, $id))]))"/>
        <source value="DomainResource"/>
      </constraint>
      <mustSupport value="true"/>
      <mapping>
        <identity value="rim"/>
        <map value="Entity. Role, or Act"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map value="Encounter[@moodCode=&#39;EVN&#39;]"/>
      </mapping>
      <mapping>
        <identity value="w5"/>
        <map value="workflow.encounter"/>
      </mapping>
    </element>
    <element id="Encounter.id">
      <path value="Encounter.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="The only time that a resource does not have an id is when it is being submitted to the server using a create operation."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Resource.id"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="id"/>
      </type>
      <mustSupport value="true"/>
      <isSummary value="true"/>
    </element>
    <element id="Encounter.meta">
      <path value="Encounter.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 may 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>
      <mustSupport value="true"/>
      <isSummary value="true"/>
    </element>
    <element id="Encounter.meta.id">
      <path value="Encounter.meta.id"/>
      <representation value="xmlAttr"/>
      <short value="xml:id (or equivalent in JSON)"/>
      <definition
                  value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Element.id"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="string"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element id="Encounter.meta.extension">
      <path value="Encounter.meta.extension"/>
      <slicing>
        <discriminator>
          <type value="value"/>
          <path value="url"/>
        </discriminator>
        <description value="Extensions are always sliced by (at least) url"/>
        <rules value="open"/>
      </slicing>
      <short value="Additional Content defined by implementations"/>
      <definition
                  value="May be used to represent additional information that is not part of the basic definition of the element. In order to make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."/>
      <comment
               value="There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone."/>
      <alias value="extensions"/>
      <alias value="user content"/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="Element.extension"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Extension"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element id="Encounter.meta.versionId">
      <path value="Encounter.meta.versionId"/>
      <short value="Version specific identifier"/>
      <definition
                  value="The version specific identifier, as it appears in the version portion of the URL. This values changes when the resource is created, updated, or deleted."/>
      <comment
               value="The server assigns this value, and ignores what the client specifies, except in the case that the server is imposing version integrity on updates/deletes."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Meta.versionId"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="id"/>
      </type>
      <isSummary value="true"/>
    </element>
    <element id="Encounter.meta.lastUpdated">
      <path value="Encounter.meta.lastUpdated"/>
      <short value="When the resource version last changed"/>
      <definition
                  value="When the resource last changed - e.g. when the version changed."/>
      <comment
               value="This value is always populated except when the resource is first being created. The server / resource manager sets this value; what a client provides is irrelevant."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Meta.lastUpdated"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="instant"/>
      </type>
      <isSummary value="true"/>
    </element>
    <element id="Encounter.meta.profile">
      <path value="Encounter.meta.profile"/>
      <short value="Profiles this resource claims to conform to"/>
      <definition
                  value="A list of profiles (references to [StructureDefinition](http://hl7.org/fhir/STU3/structuredefinition.html#) resources) that this resource claims to conform to. The URL is a reference to [StructureDefinition.url](http://hl7.org/fhir/STU3/)."/>
      <comment
               value="It is up to the server and/or other infrastructure of policy to determine whether/how these claims are verified and/or updated over time.  The list of profile URLs is a set."/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="Meta.profile"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="uri"/>
      </type>
      <mustSupport value="true"/>
      <isSummary value="true"/>
    </element>
    <element id="Encounter.meta.security">
      <path value="Encounter.meta.security"/>
      <short value="Security Labels applied to this resource"/>
      <definition
                  value="Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure."/>
      <comment
               value="The security labels can be updated without changing the stated version of the resource  The list of security labels is a set. Uniqueness is based the system/code, and version and display are ignored."/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="Meta.security"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Coding"/>
      </type>
      <isSummary value="true"/>
      <binding>
        <extension
                   url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="SecurityLabels"/>
        </extension>
        <extension
                   url="http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding">
          <valueBoolean value="true"/>
        </extension>
        <strength value="extensible"/>
        <description
                     value="Security Labels from the Healthcare Privacy and Security Classification System."/>
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/security-labels"/>
        </valueSetReference>
      </binding>
    </element>
    <element id="Encounter.meta.tag">
      <path value="Encounter.meta.tag"/>
      <short value="Tags applied to this resource"/>
      <definition
                  value="Tags applied to this resource. Tags are intended to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource."/>
      <comment
               value="The tags can be updated without changing the stated version of the resource.  The list of tags is a set. Uniqueness is based the system/code, and version and display are ignored."/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="Meta.tag"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Coding"/>
      </type>
      <isSummary value="true"/>
      <binding>
        <extension
                   url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="Tags"/>
        </extension>
        <strength value="example"/>
        <description
                     value="Codes that represent various types of tags, commonly workflow-related; e.g. &quot;Needs review by Dr. Jones&quot;"/>
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/common-tags"/>
        </valueSetReference>
      </binding>
    </element>
    <element id="Encounter.implicitRules">
      <path value="Encounter.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."/>
      <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. 

This element is labelled as a modifier because the implicit rules may provide additional knowledge about the resource that modifies it&#39;s meaning or interpretation."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Resource.implicitRules"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="uri"/>
      </type>
      <isModifier value="true"/>
      <isSummary value="true"/>
    </element>
    <element id="Encounter.language">
      <path value="Encounter.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>
      <binding>
        <extension
                   url="http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet">
          <valueReference>
            <reference value="http://hl7.org/fhir/ValueSet/all-languages"/>
          </valueReference>
        </extension>
        <extension
                   url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="Language"/>
        </extension>
        <extension
                   url="http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding">
          <valueBoolean value="true"/>
        </extension>
        <strength value="extensible"/>
        <description value="A human language."/>
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/languages"/>
        </valueSetReference>
      </binding>
    </element>
    <element id="Encounter.text">
      <path value="Encounter.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 may 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 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 in formation 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-1"/>
      <mustSupport value="true"/>
      <mapping>
        <identity value="rim"/>
        <map value="Act.text?"/>
      </mapping>
    </element>
    <element id="Encounter.contained">
      <path value="Encounter.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, and nor can they have their own independent transaction scope."/>
      <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."/>
      <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>
      <mapping>
        <identity value="rim"/>
        <map value="N/A"/>
      </mapping>
    </element>
    <element id="Encounter.extension">
      <path value="Encounter.extension"/>
      <slicing id="6">
        <discriminator>
          <type value="value"/>
          <path value="url"/>
        </discriminator>
        <ordered value="false"/>
        <rules value="open"/>
      </slicing>
      <short value="Extension"/>
      <definition value="An Extension"/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="DomainResource.extension"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Extension"/>
      </type>
    </element>
    <element id="Encounter.extension:documentedBy">
      <path value="Encounter.extension"/>
      <sliceName value="documentedBy"/>
      <short value="Extension"/>
      <definition value="An Extension"/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="DomainResource.extension"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Extension"/>
        <profile
                 value="http://hl7.eu/fhir/trillium2/StructureDefinition/documentedBy-uv-trillium2"/>
      </type>
      <mustSupport value="true"/>
    </element>
    <element id="Encounter.extension:documentedBy.id">
      <path value="Encounter.extension.id"/>
      <representation value="xmlAttr"/>
      <short value="xml:id (or equivalent in JSON)"/>
      <definition
                  value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Element.id"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="string"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element id="Encounter.extension:documentedBy.extension">
      <path value="Encounter.extension.extension"/>
      <slicing>
        <discriminator>
          <type value="value"/>
          <path value="url"/>
        </discriminator>
        <description value="Extensions are always sliced by (at least) url"/>
        <rules value="open"/>
      </slicing>
      <short value="Additional Content defined by implementations"/>
      <definition
                  value="May be used to represent additional information that is not part of the basic definition of the element. In order to make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."/>
      <comment
               value="There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone."/>
      <alias value="extensions"/>
      <alias value="user content"/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="Element.extension"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Extension"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element id="Encounter.extension:documentedBy.extension:reference">
      <path value="Encounter.extension.extension"/>
      <sliceName value="reference"/>
      <short value="Extension"/>
      <definition value="An Extension"/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="Element.extension"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Extension"/>
      </type>
      <mustSupport value="true"/>
    </element>
    <element id="Encounter.extension:documentedBy.extension:reference.id">
      <path value="Encounter.extension.extension.id"/>
      <representation value="xmlAttr"/>
      <short value="xml:id (or equivalent in JSON)"/>
      <definition
                  value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Element.id"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="string"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element id="Encounter.extension:documentedBy.extension:reference.extension">
      <path value="Encounter.extension.extension.extension"/>
      <slicing>
        <discriminator>
          <type value="value"/>
          <path value="url"/>
        </discriminator>
        <description value="Extensions are always sliced by (at least) url"/>
        <rules value="open"/>
      </slicing>
      <short value="Additional Content defined by implementations"/>
      <definition
                  value="May be used to represent additional information that is not part of the basic definition of the element. In order to make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."/>
      <comment
               value="There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone."/>
      <alias value="extensions"/>
      <alias value="user content"/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="Element.extension"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Extension"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element id="Encounter.extension:documentedBy.extension:reference.url">
      <path value="Encounter.extension.extension.url"/>
      <representation value="xmlAttr"/>
      <short value="identifies the meaning of the extension"/>
      <definition
                  value="Source of the definition for the extension code - a logical name or a URL."/>
      <comment
               value="The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension."/>
      <min value="1"/>
      <max value="1"/>
      <base>
        <path value="Extension.url"/>
        <min value="1"/>
        <max value="1"/>
      </base>
      <type>
        <code value="uri"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map value="N/A"/>
      </mapping>
    </element>
    <element
             id="Encounter.extension:documentedBy.extension:reference.valueReference:valueReference">
      <path value="Encounter.extension.extension.valueReference"/>
      <sliceName value="valueReference"/>
      <short value="Value of extension"/>
      <definition
                  value="Value of extension - may be a resource or one of a constrained set of the data types (see Extensibility in the spec for list)."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Extension.value[x]"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="Reference"/>
        <targetProfile
                       value="http://hl7.eu/fhir/trillium2/StructureDefinition/DocumentReference-uv-trillium2"/>
      </type>
      <type>
        <code value="Reference"/>
        <targetProfile
                       value="http://hl7.eu/fhir/trillium2/StructureDefinition/imagingstudy-RefToEvidences-uv-trillium2"/>
      </type>
      <mustSupport value="true"/>
      <mapping>
        <identity value="rim"/>
        <map value="N/A"/>
      </mapping>
    </element>
    <element id="Encounter.extension:documentedBy.url">
      <path value="Encounter.extension.url"/>
      <representation value="xmlAttr"/>
      <short value="identifies the meaning of the extension"/>
      <definition
                  value="Source of the definition for the extension code - a logical name or a URL."/>
      <comment
               value="The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension."/>
      <min value="1"/>
      <max value="1"/>
      <base>
        <path value="Extension.url"/>
        <min value="1"/>
        <max value="1"/>
      </base>
      <type>
        <code value="uri"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map value="N/A"/>
      </mapping>
    </element>
    <element id="Encounter.extension:documentedBy.value[x]">
      <path value="Encounter.extension.value[x]"/>
      <short value="Value of extension"/>
      <definition
                  value="Value of extension - may be a resource or one of a constrained set of the data types (see Extensibility in the spec for list)."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Extension.value[x]"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="base64Binary"/>
      </type>
      <type>
        <code value="boolean"/>
      </type>
      <type>
        <code value="code"/>
      </type>
      <type>
        <code value="date"/>
      </type>
      <type>
        <code value="dateTime"/>
      </type>
      <type>
        <code value="decimal"/>
      </type>
      <type>
        <code value="id"/>
      </type>
      <type>
        <code value="instant"/>
      </type>
      <type>
        <code value="integer"/>
      </type>
      <type>
        <code value="markdown"/>
      </type>
      <type>
        <code value="oid"/>
      </type>
      <type>
        <code value="positiveInt"/>
      </type>
      <type>
        <code value="string"/>
      </type>
      <type>
        <code value="time"/>
      </type>
      <type>
        <code value="unsignedInt"/>
      </type>
      <type>
        <code value="uri"/>
      </type>
      <type>
        <code value="Address"/>
      </type>
      <type>
        <code value="Age"/>
      </type>
      <type>
        <code value="Annotation"/>
      </type>
      <type>
        <code value="Attachment"/>
      </type>
      <type>
        <code value="CodeableConcept"/>
      </type>
      <type>
        <code value="Coding"/>
      </type>
      <type>
        <code value="ContactPoint"/>
      </type>
      <type>
        <code value="Count"/>
      </type>
      <type>
        <code value="Distance"/>
      </type>
      <type>
        <code value="Duration"/>
      </type>
      <type>
        <code value="HumanName"/>
      </type>
      <type>
        <code value="Identifier"/>
      </type>
      <type>
        <code value="Money"/>
      </type>
      <type>
        <code value="Period"/>
      </type>
      <type>
        <code value="Quantity"/>
      </type>
      <type>
        <code value="Range"/>
      </type>
      <type>
        <code value="Ratio"/>
      </type>
      <type>
        <code value="Reference"/>
      </type>
      <type>
        <code value="SampledData"/>
      </type>
      <type>
        <code value="Signature"/>
      </type>
      <type>
        <code value="Timing"/>
      </type>
      <type>
        <code value="Meta"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map value="N/A"/>
      </mapping>
    </element>
    <element id="Encounter.modifierExtension">
      <path value="Encounter.modifierExtension"/>
      <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. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions."/>
      <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.modifierExtension"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Extension"/>
      </type>
      <isModifier value="true"/>
      <mapping>
        <identity value="rim"/>
        <map value="N/A"/>
      </mapping>
    </element>
    <element id="Encounter.identifier">
      <path value="Encounter.identifier"/>
      <short value="Identifier(s) by which this encounter is known"/>
      <definition value="Identifier(s) by which this encounter is known."/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="Encounter.identifier"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Identifier"/>
      </type>
      <isSummary value="true"/>
      <mapping>
        <identity value="v2"/>
        <map value="PV1-19"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map value=".id"/>
      </mapping>
      <mapping>
        <identity value="w5"/>
        <map value="id"/>
      </mapping>
    </element>
    <element id="Encounter.status">
      <path value="Encounter.status"/>
      <short
             value="planned | arrived | triaged | in-progress | onleave | finished | cancelled +"/>
      <definition
                  value="planned | arrived | triaged | in-progress | onleave | finished | cancelled +."/>
      <comment
               value="Note that internal business rules will detemine the appropraite transitions that may occur between statuses (and also classes).

This element is labeled as a modifier because the status contains codes that mark the encounter as not currently valid."/>
      <min value="1"/>
      <max value="1"/>
      <base>
        <path value="Encounter.status"/>
        <min value="1"/>
        <max value="1"/>
      </base>
      <type>
        <code value="code"/>
      </type>
      <isModifier value="true"/>
      <isSummary value="true"/>
      <binding>
        <extension
                   url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="EncounterStatus"/>
        </extension>
        <strength value="required"/>
        <description value="Current state of the encounter"/>
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/encounter-status"/>
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="v2"/>
        <map
             value="No clear equivalent in HL7 v2; active/finished could be inferred from PV1-44, PV1-45, PV2-24; inactive could be inferred from PV2-16"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map value=".statusCode"/>
      </mapping>
      <mapping>
        <identity value="w5"/>
        <map value="status"/>
      </mapping>
    </element>
    <element id="Encounter.statusHistory">
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name">
        <valueString value="StatusHistory"/>
      </extension>
      <path value="Encounter.statusHistory"/>
      <short value="List of past encounter statuses"/>
      <definition
                  value="The status history permits the encounter resource to contain the status history without needing to read through the historical versions of the resource, or even have the server store them."/>
      <comment
               value="The current status is always found in the current version of the resource, not the status history."/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="Encounter.statusHistory"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="BackboneElement"/>
      </type>
      <constraint>
        <key value="ele-1"/>
        <severity value="error"/>
        <human value="All FHIR elements must have a @value or children"/>
        <expression value="hasValue() | (children().count() &gt; id.count())"/>
        <xpath value="@value|f:*|h:div"/>
        <source value="Element"/>
      </constraint>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element id="Encounter.statusHistory.id">
      <path value="Encounter.statusHistory.id"/>
      <representation value="xmlAttr"/>
      <short value="xml:id (or equivalent in JSON)"/>
      <definition
                  value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Element.id"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="string"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element id="Encounter.statusHistory.extension">
      <path value="Encounter.statusHistory.extension"/>
      <short value="Additional Content defined by implementations"/>
      <definition
                  value="May be used to represent additional information that is not part of the basic definition of the element. In order to make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."/>
      <comment
               value="There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone."/>
      <alias value="extensions"/>
      <alias value="user content"/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="Element.extension"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Extension"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element id="Encounter.statusHistory.modifierExtension">
      <path value="Encounter.statusHistory.modifierExtension"/>
      <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 element, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions."/>
      <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"/>
      <alias value="modifiers"/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="BackboneElement.modifierExtension"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Extension"/>
      </type>
      <isModifier value="true"/>
      <isSummary value="true"/>
      <mapping>
        <identity value="rim"/>
        <map value="N/A"/>
      </mapping>
    </element>
    <element id="Encounter.statusHistory.status">
      <path value="Encounter.statusHistory.status"/>
      <short
             value="planned | arrived | triaged | in-progress | onleave | finished | cancelled +"/>
      <definition
                  value="planned | arrived | triaged | in-progress | onleave | finished | cancelled +."/>
      <min value="1"/>
      <max value="1"/>
      <base>
        <path value="Encounter.statusHistory.status"/>
        <min value="1"/>
        <max value="1"/>
      </base>
      <type>
        <code value="code"/>
      </type>
      <binding>
        <extension
                   url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="EncounterStatus"/>
        </extension>
        <strength value="required"/>
        <description value="Current state of the encounter"/>
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/encounter-status"/>
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element id="Encounter.statusHistory.period">
      <path value="Encounter.statusHistory.period"/>
      <short value="The time that the episode was in the specified status"/>
      <definition value="The time that the episode was in the specified status."/>
      <min value="1"/>
      <max value="1"/>
      <base>
        <path value="Encounter.statusHistory.period"/>
        <min value="1"/>
        <max value="1"/>
      </base>
      <type>
        <code value="Period"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element id="Encounter.class">
      <path value="Encounter.class"/>
      <short value="inpatient | outpatient | ambulatory | emergency +"/>
      <definition value="inpatient | outpatient | ambulatory | emergency +."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Encounter.class"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="Coding"/>
      </type>
      <isSummary value="true"/>
      <binding>
        <extension
                   url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="EncounterClass"/>
        </extension>
        <strength value="extensible"/>
        <description value="Classification of the encounter"/>
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/v3-ActEncounterCode"/>
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="v2"/>
        <map value="PV1-2"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map
             value=".inboundRelationship[typeCode=SUBJ].source[classCode=LIST].code"/>
      </mapping>
      <mapping>
        <identity value="w5"/>
        <map value="class"/>
      </mapping>
    </element>
    <element id="Encounter.classHistory">
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name">
        <valueString value="ClassHistory"/>
      </extension>
      <path value="Encounter.classHistory"/>
      <short value="List of past encounter classes"/>
      <definition
                  value="The class history permits the tracking of the encounters transitions without needing to go  through the resource history.

This would be used for a case where an admission starts of as an emergency encounter, then transisions into an inpatient scenario. Doing this and not restarting a new encounter ensures that any lab/diagnostic results can more easily follow the patient and not require re-processing and not get lost or cancelled during a kindof discharge from emergency to inpatient."/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="Encounter.classHistory"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="BackboneElement"/>
      </type>
      <constraint>
        <key value="ele-1"/>
        <severity value="error"/>
        <human value="All FHIR elements must have a @value or children"/>
        <expression value="hasValue() | (children().count() &gt; id.count())"/>
        <xpath value="@value|f:*|h:div"/>
        <source value="Element"/>
      </constraint>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element id="Encounter.classHistory.id">
      <path value="Encounter.classHistory.id"/>
      <representation value="xmlAttr"/>
      <short value="xml:id (or equivalent in JSON)"/>
      <definition
                  value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Element.id"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="string"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element id="Encounter.classHistory.extension">
      <path value="Encounter.classHistory.extension"/>
      <short value="Additional Content defined by implementations"/>
      <definition
                  value="May be used to represent additional information that is not part of the basic definition of the element. In order to make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."/>
      <comment
               value="There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone."/>
      <alias value="extensions"/>
      <alias value="user content"/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="Element.extension"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Extension"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element id="Encounter.classHistory.modifierExtension">
      <path value="Encounter.classHistory.modifierExtension"/>
      <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 element, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions."/>
      <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"/>
      <alias value="modifiers"/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="BackboneElement.modifierExtension"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Extension"/>
      </type>
      <isModifier value="true"/>
      <isSummary value="true"/>
      <mapping>
        <identity value="rim"/>
        <map value="N/A"/>
      </mapping>
    </element>
    <element id="Encounter.classHistory.class">
      <path value="Encounter.classHistory.class"/>
      <short value="inpatient | outpatient | ambulatory | emergency +"/>
      <definition value="inpatient | outpatient | ambulatory | emergency +."/>
      <min value="1"/>
      <max value="1"/>
      <base>
        <path value="Encounter.classHistory.class"/>
        <min value="1"/>
        <max value="1"/>
      </base>
      <type>
        <code value="Coding"/>
      </type>
      <binding>
        <extension
                   url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="EncounterClass"/>
        </extension>
        <strength value="extensible"/>
        <description value="Classification of the encounter"/>
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/v3-ActEncounterCode"/>
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element id="Encounter.classHistory.period">
      <path value="Encounter.classHistory.period"/>
      <short value="The time that the episode was in the specified class"/>
      <definition value="The time that the episode was in the specified class."/>
      <min value="1"/>
      <max value="1"/>
      <base>
        <path value="Encounter.classHistory.period"/>
        <min value="1"/>
        <max value="1"/>
      </base>
      <type>
        <code value="Period"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element id="Encounter.type">
      <path value="Encounter.type"/>
      <short value="Specific type of encounter"/>
      <definition
                  value="Specific type of encounter (e.g. e-mail consultation, surgical day-care, skilled nursing, rehabilitation)."/>
      <comment
               value="Since there are many ways to further classify encounters, this element is 0..*."/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="Encounter.type"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="CodeableConcept"/>
      </type>
      <mustSupport value="true"/>
      <isSummary value="true"/>
      <binding>
        <extension
                   url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="EncounterType"/>
        </extension>
        <strength value="example"/>
        <description value="The type of encounter"/>
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/encounter-type"/>
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="v2"/>
        <map value="PV1-4 / PV1-18"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map value=".code"/>
      </mapping>
      <mapping>
        <identity value="w5"/>
        <map value="class"/>
      </mapping>
    </element>
    <element id="Encounter.type.id">
      <path value="Encounter.type.id"/>
      <representation value="xmlAttr"/>
      <short value="xml:id (or equivalent in JSON)"/>
      <definition
                  value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Element.id"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="string"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element id="Encounter.type.extension">
      <path value="Encounter.type.extension"/>
      <slicing>
        <discriminator>
          <type value="value"/>
          <path value="url"/>
        </discriminator>
        <description value="Extensions are always sliced by (at least) url"/>
        <rules value="open"/>
      </slicing>
      <short value="Additional Content defined by implementations"/>
      <definition
                  value="May be used to represent additional information that is not part of the basic definition of the element. In order to make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."/>
      <comment
               value="There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone."/>
      <alias value="extensions"/>
      <alias value="user content"/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="Element.extension"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Extension"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element id="Encounter.type.coding">
      <path value="Encounter.type.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 translations and alternate encodings within a code system.  Also supports communication of the same instance to systems requiring different encodings."/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="CodeableConcept.coding"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Coding"/>
      </type>
      <isSummary value="true"/>
      <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="Encounter.type.coding.id">
      <path value="Encounter.type.coding.id"/>
      <representation value="xmlAttr"/>
      <short value="xml:id (or equivalent in JSON)"/>
      <definition
                  value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Element.id"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="string"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element id="Encounter.type.coding.extension">
      <path value="Encounter.type.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. In order to make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."/>
      <comment
               value="There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone."/>
      <alias value="extensions"/>
      <alias value="user content"/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="Element.extension"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Extension"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element id="Encounter.type.coding.system">
      <path value="Encounter.type.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&#39;s list of FHIR defined special URIs or it should de-reference to some definition that establish the system clearly and unambiguously."/>
      <requirements
                    value="Need to be unambiguous about the source of the definition of the symbol."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Coding.system"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="uri"/>
      </type>
      <isSummary value="true"/>
      <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="Encounter.type.coding.version">
      <path value="Encounter.type.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>
      <isSummary value="true"/>
      <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="Encounter.type.coding.code">
      <path value="Encounter.type.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)."/>
      <requirements value="Need to refer to a particular code in the system."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Coding.code"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="code"/>
      </type>
      <mustSupport value="true"/>
      <isSummary value="true"/>
      <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="Encounter.type.coding.display">
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true"/>
      </extension>
      <path value="Encounter.type.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."/>
      <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>
      <isSummary value="true"/>
      <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="Encounter.type.coding.userSelected">
      <path value="Encounter.type.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 - i.e. 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 &#39;directly chosen&#39; 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>
      <isSummary value="true"/>
      <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="Encounter.type.text">
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true"/>
      </extension>
      <path value="Encounter.type.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>
      <isSummary value="true"/>
      <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="Encounter.priority">
      <path value="Encounter.priority"/>
      <short value="Indicates the urgency of the encounter"/>
      <definition value="Indicates the urgency of the encounter."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Encounter.priority"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="CodeableConcept"/>
      </type>
      <binding>
        <extension
                   url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="Priority"/>
        </extension>
        <strength value="example"/>
        <description value="Indicates the urgency of the encounter."/>
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/v3-ActPriority"/>
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="v2"/>
        <map value="PV2-25"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map value=".priorityCode"/>
      </mapping>
      <mapping>
        <identity value="w5"/>
        <map value="grade"/>
      </mapping>
    </element>
    <element id="Encounter.subject">
      <path value="Encounter.subject"/>
      <short value="The patient ro group present at the encounter"/>
      <definition value="The patient ro group present at the encounter."/>
      <comment
               value="While the encounter is always about the patient, the patient may not actually be known in all contexts of use, and there may be a group of patients that could be anonymous (such as in a group therapy for Alcoholics Anonymous - where the recording of the encounter could be used for billing on the number of people/staff and not important to the context of the specific patients) or alternately in veterinary care a herd of sheep receiving treatment (where the animals are not individually tracked)."/>
      <alias value="patient"/>
      <min value="1"/>
      <max value="1"/>
      <base>
        <path value="Encounter.subject"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="Reference"/>
        <targetProfile
                       value="http://hl7.eu/fhir/trillium2/StructureDefinition/Patient-uv-ips"/>
      </type>
      <mustSupport value="true"/>
      <isSummary value="true"/>
      <mapping>
        <identity value="v2"/>
        <map value="PID-3"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map value=".participation[typeCode=SBJ]/role[classCode=PAT]"/>
      </mapping>
      <mapping>
        <identity value="w5"/>
        <map value="who.focus"/>
      </mapping>
    </element>
    <element id="Encounter.episodeOfCare">
      <path value="Encounter.episodeOfCare"/>
      <short
             value="Episode(s) of care that this encounter should be recorded against"/>
      <definition
                  value="Where a specific encounter should be classified as a part of a specific episode(s) of care this field should be used. This association can facilitate grouping of related encounters together for a specific purpose, such as government reporting, issue tracking, association via a common problem.  The association is recorded on the encounter as these are typically created after the episode of care, and grouped on entry rather than editing the episode of care to append another encounter to it (the episode of care could span years)."/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="Encounter.episodeOfCare"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Reference"/>
        <targetProfile
                       value="http://hl7.org/fhir/StructureDefinition/EpisodeOfCare"/>
      </type>
      <isSummary value="true"/>
      <mapping>
        <identity value="v2"/>
        <map value="PV1-54, PV1-53"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
      <mapping>
        <identity value="w5"/>
        <map value="context"/>
      </mapping>
    </element>
    <element id="Encounter.incomingReferral">
      <path value="Encounter.incomingReferral"/>
      <short value="The ReferralRequest that initiated this encounter"/>
      <definition
                  value="The referral request this encounter satisfies (incoming referral)."/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="Encounter.incomingReferral"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Reference"/>
        <targetProfile
                       value="http://hl7.org/fhir/StructureDefinition/ReferralRequest"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map value=".reason.ClinicalDocument"/>
      </mapping>
    </element>
    <element id="Encounter.participant">
      <path value="Encounter.participant"/>
      <slicing>
        <discriminator>
          <type value="value"/>
          <path value="type.coding.code"/>
        </discriminator>
        <rules value="openAtEnd"/>
      </slicing>
      <short value="List of participants involved in the encounter"/>
      <definition
                  value="The list of people responsible for providing the service."/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="Encounter.participant"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="BackboneElement"/>
      </type>
      <constraint>
        <key value="ele-1"/>
        <severity value="error"/>
        <human value="All FHIR elements must have a @value or children"/>
        <expression value="hasValue() | (children().count() &gt; id.count())"/>
        <xpath value="@value|f:*|h:div"/>
        <source value="Element"/>
      </constraint>
      <mustSupport value="true"/>
      <isSummary value="true"/>
      <mapping>
        <identity value="v2"/>
        <map value="ROL"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map value=".participation[typeCode=PFM]"/>
      </mapping>
    </element>
    <element id="Encounter.participant.id">
      <path value="Encounter.participant.id"/>
      <representation value="xmlAttr"/>
      <short value="xml:id (or equivalent in JSON)"/>
      <definition
                  value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Element.id"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="string"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element id="Encounter.participant.extension">
      <path value="Encounter.participant.extension"/>
      <short value="Additional Content defined by implementations"/>
      <definition
                  value="May be used to represent additional information that is not part of the basic definition of the element. In order to make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."/>
      <comment
               value="There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone."/>
      <alias value="extensions"/>
      <alias value="user content"/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="Element.extension"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Extension"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element id="Encounter.participant.modifierExtension">
      <path value="Encounter.participant.modifierExtension"/>
      <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 element, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions."/>
      <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"/>
      <alias value="modifiers"/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="BackboneElement.modifierExtension"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Extension"/>
      </type>
      <isModifier value="true"/>
      <isSummary value="true"/>
      <mapping>
        <identity value="rim"/>
        <map value="N/A"/>
      </mapping>
    </element>
    <element id="Encounter.participant.type">
      <path value="Encounter.participant.type"/>
      <short value="Role of participant in encounter"/>
      <definition value="Role of participant in encounter."/>
      <comment
               value="The participant type indicates how an individual partitipates in an encounter. It includes non-practitioner participants, and for practitioners this is to describe the action type in the context of this encounter (e.g. Admitting Dr, Attending Dr, Translator, Consulting Dr). This is different to the practitioner roles which are functional roles, derived from terms of employment, education, licensing, etc."/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="Encounter.participant.type"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="CodeableConcept"/>
      </type>
      <isSummary value="true"/>
      <binding>
        <extension
                   url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="ParticipantType"/>
        </extension>
        <strength value="extensible"/>
        <description value="Role of participant in encounter"/>
        <valueSetReference>
          <reference
                     value="http://hl7.org/fhir/ValueSet/encounter-participant-type"/>
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="v2"/>
        <map value="ROL-3 (or maybe PRT-4)"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map value=".functionCode"/>
      </mapping>
    </element>
    <element id="Encounter.participant.period">
      <path value="Encounter.participant.period"/>
      <short
             value="Period of time during the encounter that the participant participated"/>
      <definition
                  value="The period of time that the specified participant participated in the encounter. These can overlap or be sub-sets of the overall encounter&#39;s period."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Encounter.participant.period"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="Period"/>
      </type>
      <mapping>
        <identity value="v2"/>
        <map value="ROL-5, ROL-6 (or maybe PRT-5)"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map value=".time"/>
      </mapping>
    </element>
    <element id="Encounter.participant.individual">
      <path value="Encounter.participant.individual"/>
      <short value="Persons involved in the encounter other than the patient"/>
      <definition
                  value="Persons involved in the encounter other than the patient."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Encounter.participant.individual"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="Reference"/>
        <targetProfile
                       value="http://hl7.org/fhir/StructureDefinition/Practitioner"/>
      </type>
      <type>
        <code value="Reference"/>
        <targetProfile
                       value="http://hl7.org/fhir/StructureDefinition/RelatedPerson"/>
      </type>
      <isSummary value="true"/>
      <mapping>
        <identity value="v2"/>
        <map value="ROL-4"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map value=".role"/>
      </mapping>
      <mapping>
        <identity value="w5"/>
        <map value="who"/>
      </mapping>
    </element>
    <element id="Encounter.participant:performer">
      <path value="Encounter.participant"/>
      <sliceName value="performer"/>
      <short value="List of participants involved in the encounter"/>
      <definition
                  value="The list of people responsible for providing the service."/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="Encounter.participant"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="BackboneElement"/>
      </type>
      <constraint>
        <key value="ele-1"/>
        <severity value="error"/>
        <human value="All FHIR elements must have a @value or children"/>
        <expression value="hasValue() | (children().count() &gt; id.count())"/>
        <xpath value="@value|f:*|h:div"/>
        <source value="Element"/>
      </constraint>
      <mustSupport value="true"/>
      <isSummary value="true"/>
      <mapping>
        <identity value="v2"/>
        <map value="ROL"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map value=".participation[typeCode=PFM]"/>
      </mapping>
    </element>
    <element id="Encounter.participant:performer.id">
      <path value="Encounter.participant.id"/>
      <representation value="xmlAttr"/>
      <short value="xml:id (or equivalent in JSON)"/>
      <definition
                  value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Element.id"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="string"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element id="Encounter.participant:performer.extension">
      <path value="Encounter.participant.extension"/>
      <short value="Additional Content defined by implementations"/>
      <definition
                  value="May be used to represent additional information that is not part of the basic definition of the element. In order to make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."/>
      <comment
               value="There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone."/>
      <alias value="extensions"/>
      <alias value="user content"/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="Element.extension"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Extension"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element id="Encounter.participant:performer.modifierExtension">
      <path value="Encounter.participant.modifierExtension"/>
      <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 element, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions."/>
      <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"/>
      <alias value="modifiers"/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="BackboneElement.modifierExtension"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Extension"/>
      </type>
      <isModifier value="true"/>
      <isSummary value="true"/>
      <mapping>
        <identity value="rim"/>
        <map value="N/A"/>
      </mapping>
    </element>
    <element id="Encounter.participant:performer.type">
      <path value="Encounter.participant.type"/>
      <short value="Role of participant in encounter"/>
      <definition value="Role of participant in encounter."/>
      <comment
               value="The participant type indicates how an individual partitipates in an encounter. It includes non-practitioner participants, and for practitioners this is to describe the action type in the context of this encounter (e.g. Admitting Dr, Attending Dr, Translator, Consulting Dr). This is different to the practitioner roles which are functional roles, derived from terms of employment, education, licensing, etc."/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="Encounter.participant.type"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="CodeableConcept"/>
      </type>
      <mustSupport value="false"/>
      <isSummary value="true"/>
      <binding>
        <extension
                   url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="ParticipantType"/>
        </extension>
        <strength value="extensible"/>
        <description value="Role of participant in encounter"/>
        <valueSetReference>
          <reference
                     value="http://hl7.org/fhir/ValueSet/encounter-participant-type"/>
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="v2"/>
        <map value="ROL-3 (or maybe PRT-4)"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map value=".functionCode"/>
      </mapping>
    </element>
    <element id="Encounter.participant:performer.period">
      <path value="Encounter.participant.period"/>
      <short
             value="Period of time during the encounter that the participant participated"/>
      <definition
                  value="The period of time that the specified participant participated in the encounter. These can overlap or be sub-sets of the overall encounter&#39;s period."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Encounter.participant.period"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="Period"/>
      </type>
      <mapping>
        <identity value="v2"/>
        <map value="ROL-5, ROL-6 (or maybe PRT-5)"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map value=".time"/>
      </mapping>
    </element>
    <element id="Encounter.participant:performer.individual">
      <path value="Encounter.participant.individual"/>
      <short value="Persons involved in the encounter other than the patient"/>
      <definition
                  value="Persons involved in the encounter other than the patient."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Encounter.participant.individual"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="Reference"/>
        <targetProfile
                       value="http://hl7.eu/fhir/trillium2/StructureDefinition/Practitioner-uv-ips"/>
      </type>
      <mustSupport value="true"/>
      <isSummary value="true"/>
      <mapping>
        <identity value="v2"/>
        <map value="ROL-4"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map value=".role"/>
      </mapping>
      <mapping>
        <identity value="w5"/>
        <map value="who"/>
      </mapping>
    </element>
    <element id="Encounter.participant:performer.individual.id">
      <path value="Encounter.participant.individual.id"/>
      <representation value="xmlAttr"/>
      <short value="xml:id (or equivalent in JSON)"/>
      <definition
                  value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Element.id"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="string"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element id="Encounter.participant:performer.individual.extension">
      <path value="Encounter.participant.individual.extension"/>
      <slicing>
        <discriminator>
          <type value="value"/>
          <path value="url"/>
        </discriminator>
        <description value="Extensions are always sliced by (at least) url"/>
        <rules value="open"/>
      </slicing>
      <short value="Additional Content defined by implementations"/>
      <definition
                  value="May be used to represent additional information that is not part of the basic definition of the element. In order to make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."/>
      <comment
               value="There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone."/>
      <alias value="extensions"/>
      <alias value="user content"/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="Element.extension"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Extension"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element id="Encounter.participant:performer.individual.reference">
      <path value="Encounter.participant.individual.reference"/>
      <short value="Literal reference, Relative, internal or absolute URL"/>
      <definition
                  value="A reference to a location at which the other resource is found. The reference may be a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with &#39;#&#39;) refer to contained resources."/>
      <comment
               value="Using absolute URLs provides a stable scalable approach suitable for a cloud/web context, while using relative/logical references provides a flexible approach suitable for use when trading across closed eco-system boundaries.   Absolute URLs do not need to point to a FHIR RESTful server, though this is the preferred approach. If the URL conforms to the structure &quot;/[type]/[id]&quot; then it should be assumed that the reference is to a FHIR RESTful server."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Reference.reference"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="string"/>
      </type>
      <condition value="ref-1"/>
      <mustSupport value="true"/>
      <isSummary value="true"/>
      <mapping>
        <identity value="rim"/>
        <map value="N/A"/>
      </mapping>
    </element>
    <element id="Encounter.participant:performer.individual.identifier">
      <path value="Encounter.participant.individual.identifier"/>
      <short value="Logical reference, when literal reference is not known"/>
      <definition
                  value="An identifier for the other resource. This is used when there is no way to reference the other resource directly, either because the entity is not available through a FHIR server, or because there is no way for the author of the resource to convert a known identifier to an actual location. There is no requirement that a Reference.identifier point to something that is actually exposed as a FHIR instance, but it SHALL point to a business concept that would be expected to be exposed as a FHIR instance, and that instance would need to be of a FHIR resource type allowed by the reference."/>
      <comment
               value="When an identifier is provided in place of a reference, any system processing the reference will only be able to resolve the identifier to a reference if it understands the business context in which the identifier is used. Sometimes this is global (e.g. a national identifier) but often it is not. For this reason, none of the useful mechanisms described for working with references (e.g. chaining, includes) are possible, nor should servers be expected to be able resolve the reference. Servers may accept an identifier based reference untouched, resolve it, and/or reject it - see CapabilityStatement.rest.resource.referencePolicy. 

When both an identifier and a literal reference are provided, the literal reference is preferred. Applications processing the resource are allowed - but not required - to check that the identifier matches the literal reference

Applications converting a logical reference to a literal reference may choose to leave the logical reference present, or remove it."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Reference.identifier"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="Identifier"/>
      </type>
      <isSummary value="true"/>
      <mapping>
        <identity value="rim"/>
        <map value=".identifier"/>
      </mapping>
    </element>
    <element id="Encounter.participant:performer.individual.display">
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true"/>
      </extension>
      <path value="Encounter.participant.individual.display"/>
      <short value="Text alternative for the resource"/>
      <definition
                  value="Plain text narrative that identifies the resource in addition to the resource reference."/>
      <comment
               value="This is generally not the same as the Resource.text of the referenced resource.  The purpose is to identify what&#39;s being referenced, not to fully describe it."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Reference.display"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="string"/>
      </type>
      <isSummary value="true"/>
      <mapping>
        <identity value="rim"/>
        <map value="N/A"/>
      </mapping>
    </element>
    <element id="Encounter.appointment">
      <path value="Encounter.appointment"/>
      <short value="The appointment that scheduled this encounter"/>
      <definition value="The appointment that scheduled this encounter."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Encounter.appointment"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="Reference"/>
        <targetProfile
                       value="http://hl7.org/fhir/StructureDefinition/Appointment"/>
      </type>
      <isSummary value="true"/>
      <mapping>
        <identity value="v2"/>
        <map value="SCH-1 / SCH-2"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map
             value=".outboundRelationship[typeCode=FLFS].target[classCode=ENC, moodCode=APT]"/>
      </mapping>
    </element>
    <element id="Encounter.period">
      <path value="Encounter.period"/>
      <short value="The start and end time of the encounter"/>
      <definition value="The start and end time of the encounter."/>
      <comment value="If not (yet) known, the end of the Period may be omitted."/>
      <min value="1"/>
      <max value="1"/>
      <base>
        <path value="Encounter.period"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="Period"/>
      </type>
      <mustSupport value="true"/>
      <mapping>
        <identity value="v2"/>
        <map value="PV1-44, PV1-45"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map value=".effectiveTime (low &amp; high)"/>
      </mapping>
      <mapping>
        <identity value="w5"/>
        <map value="when.done"/>
      </mapping>
    </element>
    <element id="Encounter.period.id">
      <path value="Encounter.period.id"/>
      <representation value="xmlAttr"/>
      <short value="xml:id (or equivalent in JSON)"/>
      <definition
                  value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Element.id"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="string"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element id="Encounter.period.extension">
      <path value="Encounter.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. In order to make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."/>
      <comment
               value="There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone."/>
      <alias value="extensions"/>
      <alias value="user content"/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="Element.extension"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Extension"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element id="Encounter.period.start">
      <path value="Encounter.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="0"/>
      <max value="1"/>
      <base>
        <path value="Period.start"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="dateTime"/>
      </type>
      <condition value="per-1"/>
      <mustSupport value="true"/>
      <isSummary value="true"/>
      <mapping>
        <identity value="v2"/>
        <map value="DR.1"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map value="./low"/>
      </mapping>
    </element>
    <element id="Encounter.period.end">
      <path value="Encounter.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 that the period is ongoing. 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 high value includes any matching date/time. i.e. 2012-02-03T10:00:00 is in a period that has a 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"/>
      <mustSupport value="true"/>
      <isSummary value="true"/>
      <mapping>
        <identity value="v2"/>
        <map value="DR.2"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map value="./high"/>
      </mapping>
    </element>
    <element id="Encounter.length">
      <path value="Encounter.length"/>
      <short value="Quantity of time the encounter lasted (less time absent)"/>
      <definition
                  value="Quantity of time the encounter lasted. This excludes the time during leaves of absence."/>
      <comment
               value="May differ from the time the Encounter.period lasted because of leave of absence."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Encounter.length"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="Duration"/>
      </type>
      <mapping>
        <identity value="v2"/>
        <map
             value="(PV1-45 less PV1-44) iff ( (PV1-44 not empty) and (PV1-45 not empty) ); units in minutes"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map value=".lengthOfStayQuantity"/>
      </mapping>
    </element>
    <element id="Encounter.reason">
      <path value="Encounter.reason"/>
      <short value="Reason the encounter takes place (code)"/>
      <definition
                  value="Reason the encounter takes place, expressed as a code. For admissions, this can be used for a coded admission diagnosis."/>
      <comment
               value="For systems that need to know which was the primary diagnosis, these will be marked with the standard extension primaryDiagnosis (which is a sequence value rather than a flag, 1 = primary diagnosis)."/>
      <alias value="Indication"/>
      <alias value="Admission diagnosis"/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="Encounter.reason"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="CodeableConcept"/>
      </type>
      <mustSupport value="true"/>
      <isSummary value="true"/>
      <binding>
        <extension
                   url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="EncounterReason"/>
        </extension>
        <strength value="preferred"/>
        <description value="Reason why the encounter takes place."/>
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/encounter-reason"/>
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="v2"/>
        <map
             value="EVN-4 / PV2-3 (note: PV2-3 is nominally constrained to inpatient admissions; HL7 v2 makes no vocabulary suggestions for PV2-3; would not expect PV2 segment or PV2-3 to be in use in all implementations )"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map value=".reasonCode"/>
      </mapping>
      <mapping>
        <identity value="w5"/>
        <map value="why"/>
      </mapping>
    </element>
    <element id="Encounter.reason.id">
      <path value="Encounter.reason.id"/>
      <representation value="xmlAttr"/>
      <short value="xml:id (or equivalent in JSON)"/>
      <definition
                  value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Element.id"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="string"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element id="Encounter.reason.extension">
      <path value="Encounter.reason.extension"/>
      <slicing>
        <discriminator>
          <type value="value"/>
          <path value="url"/>
        </discriminator>
        <description value="Extensions are always sliced by (at least) url"/>
        <rules value="open"/>
      </slicing>
      <short value="Additional Content defined by implementations"/>
      <definition
                  value="May be used to represent additional information that is not part of the basic definition of the element. In order to make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."/>
      <comment
               value="There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone."/>
      <alias value="extensions"/>
      <alias value="user content"/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="Element.extension"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Extension"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element id="Encounter.reason.coding">
      <path value="Encounter.reason.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 translations and alternate encodings within a code system.  Also supports communication of the same instance to systems requiring different encodings."/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="CodeableConcept.coding"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Coding"/>
      </type>
      <mustSupport value="true"/>
      <isSummary value="true"/>
      <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="Encounter.reason.text">
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true"/>
      </extension>
      <path value="Encounter.reason.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>
      <mustSupport value="true"/>
      <isSummary value="true"/>
      <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="Encounter.diagnosis">
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name">
        <valueString value="Diagnosis"/>
      </extension>
      <path value="Encounter.diagnosis"/>
      <slicing>
        <discriminator>
          <type value="value"/>
          <path value="role.coding.code"/>
        </discriminator>
        <rules value="open"/>
      </slicing>
      <short value="The list of diagnosis relevant to this encounter"/>
      <definition value="The list of diagnosis relevant to this encounter."/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="Encounter.diagnosis"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="BackboneElement"/>
      </type>
      <constraint>
        <key value="ele-1"/>
        <severity value="error"/>
        <human value="All FHIR elements must have a @value or children"/>
        <expression value="hasValue() | (children().count() &gt; id.count())"/>
        <xpath value="@value|f:*|h:div"/>
        <source value="Element"/>
      </constraint>
      <mustSupport value="true"/>
      <isSummary value="true"/>
      <mapping>
        <identity value="rim"/>
        <map value=".outboundRelationship[typeCode=RSON]"/>
      </mapping>
    </element>
    <element id="Encounter.diagnosis.id">
      <path value="Encounter.diagnosis.id"/>
      <representation value="xmlAttr"/>
      <short value="xml:id (or equivalent in JSON)"/>
      <definition
                  value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Element.id"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="string"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element id="Encounter.diagnosis.extension">
      <path value="Encounter.diagnosis.extension"/>
      <short value="Additional Content defined by implementations"/>
      <definition
                  value="May be used to represent additional information that is not part of the basic definition of the element. In order to make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."/>
      <comment
               value="There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone."/>
      <alias value="extensions"/>
      <alias value="user content"/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="Element.extension"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Extension"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element id="Encounter.diagnosis.modifierExtension">
      <path value="Encounter.diagnosis.modifierExtension"/>
      <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 element, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions."/>
      <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"/>
      <alias value="modifiers"/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="BackboneElement.modifierExtension"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Extension"/>
      </type>
      <isModifier value="true"/>
      <isSummary value="true"/>
      <mapping>
        <identity value="rim"/>
        <map value="N/A"/>
      </mapping>
    </element>
    <element id="Encounter.diagnosis.condition">
      <path value="Encounter.diagnosis.condition"/>
      <short value="Reason the encounter takes place (resource)"/>
      <definition
                  value="Reason the encounter takes place, as specified using information from another resource. For admissions, this is the admission diagnosis. The indication will typically be a Condition (with other resources referenced in the evidence.detail), or a Procedure."/>
      <comment
               value="For systems that need to know which was the primary diagnosis, these will be marked with the standard extension primaryDiagnosis (which is a sequence value rather than a flag, 1 = primary diagnosis)."/>
      <alias value="Admission diagnosis"/>
      <alias value="discharge diagnosis"/>
      <alias value="indication"/>
      <min value="1"/>
      <max value="1"/>
      <base>
        <path value="Encounter.diagnosis.condition"/>
        <min value="1"/>
        <max value="1"/>
      </base>
      <type>
        <code value="Reference"/>
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Condition"/>
      </type>
      <type>
        <code value="Reference"/>
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Procedure"/>
      </type>
      <mapping>
        <identity value="v2"/>
        <map
             value="Resources that would commonly referenced at Encounter.indication would be Condition and/or Procedure. These most closely align with DG1/PRB and PR1 respectively."/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map value=".outboundRelationship[typeCode=RSON].target"/>
      </mapping>
      <mapping>
        <identity value="w5"/>
        <map value="why"/>
      </mapping>
    </element>
    <element id="Encounter.diagnosis.role">
      <path value="Encounter.diagnosis.role"/>
      <short
             value="Role that this diagnosis has within the encounter (e.g. admission, billing, discharge …)"/>
      <definition
                  value="Role that this diagnosis has within the encounter (e.g. admission, billing, discharge …)."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Encounter.diagnosis.role"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="CodeableConcept"/>
      </type>
      <binding>
        <extension
                   url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="DiagnosisRole"/>
        </extension>
        <extension
                   url="http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding">
          <valueBoolean value="true"/>
        </extension>
        <strength value="preferred"/>
        <description value="The type of diagnosis this condition represents"/>
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/diagnosis-role"/>
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element id="Encounter.diagnosis.rank">
      <path value="Encounter.diagnosis.rank"/>
      <short value="Ranking of the diagnosis (for each role type)"/>
      <definition value="Ranking of the diagnosis (for each role type)."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Encounter.diagnosis.rank"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="positiveInt"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map value=".outboundRelationship[typeCode=RSON].priority"/>
      </mapping>
    </element>
    <element id="Encounter.diagnosis:admissionDiagnosis">
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name">
        <valueString value="Diagnosis"/>
      </extension>
      <path value="Encounter.diagnosis"/>
      <sliceName value="admissionDiagnosis"/>
      <short value="The list of diagnosis relevant to this encounter"/>
      <definition value="The list of diagnosis relevant to this encounter."/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="Encounter.diagnosis"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="BackboneElement"/>
      </type>
      <constraint>
        <key value="ele-1"/>
        <severity value="error"/>
        <human value="All FHIR elements must have a @value or children"/>
        <expression value="hasValue() | (children().count() &gt; id.count())"/>
        <xpath value="@value|f:*|h:div"/>
        <source value="Element"/>
      </constraint>
      <mustSupport value="true"/>
      <isSummary value="true"/>
      <mapping>
        <identity value="rim"/>
        <map value=".outboundRelationship[typeCode=RSON]"/>
      </mapping>
    </element>
    <element id="Encounter.diagnosis:admissionDiagnosis.id">
      <path value="Encounter.diagnosis.id"/>
      <representation value="xmlAttr"/>
      <short value="xml:id (or equivalent in JSON)"/>
      <definition
                  value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Element.id"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="string"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element id="Encounter.diagnosis:admissionDiagnosis.extension">
      <path value="Encounter.diagnosis.extension"/>
      <short value="Additional Content defined by implementations"/>
      <definition
                  value="May be used to represent additional information that is not part of the basic definition of the element. In order to make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."/>
      <comment
               value="There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone."/>
      <alias value="extensions"/>
      <alias value="user content"/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="Element.extension"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Extension"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element id="Encounter.diagnosis:admissionDiagnosis.modifierExtension">
      <path value="Encounter.diagnosis.modifierExtension"/>
      <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 element, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions."/>
      <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"/>
      <alias value="modifiers"/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="BackboneElement.modifierExtension"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Extension"/>
      </type>
      <isModifier value="true"/>
      <isSummary value="true"/>
      <mapping>
        <identity value="rim"/>
        <map value="N/A"/>
      </mapping>
    </element>
    <element id="Encounter.diagnosis:admissionDiagnosis.condition">
      <path value="Encounter.diagnosis.condition"/>
      <short value="Reason the encounter takes place (resource)"/>
      <definition
                  value="Reason the encounter takes place, as specified using information from another resource. For admissions, this is the admission diagnosis. The indication will typically be a Condition (with other resources referenced in the evidence.detail), or a Procedure."/>
      <comment
               value="For systems that need to know which was the primary diagnosis, these will be marked with the standard extension primaryDiagnosis (which is a sequence value rather than a flag, 1 = primary diagnosis)."/>
      <alias value="Admission diagnosis"/>
      <alias value="discharge diagnosis"/>
      <alias value="indication"/>
      <min value="1"/>
      <max value="1"/>
      <base>
        <path value="Encounter.diagnosis.condition"/>
        <min value="1"/>
        <max value="1"/>
      </base>
      <type>
        <code value="Reference"/>
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Condition"/>
      </type>
      <type>
        <code value="Reference"/>
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Procedure"/>
      </type>
      <mapping>
        <identity value="v2"/>
        <map
             value="Resources that would commonly referenced at Encounter.indication would be Condition and/or Procedure. These most closely align with DG1/PRB and PR1 respectively."/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map value=".outboundRelationship[typeCode=RSON].target"/>
      </mapping>
      <mapping>
        <identity value="w5"/>
        <map value="why"/>
      </mapping>
    </element>
    <element id="Encounter.diagnosis:admissionDiagnosis.role">
      <path value="Encounter.diagnosis.role"/>
      <short
             value="Role that this diagnosis has within the encounter (e.g. admission, billing, discharge …)"/>
      <definition
                  value="Role that this diagnosis has within the encounter (e.g. admission, billing, discharge …)."/>
      <min value="1"/>
      <max value="1"/>
      <base>
        <path value="Encounter.diagnosis.role"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="CodeableConcept"/>
      </type>
      <fixedCodeableConcept>
        <coding>
          <system value="http://hl7.org/fhir/diagnosis-role"/>
          <code value="AD"/>
        </coding>
      </fixedCodeableConcept>
      <mustSupport value="true"/>
      <binding>
        <extension
                   url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="DiagnosisRole"/>
        </extension>
        <extension
                   url="http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding">
          <valueBoolean value="true"/>
        </extension>
        <strength value="preferred"/>
        <description value="The type of diagnosis this condition represents"/>
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/diagnosis-role"/>
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element id="Encounter.diagnosis:admissionDiagnosis.rank">
      <path value="Encounter.diagnosis.rank"/>
      <short value="Ranking of the diagnosis (for each role type)"/>
      <definition value="Ranking of the diagnosis (for each role type)."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Encounter.diagnosis.rank"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="positiveInt"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map value=".outboundRelationship[typeCode=RSON].priority"/>
      </mapping>
    </element>
    <element id="Encounter.diagnosis:dischargeDiagnosis">
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name">
        <valueString value="Diagnosis"/>
      </extension>
      <path value="Encounter.diagnosis"/>
      <sliceName value="dischargeDiagnosis"/>
      <short value="The list of diagnosis relevant to this encounter"/>
      <definition value="The list of diagnosis relevant to this encounter."/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="Encounter.diagnosis"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="BackboneElement"/>
      </type>
      <constraint>
        <key value="ele-1"/>
        <severity value="error"/>
        <human value="All FHIR elements must have a @value or children"/>
        <expression value="hasValue() | (children().count() &gt; id.count())"/>
        <xpath value="@value|f:*|h:div"/>
        <source value="Element"/>
      </constraint>
      <mustSupport value="true"/>
      <isSummary value="true"/>
      <mapping>
        <identity value="rim"/>
        <map value=".outboundRelationship[typeCode=RSON]"/>
      </mapping>
    </element>
    <element id="Encounter.diagnosis:dischargeDiagnosis.id">
      <path value="Encounter.diagnosis.id"/>
      <representation value="xmlAttr"/>
      <short value="xml:id (or equivalent in JSON)"/>
      <definition
                  value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Element.id"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="string"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element id="Encounter.diagnosis:dischargeDiagnosis.extension">
      <path value="Encounter.diagnosis.extension"/>
      <short value="Additional Content defined by implementations"/>
      <definition
                  value="May be used to represent additional information that is not part of the basic definition of the element. In order to make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."/>
      <comment
               value="There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone."/>
      <alias value="extensions"/>
      <alias value="user content"/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="Element.extension"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Extension"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element id="Encounter.diagnosis:dischargeDiagnosis.modifierExtension">
      <path value="Encounter.diagnosis.modifierExtension"/>
      <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 element, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions."/>
      <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"/>
      <alias value="modifiers"/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="BackboneElement.modifierExtension"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Extension"/>
      </type>
      <isModifier value="true"/>
      <isSummary value="true"/>
      <mapping>
        <identity value="rim"/>
        <map value="N/A"/>
      </mapping>
    </element>
    <element id="Encounter.diagnosis:dischargeDiagnosis.condition">
      <path value="Encounter.diagnosis.condition"/>
      <short value="Reason the encounter takes place (resource)"/>
      <definition
                  value="Reason the encounter takes place, as specified using information from another resource. For admissions, this is the admission diagnosis. The indication will typically be a Condition (with other resources referenced in the evidence.detail), or a Procedure."/>
      <comment
               value="For systems that need to know which was the primary diagnosis, these will be marked with the standard extension primaryDiagnosis (which is a sequence value rather than a flag, 1 = primary diagnosis)."/>
      <alias value="Admission diagnosis"/>
      <alias value="discharge diagnosis"/>
      <alias value="indication"/>
      <min value="1"/>
      <max value="1"/>
      <base>
        <path value="Encounter.diagnosis.condition"/>
        <min value="1"/>
        <max value="1"/>
      </base>
      <type>
        <code value="Reference"/>
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Condition"/>
      </type>
      <type>
        <code value="Reference"/>
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Procedure"/>
      </type>
      <mapping>
        <identity value="v2"/>
        <map
             value="Resources that would commonly referenced at Encounter.indication would be Condition and/or Procedure. These most closely align with DG1/PRB and PR1 respectively."/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map value=".outboundRelationship[typeCode=RSON].target"/>
      </mapping>
      <mapping>
        <identity value="w5"/>
        <map value="why"/>
      </mapping>
    </element>
    <element id="Encounter.diagnosis:dischargeDiagnosis.role">
      <path value="Encounter.diagnosis.role"/>
      <short
             value="Role that this diagnosis has within the encounter (e.g. admission, billing, discharge …)"/>
      <definition
                  value="Role that this diagnosis has within the encounter (e.g. admission, billing, discharge …)."/>
      <min value="1"/>
      <max value="1"/>
      <base>
        <path value="Encounter.diagnosis.role"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="CodeableConcept"/>
      </type>
      <fixedCodeableConcept>
        <coding>
          <system value="http://hl7.org/fhir/diagnosis-role"/>
          <code value="DD"/>
        </coding>
      </fixedCodeableConcept>
      <mustSupport value="true"/>
      <binding>
        <extension
                   url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="DiagnosisRole"/>
        </extension>
        <extension
                   url="http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding">
          <valueBoolean value="true"/>
        </extension>
        <strength value="preferred"/>
        <description value="The type of diagnosis this condition represents"/>
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/diagnosis-role"/>
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element id="Encounter.diagnosis:dischargeDiagnosis.rank">
      <path value="Encounter.diagnosis.rank"/>
      <short value="Ranking of the diagnosis (for each role type)"/>
      <definition value="Ranking of the diagnosis (for each role type)."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Encounter.diagnosis.rank"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="positiveInt"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map value=".outboundRelationship[typeCode=RSON].priority"/>
      </mapping>
    </element>
    <element id="Encounter.diagnosis:otherDiagnosis">
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name">
        <valueString value="Diagnosis"/>
      </extension>
      <path value="Encounter.diagnosis"/>
      <sliceName value="otherDiagnosis"/>
      <short value="The list of diagnosis relevant to this encounter"/>
      <definition value="The list of diagnosis relevant to this encounter."/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="Encounter.diagnosis"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="BackboneElement"/>
      </type>
      <constraint>
        <key value="ele-1"/>
        <severity value="error"/>
        <human value="All FHIR elements must have a @value or children"/>
        <expression value="hasValue() | (children().count() &gt; id.count())"/>
        <xpath value="@value|f:*|h:div"/>
        <source value="Element"/>
      </constraint>
      <mustSupport value="true"/>
      <isSummary value="true"/>
      <mapping>
        <identity value="rim"/>
        <map value=".outboundRelationship[typeCode=RSON]"/>
      </mapping>
    </element>
    <element id="Encounter.diagnosis:otherDiagnosis.id">
      <path value="Encounter.diagnosis.id"/>
      <representation value="xmlAttr"/>
      <short value="xml:id (or equivalent in JSON)"/>
      <definition
                  value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Element.id"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="string"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element id="Encounter.diagnosis:otherDiagnosis.extension">
      <path value="Encounter.diagnosis.extension"/>
      <short value="Additional Content defined by implementations"/>
      <definition
                  value="May be used to represent additional information that is not part of the basic definition of the element. In order to make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."/>
      <comment
               value="There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone."/>
      <alias value="extensions"/>
      <alias value="user content"/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="Element.extension"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Extension"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element id="Encounter.diagnosis:otherDiagnosis.modifierExtension">
      <path value="Encounter.diagnosis.modifierExtension"/>
      <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 element, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions."/>
      <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"/>
      <alias value="modifiers"/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="BackboneElement.modifierExtension"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Extension"/>
      </type>
      <isModifier value="true"/>
      <isSummary value="true"/>
      <mapping>
        <identity value="rim"/>
        <map value="N/A"/>
      </mapping>
    </element>
    <element id="Encounter.diagnosis:otherDiagnosis.condition">
      <path value="Encounter.diagnosis.condition"/>
      <short value="Reason the encounter takes place (resource)"/>
      <definition
                  value="Reason the encounter takes place, as specified using information from another resource. For admissions, this is the admission diagnosis. The indication will typically be a Condition (with other resources referenced in the evidence.detail), or a Procedure."/>
      <comment
               value="For systems that need to know which was the primary diagnosis, these will be marked with the standard extension primaryDiagnosis (which is a sequence value rather than a flag, 1 = primary diagnosis)."/>
      <alias value="Admission diagnosis"/>
      <alias value="discharge diagnosis"/>
      <alias value="indication"/>
      <min value="1"/>
      <max value="1"/>
      <base>
        <path value="Encounter.diagnosis.condition"/>
        <min value="1"/>
        <max value="1"/>
      </base>
      <type>
        <code value="Reference"/>
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Condition"/>
      </type>
      <type>
        <code value="Reference"/>
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Procedure"/>
      </type>
      <mapping>
        <identity value="v2"/>
        <map
             value="Resources that would commonly referenced at Encounter.indication would be Condition and/or Procedure. These most closely align with DG1/PRB and PR1 respectively."/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map value=".outboundRelationship[typeCode=RSON].target"/>
      </mapping>
      <mapping>
        <identity value="w5"/>
        <map value="why"/>
      </mapping>
    </element>
    <element id="Encounter.diagnosis:otherDiagnosis.role">
      <path value="Encounter.diagnosis.role"/>
      <short
             value="Role that this diagnosis has within the encounter (e.g. admission, billing, discharge …)"/>
      <definition
                  value="Role that this diagnosis has within the encounter (e.g. admission, billing, discharge …)."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Encounter.diagnosis.role"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="CodeableConcept"/>
      </type>
      <binding>
        <extension
                   url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="DiagnosisRole"/>
        </extension>
        <extension
                   url="http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding">
          <valueBoolean value="true"/>
        </extension>
        <strength value="preferred"/>
        <description value="The type of diagnosis this condition represents"/>
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/diagnosis-role"/>
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element id="Encounter.diagnosis:otherDiagnosis.rank">
      <path value="Encounter.diagnosis.rank"/>
      <short value="Ranking of the diagnosis (for each role type)"/>
      <definition value="Ranking of the diagnosis (for each role type)."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Encounter.diagnosis.rank"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="positiveInt"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map value=".outboundRelationship[typeCode=RSON].priority"/>
      </mapping>
    </element>
    <element id="Encounter.account">
      <path value="Encounter.account"/>
      <short
             value="The set of accounts that may be used for billing for this Encounter"/>
      <definition
                  value="The set of accounts that may be used for billing for this Encounter."/>
      <comment
               value="The billing system may choose to allocate billable items associated with the Encounter to different referenced Accounts based on internal business rules."/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="Encounter.account"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Reference"/>
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Account"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map value=".pertains.A_Account"/>
      </mapping>
    </element>
    <element id="Encounter.hospitalization">
      <path value="Encounter.hospitalization"/>
      <short value="Details about the admission to a healthcare service"/>
      <definition value="Details about the admission to a healthcare service."/>
      <comment
               value="An Encounter may cover more than just the inpatient stay. Contexts such as outpatients, community clinics, and aged care facilities are also included.

The duration recorded in the period of this encounter covers the entire scope of this hospitalization record."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Encounter.hospitalization"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="BackboneElement"/>
      </type>
      <constraint>
        <key value="ele-1"/>
        <severity value="error"/>
        <human value="All FHIR elements must have a @value or children"/>
        <expression value="hasValue() | (children().count() &gt; id.count())"/>
        <xpath value="@value|f:*|h:div"/>
        <source value="Element"/>
      </constraint>
      <mapping>
        <identity value="rim"/>
        <map
             value=".outboundRelationship[typeCode=COMP].target[classCode=ENC, moodCode=EVN]"/>
      </mapping>
    </element>
    <element id="Encounter.hospitalization.id">
      <path value="Encounter.hospitalization.id"/>
      <representation value="xmlAttr"/>
      <short value="xml:id (or equivalent in JSON)"/>
      <definition
                  value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Element.id"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="string"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element id="Encounter.hospitalization.extension">
      <path value="Encounter.hospitalization.extension"/>
      <short value="Additional Content defined by implementations"/>
      <definition
                  value="May be used to represent additional information that is not part of the basic definition of the element. In order to make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."/>
      <comment
               value="There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone."/>
      <alias value="extensions"/>
      <alias value="user content"/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="Element.extension"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Extension"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element id="Encounter.hospitalization.modifierExtension">
      <path value="Encounter.hospitalization.modifierExtension"/>
      <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 element, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions."/>
      <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"/>
      <alias value="modifiers"/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="BackboneElement.modifierExtension"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Extension"/>
      </type>
      <isModifier value="true"/>
      <isSummary value="true"/>
      <mapping>
        <identity value="rim"/>
        <map value="N/A"/>
      </mapping>
    </element>
    <element id="Encounter.hospitalization.preAdmissionIdentifier">
      <path value="Encounter.hospitalization.preAdmissionIdentifier"/>
      <short value="Pre-admission identifier"/>
      <definition value="Pre-admission identifier."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Encounter.hospitalization.preAdmissionIdentifier"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="Identifier"/>
      </type>
      <mapping>
        <identity value="v2"/>
        <map value="PV1-5"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map value=".id"/>
      </mapping>
    </element>
    <element id="Encounter.hospitalization.origin">
      <path value="Encounter.hospitalization.origin"/>
      <short value="The location from which the patient came before admission"/>
      <definition
                  value="The location from which the patient came before admission."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Encounter.hospitalization.origin"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="Reference"/>
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Location"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map value=".participation[typeCode=ORG].role"/>
      </mapping>
    </element>
    <element id="Encounter.hospitalization.admitSource">
      <path value="Encounter.hospitalization.admitSource"/>
      <short
             value="From where patient was admitted (physician referral, transfer)"/>
      <definition
                  value="From where patient was admitted (physician referral, transfer)."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Encounter.hospitalization.admitSource"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="CodeableConcept"/>
      </type>
      <binding>
        <extension
                   url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="AdmitSource"/>
        </extension>
        <strength value="preferred"/>
        <description value="From where the patient was admitted."/>
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/encounter-admit-source"/>
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="v2"/>
        <map value="PV1-14"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map value=".admissionReferralSourceCode"/>
      </mapping>
    </element>
    <element id="Encounter.hospitalization.reAdmission">
      <path value="Encounter.hospitalization.reAdmission"/>
      <short
             value="The type of hospital re-admission that has occurred (if any). If the value is absent, then this is not identified as a readmission"/>
      <definition
                  value="Whether this hospitalization is a readmission and why if known."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Encounter.hospitalization.reAdmission"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="CodeableConcept"/>
      </type>
      <binding>
        <extension
                   url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="ReAdmissionType"/>
        </extension>
        <strength value="example"/>
        <description
                     value="The reason for re-admission of this hospitalization encounter."/>
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/v2-0092"/>
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="v2"/>
        <map value="PV1-13"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element id="Encounter.hospitalization.dietPreference">
      <path value="Encounter.hospitalization.dietPreference"/>
      <short value="Diet preferences reported by the patient"/>
      <definition value="Diet preferences reported by the patient."/>
      <comment
               value="For example a patient may request both a dairy-free and nut-free diet preference (not mutually exclusive)."/>
      <requirements
                    value="Used to track patient&#39;s diet restrictions and/or preference. For a complete description of the nutrition needs of a patient during their stay, one should use the nutritionOrder resource which links to Encounter."/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="Encounter.hospitalization.dietPreference"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="CodeableConcept"/>
      </type>
      <binding>
        <extension
                   url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="PatientDiet"/>
        </extension>
        <strength value="example"/>
        <description
                     value="Medical, cultural or ethical food preferences to help with catering requirements."/>
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/encounter-diet"/>
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="v2"/>
        <map value="PV1-38"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map
             value=".outboundRelationship[typeCode=COMP].target[classCode=SBADM, moodCode=EVN, code=&quot;diet&quot;]"/>
      </mapping>
    </element>
    <element id="Encounter.hospitalization.specialCourtesy">
      <path value="Encounter.hospitalization.specialCourtesy"/>
      <short value="Special courtesies (VIP, board member)"/>
      <definition value="Special courtesies (VIP, board member)."/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="Encounter.hospitalization.specialCourtesy"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="CodeableConcept"/>
      </type>
      <binding>
        <extension
                   url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="Courtesies"/>
        </extension>
        <strength value="preferred"/>
        <description value="Special courtesies"/>
        <valueSetReference>
          <reference
                     value="http://hl7.org/fhir/ValueSet/encounter-special-courtesy"/>
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="v2"/>
        <map value="PV1-16"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map value=".specialCourtesiesCode"/>
      </mapping>
    </element>
    <element id="Encounter.hospitalization.specialArrangement">
      <path value="Encounter.hospitalization.specialArrangement"/>
      <short value="Wheelchair, translator, stretcher, etc."/>
      <definition
                  value="Any special requests that have been made for this hospitalization encounter, such as the provision of specific equipment or other things."/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="Encounter.hospitalization.specialArrangement"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="CodeableConcept"/>
      </type>
      <binding>
        <extension
                   url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="Arrangements"/>
        </extension>
        <strength value="preferred"/>
        <description value="Special arrangements"/>
        <valueSetReference>
          <reference
                     value="http://hl7.org/fhir/ValueSet/encounter-special-arrangements"/>
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="v2"/>
        <map value="PV1-15 / OBR-30 / OBR-43"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map value=".specialArrangementCode"/>
      </mapping>
    </element>
    <element id="Encounter.hospitalization.destination">
      <path value="Encounter.hospitalization.destination"/>
      <short value="Location to which the patient is discharged"/>
      <definition value="Location to which the patient is discharged."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Encounter.hospitalization.destination"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="Reference"/>
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Location"/>
      </type>
      <mapping>
        <identity value="v2"/>
        <map value="PV1-37"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map value=".participation[typeCode=DST]"/>
      </mapping>
    </element>
    <element id="Encounter.hospitalization.dischargeDisposition">
      <path value="Encounter.hospitalization.dischargeDisposition"/>
      <short value="Category or kind of location after discharge"/>
      <definition value="Category or kind of location after discharge."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Encounter.hospitalization.dischargeDisposition"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="CodeableConcept"/>
      </type>
      <binding>
        <extension
                   url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="DischargeDisp"/>
        </extension>
        <strength value="example"/>
        <description value="Discharge Disposition"/>
        <valueSetReference>
          <reference
                     value="http://hl7.org/fhir/ValueSet/encounter-discharge-disposition"/>
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="v2"/>
        <map value="PV1-36"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map value=".dischargeDispositionCode"/>
      </mapping>
    </element>
    <element id="Encounter.location">
      <path value="Encounter.location"/>
      <short value="List of locations where the patient has been"/>
      <definition
                  value="List of locations where  the patient has been during this encounter."/>
      <comment
               value="Virtual encounters can be recorded in the Encounter by specifying a location reference to a location of type &quot;kind&quot; such as &quot;client&#39;s home&quot; and an encounter.class = &quot;virtual&quot;."/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="Encounter.location"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="BackboneElement"/>
      </type>
      <constraint>
        <key value="ele-1"/>
        <severity value="error"/>
        <human value="All FHIR elements must have a @value or children"/>
        <expression value="hasValue() | (children().count() &gt; id.count())"/>
        <xpath value="@value|f:*|h:div"/>
        <source value="Element"/>
      </constraint>
      <mustSupport value="true"/>
      <mapping>
        <identity value="rim"/>
        <map value=".participation[typeCode=LOC]"/>
      </mapping>
    </element>
    <element id="Encounter.location.id">
      <path value="Encounter.location.id"/>
      <representation value="xmlAttr"/>
      <short value="xml:id (or equivalent in JSON)"/>
      <definition
                  value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Element.id"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="string"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element id="Encounter.location.extension">
      <path value="Encounter.location.extension"/>
      <short value="Additional Content defined by implementations"/>
      <definition
                  value="May be used to represent additional information that is not part of the basic definition of the element. In order to make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."/>
      <comment
               value="There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone."/>
      <alias value="extensions"/>
      <alias value="user content"/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="Element.extension"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Extension"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element id="Encounter.location.modifierExtension">
      <path value="Encounter.location.modifierExtension"/>
      <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 element, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions."/>
      <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"/>
      <alias value="modifiers"/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="BackboneElement.modifierExtension"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Extension"/>
      </type>
      <isModifier value="true"/>
      <isSummary value="true"/>
      <mapping>
        <identity value="rim"/>
        <map value="N/A"/>
      </mapping>
    </element>
    <element id="Encounter.location.location">
      <path value="Encounter.location.location"/>
      <short value="Location the encounter takes place"/>
      <definition value="The location where the encounter takes place."/>
      <min value="1"/>
      <max value="1"/>
      <base>
        <path value="Encounter.location.location"/>
        <min value="1"/>
        <max value="1"/>
      </base>
      <type>
        <code value="Reference"/>
        <targetProfile
                       value="http://hl7.eu/fhir/trillium2/StructureDefinition/Location-uv-trillium2"/>
      </type>
      <mustSupport value="true"/>
      <mapping>
        <identity value="v2"/>
        <map value="PV1-3 / PV1-6 / PV1-11 / PV1-42 / PV1-43"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map value=".role"/>
      </mapping>
      <mapping>
        <identity value="w5"/>
        <map value="where"/>
      </mapping>
    </element>
    <element id="Encounter.location.location.id">
      <path value="Encounter.location.location.id"/>
      <representation value="xmlAttr"/>
      <short value="xml:id (or equivalent in JSON)"/>
      <definition
                  value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Element.id"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="string"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element id="Encounter.location.location.extension">
      <path value="Encounter.location.location.extension"/>
      <slicing>
        <discriminator>
          <type value="value"/>
          <path value="url"/>
        </discriminator>
        <description value="Extensions are always sliced by (at least) url"/>
        <rules value="open"/>
      </slicing>
      <short value="Additional Content defined by implementations"/>
      <definition
                  value="May be used to represent additional information that is not part of the basic definition of the element. In order to make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."/>
      <comment
               value="There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone."/>
      <alias value="extensions"/>
      <alias value="user content"/>
      <min value="0"/>
      <max value="*"/>
      <base>
        <path value="Element.extension"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Extension"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element id="Encounter.location.location.reference">
      <path value="Encounter.location.location.reference"/>
      <short value="Literal reference, Relative, internal or absolute URL"/>
      <definition
                  value="A reference to a location at which the other resource is found. The reference may be a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with &#39;#&#39;) refer to contained resources."/>
      <comment
               value="Using absolute URLs provides a stable scalable approach suitable for a cloud/web context, while using relative/logical references provides a flexible approach suitable for use when trading across closed eco-system boundaries.   Absolute URLs do not need to point to a FHIR RESTful server, though this is the preferred approach. If the URL conforms to the structure &quot;/[type]/[id]&quot; then it should be assumed that the reference is to a FHIR RESTful server."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Reference.reference"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="string"/>
      </type>
      <condition value="ref-1"/>
      <mustSupport value="true"/>
      <isSummary value="true"/>
      <mapping>
        <identity value="rim"/>
        <map value="N/A"/>
      </mapping>
    </element>
    <element id="Encounter.location.location.identifier">
      <path value="Encounter.location.location.identifier"/>
      <short value="Logical reference, when literal reference is not known"/>
      <definition
                  value="An identifier for the other resource. This is used when there is no way to reference the other resource directly, either because the entity is not available through a FHIR server, or because there is no way for the author of the resource to convert a known identifier to an actual location. There is no requirement that a Reference.identifier point to something that is actually exposed as a FHIR instance, but it SHALL point to a business concept that would be expected to be exposed as a FHIR instance, and that instance would need to be of a FHIR resource type allowed by the reference."/>
      <comment
               value="When an identifier is provided in place of a reference, any system processing the reference will only be able to resolve the identifier to a reference if it understands the business context in which the identifier is used. Sometimes this is global (e.g. a national identifier) but often it is not. For this reason, none of the useful mechanisms described for working with references (e.g. chaining, includes) are possible, nor should servers be expected to be able resolve the reference. Servers may accept an identifier based reference untouched, resolve it, and/or reject it - see CapabilityStatement.rest.resource.referencePolicy. 

When both an identifier and a literal reference are provided, the literal reference is preferred. Applications processing the resource are allowed - but not required - to check that the identifier matches the literal reference

Applications converting a logical reference to a literal reference may choose to leave the logical reference present, or remove it."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Reference.identifier"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="Identifier"/>
      </type>
      <isSummary value="true"/>
      <mapping>
        <identity value="rim"/>
        <map value=".identifier"/>
      </mapping>
    </element>
    <element id="Encounter.location.location.display">
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true"/>
      </extension>
      <path value="Encounter.location.location.display"/>
      <short value="Text alternative for the resource"/>
      <definition
                  value="Plain text narrative that identifies the resource in addition to the resource reference."/>
      <comment
               value="This is generally not the same as the Resource.text of the referenced resource.  The purpose is to identify what&#39;s being referenced, not to fully describe it."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Reference.display"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="string"/>
      </type>
      <isSummary value="true"/>
      <mapping>
        <identity value="rim"/>
        <map value="N/A"/>
      </mapping>
    </element>
    <element id="Encounter.location.status">
      <path value="Encounter.location.status"/>
      <short value="planned | active | reserved | completed"/>
      <definition
                  value="The status of the participants&#39; presence at the specified location during the period specified. If the participant is is no longer at the location, then the period will have an end date/time."/>
      <comment
               value="When the patient is no longer active at a location, then the period end date is entered, and the status may be changed to completed."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Encounter.location.status"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="code"/>
      </type>
      <binding>
        <extension
                   url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="EncounterLocationStatus"/>
        </extension>
        <strength value="required"/>
        <description value="The status of the location."/>
        <valueSetReference>
          <reference
                     value="http://hl7.org/fhir/ValueSet/encounter-location-status"/>
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="rim"/>
        <map value=".role.statusCode"/>
      </mapping>
    </element>
    <element id="Encounter.location.period">
      <path value="Encounter.location.period"/>
      <short
             value="Time period during which the patient was present at the location"/>
      <definition
                  value="Time period during which the patient was present at the location."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Encounter.location.period"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="Period"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map value=".time"/>
      </mapping>
    </element>
    <element id="Encounter.serviceProvider">
      <path value="Encounter.serviceProvider"/>
      <short value="The custodian organization of this Encounter record"/>
      <definition
                  value="An organization that is in charge of maintaining the information of this Encounter (e.g. who maintains the report or the master service catalog item, etc.). This MAY be the same as the organization on the Patient record, however it could be different. This MAY not be not the Service Delivery Location&#39;s Organization."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Encounter.serviceProvider"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="Reference"/>
        <targetProfile
                       value="http://hl7.eu/fhir/trillium2/StructureDefinition/Organization-observation-uv-ips"/>
      </type>
      <mustSupport value="true"/>
      <mapping>
        <identity value="v2"/>
        <map
             value="PV1-10 / PL.6  &amp; PL.1  (note: HL7 v2 definition is &quot;the treatment or type of surgery that the patient is scheduled to receive&quot;; seems slightly out of alignment with the concept name &#39;hospital service&#39;. Would not trust that implementations apply this semantic by default)"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map value=".particiaption[typeCode=PFM].role"/>
      </mapping>
    </element>
    <element id="Encounter.partOf">
      <path value="Encounter.partOf"/>
      <short value="Another Encounter this encounter is part of"/>
      <definition
                  value="Another Encounter of which this encounter is a part of (administratively or in time)."/>
      <comment
               value="This is also used for associating a child&#39;s encounter back to the mother&#39;s encounter.

Refer to the Notes section in the Patient resource for further details."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Encounter.partOf"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="Reference"/>
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Encounter"/>
      </type>
      <mapping>
        <identity value="rim"/>
        <map
             value=".inboundRelationship[typeCode=COMP].source[classCode=COMP, moodCode=EVN]"/>
      </mapping>
    </element>
  </snapshot>
  <differential>
    <element id="Encounter">
      <path value="Encounter"/>
      <mustSupport value="true"/>
    </element>
    <element id="Encounter.id">
      <path value="Encounter.id"/>
      <mustSupport value="true"/>
    </element>
    <element id="Encounter.meta">
      <path value="Encounter.meta"/>
      <mustSupport value="true"/>
    </element>
    <element id="Encounter.meta.profile">
      <path value="Encounter.meta.profile"/>
      <mustSupport value="true"/>
    </element>
    <element id="Encounter.text">
      <path value="Encounter.text"/>
      <mustSupport value="true"/>
    </element>
    <element id="Encounter.extension:documentedBy">
      <path value="Encounter.extension"/>
      <sliceName value="documentedBy"/>
      <type>
        <code value="Extension"/>
        <profile
                 value="http://hl7.eu/fhir/trillium2/StructureDefinition/documentedBy-uv-trillium2"/>
      </type>
      <mustSupport value="true"/>
    </element>
    <element id="Encounter.extension:documentedBy.extension:reference">
      <path value="Encounter.extension.extension"/>
      <sliceName value="reference"/>
      <mustSupport value="true"/>
    </element>
    <element
             id="Encounter.extension:documentedBy.extension:reference.valueReference:valueReference">
      <path value="Encounter.extension.extension.valueReference"/>
      <sliceName value="valueReference"/>
      <type>
        <code value="Reference"/>
        <targetProfile
                       value="http://hl7.eu/fhir/trillium2/StructureDefinition/DocumentReference-uv-trillium2"/>
      </type>
      <type>
        <code value="Reference"/>
        <targetProfile
                       value="http://hl7.eu/fhir/trillium2/StructureDefinition/imagingstudy-RefToEvidences-uv-trillium2"/>
      </type>
      <mustSupport value="true"/>
    </element>
    <element
             id="Encounter.extension:documentedBy.extension:reference.value[x].reference">
      <path value="Encounter.extension.extension.value[x].reference"/>
      <mustSupport value="true"/>
    </element>
    <element id="Encounter.type">
      <path value="Encounter.type"/>
      <mustSupport value="true"/>
    </element>
    <element id="Encounter.type.coding.code">
      <path value="Encounter.type.coding.code"/>
      <mustSupport value="true"/>
    </element>
    <element id="Encounter.subject">
      <path value="Encounter.subject"/>
      <min value="1"/>
      <type>
        <code value="Reference"/>
        <targetProfile
                       value="http://hl7.eu/fhir/trillium2/StructureDefinition/Patient-uv-ips"/>
      </type>
      <mustSupport value="true"/>
    </element>
    <element id="Encounter.participant">
      <path value="Encounter.participant"/>
      <slicing>
        <discriminator>
          <type value="value"/>
          <path value="type.coding.code"/>
        </discriminator>
        <rules value="openAtEnd"/>
      </slicing>
      <mustSupport value="true"/>
    </element>
    <element id="Encounter.participant:performer">
      <path value="Encounter.participant"/>
      <sliceName value="performer"/>
      <mustSupport value="true"/>
    </element>
    <element id="Encounter.participant:performer.type">
      <path value="Encounter.participant.type"/>
      <mustSupport value="false"/>
    </element>
    <element id="Encounter.participant:performer.individual">
      <path value="Encounter.participant.individual"/>
      <type>
        <code value="Reference"/>
        <targetProfile
                       value="http://hl7.eu/fhir/trillium2/StructureDefinition/Practitioner-uv-ips"/>
      </type>
      <mustSupport value="true"/>
    </element>
    <element id="Encounter.participant:performer.individual.reference">
      <path value="Encounter.participant.individual.reference"/>
      <mustSupport value="true"/>
    </element>
    <element id="Encounter.period">
      <path value="Encounter.period"/>
      <min value="1"/>
      <mustSupport value="true"/>
    </element>
    <element id="Encounter.period.start">
      <path value="Encounter.period.start"/>
      <mustSupport value="true"/>
    </element>
    <element id="Encounter.period.end">
      <path value="Encounter.period.end"/>
      <mustSupport value="true"/>
    </element>
    <element id="Encounter.reason">
      <path value="Encounter.reason"/>
      <mustSupport value="true"/>
    </element>
    <element id="Encounter.reason.coding">
      <path value="Encounter.reason.coding"/>
      <mustSupport value="true"/>
    </element>
    <element id="Encounter.reason.text">
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true"/>
      </extension>
      <path value="Encounter.reason.text"/>
      <mustSupport value="true"/>
    </element>
    <element id="Encounter.diagnosis">
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name">
        <valueString value="Diagnosis"/>
      </extension>
      <path value="Encounter.diagnosis"/>
      <slicing>
        <discriminator>
          <type value="value"/>
          <path value="role.coding.code"/>
        </discriminator>
        <rules value="open"/>
      </slicing>
      <mustSupport value="true"/>
    </element>
    <element id="Encounter.diagnosis:admissionDiagnosis">
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name">
        <valueString value="Diagnosis"/>
      </extension>
      <path value="Encounter.diagnosis"/>
      <sliceName value="admissionDiagnosis"/>
      <mustSupport value="true"/>
    </element>
    <element id="Encounter.diagnosis:admissionDiagnosis.role">
      <path value="Encounter.diagnosis.role"/>
      <min value="1"/>
      <fixedCodeableConcept>
        <coding>
          <system value="http://hl7.org/fhir/diagnosis-role"/>
          <code value="AD"/>
        </coding>
      </fixedCodeableConcept>
      <mustSupport value="true"/>
    </element>
    <element id="Encounter.diagnosis:dischargeDiagnosis">
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name">
        <valueString value="Diagnosis"/>
      </extension>
      <path value="Encounter.diagnosis"/>
      <sliceName value="dischargeDiagnosis"/>
      <mustSupport value="true"/>
    </element>
    <element id="Encounter.diagnosis:dischargeDiagnosis.role">
      <path value="Encounter.diagnosis.role"/>
      <min value="1"/>
      <fixedCodeableConcept>
        <coding>
          <system value="http://hl7.org/fhir/diagnosis-role"/>
          <code value="DD"/>
        </coding>
      </fixedCodeableConcept>
      <mustSupport value="true"/>
    </element>
    <element id="Encounter.diagnosis:otherDiagnosis">
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name">
        <valueString value="Diagnosis"/>
      </extension>
      <path value="Encounter.diagnosis"/>
      <sliceName value="otherDiagnosis"/>
      <mustSupport value="true"/>
    </element>
    <element id="Encounter.location">
      <path value="Encounter.location"/>
      <mustSupport value="true"/>
    </element>
    <element id="Encounter.location.location">
      <path value="Encounter.location.location"/>
      <type>
        <code value="Reference"/>
        <targetProfile
                       value="http://hl7.eu/fhir/trillium2/StructureDefinition/Location-uv-trillium2"/>
      </type>
      <mustSupport value="true"/>
    </element>
    <element id="Encounter.location.location.reference">
      <path value="Encounter.location.location.reference"/>
      <mustSupport value="true"/>
    </element>
    <element id="Encounter.serviceProvider">
      <path value="Encounter.serviceProvider"/>
      <type>
        <code value="Reference"/>
        <targetProfile
                       value="http://hl7.eu/fhir/trillium2/StructureDefinition/Organization-observation-uv-ips"/>
      </type>
      <mustSupport value="true"/>
    </element>
  </differential>
</StructureDefinition>