Page Status: updated 2022-06-17

Prescription - Create

Page index

Introduction

Sv: användningsfall - 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.

  • HTTP headers: see HTTP Header and Authorization for more information about the various headers used by the Swedish National Medication List.
  • HTTP body: see MedicationRequest for more information about the MedicationRequest resource.

Before a prescription is created, the prescriber needs to see information about the patient, the patient's medication and consents, etc. In order to do so, the system used by the prescriber must communicate with many different FHIR resources. As the national medication list is largely based on structured information, this also includes retrieving a large number of value sets in order to be able to translate codes into display texts.

For more information about 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 Swedish 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 when creating or updating a resource is mandatory when creating or updating a prescription
x-access The cause for the call is not needed when creating or updating a resource
x-org-info Information about the users's organisation
x-patientref The logical ID of the patient is not needed when creating a resource
x-provenance A provenance resource with information about the user interacting with NLL
x-purpose The purpose of the call is not needed when creating or updating a resource
x-request-id A random and unique ID in each request
x-user-agent Information about the caller

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":"Orgsala"} 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":"Orgsala"} 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":"Orgsala"} 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":"Orgsala"} 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":"Orgsala"} 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