<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="apprequesttriggeredcommunicationtemplate-profile" />
  <url value="http://fhir.xt.dev/StructureDefinition/AppointmentRequestTriggeredCommunicationTemplate" />
  <version value="1.1.1" />
  <name value="AppointmentRequestTriggeredCommunicationTemplate" />
  <status value="active" />
  <date value="2026-07-02T16:03:55.216881+02: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="The template for a planned communication, automatically triggered by changes in data. The communication is usually a structured interaction modeled as a Task, but might also be a more conventional message. This type of communication template is triggered by an AppointmentRequest." />
  <copyright value="x-tention Informationstechnologie GmbH" />
  <fhirVersion value="4.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="CommunicationRequest" />
  <baseDefinition value="http://fhir.xt.dev/StructureDefinition/BaseCommunicationTemplate" />
  <derivation value="constraint" />
  <differential>
    <element id="CommunicationRequest.basedOn">
      <path value="CommunicationRequest.basedOn" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="type" />
        </discriminator>
        <rules value="closed" />
      </slicing>
    </element>
    <element id="CommunicationRequest.basedOn:targetOrganization">
      <path value="CommunicationRequest.basedOn" />
      <sliceName value="targetOrganization" />
      <definition value="Target Organization that the user selected and that is linked to the Appointment through the participant Location" />
      <min value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Organization" />
      </type>
    </element>
    <element id="CommunicationRequest.basedOn:targetOrganization.type">
      <path value="CommunicationRequest.basedOn.type" />
      <min value="1" />
      <fixedUri value="Organization" />
    </element>
    <element id="CommunicationRequest.basedOn:targetOrganization.identifier">
      <path value="CommunicationRequest.basedOn.identifier" />
      <short value="primary-org-id" />
      <min value="1" />
    </element>
    <element id="CommunicationRequest.basedOn:targetOrganization.identifier.system">
      <path value="CommunicationRequest.basedOn.identifier.system" />
      <min value="1" />
      <fixedUri value="urn:ietf:rfc:3986" />
    </element>
    <element id="CommunicationRequest.basedOn:targetOrganization.identifier.value">
      <path value="CommunicationRequest.basedOn.identifier.value" />
      <min value="1" />
    </element>
    <element id="CommunicationRequest.basedOn:targetOrganization.identifier.period">
      <path value="CommunicationRequest.basedOn.identifier.period" />
      <max value="0" />
    </element>
    <element id="CommunicationRequest.basedOn:targetOrganization.identifier.assigner">
      <path value="CommunicationRequest.basedOn.identifier.assigner" />
      <max value="0" />
    </element>
    <element id="CommunicationRequest.category.coding.system">
      <path value="CommunicationRequest.category.coding.system" />
      <fixedUri value="http://fhir.xt.dev/CodeSystem/CommunicationTemplateCategory" />
    </element>
    <element id="CommunicationRequest.category.coding.code">
      <path value="CommunicationRequest.category.coding.code" />
      <fixedCode value="AppointmentRequestCreated" />
    </element>
    <element id="CommunicationRequest.medium.coding:subtaskOfAppointmentRequestTask">
      <path value="CommunicationRequest.medium.coding" />
      <sliceName value="subtaskOfAppointmentRequestTask" />
      <max value="1" />
    </element>
    <element id="CommunicationRequest.medium.coding:subtaskOfAppointmentRequestTask.system">
      <path value="CommunicationRequest.medium.coding.system" />
      <min value="1" />
      <fixedUri value="http://fhir.xt.dev/CodeSystem/TaskRelatedResource" />
    </element>
    <element id="CommunicationRequest.medium.coding:subtaskOfAppointmentRequestTask.code">
      <path value="CommunicationRequest.medium.coding.code" />
      <min value="1" />
      <fixedCode value="subtask-of-app-request-task" />
    </element>
    <element id="CommunicationRequest.reasonCode">
      <path value="CommunicationRequest.reasonCode" />
      <short value="Code Filter for the AppointmentRequest" />
      <definition value="Filter to limit the intended communication to appointment requests with a a specific keyword, payor type or referral order type. Different reasonCodes are considered alternative filter criteria and logically combined using OR. Different codings in one reasonCode are considered multiple aspects of the same filter criterium and logically combined using AND." />
    </element>
    <element id="CommunicationRequest.reasonCode.coding">
      <path value="CommunicationRequest.reasonCode.coding" />
      <short value="Code Filter" />
      <definition value="Filter to limit the intended communication to appointment requests with a a specific keyword, payor type or referral order type. Different reasonCodes are considered alternative filter criteria and logically combined using OR. Different codings in one reasonCode are considered multiple aspects of the same filter criterium and logically combined using AND." />
      <min value="1" />
    </element>
    <element id="CommunicationRequest.reasonCode.coding.userSelected">
      <path value="CommunicationRequest.reasonCode.coding.userSelected" />
      <max value="0" />
    </element>
    <element id="CommunicationRequest.reasonCode.text">
      <path value="CommunicationRequest.reasonCode.text" />
      <max value="0" />
    </element>
  </differential>
</StructureDefinition>