<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="rdc-Subscription" />
  <url value="https://roche.com/fhir/iop/StructureDefinition/rdc-Subscription" />
  <name value="RdcSubscription" />
  <title value="RDC Subscription" />
  <status value="active" />
  <publisher value="F. Hoffmann-La Roche AG" />
  <description value="RDC Subscription profile describes custom rules how to create a valid Subscription resource to be able to subscribe to receive notifications about created/updated resources from Roche." />
  <copyright value="Copyright and related rights waived via CC0, https://creativecommons.org/publicdomain/zero/1.0/. This does not apply to information from third parties, for example a medical terminology system. The implementer alone is responsible for identifying and obtaining any necessary licenses or authorizations to utilize third party IP in connection with the specification or otherwise." />
  <fhirVersion value="5.0.0" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="Subscription" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Subscription" />
  <derivation value="constraint" />
  <differential>
    <element id="Subscription.name">
      <path value="Subscription.name" />
      <comment value="Cannot exceed 255 characters in size" />
    </element>
    <element id="Subscription.contact">
      <path value="Subscription.contact" />
      <max value="0" />
    </element>
    <element id="Subscription.end">
      <path value="Subscription.end" />
      <max value="0" />
    </element>
    <element id="Subscription.managingEntity">
      <path value="Subscription.managingEntity" />
      <max value="0" />
    </element>
    <element id="Subscription.reason">
      <path value="Subscription.reason" />
      <comment value="Cannot exceed 2048 characters in size" />
    </element>
    <element id="Subscription.filterBy">
      <path value="Subscription.filterBy" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Subscription.filterBy.filterParameter">
      <path value="Subscription.filterBy.filterParameter" />
      <binding>
        <strength value="required" />
        <description value="Can be either &quot;patient&quot; or &quot;organization&quot;" />
      </binding>
    </element>
    <element id="Subscription.filterBy.value">
      <path value="Subscription.filterBy.value" />
      <short value="ID of the resource" />
      <definition value="For filterParameter having value &quot;organization&quot;, the value must correspond to the ID of the managing organization. For filterParameter having value &quot;patient&quot;, the value must correspond to ID of a patient within the managing organization." />
    </element>
    <element id="Subscription.channelType">
      <path value="Subscription.channelType" />
      <definition value="The type of channel to send notifications on. Only rest-hook is allowed." />
      <fixedCoding>
        <code value="rest-hook" />
      </fixedCoding>
    </element>
    <element id="Subscription.channelType.system">
      <path value="Subscription.channelType.system" />
      <max value="0" />
    </element>
    <element id="Subscription.channelType.version">
      <path value="Subscription.channelType.version" />
      <max value="0" />
    </element>
    <element id="Subscription.channelType.display">
      <path value="Subscription.channelType.display" />
      <max value="0" />
    </element>
    <element id="Subscription.channelType.userSelected">
      <path value="Subscription.channelType.userSelected" />
      <max value="0" />
    </element>
    <element id="Subscription.endpoint">
      <path value="Subscription.endpoint" />
      <comment value="Absolute URL to the endpoint to receive notifications. Must start with https://" />
      <min value="1" />
    </element>
    <element id="Subscription.heartbeatPeriod">
      <path value="Subscription.heartbeatPeriod" />
      <max value="0" />
    </element>
    <element id="Subscription.timeout">
      <path value="Subscription.timeout" />
      <comment value="Number between 10 and 20. Default is 10." />
    </element>
    <element id="Subscription.contentType">
      <path value="Subscription.contentType" />
      <definition value="The MIME type to send the payload in . Only values `application/json` and `application/fhir+json` are allowed." />
      <min value="1" />
    </element>
    <element id="Subscription.content">
      <path value="Subscription.content" />
      <definition value="How much of the resource content to deliver in the notification payload. Only id-only and empty are supported" />
      <min value="1" />
      <constraint>
        <key value="valueCodeConstraint" />
        <severity value="error" />
        <human value="The value for content must be either 'id-only' or 'empty'." />
        <expression value="$this = 'id-only' or $this = 'empty'" />
      </constraint>
    </element>
    <element id="Subscription.maxCount">
      <path value="Subscription.maxCount" />
      <comment value="By default this value is set to 100. You can change the value to a number higher than 100." />
    </element>
  </differential>
</StructureDefinition>