{
  "resourceType": "StructureDefinition",
  "id": "Encounter",
  "meta": {
    "lastUpdated": "2019-10-31T22:29:23.356+00:00"
  },
  "extension": [
    {
      "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-category",
      "valueString": "Base.Management"
    },
    {
      "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status",
      "valueCode": "trial-use"
    },
    {
      "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm",
      "valueInteger": 2
    },
    {
      "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-security-category",
      "valueCode": "patient"
    },
    {
      "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg",
      "valueCode": "pa"
    }
  ],
  "url": "https://fhir.kemkes.go.id/r4/StructureDefinition/Encounter",
  "version": "4.0.1",
  "name": "Encounter",
  "status": "draft",
  "date": "2022-07-08T15:10:50.6856647+00:00",
  "publisher": "Health Level Seven International (Patient Administration)",
  "contact": [
    {
      "telecom": [
        {
          "system": "url",
          "value": "http://hl7.org/fhir"
        }
      ]
    },
    {
      "telecom": [
        {
          "system": "url",
          "value": "http://www.hl7.org/Special/committees/pafm/index.cfm"
        }
      ]
    }
  ],
  "description": "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": "4.0.1",
  "mapping": [
    {
      "identity": "workflow",
      "uri": "http://hl7.org/fhir/workflow",
      "name": "Workflow Pattern"
    },
    {
      "identity": "rim",
      "uri": "http://hl7.org/v3",
      "name": "RIM Mapping"
    },
    {
      "identity": "w5",
      "uri": "http://hl7.org/fhir/fivews",
      "name": "FiveWs Pattern Mapping"
    },
    {
      "identity": "v2",
      "uri": "http://hl7.org/v2",
      "name": "HL7 v2 Mapping"
    }
  ],
  "kind": "resource",
  "abstract": false,
  "type": "Encounter",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/DomainResource",
  "derivation": "specialization",
  "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"
        ],
        "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.",
        "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.1"
        },
        "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.",
        "type": [
          {
            "code": "BackboneElement"
          }
        ]
      },
      {
        "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.1"
        }
      },
      {
        "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"
          }
        ]
      },
      {
        "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.",
        "type": [
          {
            "code": "BackboneElement"
          }
        ]
      },
      {
        "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"
        }
      },
      {
        "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"
          }
        ]
      },
      {
        "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..*.",
        "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).",
        "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"
          }
        ]
      },
      {
        "id": "Encounter.priority",
        "path": "Encounter.priority",
        "short": "Indicates the urgency of the encounter",
        "definition": "Indicates the urgency of the encounter.",
        "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"
        ],
        "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).",
        "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"
          }
        ]
      },
      {
        "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"
        ],
        "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.",
        "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.",
        "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.",
        "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.",
        "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.",
        "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.",
        "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.",
        "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"
        ],
        "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"
        ],
        "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.",
        "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": "1",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.org/fhir/StructureDefinition/Condition",
              "http://hl7.org/fhir/StructureDefinition/Procedure"
            ]
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "workflow",
            "map": "Event.reasonReference"
          },
          {
            "identity": "w5",
            "map": "FiveWs.why[x]"
          },
          {
            "identity": "v2",
            "map": "Resources that would commonly referenced at Encounter.indication would be Condition and/or Procedure. These most closely align with DG1/PRB and PR1 respectively."
          },
          {
            "identity": "rim",
            "map": ".outboundRelationship[typeCode=RSON].target"
          }
        ]
      },
      {
        "id": "Encounter.diagnosis.use",
        "path": "Encounter.diagnosis.use",
        "short": "Role that this diagnosis has within the encounter (e.g. admission, billing, discharge …)",
        "definition": "Role that this diagnosis has within the encounter (e.g. admission, billing, discharge …).",
        "max": "1",
        "type": [
          {
            "code": "CodeableConcept"
          }
        ],
        "binding": {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
              "valueString": "DiagnosisRole"
            },
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding",
              "valueBoolean": true
            }
          ],
          "strength": "preferred",
          "description": "The type of diagnosis this condition represents.",
          "valueSet": "http://hl7.org/fhir/ValueSet/diagnosis-role"
        }
      },
      {
        "id": "Encounter.diagnosis.rank",
        "path": "Encounter.diagnosis.rank",
        "short": "Ranking of the diagnosis (for each role type)",
        "definition": "Ranking of the diagnosis (for each role type).",
        "max": "1",
        "type": [
          {
            "code": "positiveInt"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": ".outboundRelationship[typeCode=RSON].priority"
          }
        ]
      },
      {
        "id": "Encounter.account",
        "path": "Encounter.account",
        "short": "The set of accounts that may be used for billing for this Encounter",
        "definition": "The set of accounts that may be used for billing for this Encounter.",
        "comment": "The billing system may choose to allocate billable items associated with the Encounter to different referenced Accounts based on internal business rules.",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.org/fhir/StructureDefinition/Account"
            ]
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": ".pertains.A_Account"
          }
        ]
      },
      {
        "id": "Encounter.hospitalization",
        "path": "Encounter.hospitalization",
        "short": "Details about the admission to a healthcare service",
        "definition": "Details about the admission to a healthcare service.",
        "comment": "An Encounter may cover more than just the inpatient stay. Contexts such as outpatients, community clinics, and aged care facilities are also included.\r\rThe duration recorded in the period of this encounter covers the entire scope of this hospitalization record.",
        "max": "1",
        "type": [
          {
            "code": "BackboneElement"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": ".outboundRelationship[typeCode=COMP].target[classCode=ENC, moodCode=EVN]"
          }
        ]
      },
      {
        "id": "Encounter.hospitalization.preAdmissionIdentifier",
        "path": "Encounter.hospitalization.preAdmissionIdentifier",
        "short": "Pre-admission identifier",
        "definition": "Pre-admission identifier.",
        "max": "1",
        "type": [
          {
            "code": "Identifier"
          }
        ],
        "mapping": [
          {
            "identity": "v2",
            "map": "PV1-5"
          },
          {
            "identity": "rim",
            "map": ".id"
          }
        ]
      },
      {
        "id": "Encounter.hospitalization.origin",
        "path": "Encounter.hospitalization.origin",
        "short": "The location/organization from which the patient came before admission",
        "definition": "The location/organization from which the patient came before admission.",
        "max": "1",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.org/fhir/StructureDefinition/Location",
              "http://hl7.org/fhir/StructureDefinition/Organization"
            ]
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": ".participation[typeCode=ORG].role"
          }
        ]
      },
      {
        "id": "Encounter.hospitalization.admitSource",
        "path": "Encounter.hospitalization.admitSource",
        "short": "From where patient was admitted (physician referral, transfer)",
        "definition": "From where patient was admitted (physician referral, transfer).",
        "max": "1",
        "type": [
          {
            "code": "CodeableConcept"
          }
        ],
        "binding": {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
              "valueString": "AdmitSource"
            }
          ],
          "strength": "preferred",
          "description": "From where the patient was admitted.",
          "valueSet": "http://hl7.org/fhir/ValueSet/encounter-admit-source"
        },
        "mapping": [
          {
            "identity": "v2",
            "map": "PV1-14"
          },
          {
            "identity": "rim",
            "map": ".admissionReferralSourceCode"
          }
        ]
      },
      {
        "id": "Encounter.hospitalization.reAdmission",
        "path": "Encounter.hospitalization.reAdmission",
        "short": "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": "Whether this hospitalization is a readmission and why if known.",
        "max": "1",
        "type": [
          {
            "code": "CodeableConcept"
          }
        ],
        "binding": {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
              "valueString": "ReAdmissionType"
            }
          ],
          "strength": "example",
          "description": "The reason for re-admission of this hospitalization encounter.",
          "valueSet": "http://terminology.hl7.org/ValueSet/v2-0092"
        },
        "mapping": [
          {
            "identity": "v2",
            "map": "PV1-13"
          }
        ]
      },
      {
        "id": "Encounter.hospitalization.dietPreference",
        "path": "Encounter.hospitalization.dietPreference",
        "short": "Diet preferences reported by the patient",
        "definition": "Diet preferences reported by the patient.",
        "comment": "For example, a patient may request both a dairy-free and nut-free diet preference (not mutually exclusive).",
        "requirements": "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": "CodeableConcept"
          }
        ],
        "binding": {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
              "valueString": "PatientDiet"
            }
          ],
          "strength": "example",
          "description": "Medical, cultural or ethical food preferences to help with catering requirements.",
          "valueSet": "http://hl7.org/fhir/ValueSet/encounter-diet"
        },
        "mapping": [
          {
            "identity": "v2",
            "map": "PV1-38"
          },
          {
            "identity": "rim",
            "map": ".outboundRelationship[typeCode=COMP].target[classCode=SBADM, moodCode=EVN, code=\"diet\"]"
          }
        ]
      },
      {
        "id": "Encounter.hospitalization.specialCourtesy",
        "path": "Encounter.hospitalization.specialCourtesy",
        "short": "Special courtesies (VIP, board member)",
        "definition": "Special courtesies (VIP, board member).",
        "type": [
          {
            "code": "CodeableConcept"
          }
        ],
        "binding": {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
              "valueString": "Courtesies"
            }
          ],
          "strength": "preferred",
          "description": "Special courtesies.",
          "valueSet": "http://hl7.org/fhir/ValueSet/encounter-special-courtesy"
        },
        "mapping": [
          {
            "identity": "v2",
            "map": "PV1-16"
          },
          {
            "identity": "rim",
            "map": ".specialCourtesiesCode"
          }
        ]
      },
      {
        "id": "Encounter.hospitalization.specialArrangement",
        "path": "Encounter.hospitalization.specialArrangement",
        "short": "Wheelchair, translator, stretcher, etc.",
        "definition": "Any special requests that have been made for this hospitalization encounter, such as the provision of specific equipment or other things.",
        "type": [
          {
            "code": "CodeableConcept"
          }
        ],
        "binding": {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
              "valueString": "Arrangements"
            }
          ],
          "strength": "preferred",
          "description": "Special arrangements.",
          "valueSet": "http://hl7.org/fhir/ValueSet/encounter-special-arrangements"
        },
        "mapping": [
          {
            "identity": "v2",
            "map": "PV1-15 / OBR-30 / OBR-43"
          },
          {
            "identity": "rim",
            "map": ".specialArrangementCode"
          }
        ]
      },
      {
        "id": "Encounter.hospitalization.destination",
        "path": "Encounter.hospitalization.destination",
        "short": "Location/organization to which the patient is discharged",
        "definition": "Location/organization to which the patient is discharged.",
        "max": "1",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.org/fhir/StructureDefinition/Location",
              "http://hl7.org/fhir/StructureDefinition/Organization"
            ]
          }
        ],
        "mapping": [
          {
            "identity": "v2",
            "map": "PV1-37"
          },
          {
            "identity": "rim",
            "map": ".participation[typeCode=DST]"
          }
        ]
      },
      {
        "id": "Encounter.hospitalization.dischargeDisposition",
        "path": "Encounter.hospitalization.dischargeDisposition",
        "short": "Category or kind of location after discharge",
        "definition": "Category or kind of location after discharge.",
        "max": "1",
        "type": [
          {
            "code": "CodeableConcept"
          }
        ],
        "binding": {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
              "valueString": "DischargeDisp"
            }
          ],
          "strength": "example",
          "description": "Discharge Disposition.",
          "valueSet": "http://hl7.org/fhir/ValueSet/encounter-discharge-disposition"
        },
        "mapping": [
          {
            "identity": "v2",
            "map": "PV1-36"
          },
          {
            "identity": "rim",
            "map": ".dischargeDispositionCode"
          }
        ]
      },
      {
        "id": "Encounter.location",
        "path": "Encounter.location",
        "short": "List of locations where the patient has been",
        "definition": "List of locations where  the patient has been during this encounter.",
        "comment": "Virtual encounters can be recorded in the Encounter by specifying a location reference to a location of type \"kind\" such as \"client's home\" and an encounter.class = \"virtual\".",
        "type": [
          {
            "code": "BackboneElement"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": ".participation[typeCode=LOC]"
          }
        ]
      },
      {
        "id": "Encounter.location.location",
        "path": "Encounter.location.location",
        "short": "Location the encounter takes place",
        "definition": "The location where the encounter takes place.",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.org/fhir/StructureDefinition/Location"
            ]
          }
        ],
        "mapping": [
          {
            "identity": "workflow",
            "map": "Event.location"
          },
          {
            "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.",
        "max": "1",
        "type": [
          {
            "code": "code"
          }
        ],
        "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.1"
        },
        "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.",
        "max": "1",
        "type": [
          {
            "code": "CodeableConcept"
          }
        ],
        "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.",
        "max": "1",
        "type": [
          {
            "code": "Period"
          }
        ],
        "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.",
        "max": "1",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.org/fhir/StructureDefinition/Organization"
            ]
          }
        ],
        "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.",
        "max": "1",
        "type": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-hierarchy",
                "valueBoolean": true
              }
            ],
            "code": "Reference",
            "targetProfile": [
              "http://hl7.org/fhir/StructureDefinition/Encounter"
            ]
          }
        ],
        "mapping": [
          {
            "identity": "workflow",
            "map": "Event.partOf"
          },
          {
            "identity": "rim",
            "map": ".inboundRelationship[typeCode=COMP].source[classCode=COMP, moodCode=EVN]"
          }
        ]
      }
    ]
  }
}