<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="spark1940" />
  <meta>
    <versionId value="spark2647" />
    <lastUpdated value="2016-03-04T12:06:52.726+00:00" />
  </meta>
  <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm">
    <valueInteger value="0" />
  </extension>
  <url value="http://hl7.no/fhir/StructureDefinition/noEncounter" />
  <version value="0.1" />
  <name value="hncEncounter" />
  <status value="draft" />
  <publisher value="HN" />
  <date value="2015-09-22T20:02:49+10:00" />
  <description value="Base StructureDefinition for Encounter Resource" />
  <fhirVersion value="1.0.1" />
  <mapping>
    <identity value="rim" />
    <uri value="http://hl7.org/v3" />
    <name value="RIM" />
  </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>
  <kind value="resource" />
  <constrainedType value="Encounter" />
  <abstract value="true" />
  <base value="http://hl7.org/fhir/StructureDefinition/Encounter" />
  <differential>
    <element>
      <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." />
      <comments value="id Internal DIPS Id" />
      <alias value="Visit" />
      <min value="0" />
      <max value="*" />
      <type>
        <code value="Encounter" />
      </type>
      <mapping>
        <identity value="rim" />
        <map value="Encounter[moodCode=EVN]" />
      </mapping>
      <mapping>
        <identity value="w5" />
        <map value="workflow.encounter" />
      </mapping>
    </element>
    <element>
      <path value="Encounter.identifier" />
      <short value="Omsorgsperiode id / ward stay id for inpatient, contact id for outpatient" />
      <definition value="Identifier(s) by which this encounter is known." />
      <comments value="Identifier(s) by which this encounter is known&#xD;&#xA;Omsorgsperiode id / ward stay id for inpatient, contact id for outpatient" />
      <min value="0" />
      <max value="*" />
      <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>
      <path value="Encounter.identifier.use" />
      <short value="usual | official | temp | secondary (If known)" />
      <definition value="The purpose of this identifier." />
      <comments value="This is labeled as &quot;Is Modifier&quot; because applications should not mistake a temporary id for a permanent one. Applications can assume that an identifier is permanent unless it explicitly says that it is temporary." />
      <requirements value="Allows the appropriate identifier for a particular context of use to be selected from among a set of identifiers." />
      <min value="0" />
      <max value="0" />
      <type>
        <code value="code" />
      </type>
      <isModifier value="true" />
      <isSummary value="true" />
      <binding>
        <strength value="required" />
        <description value="Identifies the purpose for this identifier, if known ." />
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/identifier-use" />
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="v2" />
        <map value="N/A" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="Role.code or implied by context" />
      </mapping>
    </element>
    <element>
      <path value="Encounter.identifier.type" />
      <short value="Description of identifier" />
      <definition value="A coded type for the identifier that can be used to determine which identifier to use for a specific purpose." />
      <comments value="This element deals only with general categories of identifiers.  It SHOULD not be used for codes that correspond 1..1 with the Identifier.system. Some identifiers may fall into multiple categories due to common usage.   Where the system is known, a type is unnecessary because the type is always part of the system definition. However systems often need to handle identifiers where the system is not known. There is not a 1:1 relationship between type and system, since many different systems have the same type." />
      <requirements value="Allows users to make use of identifiers when the identifier system is not known." />
      <min value="0" />
      <max value="0" />
      <type>
        <code value="CodeableConcept" />
      </type>
      <isSummary value="true" />
      <binding>
        <strength value="extensible" />
        <description value="A coded type for an identifier that can be used to determine which identifier to use for a specific purpose." />
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/identifier-type" />
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="v2" />
        <map value="CX.5" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="Role.code or implied by context" />
      </mapping>
    </element>
    <element>
      <path value="Encounter.identifier.system" />
      <short value="The namespace for the identifier" />
      <definition value="Establishes the namespace in which set of possible id values is unique." />
      <requirements value="There are many sequences of identifiers.  To perform matching, we need to know what sequence we're dealing with. The system identifies a particular sequence or set of unique identifiers." />
      <min value="0" />
      <max value="0" />
      <type>
        <code value="uri" />
      </type>
      <exampleUri value="http://www.acme.com/identifiers/patient or urn:ietf:rfc:3986 if the Identifier.value itself is a full uri" />
      <isSummary value="true" />
      <mapping>
        <identity value="v2" />
        <map value="CX.4 / EI-2-4" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="II.root or Role.id.root" />
      </mapping>
      <mapping>
        <identity value="servd" />
        <map value="./IdentifierType" />
      </mapping>
    </element>
    <element>
      <path value="Encounter.identifier.value" />
      <short value="The value that is unique" />
      <definition value="The portion of the identifier typically displayed to the user and which is unique within the context of the system." />
      <comments value="If the value is a full URI, then the system SHALL be urn:ietf:rfc:3986." />
      <min value="0" />
      <max value="0" />
      <type>
        <code value="string" />
      </type>
      <exampleString value="123456" />
      <isSummary value="true" />
      <mapping>
        <identity value="v2" />
        <map value="CX.1 / EI.1" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="II.extension or II.root if system indicates OID or GUID (Or Role.id.extension or root)" />
      </mapping>
      <mapping>
        <identity value="servd" />
        <map value="./Value" />
      </mapping>
    </element>
    <element>
      <path value="Encounter.identifier.period" />
      <short value="Time period when id is/was valid for use" />
      <definition value="Time period during which identifier is/was valid for use." />
      <min value="0" />
      <max value="0" />
      <type>
        <code value="Period" />
      </type>
      <isSummary value="true" />
      <mapping>
        <identity value="v2" />
        <map value="CX.7 + CX.8" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="Role.effectiveTime or implied by context" />
      </mapping>
      <mapping>
        <identity value="servd" />
        <map value="./StartDate and ./EndDate" />
      </mapping>
    </element>
    <element>
      <path value="Encounter.identifier.assigner" />
      <short value="Organization that issued id (may be just text)" />
      <definition value="Organization that issued/manages the identifier." />
      <comments value="The reference may be just a text description of the assigner." />
      <min value="0" />
      <max value="0" />
      <type>
        <code value="Reference" />
        <profile value="http://hl7.org/fhir/StructureDefinition/Organization" />
      </type>
      <isSummary value="true" />
      <mapping>
        <identity value="v2" />
        <map value="CX.4 / (CX.4,CX.9,CX.10)" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="II.assigningAuthorityName but note that this is an improper use by the definition of the field.  Also Role.scoper" />
      </mapping>
      <mapping>
        <identity value="servd" />
        <map value="./IdentifierIssuingAuthority" />
      </mapping>
    </element>
    <element>
      <path value="Encounter.status" />
      <short value="planned | arrived | in-progress | onleave | finished | cancelled" />
      <definition value="planned | arrived | in-progress | onleave | finished | cancelled." />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="code" />
      </type>
      <isModifier value="true" />
      <isSummary value="true" />
      <binding>
        <strength value="required" />
        <description value="Current state of the encounter" />
        <valueSetUri value="https://volven.helsedirektoratet.no/produkt.asp?id=271548&amp;catID=3&amp;subID=8" />
      </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>
      <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." />
      <comments value="The current status is always found in the current version of the resource, not the status history." />
      <min value="0" />
      <max value="0" />
      <type>
        <code value="BackboneElement" />
      </type>
    </element>
    <element>
      <path value="Encounter.class" />
      <short value="inpatient | outpatient | ambulatory | emergency +" />
      <definition value="inpatient | outpatient | ambulatory | emergency +." />
      <comments value="https://volven.helsedirektoratet.no/produkt.asp?id=272416&amp;catID=3&amp;subID=8&#xD;&#xA;&#xD;&#xA;urn:oid:2.16.578.1.12.4.1.8240 " />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="code" />
      </type>
      <isSummary value="true" />
      <binding>
        <strength value="required" />
        <description value="Classification of the encounter" />
        <valueSetUri value="https://volven.helsedirektoratet.no/produkt.asp?id=272416&amp;catID=3&amp;subID=8" />
      </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>
      <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." />
      <comments 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="0" />
      <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>
      <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)." />
      <comments value="Amongst a set of alternatives, a directly chosen code is the most appropriate starting point for new translations. There is some ambiguity about what exactly 'directly chosen' implies, and trading partner agreement may be needed to clarify the use of this element and its consequences more completely." />
      <requirements value="This has been identified as a clinical safety criterium - that this exact system/code pair was chosen explicitly, rather than inferred by the system based on some rules or language processing." />
      <min value="0" />
      <max value="0" />
      <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>
      <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." />
      <comments 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="0" />
      <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>
      <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="0" />
      <type>
        <code value="CodeableConcept" />
      </type>
      <binding>
        <strength value="example" />
        <description value="Indicates the urgency of the encounter." />
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/encounter-priority" />
        </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>
      <path value="Encounter.patient" />
      <short value="The patient present at the encounter" />
      <definition value="The patient present at the encounter." />
      <comments value="While the encounter is always about the patient, the patient may not actually be known in all contexts of use." />
      <alias value="patient" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <profile value="http://hl7.org/fhir/StructureDefinition/Patient" />
      </type>
      <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>
      <path value="Encounter.patient.reference" />
      <short value="Relative, internal or absolute URL reference" />
      <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 '#') refer to contained resources." />
      <comments 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="1" />
      <max value="1" />
      <type>
        <code value="string" />
      </type>
      <condition value="ref-1" />
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element>
      <path value="Encounter.patient.display" />
      <short value="Text alternative for the resource" />
      <definition value="Plain text narrative that identifies the resource in addition to the resource reference." />
      <comments value="This is generally not the same as the Resource.text of the referenced resource.  The purpose is to identify what's being referenced, not to fully describe it." />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="string" />
      </type>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element>
      <path value="Encounter.episodeOfCare" />
      <short value="Henvisningsperiode/Omsorgsperiode" />
      <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="*" />
      <type>
        <code value="Reference" />
        <profile 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="w5" />
        <map value="context" />
      </mapping>
    </element>
    <element>
      <path value="Encounter.episodeOfCare.reference" />
      <short value="Relative, internal or absolute URL reference" />
      <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 '#') refer to contained resources." />
      <comments 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="0" />
      <type>
        <code value="string" />
      </type>
      <condition value="ref-1" />
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element>
      <path value="Encounter.episodeOfCare.display" />
      <short value="Text alternative for the resource" />
      <definition value="Plain text narrative that identifies the resource in addition to the resource reference." />
      <comments value="This is generally not the same as the Resource.text of the referenced resource.  The purpose is to identify what's being referenced, not to fully describe it." />
      <min value="0" />
      <max value="0" />
      <type>
        <code value="string" />
      </type>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element>
      <path value="Encounter.incomingReferral" />
      <short value="HenvisningID, no need to be able to follow link at this point" />
      <definition value="The referral request this encounter satisfies (incoming referral)." />
      <min value="0" />
      <max value="*" />
      <type>
        <code value="Reference" />
        <profile value="http://hl7.org/fhir/StructureDefinition/ReferralRequest" />
      </type>
    </element>
    <element>
      <path value="Encounter.incomingReferral.reference" />
      <short value="Relative, internal or absolute URL reference" />
      <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 '#') refer to contained resources." />
      <comments 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="0" />
      <type>
        <code value="string" />
      </type>
      <condition value="ref-1" />
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element>
      <path value="Encounter.incomingReferral.display" />
      <short value="Text alternative for the resource" />
      <definition value="Plain text narrative that identifies the resource in addition to the resource reference." />
      <comments value="This is generally not the same as the Resource.text of the referenced resource.  The purpose is to identify what's being referenced, not to fully describe it." />
      <min value="0" />
      <max value="0" />
      <type>
        <code value="string" />
      </type>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element>
      <path value="Encounter.participant" />
      <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="0" />
      <type>
        <code value="BackboneElement" />
      </type>
      <isSummary value="true" />
      <mapping>
        <identity value="v2" />
        <map value="ROL" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".participation[typeCode=PFM]" />
      </mapping>
    </element>
    <element>
      <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="0" />
      <type>
        <code value="Reference" />
        <profile 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>
      <path value="Encounter.period.start" />
      <short value="Starting time with inclusive boundary" />
      <definition value="The start of the period. The boundary is inclusive." />
      <comments value="If the low element is missing, the meaning is that the low boundary is not known." />
      <min value="0" />
      <max value="0" />
      <type>
        <code value="dateTime" />
      </type>
      <condition value="per-1" />
      <isSummary value="true" />
      <mapping>
        <identity value="v2" />
        <map value="DR.1" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./low" />
      </mapping>
    </element>
    <element>
      <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." />
      <comments 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="0" />
      <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" />
      <isSummary value="true" />
      <mapping>
        <identity value="v2" />
        <map value="DR.2" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./high" />
      </mapping>
    </element>
    <element>
      <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." />
      <comments value="May differ from the time the Encounter.period lasted because of leave of absence." />
      <min value="0" />
      <max value="0" />
      <type>
        <code value="Quantity" />
        <profile value="http://hl7.org/fhir/StructureDefinition/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>
      <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." />
      <comments 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="0" />
      <type>
        <code value="CodeableConcept" />
      </type>
      <isSummary value="true" />
      <binding>
        <strength value="example" />
        <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>
      <path value="Encounter.indication" />
      <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." />
      <comments 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" />
      <min value="0" />
      <max value="0" />
      <type>
        <code value="Reference" />
        <profile value="http://hl7.org/fhir/StructureDefinition/Condition" />
      </type>
      <type>
        <code value="Reference" />
        <profile 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>
      <path value="Encounter.hospitalization" />
      <short value="Details about the admission to a healthcare service" />
      <definition value="Details about the admission to a healthcare service." />
      <comments 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="0" />
      <type>
        <code value="BackboneElement" />
      </type>
      <mapping>
        <identity value="rim" />
        <map value=".outboundRelationship[typeCode=COMP].target[classCode=ENC, moodCode=EVN]" />
      </mapping>
    </element>
    <element>
      <path value="Encounter.hospitalization.preAdmissionIdentifier.use" />
      <short value="usual | official | temp | secondary (If known)" />
      <definition value="The purpose of this identifier." />
      <comments value="This is labeled as &quot;Is Modifier&quot; because applications should not mistake a temporary id for a permanent one. Applications can assume that an identifier is permanent unless it explicitly says that it is temporary." />
      <requirements value="Allows the appropriate identifier for a particular context of use to be selected from among a set of identifiers." />
      <min value="0" />
      <max value="0" />
      <type>
        <code value="code" />
      </type>
      <isModifier value="true" />
      <isSummary value="true" />
      <binding>
        <strength value="required" />
        <description value="Identifies the purpose for this identifier, if known ." />
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/identifier-use" />
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="v2" />
        <map value="N/A" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="Role.code or implied by context" />
      </mapping>
    </element>
    <element>
      <path value="Encounter.hospitalization.preAdmissionIdentifier.type" />
      <short value="Description of identifier" />
      <definition value="A coded type for the identifier that can be used to determine which identifier to use for a specific purpose." />
      <comments value="This element deals only with general categories of identifiers.  It SHOULD not be used for codes that correspond 1..1 with the Identifier.system. Some identifiers may fall into multiple categories due to common usage.   Where the system is known, a type is unnecessary because the type is always part of the system definition. However systems often need to handle identifiers where the system is not known. There is not a 1:1 relationship between type and system, since many different systems have the same type." />
      <requirements value="Allows users to make use of identifiers when the identifier system is not known." />
      <min value="0" />
      <max value="0" />
      <type>
        <code value="CodeableConcept" />
      </type>
      <isSummary value="true" />
      <binding>
        <strength value="extensible" />
        <description value="A coded type for an identifier that can be used to determine which identifier to use for a specific purpose." />
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/identifier-type" />
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="v2" />
        <map value="CX.5" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="Role.code or implied by context" />
      </mapping>
    </element>
    <element>
      <path value="Encounter.hospitalization.preAdmissionIdentifier.period" />
      <short value="Time period when id is/was valid for use" />
      <definition value="Time period during which identifier is/was valid for use." />
      <min value="0" />
      <max value="0" />
      <type>
        <code value="Period" />
      </type>
      <isSummary value="true" />
      <mapping>
        <identity value="v2" />
        <map value="CX.7 + CX.8" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="Role.effectiveTime or implied by context" />
      </mapping>
      <mapping>
        <identity value="servd" />
        <map value="./StartDate and ./EndDate" />
      </mapping>
    </element>
    <element>
      <path value="Encounter.hospitalization.preAdmissionIdentifier.assigner" />
      <short value="Organization that issued id (may be just text)" />
      <definition value="Organization that issued/manages the identifier." />
      <comments value="The reference may be just a text description of the assigner." />
      <min value="0" />
      <max value="0" />
      <type>
        <code value="Reference" />
        <profile value="http://hl7.org/fhir/StructureDefinition/Organization" />
      </type>
      <isSummary value="true" />
      <mapping>
        <identity value="v2" />
        <map value="CX.4 / (CX.4,CX.9,CX.10)" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="II.assigningAuthorityName but note that this is an improper use by the definition of the field.  Also Role.scoper" />
      </mapping>
      <mapping>
        <identity value="servd" />
        <map value="./IdentifierIssuingAuthority" />
      </mapping>
    </element>
    <element>
      <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="0" />
      <type>
        <code value="Reference" />
        <profile value="http://hl7.org/fhir/StructureDefinition/Location" />
      </type>
      <mapping>
        <identity value="rim" />
        <map value=".participation[typeCode=ORG].role" />
      </mapping>
    </element>
    <element>
      <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="0" />
      <type>
        <code value="CodeableConcept" />
      </type>
      <binding>
        <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>
      <path value="Encounter.hospitalization.admittingDiagnosis" />
      <short value="The admitting diagnosis as reported by admitting practitioner" />
      <definition value="The admitting diagnosis field is used to record the diagnosis codes as reported by admitting practitioner. This could be different or in addition to the conditions reported as reason-condition(s) for the encounter." />
      <min value="0" />
      <max value="0" />
      <type>
        <code value="Reference" />
        <profile value="http://hl7.org/fhir/StructureDefinition/Condition" />
      </type>
    </element>
    <element>
      <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="0" />
      <type>
        <code value="CodeableConcept" />
      </type>
      <binding>
        <strength value="example" />
        <description value="The reason for re-admission of this hospitalization encounter." />
      </binding>
      <mapping>
        <identity value="v2" />
        <map value="PV1-13" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="Propose at harmonization" />
      </mapping>
    </element>
    <element>
      <path value="Encounter.hospitalization.dietPreference" />
      <short value="Diet preferences reported by the patient" />
      <definition value="Diet preferences reported by the patient." />
      <comments 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'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="0" />
      <type>
        <code value="CodeableConcept" />
      </type>
      <binding>
        <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>
      <path value="Encounter.hospitalization.specialCourtesy" />
      <short value="Special courtesies (VIP, board member)" />
      <definition value="Special courtesies (VIP, board member)." />
      <min value="0" />
      <max value="0" />
      <type>
        <code value="CodeableConcept" />
      </type>
      <binding>
        <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>
      <path value="Encounter.hospitalization.specialArrangement" />
      <short value="Wheelchair, translator, stretcher, etc." />
      <definition value="Wheelchair, translator, stretcher, etc." />
      <min value="0" />
      <max value="0" />
      <type>
        <code value="CodeableConcept" />
      </type>
      <binding>
        <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>
      <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="0" />
      <type>
        <code value="Reference" />
        <profile 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>
      <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="0" />
      <type>
        <code value="CodeableConcept" />
      </type>
      <binding>
        <strength value="preferred" />
        <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>
      <path value="Encounter.hospitalization.dischargeDiagnosis" />
      <short value="The final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete" />
      <definition value="The final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete." />
      <min value="0" />
      <max value="0" />
      <type>
        <code value="Reference" />
        <profile value="http://hl7.org/fhir/StructureDefinition/Condition" />
      </type>
      <mapping>
        <identity value="rim" />
        <map value=".outboundRelationship[typeCode=OUT].target[classCode=OBS, moodCode=EVN, code=ASSERTION].value" />
      </mapping>
    </element>
    <element>
      <path value="Encounter.location" />
      <short value="List of locations where the patient has been, location can be bed, ward or outpatientlocation " />
      <definition value="The physical locations where  the patient has been during this encounter. can be one or more.. Typicalli bed  changes and ward changes can result in more than one location." />
      <comments value="This should contain the link to the patients physical location.  " />
      <min value="0" />
      <max value="*" />
      <type>
        <code value="BackboneElement" />
      </type>
      <mapping>
        <identity value="rim" />
        <map value=".participation[typeCode=LOC]" />
      </mapping>
    </element>
    <element>
      <path value="Encounter.location.location" />
      <short value="Location the encounter takes place" />
      <definition value="The location where the encounter takes place." />
      <comments value="Maps to department in Metavision" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <profile value="http://hl7.org/fhir/StructureDefinition/Location" />
      </type>
      <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>
      <path value="Encounter.location.location.reference" />
      <short value="Relative, internal or absolute URL reference" />
      <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 '#') refer to contained resources." />
      <comments 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" />
      <type>
        <code value="string" />
      </type>
      <condition value="ref-1" />
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element>
      <path value="Encounter.location.status" />
      <short value="planned | active | reserved | completed" />
      <definition value="The status of the participants' 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." />
      <comments value="When the patient is no longer active at a location, then the period end date is entered, and the status should be changed to completed.&#xD;&#xA;For planned encounters status is set to planned and period will be the appointment time." />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="code" />
      </type>
      <binding>
        <strength value="required" />
        <description value="The status of the location." />
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/encounter-location-status" />
        </valueSetReference>
      </binding>
    </element>
    <element>
      <path value="Encounter.location.period.start" />
      <short value="Starting time with inclusive boundary" />
      <definition value="The start of the period. The boundary is inclusive." />
      <comments value="If the low element is missing, the meaning is that the low boundary is not known." />
      <min value="0" />
      <max value="0" />
      <type>
        <code value="dateTime" />
      </type>
      <condition value="per-1" />
      <isSummary value="true" />
      <mapping>
        <identity value="v2" />
        <map value="DR.1" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./low" />
      </mapping>
    </element>
    <element>
      <path value="Encounter.location.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." />
      <comments 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="0" />
      <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" />
      <isSummary value="true" />
      <mapping>
        <identity value="v2" />
        <map value="DR.2" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./high" />
      </mapping>
    </element>
    <element>
      <path value="Encounter.serviceProvider" />
      <short value="The clinical organisationunit responsible for the patient (section/Careteam)" />
      <definition value="Linc to the clinical organization, Avdeling (department)  or Seksjon in DIPS depending on how this is maintained by the organisation. In Helse Nord this link is maintained on the section level.  This link will be available both for inpatient and outpatients.  " />
      <comments value="Will map to section or department in DIPS based on procedures, in Helse Nord it will be section.  Maps to CareTeam in Metavision.&#xD;&#xA;" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <profile value="http://hl7.org/fhir/StructureDefinition/Organization" />
      </type>
      <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 'hospital service'. Would not trust that implementations apply this semantic by default)" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".particiaption[typeCode=PFM].role" />
      </mapping>
    </element>
    <element>
      <path value="Encounter.serviceProvider.reference" />
      <short value="Relative, internal or absolute URL reference" />
      <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 '#') refer to contained resources." />
      <comments 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="0" />
      <type>
        <code value="string" />
      </type>
      <condition value="ref-1" />
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element>
      <path value="Encounter.serviceProvider.display" />
      <short value="Text alternative for the resource" />
      <definition value="Plain text narrative that identifies the resource in addition to the resource reference." />
      <comments value="This is generally not the same as the Resource.text of the referenced resource.  The purpose is to identify what's being referenced, not to fully describe it." />
      <min value="0" />
      <max value="0" />
      <type>
        <code value="string" />
      </type>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element>
      <path value="Encounter.partOf" />
      <short value="Another Encounter this encounter is part of  Shuld be used for tecnical encounters and outpatient encounters when inpatient.  For parallel encounters that are independent it should not be a link. Example somatic and psykiatric stays." />
      <definition value="Another Encounter of which this encounter is a part of (administratively or in time)." />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <profile value="http://hl7.org/fhir/StructureDefinition/Encounter" />
      </type>
      <mapping>
        <identity value="rim" />
        <map value=".inboundRelationship[typeCode=COMP].source[classCode=COMP, moodCode=EVN]" />
      </mapping>
    </element>
    <element>
      <path value="Encounter.partOf.reference" />
      <short value="Relative, internal or absolute URL reference" />
      <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 '#') refer to contained resources." />
      <comments 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="0" />
      <type>
        <code value="string" />
      </type>
      <condition value="ref-1" />
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element>
      <path value="Encounter.partOf.display" />
      <short value="Text alternative for the resource" />
      <definition value="Plain text narrative that identifies the resource in addition to the resource reference." />
      <comments value="This is generally not the same as the Resource.text of the referenced resource.  The purpose is to identify what's being referenced, not to fully describe it." />
      <min value="0" />
      <max value="0" />
      <type>
        <code value="string" />
      </type>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
  </differential>
</StructureDefinition>