{
  "resourceType": "StructureDefinition",
  "url": "https://fhir.kbv.de/StructureDefinition/74_PR_ETS_Appointment",
  "version": "3.1",
  "name": "AppointmentEts",
  "title": "gebuchter Termin",
  "status": "active",
  "experimental": false,
  "date": "2023-05-15",
  "publisher": "kv.digital GmbH",
  "contact": [
    {
      "name": "kv.digital GmbH",
      "telecom": [
        {
          "system": "url",
          "value": "https://www.kv.digital"
        }
      ]
    }
  ],
  "copyright": "Copyright 2023 kv.digital GmbH",
  "fhirVersion": "4.0.0",
  "kind": "resource",
  "abstract": false,
  "type": "Appointment",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Appointment",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Appointment.extension",
        "path": "Appointment.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        },
        "min": 3
      },
      {
        "id": "Appointment.extension:ersterVermittlungsversuch",
        "path": "Appointment.extension",
        "sliceName": "ersterVermittlungsversuch",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://fhir.kbv.de/StructureDefinition/74_EX_ETS_ErsterVermittlungsversuch"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Appointment.extension:ersterVermittlungsversuch.value[x]",
        "path": "Appointment.extension.value[x]",
        "mustSupport": true
      },
      {
        "id": "Appointment.extension:buchungsherkunft",
        "path": "Appointment.extension",
        "sliceName": "buchungsherkunft",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://fhir.kbv.de/StructureDefinition/74_EX_ETS_AppointmentBuchungsherkunft"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Appointment.extension:buchungsherkunft.value[x]",
        "path": "Appointment.extension.value[x]",
        "mustSupport": true
      },
      {
        "id": "Appointment.extension:priorityCoding",
        "path": "Appointment.extension",
        "sliceName": "priorityCoding",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://fhir.kbv.de/StructureDefinition/74_EX_ETS_AppointmentPriority"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Appointment.extension:priorityCoding.value[x]",
        "path": "Appointment.extension.value[x]",
        "mustSupport": true
      },
      {
        "id": "Appointment.extension:priorityCoding.value[x].system",
        "path": "Appointment.extension.value[x].system",
        "mustSupport": true
      },
      {
        "id": "Appointment.extension:priorityCoding.value[x].code",
        "path": "Appointment.extension.value[x].code",
        "mustSupport": true
      },
      {
        "id": "Appointment.identifier",
        "path": "Appointment.identifier",
        "short": "externalID",
        "definition": "externalID, identisch mit derjenigen des referenzierten Slot",
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Appointment.identifier.system",
        "path": "Appointment.identifier.system",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Appointment.identifier.value",
        "path": "Appointment.identifier.value",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Appointment.status",
        "path": "Appointment.status",
        "mustSupport": true
      },
      {
        "id": "Appointment.cancelationReason",
        "path": "Appointment.cancelationReason",
        "short": "Begründung für Terminabsage",
        "max": "0",
        "mustSupport": false
      },
      {
        "id": "Appointment.cancelationReason.coding",
        "path": "Appointment.cancelationReason.coding",
        "max": "0"
      },
      {
        "id": "Appointment.cancelationReason.text",
        "path": "Appointment.cancelationReason.text",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Appointment.serviceCategory",
        "path": "Appointment.serviceCategory",
        "max": "0"
      },
      {
        "id": "Appointment.serviceType",
        "path": "Appointment.serviceType",
        "max": "0"
      },
      {
        "id": "Appointment.specialty",
        "path": "Appointment.specialty",
        "max": "0"
      },
      {
        "id": "Appointment.appointmentType",
        "path": "Appointment.appointmentType",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Appointment.appointmentType.coding",
        "path": "Appointment.appointmentType.coding",
        "min": 1,
        "max": "1",
        "binding": {
          "strength": "required",
          "description": "Termintyp",
          "valueSet": "https://fhir.kbv.de/ValueSet/74_VS_ETS_Termintyp"
        }
      },
      {
        "id": "Appointment.appointmentType.coding.system",
        "path": "Appointment.appointmentType.coding.system",
        "min": 1
      },
      {
        "id": "Appointment.appointmentType.coding.code",
        "path": "Appointment.appointmentType.coding.code",
        "min": 1
      },
      {
        "id": "Appointment.reasonCode",
        "path": "Appointment.reasonCode",
        "max": "0"
      },
      {
        "id": "Appointment.reasonReference",
        "path": "Appointment.reasonReference",
        "max": "0"
      },
      {
        "id": "Appointment.priority",
        "path": "Appointment.priority",
        "max": "0"
      },
      {
        "id": "Appointment.description",
        "path": "Appointment.description",
        "max": "0"
      },
      {
        "id": "Appointment.supportingInformation",
        "path": "Appointment.supportingInformation",
        "max": "0"
      },
      {
        "id": "Appointment.start",
        "path": "Appointment.start",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Appointment.end",
        "path": "Appointment.end",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Appointment.minutesDuration",
        "path": "Appointment.minutesDuration",
        "max": "0"
      },
      {
        "id": "Appointment.slot",
        "path": "Appointment.slot",
        "max": "0",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://fhir.kbv.de/StructureDefinition/74_PR_ETS_Slot"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Appointment.slot.reference",
        "path": "Appointment.slot.reference",
        "mustSupport": true
      },
      {
        "id": "Appointment.slot.type",
        "path": "Appointment.slot.type",
        "max": "0"
      },
      {
        "id": "Appointment.slot.identifier",
        "path": "Appointment.slot.identifier",
        "mustSupport": true
      },
      {
        "id": "Appointment.slot.identifier.system",
        "path": "Appointment.slot.identifier.system",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Appointment.slot.identifier.value",
        "path": "Appointment.slot.identifier.value",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Appointment.slot.display",
        "path": "Appointment.slot.display",
        "max": "0"
      },
      {
        "id": "Appointment.created",
        "path": "Appointment.created",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Appointment.comment",
        "path": "Appointment.comment",
        "max": "0",
        "mustSupport": false
      },
      {
        "id": "Appointment.patientInstruction",
        "path": "Appointment.patientInstruction",
        "max": "0"
      },
      {
        "id": "Appointment.basedOn",
        "path": "Appointment.basedOn",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://fhir.kbv.de/StructureDefinition/74_PR_ETS_Servicerequest"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Appointment.basedOn.reference",
        "path": "Appointment.basedOn.reference",
        "max": "0"
      },
      {
        "id": "Appointment.basedOn.type",
        "path": "Appointment.basedOn.type",
        "max": "0"
      },
      {
        "id": "Appointment.basedOn.identifier",
        "path": "Appointment.basedOn.identifier",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Appointment.basedOn.identifier.system",
        "path": "Appointment.basedOn.identifier.system",
        "min": 1,
        "fixedUri": "https://fhir.kbv.de/identifierer/74_ID_ETS_Vermittlungscode",
        "mustSupport": true
      },
      {
        "id": "Appointment.basedOn.identifier.value",
        "path": "Appointment.basedOn.identifier.value",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Appointment.basedOn.display",
        "path": "Appointment.basedOn.display",
        "max": "0"
      },
      {
        "id": "Appointment.participant",
        "path": "Appointment.participant",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "type.coding.code"
            }
          ],
          "rules": "open"
        },
        "min": 2,
        "max": "2",
        "mustSupport": true
      },
      {
        "id": "Appointment.participant:patient",
        "path": "Appointment.participant",
        "sliceName": "patient",
        "min": 1,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Appointment.participant:patient.type",
        "path": "Appointment.participant.type",
        "min": 1,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Appointment.participant:patient.type.coding",
        "path": "Appointment.participant.type.coding",
        "min": 1,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Appointment.participant:patient.type.coding.system",
        "path": "Appointment.participant.type.coding.system",
        "min": 1,
        "fixedUri": "http://hl7.org/fhir/v3/ParticipationType",
        "mustSupport": true
      },
      {
        "id": "Appointment.participant:patient.type.coding.version",
        "path": "Appointment.participant.type.coding.version",
        "max": "0"
      },
      {
        "id": "Appointment.participant:patient.type.coding.code",
        "path": "Appointment.participant.type.coding.code",
        "min": 1,
        "fixedCode": "PART",
        "mustSupport": true
      },
      {
        "id": "Appointment.participant:patient.type.coding.display",
        "path": "Appointment.participant.type.coding.display",
        "max": "0"
      },
      {
        "id": "Appointment.participant:patient.type.coding.userSelected",
        "path": "Appointment.participant.type.coding.userSelected",
        "max": "0"
      },
      {
        "id": "Appointment.participant:patient.type.text",
        "path": "Appointment.participant.type.text",
        "max": "0"
      },
      {
        "id": "Appointment.participant:patient.actor",
        "path": "Appointment.participant.actor",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://fhir.kbv.de/StructureDefinition/74_PR_ETS_Patient"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Appointment.participant:patient.actor.reference",
        "path": "Appointment.participant.actor.reference",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Appointment.participant:patient.actor.type",
        "path": "Appointment.participant.actor.type",
        "max": "0"
      },
      {
        "id": "Appointment.participant:patient.actor.identifier",
        "path": "Appointment.participant.actor.identifier",
        "max": "0"
      },
      {
        "id": "Appointment.participant:patient.actor.display",
        "path": "Appointment.participant.actor.display",
        "max": "0"
      },
      {
        "id": "Appointment.participant:patient.required",
        "path": "Appointment.participant.required",
        "max": "0"
      },
      {
        "id": "Appointment.participant:patient.status",
        "path": "Appointment.participant.status",
        "mustSupport": true
      },
      {
        "id": "Appointment.participant:practitionerRole",
        "path": "Appointment.participant",
        "sliceName": "practitionerRole",
        "min": 1,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Appointment.participant:practitionerRole.type",
        "path": "Appointment.participant.type",
        "min": 1,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Appointment.participant:practitionerRole.type.coding",
        "path": "Appointment.participant.type.coding",
        "min": 1,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Appointment.participant:practitionerRole.type.coding.system",
        "path": "Appointment.participant.type.coding.system",
        "min": 1,
        "fixedUri": "http://hl7.org/fhir/v3/ParticipationType",
        "mustSupport": true
      },
      {
        "id": "Appointment.participant:practitionerRole.type.coding.version",
        "path": "Appointment.participant.type.coding.version",
        "max": "0"
      },
      {
        "id": "Appointment.participant:practitionerRole.type.coding.code",
        "path": "Appointment.participant.type.coding.code",
        "min": 1,
        "fixedCode": "PPRF",
        "mustSupport": true
      },
      {
        "id": "Appointment.participant:practitionerRole.type.coding.display",
        "path": "Appointment.participant.type.coding.display",
        "max": "0"
      },
      {
        "id": "Appointment.participant:practitionerRole.type.coding.userSelected",
        "path": "Appointment.participant.type.coding.userSelected",
        "max": "0"
      },
      {
        "id": "Appointment.participant:practitionerRole.actor",
        "path": "Appointment.participant.actor",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://fhir.kbv.de/StructureDefinition/74_PR_ETS_PractitionerRole"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Appointment.participant:practitionerRole.actor.reference",
        "path": "Appointment.participant.actor.reference",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Appointment.participant:practitionerRole.actor.type",
        "path": "Appointment.participant.actor.type",
        "max": "0"
      },
      {
        "id": "Appointment.participant:practitionerRole.actor.identifier",
        "path": "Appointment.participant.actor.identifier",
        "max": "0"
      },
      {
        "id": "Appointment.participant:practitionerRole.actor.display",
        "path": "Appointment.participant.actor.display",
        "max": "0"
      },
      {
        "id": "Appointment.participant:practitionerRole.required",
        "path": "Appointment.participant.required",
        "max": "0"
      },
      {
        "id": "Appointment.participant:practitionerRole.status",
        "path": "Appointment.participant.status",
        "mustSupport": true
      },
      {
        "id": "Appointment.requestedPeriod",
        "path": "Appointment.requestedPeriod",
        "max": "0"
      }
    ]
  }
}