Page Status: updated 2022-10-27
Dispense - Close
Page index
Introduction
Sv. Backa och kreditera uttag
This page describes how to reverse or credit a medication dispense for a patient by a few examples.
Updating a medication dispense is done by the following operation.
PUT [base]/MedicationDispense
A set of HTTP headers must be provided in order to cancel a medication dispense and the medication dispense itself is provided as a MedicationDispense in the HTTP body.
- HTTP headers: see HTTP Header and Authorization for more information about the various headers used by the National Medication List.
- HTTP body: see MedicationDispense for more information about the MedicationDispense resource.
A PUT will update the resource in its entirety, it is therefore important to get the latest version of the resource before performing a change. The resource is identified by the logical id (the id element). A PUT on a non existing logical id will fail.
Before a MedicationDispense is canceled, the user needs access to other information in the National Medication List. For more information on different scenarios and what information is required for each scenario, see Handbok för vård- och apotekstjänster: Verksamhetsområden.
Examples
HTTP Headers
See HTTP Header and Authorization for generic information about all HTTP headers used by the National Medication List including information about authorization, purpose and access type. The authorization token is translated to an authority role. The authority role together with the purpose and type of access is used by the National Medication List to determine what actions a user may perform and what information the user may access.
Header | Comment |
---|---|
authorization | The users's security token |
prefer | Type of returned content |
x-access | The cause for the call |
x-context-id | An ID to group a sequence of requests |
x-org-info | Information about the users's organisation |
x-patientref | The logical ID of the patient |
x-provenance | A provenance resource with information about the user interacting with NLL |
x-purpose | The purpose of the call |
x-request-id | A random and unique ID |
x-user-agent | Information about the calling system |
Example 1 - Reverse a medication dispense
This example shows how to undo a dispense before it has been accounted for.
HTTP headers
Header | Value | Comment |
---|---|---|
authorization | {...,"APOTEKSID":"7350046611966","LEGITIMATIONSKOD":"920007","YRKESKOD":["AP"],"loa":3} |
Selected information from the OAuth2-ticket in decoded form |
prefer | ||
x-access | ||
x-org-info | ||
x-patientref | ||
x-provenance | Provenance for a pharmacy user | Decoded value |
x-purpose | ||
x-request-id | f9b23d69-eddc-4bda-9db7-e1efdc709c48 |
|
x-user-agent | {"name":"Test application","version":"0.01010101010.1 beta"} |
Decoded value |
HTTP body: Close MedicationDispense reverse dispense
Example 2 - Credit a medication dispense
This example shows how to credit a dispense after it has been accounted for.
HTTP headers
Header | Value | Comment |
---|---|---|
authorization | {...,"APOTEKSID":"7350046611966","LEGITIMATIONSKOD":"920007","YRKESKOD":["AP"],"loa":3} |
Selected information from the OAuth2-ticket in decoded form |
prefer | ||
x-access | ||
x-org-info | ||
x-patientref | ||
x-provenance | Provenance for a pharmacy user | Decoded value |
x-purpose | ||
x-request-id | 69cf7dbd-904a-4877-ac53-059dc2c1412c |
|
x-user-agent | {"name":"Test application","version":"0.01010101010.1 beta"} |
Decoded value |
HTTP body: Close MedicationDispense credit dispense