<StructureDefinition xmlns="http://hl7.org/fhir">
  <url value="https://fhir.cambio.se/StructureDefinition/MedicationRequestDoseDispensing" />
  <version value="1.0" />
  <name value="MedicationRequestDoseDispensing" />
  <status value="draft" />
  <description value="This profile will be used for communicating prescription data that needs to be dispensed from dose dispensing machines." />
  <copyright value="Kalindu Perera @Cambio 2023" />
  <fhirVersion value="4.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="MedicationRequest" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/MedicationRequest" />
  <derivation value="constraint" />
  <snapshot />
  <differential>
    <element id="MedicationRequest">
      <path value="MedicationRequest" />
      <definition value="An order or request for both supply of the medication and the instructions for administration of the medication to a patient. The resource is called &quot;MedicationRequest&quot; rather than &quot;MedicationPrescription&quot; or &quot;MedicationOrder&quot; to generalize the use across inpatient and outpatient settings, including care plans, etc., and to harmonize with workflow patterns. This profile will be used for communicating prescription data that needs to be dispensed from dose dispensing machines." />
    </element>
    <element id="MedicationRequest.intent">
      <path value="MedicationRequest.intent" />
      <requirements value="The use case to order set of drugs to be dispensed from a machine" />
      <fixedCode value="order" />
    </element>
    <element id="MedicationRequest.subject">
      <path value="MedicationRequest.subject" />
      <requirements value="Since when requested from the external system they will send one request per patient so we will not send multiple patient data in one medicationRequest response. Also will be sending information of one prescription in one medicationRequest response so there will be no use case for use groups" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Patient" />
      </type>
    </element>
    <element id="MedicationRequest.instantiatesCanonical">
      <path value="MedicationRequest.instantiatesCanonical" />
      <max value="0" />
    </element>
    <element id="MedicationRequest.instantiatesUri">
      <path value="MedicationRequest.instantiatesUri" />
      <max value="0" />
    </element>
    <element id="MedicationRequest.courseOfTherapyType">
      <path value="MedicationRequest.courseOfTherapyType" />
      <requirements value="Not available in the cambio medication" />
      <max value="0" />
    </element>
    <element id="MedicationRequest.insurance">
      <path value="MedicationRequest.insurance" />
      <requirements value="No use case to communicate insuarance details from this profile" />
      <max value="0" />
    </element>
    <element id="MedicationRequest.eventHistory">
      <path value="MedicationRequest.eventHistory" />
      <max value="0" />
    </element>
  </differential>
</StructureDefinition>