<StructureDefinition xmlns="http://hl7.org/fhir">
  <url value="https://nijz.si/rdsp/fhir/StructureDefinition/ConsentSIAgent" />
  <name value="ConsentSIAgent" />
  <status value="draft" />
  <fhirVersion value="4.1.0" />
  <mapping>
    <identity value="workflow" />
    <uri value="http://hl7.org/fhir/workflow" />
    <name value="Workflow Pattern" />
  </mapping>
  <mapping>
    <identity value="v2" />
    <uri value="http://hl7.org/v2" />
    <name value="HL7 v2 Mapping" />
  </mapping>
  <mapping>
    <identity value="rim" />
    <uri value="http://hl7.org/v3" />
    <name value="RIM Mapping" />
  </mapping>
  <mapping>
    <identity value="w5" />
    <uri value="http://hl7.org/fhir/fivews" />
    <name value="FiveWs Pattern Mapping" />
  </mapping>
  <kind value="resource" />
  <abstract value="false" />
  <type value="Consent" />
  <baseDefinition value="https://nijz.si/rdsp/fhir/StructureDefinition/ConsentSI" />
  <derivation value="constraint" />
  <differential>
    <element id="Consent.identifier">
      <path value="Consent.identifier" />
      <min value="1" />
    </element>
    <element id="Consent.identifier.system">
      <path value="Consent.identifier.system" />
      <fixedUri value="urn:nijz:crpp:consentId" />
    </element>
    <element id="Consent.status">
      <path value="Consent.status" />
      <short value="active | inactive" />
    </element>
    <element id="Consent.category.coding.system">
      <path value="Consent.category.coding.system" />
      <fixedUri value="urn:nijz:crpp:consentcategory" />
    </element>
    <element id="Consent.category.coding.code">
      <path value="Consent.category.coding.code" />
      <fixedCode value="access-eZdravje" />
    </element>
    <element id="Consent.category.coding.display">
      <path value="Consent.category.coding.display" />
      <fixedString value="access-eZdravje" />
    </element>
    <element id="Consent.patient">
      <path value="Consent.patient" />
      <min value="1" />
    </element>
    <element id="Consent.dateTime">
      <path value="Consent.dateTime" />
      <min value="1" />
    </element>
    <element id="Consent.performer">
      <path value="Consent.performer" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Patient" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/RelatedPerson" />
      </type>
    </element>
    <element id="Consent.organization">
      <path value="Consent.organization" />
      <max value="0" />
    </element>
    <element id="Consent.source[x].contentType">
      <path value="Consent.source[x].contentType" />
      <max value="0" />
    </element>
    <element id="Consent.source[x].language">
      <path value="Consent.source[x].language" />
      <max value="0" />
    </element>
    <element id="Consent.source[x].data">
      <path value="Consent.source[x].data" />
      <max value="0" />
    </element>
    <element id="Consent.source[x].size">
      <path value="Consent.source[x].size" />
      <max value="0" />
    </element>
    <element id="Consent.source[x].hash">
      <path value="Consent.source[x].hash" />
      <max value="0" />
    </element>
    <element id="Consent.policyRule.coding.system">
      <path value="Consent.policyRule.coding.system" />
      <fixedUri value="http://terminology.hl7.org/CodeSystem/v3-ActCode" />
    </element>
    <element id="Consent.policyRule.coding.code">
      <path value="Consent.policyRule.coding.code" />
      <fixedCode value="OPTIN" />
    </element>
    <element id="Consent.provision">
      <path value="Consent.provision" />
      <min value="1" />
    </element>
    <element id="Consent.provision.type">
      <path value="Consent.provision.type" />
      <min value="1" />
      <fixedCode value="permit" />
    </element>
    <element id="Consent.provision.period">
      <path value="Consent.provision.period" />
      <min value="1" />
    </element>
    <element id="Consent.provision.actor">
      <path value="Consent.provision.actor" />
      <min value="1" />
    </element>
    <element id="Consent.provision.actor.role">
      <path value="Consent.provision.actor.role" />
      <binding>
        <strength value="extensible" />
        <valueSet value="urn:nijz:consentagent:roleclassSI" />
      </binding>
    </element>
    <element id="Consent.provision.actor.reference">
      <path value="Consent.provision.actor.reference" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Patient" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/PractitionerRole" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Practitioner" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Organization" />
      </type>
    </element>
    <element id="Consent.provision.action">
      <path value="Consent.provision.action" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Consent.provision.action.coding.system">
      <path value="Consent.provision.action.coding.system" />
      <fixedUri value="http://terminology.hl7.org/CodeSystem/consentaction" />
    </element>
    <element id="Consent.provision.action.coding.code">
      <path value="Consent.provision.action.coding.code" />
      <fixedCode value="access" />
    </element>
    <element id="Consent.provision.action.coding.display">
      <path value="Consent.provision.action.coding.display" />
      <fixedString value="Access" />
    </element>
    <element id="Consent.provision.purpose">
      <path value="Consent.provision.purpose" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Consent.provision.purpose.system">
      <path value="Consent.provision.purpose.system" />
      <fixedUri value="http://terminology.hl7.org/ValueSet/v3-PurposeOfUse" />
    </element>
    <element id="Consent.provision.purpose.code">
      <path value="Consent.provision.purpose.code" />
      <fixedCode value="PATRQT" />
    </element>
    <element id="Consent.provision.purpose.display">
      <path value="Consent.provision.purpose.display" />
      <fixedString value="patient requested" />
    </element>
    <element id="Consent.provision.class">
      <path value="Consent.provision.class" />
      <max value="0" />
    </element>
  </differential>
</StructureDefinition>