<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="ca-on-eReferral-profile-ServiceRequest" />
  <url value="http://ehealthontario.ca/fhir/StructureDefinition/ca-on-eReferral-profile-ServiceRequest" />
  <version value="1.0.0" />
  <name value="EReferralServiceRequest" />
  <title value="ServiceRequest" />
  <status value="draft" />
  <description value="ServiceRequest is the main resource use 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.meta">
      <path value="ServiceRequest.meta" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.meta.profile">
      <path value="ServiceRequest.meta.profile" />
      <comment value="#### **_` FOR eREFERRAL USAGE: The meta.profile = http://ehealthontario.ca/fhir/StructureDefinition/ca-on-eReferral-profile-ServiceRequest|1.0.0 `_**&#xD;&#xA;&#xD;&#xA;It is up to the server and/or other infrastructure of policy to determine whether/how these claims are verified and/or updated over time.  The list of profile URLs is a set." />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.extension">
      <path value="ServiceRequest.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <min value="0" />
    </element>
    <element id="ServiceRequest.extension:PatientPresentLocation">
      <path value="ServiceRequest.extension" />
      <sliceName value="PatientPresentLocation" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://ehealthontario.ca/fhir/StructureDefinition/ext-patient-present-location" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.extension:PatientPresentLocation.value[x]">
      <path value="ServiceRequest.extension.value[x]" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.extension:PatientPresentLocation.value[x].reference">
      <path value="ServiceRequest.extension.value[x].reference" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.extension:PatientPresentLocation.value[x].identifier">
      <path value="ServiceRequest.extension.value[x].identifier" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.extension:PatientPresentLocation.value[x].identifier.system">
      <path value="ServiceRequest.extension.value[x].identifier.system" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.extension:PatientPresentLocation.value[x].identifier.value">
      <path value="ServiceRequest.extension.value[x].identifier.value" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.extension:RoutingOptions">
      <path value="ServiceRequest.extension" />
      <sliceName value="RoutingOptions" />
      <min value="0" />
      <type>
        <code value="Extension" />
        <profile value="http://ehealthontario.ca/fhir/StructureDefinition/ext-routing-options" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.extension:RoutingOptions.value[x]">
      <path value="ServiceRequest.extension.value[x]" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.extension:RoutingOptions.value[x].coding">
      <path value="ServiceRequest.extension.value[x].coding" />
      <mustSupport value="true" />
      <binding>
        <strength value="extensible" />
        <valueSet value="http://ehealthontario.ca/fhir/ValueSet/ereferral-source-types" />
      </binding>
    </element>
    <element id="ServiceRequest.extension:RoutingOptions.value[x].coding.system">
      <path value="ServiceRequest.extension.value[x].coding.system" />
      <fixedUri value="http://ehealthontario.ca/fhir/CodeSystem/ereferral-source-types" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.extension:RoutingOptions.value[x].coding.code">
      <path value="ServiceRequest.extension.value[x].coding.code" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.extension:RoutingOptions.value[x].coding.display">
      <path value="ServiceRequest.extension.value[x].coding.display" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.identifier">
      <path value="ServiceRequest.identifier" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.identifier.extension">
      <path value="ServiceRequest.identifier.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <min value="0" />
    </element>
    <element id="ServiceRequest.identifier.extension:performerIdentifierTest">
      <path value="ServiceRequest.identifier.extension" />
      <sliceName value="performerIdentifierTest" />
      <min value="0" />
      <type>
        <code value="Extension" />
        <profile value="http://ehealthontario.ca/fhir/StructureDefinition/ext-performer-identifier" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.identifier.type">
      <path value="ServiceRequest.identifier.type" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.identifier.type.coding">
      <path value="ServiceRequest.identifier.type.coding" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.identifier.type.coding.system">
      <path value="ServiceRequest.identifier.type.coding.system" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.identifier.type.coding.code">
      <path value="ServiceRequest.identifier.type.coding.code" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.identifier.type.coding.display">
      <path value="ServiceRequest.identifier.type.coding.display" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.identifier.system">
      <path value="ServiceRequest.identifier.system" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.identifier.value">
      <path value="ServiceRequest.identifier.value" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.basedOn">
      <path value="ServiceRequest.basedOn" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://ehealthontario.ca/fhir/StructureDefinition/ca-on-eReferral-profile-ServiceRequest" />
        <aggregation value="referenced" />
      </type>
    </element>
    <element id="ServiceRequest.requisition">
      <path value="ServiceRequest.requisition" />
      <comment value="#### **_` FOR EREFERRAL USAGE: It is highly recommended that the common elements should match between multiple ServiceRequests (e.g., patient, requester, etc...) Requests are linked either by a &quot;basedOn&quot; relationship (i.e. one request is fulfilling another) or by having a common requisition. Requests that are part of the same requisition are generally treated independently from the perspective of changing their state or maintaining them after initial creation. `_**" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.requisition.system">
      <path value="ServiceRequest.requisition.system" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.requisition.value">
      <path value="ServiceRequest.requisition.value" />
      <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="extensible" />
        <valueSet value="https://fhir.infoway-inforoute.ca/ValueSet/interventioncodesubsetcare" />
      </binding>
    </element>
    <element id="ServiceRequest.category.coding">
      <path value="ServiceRequest.category.coding" />
      <comment value="Codes may be defined very casually in enumerations, or code lists, up to very formal definitions such as SNOMED CT - see the HL7 v3 Core Principles for more information.  Ordering of codings is undefined and SHALL NOT be used to infer meaning. Generally, at most only one of the coding values will be labeled as UserSelected = true.&#xD;&#xA;&#xD;&#xA;For details of the value set, please visit https://tgateway.infoway-inforoute.ca/mtw.html?id=2.16.840.1.113883.2.20.3.97&amp;versionid=20160311" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.category.coding.system">
      <path value="ServiceRequest.category.coding.system" />
      <min value="1" />
      <fixedUri value="http://snomed.info/sct" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.category.coding.code">
      <path value="ServiceRequest.category.coding.code" />
      <min value="1" />
      <mustSupport value="true" />
      <binding>
        <strength value="extensible" />
        <valueSet value="https://fhir.infoway-inforoute.ca/ValueSet/interventioncodesubsetcare" />
      </binding>
    </element>
    <element id="ServiceRequest.category.coding.display">
      <path value="ServiceRequest.category.coding.display" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.priority">
      <path value="ServiceRequest.priority" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.code">
      <path value="ServiceRequest.code" />
      <definition value="A code that identifies a particular service (i.e., procedure, diagnostic investigation, or panel of investigations) that have been requested.&#xD;&#xA;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)" />
      <comment value="#### **_`FOR EREFERRAL USAGE: The meaning of this field is to be used in conjunction with ServiceRequest.performing 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). `_**&#xD;&#xA;&#xD;&#xA;Many laboratory and radiology procedure codes embed the specimen/organ system in the test order name, for example,  serum or serum/plasma glucose, or a chest x-ray. The specimen might not be recorded separately from the test code." />
      <mustSupport value="true" />
      <binding>
        <strength value="extensible" />
        <valueSet value="https://fhir.infoway-inforoute.ca/ValueSet/interventioncodesubsetcare" />
      </binding>
    </element>
    <element id="ServiceRequest.code.coding">
      <path value="ServiceRequest.code.coding" />
      <comment value="Codes may be defined very casually in enumerations, or code lists, up to very formal definitions such as SNOMED CT - see the HL7 v3 Core Principles for more information.  Ordering of codings is undefined and SHALL NOT be used to infer meaning. Generally, at most only one of the coding values will be labeled as UserSelected = true.&#xD;&#xA;&#xD;&#xA;For details of the value set, please visit https://tgateway.infoway-inforoute.ca/mtw.html?id=2.16.840.1.113883.2.20.3.97&amp;versionid=20160311" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.code.coding.system">
      <path value="ServiceRequest.code.coding.system" />
      <min value="1" />
      <fixedUri value="http://snomed.info/sct" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.code.coding.code">
      <path value="ServiceRequest.code.coding.code" />
      <min value="1" />
      <mustSupport value="true" />
      <binding>
        <strength value="extensible" />
        <valueSet value="https://fhir.infoway-inforoute.ca/ValueSet/interventioncodesubsetcare" />
      </binding>
    </element>
    <element id="ServiceRequest.code.coding.display">
      <path value="ServiceRequest.code.coding.display" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.orderDetail">
      <path value="ServiceRequest.orderDetail" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.orderDetail.coding">
      <path value="ServiceRequest.orderDetail.coding" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.orderDetail.coding.system">
      <path value="ServiceRequest.orderDetail.coding.system" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.orderDetail.coding.code">
      <path value="ServiceRequest.orderDetail.coding.code" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.orderDetail.coding.display">
      <path value="ServiceRequest.orderDetail.coding.display" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.subject">
      <path value="ServiceRequest.subject" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://ehealthontario.ca/fhir/StructureDefinition/ca-on-eReferral-profile-Patient" />
        <aggregation value="referenced" />
      </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" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.subject.identifier.value">
      <path value="ServiceRequest.subject.identifier.value" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.authoredOn">
      <path value="ServiceRequest.authoredOn" />
      <definition value="When the request transitioned to being actionable. In case it's 'blank' the date time should fall back to the submission time/system time of the SENDING system." />
      <comment value="#### **_`FOR EREFERRAL USAGE: authoredOn is the submission time of the sending system `_**" />
      <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://ehealthontario.ca/fhir/StructureDefinition/ca-on-eReferral-profile-PractitionerRole" />
        <targetProfile value="http://ehealthontario.ca/fhir/StructureDefinition/ca-on-eReferral-profile-Patient" />
        <aggregation value="referenced" />
      </type>
      <mustSupport value="true" />
    </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" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.requester.identifier.value">
      <path value="ServiceRequest.requester.identifier.value" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.performer">
      <path value="ServiceRequest.performer" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://ehealthontario.ca/fhir/StructureDefinition/ca-on-eReferral-profile-PractitionerRole" />
        <aggregation value="referenced" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.performer.extension">
      <path value="ServiceRequest.performer.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <min value="0" />
    </element>
    <element id="ServiceRequest.performer.extension:performerIdentifier">
      <path value="ServiceRequest.performer.extension" />
      <sliceName value="performerIdentifier" />
      <min value="0" />
      <type>
        <code value="Extension" />
        <profile value="http://ehealthontario.ca/fhir/StructureDefinition/ext-performer-identifier" />
      </type>
      <mustSupport value="true" />
    </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" />
      <max value="0" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.performer.identifier.system">
      <path value="ServiceRequest.performer.identifier.system" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.performer.identifier.value">
      <path value="ServiceRequest.performer.identifier.value" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.reasonCode">
      <path value="ServiceRequest.reasonCode" />
      <mustSupport value="true" />
      <binding>
        <strength value="preferred" />
      </binding>
    </element>
    <element id="ServiceRequest.reasonCode.coding">
      <path value="ServiceRequest.reasonCode.coding" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.reasonCode.coding.system">
      <path value="ServiceRequest.reasonCode.coding.system" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.reasonCode.coding.code">
      <path value="ServiceRequest.reasonCode.coding.code" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.reasonCode.coding.display">
      <path value="ServiceRequest.reasonCode.coding.display" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.reasonCode.text">
      <path value="ServiceRequest.reasonCode.text" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.supportingInfo">
      <path value="ServiceRequest.supportingInfo" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Resource" />
        <targetProfile value="http://ehealthontario.ca/fhir/StructureDefinition/ca-on-eReferral-profile-QuestionnaireResponse" />
        <targetProfile value="http://ehealthontario.ca/fhir/StructureDefinition/ca-on-eReferral-profile-DocumentReference" />
        <targetProfile value="http://ehealthontario.ca/fhir/StructureDefinition/ca-on-eReferral-profile-Consent" />
        <targetProfile value="http://ehealthontario.ca/fhir/StructureDefinition/ca-on-eReferral-profile-AllergyIntolerance" />
        <targetProfile value="http://ehealthontario.ca/fhir/StructureDefinition/ca-on-eReferral-profile-Condition" />
        <targetProfile value="http://ehealthontario.ca/fhir/StructureDefinition/ca-on-eReferral-profile-Communication" />
      </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" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.supportingInfo.identifier.value">
      <path value="ServiceRequest.supportingInfo.identifier.value" />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.bodySite">
      <path value="ServiceRequest.bodySite" />
      <binding>
        <strength value="preferred" />
      </binding>
    </element>
    <element id="ServiceRequest.note">
      <path value="ServiceRequest.note" />
      <comment value="#### **_`FOR EREFERRAL USAGE: 'note' is used to include additional information in the referral that is not captured by an existing resource or in a DocumentReference. This is often used when the sending application has a custom data capture form with fields are not mapped to a resource (e.g., Food preference, home visit risk factors, etc...). `_**&#xD;&#xA;&#xD;&#xA;For systems that do not have structured annotations, they can simply communicate a single annotation with no author or time.  This element may need to be included in narrative because of the potential for modifying information.  *Annotations SHOULD NOT* be used to communicate &quot;modifying&quot; information that could be computable. (This is a SHOULD because enforcing user behavior is nearly impossible)." />
      <mustSupport value="true" />
    </element>
    <element id="ServiceRequest.note.author[x]">
      <path value="ServiceRequest.note.author[x]" />
      <comment value="#### **_`FOR EREFERRAL USAGE: On submission of the ServiceRequest, if .author[x] and .time are not included, they are assumed to be the requester and received time of the ServiceRequest respectively (this is expected to be the normal use case). `_**&#xD;&#xA;Organization is used when there's no need for specific attribution as to who made the comment." />
      <type>
        <code value="Reference" />
        <targetProfile value="http://ehealthontario.ca/fhir/StructureDefinition/ca-on-eReferral-profile-Practitioner" />
        <targetProfile value="http://ehealthontario.ca/fhir/StructureDefinition/ca-on-eReferral-profile-Organization" />
        <targetProfile value="http://ehealthontario.ca/fhir/StructureDefinition/ca-on-eReferral-profile-Patient" />
      </type>
      <type>
        <code value="string" />
      </type>
    </element>
    <element id="ServiceRequest.note.text">
      <path value="ServiceRequest.note.text" />
      <mustSupport value="true" />
    </element>
  </differential>
</StructureDefinition>