{
  "resourceType": "StructureDefinition",
  "url": "https://medico-emr.net/medico/r4/sd/Encounter_Consultation_1",
  "name": "Encounter_Consultation_1",
  "status": "draft",
  "description": "A resource of this profile represents a \"consultation care\" 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=1 ).",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "Encounter",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Encounter",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Encounter.id",
        "path": "Encounter.id",
        "definition": "Format: ConsultationEncounter-####\r\nA resource of this profile represents a \"consultation care\" 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\".",
        "mustSupport": true
      },
      {
        "id": "Encounter.meta",
        "path": "Encounter.meta",
        "type": [
          {
            "code": "Meta",
            "profile": [
              "https://medico-emr.net/medico/r4/sd/Meta_ProfileOnly_1"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "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_Consultation_1",
        "mustSupport": true
      },
      {
        "id": "Encounter.identifier",
        "path": "Encounter.identifier",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "system"
            }
          ],
          "rules": "open"
        },
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Encounter.identifier:medicoResourceId",
        "path": "Encounter.identifier",
        "sliceName": "medicoResourceId",
        "type": [
          {
            "code": "Identifier",
            "profile": [
              "https://medico-emr.net/medico/r4/sd/Identifier_medicoResourceId_1"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Encounter.identifier:medicoResourceId.system",
        "path": "Encounter.identifier.system",
        "definition": "The resulting value will be https://medico-emr.net/medico/%KUNDE%/sid1/*   \r\n - where * is the in code.code  - see below\r\n - and %KUNDE& is a tenant specific 2-3 character id\r\nfor automatic calculation the Code with the system \"https://medico-emr.net/medico/cs/customerdefinedsystem\" is used\r\n\r\nmaps to https://medico-emr.net/medico/%KUNDE%/sid1/ConsultationEncounter",
        "comment": "Dynamically resolved for validation\r\n--FixedValue=https://medico-emr.net/medico/%KUNDE%/sid1/ConsultationEncounter"
      },
      {
        "id": "Encounter.status",
        "path": "Encounter.status",
        "definition": "medico available: planned  | in-progress | finished"
      },
      {
        "id": "Encounter.class",
        "path": "Encounter.class",
        "definition": "medico - possible values:\r\nIMP-inpatient encounter types",
        "mustSupport": true
      },
      {
        "id": "Encounter.class.system",
        "path": "Encounter.class.system",
        "fixedUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode",
        "mustSupport": true
      },
      {
        "id": "Encounter.class.code",
        "path": "Encounter.class.code",
        "mustSupport": true
      },
      {
        "id": "Encounter.type",
        "path": "Encounter.type",
        "slicing": {
          "discriminator": [
            {
              "type": "pattern",
              "path": "$this"
            }
          ],
          "rules": "open"
        },
        "mustSupport": true
      },
      {
        "id": "Encounter.type:Kontaktart",
        "path": "Encounter.type",
        "sliceName": "Kontaktart",
        "max": "1",
        "patternCodeableConcept": {
          "coding": [
            {
              "system": "http://fhir.de/CodeSystem/kontaktart-de"
            }
          ]
        },
        "mustSupport": true,
        "binding": {
          "strength": "required",
          "valueSet": "http://fhir.de/ValueSet/kontaktart-de"
        }
      },
      {
        "id": "Encounter.type:type",
        "path": "Encounter.type",
        "sliceName": "type",
        "max": "1",
        "patternCodeableConcept": {
          "coding": [
            {
              "system": "https://medico-emr.net/medico/cs/cs1"
            }
          ]
        },
        "mustSupport": true
      },
      {
        "id": "Encounter.type:type.coding",
        "path": "Encounter.type.coding",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Encounter.type:type.coding.system",
        "path": "Encounter.type.coding.system",
        "min": 1,
        "fixedUri": "https://medico-emr.net/medico/cs/cs1"
      },
      {
        "id": "Encounter.type:type.coding.code",
        "path": "Encounter.type.coding.code",
        "definition": "medico - possible values:\r\nIMP   (=inpatient) - the default value for all medico consultations (consils only) \r\nEMER   (Emergency) - an ambulatory encounter/consultation especially marked",
        "min": 1
      },
      {
        "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"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Encounter.period",
        "path": "Encounter.period",
        "mustSupport": true
      },
      {
        "id": "Encounter.period.start",
        "path": "Encounter.period.start",
        "definition": "The start of the period. The boundary is inclusive.\r\n(x1205awo.datf)",
        "mustSupport": true
      },
      {
        "id": "Encounter.period.end",
        "path": "Encounter.period.end",
        "definition": "The end of the period. If the end of the period is missing, it means no end was known or planned at the time the instance was created. The start may be in the past, and the end date in the future, which means that period is expected/planned to end at that time.\r\n\r\n(x1205awo.datt)",
        "mustSupport": true
      },
      {
        "id": "Encounter.account",
        "path": "Encounter.account",
        "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"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Encounter.location",
        "path": "Encounter.location",
        "definition": "the ward the consultation took place (x1205awo.wds)",
        "mustSupport": true
      },
      {
        "id": "Encounter.location.location",
        "path": "Encounter.location.location",
        "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"
            ]
          }
        ]
      },
      {
        "id": "Encounter.location.status",
        "path": "Encounter.location.status",
        "mustSupport": true
      },
      {
        "id": "Encounter.location.physicalType",
        "path": "Encounter.location.physicalType",
        "mustSupport": true
      },
      {
        "id": "Encounter.location.physicalType.coding",
        "path": "Encounter.location.physicalType.coding",
        "mustSupport": true
      },
      {
        "id": "Encounter.location.physicalType.coding.system",
        "path": "Encounter.location.physicalType.coding.system",
        "fixedUri": "http://terminology.hl7.org/CodeSystem/location-physical-type",
        "mustSupport": true
      },
      {
        "id": "Encounter.location.physicalType.coding.code",
        "path": "Encounter.location.physicalType.coding.code",
        "mustSupport": true
      },
      {
        "id": "Encounter.location.period",
        "path": "Encounter.location.period",
        "mustSupport": true
      },
      {
        "id": "Encounter.location.period.start",
        "path": "Encounter.location.period.start",
        "mustSupport": true
      },
      {
        "id": "Encounter.location.period.end",
        "path": "Encounter.location.period.end",
        "mustSupport": true
      },
      {
        "id": "Encounter.serviceProvider",
        "path": "Encounter.serviceProvider",
        "definition": "the department the consultation took place (x1205awo.dep)",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://medico-emr.net/medico/r4/sd/Organization_Department_1"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Encounter.serviceProvider.reference",
        "path": "Encounter.serviceProvider.reference",
        "mustSupport": true
      },
      {
        "id": "Encounter.serviceProvider.type",
        "path": "Encounter.serviceProvider.type",
        "fixedUri": "Organization",
        "mustSupport": true
      },
      {
        "id": "Encounter.serviceProvider.identifier",
        "path": "Encounter.serviceProvider.identifier",
        "mustSupport": true
      },
      {
        "id": "Encounter.serviceProvider.identifier.system",
        "path": "Encounter.serviceProvider.identifier.system",
        "comment": "The fixed value is inserted at runtime\r\nFixedValue=https://medico-emr.net/medico/%KUNDE%/sid1/Department",
        "mustSupport": true
      },
      {
        "id": "Encounter.serviceProvider.identifier.value",
        "path": "Encounter.serviceProvider.identifier.value",
        "mustSupport": true
      },
      {
        "id": "Encounter.partOf",
        "path": "Encounter.partOf",
        "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"
            ]
          }
        ],
        "mustSupport": true
      }
    ]
  }
}