Page Status: updated 2022-11-09

Transaction Bundle - Prescriptions

Page index

Introduction

Sv. Hantera flera förskrivningar.

This page describes how to create, update or close multiple prescriptions in one call by a few examples.

This is done by sending a Bundle of prescriptions in a call to the following operation.

POST [base]/

A set of HTTP headers must be provided with the call and the prescriptions are provided as a Bundle in the HTTP body.

Before a MedicationRequest is created or updated, 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 caller

Example 1 - Stop two prescriptions in a prescription chain

This example shows how to end both the active prescription and the one to be active in a prescription chain. In this case by a pharmacy.

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=represenation
x-access
x-org-info
x-patientref
x-provenance Provenance for a pharmacy user Decoded value
x-purpose
x-request-id 556b9b97-624f-4442-a099-fc3627f400d3
x-user-agent {"name":"Test application","version":"0.01010101010.1 beta"} Decoded value

HTTP body: Transaction Bundle stop prescriptions

Example 2 - Cancel two prescriptions in a prescription chain

This example shows how to cancel both the active prescription and the one to be active in a prescription chain. In this case by a healtcare provider.

HTTP headers

Header Value Comment
authorization {...,"FORSKRIVARKOD":"9000027","VARDGIVARE":"0123456789","YRKESKOD":["LK"],"loa":3} Selected information from the OAuth2-ticket in decoded form
prefer return=represenation
x-access
x-org-info {"orgenhetsOrt":"Sala"} Decoded value
x-patientref
x-provenance Provenance for a healthcare user Decoded value
x-purpose
x-request-id e2401847-d9fb-4b10-a66d-3fa785302fed
x-user-agent {"name":"Test application","version":"0.01010101010.1 beta"} Decoded value

HTTP body: Transaction Bundle cancel prescriptions

Example 3 - Update one prescription and cancel another in a prescription chain

This example shows how to update the the active prescription and cancel the one to be active in a prescription chain. In this case by a healtcare provider.

HTTP headers

Header Value Comment
authorization {...,"FORSKRIVARKOD":"9000027","VARDGIVARE":"0123456789","YRKESKOD":["LK"],"loa":3} Selected information from the OAuth2-ticket in decoded form
prefer return=OperationOutcome
x-access
x-org-info {"orgenhetsOrt":"Sala"} Decoded value
x-patientref
x-provenance Provenance for a healthcare user Decoded value
x-purpose
x-request-id aeaaa878-7eb1-421f-b4d2-c8d0e186c99e
x-user-agent {"name":"Test application","version":"0.01010101010.1 beta"} Decoded value

HTTP body: Transaction Bundle update-cancel prescriptions