<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="sgrdv-base-book-source-device" />
  <url value="http://sante.quebec/fhir/StructureDefinition/sgrdv-base-book-source-device" />
  <name value="SGRDVBaseBookSourceDevice" />
  <title value="Système source SGRDV pour $book (Base)" />
  <status value="draft" />
  <experimental value="true" />
  <description value="Spécialisation du Device source pour les demandes de réservation. Embarque la tuile du portail REO via Device.property[tuilePortail] et le lieu Clinique d'origine via Device.owner (logical reference vers Organization)." />
  <fhirVersion value="4.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="Device" />
  <baseDefinition value="http://sante.quebec/fhir/StructureDefinition/sgrdv-base-source-system-device" />
  <derivation value="constraint" />
  <differential>
    <element id="Device">
      <path value="Device" />
      <constraint>
        <key value="sgrdv-book-device-portail-identifier" />
        <severity value="error" />
        <human value="Le Device source d'une demande $book doit porter au moins un identifiant émis par le portail RVSQ Réo ou par Votre santé." />
        <expression value="identifier.where(system = 'http://sante.quebec/fhir/NamingSystem/RVSQREO' or system = 'http://sante.quebec/fhir/NamingSystem/VOTRESANTE').exists()" />
        <source value="http://sante.quebec/fhir/StructureDefinition/sgrdv-base-book-source-device" />
      </constraint>
    </element>
    <element id="Device.identifier">
      <path value="Device.identifier" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="system" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="Device.identifier:reo">
      <path value="Device.identifier" />
      <sliceName value="reo" />
      <min value="0" />
      <max value="*" />
    </element>
    <element id="Device.identifier:reo.system">
      <path value="Device.identifier.system" />
      <min value="1" />
      <fixedUri value="http://sante.quebec/fhir/NamingSystem/RVSQREO" />
    </element>
    <element id="Device.identifier:votresante">
      <path value="Device.identifier" />
      <sliceName value="votresante" />
      <min value="0" />
      <max value="*" />
    </element>
    <element id="Device.identifier:votresante.system">
      <path value="Device.identifier.system" />
      <min value="1" />
      <fixedUri value="http://sante.quebec/fhir/NamingSystem/VOTRESANTE" />
    </element>
    <element id="Device.property">
      <path value="Device.property" />
      <slicing>
        <discriminator>
          <type value="pattern" />
          <path value="type" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="Device.property:tuilePortail">
      <path value="Device.property" />
      <sliceName value="tuilePortail" />
      <min value="0" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Device.property:tuilePortail.type">
      <path value="Device.property.type" />
      <patternCodeableConcept>
        <coding>
          <system value="http://sante.quebec/fhir/CodeSystem/sgrdv-device-property-type" />
          <code value="tuilePortail" />
        </coding>
      </patternCodeableConcept>
    </element>
    <element id="Device.property:tuilePortail.valueCode">
      <path value="Device.property.valueCode" />
      <min value="1" />
      <max value="1" />
      <mustSupport value="true" />
      <binding>
        <strength value="required" />
        <valueSet value="http://sante.quebec/fhir/ValueSet/sgrdv-tuile-portail-reo-vs" />
      </binding>
    </element>
    <element id="Device.property:tuilePortail.valueCode.coding">
      <path value="Device.property.valueCode.coding" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Device.property:tuilePortail.valueCode.coding.system">
      <path value="Device.property.valueCode.coding.system" />
      <fixedUri value="http://sante.quebec/fhir/CodeSystem/sgrdv-tuile-portail-reo" />
    </element>
    <element id="Device.property:tuilePortail.valueCode.coding.code">
      <path value="Device.property.valueCode.coding.code" />
      <mustSupport value="true" />
    </element>
    <element id="Device.owner">
      <path value="Device.owner" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://sante.quebec/fhir/StructureDefinition/sgrdv-base-find-organization" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Device.owner.reference">
      <path value="Device.owner.reference" />
      <max value="0" />
    </element>
    <element id="Device.owner.type">
      <path value="Device.owner.type" />
      <fixedUri value="Organization" />
    </element>
    <element id="Device.owner.identifier">
      <path value="Device.owner.identifier" />
      <min value="1" />
    </element>
    <element id="Device.owner.identifier.type">
      <path value="Device.owner.identifier.type" />
      <min value="1" />
    </element>
    <element id="Device.owner.identifier.type.coding">
      <path value="Device.owner.identifier.type.coding" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Device.owner.identifier.type.coding.system">
      <path value="Device.owner.identifier.type.coding.system" />
      <fixedUri value="http://sante.quebec/fhir/CodeSystem/sgrdv-identifier-type" />
    </element>
    <element id="Device.owner.identifier.type.coding.code">
      <path value="Device.owner.identifier.type.coding.code" />
      <fixedCode value="CodeEtablissement" />
    </element>
    <element id="Device.owner.identifier.system">
      <path value="Device.owner.identifier.system" />
      <min value="1" />
    </element>
    <element id="Device.owner.identifier.value">
      <path value="Device.owner.identifier.value" />
      <min value="1" />
    </element>
  </differential>
</StructureDefinition>