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