<OperationDefinition xmlns="http://hl7.org/fhir">
  <id value="NLLReciept" />
  <url value="http://electronichealth.se/fhir/OperationDefinition/NLLReceipt" />
  <version value="1.0..0" />
  <name value="NLLReceipt" />
  <title value="NLLReceipt Operation" />
  <status value="active" />
  <kind value="operation" />
  <date value="2026-11-20" />
  <description value="The NLLReceipt operation provides a lightweight mechanism for determining whether a MedicationRequest resource exists and retrieving basic metadata without retrieving the complete resource.&#xD;&#xA;&#xD;&#xA;The operation is primarily intended to support client recovery and synchronization scenarios where the outcome of a previously submitted update request is uncertain.&#xD;&#xA;&#xD;&#xA;Clients SHOULD invoke this operation before retransmitting a request when the current state of a MedicationRequest resource is unknown.&#xD;&#xA;&#xD;&#xA;This initial version supports MedicationRequest resources only and is intended primarily for update scenarios. Future versions may extend support to create scenarios and additional resource types." />
  <purpose value="Supports client recovery and synchronization by enabling verification of the current state of an existing MedicationRequest resource.&#xD;&#xA;&#xD;&#xA;LogicalId SHOULD be used to verify whether a previous update operation has been successfully processed following a timeout, communication failure, or missing response.&#xD;&#xA;&#xD;&#xA;This initial version supports MedicationRequest resources only. Future versions may extend the operation to support create scenarios and additional resource types." />
  <affectsState value="false" />
  <code value="nll-receipt" />
  <comment value="This operation is intended for recovery and synchronization scenarios and should not be used as a general-purpose resource query mechanism. &#xA; &#xA;This operation SHOULD be used to verify the outcome of a previous update request before retransmission is attempted.&#xD;&#xA;**Invocation:** `POST [base]/$nll-receipt`. A LogicalId SHALL be supplied.&#xA; &#xA;This version of the operation supports MedicationRequest resources only and is intended primarily for update scenarios. &#xD;&#xA;&#xD;&#xA;Future versions will introduce support for `requestId` as an alternative identifier for receipt retrieval. This will enable receipt retrieval for scenarios where a logical resource identifier is not available to the client, such as resource creation requests. In such versions, exactly one of `logicalId` or `requestId` SHALL be supplied." />
  <system value="true" />
  <type value="false" />
  <instance value="false" />
  <parameter>
    <name value="logicalId" />
    <use value="in" />
    <min value="0" />
    <max value="1" />
    <documentation value="Logical identifier of an existing resource. SHOULD be used for verification following update requests (PUT) and for synchronization scenarios." />
    <type value="id" />
  </parameter>
  <parameter>
    <name value="requestId" />
    <use value="in" />
    <min value="0" />
    <max value="1" />
    <documentation value="Unique identifier of the original request. Reserved for future use." />
    <type value="id" />
  </parameter>
  <parameter>
    <name value="exists" />
    <use value="out" />
    <min value="1" />
    <max value="1" />
    <documentation value="Indicates whether a matching resource was found. When exists=false, no resource-specific output parameters are returned." />
    <type value="boolean" />
  </parameter>
  <parameter>
    <name value="logicalId" />
    <use value="out" />
    <min value="0" />
    <max value="1" />
    <documentation value="Logical identifier of the matching resource." />
    <type value="id" />
  </parameter>
  <parameter>
    <name value="chainId" />
    <use value="out" />
    <min value="0" />
    <max value="1" />
    <documentation value="Chain identifier of the matching resource." />
    <type value="string" />
  </parameter>
  <parameter>
    <name value="status" />
    <use value="out" />
    <min value="0" />
    <max value="1" />
    <documentation value="The response is filtered according to the value of the `x-purpose` request header.&#xA;* When `x-purpose=VARD`, the operation SHALL only return information for MedicationRequest resources having a status of `Stopped` or `Cancelled`.&#xA;* When `x-purpose=EXPEDIERING`, no status-based filtering is applied." />
    <type value="string" />
  </parameter>
  <parameter>
    <name value="created" />
    <use value="out" />
    <min value="0" />
    <max value="1" />
    <documentation value="Timestamp when the resource was originally created." />
    <type value="instant" />
  </parameter>
  <parameter>
    <name value="lastUpdated" />
    <use value="out" />
    <min value="0" />
    <max value="1" />
    <documentation value="Timestamp when the resource was last updated." />
    <type value="instant" />
  </parameter>
</OperationDefinition>