Page Status: updated 2024-10-28
Prescription - Close
Page index
Introduction
Sv. Avsluta förskrivning, makulera förskrivning.
This page describes two different ways of ending a prescription for a patient by example.
Cancel a prescription using PUT
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.
- HTTP headers: see HTTP Header and Authorization for more information about the various headers used by the National Medication List.
- HTTP body: see MedicationRequest for more information about the MedicationRequest 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 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.
Stop or cancel a prescription using reference
POST [base]/MedicationRequest/$end
Using this operation it is possible to stop or cancel multiple prescriptions of a Patient in a single request. A prescription is identified either by logical id or NEF-id. The caller does not need to know the latest version of each resource to update.
For more details about the Operation Definition see NLLEnd and Makulera eller avsluta via förskrivningsreferens - $end
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 - Stop a prescription
This example shows how to end a prescription momentarily.
HTTP headers
Header | Value | Comment |
---|---|---|
authorization | {...,"PERSONNUMMER":"199006012398","EFTERNAMN":"Receptarie","FORNAMN":"Ritva","APOTEKSID":"7350046611966","UTOKAD_YRKESKOD":["RE"],"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 | 125f42a1-ebae-4e69-8204-99afb8ecd970 |
|
x-user-agent | {"name":"Test application","version":"0.01010101010.1 beta"} |
Decoded value |
HTTP body: Close MedicationRequest as a healthcare provider
Examples - Cancel or stop prescription(s) using reference
HTTP headers
Not all headers used in the PUT example are required when using MedicationRequest/$end
Header | Value | Comment |
---|---|---|
Authorization | {...,"PERSONNUMMER":"199006012398","EFTERNAMN":"Receptarie","FORNAMN":"Ritva","APOTEKSID":"7350046611966","UTOKAD_YRKESKOD":["RE"],"loa":3} |
Selected information from the OAuth2-ticket in decoded form |
x-org-info | {"orgenhetsOrt":"Sala"} |
Decoded value |
x-provenance | Provenance for a healthcare user | Decoded value. Note that while activity is required in the provenance, it's not used. The activity is provided in each entry in the body. |
x-request-id | 125f42a1-ebae-4e69-8204-99afb8ecd970 |
|
x-user-agent | {"name":"Test application","version":"0.01010101010.1 beta"} |
Decoded value |
Example 2 - Cancel (sv Makulera) a MedicationRequest using its logical id
HTTP body: Cancel MedicationRequest using NLLEnd
Example 3 - Stop (sv Avsluta) a MedicationRequest and deleting its nllUsageEndDate
HTTP body: Stop MedicationRequest using NLLEnd
Example 4 - Cancel (sv Makulera) a MedicationRequest using its legacy NEF-ids
HTTP body: Cancel MedicationRequest using NLLEnd