Page Status: updated 2022-11-03

Get NLLDataLock (Basic)

Page index

Introduction

sv. Hämta spärr.

This page describes how to fetch the resource Basic of type DataLock for a patient by an example.

A DataLock can be fetched in different ways. See DataLock query operations for information about all options.

In short, a query request is either a read, that is, a retrieval via the resource ID, or a search via a search condition. The result differs between a read and a search. A search results in a Bundle being returned containing all matching resources. If there are no hits, an empty Bundle is returned. A read results in the requested resource being returned or an error if no resource with the requested ID exists. If a system error occurs both searches and reads result in an error (i.e. an OperationOutcome).

Before a DataLock can be retrieved and presented to the user, other information is needed from 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.

Request

Fetching a Basic of type DataLock is done by one of the following operations;

GET [base]/Basic/[id]
GET [base]/Basic?code=datalock&[search parameters]

Request Headers

A set of HTTP headers must be provided in order to fetch a DataLock. See HTTP Header and Authorization for more information about the various headers used by the National Medication List.

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

Response Body

See NLLDataLock for more information about the DataLock resource.

Examples

Example 1 - Get a secrecy data lock

This example shows a confidentiality lock created by a healthcare professional (see example 1 on Create NLLDataLock) so that the patient can't see the cause of treatment of a prescription chain.

Request

The request is made as a search by the logical id of the patient;

GET [base]/Basic?code=datalock&patient._id=02ca682b-e728-43d7-845c-466238f2e96e

Request Headers

Header Value Comment
authorization {...,"FORSKRIVARKOD":"9000027","VARDGIVARE":"0123456789","YRKESKOD":["LK"],"loa":3} Selected information from the OAuth2-ticket in decoded form
x-access TILLFALLIGT_SAMTYCKE_SPARRADE_UPPGIFTER
x-org-info {"orgenhetsOrt":"Sala"} Decoded value
x-patientref 02ca682b-e728-43d7-845c-466238f2e96e
x-purpose VARD
x-request-id 26c9adea-7173-4883-a90b-ecaa2b1828c8
x-user-agent {"name":"Test system testaren","version":"0.01010101010.1 beta"} Decoded value

Response Body

See Fetch DataLock - secrecy lock.