### ----------------------------------------------------
### -- FHIR
### -- Licenses: Artistic-2.0
### -- Authors: Hugh Simpson
### -- File: t/resources/structureDefinition/Encounter.json
### ----------------------------------------------------
### -- Chunk 13 of 13
 "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 …).",
      "min" : 0,
      "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"
      },
      "mapping" : [{
        "identity" : "rim",
        "map" : "n/a"
      }]
    },
    {
      "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).",
      "min" : 0,
      "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.",
      "min" : 0,
      "max" : "*",
      "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.",
      "min" : 0,
      "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.",
      "min" : 0,
      "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.",
      "min" : 0,
      "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).",
      "min" : 0,
      "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.",
      "min" : 0,
      "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"
      },
      {
        "identity" : "rim",
        "map" : "n/a"
      }]
    },
    {
      "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.",
      "min" : 0,
      "max" : "*",
      "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).",
      "min" : 0,
      "max" : "*",
      "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.",
      "min" : 0,
      "max" : "*",
      "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.",
      "min" : 0,
      "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.",
      "min" : 0,
      "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\".",
      "min" : 0,
      "max" : "*",
      "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.",
      "min" : 0,
      "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.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",
      "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.",
      "min" : 0,
      "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.",
      "min" : 0,
      "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.",
      "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"]
      }],
      "mapping" : [{
        "identity" : "workflow",
        "map" : "Event.partOf"
      },
      {
        "identity" : "rim",
        "map" : ".inboundRelationship[typeCode=COMP].source[classCode=COMP, moodCode=EVN]"
      }]
    }]
  }
}


