Page Status: Outdated

Datalock - Create

Page index

Introduction

Sv: användningsfall - Skapa spärr.

This use case describes the required interactions when a data lock should be added to a medication request (sv: skapa spärr för förskrivning) or to all medication dispenses without a reference to a medication request (sv: lösa uttag).

The basic approach to add a data lock is to use HTTP POST to create a new NLLDataLock resource and to refer to the MedicationRequest which should be locked (through the prescription chain id) and the Patient. If all medication dispenses without a reference to a medication request should be locked, only the patient reference is needed.

POST [base]/fhir/Basic

Sequence diagram

This interaction shows a sequence where the client creates a data lock, in this case a practitioner adds a secrecy lock (patient) after a medication request is created. The interaction requires a valid authorization token as an initial step, which is not shown in the diagram. It also requires that the chain id of the medication request id known.

Note that the requests shown in the diagram doesn't include the full basepath. It only shows the last part of the http request including resource.

Examples

Example 1 - Create integrity data lock

This example shows how to create a data lock for a given prescription chain and patient, where the patient wants an integrity lock defined and the practitioner assists by defining it.

Header: required authorization and provenance information

Parameter Mandatory Comment
Authorization Yes Bearer [valid OAuth2 token]
X-Access N/A -
X-Purpose N/A -
X-Provenance Yes Must be provided with information as described below. Note: The provenance object must be base64-encoded
nllDataLockReasonType INTEGRITET
author/enterer Author and (if applicable) enterer

An example of a full provenance json structure can be seen in: Provenance

DataLock resource

{
  "resourceType": "Basic",
  "meta": {
    "profile": [
      "http://electronichealth.se/fhir/StructureDefinition/NLLDataLock"
    ]
  },
  "extension": [
    {
      "url": "http://electronichealth.se/fhir/StructureDefinition/NLLDataLockTarget",
      "valueReference": {
        "reference": "Patient/1fc644e1-b7a2-4806-a57b-d48a31690493"
      }
    },
    {
      "url": "http://electronichealth.se/fhir/StructureDefinition/NLLDataLockType",
      "valueCoding": {
        "system": "http://electronichealth.se/fhir/ValueSet/data-lock-type",
        "code": "INTEGRITET"
      }
    },
    {
      "url": "http://electronichealth.se/fhir/StructureDefinition/NLLLockedSubjectType",
      "valueCoding": {
        "system": "http://electronichealth.se/fhir/ValueSet/locked-subject",
        "code": "FORSKRIVNINGSKEDJA"
      }
    }
  ],
  "code": {
    "text": "NLLDataLock"
  }
}

Example 2 - Create secrecy data lock

This example shows how to create a data lock for a given prescription chain where the treatment reason should locked, hence not shared with, the patient. The data lock type should then be set to SEKRETESS and the locked subject be defined as BEHANDLINGSORSAK.

Header: required authorization and provenance information

Parameter Mandatory Comment
Authorization Yes Bearer [valid OAuth2 token]
X-Access N/A -
X-Purpose N/A -
X-Provenance Yes Must be provided with information as described below. Note: The provenance object must be base64 encoded
activity.coding.code SEKRETESS_PAT
author/enterer Author and (if applicable) enterer

Provenance (to be provided in the header)

{
  "resourceType": "Basic",
  "meta": {
    "profile": [
      "http://electronichealth.se/fhir/StructureDefinition/NLLDataLock"
    ]
  },
  "extension": [
    {
      "url": "http://electronichealth.se/fhir/StructureDefinition/NLLDataLockTarget",
      "valueReference": {
        "reference": "Patient/1fc644e1-b7a2-4806-a57b-d48a31690493"
      }
    },
    {
      "url": "http://electronichealth.se/fhir/StructureDefinition/NLLDataLockType",
      "valueCoding": {
        "system": "http://electronichealth.se/fhir/ValueSet/data-lock-type",
        "code": "SEKRETESS"
      }
    },
    {
      "url": "http://electronichealth.se/fhir/StructureDefinition/NLLLockedSubjectType",
      "valueCoding": {
        "system": "http://electronichealth.se/fhir/ValueSet/locked-subject",
        "code": "BEHANDLINGSORSAK"
      }
    }
  ],
  "code": {
    "text": "NLLDataLock"
  }
}