<StructureDefinition xmlns="http://hl7.org/fhir">
  <url value="http://electronichealth.se/fhir/StructureDefinition/NLLProvenanceMedicationRequestOther" />
  <version value="1.1.0" />
  <name value="NLLProvenanceMedicationRequestOther" />
  <status value="active" />
  <date value="2025-04-24" />
  <publisher value="Swedish eHealth Agency" />
  <description value="A derived profile of NLLProvenance. &#xD;&#xA;Used when creating a new Provenance when a prescription is renewed (sv förnya), replaced (sv ersätta) or updated in some other manner except cancelling (sv makulera) or stopping (sv avsluta) which are described in their own separate profiles." />
  <fhirVersion value="4.0.1" />
  <mapping>
    <identity value="EHM" />
    <name value="E-hälsomyndigheten internal model" />
  </mapping>
  <kind value="resource" />
  <abstract value="false" />
  <type value="Provenance" />
  <baseDefinition value="http://electronichealth.se/fhir/StructureDefinition/NLLProvenance" />
  <derivation value="constraint" />
  <differential>
    <element id="Provenance.target">
      <path value="Provenance.target" />
      <short value="Target MedicationRequest" />
      <definition value="The MedicationRequest that was generated or updated by the activity described in this Provenance." />
      <type>
        <code value="Reference" />
        <targetProfile value="http://electronichealth.se/fhir/StructureDefinition/NLLMedicationRequest" />
      </type>
    </element>
    <element id="Provenance.reason">
      <path value="Provenance.reason" />
      <short value="Reason the MedicationRequest is changed" />
      <definition value="The reason is mandatory when the prescription is updated or replaced (sv uppdatera eller ersätta).&#xD;&#xA;For other activities (sv händelsetyper) the reason is optional and the only code allowed is OTH.&#xD;&#xA;Only codes from the value set nll-snomed-reason-for-change are allowed." />
      <binding>
        <strength value="required" />
        <valueSet value="http://electronichealth.se/fhir/ValueSet/nll-snomed-reason-for-change" />
      </binding>
    </element>
    <element id="Provenance.reason.coding">
      <path value="Provenance.reason.coding" />
      <min value="1" />
    </element>
    <element id="Provenance.activity">
      <path value="Provenance.activity" />
      <short value="Activity that occurred on the MedicationRequest" />
      <definition value="Describes the activity that occurred on a MedicationRequest. This profile supports all scenarios for changing a prescription except stopping (sv Avsluta) or cancelling (sv Makulera)." />
      <binding>
        <strength value="required" />
        <valueSet value="http://ehalsomyndigheten.se/fhir/ValueSet/medication-request-activity-types" />
      </binding>
    </element>
    <element id="Provenance.agent">
      <path value="Provenance.agent" />
      <short value="Practitioner involved for the MedicationRequest" />
    </element>
    <element id="Provenance.agent.who">
      <path value="Provenance.agent.who" />
      <definition value="The practitioners that participated in the event as contained resources." />
      <type>
        <code value="Reference" />
        <targetProfile value="http://electronichealth.se/fhir/StructureDefinition/NLLPractitioner" />
        <aggregation value="contained" />
      </type>
    </element>
  </differential>
</StructureDefinition>