<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="30ded8c8-fbe8-4cb7-a431-d95ef0c206f1" />
  <url value="http://health.gov.on.ca/sadie/fhir/StructureDefinition/Request" />
  <version value="1.0.0" />
  <name value="MyServiceRequest" />
  <title value="Request" />
  <status value="active" />
  <description value="This is the Request, this profile is not very restrictive since the request can be saved at anytime.  The RequestSubmission profile is a more restriced profile of the Request." />
  <fhirVersion value="4.0.1" />
  <mapping>
    <identity value="workflow" />
    <uri value="http://hl7.org/fhir/workflow" />
    <name value="Workflow Pattern" />
  </mapping>
  <mapping>
    <identity value="v2" />
    <uri value="http://hl7.org/v2" />
    <name value="HL7 v2 Mapping" />
  </mapping>
  <mapping>
    <identity value="rim" />
    <uri value="http://hl7.org/v3" />
    <name value="RIM Mapping" />
  </mapping>
  <mapping>
    <identity value="w5" />
    <uri value="http://hl7.org/fhir/fivews" />
    <name value="FiveWs Pattern Mapping" />
  </mapping>
  <mapping>
    <identity value="quick" />
    <uri value="http://siframework.org/cqf" />
    <name value="Quality Improvement and Clinical Knowledge (QUICK)" />
  </mapping>
  <kind value="resource" />
  <abstract value="false" />
  <type value="ServiceRequest" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/ServiceRequest" />
  <derivation value="constraint" />
  <differential>
    <element id="ServiceRequest">
      <path value="ServiceRequest" />
      <definition value="#### **_`FOR SADIE USE:  This is a request.  Since the request can be saved anytime this profile is not very restrictive.  Profile(s) derived from this profile are more restrictive.`_**&#xA;&#xA;- can have a location&#xA;- must have a requestor&#xA;- can have an applicant&#xA;&#xA;&#xA;&#xA;A record of a request for service such as diagnostic investigations, treatments, or operations to be performed." />
    </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:requestCreatedUser">
      <path value="ServiceRequest.extension" />
      <sliceName value="requestCreatedUser" />
      <definition value="#### **_`FOR SADIE USE:  This is the user that created the request.`_**" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://health.gov.on.ca/sadie/fhir/StructureDefinition/CreatedUser" />
      </type>
    </element>
    <element id="ServiceRequest.extension:requestCreatedDate">
      <path value="ServiceRequest.extension" />
      <sliceName value="requestCreatedDate" />
      <definition value="#### **_`FOR SADIE USE:  This is the date and time the Request was created.`_**" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://health.gov.on.ca/sadie/fhir/StructureDefinition/CreatedDate" />
      </type>
    </element>
    <element id="ServiceRequest.extension:requestSubmittedUser">
      <path value="ServiceRequest.extension" />
      <sliceName value="requestSubmittedUser" />
      <definition value="#### **_`FOR SADIE USE:  This is the user that submitted the request.`_**" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://health.gov.on.ca/sadie/fhir/StructureDefinition/SubmittedUser" />
      </type>
    </element>
    <element id="ServiceRequest.extension:requestSubmittedDate">
      <path value="ServiceRequest.extension" />
      <sliceName value="requestSubmittedDate" />
      <definition value="#### **_`FOR SADIE USE:  This is the date and time the Request was submitted.`_**" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://health.gov.on.ca/sadie/fhir/StructureDefinition/RequestSubmittedDate" />
      </type>
    </element>
    <element id="ServiceRequest.extension:requestCompletedDate">
      <path value="ServiceRequest.extension" />
      <sliceName value="requestCompletedDate" />
      <definition value="#### **_`FOR SADIE USE:  This is the date and time the Request was completed.`_**" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://health.gov.on.ca/sadie/fhir/StructureDefinition/RequestCompletedDate" />
      </type>
    </element>
    <element id="ServiceRequest.extension:requestCompletedDateString">
      <path value="ServiceRequest.extension" />
      <sliceName value="requestCompletedDateString" />
      <definition value="#### **_`FOR SADIE USE:  This is the date and time the Request was completed, in String format, it is needed for searching.`_**" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://health.gov.on.ca/sadie/fhir/StructureDefinition/RequestCompletedDateString" />
      </type>
    </element>
    <element id="ServiceRequest.extension:requestSubmittedDateString">
      <path value="ServiceRequest.extension" />
      <sliceName value="requestSubmittedDateString" />
      <definition value="#### **_`FOR SADIE USE:  This is the String format of the Submitted Date element,  it is needed for searching.`_**" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://health.gov.on.ca/sadie/fhir/StructureDefinition/RequestSubmittedDateString" />
      </type>
    </element>
    <element id="ServiceRequest.extension:requestClientStatus">
      <path value="ServiceRequest.extension" />
      <sliceName value="requestClientStatus" />
      <definition value="#### **_`FOR SADIE USE:  This is the client's status for the Request.  The client can update this with anything they want, typically it will be 'Rejected' or 'Approved'.  This status appears on UI when the list of completed requests is displayed.`_**" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://health.gov.on.ca/sadie/fhir/StructureDefinition/RequestClientStatus" />
      </type>
    </element>
    <element id="ServiceRequest.extension:submissionConsent">
      <path value="ServiceRequest.extension" />
      <sliceName value="submissionConsent" />
      <definition value="#### **_`FOR SADIE USE:  The Terms Of Use Consent that the user submitting the request agreed to.`_**" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://health.gov.on.ca/sadie/fhir/StructureDefinition/RelatedSubmissionConsent" />
      </type>
    </element>
    <element id="ServiceRequest.extension:practitionerName">
      <path value="ServiceRequest.extension" />
      <sliceName value="practitionerName" />
      <definition value="#### **_`FOR SADIE USE:  The name of the practitioner that last updated this record.`_**" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://health.gov.on.ca/sadie/fhir/StructureDefinition/PractitionerName" />
      </type>
    </element>
    <element id="ServiceRequest.extension:clientCodeOne">
      <path value="ServiceRequest.extension" />
      <sliceName value="clientCodeOne" />
      <definition value="#### **_`FOR SADIE USE: This is the first client code. This is searchable using contains, this is needed by the user interface.`_**" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://health.gov.on.ca/sadie/fhir/StructureDefinition/ClientCodeOne" />
      </type>
    </element>
    <element id="ServiceRequest.extension:clientCodeTwo">
      <path value="ServiceRequest.extension" />
      <sliceName value="clientCodeTwo" />
      <definition value="#### **_`FOR SADIE USE: This is the second client code. This is searchable using contains, this is needed by the user interface.`_**" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://health.gov.on.ca/sadie/fhir/StructureDefinition/ClientCodeTwo" />
      </type>
    </element>
    <element id="ServiceRequest.extension:applicantName">
      <path value="ServiceRequest.extension" />
      <sliceName value="applicantName" />
      <definition value="#### **_`FOR SADIE USE:  The name of the Applicant. This is needed for searching and sorting on the user interface.`_**" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://health.gov.on.ca/sadie/fhir/StructureDefinition/ApplicantName" />
      </type>
    </element>
    <element id="ServiceRequest.extension:searchableString">
      <path value="ServiceRequest.extension" />
      <sliceName value="searchableString" />
      <definition value="#### **_`FOR SADIE USE:  This is for searching a combination of fields on the Submitted Request List. This will be loaded with the values from all the columns on the list. Each value will be seperated by the | character.`_**" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://health.gov.on.ca/sadie/fhir/StructureDefinition/SearchableString" />
      </type>
    </element>
    <element id="ServiceRequest.identifier">
      <path value="ServiceRequest.identifier" />
      <definition value="#### **_`FOR SADIE USE:  This is an identifier the client gives to request.  For 'ODSP' the identifier is the Refferal ID.`_**" />
    </element>
    <element id="ServiceRequest.identifier.use">
      <path value="ServiceRequest.identifier.use" />
      <max value="0" />
    </element>
    <element id="ServiceRequest.identifier.type">
      <path value="ServiceRequest.identifier.type" />
      <max value="0" />
    </element>
    <element id="ServiceRequest.identifier.type.coding">
      <path value="ServiceRequest.identifier.type.coding" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="ServiceRequest.identifier.type.coding.code">
      <path value="ServiceRequest.identifier.type.coding.code" />
      <min value="1" />
    </element>
    <element id="ServiceRequest.identifier.system">
      <path value="ServiceRequest.identifier.system" />
      <definition value="#### **_`FOR SADIE USE:  The system element will have the following format: urn:sadie:FHIR resource:Source System:Name in the source system`_**&#xA;&#xA;Establishes the namespace for the value - that is, a URL that describes a set values that are unique." />
      <min value="1" />
      <binding>
        <strength value="required" />
        <valueSet value="http://health.gov.on.ca/sadie/fhir/ValueSet/FlexForms-IdentifierSystems" />
      </binding>
    </element>
    <element id="ServiceRequest.identifier.value">
      <path value="ServiceRequest.identifier.value" />
      <min value="1" />
    </element>
    <element id="ServiceRequest.identifier.period">
      <path value="ServiceRequest.identifier.period" />
      <max value="0" />
    </element>
    <element id="ServiceRequest.identifier.assigner">
      <path value="ServiceRequest.identifier.assigner" />
      <max value="0" />
    </element>
    <element id="ServiceRequest.instantiatesCanonical">
      <path value="ServiceRequest.instantiatesCanonical" />
      <definition value="#### **_`FOR SADIE USE:  NOT SURE YET... If a generated reference number is required it may go here.`_**&#xA;&#xA;The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this ServiceRequest." />
      <max value="0" />
    </element>
    <element id="ServiceRequest.instantiatesUri">
      <path value="ServiceRequest.instantiatesUri" />
      <max value="0" />
    </element>
    <element id="ServiceRequest.basedOn">
      <path value="ServiceRequest.basedOn" />
      <definition value="#### **_`FOR SADIE USE:  If this is a child request (a request for additional information) then this will be a reference to the parent request. `_**&#xA;&#xA;Plan/proposal/order fulfilled by this request." />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/ServiceRequest" />
      </type>
    </element>
    <element id="ServiceRequest.replaces">
      <path value="ServiceRequest.replaces" />
      <max value="0" />
    </element>
    <element id="ServiceRequest.requisition">
      <path value="ServiceRequest.requisition" />
      <max value="0" />
    </element>
    <element id="ServiceRequest.status">
      <path value="ServiceRequest.status" />
      <definition value="#### **_`FOR SADIE USE:  The status of the request. We are required to use the FHIR codes, how we are using each code is defined in https://simplifier.net/specialauthorizationdigitalinformationexchange2/1661cfaf-3df0-4f53-a65e-92f95bb08a49  (ValueSet 'FlexForms-RequestStatuses')`_**&#xA; &#xA;The status of the order." />
      <binding>
        <strength value="required" />
        <valueSet value="http://hl7.org/fhir/ValueSet/request-status" />
      </binding>
    </element>
    <element id="ServiceRequest.intent">
      <path value="ServiceRequest.intent" />
      <definition value="#### **_`FOR SADIE USE:  This is required by FHIR and will always be 'order'`_**&#xA;Whether the request is a proposal, plan, an original order or a reflex order." />
      <fixedCode value="order" />
    </element>
    <element id="ServiceRequest.category">
      <path value="ServiceRequest.category" />
      <definition value="#### **_`FOR SADIE USE:  The type of request,  New Request or Additional Information.`_**" />
      <min value="1" />
      <max value="1" />
      <binding>
        <strength value="required" />
        <valueSet value="http://health.gov.on.ca/sadie/fhir/ValueSet/FlexForms-RequestTypes" />
      </binding>
    </element>
    <element id="ServiceRequest.priority">
      <path value="ServiceRequest.priority" />
      <max value="0" />
    </element>
    <element id="ServiceRequest.doNotPerform">
      <path value="ServiceRequest.doNotPerform" />
      <max value="0" />
    </element>
    <element id="ServiceRequest.code">
      <path value="ServiceRequest.code" />
      <max value="1" />
    </element>
    <element id="ServiceRequest.orderDetail">
      <path value="ServiceRequest.orderDetail" />
      <definition value="#### **_`FOR SADIE USE:  These are used for the Program Area specific columns on the WIP list. The first element in the array is Detail Column One,  the second element in the array is Detail Column Two`_**&#xA;&#xA;Additional details and instructions about the how the services are to be delivered.   For example, and order for a urinary catheter may have an order detail for an external or indwelling catheter, or an order for a bandage may require additional instructions specifying how the bandage should be applied." />
      <max value="2" />
    </element>
    <element id="ServiceRequest.quantity[x]">
      <path value="ServiceRequest.quantity[x]" />
      <max value="0" />
    </element>
    <element id="ServiceRequest.subject">
      <path value="ServiceRequest.subject" />
      <definition value="#### **_`FOR SADIE USE:  This is the Applicant.`_**&#xA;&#xA;On whom or what the service is to be performed. This is usually a human patient, but can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans)." />
      <type>
        <code value="Reference" />
        <targetProfile value="https://health.gov.on.ca/sadie/fhir/StructureDefinition/Applicant" />
      </type>
    </element>
    <element id="ServiceRequest.encounter">
      <path value="ServiceRequest.encounter" />
      <max value="0" />
    </element>
    <element id="ServiceRequest.occurrence[x]">
      <path value="ServiceRequest.occurrence[x]" />
      <max value="0" />
    </element>
    <element id="ServiceRequest.asNeeded[x]">
      <path value="ServiceRequest.asNeeded[x]" />
      <max value="0" />
    </element>
    <element id="ServiceRequest.authoredOn">
      <path value="ServiceRequest.authoredOn" />
      <definition value="#### **_`FOR SADIE USE:  This is the Request Date,  the Requestor can change this to any date.`_**&#xA;When the request transitioned to being actionable." />
    </element>
    <element id="ServiceRequest.requester">
      <path value="ServiceRequest.requester" />
      <definition value="#### **_`FOR SADIE USE:  This is used to store the owner of the request, it is a reference to a Requestor Role`_**&#xA;&#xA;The individual who initiated the request and has responsibility for its activation." />
      <type>
        <code value="Reference" />
        <targetProfile value="https://health.gov.on.ca/sadie/fhir/StructureDefinition/FlexFormsRole" />
      </type>
    </element>
    <element id="ServiceRequest.performerType">
      <path value="ServiceRequest.performerType" />
      <max value="0" />
    </element>
    <element id="ServiceRequest.performer">
      <path value="ServiceRequest.performer" />
      <comment value="#### **_`FOR SADIE USE:  This is used to store who modifed the request,  it is a reference to a FlexFormsRole`_**&#xA;&#xA;&#xA;&#xA;If multiple performers are present, it is interpreted as a list of *alternative* performers without any preference regardless of order.  If order of preference is needed use the [request-performerOrder extension](extension-request-performerorder.html).  Use CareTeam to represent a group of performers (for example, Practitioner A *and* Practitioner B)." />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://health.gov.on.ca/sadie/fhir/StructureDefinition/FlexFormsRole" />
      </type>
    </element>
    <element id="ServiceRequest.locationCode">
      <path value="ServiceRequest.locationCode" />
      <definition value="The preferred location(s) where the procedure should actually happen in coded or free text form. E.g. at home or nursing day care center." />
      <comment value="#### **_`FOR SADIE USE:  This is used to store the Location confirmation`_**&#xA;&#xA;&#xA;Not all terminology uses fit this general pattern. In some cases, models should not use CodeableConcept and use Coding directly and provide their own structure for managing text, codings, translations and the relationship between elements and pre- and post-coordination." />
      <max value="1" />
    </element>
    <element id="ServiceRequest.locationCode.coding.system">
      <path value="ServiceRequest.locationCode.coding.system" />
      <fixedUri value="https://health.gov.on.ca/sadie/fhir/CodeSystem/FlexForms-Internal-Complete" />
    </element>
    <element id="ServiceRequest.locationCode.coding.version">
      <path value="ServiceRequest.locationCode.coding.version" />
      <max value="0" />
    </element>
    <element id="ServiceRequest.locationCode.coding.code">
      <path value="ServiceRequest.locationCode.coding.code" />
      <definition value="#### **_`FOR SADIE USE:  This needs to be a code in http://health.gov.on.ca/sadie/fhir/ValueSet/FlexForms-LocationConfirmationStatuses.  There seems to be bug that doesn't allow this to be binded to the ValueSet. If it does have a binding then  validation with return a null pointer reference `_**." />
    </element>
    <element id="ServiceRequest.locationCode.coding.display">
      <path value="ServiceRequest.locationCode.coding.display" />
      <max value="0" />
    </element>
    <element id="ServiceRequest.locationCode.coding.userSelected">
      <path value="ServiceRequest.locationCode.coding.userSelected" />
      <max value="0" />
    </element>
    <element id="ServiceRequest.locationCode.text">
      <path value="ServiceRequest.locationCode.text" />
      <max value="0" />
    </element>
    <element id="ServiceRequest.locationReference">
      <path value="ServiceRequest.locationReference" />
      <definition value="#### **_`FOR SADIE USE:  This is the Requestor's location.`_**&#xA;&#xA;A reference to the the preferred location(s) where the procedure should actually happen. E.g. at home or nursing day care center." />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://health.gov.on.ca/sadie/fhir/StructureDefinition/RequestorLocation" />
      </type>
    </element>
    <element id="ServiceRequest.reasonCode">
      <path value="ServiceRequest.reasonCode" />
      <definition value="#### **_`FOR SADIE USE:  This is the Questionnaire Code.`_**&#xA;&#xA; An explanation or justification for why this service is being requested in coded or textual form." />
      <max value="1" />
    </element>
    <element id="ServiceRequest.reasonReference">
      <path value="ServiceRequest.reasonReference" />
      <max value="0" />
    </element>
    <element id="ServiceRequest.insurance">
      <path value="ServiceRequest.insurance" />
      <max value="0" />
    </element>
    <element id="ServiceRequest.supportingInfo">
      <path value="ServiceRequest.supportingInfo" />
      <definition value="#### **_`FOR SADIE USE:  Once submitted this is where the generated PDF is referenced.   It is a reference to a RequestPDF resource.`_**&#xA;&#xA;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 ask at order entry questions (AOEs).  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." />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://health.gov.on.ca/sadie/fhir/StructureDefinition/RequestPDF" />
      </type>
    </element>
    <element id="ServiceRequest.specimen">
      <path value="ServiceRequest.specimen" />
      <max value="0" />
    </element>
    <element id="ServiceRequest.bodySite">
      <path value="ServiceRequest.bodySite" />
      <max value="0" />
    </element>
    <element id="ServiceRequest.note">
      <path value="ServiceRequest.note" />
      <max value="0" />
    </element>
    <element id="ServiceRequest.patientInstruction">
      <path value="ServiceRequest.patientInstruction" />
      <max value="0" />
    </element>
    <element id="ServiceRequest.relevantHistory">
      <path value="ServiceRequest.relevantHistory" />
      <definition value="#### **_`FOR SADIE USE:  This captures the status changes so they can appear on the user interface.`_**&#xA;&#xA;Key events in the history of the request." />
      <max value="0" />
    </element>
  </differential>
</StructureDefinition>