Page Status: updated 2022-11-03

Data lock (Basic) - Create

Page index

Introduction

Sv. Skapa spärr.

This page describes how to create secrecy locka and privacy locks (data locks) for a patient by a few examples.

Creating a data lock is done by the following operation.

POST [base]/Basic

A set of HTTP headers must be provided in order to create a data lock and the data lock itself is provided as a Basic of type DataLock 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 NLLDataLock for more information about the DataLock resource.

Before a DataLock 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 an privacy data lock

This example shows how an privacy data lock is created. The privacy lock is created by the prescriber on behalf of the patient.

HTTP headers

Header Value Comment
authorization {...,"FORSKRIVARKOD":"9000027","VARDGIVARE":"0123456789","YRKESKOD":["LK"],"loa":3} Selected information from the OAuth2-ticket in decoded form
prefer
x-access
x-org-info {"orgenhetsOrt":"Sala"} Decoded value
x-patientref
x-provenance Provenance for a patient Decoded value
x-purpose
x-request-id 83cf13d5-18f2-4548-bae0-219ed3de9e7e
x-user-agent {"name":"Test application","version":"0.01010101010.1 beta"} Decoded value

HTTP body: Create DataLock - privacy lock of a prescription chain

Example 2 - Create a secrecy data lock

This example shows how a healthcare professional creates a secrecy data lock so the patient can't see the cause of treatment of a prescription chain.

HTTP headers

Header Value Comment
authorization {...,"FORSKRIVARKOD":"9000027","VARDGIVARE":"0123456789","YRKESKOD":["LK"],"loa":3} Selected information from the OAuth2-ticket in decoded form
prefer
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 a449f092-b16b-4e41-aca5-883952a9a794
x-user-agent {"name":"Test application","version":"0.01010101010.1 beta"} Decoded value

HTTP body: Create DataLock - secrecy lock