Page Status: updated 2023-01-26

Dispense - Create

Page index

Introduction

Sv. Registrera uttag.

This page describes how to create a medication dispense for a patient by a few examples. Paperbased medication dispenses are decribed in a separate section.

Creating a medication dispense is done by the following operation.

POST [base]/MedicationDispense

A set of HTTP headers must be provided in order to create a medication dispense and the dispense itself is provided as a MedicationDispense in the HTTP body.

Before a MedicationDispense is created, 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 - Create a medication dispense with a detected issue

This example shows how a pharmacy registers a dispense of a prescription when there is an AFF warning that needs to be handled.

HTTP headers

Header Value Comment
authorization {...,"APOTEKSID":"7350046611966","LEGITIMATIONSKOD":"920007","YRKESKOD":["AP"],"loa":3} Selected information from the OAuth2-ticket in decoded form
prefer return=representation
x-access
x-org-info
x-patientref
x-provenance Provenance for a pharmacy user Decoded value
x-purpose
x-request-id 10d326c1-287b-4789-92f6-020841e09798
x-user-agent {"name":"Test system testaren","version":"0.01010101010.1 beta"} Decoded value

HTTP body: Create MedicationDispense with detectedIssue

Example 2 - Create a medication dispense with a final dispatch

This example shows how a pharmacy registers a dispense including an explicit final dispatch of the prescription.

HTTP headers

Header Value Comment
authorization {...,"APOTEKSID":"7350046611966","LEGITIMATIONSKOD":"920007","YRKESKOD":["AP"],"loa":3 Selected information from the OAuth2-ticket in decoded form
prefer return=representation
x-access
x-org-info
x-patientref
x-provenance Provenance for a pharmacy user Decoded value
x-purpose
x-request-id 12090211-699f-4d65-9350-b065468f5771
x-user-agent {"name":"Test system testaren","version":"0.01010101010.1 beta"} Decoded value

HTTP body: Create MedicationDispense with a complete prescription choice

Example 3 - Create a dispense paper prescription

This example shows how a pharmacy registers a dispense when there is no prescription in the National Medication List. The prescription were in this case made by a physician in Norway to a Swedish patient. The dispense is therefore not linked to a prescription, i.e. the element authorizingPrescription is missing, and the patient is refered to by a literal reference, i.e. subject:reference points at Patient/b00a0407-b781-43e8-983b-74fdfb8eb97d.

HTTP headers

Header Value Comment
authorization {...,"APOTEKSID":"7350046611966","LEGITIMATIONSKOD":"920007","YRKESKOD":["AP"],"loa":3 Selected information from the OAuth2-ticket in decoded form
prefer return=representation
x-access
x-org-info ´{"orgenhetsOrt":"Sala"}´ Decoded value
x-patientref
x-provenance Provenance for a pharmacy user Decoded value
x-purpose
x-request-id 01e09388-ebb6-4f60-9d89-0605690b2f85
x-user-agent {"name":"Test system testaren","version":"0.01010101010.1 beta"} Decoded value

HTTP body: Create dispense paper prescription

Example 3 - Create a dose dispensed medication dispense

This example shows how a pharmacy registers a dose dispensed medication dispense.

HTTP headers

Header Value Comment
authorization {...,"APOTEKSID":"7350046611966","LEGITIMATIONSKOD":"920007","YRKESKOD":["AP"],"loa":3 Selected information from the OAuth2-ticket in decoded form
prefer return=representation
x-access
x-org-info
x-patientref
x-provenance Provenance for a pharmacy user Decoded value
x-purpose
x-request-id 63fa04d6-07d9-4b80-912c-a460deab3ea3
x-user-agent {"name":"Test system testaren","version":"0.01010101010.1 beta"} Decoded value

HTTP body: Create dose dipensed MedicationDispense