<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="CA-eReC-ServiceRequest" />
  <url value="http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/CA-eReC-ServiceRequest" />
  <name value="ServiceRequest" />
  <title value="ServiceRequest" />
  <status value="draft" />
  <description value="ServiceRequest is the main resource used to send all referral related information to the destination system." />
  <fhirVersion value="4.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="ServiceRequest" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/ServiceRequest" />
  <derivation value="constraint" />
  <differential>
    <element id="ServiceRequest.extension">
      <path value="ServiceRequest.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <ordered value="false" />
        <rules value="open" />
      </slicing>
    </element>
    <element id="ServiceRequest.extension:PatientPresentLocation">
      <path value="ServiceRequest.extension" />
      <sliceName value="PatientPresentLocation" />
      <short value="USE CASE SUPPORT: Systems deployed in Ontario SHALL support" />
      <type>
        <code value="Extension" />
        <profile value="http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/CA-eReC-Patient-Present-Location-EXT" />
      </type>
    </element>
    <element id="ServiceRequest.extension:DARC">
      <path value="ServiceRequest.extension" />
      <sliceName value="DARC" />
      <short value="USE CASE SUPPORT: Systems deployed in Ontario SHALL support" />
      <type>
        <code value="Extension" />
        <profile value="http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/DARC-EXT" />
      </type>
    </element>
    <element id="ServiceRequest.extension:DART">
      <path value="ServiceRequest.extension" />
      <sliceName value="DART" />
      <short value="USE CASE SUPPORT: Systems deployed in Ontario SHALL support" />
      <type>
        <code value="Extension" />
        <profile value="http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/DART-ext" />
      </type>
    </element>
    <element id="ServiceRequest.extension:RoutingOptions">
      <path value="ServiceRequest.extension" />
      <sliceName value="RoutingOptions" />
      <short value="USE CASE SUPPORT: Systems deployed in Ontario SHALL support" />
      <type>
        <code value="Extension" />
        <profile value="http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/Routing-Options-EXT" />
      </type>
    </element>
    <element id="ServiceRequest.extension:CopiedParticipants">
      <path value="ServiceRequest.extension" />
      <sliceName value="CopiedParticipants" />
      <short value="USE CASE SUPPORT: Systems deployed in Ontario SHALL support" />
      <type>
        <code value="Extension" />
        <profile value="http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/CA-eReC-copied-participants-EXT" />
      </type>
    </element>
    <element id="ServiceRequest.extension:ServiceProviderPreference">
      <path value="ServiceRequest.extension" />
      <sliceName value="ServiceProviderPreference" />
      <short value="USE CASE SUPPORT: Systems deployed in Ontario SHALL support" />
      <type>
        <code value="Extension" />
        <profile value="http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/CA-eReC-ext-ServiceProviderPreference" />
      </type>
    </element>
    <element id="ServiceRequest.identifier">
      <path value="ServiceRequest.identifier" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.identifier.system">
      <path value="ServiceRequest.identifier.system" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.identifier.value">
      <path value="ServiceRequest.identifier.value" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.basedOn">
      <path value="ServiceRequest.basedOn" />
      <short value="𝗨𝗦𝗘 𝗖𝗔𝗦𝗘 𝗦𝗨𝗣𝗣𝗢𝗥𝗧: Systems that support routing/chaining/splitting SHALL support" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/CA-eReC-ServiceRequest" />
      </type>
    </element>
    <element id="ServiceRequest.basedOn.reference">
      <path value="ServiceRequest.basedOn.reference" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.basedOn.identifier">
      <path value="ServiceRequest.basedOn.identifier" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.basedOn.identifier.system">
      <path value="ServiceRequest.basedOn.identifier.system" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.basedOn.identifier.value">
      <path value="ServiceRequest.basedOn.identifier.value" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.replaces">
      <path value="ServiceRequest.replaces" />
      <short value="𝗨𝗦𝗘 𝗖𝗔𝗦𝗘 𝗦𝗨𝗣𝗣𝗢𝗥𝗧: Systems that support routing/chaining/splitting SHALL support" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/CA-eReC-ServiceRequest" />
      </type>
    </element>
    <element id="ServiceRequest.replaces.reference">
      <path value="ServiceRequest.replaces.reference" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.replaces.identifier">
      <path value="ServiceRequest.replaces.identifier" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.replaces.identifier.system">
      <path value="ServiceRequest.replaces.identifier.system" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.replaces.identifier.value">
      <path value="ServiceRequest.replaces.identifier.value" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.requisition">
      <path value="ServiceRequest.requisition" />
      <short value="𝗨𝗦𝗘 𝗖𝗔𝗦𝗘 𝗦𝗨𝗣𝗣𝗢𝗥𝗧: Systems that support routing/chaining/splitting SHALL support" />
    </element>
    <element id="ServiceRequest.requisition.system">
      <path value="ServiceRequest.requisition.system" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.requisition.value">
      <path value="ServiceRequest.requisition.value" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.status">
      <path value="ServiceRequest.status" />
      <mustSupport value="true" />
      <binding>
        <strength value="required" />
        <valueSet value="http://hl7.org/fhir/ValueSet/request-status" />
      </binding>
    </element>
    <element id="ServiceRequest.intent">
      <path value="ServiceRequest.intent" />
      <fixedCode value="proposal" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.category">
      <path value="ServiceRequest.category" />
      <mustSupport value="true" />
      <binding>
        <strength value="preferred" />
        <valueSet value="http://fhir.infoway-inforoute.ca/ValueSet/interventioncodesubsetcare" />
      </binding>
    </element>
    <element id="ServiceRequest.code">
      <path value="ServiceRequest.code" />
      <short value="Note that the meaning of this field is to be used in conjunction with ServiceRequest.performer pointing to a HealthCareservice, and .code further specifies the service, for example code could be a specific procedure under the specificed HealthcareService (e.g., HealthcareService = Orthopaedic Surgeon, code=Knee Surgery)" />
      <mustSupport value="true" />
      <binding>
        <strength value="extensible" />
        <valueSet value="http://fhir.infoway-inforoute.ca/ValueSet/interventioncodesubsetcare" />
      </binding>
    </element>
    <element id="ServiceRequest.subject">
      <path value="ServiceRequest.subject" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/CA-eReC-Patient" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.subject.reference">
      <path value="ServiceRequest.subject.reference" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.subject.identifier">
      <path value="ServiceRequest.subject.identifier" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.subject.identifier.system">
      <path value="ServiceRequest.subject.identifier.system" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.subject.identifier.value">
      <path value="ServiceRequest.subject.identifier.value" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.authoredOn">
      <path value="ServiceRequest.authoredOn" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.requester">
      <path value="ServiceRequest.requester" />
      <min value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/CA-eReC-PractitionerRole" />
        <targetProfile value="http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/CA-eReC-Patient" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.requester.extension">
      <path value="ServiceRequest.requester.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <ordered value="false" />
        <rules value="open" />
      </slicing>
    </element>
    <element id="ServiceRequest.requester.extension:ServiceRequesterDelegate">
      <path value="ServiceRequest.requester.extension" />
      <sliceName value="ServiceRequesterDelegate" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/CA-eReC-ext-ServiceRequesterDelegate" />
      </type>
    </element>
    <element id="ServiceRequest.requester.reference">
      <path value="ServiceRequest.requester.reference" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.requester.identifier">
      <path value="ServiceRequest.requester.identifier" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.requester.identifier.system">
      <path value="ServiceRequest.requester.identifier.system" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.requester.identifier.value">
      <path value="ServiceRequest.requester.identifier.value" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.performer">
      <path value="ServiceRequest.performer" />
      <min value="1" />
      <max value="*" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/CA-eReC-PractitionerRole" />
        <targetProfile value="http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/CA-eReC-HealthcareService" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.performer.extension">
      <path value="ServiceRequest.performer.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <ordered value="false" />
        <rules value="open" />
      </slicing>
    </element>
    <element id="ServiceRequest.performer.extension:PerformerIdentifier">
      <path value="ServiceRequest.performer.extension" />
      <sliceName value="PerformerIdentifier" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/CA-eReC-performer-identifier-EXT" />
      </type>
    </element>
    <element id="ServiceRequest.performer.reference">
      <path value="ServiceRequest.performer.reference" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.performer.identifier">
      <path value="ServiceRequest.performer.identifier" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.performer.identifier.system">
      <path value="ServiceRequest.performer.identifier.system" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.performer.identifier.value">
      <path value="ServiceRequest.performer.identifier.value" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.reasonCode">
      <path value="ServiceRequest.reasonCode" />
      <mustSupport value="true" />
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="ServiceRequestReason" />
        </extension>
        <strength value="preferred" />
        <description value="Diagnosis or problem codes justifying the reason for requesting the service investigation." />
        <valueSet value="http://hl7.org/fhir/ValueSet/procedure-reason" />
      </binding>
    </element>
    <element id="ServiceRequest.supportingInfo">
      <path value="ServiceRequest.supportingInfo" />
      <definition value="Additional clinical information about the patient or specimen that may influence the services or their interpretations. This information includes diagnosis, clinical findings and other observations.  In laboratory ordering these are typically referred to as &quot;ask at order entry questions (AOEs)&quot;.  This includes observations explicitly requested by the producer (filler) to provide context or supporting information needed to complete the order. For example,  reporting the amount of inspired oxygen for blood gas measurements." />
      <comment value="To represent information about how the services are to be delivered use the `instructions` element. This element can be used to provide a Patient Summary as well." />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Resource">
          <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-type-must-support">
            <valueBoolean value="false" />
          </extension>
        </targetProfile>
        <targetProfile value="http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/CA-eReC-DocumentReference">
          <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-type-must-support">
            <valueBoolean value="true" />
          </extension>
        </targetProfile>
        <targetProfile value="http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/CA-eReC-Communication">
          <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-type-must-support">
            <valueBoolean value="true" />
          </extension>
        </targetProfile>
        <targetProfile value="http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/CA-eReC-QuestionnaireResponse">
          <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-type-must-support">
            <valueBoolean value="true" />
          </extension>
        </targetProfile>
        <targetProfile value="http://fhir.infoway-inforoute.ca/io/psca/StructureDefinition/condition-ca-ps">
          <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-type-must-support">
            <valueBoolean value="false" />
          </extension>
        </targetProfile>
        <targetProfile value="http://fhir.infoway-inforoute.ca/io/psca/StructureDefinition/allergyintolerance-ca-ps">
          <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-type-must-support">
            <valueBoolean value="false" />
          </extension>
        </targetProfile>
      </type>
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.supportingInfo.reference">
      <path value="ServiceRequest.supportingInfo.reference" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.supportingInfo.identifier">
      <path value="ServiceRequest.supportingInfo.identifier" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.supportingInfo.identifier.system">
      <path value="ServiceRequest.supportingInfo.identifier.system" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.supportingInfo.identifier.value">
      <path value="ServiceRequest.supportingInfo.identifier.value" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.note">
      <path value="ServiceRequest.note" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.note.author[x]">
      <path value="ServiceRequest.note.author[x]" />
      <slicing>
        <discriminator>
          <type value="type" />
          <path value="$this" />
        </discriminator>
        <ordered value="false" />
        <rules value="open" />
      </slicing>
    </element>
    <element id="ServiceRequest.note.author[x]:authorReference">
      <path value="ServiceRequest.note.author[x]" />
      <sliceName value="authorReference" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/CA-eReC-Practitioner" />
        <targetProfile value="http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/CA-eReC-Organization" />
        <targetProfile value="http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/CA-eReC-Patient" />
      </type>
    </element>
    <element id="ServiceRequest.note.author[x]:authorReference.reference">
      <path value="ServiceRequest.note.author[x].reference" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.note.author[x]:authorReference.identifier">
      <path value="ServiceRequest.note.author[x].identifier" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.note.author[x]:authorReference.identifier.system">
      <path value="ServiceRequest.note.author[x].identifier.system" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.note.author[x]:authorReference.identifier.value">
      <path value="ServiceRequest.note.author[x].identifier.value" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
  </differential>
</StructureDefinition>