<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="healthcareService-currentWaitTime" />
  <url value="http://fhir.infoway-inforoute.ca/ca-ext/StructureDefinition/healthcareService-currentWaitTime" />
  <version value="1.1.0" />
  <name value="HealthcareServiceCurrentWaitTime" />
  <title value="HealthcareService Current WaitTime" />
  <status value="draft" />
  <description value="This extension describes the expected wait-time of a service to the patient. Service directory utilizes the extension to ensure that there are automatically generated expected wait-time and self-reported wait-time provided for each service, alongside how long the patient is expected to be on a wait list (i.e. days/weeks/months) for that service." />
  <jurisdiction>
    <coding>
      <system value="https://canadapost.ca/CodeSystem/ProvinceCodes" />
      <code value="AB" />
    </coding>
    <coding>
      <system value="https://canadapost.ca/CodeSystem/ProvinceCodes" />
      <code value="ON" />
    </coding>
    <coding>
      <system value="urn:iso:std:iso:3166" />
      <code value="CA" />
    </coding>
  </jurisdiction>
  <fhirVersion value="4.0.1" />
  <kind value="complex-type" />
  <abstract value="false" />
  <context>
    <type value="element" />
    <expression value="HealthcareService.type" />
  </context>
  <context>
    <type value="element" />
    <expression value="HealthcareService.category" />
  </context>
  <type value="Extension" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Extension" />
  <derivation value="constraint" />
  <differential>
    <element id="Extension.extension:waitType">
      <path value="Extension.extension" />
      <sliceName value="waitType" />
      <definition value="Types include “Expected wait-time” (calculated through information provided in elements below by the system) or “Self-reported wait-time” (provided by the healthcare service provider/patient)​." />
    </element>
    <element id="Extension.extension:waitType.url">
      <path value="Extension.extension.url" />
      <fixedUri value="waitType" />
    </element>
    <element id="Extension.extension:waitType.value[x]">
      <path value="Extension.extension.value[x]" />
      <type>
        <code value="CodeableConcept" />
      </type>
      <binding>
        <strength value="extensible" />
        <description value="Types include “Expected wait-time” (calculated through information provided in elements below by the system) or “Self-reported wait-time” (provided by the healthcare service provider/patient)​." />
        <valueSet value="http://fhir.infoway-inforoute.ca/io/CA-CSD/ValueSet/current-wait-time" />
      </binding>
    </element>
    <element id="Extension.extension:duration">
      <path value="Extension.extension" />
      <sliceName value="duration" />
      <definition value="In expected number of days/weeks/months or in range covering the duration​." />
    </element>
    <element id="Extension.extension:duration.url">
      <path value="Extension.extension.url" />
      <fixedUri value="duration" />
    </element>
    <element id="Extension.extension:duration.value[x]">
      <path value="Extension.extension.value[x]" />
      <type>
        <code value="Duration" />
      </type>
    </element>
    <element id="Extension.extension:priority">
      <path value="Extension.extension" />
      <sliceName value="priority" />
      <definition value="Priority status (if-available), used to escalate patient need for eReferral/eConsult​​." />
    </element>
    <element id="Extension.extension:priority.url">
      <path value="Extension.extension.url" />
      <fixedUri value="priority" />
    </element>
    <element id="Extension.extension:priority.value[x]">
      <path value="Extension.extension.value[x]" />
      <code>
        <code value="priority" />
        <display value="priority" />
      </code>
      <type>
        <code value="code" />
      </type>
    </element>
    <element id="Extension.url">
      <path value="Extension.url" />
      <fixedUri value="http://fhir.infoway-inforoute.ca/ca-ext/StructureDefinition/healthcareService-currentWaitTime" />
    </element>
  </differential>
</StructureDefinition>