### ----------------------------------------------------
### -- FHIR
### -- Licenses: Artistic-2.0
### -- Authors: Hugh Simpson
### -- File: t/resources/structureDefinition/Encounter.json
### ----------------------------------------------------
### -- Chunk 12 of 13
 {
        "identity" : "w5",
        "map" : "FiveWs.where[x]"
      },
      {
        "identity" : "v2",
        "map" : "PV1-3 / PV1-6 / PV1-11 / PV1-42 / PV1-43"
      },
      {
        "identity" : "rim",
        "map" : ".role"
      }]
    },
    {
      "id" : "Encounter.location.status",
      "path" : "Encounter.location.status",
      "short" : "planned | active | reserved | completed",
      "definition" : "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" : "When the patient is no longer active at a location, then the period end date is entered, and the status may be changed to completed.",
      "min" : 0,
      "max" : "1",
      "base" : {
        "path" : "Encounter.location.status",
        "min" : 0,
        "max" : "1"
      },
      "type" : [{
        "code" : "code"
      }],
      "isModifier" : false,
      "isSummary" : false,
      "binding" : {
        "extension" : [{
          "url" : "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
          "valueString" : "EncounterLocationStatus"
        }],
        "strength" : "required",
        "description" : "The status of the location.",
        "valueSet" : "http://hl7.org/fhir/ValueSet/encounter-location-status|4.0.0"
      },
      "mapping" : [{
        "identity" : "rim",
        "map" : ".role.statusCode"
      }]
    },
    {
      "id" : "Encounter.location.physicalType",
      "path" : "Encounter.location.physicalType",
      "short" : "The physical type of the location (usually the level in the location hierachy - bed room ward etc.)",
      "definition" : "This will be used to specify the required levels (bed/ward/room/etc.) desired to be recorded to simplify either messaging or query.",
      "comment" : "This information is de-normalized from the Location resource to support the easier understanding of the encounter resource and processing in messaging or query.\n\nThere may be many levels in the hierachy, and this may only pic specific levels that are required for a specific usage scenario.",
      "min" : 0,
      "max" : "1",
      "base" : {
        "path" : "Encounter.location.physicalType",
        "min" : 0,
        "max" : "1"
      },
      "type" : [{
        "code" : "CodeableConcept"
      }],
      "isModifier" : false,
      "isSummary" : false,
      "binding" : {
        "extension" : [{
          "url" : "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
          "valueString" : "PhysicalType"
        }],
        "strength" : "example",
        "description" : "Physical form of the location.",
        "valueSet" : "http://hl7.org/fhir/ValueSet/location-physical-type"
      }
    },
    {
      "id" : "Encounter.location.period",
      "path" : "Encounter.location.period",
      "short" : "Time period during which the patient was present at the location",
      "definition" : "Time period during which the patient was present at the location.",
      "min" : 0,
      "max" : "1",
      "base" : {
        "path" : "Encounter.location.period",
        "min" : 0,
        "max" : "1"
      },
      "type" : [{
        "code" : "Period"
      }],
      "isModifier" : false,
      "isSummary" : false,
      "mapping" : [{
        "identity" : "rim",
        "map" : ".time"
      }]
    },
    {
      "id" : "Encounter.serviceProvider",
      "path" : "Encounter.serviceProvider",
      "short" : "The organization (facility) responsible for this encounter",
      "definition" : "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.",
      "min" : 0,
      "max" : "1",
      "base" : {
        "path" : "Encounter.serviceProvider",
        "min" : 0,
        "max" : "1"
      },
      "type" : [{
        "code" : "Reference",
        "targetProfile" : ["http://hl7.org/fhir/StructureDefinition/Organization"]
      }],
      "isModifier" : false,
      "isSummary" : false,
      "mapping" : [{
        "identity" : "workflow",
        "map" : "Event.performer.actor"
      },
      {
        "identity" : "v2",
        "map" : "PL.6  & PL.1"
      },
      {
        "identity" : "rim",
        "map" : ".particiaption[typeCode=PFM].role"
      }]
    },
    {
      "id" : "Encounter.partOf",
      "path" : "Encounter.partOf",
      "short" : "Another Encounter this encounter is part of",
      "definition" : "Another Encounter of which this encounter is a part of (administratively or in time).",
      "comment" : "This is also used for associating a child's encounter back to the mother's encounter.\r\rRefer to the Notes section in the Patient resource for further details.",
      "min" : 0,
      "max" : "1",
      "base" : {
        "path" : "Encounter.partOf",
        "min" : 0,
        "max" : "1"
      },
      "type" : [{
        "extension" : [{
          "url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-hierarchy",
          "valueBoolean" : true
        }],
        "code" : "Reference",
        "targetProfile" : ["http://hl7.org/fhir/StructureDefinition/Encounter"]
      }],
      "isModifier" : false,
      "isSummary" : false,
      "mapping" : [{
        "identity" : "workflow",
        "map" : "Event.partOf"
      },
      {
        "identity" : "rim",
        "map" : ".inboundRelationship[typeCode=COMP].source[classCode=COMP, moodCode=EVN]"
      }]
    }]
  },
  "differential" : {
    "element" : [{
      "id" : "Encounter",
      "path" : "Encounter",
      "short" : "An interaction during which services are provided to the patient",
      "definition" : "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" : ["Visit"],
      "min" : 0,
      "max" : "*",
      "mapping" : [{
        "identity" : "workflow",
        "map" : "Event"
      },
      {
        "identity" : "rim",
        "map" : "Encounter[@moodCode='EVN']"
      }]
    },
    {
      "id" : "Encounter.identifier",
      "path" : "Encounter.identifier",
      "short" : "Identifier(s) by which this encounter is known",
      "definition" : "Identifier(s) by which this encounter is known.",
      "min" : 0,
      "max" : "*",
      "type" : [{
        "code" : "Identifier"
      }],
      "isSummary" : true,
      "mapping" : [{
        "identity" : "workflow",
        "map" : "Event.identifier"
      },
      {
        "identity" : "w5",
        "map" : "FiveWs.identifier"
      },
      {
        "identity" : "v2",
        "map" : "PV1-19"
      },
      {
        "identity" : "rim",
        "map" : ".id"
      }]
    },
    {
      "id" : "Encounter.status",
      "path" : "Encounter.status",
      "short" : "planned | arrived | triaged | in-progress | onleave | finished | cancelled +",
      "definition" : "planned | arrived | triaged | in-progress | onleave | finished | cancelled +.",
      "comment" : "Note that internal business rules will determine the appropriate transitions that may occur between statuses (and also classes).",
      "min" : 1,
      "max" : "1",
      "type" : [{
        "code" : "code"
      }],
      "isModifier" : true,
      "isModifierReason" : "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" : true,
      "binding" : {
        "extension" : [{
          "url" : "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
          "valueString" : "EncounterStatus"
        }],
        "strength" : "required",
        "description" : "Current state of the encounter.",
        "valueSet" : "http://hl7.org/fhir/ValueSet/encounter-status|4.0.0"
      },
      "mapping" : [{
        "identity" : "workflow",
        "map" : "Event.status"
      },
      {
        "identity" : "w5",
        "map" : "FiveWs.status"
      },
      {
        "identity" : "v2",
        "map" : "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"
      },
      {
        "identity" : "rim",
        "map" : ".statusCode"
      }]
    },
    {
      "id" : "Encounter.statusHistory",
      "extension" : [{
        "url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name",
        "valueString" : "StatusHistory"
      }],
      "path" : "Encounter.statusHistory",
      "short" : "List of past encounter statuses",
      "definition" : "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" : "The current status is always found in the current version of the resource, not the status history.",
      "min" : 0,
      "max" : "*",
      "type" : [{
        "code" : "BackboneElement"
      }],
      "mapping" : [{
        "identity" : "rim",
        "map" : "n/a"
      }]
    },
    {
      "id" : "Encounter.statusHistory.status",
      "path" : "Encounter.statusHistory.status",
      "short" : "planned | arrived | triaged | in-progress | onleave | finished | cancelled +",
      "definition" : "planned | arrived | triaged | in-progress | onleave | finished | cancelled +.",
      "min" : 1,
      "max" : "1",
      "type" : [{
        "code" : "code"
      }],
      "binding" : {
        "extension" : [{
          "url" : "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
          "valueString" : "EncounterStatus"
        }],
        "strength" : "required",
        "description" : "Current state of the encounter.",
        "valueSet" : "http://hl7.org/fhir/ValueSet/encounter-status|4.0.0"
      },
      "mapping" : [{
        "identity" : "rim",
        "map" : "n/a"
      }]
    },
    {
      "id" : "Encounter.statusHistory.period",
      "path" : "Encounter.statusHistory.period",
      "short" : "The time that the episode was in the specified status",
      "definition" : "The time that the episode was in the specified status.",
      "min" : 1,
      "max" : "1",
      "type" : [{
        "code" : "Period"
      }],
      "mapping" : [{
        "identity" : "rim",
        "map" : "n/a"
      }]
    },
    {
      "id" : "Encounter.class",
      "path" : "Encounter.class",
      "short" : "Classification of patient encounter",
      "definition" : "Concepts representing classification of patient encounter such as ambulatory (outpatient), inpatient, emergency, home health or others due to local variations.",
      "min" : 1,
      "max" : "1",
      "type" : [{
        "code" : "Coding"
      }],
      "isSummary" : true,
      "binding" : {
        "extension" : [{
          "url" : "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
          "valueString" : "EncounterClass"
        }],
        "strength" : "extensible",
        "description" : "Classification of the encounter.",
        "valueSet" : "http://terminology.hl7.org/ValueSet/v3-ActEncounterCode"
      },
      "mapping" : [{
        "identity" : "w5",
        "map" : "FiveWs.class"
      },
      {
        "identity" : "v2",
        "map" : "PV1-2"
      },
      {
        "identity" : "rim",
        "map" : ".inboundRelationship[typeCode=SUBJ].source[classCode=LIST].code"
      }]
    },
    {
      "id" : "Encounter.classHistory",
      "extension" : [{
        "url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name",
        "valueString" : "ClassHistory"
      }],
      "path" : "Encounter.classHistory",
      "short" : "List of past encounter classes",
      "definition" : "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.",
      "min" : 0,
      "max" : "*",
      "type" : [{
        "code" : "BackboneElement"
      }],
      "mapping" : [{
        "identity" : "rim",
        "map" : "n/a"
      }]
    },
    {
      "id" : "Encounter.classHistory.class",
      "path" : "Encounter.classHistory.class",
      "short" : "inpatient | outpatient | ambulatory | emergency +",
      "definition" : "inpatient | outpatient | ambulatory | emergency +.",
      "min" : 1,
      "max" : "1",
      "type" : [{
        "code" : "Coding"
      }],
      "binding" : {
        "extension" : [{
          "url" : "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
          "valueString" : "EncounterClass"
        }],
        "strength" : "extensible",
        "description" : "Classification of the encounter.",
        "valueSet" : "http://terminology.hl7.org/ValueSet/v3-ActEncounterCode"
      },
      "mapping" : [{
        "identity" : "rim",
        "map" : "n/a"
      }]
    },
    {
      "id" : "Encounter.classHistory.period",
      "path" : "Encounter.classHistory.period",
      "short" : "The time that the episode was in the specified class",
      "definition" : "The time that the episode was in the specified class.",
      "min" : 1,
      "max" : "1",
      "type" : [{
        "code" : "Period"
      }],
      "mapping" : [{
        "identity" : "rim",
        "map" : "n/a"
      }]
    },
    {
      "id" : "Encounter.type",
      "path" : "Encounter.type",
      "short" : "Specific type of encounter",
      "definition" : "Specific type of encounter (e.g. e-mail consultation, surgical day-care, skilled nursing, rehabilitation).",
      "comment" : "Since there are many ways to further classify encounters, this element is 0..*.",
      "min" : 0,
      "max" : "*",
      "type" : [{
        "code" : "CodeableConcept"
      }],
      "isSummary" : true,
      "binding" : {
        "extension" : [{
          "url" : "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
          "valueString" : "EncounterType"
        }],
        "strength" : "example",
        "description" : "The type of encounter.",
        "valueSet" : "http://hl7.org/fhir/ValueSet/encounter-type"
      },
      "mapping" : [{
        "identity" : "workflow",
        "map" : "Event.code"
      },
      {
        "identity" : "w5",
        "map" : "FiveWs.class"
      },
      {
        "identity" : "v2",
        "map" : "PV1-4 / PV1-18"
      },
      {
        "identity" : "rim",
        "map" : ".code"
      }]
    },
    {
      "id" : "Encounter.serviceType",
      "path" : "Encounter.serviceType",
      "short" : "Specific type of service",
      "definition" : "Broad categorization of the service that is to be provided (e.g. cardiology).",
      "min" : 0,
      "max" : "1",
      "type" : [{
        "code" : "CodeableConcept"
      }],
      "isSummary" : true,
      "binding" : {
        "extension" : [{
          "url" : "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
          "valueString" : "EncounterServiceType"
        }],
        "strength" : "example",
        "description" : "Broad categorization of the service that is to be provided.",
        "valueSet" : "http://hl7.org/fhir/ValueSet/service-type"
      },
      "mapping" : [{
        "identity" : "workflow",
        "map" : "Event.code"
      },
      {
        "identity" : "v2",
        "map" : "PV1-10"
      },
      {
        "identity" : "rim",
        "map" : "n/a"
      }]
    },
    {
      "id" : "Encounter.priority",
      "path" : "Encounter.priority",
      "short" : "Indicates the urgency of the encounter",
      "definition" : "Indicates the urgency of the encounter.",
      "min" : 0,
      "max" : "1",
      "type" : [{
        "code" : "CodeableConcept"
      }],
      "binding" : {
        "extension" : [{
          "url" : "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
          "valueString" : "Priority"
        }],
        "strength" : "example",
        "description" : "Indicates the urgency of the encounter.",
        "valueSet" : "http://terminology.hl7.org/ValueSet/v3-ActPriority"
      },
      "mapping" : [{
        "identity" : "w5",
        "map" : "FiveWs.grade"
      },
      {
        "identity" : "v2",
        "map" : "PV2-25"
      },
      {
        "identity" : "rim",
        "map" : ".priorityCode"
      }]
    },
    {
      "id" : "Encounter.subject",
      "path" : "Encounter.subject",
      "short" : "The patient or group present at the encounter",
      "definition" : "The patient or group present at the encounter.",
      "comment" : "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" : ["patient"],
      "min" : 0,
      "max" : "1",
      "type" : [{
        "code" : "Reference",
        "targetProfile" : ["http://hl7.org/fhir/StructureDefinition/Patient",
        "http://hl7.org/fhir/StructureDefinition/Group"]
      }],
      "isSummary" : true,
      "mapping" : [{
        "identity" : "workflow",
        "map" : "Event.subject"
      },
      {
        "identity" : "w5",
        "map" : "FiveWs.subject[x]"
      },
      {
        "identity" : "v2",
        "map" : "PID-3"
      },
      {
        "identity" : "rim",
        "map" : ".participation[typeCode=SBJ]/role[classCode=PAT]"
      },
      {
        "identity" : "w5",
        "map" : "FiveWs.subject"
      }]
    },
    {
      "id" : "Encounter.episodeOfCare",
      "path" : "Encounter.episodeOfCare",
      "short" : "Episode(s) of care that this encounter should be recorded against",
      "definition" : "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" : 0,
      "max" : "*",
      "type" : [{
        "code" : "Reference",
        "targetProfile" : ["http://hl7.org/fhir/StructureDefinition/EpisodeOfCare"]
      }],
      "isSummary" : true,
      "mapping" : [{
        "identity" : "workflow",
        "map" : "Event.context"
      },
      {
        "identity" : "w5",
        "map" : "FiveWs.context"
      },
      {
        "identity" : "v2",
        "map" : "PV1-54, PV1-53"
      },
      {
        "identity" : "rim",
        "map" : "n/a"
      }]
    },
    {
      "id" : "Encounter.basedOn",
      "path" : "Encounter.basedOn",
      "short" : "The ServiceRequest that initiated this encounter",
      "definition" : "The request this encounter satisfies (e.g. incoming referral or procedure request).",
      "alias" : ["incomingReferral"],
      "min" : 0,
      "max" : "*",
      "type" : [{
        "code" : "Reference",
        "targetProfile" : ["http://hl7.org/fhir/StructureDefinition/ServiceRequest"]
      }],
      "mapping" : [{
        "identity" : "workflow",
        "map" : "Event.basedOn"
      },
      {
        "identity" : "rim",
        "map" : ".reason.ClinicalDocument"
      }]
    },
    {
      "id" : "Encounter.participant",
      "path" : "Encounter.participant",
      "short" : "List of participants involved in the encounter",
      "definition" : "The list of people responsible for providing the service.",
      "min" : 0,
      "max" : "*",
      "type" : [{
        "code" : "BackboneElement"
      }],
      "isSummary" : true,
      "mapping" : [{
        "identity" : "workflow",
        "map" : "Event.performer"
      },
      {
        "identity" : "v2",
        "map" : "ROL"
      },
      {
        "identity" : "rim",
        "map" : ".participation[typeCode=PFM]"
      }]
    },
    {
      "id" : "Encounter.participant.type",
      "path" : "Encounter.participant.type",
      "short" : "Role of participant in encounter",
      "definition" : "Role of participant in encounter.",
      "comment" : "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.",
      "min" : 0,
      "max" : "*",
      "type" : [{
        "code" : "CodeableConcept"
      }],
      "isSummary" : true,
      "binding" : {
        "extension" : [{
          "url" : "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
          "valueString" : "ParticipantType"
        }],
        "strength" : "extensible",
        "description" : "Role of participant in encounter.",
        "valueSet" : "http://hl7.org/fhir/ValueSet/encounter-participant-type"
      },
      "mapping" : [{
        "identity" : "workflow",
        "map" : "Event.performer.function"
      },
      {
        "identity" : "v2",
        "map" : "ROL-3 (or maybe PRT-4)"
      },
      {
        "identity" : "rim",
        "map" : ".functionCode"
      }]
    },
    {
      "id" : "Encounter.participant.period",
      "path" : "Encounter.participant.period",
      "short" : "Period of time during the encounter that the participant participated",
      "definition" : "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.",
      "min" : 0,
      "max" : "1",
      "type" : [{
        "code" : "Period"
      }],
      "mapping" : [{
        "identity" : "v2",
        "map" : "ROL-5, ROL-6 (or maybe PRT-5)"
      },
      {
        "identity" : "rim",
        "map" : ".time"
      }]
    },
    {
      "id" : "Encounter.participant.individual",
      "path" : "Encounter.participant.individual",
      "short" : "Persons involved in the encounter other than the patient",
      "definition" : "Persons involved in the encounter other than the patient.",
      "min" : 0,
      "max" : "1",
      "type" : [{
        "code" : "Reference",
        "targetProfile" : ["http://hl7.org/fhir/StructureDefinition/Practitioner",
        "http://hl7.org/fhir/StructureDefinition/PractitionerRole",
        "http://hl7.org/fhir/StructureDefinition/RelatedPerson"]
      }],
      "isSummary" : true,
      "mapping" : [{
        "identity" : "workflow",
        "map" : "Event.performer.actor"
      },
      {
        "identity" : "w5",
        "map" : "FiveWs.who"
      },
      {
        "identity" : "v2",
        "map" : "ROL-4"
      },
      {
        "identity" : "rim",
        "map" : ".role"
      }]
    },
    {
      "id" : "Encounter.appointment",
      "path" : "Encounter.appointment",
      "short" : "The appointment that scheduled this encounter",
      "definition" : "The appointment that scheduled this encounter.",
      "min" : 0,
      "max" : "*",
      "type" : [{
        "code" : "Reference",
        "targetProfile" : ["http://hl7.org/fhir/StructureDefinition/Appointment"]
      }],
      "isSummary" : true,
      "mapping" : [{
        "identity" : "workflow",
        "map" : "Event.basedOn"
      },
      {
        "identity" : "v2",
        "map" : "SCH-1 / SCH-2"
      },
      {
        "identity" : "rim",
        "map" : ".outboundRelationship[typeCode=FLFS].target[classCode=ENC, moodCode=APT]"
      }]
    },
    {
      "id" : "Encounter.period",
      "path" : "Encounter.period",
      "short" : "The start and end time of the encounter",
      "definition" : "The start and end time of the encounter.",
      "comment" : "If not (yet) known, the end of the Period may be omitted.",
      "min" : 0,
      "max" : "1",
      "type" : [{
        "code" : "Period"
      }],
      "mapping" : [{
        "identity" : "workflow",
        "map" : "Event.occurrence[x]"
      },
      {
        "identity" : "w5",
        "map" : "FiveWs.done[x]"
      },
      {
        "identity" : "v2",
        "map" : "PV1-44, PV1-45"
      },
      {
        "identity" : "rim",
        "map" : ".effectiveTime (low & high)"
      }]
    },
    {
      "id" : "Encounter.length",
      "path" : "Encounter.length",
      "short" : "Quantity of time the encounter lasted (less time absent)",
      "definition" : "Quantity of time the encounter lasted. This excludes the time during leaves of absence.",
      "comment" : "May differ from the time the Encounter.period lasted because of leave of absence.",
      "min" : 0,
      "max" : "1",
      "type" : [{
        "code" : "Duration"
      }],
      "mapping" : [{
        "identity" : "workflow",
        "map" : "Event.occurrence[x]"
      },
      {
        "identity" : "v2",
        "map" : "(PV1-45 less PV1-44) iff ( (PV1-44 not empty) and (PV1-45 not empty) ); units in minutes"
      },
      {
        "identity" : "rim",
        "map" : ".lengthOfStayQuantity"
      }]
    },
    {
      "id" : "Encounter.reasonCode",
      "path" : "Encounter.reasonCode",
      "short" : "Coded reason the encounter takes place",
      "definition" : "Reason the encounter takes place, expressed as a code. For admissions, this can be used for a coded admission diagnosis.",
      "comment" : "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" : ["Indication",
      "Admission diagnosis"],
      "min" : 0,
      "max" : "*",
      "type" : [{
        "code" : "CodeableConcept"
      }],
      "isSummary" : true,
      "binding" : {
        "extension" : [{
          "url" : "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
          "valueString" : "EncounterReason"
        }],
        "strength" : "preferred",
        "description" : "Reason why the encounter takes place.",
        "valueSet" : "http://hl7.org/fhir/ValueSet/encounter-reason"
      },
      "mapping" : [{
        "identity" : "workflow",
        "map" : "Event.reasonCode"
      },
      {
        "identity" : "w5",
        "map" : "FiveWs.why[x]"
      },
      {
        "identity" : "v2",
        "map" : "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 )"
      },
      {
        "identity" : "rim",
        "map" : ".reasonCode"
      }]
    },
    {
      "id" : "Encounter.reasonReference",
      "path" : "Encounter.reasonReference",
      "short" : "Reason the encounter takes place (reference)",
      "definition" : "Reason the encounter takes place, expressed as a code. For admissions, this can be used for a coded admission diagnosis.",
      "comment" : "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" : ["Indication",
      "Admission diagnosis"],
      "min" : 0,
      "max" : "*",
      "type" : [{
        "code" : "Reference",
        "targetProfile" : ["http://hl7.org/fhir/StructureDefinition/Condition",
        "http://hl7.org/fhir/StructureDefinition/Procedure",
        "http://hl7.org/fhir/StructureDefinition/Observation",
        "http://hl7.org/fhir/StructureDefinition/ImmunizationRecommendation"]
      }],
      "isSummary" : true,
      "mapping" : [{
        "identity" : "workflow",
        "map" : "Event.reasonCode"
      },
      {
        "identity" : "w5",
        "map" : "FiveWs.why[x]"
      },
      {
        "identity" : "v2",
        "map" : "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 )"
      },
      {
        "identity" : "rim",
        "map" : ".reasonCode"
      }]
    },
    {
      "id" : "Encounter.diagnosis",
      "extension" : [{
        "url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name",
        "valueString" : "Diagnosis"
      }],
      "path" : "Encounter.diagnosis",
      "short" : "The list of diagnosis relevant to this encounter",
      "definition" : "The list of diagnosis relevant to this encounter.",
      "min" : 0,
      "max" : "*",
      "type" : [{
        "code" : "BackboneElement"
      }],
      "isSummary" : true,
      "mapping" : [{
        "identity" : "rim",
        "map" : ".outboundRelationship[typeCode=RSON]"
      }]
    },
    {
      "id" : "Encounter.diagnosis.condition",
      "path" : "Encounter.diagnosis.condition",
      "short" : "The diagnosis or procedure relevant to the encounter",
      "definition" : "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" : "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" : ["Admission diagnosis",
      "discharge diagnosis",
      "indication"],
      "min" : 1,
      "max" :