<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="Encounter" />
  <meta>
    <lastUpdated value="2019-11-01T09:29:23.356+11:00" />
  </meta>
  <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-category">
    <valueString value="Base.Management" />
  </extension>
  <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status">
    <valueCode value="trial-use" />
  </extension>
  <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm">
    <valueInteger value="2" />
  </extension>
  <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-security-category">
    <valueCode value="patient" />
  </extension>
  <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-wg">
    <valueCode value="pa" />
  </extension>
  <url value="https://fhir.kemkes.go.id/r4/StructureDefinition/Encounter" />
  <version value="4.0.1" />
  <name value="Encounter" />
  <status value="draft" />
  <date value="2022-07-08T15:10:50.6856647+00:00" />
  <publisher value="Health Level Seven International (Patient Administration)" />
  <contact>
    <telecom>
      <system value="url" />
      <value value="http://hl7.org/fhir" />
    </telecom>
  </contact>
  <contact>
    <telecom>
      <system value="url" />
      <value value="http://www.hl7.org/Special/committees/pafm/index.cfm" />
    </telecom>
  </contact>
  <description 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." />
  <fhirVersion value="4.0.1" />
  <mapping>
    <identity value="workflow" />
    <uri value="http://hl7.org/fhir/workflow" />
    <name value="Workflow Pattern" />
  </mapping>
  <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/fivews" />
    <name value="FiveWs Pattern 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/DomainResource" />
  <derivation value="specialization" />
  <differential>
    <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" />
      <mapping>
        <identity value="workflow" />
        <map value="Event" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="Encounter[@moodCode='EVN']" />
      </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." />
      <type>
        <code value="Identifier" />
      </type>
      <isSummary value="true" />
      <mapping>
        <identity value="workflow" />
        <map value="Event.identifier" />
      </mapping>
      <mapping>
        <identity value="w5" />
        <map value="FiveWs.identifier" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="PV1-19" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <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 determine the appropriate transitions that may occur between statuses (and also classes)." />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="code" />
      </type>
      <isModifier value="true" />
      <isModifierReason value="This element is labeled as a modifier because it is a status element that contains status entered-in-error which means that the resource should not be treated as valid" />
      <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." />
        <valueSet value="http://hl7.org/fhir/ValueSet/encounter-status|4.0.1" />
      </binding>
      <mapping>
        <identity value="workflow" />
        <map value="Event.status" />
      </mapping>
      <mapping>
        <identity value="w5" />
        <map value="FiveWs.status" />
      </mapping>
      <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>
    </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." />
      <type>
        <code value="BackboneElement" />
      </type>
    </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" />
      <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." />
        <valueSet value="http://hl7.org/fhir/ValueSet/encounter-status|4.0.1" />
      </binding>
    </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" />
      <type>
        <code value="Period" />
      </type>
    </element>
    <element id="Encounter.class">
      <path value="Encounter.class" />
      <short value="Classification of patient encounter" />
      <definition value="Concepts representing classification of patient encounter such as ambulatory (outpatient), inpatient, emergency, home health or others due to local variations." />
      <min value="1" />
      <max value="1" />
      <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." />
        <valueSet value="http://terminology.hl7.org/ValueSet/v3-ActEncounterCode" />
      </binding>
      <mapping>
        <identity value="w5" />
        <map value="FiveWs.class" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="PV1-2" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".inboundRelationship[typeCode=SUBJ].source[classCode=LIST].code" />
      </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 transitions 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 kind of discharge from emergency to inpatient." />
      <type>
        <code value="BackboneElement" />
      </type>
    </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" />
      <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." />
        <valueSet value="http://terminology.hl7.org/ValueSet/v3-ActEncounterCode" />
      </binding>
    </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" />
      <type>
        <code value="Period" />
      </type>
    </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..*." />
      <type>
        <code value="CodeableConcept" />
      </type>
      <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." />
        <valueSet value="http://hl7.org/fhir/ValueSet/encounter-type" />
      </binding>
      <mapping>
        <identity value="workflow" />
        <map value="Event.code" />
      </mapping>
      <mapping>
        <identity value="w5" />
        <map value="FiveWs.class" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="PV1-4 / PV1-18" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".code" />
      </mapping>
    </element>
    <element id="Encounter.serviceType">
      <path value="Encounter.serviceType" />
      <short value="Specific type of service" />
      <definition value="Broad categorization of the service that is to be provided (e.g. cardiology)." />
      <max value="1" />
      <type>
        <code value="CodeableConcept" />
      </type>
      <isSummary value="true" />
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="EncounterServiceType" />
        </extension>
        <strength value="example" />
        <description value="Broad categorization of the service that is to be provided." />
        <valueSet value="http://hl7.org/fhir/ValueSet/service-type" />
      </binding>
      <mapping>
        <identity value="workflow" />
        <map value="Event.code" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="PV1-10" />
      </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." />
      <max value="1" />
      <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." />
        <valueSet value="http://terminology.hl7.org/ValueSet/v3-ActPriority" />
      </binding>
      <mapping>
        <identity value="w5" />
        <map value="FiveWs.grade" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="PV2-25" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".priorityCode" />
      </mapping>
    </element>
    <element id="Encounter.subject">
      <path value="Encounter.subject" />
      <short value="The patient or group present at the encounter" />
      <definition value="The patient or group present at the encounter." />
      <comment value="While the encounter is always about the patient, the patient might 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" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Patient" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Group" />
      </type>
      <isSummary value="true" />
      <mapping>
        <identity value="workflow" />
        <map value="Event.subject" />
      </mapping>
      <mapping>
        <identity value="w5" />
        <map value="FiveWs.subject[x]" />
      </mapping>
      <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="FiveWs.subject" />
      </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)." />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/EpisodeOfCare" />
      </type>
      <isSummary value="true" />
      <mapping>
        <identity value="workflow" />
        <map value="Event.context" />
      </mapping>
      <mapping>
        <identity value="w5" />
        <map value="FiveWs.context" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="PV1-54, PV1-53" />
      </mapping>
    </element>
    <element id="Encounter.basedOn">
      <path value="Encounter.basedOn" />
      <short value="The ServiceRequest that initiated this encounter" />
      <definition value="The request this encounter satisfies (e.g. incoming referral or procedure request)." />
      <alias value="incomingReferral" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/ServiceRequest" />
      </type>
      <mapping>
        <identity value="workflow" />
        <map value="Event.basedOn" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".reason.ClinicalDocument" />
      </mapping>
    </element>
    <element id="Encounter.participant">
      <path value="Encounter.participant" />
      <short value="List of participants involved in the encounter" />
      <definition value="The list of people responsible for providing the service." />
      <type>
        <code value="BackboneElement" />
      </type>
      <isSummary value="true" />
      <mapping>
        <identity value="workflow" />
        <map value="Event.performer" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="ROL" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".participation[typeCode=PFM]" />
      </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 participates 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." />
      <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." />
        <valueSet value="http://hl7.org/fhir/ValueSet/encounter-participant-type" />
      </binding>
      <mapping>
        <identity value="workflow" />
        <map value="Event.performer.function" />
      </mapping>
      <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's period." />
      <max value="1" />
      <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." />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Practitioner" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/PractitionerRole" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/RelatedPerson" />
      </type>
      <isSummary value="true" />
      <mapping>
        <identity value="workflow" />
        <map value="Event.performer.actor" />
      </mapping>
      <mapping>
        <identity value="w5" />
        <map value="FiveWs.who" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="ROL-4" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".role" />
      </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." />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Appointment" />
      </type>
      <isSummary value="true" />
      <mapping>
        <identity value="workflow" />
        <map value="Event.basedOn" />
      </mapping>
      <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." />
      <max value="1" />
      <type>
        <code value="Period" />
      </type>
      <mapping>
        <identity value="workflow" />
        <map value="Event.occurrence[x]" />
      </mapping>
      <mapping>
        <identity value="w5" />
        <map value="FiveWs.done[x]" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="PV1-44, PV1-45" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".effectiveTime (low &amp; 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." />
      <max value="1" />
      <type>
        <code value="Duration" />
      </type>
      <mapping>
        <identity value="workflow" />
        <map value="Event.occurrence[x]" />
      </mapping>
      <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.reasonCode">
      <path value="Encounter.reasonCode" />
      <short value="Coded reason the encounter takes place" />
      <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" />
      <type>
        <code value="CodeableConcept" />
      </type>
      <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." />
        <valueSet value="http://hl7.org/fhir/ValueSet/encounter-reason" />
      </binding>
      <mapping>
        <identity value="workflow" />
        <map value="Event.reasonCode" />
      </mapping>
      <mapping>
        <identity value="w5" />
        <map value="FiveWs.why[x]" />
      </mapping>
      <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>
    </element>
    <element id="Encounter.reasonReference">
      <path value="Encounter.reasonReference" />
      <short value="Reason the encounter takes place (reference)" />
      <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" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Condition" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Procedure" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Observation" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/ImmunizationRecommendation" />
      </type>
      <isSummary value="true" />
      <mapping>
        <identity value="workflow" />
        <map value="Event.reasonCode" />
      </mapping>
      <mapping>
        <identity value="w5" />
        <map value="FiveWs.why[x]" />
      </mapping>
      <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>
    </element>
    <element id="Encounter.diagnosis">
      <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name">
        <valueString value="Diagnosis" />
      </extension>
      <path value="Encounter.diagnosis" />
      <short value="The list of diagnosis relevant to this encounter" />
      <definition value="The list of diagnosis relevant to this encounter." />
      <type>
        <code value="BackboneElement" />
      </type>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value=".outboundRelationship[typeCode=RSON]" />
      </mapping>
    </element>
    <element id="Encounter.diagnosis.condition">
      <path value="Encounter.diagnosis.condition" />
      <short value="The diagnosis or procedure relevant to the encounter" />
      <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" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Condition" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Procedure" />
      </type>
      <isSummary value="true" />
      <mapping>
        <identity value="workflow" />
        <map value="Event.reasonReference" />
      </mapping>
      <mapping>
        <identity value="w5" />
        <map value="FiveWs.why[x]" />
      </mapping>
      <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>
    </element>
    <element id="Encounter.diagnosis.use">
      <path value="Encounter.diagnosis.use" />
      <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 …)." />
      <max value="1" />
      <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." />
        <valueSet value="http://hl7.org/fhir/ValueSet/diagnosis-role" />
      </binding>
    </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)." />
      <max value="1" />
      <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." />
      <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.&#xD;&#xD;The duration recorded in the period of this encounter covers the entire scope of this hospitalization record." />
      <max value="1" />
      <type>
        <code value="BackboneElement" />
      </type>
      <mapping>
        <identity value="rim" />
        <map value=".outboundRelationship[typeCode=COMP].target[classCode=ENC, moodCode=EVN]" />
      </mapping>
    </element>
    <element id="Encounter.hospitalization.preAdmissionIdentifier">
      <path value="Encounter.hospitalization.preAdmissionIdentifier" />
      <short value="Pre-admission identifier" />
      <definition value="Pre-admission identifier." />
      <max value="1" />
      <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/organization from which the patient came before admission" />
      <definition value="The location/organization from which the patient came before admission." />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Location" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Organization" />
      </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)." />
      <max value="1" />
      <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." />
        <valueSet value="http://hl7.org/fhir/ValueSet/encounter-admit-source" />
      </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." />
      <max value="1" />
      <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." />
        <valueSet value="http://terminology.hl7.org/ValueSet/v2-0092" />
      </binding>
      <mapping>
        <identity value="v2" />
        <map value="PV1-13" />
      </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'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." />
      <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." />
        <valueSet value="http://hl7.org/fhir/ValueSet/encounter-diet" />
      </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)." />
      <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." />
        <valueSet value="http://hl7.org/fhir/ValueSet/encounter-special-courtesy" />
      </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." />
      <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." />
        <valueSet value="http://hl7.org/fhir/ValueSet/encounter-special-arrangements" />
      </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/organization to which the patient is discharged" />
      <definition value="Location/organization to which the patient is discharged." />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Location" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Organization" />
      </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." />
      <max value="1" />
      <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." />
        <valueSet value="http://hl7.org/fhir/ValueSet/encounter-discharge-disposition" />
      </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's home&quot; and an encounter.class = &quot;virtual&quot;." />
      <type>
        <code value="BackboneElement" />
      </type>
      <mapping>
        <identity value="rim" />
        <map value=".participation[typeCode=LOC]" />
      </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" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Location" />
      </type>
      <mapping>
        <identity value="workflow" />
        <map value="Event.location" />
      </mapping>
      <mapping>
        <identity value="w5" />
        <map value="FiveWs.where[x]" />
      </mapping>
      <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>
    </element>
    <element id="Encounter.location.status">
      <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 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." />
      <max value="1" />
      <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." />
        <valueSet value="http://hl7.org/fhir/ValueSet/encounter-location-status|4.0.1" />
      </binding>
      <mapping>
        <identity value="rim" />
        <map value=".role.statusCode" />
      </mapping>
    </element>
    <element id="Encounter.location.physicalType">
      <path value="Encounter.location.physicalType" />
      <short value="The physical type of the location (usually the level in the location hierachy - bed room ward etc.)" />
      <definition value="This will be used to specify the required levels (bed/ward/room/etc.) desired to be recorded to simplify either messaging or query." />
      <comment value="This information is de-normalized from the Location resource to support the easier understanding of the encounter resource and processing in messaging or query.&#xA;&#xA;There may be many levels in the hierachy, and this may only pic specific levels that are required for a specific usage scenario." />
      <max value="1" />
      <type>
        <code value="CodeableConcept" />
      </type>
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="PhysicalType" />
        </extension>
        <strength value="example" />
        <description value="Physical form of the location." />
        <valueSet value="http://hl7.org/fhir/ValueSet/location-physical-type" />
      </binding>
    </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." />
      <max value="1" />
      <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 organization (facility) responsible for this encounter" />
      <definition value="The organization that is primarily responsible for this Encounter's services. This MAY be the same as the organization on the Patient record, however it could be different, such as if the actor performing the services was from an external organization (which may be billed seperately) for an external consultation.  Refer to the example bundle showing an abbreviated set of Encounters for a colonoscopy." />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Organization" />
      </type>
      <mapping>
        <identity value="workflow" />
        <map value="Event.performer.actor" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="PL.6  &amp; PL.1" />
      </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's encounter back to the mother's encounter.&#xD;&#xD;Refer to the Notes section in the Patient resource for further details." />
      <max value="1" />
      <type>
        <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-hierarchy">
          <valueBoolean value="true" />
        </extension>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Encounter" />
      </type>
      <mapping>
        <identity value="workflow" />
        <map value="Event.partOf" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".inboundRelationship[typeCode=COMP].source[classCode=COMP, moodCode=EVN]" />
      </mapping>
    </element>
  </differential>
</StructureDefinition>