<?xml version="1.0" encoding="UTF-8"?>

<OperationDefinition xmlns="http://hl7.org/fhir">
  <id value="MedicationListFi-get-medicationlist"/>
  <text>
    <status value="generated"/><div xmlns="http://www.w3.org/1999/xhtml"><p class="res-header-id"><b>Generated Narrative: OperationDefinition MedicationListFi-get-medicationlist</b></p><a name="MedicationListFi-get-medicationlist"> </a><a name="hcMedicationListFi-get-medicationlist"> </a><p>URL: [base]/$MedicationListFi-get-medicationlist</p><h3>Parameters</h3><table class="grid"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Scope</b></td><td><b>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>IN</td><td>requestPurpose</td><td/><td>1..1</td><td><a href="http://hl7.org/fhir/R4/datatypes.html#Coding">Coding</a></td><td/><td><div><p>Purpose of requesting medication information. Expressed using a code from the Kanta code system 'urn:oid:1.2.246.537.5.40110.2006' (Sähköinen lääkemääräys - Reseptikyselyn syy). Provide both the system and the code.</p>
</div></td></tr><tr><td>IN</td><td>consentType</td><td/><td>1..1</td><td><a href="http://hl7.org/fhir/R4/datatypes.html#Coding">Coding</a></td><td/><td><div><p>Type of consent received from the patient or his/her trustee. Expressed using a code from the Kanta code system 'urn:oid:1.2.246.537.5.40119.2006' (Sähköinen lääkemääräys - Suostumustyypit). Provide both the system and the code.</p>
</div></td></tr><tr><td>IN</td><td>serviceEventId</td><td/><td>0..1</td><td><a href="http://hl7.org/fhir/R4/datatypes.html#Identifier">Identifier</a></td><td/><td><div><p>Identifier of a service event, if request is done from a open service event.</p>
</div></td></tr><tr><td>IN</td><td>patientIdentifier</td><td/><td>1..1</td><td><a href="http://hl7.org/fhir/R4/datatypes.html#Identifier">Identifier</a></td><td/><td><div><p>Identifier of the patient. Provide both the system 'urn:oid:1.2.246.21' and the identifier.</p>
</div></td></tr><tr><td>IN</td><td>category</td><td/><td>0..*</td><td><a href="http://hl7.org/fhir/R4/datatypes.html#Coding">Coding</a></td><td/><td><div><p>Category of the prescription. This parameter is <strong>required for pharmacies and hospital pharmacies</strong> and not allowed for patient information systems. The category is expressed using a code from the Kanta code system 'urn:oid:1.2.246.537.6.605.2014' (THL - Reseptin laji). Provide both the system and the code.</p>
</div></td></tr><tr><td>OUT</td><td>return</td><td/><td>1..1</td><td><a href="http://hl7.org/fhir/R4/parameters.html">Parameters</a></td><td/><td><div><p>Kanta medication list</p>
</div></td></tr></table></div>
  </text>
  <url value="https://eradocumentation.atostek.com/OperationDefinition/MedicationListFi-get-medicationlist"/>
  <version value="1.0.0"/>
  <name value="MedicationListFi-Get-MedicationList"/>
  <title value="MedicationListFI Get Medication List"/>
  <status value="draft"/>
  <kind value="operation"/>
  <date value="2026-10-28T11:52:12+00:00"/>
  <publisher value="Atostek"/>
  <contact>
    <name value="Atostek"/>
    <telecom>
      <system value="url"/>
      <value value="https://atostek.com/"/>
    </telecom>
  </contact>
  <description value="The operation performs a request to the Kanta Prescription Centre and retrieves a list of the current medication of the patient. This list includes most recent versions of prescriptions that are currently in use, their most recent renewal requests, and information about blocks, reservations, and the most recent dispenses. Also, medications that have been discontinued during the past year and prescriptions cancelled no more than a year ago are returned. If the medication has an active discontinuation note, it will be returned as well.&#xA;&#xA;The operation requires an active ERA session and the client registry ID. Please provide these in the request header.&#xA;&#xA;The search result is stored in the client's registry in ERA's database and returned to the client. The search results can be limited if the patient has restricted the sharing of their personal health information.&#xA;&#xA;The operation returns a Parameters resource that contains a Bundle with information about the patient's current medication. During a transition period, the Parameters resource may also contain a second Bundle with a list of medications that have been prescribed to the patient without identifiers of current use. If the search is performed successfully but returns no results, an empty Bundle is returned."/>
  <code value="MedicationListFi-get-medicationlist"/>
  <system value="true"/>
  <type value="false"/>
  <instance value="false"/>
  <parameter>
    <name value="requestPurpose"/>
    <use value="in"/>
    <min value="1"/>
    <max value="1"/>
    <documentation value="Purpose of requesting medication information. Expressed using a code from the Kanta code system 'urn:oid:1.2.246.537.5.40110.2006' (Sähköinen lääkemääräys - Reseptikyselyn syy). Provide both the system and the code."/>
    <type value="Coding"/>
  </parameter>
  <parameter>
    <name value="consentType"/>
    <use value="in"/>
    <min value="1"/>
    <max value="1"/>
    <documentation value="Type of consent received from the patient or his/her trustee. Expressed using a code from the Kanta code system 'urn:oid:1.2.246.537.5.40119.2006' (Sähköinen lääkemääräys - Suostumustyypit). Provide both the system and the code."/>
    <type value="Coding"/>
  </parameter>
  <parameter>
    <name value="serviceEventId"/>
    <use value="in"/>
    <min value="0"/>
    <max value="1"/>
    <documentation value="Identifier of a service event, if request is done from a open service event."/>
    <type value="Identifier"/>
  </parameter>
  <parameter>
    <name value="patientIdentifier"/>
    <use value="in"/>
    <min value="1"/>
    <max value="1"/>
    <documentation value="Identifier of the patient. Provide both the system 'urn:oid:1.2.246.21' and the identifier."/>
    <type value="Identifier"/>
  </parameter>
  <parameter>
    <name value="category"/>
    <use value="in"/>
    <min value="0"/>
    <max value="*"/>
    <documentation value="Category of the prescription. This parameter is **required for pharmacies and hospital pharmacies** and not allowed for patient information systems. The category is expressed using a code from the Kanta code system 'urn:oid:1.2.246.537.6.605.2014' (THL - Reseptin laji). Provide both the system and the code."/>
    <type value="Coding"/>
  </parameter>
  <parameter>
    <name value="return"/>
    <use value="out"/>
    <min value="1"/>
    <max value="1"/>
    <documentation value="Kanta medication list"/>
    <type value="Parameters"/>
  </parameter>
</OperationDefinition>