<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="patientappointmentrequest" />
  <url value="http://fhir.xt.dev/StructureDefinition/PatientAppointmentRequest" />
  <version value="5.1.0" />
  <name value="PatientAppointmentRequest" />
  <status value="active" />
  <experimental value="false" />
  <date value="2025-03-02T18:47:51.3205821+00:00" />
  <publisher value="x-tention Informationstechnologie GmbH" />
  <contact>
    <telecom>
      <system value="email" />
      <value value="fhir.profiling@x-tention.com" />
      <use value="work" />
    </telecom>
  </contact>
  <description value="Appointment that represents a request by a patient for treatment. The patient may not know the correct Organization and HealthcareService yet. The resource is used in a workflow, that eventually leads to a specific Appointment, which fulfills this request. The fulfilling Appointment might be managed as a seperate resource to clearly delineate responsibilities and simplify lifecycle issues." />
  <copyright value="x-tention Informationstechnologie GmbH" />
  <fhirVersion value="4.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="Appointment" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Appointment" />
  <derivation value="constraint" />
  <differential>
    <element id="Appointment.contained">
      <path value="Appointment.contained" />
      <slicing>
        <discriminator>
          <type value="type" />
          <path value="$this" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="Appointment.contained:containedUnverifiedPersonData">
      <path value="Appointment.contained" />
      <sliceName value="containedUnverifiedPersonData" />
      <short value="Contained unverified Person data" />
      <definition value="The data that the booking user entered as the patient's data. This is only necessary, if the patient has not been linked and therefore has no verified patient data in the FHIR Patient referenced in Participant." />
      <max value="1" />
      <type>
        <code value="Resource" />
        <profile value="http://hl7.org/fhir/StructureDefinition/Person" />
      </type>
    </element>
    <element id="Appointment.contained:containedAccidentCondition">
      <path value="Appointment.contained" />
      <sliceName value="containedAccidentCondition" />
      <short value="Contained accident timing Condition" />
      <definition value="Contained Condition resource that can be referenced from Appointment.reasonReference." />
      <type>
        <code value="Resource" />
        <profile value="http://hl7.org/fhir/StructureDefinition/Condition" />
      </type>
    </element>
    <element id="Appointment.extension">
      <path value="Appointment.extension" />
      <min value="1" />
    </element>
    <element id="Appointment.extension:patientPayorTypeSlice">
      <path value="Appointment.extension" />
      <sliceName value="patientPayorTypeSlice" />
      <short value="Extension Element for Payor Type" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://fhir.xt.dev/StructureDefinition/PatientPayorType" />
      </type>
      <isModifier value="false" />
    </element>
    <element id="Appointment.extension:requestedDayOfWeekSlice">
      <path value="Appointment.extension" />
      <sliceName value="requestedDayOfWeekSlice" />
      <short value="Extension Element for Requested Days of Week" />
      <definition value="The weekdays that the patient would prefer for their requested appointment." />
      <type>
        <code value="Extension" />
        <profile value="http://fhir.xt.dev/StructureDefinition/RequestedDayOfWeek" />
      </type>
      <meaningWhenMissing value="The patient does not have a preference for a weekday." />
      <isModifier value="false" />
    </element>
    <element id="Appointment.extension:requestedTimeOfDaySlice">
      <path value="Appointment.extension" />
      <sliceName value="requestedTimeOfDaySlice" />
      <short value="Extension Element for Requested Times of Day" />
      <definition value="The part of the day that the patient would prefer for their requested appointment." />
      <type>
        <code value="Extension" />
        <profile value="http://fhir.xt.dev/StructureDefinition/RequestedTimeOfDay" />
      </type>
      <meaningWhenMissing value="The patient does not have a preference for a time of day." />
      <isModifier value="false" />
    </element>
    <element id="Appointment.extension:notificationAddressSlice">
      <path value="Appointment.extension" />
      <sliceName value="notificationAddressSlice" />
      <short value="Extension Element for Notification Address" />
      <type>
        <code value="Extension" />
        <profile value="http://fhir.xt.dev/StructureDefinition/AppointmentNotificationAddress" />
      </type>
      <meaningWhenMissing value="The patient does not want to be contacted" />
      <isModifier value="false" />
    </element>
    <element id="Appointment.extension:referralOrderedByProvider">
      <path value="Appointment.extension" />
      <sliceName value="referralOrderedByProvider" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://fhir.xt.dev/StructureDefinition/ReferralOrderedByProvider" />
      </type>
      <isModifier value="false" />
    </element>
    <element id="Appointment.status">
      <path value="Appointment.status" />
      <short value="proposed | booked | cancelled | entered-in-error" />
      <definition value="The overall status of the Appointment. The requests are created in status &quot;proposed&quot;. When the employee (booking agent) resolves the associated task, it results in a &quot;booked&quot; status or in a &quot;cancelled&quot; status. When the patient retracts their request, the status &quot;entered-in-error&quot; is used." />
    </element>
    <element id="Appointment.cancelationReason">
      <path value="Appointment.cancelationReason" />
      <binding>
        <strength value="required" />
        <valueSet value="http://fhir.xt.dev/ValueSet/AppointmentRequestCancellationReasons" />
      </binding>
    </element>
    <element id="Appointment.reasonCode">
      <path value="Appointment.reasonCode" />
      <slicing>
        <discriminator>
          <type value="exists" />
          <path value="text" />
        </discriminator>
        <rules value="closed" />
      </slicing>
    </element>
    <element id="Appointment.reasonCode:requestSlice">
      <path value="Appointment.reasonCode" />
      <sliceName value="requestSlice" />
      <short value="Request Text" />
      <definition value="Die Fragestellung des Patienten" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Appointment.reasonCode:requestSlice.text">
      <path value="Appointment.reasonCode.text" />
      <short value="Reason for request" />
      <definition value="The patient's reason for seeking an appointment." />
      <min value="1" />
    </element>
    <element id="Appointment.reasonCode:keywordsSlice">
      <path value="Appointment.reasonCode" />
      <sliceName value="keywordsSlice" />
      <short value="Keywords" />
      <definition value="Stichwort-Liste mit relevanten Begriffen für die Anfrage des Patienten" />
    </element>
    <element id="Appointment.reasonCode:keywordsSlice.coding">
      <path value="Appointment.reasonCode.coding" />
      <short value="List of Keywords" />
      <definition value="List of organization-specific keywords that the patient selected as being relevant to his request." />
    </element>
    <element id="Appointment.reasonCode:keywordsSlice.text">
      <path value="Appointment.reasonCode.text" />
      <max value="0" />
    </element>
    <element id="Appointment.reasonReference">
      <path value="Appointment.reasonReference" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="type" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="Appointment.reasonReference:containedAccidentCondition">
      <path value="Appointment.reasonReference" />
      <sliceName value="containedAccidentCondition" />
      <short value="Contained accident timing Condition" />
      <definition value="Reference to a contained Condition resource that describes the reason for the appointment request." />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Condition" />
        <aggregation value="contained" />
      </type>
    </element>
    <element id="Appointment.reasonReference:containedAccidentCondition.reference">
      <path value="Appointment.reasonReference.reference" />
      <short value="Internal fragment reference" />
      <definition value="An internal fragment reference (starting with '#') that refers to a contained Condition resource." />
      <min value="1" />
    </element>
    <element id="Appointment.reasonReference:containedAccidentCondition.type">
      <path value="Appointment.reasonReference.type" />
      <min value="1" />
      <fixedUri value="Condition" />
    </element>
    <element id="Appointment.reasonReference:containedAccidentCondition.identifier">
      <path value="Appointment.reasonReference.identifier" />
      <max value="0" />
    </element>
    <element id="Appointment.priority">
      <path value="Appointment.priority" />
      <max value="0" />
    </element>
    <element id="Appointment.description">
      <path value="Appointment.description" />
      <min value="1" />
    </element>
    <element id="Appointment.supportingInformation">
      <path value="Appointment.supportingInformation" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="type" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="Appointment.supportingInformation:unverifiedPersonData">
      <path value="Appointment.supportingInformation" />
      <sliceName value="unverifiedPersonData" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Person" />
        <aggregation value="contained" />
      </type>
    </element>
    <element id="Appointment.supportingInformation:unverifiedPersonData.reference">
      <path value="Appointment.supportingInformation.reference" />
      <short value="Internal fragment reference" />
      <definition value="An Internal fragment references (starting with '#') that refers to a contained person resource." />
    </element>
    <element id="Appointment.supportingInformation:unverifiedPersonData.type">
      <path value="Appointment.supportingInformation.type" />
      <min value="1" />
      <fixedUri value="Person" />
    </element>
    <element id="Appointment.supportingInformation:unverifiedPersonData.identifier">
      <path value="Appointment.supportingInformation.identifier" />
      <max value="0" />
    </element>
    <element id="Appointment.supportingInformation:resultingAppointment">
      <path value="Appointment.supportingInformation" />
      <sliceName value="resultingAppointment" />
      <short value="Resulting Appointment" />
      <definition value="Appointment booked as a result of this appointmentRequest." />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Appointment" />
        <aggregation value="referenced" />
      </type>
    </element>
    <element id="Appointment.supportingInformation:resultingAppointment.type">
      <path value="Appointment.supportingInformation.type" />
      <min value="1" />
      <fixedUri value="Appointment" />
    </element>
    <element id="Appointment.supportingInformation:generatedCollectionList">
      <path value="Appointment.supportingInformation" />
      <sliceName value="generatedCollectionList" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/List" />
        <aggregation value="referenced" />
      </type>
    </element>
    <element id="Appointment.supportingInformation:generatedCollectionList.reference">
      <path value="Appointment.supportingInformation.reference" />
      <min value="1" />
    </element>
    <element id="Appointment.supportingInformation:generatedCollectionList.type">
      <path value="Appointment.supportingInformation.type" />
      <min value="1" />
      <fixedUri value="List" />
    </element>
    <element id="Appointment.supportingInformation:generatedCollectionList.identifier">
      <path value="Appointment.supportingInformation.identifier" />
      <max value="0" />
    </element>
    <element id="Appointment.minutesDuration">
      <path value="Appointment.minutesDuration" />
      <max value="0" />
    </element>
    <element id="Appointment.slot">
      <path value="Appointment.slot" />
      <max value="0" />
    </element>
    <element id="Appointment.created">
      <path value="Appointment.created" />
      <min value="1" />
    </element>
    <element id="Appointment.comment">
      <path value="Appointment.comment" />
      <short value="Additional comments by the patient" />
      <definition value="Additional comments about the appointment by the patient. This is intended for more administrative aspects, e.g. regarding accomodations that the patient needs." />
      <comment value="Additional text to aid in facilitating the appointment. For instance, a comment might be, &quot;Wheelchair needed, bringing service animal&quot;" />
    </element>
    <element id="Appointment.basedOn">
      <path value="Appointment.basedOn" />
      <max value="0" />
    </element>
    <element id="Appointment.participant">
      <path value="Appointment.participant" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="type.coding.system" />
        </discriminator>
        <discriminator>
          <type value="value" />
          <path value="type.coding.code" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="Appointment.participant:Patient">
      <path value="Appointment.participant" />
      <sliceName value="Patient" />
      <short value="Patient" />
      <definition value="The patient requesting the appointment. This always references the patient resources. Additional, unverified patient data (name, telephone number, ...) may be found in Appointment.supportingInformation (unverifiedPersonData slice)." />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Appointment.participant:Patient.id">
      <path value="Appointment.participant.id" />
      <max value="0" />
    </element>
    <element id="Appointment.participant:Patient.type.id">
      <path value="Appointment.participant.type.id" />
      <max value="0" />
    </element>
    <element id="Appointment.participant:Patient.type.coding">
      <path value="Appointment.participant.type.coding" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Appointment.participant:Patient.type.coding.id">
      <path value="Appointment.participant.type.coding.id" />
      <max value="0" />
    </element>
    <element id="Appointment.participant:Patient.type.coding.system">
      <path value="Appointment.participant.type.coding.system" />
      <min value="1" />
      <fixedUri value="http://terminology.hl7.org/CodeSystem/v3-ParticipationType" />
    </element>
    <element id="Appointment.participant:Patient.type.coding.version">
      <path value="Appointment.participant.type.coding.version" />
      <max value="0" />
    </element>
    <element id="Appointment.participant:Patient.type.coding.code">
      <path value="Appointment.participant.type.coding.code" />
      <min value="1" />
      <fixedCode value="PART" />
    </element>
    <element id="Appointment.participant:Patient.type.coding.userSelected">
      <path value="Appointment.participant.type.coding.userSelected" />
      <max value="0" />
    </element>
    <element id="Appointment.participant:Patient.type.text">
      <path value="Appointment.participant.type.text" />
      <max value="0" />
    </element>
    <element id="Appointment.participant:Patient.actor">
      <path value="Appointment.participant.actor" />
      <short value="Patient" />
      <definition value="The patient requesting the appointment" />
      <min value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Patient" />
        <aggregation value="referenced" />
      </type>
    </element>
    <element id="Appointment.participant:Patient.actor.id">
      <path value="Appointment.participant.actor.id" />
      <max value="0" />
    </element>
    <element id="Appointment.participant:Patient.actor.reference">
      <path value="Appointment.participant.actor.reference" />
      <min value="1" />
    </element>
    <element id="Appointment.participant:Patient.actor.identifier">
      <path value="Appointment.participant.actor.identifier" />
      <max value="0" />
    </element>
    <element id="Appointment.participant:Patient.actor.display">
      <path value="Appointment.participant.actor.display" />
      <max value="0" />
    </element>
    <element id="Appointment.participant:Patient.required">
      <path value="Appointment.participant.required" />
      <min value="1" />
      <fixedCode value="required" />
    </element>
    <element id="Appointment.participant:Patient.period">
      <path value="Appointment.participant.period" />
      <max value="0" />
    </element>
    <element id="Appointment.participant:requestedLocation">
      <path value="Appointment.participant" />
      <sliceName value="requestedLocation" />
      <short value="Requested Location" />
      <definition value="Organization that the patient is seeking an appointment in, represented by its Location." />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Appointment.participant:requestedLocation.id">
      <path value="Appointment.participant.id" />
      <max value="0" />
    </element>
    <element id="Appointment.participant:requestedLocation.type">
      <path value="Appointment.participant.type" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Appointment.participant:requestedLocation.type.id">
      <path value="Appointment.participant.type.id" />
      <max value="0" />
    </element>
    <element id="Appointment.participant:requestedLocation.type.coding">
      <path value="Appointment.participant.type.coding" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Appointment.participant:requestedLocation.type.coding.id">
      <path value="Appointment.participant.type.coding.id" />
      <max value="0" />
    </element>
    <element id="Appointment.participant:requestedLocation.type.coding.system">
      <path value="Appointment.participant.type.coding.system" />
      <min value="1" />
      <fixedUri value="http://terminology.hl7.org/CodeSystem/v3-ParticipationType" />
    </element>
    <element id="Appointment.participant:requestedLocation.type.coding.version">
      <path value="Appointment.participant.type.coding.version" />
      <max value="0" />
    </element>
    <element id="Appointment.participant:requestedLocation.type.coding.code">
      <path value="Appointment.participant.type.coding.code" />
      <min value="1" />
      <fixedCode value="LOC" />
    </element>
    <element id="Appointment.participant:requestedLocation.type.coding.userSelected">
      <path value="Appointment.participant.type.coding.userSelected" />
      <max value="0" />
    </element>
    <element id="Appointment.participant:requestedLocation.type.text">
      <path value="Appointment.participant.type.text" />
      <max value="0" />
    </element>
    <element id="Appointment.participant:requestedLocation.actor">
      <path value="Appointment.participant.actor" />
      <short value="Requested Location" />
      <definition value="The Location that the patient selected for the appointment request" />
      <min value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Location" />
        <aggregation value="referenced" />
      </type>
    </element>
    <element id="Appointment.participant:requestedLocation.actor.id">
      <path value="Appointment.participant.actor.id" />
      <max value="0" />
    </element>
    <element id="Appointment.participant:requestedLocation.actor.reference">
      <path value="Appointment.participant.actor.reference" />
      <min value="1" />
    </element>
    <element id="Appointment.participant:requestedLocation.actor.type">
      <path value="Appointment.participant.actor.type" />
      <max value="0" />
    </element>
    <element id="Appointment.participant:requestedLocation.actor.identifier">
      <path value="Appointment.participant.actor.identifier" />
      <max value="0" />
    </element>
    <element id="Appointment.participant:requestedLocation.actor.display">
      <path value="Appointment.participant.actor.display" />
      <max value="0" />
    </element>
    <element id="Appointment.participant:requestedLocation.period">
      <path value="Appointment.participant.period" />
      <max value="0" />
    </element>
  </differential>
</StructureDefinition>