{
  "resourceType": "StructureDefinition",
  "meta": {
    "lastUpdated": "2022-08-02T09:18:31.296+00:00"
  },
  "url": "https://medico-emr.net/medico/r4/sd/Encounter_OutpatientEncounter_1",
  "name": "Encounter_OutpatientEncounter_1",
  "status": "draft",
  "description": "A resource of this profile represents a \"consultation\" in medico\r\nA consulation in medico reprents each showup of a patient in an outpatient facility (=ambulance).\r\nA consultation is part of an administrative case, i.e. partof references a resource of the profile \"encounter_case\".\r\n\r\nDatabase mapping \r\n- mapping to x1205awo ( where consil=0 ).",
  "fhirVersion": "4.0.0",
  "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/Encounter",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Encounter",
        "path": "Encounter",
        "definition": "A resource of this profile represents an outpatient's encounter.\r\n.partof points to an administrative encounter (profile:encounter_case)  of which this outpatient encounter is a part-of"
      },
      {
        "id": "Encounter.id",
        "path": "Encounter.id",
        "definition": "Format: OutpatientEncounter-####\r\nA resource of this profile represents a \"consultation\" in medico\r\nA consulation in medico reprents each showup of a patient in an outpatient facility (=ambulance).\r\nA consultation is part of an administrative case, i.e. .partof references a resource of the profile \"encounter_case\".",
        "min": 1,
        "defaultValueString": "100"
      },
      {
        "id": "Encounter.meta",
        "path": "Encounter.meta",
        "min": 1,
        "type": [
          {
            "code": "Meta",
            "profile": [
              "https://medico-emr.net/medico/r4/sd/Meta_ProfileOnly_1"
            ]
          }
        ]
      },
      {
        "id": "Encounter.meta.lastUpdated",
        "path": "Encounter.meta.lastUpdated",
        "mustSupport": true
      },
      {
        "id": "Encounter.meta.profile",
        "path": "Encounter.meta.profile",
        "fixedCanonical": "https://medico-emr.net/medico/r4/sd/Encounter_OutpatientEncounter_1"
      },
      {
        "id": "Encounter.implicitRules",
        "path": "Encounter.implicitRules",
        "max": "0"
      },
      {
        "id": "Encounter.language",
        "path": "Encounter.language",
        "max": "0"
      },
      {
        "id": "Encounter.text",
        "path": "Encounter.text",
        "max": "0"
      },
      {
        "id": "Encounter.contained",
        "path": "Encounter.contained",
        "max": "0"
      },
      {
        "id": "Encounter.identifier",
        "path": "Encounter.identifier",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "system"
            }
          ],
          "rules": "open"
        },
        "min": 1,
        "max": "1"
      },
      {
        "id": "Encounter.identifier:medicoResourceId",
        "path": "Encounter.identifier",
        "sliceName": "medicoResourceId",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Identifier",
            "profile": [
              "https://medico-emr.net/medico/r4/sd/Identifier_medicoResourceId_1"
            ]
          }
        ]
      },
      {
        "id": "Encounter.identifier:medicoResourceId.system",
        "path": "Encounter.identifier.system",
        "code": [
          {
            "system": "https://medico-emr.net/medico/cs/customerdefinedsystems",
            "code": "OutpatientEncounter"
          }
        ],
        "definition": "maps to https://medico-emr.net/medico/%KUNDE%/sid1/OutpatientEncounter",
        "comment": "Dynamically resolved for validation\r\n--FixedValue=https://medico-emr.net/medico/%KUNDE%/sid1/OutpatientEncounter"
      },
      {
        "id": "Encounter.status",
        "path": "Encounter.status",
        "definition": "medico available: planned  | in-progress | finished"
      },
      {
        "id": "Encounter.statusHistory",
        "path": "Encounter.statusHistory",
        "max": "0"
      },
      {
        "id": "Encounter.class",
        "path": "Encounter.class",
        "definition": "medico - possible values:\r\nAMB-ambulatory/outpatient encounter types\r\nIMP-inpatient encounter types"
      },
      {
        "id": "Encounter.class.id",
        "path": "Encounter.class.id",
        "max": "0"
      },
      {
        "id": "Encounter.class.system",
        "path": "Encounter.class.system",
        "min": 1,
        "fixedUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"
      },
      {
        "id": "Encounter.class.version",
        "path": "Encounter.class.version",
        "max": "0"
      },
      {
        "id": "Encounter.class.code",
        "path": "Encounter.class.code",
        "min": 1
      },
      {
        "id": "Encounter.class.display",
        "path": "Encounter.class.display",
        "max": "0"
      },
      {
        "id": "Encounter.class.userSelected",
        "path": "Encounter.class.userSelected",
        "max": "0"
      },
      {
        "id": "Encounter.classHistory",
        "path": "Encounter.classHistory",
        "max": "0"
      },
      {
        "id": "Encounter.type",
        "path": "Encounter.type",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Encounter.type.id",
        "path": "Encounter.type.id",
        "max": "0"
      },
      {
        "id": "Encounter.type.coding",
        "path": "Encounter.type.coding",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Encounter.type.coding.id",
        "path": "Encounter.type.coding.id",
        "max": "0"
      },
      {
        "id": "Encounter.type.coding.system",
        "path": "Encounter.type.coding.system",
        "min": 1,
        "fixedUri": "https://medico-emr.net/medico/cs/cs1"
      },
      {
        "id": "Encounter.type.coding.version",
        "path": "Encounter.type.coding.version",
        "max": "0"
      },
      {
        "id": "Encounter.type.coding.code",
        "path": "Encounter.type.coding.code",
        "definition": "medico - possible values:\r\nAMB    (=ambulator) - the default value for all medico consultations (not consils) \r\nEMER   (Emergency) - an ambulatory encounter/consultation especially marked",
        "min": 1,
        "fixedCode": "Outpatient-SubEncounter"
      },
      {
        "id": "Encounter.type.coding.display",
        "path": "Encounter.type.coding.display",
        "max": "0"
      },
      {
        "id": "Encounter.type.coding.userSelected",
        "path": "Encounter.type.coding.userSelected",
        "max": "0"
      },
      {
        "id": "Encounter.type.text",
        "path": "Encounter.type.text",
        "max": "0"
      },
      {
        "id": "Encounter.serviceType",
        "path": "Encounter.serviceType",
        "max": "0"
      },
      {
        "id": "Encounter.priority",
        "path": "Encounter.priority",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "coding.code"
            }
          ],
          "rules": "open"
        },
        "definition": "medico currently supports an emergency flag - see slice below"
      },
      {
        "id": "Encounter.priority:emergencyFlag",
        "path": "Encounter.priority",
        "sliceName": "emergencyFlag",
        "definition": "medico - this flag is expressed as http://terminology.hl7.org/CodeSystem/v3-ActPriority|EM"
      },
      {
        "id": "Encounter.priority:emergencyFlag.id",
        "path": "Encounter.priority.id",
        "max": "0"
      },
      {
        "id": "Encounter.priority:emergencyFlag.coding",
        "path": "Encounter.priority.coding",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Encounter.priority:emergencyFlag.coding.id",
        "path": "Encounter.priority.coding.id",
        "max": "0"
      },
      {
        "id": "Encounter.priority:emergencyFlag.coding.system",
        "path": "Encounter.priority.coding.system",
        "min": 1,
        "fixedUri": "http://terminology.hl7.org/CodeSystem/v3-ActPriority"
      },
      {
        "id": "Encounter.priority:emergencyFlag.coding.version",
        "path": "Encounter.priority.coding.version",
        "max": "0"
      },
      {
        "id": "Encounter.priority:emergencyFlag.coding.code",
        "path": "Encounter.priority.coding.code",
        "min": 1,
        "fixedCode": "EM"
      },
      {
        "id": "Encounter.priority:emergencyFlag.coding.display",
        "path": "Encounter.priority.coding.display",
        "max": "0"
      },
      {
        "id": "Encounter.priority:emergencyFlag.coding.userSelected",
        "path": "Encounter.priority.coding.userSelected",
        "max": "0"
      },
      {
        "id": "Encounter.subject",
        "path": "Encounter.subject",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "profile": [
              "https://medico-emr.net/medico/r4/sd/Reference_SubjectPatient_1"
            ],
            "targetProfile": [
              "https://medico-emr.net/medico/r4/sd/Patient_Patient_1"
            ],
            "aggregation": [
              "referenced"
            ]
          }
        ]
      },
      {
        "id": "Encounter.episodeOfCare",
        "path": "Encounter.episodeOfCare",
        "max": "0"
      },
      {
        "id": "Encounter.basedOn",
        "path": "Encounter.basedOn",
        "max": "0"
      },
      {
        "id": "Encounter.participant",
        "path": "Encounter.participant",
        "max": "0"
      },
      {
        "id": "Encounter.appointment",
        "path": "Encounter.appointment",
        "max": "0"
      },
      {
        "id": "Encounter.period",
        "path": "Encounter.period",
        "definition": "the period of the \"showup\" of the patient in the facility.\r\nend is not present while the patient is still in the ambulance.",
        "min": 1
      },
      {
        "id": "Encounter.period.id",
        "path": "Encounter.period.id",
        "max": "0"
      },
      {
        "id": "Encounter.period.start",
        "path": "Encounter.period.start",
        "min": 1
      },
      {
        "id": "Encounter.length",
        "path": "Encounter.length",
        "max": "0"
      },
      {
        "id": "Encounter.reasonCode",
        "path": "Encounter.reasonCode",
        "max": "0"
      },
      {
        "id": "Encounter.reasonReference",
        "path": "Encounter.reasonReference",
        "max": "0"
      },
      {
        "id": "Encounter.diagnosis",
        "path": "Encounter.diagnosis",
        "max": "0"
      },
      {
        "id": "Encounter.account",
        "path": "Encounter.account",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Reference",
            "profile": [
              "https://medico-emr.net/medico/r4/sd/Reference_Base_1"
            ],
            "targetProfile": [
              "https://medico-emr.net/medico/r4/sd/Account_CaseAccount_1"
            ],
            "aggregation": [
              "referenced"
            ]
          }
        ]
      },
      {
        "id": "Encounter.account.identifier.system",
        "path": "Encounter.account.identifier.system",
        "code": [
          {
            "system": "https://medico-emr.net/medico/cs/customerdefinedsystems",
            "code": "CaseAccount"
          }
        ],
        "comment": "Dynamically resolved for validation\r\n--FixedValue=https://medico-emr.net/medico/%KUNDE%/sid1/CaseAccount"
      },
      {
        "id": "Encounter.hospitalization",
        "path": "Encounter.hospitalization",
        "max": "0"
      },
      {
        "id": "Encounter.hospitalization.id",
        "path": "Encounter.hospitalization.id",
        "max": "0"
      },
      {
        "id": "Encounter.hospitalization.preAdmissionIdentifier",
        "path": "Encounter.hospitalization.preAdmissionIdentifier",
        "max": "0"
      },
      {
        "id": "Encounter.hospitalization.origin",
        "path": "Encounter.hospitalization.origin",
        "max": "0"
      },
      {
        "id": "Encounter.hospitalization.admitSource",
        "path": "Encounter.hospitalization.admitSource",
        "max": "0"
      },
      {
        "id": "Encounter.hospitalization.reAdmission",
        "path": "Encounter.hospitalization.reAdmission",
        "max": "0"
      },
      {
        "id": "Encounter.hospitalization.dietPreference",
        "path": "Encounter.hospitalization.dietPreference",
        "max": "0"
      },
      {
        "id": "Encounter.hospitalization.specialCourtesy",
        "path": "Encounter.hospitalization.specialCourtesy",
        "max": "0"
      },
      {
        "id": "Encounter.hospitalization.specialArrangement",
        "path": "Encounter.hospitalization.specialArrangement",
        "max": "0"
      },
      {
        "id": "Encounter.hospitalization.destination",
        "path": "Encounter.hospitalization.destination",
        "definition": "Points to the department that initially received the patient\r\nmaps to x1205awo.dep",
        "max": "0",
        "type": [
          {
            "code": "Reference",
            "profile": [
              "https://medico-emr.net/medico/sd/r4/Reference_Department_1"
            ],
            "targetProfile": [
              "https://medico-emr.net/medico/r4/sd/Organization_Department_1"
            ],
            "aggregation": [
              "referenced"
            ]
          }
        ]
      },
      {
        "id": "Encounter.hospitalization.destination.identifier.system",
        "path": "Encounter.hospitalization.destination.identifier.system",
        "code": [
          {
            "system": "https://medico-emr.net/medico/cs/customerdefinedsystem",
            "code": "Department"
          }
        ]
      },
      {
        "id": "Encounter.hospitalization.dischargeDisposition",
        "path": "Encounter.hospitalization.dischargeDisposition",
        "max": "0"
      },
      {
        "id": "Encounter.location",
        "path": "Encounter.location",
        "definition": "medico: llists locations (for location_unit) , i.e. currently wards and outpatient facilities (=Ambulanz).\r\nCurrently 1 or 2 locations are provided:\r\n   1. initial unit\r\n   2. current unit   - only if different for current one",
        "min": 1
      },
      {
        "id": "Encounter.location.id",
        "path": "Encounter.location.id",
        "max": "0"
      },
      {
        "id": "Encounter.location.location",
        "path": "Encounter.location.location",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "profile": [
              "https://medico-emr.net/medico/r4/sd/Reference_LocationUnit_1"
            ],
            "targetProfile": [
              "https://medico-emr.net/medico/r4/sd/Location_Unit_1"
            ],
            "aggregation": [
              "referenced"
            ]
          }
        ]
      },
      {
        "id": "Encounter.location.status",
        "path": "Encounter.location.status",
        "definition": "medico supports - based on x1205awo.datf and .datt:\r\nplanned (current time is before datf), active (current time after datf ), completed (current time after datt)",
        "min": 1
      },
      {
        "id": "Encounter.location.physicalType",
        "path": "Encounter.location.physicalType",
        "definition": "medico: MUST be used identically to Location_Unit_1.physicalType, i.e.\r\nhttp://terminology.hl7.org/CodeSystem/location-physical-type|wa    (for normal wards)\r\nhttp://terminology.hl7.org/CodeSystem/location-physical-type|area    (for areas - now used when an outpatient facility is behind)",
        "min": 1
      },
      {
        "id": "Encounter.location.physicalType.id",
        "path": "Encounter.location.physicalType.id",
        "max": "0"
      },
      {
        "id": "Encounter.location.physicalType.coding",
        "path": "Encounter.location.physicalType.coding",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Encounter.location.physicalType.coding.id",
        "path": "Encounter.location.physicalType.coding.id",
        "max": "0"
      },
      {
        "id": "Encounter.location.physicalType.coding.system",
        "path": "Encounter.location.physicalType.coding.system",
        "min": 1,
        "fixedUri": "http://terminology.hl7.org/CodeSystem/location-physical-type"
      },
      {
        "id": "Encounter.location.physicalType.coding.version",
        "path": "Encounter.location.physicalType.coding.version",
        "max": "0"
      },
      {
        "id": "Encounter.location.physicalType.coding.code",
        "path": "Encounter.location.physicalType.coding.code",
        "min": 1
      },
      {
        "id": "Encounter.location.physicalType.coding.display",
        "path": "Encounter.location.physicalType.coding.display",
        "max": "0"
      },
      {
        "id": "Encounter.location.physicalType.coding.userSelected",
        "path": "Encounter.location.physicalType.coding.userSelected",
        "max": "0"
      },
      {
        "id": "Encounter.location.physicalType.text",
        "path": "Encounter.location.physicalType.text",
        "max": "0"
      },
      {
        "id": "Encounter.location.period",
        "path": "Encounter.location.period",
        "min": 1
      },
      {
        "id": "Encounter.location.period.id",
        "path": "Encounter.location.period.id",
        "max": "0"
      },
      {
        "id": "Encounter.serviceProvider",
        "path": "Encounter.serviceProvider",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "profile": [
              "https://medico-emr.net/medico/r4/sd/Reference_OrganizationUnit_1"
            ],
            "targetProfile": [
              "https://medico-emr.net/medico/r4/sd/Organization_Unit_1"
            ],
            "aggregation": [
              "referenced"
            ]
          }
        ]
      },
      {
        "id": "Encounter.partOf",
        "path": "Encounter.partOf",
        "label": "Administrative case",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "profile": [
              "https://medico-emr.net/medico/r4/sd/Reference_ContextEncounter_1"
            ],
            "targetProfile": [
              "https://medico-emr.net/medico/r4/sd/Encounter_Case_1"
            ],
            "aggregation": [
              "referenced"
            ]
          }
        ]
      }
    ]
  }
}