{
  "resourceType": "StructureDefinition",
  "id": "KBV-PR-AW-Termin",
  "url": "https://fhir.kbv.de/StructureDefinition/KBV_PR_AW_Termin",
  "version": "1.3.0",
  "name": "KBV_PR_AW_Termin",
  "status": "draft",
  "copyright": "Copyright © [2022], Kassenärztliche Bundesvereinigung (KBV). All rights reserved.",
  "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": "ical",
      "uri": "http://ietf.org/rfc/2445",
      "name": "iCalendar"
    },
    {
      "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": "Appointment",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Appointment",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Appointment",
        "path": "Appointment",
        "constraint": [
          {
            "key": "AWS-1",
            "severity": "error",
            "human": "Der Status muss booked oder cancelled sein",
            "expression": "status='booked' or status='cancelled'"
          }
        ]
      },
      {
        "id": "Appointment.id",
        "path": "Appointment.id",
        "min": 1
      },
      {
        "id": "Appointment.meta",
        "path": "Appointment.meta",
        "min": 1
      },
      {
        "id": "Appointment.meta.versionId",
        "path": "Appointment.meta.versionId",
        "min": 1
      },
      {
        "id": "Appointment.meta.lastUpdated",
        "path": "Appointment.meta.lastUpdated",
        "min": 1
      },
      {
        "id": "Appointment.meta.profile",
        "path": "Appointment.meta.profile",
        "min": 1,
        "max": "1",
        "fixedCanonical": "https://fhir.kbv.de/StructureDefinition/KBV_PR_AW_Termin|1.3.0"
      },
      {
        "id": "Appointment.text",
        "path": "Appointment.text",
        "min": 1
      },
      {
        "id": "Appointment.text.status",
        "path": "Appointment.text.status",
        "short": "extensions",
        "fixedCode": "extensions"
      },
      {
        "id": "Appointment.extension",
        "path": "Appointment.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "closed"
        },
        "min": 0
      },
      {
        "id": "Appointment.extension:Terminserie",
        "path": "Appointment.extension",
        "sliceName": "Terminserie",
        "min": 0,
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://fhir.kbv.de/StructureDefinition/KBV_EX_AW_Termin_Terminserie"
            ]
          }
        ]
      },
      {
        "id": "Appointment.identifier",
        "path": "Appointment.identifier",
        "max": "0"
      },
      {
        "id": "Appointment.status",
        "path": "Appointment.status",
        "short": "booked | cancelled",
        "definition": "Dieses Status dieser Ressource kann gebucht(booked) oder abgesagt(cancelled) sein."
      },
      {
        "id": "Appointment.cancelationReason",
        "path": "Appointment.cancelationReason",
        "max": "0"
      },
      {
        "id": "Appointment.serviceCategory",
        "path": "Appointment.serviceCategory",
        "max": "0"
      },
      {
        "id": "Appointment.serviceType",
        "path": "Appointment.serviceType",
        "short": "Terminkategorie",
        "definition": "Dem Termin kann einer Kategorie zugeordnet werden. Die Kategorie wird vom exportierenden PVS vergeben. Termine der gleichen Art müssen die gleiche Kategorie haben.",
        "mustSupport": true
      },
      {
        "id": "Appointment.serviceType.coding",
        "path": "Appointment.serviceType.coding",
        "max": "0"
      },
      {
        "id": "Appointment.serviceType.text",
        "path": "Appointment.serviceType.text",
        "short": "Terminkategorie",
        "definition": "Z.B. Impftermine werden mit der Kategorie „Impf“ versehen. Über die Kategorie können auch Räume abgebildet werden.",
        "min": 1
      },
      {
        "id": "Appointment.specialty",
        "path": "Appointment.specialty",
        "max": "0"
      },
      {
        "id": "Appointment.appointmentType",
        "path": "Appointment.appointmentType",
        "max": "0"
      },
      {
        "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",
        "short": "Überschrift",
        "definition": "Kurzbeschreibung des Termins"
      },
      {
        "id": "Appointment.supportingInformation",
        "path": "Appointment.supportingInformation",
        "max": "0"
      },
      {
        "id": "Appointment.start",
        "path": "Appointment.start",
        "short": "Beginn",
        "definition": "Beginn des Termins mit Datum und Uhrzeit",
        "mustSupport": true
      },
      {
        "id": "Appointment.end",
        "path": "Appointment.end",
        "short": "Ende",
        "definition": "Ende des Termins mit Datum und Uhrzeit",
        "mustSupport": true
      },
      {
        "id": "Appointment.minutesDuration",
        "path": "Appointment.minutesDuration",
        "max": "0"
      },
      {
        "id": "Appointment.slot",
        "path": "Appointment.slot",
        "max": "0"
      },
      {
        "id": "Appointment.created",
        "path": "Appointment.created",
        "max": "0"
      },
      {
        "id": "Appointment.comment",
        "path": "Appointment.comment",
        "short": "Terminnotiz",
        "definition": "Die Beschreibung bzw. Notiz des Termins",
        "mustSupport": true
      },
      {
        "id": "Appointment.patientInstruction",
        "path": "Appointment.patientInstruction",
        "max": "0"
      },
      {
        "id": "Appointment.basedOn",
        "path": "Appointment.basedOn",
        "max": "0"
      },
      {
        "id": "Appointment.participant",
        "path": "Appointment.participant",
        "mustSupport": true
      },
      {
        "id": "Appointment.participant.type",
        "path": "Appointment.participant.type",
        "mustSupport": true,
        "binding": {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
              "valueString": "ParticipantType"
            }
          ],
          "strength": "required"
        }
      },
      {
        "id": "Appointment.participant.type.coding",
        "path": "Appointment.participant.type.coding",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Appointment.participant.type.coding.system",
        "path": "Appointment.participant.type.coding.system",
        "min": 1
      },
      {
        "id": "Appointment.participant.type.coding.code",
        "path": "Appointment.participant.type.coding.code",
        "min": 1
      },
      {
        "id": "Appointment.participant.type.coding.userSelected",
        "path": "Appointment.participant.type.coding.userSelected",
        "max": "0"
      },
      {
        "id": "Appointment.participant.type.text",
        "path": "Appointment.participant.type.text",
        "max": "0"
      },
      {
        "id": "Appointment.participant.actor",
        "path": "Appointment.participant.actor",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://fhir.kbv.de/StructureDefinition/KBV_PR_AW_Patient|1.3.0",
              "https://fhir.kbv.de/StructureDefinition/KBV_PR_AW_Behandelnder|1.3.0",
              "https://fhir.kbv.de/StructureDefinition/KBV_PR_AW_Betriebsstaette_Ort|1.3.0"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Appointment.participant.actor.reference",
        "path": "Appointment.participant.actor.reference",
        "min": 1
      },
      {
        "id": "Appointment.participant.actor.type",
        "path": "Appointment.participant.actor.type",
        "max": "0"
      },
      {
        "id": "Appointment.participant.actor.identifier.use",
        "path": "Appointment.participant.actor.identifier.use",
        "max": "0"
      },
      {
        "id": "Appointment.participant.actor.identifier.type",
        "path": "Appointment.participant.actor.identifier.type",
        "max": "0"
      },
      {
        "id": "Appointment.participant.actor.identifier.system",
        "path": "Appointment.participant.actor.identifier.system",
        "min": 1,
        "fixedUri": "https://fhir.kbv.de/NamingSystem/KBV_NS_Base_ANR"
      },
      {
        "id": "Appointment.participant.actor.identifier.value",
        "path": "Appointment.participant.actor.identifier.value",
        "min": 1
      },
      {
        "id": "Appointment.participant.actor.identifier.period",
        "path": "Appointment.participant.actor.identifier.period",
        "max": "0"
      },
      {
        "id": "Appointment.participant.actor.identifier.assigner",
        "path": "Appointment.participant.actor.identifier.assigner",
        "max": "0"
      },
      {
        "id": "Appointment.participant.actor.display",
        "path": "Appointment.participant.actor.display",
        "max": "0"
      },
      {
        "id": "Appointment.participant.required",
        "path": "Appointment.participant.required",
        "max": "0"
      },
      {
        "id": "Appointment.participant.status",
        "path": "Appointment.participant.status",
        "fixedCode": "accepted"
      },
      {
        "id": "Appointment.participant.period",
        "path": "Appointment.participant.period",
        "max": "0"
      },
      {
        "id": "Appointment.requestedPeriod",
        "path": "Appointment.requestedPeriod",
        "max": "0"
      }
    ]
  }
}