<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="mitz-Subscription" />
  <url value="http://vzvz.nl/fhir/otv/StructureDefinition/mitz-Subscription" />
  <version value="4.0.0-beta.1" />
  <name value="MitzSubscription" />
  <status value="draft" />
  <date value="2025-03-04T12:00:00+01:00" />
  <publisher value="VZVZ" />
  <contact>
    <name value="VZVZ" />
    <telecom>
      <system value="email" />
      <value value="standaardisatie@vzvz.nl" />
      <use value="work" />
    </telecom>
  </contact>
  <description value="Profile to define the subscription that can be taken on consent information" />
  <jurisdiction>
    <coding>
      <system value="urn:iso:std:iso:3166" />
      <code value="NL" />
      <display value="Netherlands" />
    </coding>
  </jurisdiction>
  <copyright value="VZVZ" />
  <fhirVersion value="4.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="Subscription" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Subscription" />
  <derivation value="constraint" />
  <differential>
    <element id="Subscription">
      <path value="Subscription" />
      <comment value="Used to share the consent subscription&#xD;&#xA;&#xD;&#xA;See also [this example](https://simplifier.net/vzvz/examples-mitz-nl-vzvz-mitz-subscription)." />
    </element>
    <element id="Subscription.id">
      <path value="Subscription.id" />
      <definition value="The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes. This is the unique ID of the subscription." />
      <comment value="The id is absent when the resource is posted by a Mitz Connector (MC). The response contains a uuid generated by Mitz. Mitz checks if a subscription for the combination MC, patient and source system. If so, that id is returned with HTTP code 202 (accepted).&#xD;&#xA;&#xD;&#xA;When the MC wants to update the Subscription, the id should be added in the updated instance." />
    </element>
    <element id="Subscription.extension">
      <path value="Subscription.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <ordered value="false" />
        <rules value="open" />
      </slicing>
      <min value="2" />
    </element>
    <element id="Subscription.extension:PatientBirthdate">
      <path value="Subscription.extension" />
      <sliceName value="PatientBirthdate" />
      <definition value="Date of birth of the patient to allow for the determination of the age category." />
      <comment value="This element is required under condition: if the healthcare provider has a verified date of birth of the patient, it MUST be provided as a full and valid date. I.e. a partial date like '1970-00-00' which could be provided by SBV-Z is not allowed." />
      <requirements value="Specific extension for Mitz to exchange the patient's date of birth, to allow the determination of the age category in Mitz." />
      <min value="0" />
      <max value="*" />
      <type>
        <code value="Extension" />
        <profile value="http://vzvz.nl/fhir/otv/StructureDefinition/Patient.birthDate" />
      </type>
    </element>
    <element id="Subscription.extension:sourceSystem">
      <path value="Subscription.extension" />
      <sliceName value="sourceSystem" />
      <short value="Source System" />
      <definition value="Extension to specify the system where the subscription originates from" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://vzvz.nl/fhir/StructureDefinition/SourceSystem" />
      </type>
    </element>
    <element id="Subscription.extension:gatewaySystem">
      <path value="Subscription.extension" />
      <sliceName value="gatewaySystem" />
      <short value="Gateway system" />
      <definition value="Extension to provide a base URL for the localisation of the data" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://vzvz.nl/fhir/StructureDefinition/GatewaySystem" />
      </type>
    </element>
    <element id="Subscription.status">
      <path value="Subscription.status" />
      <fixedCode value="requested" />
    </element>
    <element id="Subscription.reason">
      <path value="Subscription.reason" />
      <short value="Reason for subscription" />
      <definition value="Fixed value OTV" />
      <comment value="Reason for subscription for now fixed value 'OTV'." />
      <fixedString value="OTV" />
    </element>
    <element id="Subscription.criteria">
      <path value="Subscription.criteria" />
      <short value="Criteria for notification trigger" />
      <definition value="Criteria to trigger the notification. BSN, URA of the source healthcare provider and category of the healthcare provider must be provided. No other criteria are allowed." />
      <example>
        <label value="Consent example" />
        <valueString value="Consent?_query=otv&amp;amp;patientid=123456789&amp;amp;providerid=01234567&amp;amp;providertype=Z3" />
      </example>
    </element>
    <element id="Subscription.channel.type">
      <path value="Subscription.channel.type" />
      <definition value="Fixed value rest-hook" />
      <fixedCode value="rest-hook" />
    </element>
    <element id="Subscription.channel.endpoint">
      <path value="Subscription.channel.endpoint" />
      <definition value="Specific URL to notify the source system (via MC)." />
      <comment value="Note: this must be a valid HTTPS address. The application ID of the dossierhoudend system is added within AORTA to be able to address systems using the LSP." />
      <min value="1" />
      <example>
        <label value="LSP systeem met applicatie-id" />
        <valueUrl value="https://zim.prf001.lsp.aorta-zorg.nl/otv/Subscription/123456789" />
      </example>
    </element>
    <element id="Subscription.channel.payload">
      <path value="Subscription.channel.payload" />
      <definition value="The mime type to send the payload in - either application/fhir+xml, or application/fhir+json." />
      <min value="1" />
      <example>
        <label value="XML" />
        <valueCode value="application/fhir+xml" />
      </example>
    </element>
  </differential>
</StructureDefinition>