Page Status: updated 2022-10-31

Prescription - Update

Page index

Introduction

Sv. Uppdatera förskrivning.

This page describes how to update a prescription for a patient by an example.

Updating a prescription is done by the following operation.

PUT [base]/MedicationRequest

A set of HTTP headers must be provided in order to update a prescription and the prescription itself is provided as a MedicationRequest in the HTTP body.

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 MedicationRequest is 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 calling system

Example 1 - Update prescription from a pharmacy

This example shows how to change the medical consumable of a prescription. The change is made by a pharmacy. The update is based on (Fetch MedicationRequest for medical consumables).

HTTP headers

Header Value Comment
authorization {...,"LEGITIMATIONSKOD":"920007","APOTEKSID":"7350046611966","YRKESKOD":["AP"],"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 pharmacy user Decoded value
x-purpose
x-request-id 4e2e93a2-e7f2-4347-b834-7c9b27db3068
x-user-agent {"name":"Test application","version":"0.01010101010.1 beta"} Decoded value

HTTP body: Update MedicationRequest for medical consumables