Page Status: updated 2022-11-09

Prescription - Create

Page index

Introduction

Sv. Skapa förskrivning, registrera förskrivning.

This page describes how to create a prescription for a patient by a few examples.

Creating a prescription is done by the following operation.

POST [base]/MedicationRequest

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

Before a MedicationRequest 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 prescription as a healthcare provider

This example shows how a healthcare provider creates a prescription for a patient having a personal identification number (sv. personnummer).

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 75151d14-ab0f-48ee-a5a3-36e4821f54c2
x-user-agent {"name":"Test application","version":"0.01010101010.1 beta"} Decoded value

HTTP body: Create MedicationRequest as a healthcare provider

Example 2 - Create prescription as a pharmacy

This example shows how a pharmacy creates a prescription for a patient having a personal identification number (sv. personnummer).

HTTP headers

Header Value Comment
authorization {...,"APOTEKSID":"7350046611966","LEGITIMATIONSKOD":"920007","YRKESKOD":["AP"],"exp":1651590542,"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 daee0351-560d-4bae-92c1-2a49abe0a50e
x-user-agent {"name":"Test application","version":"0.01010101010.1 beta"} Decoded value

HTTP body: Create MedicationRequest as a pharmacy

Example 3 - Create prescription for a patient on birthdate

This example shows how to create a prescription for a patient who doesn't have a valid personal identity number (sv. personnummer). In these scenarios the patient or medication list summary (MedicationListInfo) can't be fetched since the patient is not registered as such and doesn't have a unique identifier.

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 88590fcf-7571-4e94-ba66-c3d51e19addb
x-user-agent {"name":"Test application","version":"0.01010101010.1 beta"} Decoded value

HTTP body: Create MedicationRequest on birthdate

Example 4 - Create prescription of medical consumables

This example shows how a medical consumable is prescribed.

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 e9684c91-5076-4937-9822-608e5b67d177
x-user-agent {"name":"Test application","version":"0.01010101010.1 beta"} Decoded value

HTTP body: Create MedicationRequest of medical consumables

Example 5 - Create prescription for a patient having a multi-dose dispensing consent

This example shows how to prescribe multi-dose dispensing to a patient who has a multi-dose dispensing consent.

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 9f12736b-6958-4fa7-afda-0bb17496c881
x-user-agent {"name":"Test application","version":"0.01010101010.1 beta"} Decoded value

HTTP body: Create MedicationRequest for multi-dose dispensing

Example 6 - Create a parallel prescription

This example shows how to create a parallel prescription within a prescription chain. The new prescription replace the currentrly active one at the appointed usage start date. The prior prescription's usage end date is set to the day before the new prescription's usage start date.

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=representation
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 8662be43-49e2-4fbd-8514-67529e47de33
x-user-agent {"name":"Test application","version":"0.01010101010.1 beta"} Decoded value

HTTP body: Create MedicationRequest parallel active