<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="nl-vzvz-Device" />
  <language value="nl-NL" />
  <url value="http://vzvz.nl/fhir/StructureDefinition/nl-vzvz-Device" />
  <version value="4.0.0-beta.1" />
  <name value="NLVZVZDevice" />
  <status value="draft" />
  <publisher value="VZVZ" />
  <contact>
    <name value="VZVZ" />
    <telecom>
      <system value="email" />
      <value value="standaardisatie@vzvz.nl" />
      <use value="work" />
    </telecom>
  </contact>
  <description value="Device profile as used in AORTA and outside the AORTA infra" />
  <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="Device" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Device" />
  <derivation value="constraint" />
  <differential>
    <element id="Device.identifier">
      <path value="Device.identifier" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="system" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <definition value="Business identifier of the Device" />
      <comment value="If this identifier defines a Device the AORTA infrastructure the identifier represents the applicationid,&#xA;  notherwise the identifier conforms to the system/value defined by the relevant infrastructure" />
      <min value="1" />
      <max value="1" />
      <example>
        <label value="AORTA application ID" />
        <valueIdentifier>
          <system value="http://fhir.nl/fhir/NamingSystem/aorta-app-id" />
          <value value="12345678" />
        </valueIdentifier>
      </example>
      <example>
        <label value="OID based identifier of a non-AORTA device" />
        <valueIdentifier>
          <system value="urn:ietf:rfc:3986" />
          <value value="urn:oid:2.16.840.1.113883.1.2.3.45678" />
        </valueIdentifier>
      </example>
    </element>
    <element id="Device.identifier:aorta-app-id">
      <path value="Device.identifier" />
      <sliceName value="aorta-app-id" />
      <short value="applicationID" />
      <definition value="This identifier identifies the Device in the AORTA infrastructure" />
      <comment value="Use this slice to identify a device with its AORTA application-ID.&#xA;  Note: the system element can contain either an OID root or a FHIR NamingSystem.&#xA;&#xA;  If the OID variant is uses the system element MUST contain the OID root and the value element MUST contain the OID extension, aka the AORTA application-ID." />
      <min value="0" />
      <max value="1" />
      <example>
        <label value="App-ID with FHIR NamingSystem" />
        <valueIdentifier>
          <system value="http://fhir.nl/fhir/NamingSystem/aorta-app-id" />
          <value value="12345678" />
        </valueIdentifier>
      </example>
      <example>
        <label value="App-ID with OID root" />
        <valueIdentifier>
          <system value="urn:oid:2.16.840.1.113883.2.4.6.6" />
          <value value="12345678" />
        </valueIdentifier>
      </example>
      <constraint>
        <key value="aai-01" />
        <severity value="error" />
        <human value="OID root should be separated from extension for AORTA app-id" />
        <expression value="iif($this.system.contains('http://fhir.nl/fhir/NamingSystem/aorta-app-id') or &#xA;$this.system.contains('2.16.840.1.113883.2.4.6.6') or&#xA;$this.system.contains('2.16.840.1.113883.2.4.3.111.3.16'), &#xA;$this.value.contains('2.16.840.1.113883.2.4.6.6').not() and&#xA;$this.value.contains('2.16.840.1.113883.2.4.3.111.3.16').not()&#xA;,true)" />
        <source value="http://vzvz.nl/fhir/StructureDefinition/nl-vzvz-Device" />
      </constraint>
    </element>
    <element id="Device.identifier:aorta-app-id.system">
      <path value="Device.identifier.system" />
      <binding>
        <strength value="required" />
        <valueSet value="http://vzvz.nl/fhir/ValueSet/aorta-device" />
      </binding>
    </element>
    <element id="Device.deviceName">
      <path value="Device.deviceName" />
      <definition value="The deviceName is not used because the ValueSet of the deviceName.type is experimental&#xA;and this profile should not be considered experimental." />
      <max value="0" />
    </element>
    <element id="Device.owner">
      <path value="Device.owner" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Organization" />
        <targetProfile value="http://nictiz.nl/fhir/StructureDefinition/nl-core-HealthcareProvider-Organization" />
      </type>
      <constraint>
        <key value="only-ura-01" />
        <severity value="error" />
        <human value="System must be the canonical URL or OID defined in NamingSystem ura" />
        <expression value="reference.exists() or identifier.where(system = 'http://fhir.nl/fhir/NamingSystem/ura' or system = 'urn:oid:2.16.528.1.1007.3.3').exists()" />
        <source value="http://vzvz.nl/fhir/StructureDefinition/nl-vzvz-Device" />
      </constraint>
    </element>
  </differential>
</StructureDefinition>