<StructureDefinition xmlns="http://hl7.org/fhir">
  <url value="http://electronichealth.se/fhir/StructureDefinition/NLLProvenanceMedicationRequestStopped" />
  <version value="1.1.0" />
  <name value="NLLProvenanceMedicationRequestStopped" />
  <status value="active" />
  <date value="2025-04-24" />
  <publisher value="Swedish eHealth Agency" />
  <description value="A derived profile of NLLProvenance. &#xD;&#xA;Used when creation a new Provenance when prescription is stopped (sv avsluta)." />
  <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="The reason why the prescription was stopped" />
      <definition value="The reason why the prescription was stopped (sv Avsluta). Codes from the value set nll-reason-for-provenance are allowed. The value set nll-reason-for-provenance is a combination of the value sets nll-reason-for-cancellation and nll-snomed-reason-for-change" />
      <min value="1" />
    </element>
    <element id="Provenance.reason.coding">
      <path value="Provenance.reason.coding" />
      <min value="1" />
    </element>
    <element id="Provenance.reason.text">
      <path value="Provenance.reason.text" />
      <definition value="Plain text representation of the reason that the activity was taking place. &#xD;&#xA;Mandatory when the code &quot;OTH&quot; (other) is used." />
    </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 the scenario for stopping (sv avsluta) a prescription, AVSLUTA_FORSKRIVNING" />
      <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>